From 3f4311ff1ca74e1971b9839e137ecd3e228b4711 Mon Sep 17 00:00:00 2001 From: L-Sun Date: Fri, 24 Jan 2025 08:23:24 +0000 Subject: [PATCH] chore(editor): add RTL experiement flag for editor (#9882) --- .../block-suite-editor/blocksuite-editor-container.tsx | 5 +++++ .../frontend/core/src/modules/feature-flag/constant.ts | 9 +++++++++ packages/frontend/i18n/src/resources/en.json | 2 ++ 3 files changed, 16 insertions(+) diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx index bd0b97ab6..a35f4adab 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx @@ -1,3 +1,4 @@ +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { type DocMode, getLastNoteBlock } from '@blocksuite/affine/blocks'; import { Slot } from '@blocksuite/affine/global/utils'; import type { @@ -7,6 +8,7 @@ import type { PageEditor, } from '@blocksuite/affine/presets'; import { type Store } from '@blocksuite/affine/store'; +import { useLiveData, useService } from '@toeverything/infra'; import clsx from 'clsx'; import type React from 'react'; import { @@ -49,6 +51,8 @@ export const BlocksuiteEditorContainer = forwardRef< const docRef = useRef(null); const docTitleRef = useRef(null); const edgelessRef = useRef(null); + const featureFlags = useService(FeatureFlagService).flags; + const enableEditorRTL = useLiveData(featureFlags.enable_editor_rtl.$); const slots: BlocksuiteEditorContainerRef['slots'] = useMemo(() => { return { @@ -157,6 +161,7 @@ export const BlocksuiteEditorContainer = forwardRef< return (