diff --git a/plugins/text-editor-resources/src/components/CollaborativeTextEditor.svelte b/plugins/text-editor-resources/src/components/CollaborativeTextEditor.svelte index 1f251fa8652..1fab4a851e7 100644 --- a/plugins/text-editor-resources/src/components/CollaborativeTextEditor.svelte +++ b/plugins/text-editor-resources/src/components/CollaborativeTextEditor.svelte @@ -28,7 +28,7 @@ makeDocCollabId, type Ref } from '@hcengineering/core' - import { IntlString, translate } from '@hcengineering/platform' + import { IntlString } from '@hcengineering/platform' import { DrawingCmd, getAttribute, @@ -88,7 +88,9 @@ export let buttonSize: IconSize = 'small' export let actionsButtonSize: IconSize = 'medium' export let full: boolean = false + export let placeholder: IntlString = textEditor.string.EditorPlaceholder + export let placeholderParams: Record = {} export let refActions: RefAction[] = [] @@ -143,21 +145,6 @@ let element: HTMLElement let editorPopupContainer: HTMLElement - let placeHolderStr: string = '' - - $: ph = translate(placeholder, {}, $themeStore.language).then((r) => { - if (editor !== undefined && placeHolderStr !== r) { - const placeholderIndex = editor.extensionManager.extensions.findIndex( - (extension) => extension.name === 'placeholder' - ) - if (placeholderIndex !== -1) { - editor.extensionManager.extensions[placeholderIndex].options.placeholder = r - editor.view.dispatch(editor.state.tr) - } - } - placeHolderStr = r - }) - $: dispatch('editor', editor) const editorHandler: TextEditorHandler = { @@ -365,8 +352,6 @@ } onMount(async () => { - await ph - // it is recommended to wait for the local provider to be loaded // https://discuss.yjs.dev/t/initial-offline-value-of-a-shared-document/465/4 await localProvider.loaded @@ -416,7 +401,11 @@ }, inlineCommands: withInlineCommands && inlineCommandsConfig(handleLeftMenuClick, canAttachFiles ? [] : ['image']), - placeholder: { placeholder: placeHolderStr }, + placeholder: { + placeholderIntl: placeholder, + placeholderIntlParams: placeholderParams, + themeStore + }, collaboration: { collaboration: { document: ydoc, field }, collaborationCursor: { @@ -515,11 +504,6 @@
-
{#if refActions.length > 0} diff --git a/plugins/text-editor-resources/src/components/TextEditor.svelte b/plugins/text-editor-resources/src/components/TextEditor.svelte index e9495a745d2..1f88749015e 100644 --- a/plugins/text-editor-resources/src/components/TextEditor.svelte +++ b/plugins/text-editor-resources/src/components/TextEditor.svelte @@ -16,7 +16,7 @@