diff --git a/fastlane/metadata/en-US/release_notes.txt b/fastlane/metadata/en-US/release_notes.txt index 226b123f..105552dc 100644 --- a/fastlane/metadata/en-US/release_notes.txt +++ b/fastlane/metadata/en-US/release_notes.txt @@ -2,6 +2,8 @@ Enjoy toooting! This version includes following improvements and fixes: - Automatic setting detected language when tooting - Remember public timeline type selection - Show diffing of edit history +- Allow hiding boosts and replies in home timeline +- Support toot in RTL languages - Added notification for admins - Fix whole word filter matching - Fix tablet cannot delete toot drafts \ No newline at end of file diff --git a/fastlane/metadata/zh-Hans/release_notes.txt b/fastlane/metadata/zh-Hans/release_notes.txt index 7ea1cc90..72d449ae 100644 --- a/fastlane/metadata/zh-Hans/release_notes.txt +++ b/fastlane/metadata/zh-Hans/release_notes.txt @@ -2,6 +2,8 @@ toooting愉快!此版本包括以下改进和修复: - 自动识别发嘟语言 - 记住上次公共时间轴选项 - 显示编辑历史的差异 +- 关注列表可隐藏转嘟和回复 - 新增管理员推送通知 +- 支持嘟文右到左文字 - 修复过滤整词功能 - 修复平板不能删除草稿 \ No newline at end of file diff --git a/package.json b/package.json index 348bc21d..7ca20343 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "react-redux": "^8.0.5", "redux-persist": "^6.0.0", "rn-placeholder": "^3.0.3", + "rtl-detect": "^1.0.4", "valid-url": "^1.0.9", "zeego": "^0.5.0" }, diff --git a/src/@types/untyped.d.ts b/src/@types/untyped.d.ts index 25b5f1b1..ad27df89 100644 --- a/src/@types/untyped.d.ts +++ b/src/@types/untyped.d.ts @@ -3,6 +3,7 @@ declare module 'htmlparser2-without-node-native' declare module 'react-native-feather' declare module 'react-native-htmlview' declare module 'react-native-toast-message' +declare module 'rtl-detect' declare module '@helpers/features' { const features: { feature: string; version: number; reference?: string }[] diff --git a/src/components/Parse/HTML.tsx b/src/components/Parse/HTML.tsx index 1867ed89..e651a66e 100644 --- a/src/components/Parse/HTML.tsx +++ b/src/components/Parse/HTML.tsx @@ -13,7 +13,7 @@ import { useTheme } from '@utils/styles/ThemeManager' import { isEqual } from 'lodash' import React, { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' -import { Platform, Pressable, View } from 'react-native' +import { Platform, Pressable, TextStyleIOS, View } from 'react-native' import HTMLView from 'react-native-htmlview' import { useSelector } from 'react-redux' @@ -154,6 +154,7 @@ const renderNode = ({ export interface Props { content: string size?: 'S' | 'M' | 'L' + textStyles?: TextStyleIOS adaptiveSize?: boolean emojis?: Mastodon.Emoji[] mentions?: Mastodon.Mention[] @@ -171,6 +172,7 @@ const ParseHTML = React.memo( ({ content, size = 'M', + textStyles, adaptiveSize = false, emojis, mentions, @@ -294,6 +296,7 @@ const ParseHTML = React.memo( } }} style={{ + ...textStyles, height: numberOfLines === 1 && !expanded ? 0 : undefined }} numberOfLines={ diff --git a/src/components/Timeline/Shared/Content.tsx b/src/components/Timeline/Shared/Content.tsx index 85985330..d7b799da 100644 --- a/src/components/Timeline/Shared/Content.tsx +++ b/src/components/Timeline/Shared/Content.tsx @@ -2,7 +2,9 @@ import { ParseHTML } from '@components/Parse' import { getInstanceAccount } from '@utils/slices/instancesSlice' import React, { useContext } from 'react' import { useTranslation } from 'react-i18next' +import { Platform } from 'react-native' import { useSelector } from 'react-redux' +import { isRtlLang } from 'rtl-detect' import StatusContext from './Context' export interface Props { @@ -31,6 +33,11 @@ const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoi numberOfLines={999} highlighted={highlighted} disableDetails={disableDetails} + textStyles={ + Platform.OS === 'ios' && status.language && isRtlLang(status.language) + ? { writingDirection: 'rtl' } + : undefined + } /> = ({ notificationOwnToot = false, setSpoi setSpoilerExpanded={setSpoilerExpanded} highlighted={highlighted} disableDetails={disableDetails} + textStyles={ + Platform.OS === 'ios' && status.language && isRtlLang(status.language) + ? { writingDirection: 'rtl' } + : undefined + } /> ) : ( @@ -62,6 +74,11 @@ const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoi tags={status.tags} numberOfLines={highlighted || inThread ? 999 : notificationOwnToot ? 2 : undefined} disableDetails={disableDetails} + textStyles={ + Platform.OS === 'ios' && status.language && isRtlLang(status.language) + ? { writingDirection: 'rtl' } + : undefined + } /> )} diff --git a/yarn.lock b/yarn.lock index 5a678791..7e9c2df6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11339,7 +11339,7 @@ router-ips@^1.0.0: resolved "https://registry.yarnpkg.com/router-ips/-/router-ips-1.0.0.tgz#44e00858ebebc0133d58e40b2cd8a1fbb04203f5" integrity sha512-yBo6F52Un/WYioXbedBGvrKIiofbwt+4cUhdqDb9fNMJBI4D4jOy7jlxxaRVEvICPKU7xMmJDtDFR6YswX/sFQ== -rtl-detect@^1.0.2: +rtl-detect@^1.0.2, rtl-detect@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/rtl-detect/-/rtl-detect-1.0.4.tgz#40ae0ea7302a150b96bc75af7d749607392ecac6" integrity sha512-EBR4I2VDSSYr7PkBmFy04uhycIpDKp+21p/jARYXlCSjQksTBQcJ0HFUPOO79EPPH5JS6VAhiIQbycf0O3JAxQ==