@dxos/react-ui-editor 0.3.9-main.7cfe653 → 0.3.9-main.88fb1d9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +134 -14
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/automerge/automerge-plugin/index.d.ts +1 -1
- package/dist/types/src/automerge/automerge-plugin/index.d.ts.map +1 -1
- package/dist/types/src/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/components/Editor/Editor.stories.d.ts +3 -2
- package/dist/types/src/components/Editor/Editor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Markdown.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Markdown.stories.d.ts +2 -1
- package/dist/types/src/components/Markdown/Markdown.stories.d.ts.map +1 -1
- package/dist/types/src/components/RichText/RichText.stories.d.ts +2 -1
- package/dist/types/src/components/RichText/RichText.stories.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.d.ts +39 -0
- package/dist/types/src/components/TextEditor/TextEditor.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts +18 -0
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/index.d.ts +5 -0
- package/dist/types/src/components/TextEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/theme.d.ts +8 -0
- package/dist/types/src/components/TextEditor/theme.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/testing/replicator.d.ts.map +1 -1
- package/package.json +19 -17
- package/src/automerge/automerge-plugin/index.ts +1 -1
- package/src/automerge/automerge.stories.tsx +1 -2
- package/src/components/Editor/Editor.stories.tsx +4 -2
- package/src/components/Editor/Editor.tsx +2 -2
- package/src/components/Markdown/Markdown.stories.tsx +3 -0
- package/src/components/Markdown/Markdown.tsx +12 -8
- package/src/components/RichText/RichText.stories.tsx +2 -0
- package/src/components/TextEditor/TextEditor.stories.tsx +33 -0
- package/src/components/TextEditor/TextEditor.tsx +130 -0
- package/src/components/TextEditor/index.ts +9 -0
- package/src/components/TextEditor/theme.ts +29 -0
- package/src/components/index.ts +1 -0
- package/src/testing/replicator.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytes":2630,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytes":15633,"imports":[{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/yjs/index.ts":{"bytes":576,"imports":[{"path":"packages/ui/react-ui-editor/src/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/model.ts":{"bytes":5003,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytes":4139,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytes":5365,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytes":1040,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytes":560,"imports":[{"path":"packages/ui/react-ui-editor/src/styles/markdown.ts","kind":"import-statement","original":"./markdown"},{"path":"packages/ui/react-ui-editor/src/styles/tokens.ts","kind":"import-statement","original":"./tokens"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts":{"bytes":27479,"imports":[{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytes":22845,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts","kind":"import-statement","original":"./markdownTheme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/index.ts":{"bytes":487,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx","kind":"import-statement","original":"./Markdown"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytes":17944,"imports":[{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"../../yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytes":487,"imports":[{"path":"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx","kind":"import-statement","original":"./RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Editor/Editor.tsx":{"bytes":3808,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"../../model"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"../Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"../RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Editor/index.ts":{"bytes":483,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Editor/Editor.tsx","kind":"import-statement","original":"./Editor"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":652,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Editor/index.ts","kind":"import-statement","original":"./Editor"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"./Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"./RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1026,"imports":[{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"./model"},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":52229},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"lib0/random","kind":"import-statement","external":true},{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"exports":["Doc","Editor","EditorModes","MarkdownEditor","RichTextEditor","TextKind","YText","YXmlFragment","useTextModel"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/components/Editor/Editor.tsx":{"bytesInOutput":574},"packages/ui/react-ui-editor/src/model.ts":{"bytesInOutput":619},"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytesInOutput":3760},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytesInOutput":5580},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytesInOutput":891},"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts":{"bytesInOutput":6808},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":1297},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytesInOutput":94},"packages/ui/react-ui-editor/src/components/Markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytesInOutput":3963},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/Editor/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":159}},"bytes":25410}}}
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytes":2630,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytes":15633,"imports":[{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/yjs/index.ts":{"bytes":576,"imports":[{"path":"packages/ui/react-ui-editor/src/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/model.ts":{"bytes":5003,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytes":4139,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytes":5365,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytes":1040,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytes":560,"imports":[{"path":"packages/ui/react-ui-editor/src/styles/markdown.ts","kind":"import-statement","original":"./markdown"},{"path":"packages/ui/react-ui-editor/src/styles/tokens.ts","kind":"import-statement","original":"./tokens"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts":{"bytes":27479,"imports":[{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytes":23206,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts","kind":"import-statement","original":"./markdownTheme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/index.ts":{"bytes":487,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx","kind":"import-statement","original":"./Markdown"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytes":17944,"imports":[{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"../../yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytes":487,"imports":[{"path":"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx","kind":"import-statement","original":"./RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Editor/Editor.tsx":{"bytes":3802,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"../../model"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"../Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"../RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Editor/index.ts":{"bytes":483,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Editor/Editor.tsx","kind":"import-statement","original":"./Editor"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/theme.ts":{"bytes":2489,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytes":11705,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytes":781,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx","kind":"import-statement","original":"./TextEditor"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":742,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Editor/index.ts","kind":"import-statement","original":"./Editor"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"./Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"./RichText"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/index.ts","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1026,"imports":[{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"./model"},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":60360},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"lib0/random","kind":"import-statement","external":true},{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"exports":["Doc","Editor","EditorModes","MarkdownEditor","RichTextEditor","TextEditor","TextKind","YText","YXmlFragment","defaultStyles","tags","useTextModel"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/components/Editor/Editor.tsx":{"bytesInOutput":572},"packages/ui/react-ui-editor/src/model.ts":{"bytesInOutput":619},"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytesInOutput":3760},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytesInOutput":5665},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytesInOutput":891},"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts":{"bytesInOutput":6808},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":1297},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytesInOutput":94},"packages/ui/react-ui-editor/src/components/Markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytesInOutput":3963},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/Editor/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytesInOutput":50},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytesInOutput":2858},"packages/ui/react-ui-editor/src/components/TextEditor/theme.ts":{"bytesInOutput":421},"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":159}},"bytes":29150}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../src/automerge/automerge.stories.tsx"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../src/automerge/automerge.stories.tsx"],"names":[],"mappings":";;;AAiGA,wBAEE;AAEF,eAAO,MAAM,WAAW;;CAEvB,CAAC"}
|
|
@@ -4,13 +4,14 @@ declare const _default: {
|
|
|
4
4
|
component: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("../..").UseTextModelOptions & {
|
|
5
5
|
slots?: import("../..").EditorSlots | undefined;
|
|
6
6
|
} & React.RefAttributes<import("..").MarkdownEditorRef | import("@tiptap/react").Editor>>>;
|
|
7
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
8
|
};
|
|
8
9
|
export default _default;
|
|
9
10
|
export declare const Markdown: {
|
|
10
11
|
render: (args: {
|
|
11
12
|
id: number;
|
|
12
13
|
}) => JSX.Element;
|
|
13
|
-
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-
|
|
14
|
+
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-0fc72a6d").R, any>[];
|
|
14
15
|
};
|
|
15
16
|
export declare const Rich: {
|
|
16
17
|
render: (args: {
|
|
@@ -23,6 +24,6 @@ export declare const Rich: {
|
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
|
-
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-
|
|
27
|
+
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-0fc72a6d").R, any>[];
|
|
27
28
|
};
|
|
28
29
|
//# sourceMappingURL=Editor.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Editor/Editor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Editor/Editor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;;;AAYxC,wBAGE;AAoCF,eAAO,MAAM,QAAQ;mBACJ;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;;CAE9B,CAAC;AAWF,eAAO,MAAM,IAAI;mBACA;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;;;;;;;;;CAS9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/Markdown.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAc,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAUL,UAAU,EACX,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAQN,MAAM,OAAO,CAAC;AAUf,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEj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AAiB,GAAG;IAC9B,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,+FA4I1B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import '@dxosTheme';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
component: React.ForwardRefExoticComponent<import("./Markdown").MarkdownEditorProps & React.RefAttributes<import("./Markdown").MarkdownEditorRef>>;
|
|
5
|
+
decorators: import("@storybook/react").Decorator[];
|
|
5
6
|
};
|
|
6
7
|
export default _default;
|
|
7
8
|
export declare const Default: {
|
|
@@ -14,6 +15,6 @@ export declare const Default: {
|
|
|
14
15
|
};
|
|
15
16
|
export declare const WithYjs: {
|
|
16
17
|
render: () => JSX.Element;
|
|
17
|
-
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-
|
|
18
|
+
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-0fc72a6d").R, any>[];
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=Markdown.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/Markdown.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"Markdown.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/Markdown.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;AAWxC,wBAGE;AAEF,eAAO,MAAM,OAAO;;;;;;;CAOnB,CAAC;AAIF,eAAO,MAAM,OAAO;;;CAyBnB,CAAC"}
|
|
@@ -9,6 +9,7 @@ declare const _default: {
|
|
|
9
9
|
} & {
|
|
10
10
|
slots?: import("../..").EditorSlots | undefined;
|
|
11
11
|
} & React.RefAttributes<import("@tiptap/react").Editor | null>>;
|
|
12
|
+
decorators: import("@storybook/react").Decorator[];
|
|
12
13
|
};
|
|
13
14
|
export default _default;
|
|
14
15
|
export declare const Default: {
|
|
@@ -21,6 +22,6 @@ export declare const Default: {
|
|
|
21
22
|
};
|
|
22
23
|
export declare const WithYjs: {
|
|
23
24
|
render: (args: Omit<RichTextEditorProps, 'model'>) => JSX.Element;
|
|
24
|
-
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-
|
|
25
|
+
decorators: import("@storybook/csf").DecoratorFunction<import("@storybook/react/dist/types-0fc72a6d").R, any>[];
|
|
25
26
|
};
|
|
26
27
|
//# sourceMappingURL=RichText.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/RichText/RichText.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RichText.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/RichText/RichText.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;;;;;;;;;;;AAGtE,wBAGE;AAEF,eAAO,MAAM,OAAO;;;;;;;CAOnB,CAAC;AAGF,eAAO,MAAM,OAAO;mBACH,KAAK,mBAAmB,EAAE,OAAO,CAAC;;CAmClD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { EditorState, type Extension } from '@codemirror/state';
|
|
2
|
+
import { EditorView } from '@codemirror/view';
|
|
3
|
+
import React, { type KeyboardEvent, type HTMLAttributes } from 'react';
|
|
4
|
+
import { type StyleSpec } from 'style-mod';
|
|
5
|
+
import { type EditorModel, type EditorSlots } from '../../model';
|
|
6
|
+
export type CursorInfo = {
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
line: number;
|
|
10
|
+
lines: number;
|
|
11
|
+
after?: string;
|
|
12
|
+
};
|
|
13
|
+
export type TextEditorRef = {
|
|
14
|
+
editor: HTMLDivElement | null;
|
|
15
|
+
state?: EditorState;
|
|
16
|
+
view?: EditorView;
|
|
17
|
+
};
|
|
18
|
+
export type TextEditorProps = {
|
|
19
|
+
model?: EditorModel;
|
|
20
|
+
extensions?: Extension[];
|
|
21
|
+
theme?: {
|
|
22
|
+
[selector: string]: StyleSpec;
|
|
23
|
+
};
|
|
24
|
+
slots?: EditorSlots;
|
|
25
|
+
onKeyDown?: (event: KeyboardEvent, info: CursorInfo) => void;
|
|
26
|
+
} & Pick<HTMLAttributes<HTMLDivElement>, 'onBlur' | 'onFocus'>;
|
|
27
|
+
/**
|
|
28
|
+
* Simple text editor.
|
|
29
|
+
*/
|
|
30
|
+
export declare const TextEditor: React.ForwardRefExoticComponent<{
|
|
31
|
+
model?: EditorModel | undefined;
|
|
32
|
+
extensions?: Extension[] | undefined;
|
|
33
|
+
theme?: {
|
|
34
|
+
[selector: string]: StyleSpec;
|
|
35
|
+
} | undefined;
|
|
36
|
+
slots?: EditorSlots | undefined;
|
|
37
|
+
onKeyDown?: ((event: KeyboardEvent, info: CursorInfo) => void) | undefined;
|
|
38
|
+
} & Pick<React.HTMLAttributes<HTMLDivElement>, "onFocus" | "onBlur"> & React.RefAttributes<TextEditorRef>>;
|
|
39
|
+
//# sourceMappingURL=TextEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/TextEditor.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;A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: React.ForwardRefExoticComponent<{
|
|
5
|
+
model?: import("../../model").EditorModel | undefined;
|
|
6
|
+
extensions?: import("@codemirror/state").Extension[] | undefined;
|
|
7
|
+
theme?: {
|
|
8
|
+
[selector: string]: import("style-mod").StyleSpec;
|
|
9
|
+
} | undefined;
|
|
10
|
+
slots?: import("../../model").EditorSlots | undefined;
|
|
11
|
+
onKeyDown?: ((event: React.KeyboardEvent<Element>, info: import("./TextEditor").CursorInfo) => void) | undefined;
|
|
12
|
+
} & Pick<React.HTMLAttributes<HTMLDivElement>, "onFocus" | "onBlur"> & React.RefAttributes<import("./TextEditor").TextEditorRef>>;
|
|
13
|
+
decorators: import("@storybook/react").Decorator[];
|
|
14
|
+
render: () => JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
17
|
+
export declare const Default: {};
|
|
18
|
+
//# sourceMappingURL=TextEditor.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/TextEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AACpB,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;;;;;;;;;;AAqBxC,wBAIE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/theme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAM3C;;GAEG;AAEH,eAAO,MAAM,aAAa,EAAE;IAC1B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAY/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replicator.d.ts","sourceRoot":"","sources":["../../../../src/testing/replicator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,KAAK,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;AAM7C;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,GAAG,CAAC;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAM;gBAEf,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC,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,GAAG,CAAC;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAM;gBAEf,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAAC,GAAG,EAAE,GAAG,CAAC;QAAC,SAAS,CAAC,EAAE,SAAS,CAAA;KAAE;IA+BtG,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,YAAY;IA0CpB,OAAO,CAAC,mBAAmB;CAG5B;AAED;;GAEG;AACH,qBAAa,UAAU;IAIT,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IACnD,OAAO,CAAC,MAAM,CAAqB;gBAEN,KAAK,EAAE,QAAQ;IAE5C,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE;IAI7B,UAAU,OAAQ,MAAM,QAAO,GAAG,KAAe,WAAW,CAmB1D;CACH;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,WAAW,4BAA6B,kBAAkB,KAAG,WAGzE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-editor",
|
|
3
|
-
"version": "0.3.9-main.
|
|
3
|
+
"version": "0.3.9-main.88fb1d9",
|
|
4
4
|
"description": "Document editing experience within a DXOS shell.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -43,19 +43,20 @@
|
|
|
43
43
|
"prosemirror-model": "^1.19.0",
|
|
44
44
|
"prosemirror-state": "^1.4.2",
|
|
45
45
|
"prosemirror-view": "^1.30.1",
|
|
46
|
+
"style-mod": "^4.1.0",
|
|
46
47
|
"y-codemirror.next": "^0.3.2",
|
|
47
48
|
"y-prosemirror": "~1.0.20",
|
|
48
49
|
"y-protocols": "^1.0.5",
|
|
49
|
-
"yjs": "^13.6.
|
|
50
|
-
"@dxos/debug": "0.3.9-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/display-name": "0.3.9-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-async": "0.3.9-main.
|
|
55
|
-
"@dxos/react-ui": "0.3.9-main.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/util": "0.3.9-main.
|
|
50
|
+
"yjs": "^13.6.10",
|
|
51
|
+
"@dxos/debug": "0.3.9-main.88fb1d9",
|
|
52
|
+
"@dxos/log": "0.3.9-main.88fb1d9",
|
|
53
|
+
"@dxos/display-name": "0.3.9-main.88fb1d9",
|
|
54
|
+
"@dxos/protocols": "0.3.9-main.88fb1d9",
|
|
55
|
+
"@dxos/react-async": "0.3.9-main.88fb1d9",
|
|
56
|
+
"@dxos/react-ui": "0.3.9-main.88fb1d9",
|
|
57
|
+
"@dxos/react-ui-theme": "0.3.9-main.88fb1d9",
|
|
58
|
+
"@dxos/text-model": "0.3.9-main.88fb1d9",
|
|
59
|
+
"@dxos/util": "0.3.9-main.88fb1d9"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@codemirror/basic-setup": "^0.20.0",
|
|
@@ -65,16 +66,17 @@
|
|
|
65
66
|
"@types/react-dom": "^18.0.6",
|
|
66
67
|
"react": "^18.2.0",
|
|
67
68
|
"react-dom": "^18.2.0",
|
|
68
|
-
"@dxos/config": "0.3.9-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/echo-
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
69
|
+
"@dxos/config": "0.3.9-main.88fb1d9",
|
|
70
|
+
"@dxos/automerge": "0.3.9-main.88fb1d9",
|
|
71
|
+
"@dxos/echo-schema": "0.3.9-main.88fb1d9",
|
|
72
|
+
"@dxos/echo-typegen": "0.3.9-main.88fb1d9",
|
|
73
|
+
"@dxos/storybook-utils": "0.3.9-main.88fb1d9",
|
|
74
|
+
"@dxos/react-client": "0.3.9-main.88fb1d9"
|
|
73
75
|
},
|
|
74
76
|
"peerDependencies": {
|
|
75
77
|
"react": "^18.2.0",
|
|
76
78
|
"react-dom": "^18.2.0",
|
|
77
|
-
"@dxos/react-client": "0.3.9-main.
|
|
79
|
+
"@dxos/react-client": "0.3.9-main.88fb1d9"
|
|
78
80
|
},
|
|
79
81
|
"publishConfig": {
|
|
80
82
|
"access": "public"
|
|
@@ -8,8 +8,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { type Prop, next as automerge } from '@dxos/automerge/automerge';
|
|
10
10
|
|
|
11
|
-
import { plugin as amgPlugin } from './automerge-plugin';
|
|
12
|
-
import { reconcile } from './automerge-plugin/plugin';
|
|
11
|
+
import { plugin as amgPlugin, reconcile } from './automerge-plugin';
|
|
13
12
|
import { Peer } from './demo';
|
|
14
13
|
|
|
15
14
|
type EditorProps = {
|
|
@@ -11,15 +11,17 @@ import { TextObject, TextKind, useQuery, useSpace } from '@dxos/react-client/ech
|
|
|
11
11
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
12
12
|
import { ClientDecorator, setupPeersInSpace, textGenerator, useDataGenerator } from '@dxos/react-client/testing';
|
|
13
13
|
import { useId } from '@dxos/react-ui';
|
|
14
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
14
15
|
|
|
15
16
|
import { Editor, type EditorProps } from './Editor';
|
|
16
17
|
import { EditorDocument, types as schema } from '../../testing';
|
|
17
18
|
|
|
18
19
|
export default {
|
|
19
20
|
component: Editor,
|
|
21
|
+
decorators: [withTheme],
|
|
20
22
|
};
|
|
21
23
|
|
|
22
|
-
const Story = ({ spaceKey, ...
|
|
24
|
+
const Story = ({ spaceKey, ...params }: Pick<EditorProps, 'slots'> & { spaceKey: PublicKey }) => {
|
|
23
25
|
const [generate, setGenerate] = useState(false);
|
|
24
26
|
const generateId = useId('generate');
|
|
25
27
|
|
|
@@ -39,7 +41,7 @@ const Story = ({ spaceKey, ...args }: Pick<EditorProps, 'slots'> & { spaceKey: P
|
|
|
39
41
|
Generate Data
|
|
40
42
|
</div>
|
|
41
43
|
{document?.content.toString().length}
|
|
42
|
-
<Editor identity={identity} space={space} text={document?.content} {...
|
|
44
|
+
<Editor identity={identity} space={space} text={document?.content} {...params} />
|
|
43
45
|
</main>
|
|
44
46
|
);
|
|
45
47
|
};
|
|
@@ -22,8 +22,8 @@ export type EditorProps = UseTextModelOptions & {
|
|
|
22
22
|
// NOTE: Without `memo`, if parent component uses `observer` the editor re-renders excessively.
|
|
23
23
|
// TODO(wittjosiah): Factor out?
|
|
24
24
|
export const Editor = memo(
|
|
25
|
-
forwardRef<TipTapEditor | MarkdownEditorRef, EditorProps>(({ slots, ...
|
|
26
|
-
const model = useTextModel(
|
|
25
|
+
forwardRef<TipTapEditor | MarkdownEditorRef, EditorProps>(({ slots, ...params }, forwardedRef) => {
|
|
26
|
+
const model = useTextModel(params);
|
|
27
27
|
if (model?.content instanceof YXmlFragment) {
|
|
28
28
|
return <RichTextEditor ref={forwardedRef as Ref<TipTapEditor>} model={model} slots={slots} />;
|
|
29
29
|
} else {
|
|
@@ -10,12 +10,14 @@ import { PublicKey } from '@dxos/react-client';
|
|
|
10
10
|
import { TextKind } from '@dxos/react-client/echo';
|
|
11
11
|
import { ClientDecorator, textGenerator, useDataGenerator } from '@dxos/react-client/testing';
|
|
12
12
|
import { useId } from '@dxos/react-ui';
|
|
13
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
13
14
|
|
|
14
15
|
import { MarkdownEditor } from './Markdown';
|
|
15
16
|
import { Replicator, useYjsModel } from '../../testing';
|
|
16
17
|
|
|
17
18
|
export default {
|
|
18
19
|
component: MarkdownEditor,
|
|
20
|
+
decorators: [withTheme],
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export const Default = {
|
|
@@ -28,6 +30,7 @@ export const Default = {
|
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
const replicator = new Replicator(TextKind.PLAIN);
|
|
33
|
+
|
|
31
34
|
export const WithYjs = {
|
|
32
35
|
render: () => {
|
|
33
36
|
const [generate, setGenerate] = useState(false);
|
|
@@ -68,7 +68,7 @@ export type MarkdownEditorRef = {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>(
|
|
71
|
-
({ model, slots = {},
|
|
71
|
+
({ model, slots = {}, editorMode, onChange }, forwardedRef) => {
|
|
72
72
|
const { id, content, provider, peer } = model ?? {};
|
|
73
73
|
const { themeMode } = useThemeContext();
|
|
74
74
|
const tabsterDOMAttribute = useFocusableGroup({ tabBehavior: 'limited' });
|
|
@@ -148,7 +148,8 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
|
|
|
148
148
|
indentWithTab,
|
|
149
149
|
]),
|
|
150
150
|
EditorView.lineWrapping,
|
|
151
|
-
|
|
151
|
+
|
|
152
|
+
// Themes.
|
|
152
153
|
markdown({ base: markdownLanguage, codeLanguages: languages, extensions: [markdownTagsExtension] }),
|
|
153
154
|
EditorView.theme({ ...markdownTheme, ...slots.editor?.markdownTheme }),
|
|
154
155
|
...(themeMode === 'dark'
|
|
@@ -157,7 +158,7 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
|
|
|
157
158
|
// TODO(thure): All but one rule here apply to both themes; rename or refactor.
|
|
158
159
|
syntaxHighlighting(markdownDarkHighlighting),
|
|
159
160
|
|
|
160
|
-
//
|
|
161
|
+
// Replication and awareness (incl. remote selection).
|
|
161
162
|
...(content instanceof YText ? [yCollab(content, provider?.awareness)] : []),
|
|
162
163
|
],
|
|
163
164
|
});
|
|
@@ -178,15 +179,18 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
|
|
|
178
179
|
}, [parent, content, provider?.awareness, themeMode, editorMode]);
|
|
179
180
|
|
|
180
181
|
const handleKeyUp = useCallback(
|
|
181
|
-
(
|
|
182
|
+
(event: KeyboardEvent) => {
|
|
183
|
+
const { key, altKey, shiftKey, metaKey, ctrlKey } = event;
|
|
182
184
|
switch (key) {
|
|
183
|
-
case 'Enter':
|
|
185
|
+
case 'Enter': {
|
|
184
186
|
view?.contentDOM.focus();
|
|
185
187
|
break;
|
|
188
|
+
}
|
|
186
189
|
|
|
187
|
-
case 'Escape':
|
|
190
|
+
case 'Escape': {
|
|
188
191
|
editorMode === 'vim' && (altKey || shiftKey || metaKey || ctrlKey) && parent?.focus();
|
|
189
192
|
break;
|
|
193
|
+
}
|
|
190
194
|
}
|
|
191
195
|
},
|
|
192
196
|
[view, editorMode],
|
|
@@ -195,11 +199,11 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
|
|
|
195
199
|
return (
|
|
196
200
|
<div
|
|
197
201
|
tabIndex={0}
|
|
202
|
+
ref={setParent}
|
|
198
203
|
key={id}
|
|
199
204
|
{...slots.root}
|
|
200
|
-
onKeyUp={handleKeyUp}
|
|
201
205
|
{...(editorMode !== 'vim' ? tabsterDOMAttribute : {})}
|
|
202
|
-
|
|
206
|
+
onKeyUp={handleKeyUp}
|
|
203
207
|
/>
|
|
204
208
|
);
|
|
205
209
|
},
|
|
@@ -11,12 +11,14 @@ import { TextKind } from '@dxos/react-client/echo';
|
|
|
11
11
|
import { ClientDecorator, textGenerator, useDataGenerator } from '@dxos/react-client/testing';
|
|
12
12
|
import { useId } from '@dxos/react-ui';
|
|
13
13
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
14
15
|
|
|
15
16
|
import { RichTextEditor, type RichTextEditorProps } from './RichText';
|
|
16
17
|
import { Replicator, useYjsModel } from '../../testing';
|
|
17
18
|
|
|
18
19
|
export default {
|
|
19
20
|
component: RichTextEditor,
|
|
21
|
+
decorators: [withTheme],
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export const Default = {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxosTheme';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { TextObject } from '@dxos/echo-schema';
|
|
9
|
+
import { fixedInsetFlexLayout, groupSurface, inputSurface, mx } from '@dxos/react-ui-theme';
|
|
10
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
11
|
+
|
|
12
|
+
import { TextEditor } from './TextEditor';
|
|
13
|
+
import { useTextModel } from '../../model';
|
|
14
|
+
|
|
15
|
+
const Story = () => {
|
|
16
|
+
const [item] = useState({ text: new TextObject('Hello world!') });
|
|
17
|
+
const model = useTextModel({ text: item.text });
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={mx(fixedInsetFlexLayout, groupSurface, 'p-4 gap-4')}>
|
|
21
|
+
<TextEditor model={model} slots={{ root: { className: mx(inputSurface, 'px-2') } }} />
|
|
22
|
+
<pre>{JSON.stringify(model?.content?.toString(), null, 2)}</pre>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
component: TextEditor,
|
|
29
|
+
decorators: [withTheme],
|
|
30
|
+
render: Story,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Default = {};
|