diff --git a/ng-app/src/apps/ProseMirrorEditor.svelte b/ng-app/src/apps/ProseMirrorEditor.svelte index aa817e6..fd838ee 100644 --- a/ng-app/src/apps/ProseMirrorEditor.svelte +++ b/ng-app/src/apps/ProseMirrorEditor.svelte @@ -24,6 +24,7 @@ cur_tab_deregister_on_save, cur_tab_branch_class } from "../tab"; + import { t } from "svelte-i18n"; import * as Y from 'yjs' // @ts-ignore @@ -38,6 +39,8 @@ const ydoc = new Y.Doc() const yxml = ydoc.getXmlFragment('ng') + let view; + ydoc.on('update', async (update, origin) => { console.log(update,origin); if (!origin.local) { @@ -82,6 +85,8 @@ for (const h of history) { Y.applyUpdate(ydoc, h.YXml, {local:true}) } + view.focus() + }); onDestroy(()=>{ @@ -94,6 +99,8 @@ className="prosemirror-editor" {editorState} debounceChangeEventsInterval=2000 + placeholder={$t("doc.type_your_text_here")} + bind:view={view} /> \ No newline at end of file diff --git a/ng-app/src/apps/ProseMirrorViewer.svelte b/ng-app/src/apps/ProseMirrorViewer.svelte index a8915fb..9827107 100644 --- a/ng-app/src/apps/ProseMirrorViewer.svelte +++ b/ng-app/src/apps/ProseMirrorViewer.svelte @@ -68,6 +68,7 @@