@dxos/react-ui-editor 0.3.10-main.f916973 → 0.3.10-next.5353ed8
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 +25 -111
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/TextEditor/MarkdownEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/extensions/comments.d.ts +6 -10
- package/dist/types/src/components/TextEditor/extensions/comments.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/extensions/index.d.ts +0 -1
- package/dist/types/src/components/TextEditor/extensions/index.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/extensions/listener.d.ts +2 -4
- package/dist/types/src/components/TextEditor/extensions/listener.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/components/TextEditor/MarkdownEditor.stories.tsx +2 -4
- package/src/components/TextEditor/TextEditor.tsx +4 -18
- package/src/components/TextEditor/extensions/comments.ts +31 -48
- package/src/components/TextEditor/extensions/index.ts +0 -1
- package/src/components/TextEditor/extensions/listener.ts +2 -2
- package/dist/types/src/components/TextEditor/extensions/demo.d.ts +0 -10
- package/dist/types/src/components/TextEditor/extensions/demo.d.ts.map +0 -1
- package/src/components/TextEditor/extensions/demo.ts +0 -66
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts":{"bytes":7096,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic.ts":{"bytes":3373,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/demo.ts":{"bytes":6009,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/comments.ts":{"bytes":18590,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/link.ts":{"bytes":19200,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/listener.ts":{"bytes":2106,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytes":6320,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytes":1192,"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/TextEditor/extensions/markdown/highlight.ts":{"bytes":15930,"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/styles/index.ts","kind":"import-statement","original":"../../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytes":10072,"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/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":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts","kind":"import-statement","original":"./highlight"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts":{"bytes":596,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts","kind":"import-statement","original":"./bundle"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts","kind":"import-statement","original":"./highlight"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tasklist.ts":{"bytes":10575,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tooltip.tsx":{"bytes":5580,"imports":[{"path":"@codemirror/view","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/extensions/index.ts":{"bytes":1188,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts","kind":"import-statement","original":"./autocomplete"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic.ts","kind":"import-statement","original":"./basic"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/demo.ts","kind":"import-statement","original":"./demo"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/comments.ts","kind":"import-statement","original":"./comments"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/link.ts","kind":"import-statement","original":"./link"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/listener.ts","kind":"import-statement","original":"./listener"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts","kind":"import-statement","original":"./markdown"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tasklist.ts","kind":"import-statement","original":"./tasklist"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tooltip.tsx","kind":"import-statement","original":"./tooltip"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/themes/default.ts":{"bytes":15385,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts":{"bytes":495,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/themes/default.ts","kind":"import-statement","original":"./default"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytes":20623,"imports":[{"path":"@codemirror/state","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":"lodash.defaultsdeep","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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts","kind":"import-statement","original":"./themes"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytes":892,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts","kind":"import-statement","original":"./themes"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":484,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/index.ts","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/amToCodemirror.ts":{"bytes":11060,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/codeMirrorToAm.ts":{"bytes":3912,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/PatchSemaphore.ts":{"bytes":8482,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/amToCodemirror.ts","kind":"import-statement","original":"./amToCodemirror"},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/codeMirrorToAm.ts","kind":"import-statement","original":"./codeMirrorToAm"},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts":{"bytes":13082,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/PatchSemaphore.ts","kind":"import-statement","original":"./PatchSemaphore"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/index.ts":{"bytes":651,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytes":2636,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytes":15639,"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/hooks/yjs/index.ts":{"bytes":582,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytes":9937,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/index.ts","kind":"import-statement","original":"./automerge"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytes":564,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/useTextModel.ts","kind":"import-statement","original":"./useTextModel"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1026,"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":102925},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/state","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/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":"@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":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@codemirror/state","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":"lodash.defaultsdeep","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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","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}],"exports":["BaseTextEditor","Doc","EditorModes","MarkdownEditor","SpaceAwarenessProvider","TextEditor","TextKind","YText","YXmlFragment","autocomplete","basicBundle","codeTheme","comments","cursorColor","defaultMarkdownSlots","defaultSlots","defaultTextSlots","defaultTheme","demo","link","listener","markdownBundle","markdownHighlightStyle","markdownTags","markdownTagsExtension","markdownTheme","tags","tasklist","textTheme","tooltip","useTextModel"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":132},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytesInOutput":50},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts":{"bytesInOutput":1098},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic.ts":{"bytesInOutput":738},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/demo.ts":{"bytesInOutput":1335},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/comments.ts":{"bytesInOutput":3575},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/link.ts":{"bytesInOutput":2573},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/listener.ts":{"bytesInOutput":300},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytesInOutput":2731},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts":{"bytesInOutput":3415},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":1029},"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/TextEditor/extensions/markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tasklist.ts":{"bytesInOutput":2416},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tooltip.tsx":{"bytesInOutput":1033},"packages/ui/react-ui-editor/src/components/TextEditor/themes/default.ts":{"bytesInOutput":4060},"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytesInOutput":4492},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytesInOutput":2039},"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts":{"bytesInOutput":2340},"packages/ui/react-ui-editor/src/hooks/automerge/PatchSemaphore.ts":{"bytesInOutput":1519},"packages/ui/react-ui-editor/src/hooks/automerge/amToCodemirror.ts":{"bytesInOutput":2412},"packages/ui/react-ui-editor/src/hooks/automerge/codeMirrorToAm.ts":{"bytesInOutput":644},"packages/ui/react-ui-editor/src/hooks/automerge/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/hooks/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytesInOutput":3769},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytesInOutput":0}},"bytes":44894}}}
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts":{"bytes":7096,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic.ts":{"bytes":3373,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/comments.ts":{"bytes":16512,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/link.ts":{"bytes":19200,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/listener.ts":{"bytes":2046,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytes":6320,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytes":1192,"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/TextEditor/extensions/markdown/highlight.ts":{"bytes":15930,"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/styles/index.ts","kind":"import-statement","original":"../../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytes":10072,"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/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":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts","kind":"import-statement","original":"./highlight"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts":{"bytes":596,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts","kind":"import-statement","original":"./bundle"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts","kind":"import-statement","original":"./highlight"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tasklist.ts":{"bytes":10575,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tooltip.tsx":{"bytes":5580,"imports":[{"path":"@codemirror/view","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/extensions/index.ts":{"bytes":1112,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts","kind":"import-statement","original":"./autocomplete"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic.ts","kind":"import-statement","original":"./basic"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/comments.ts","kind":"import-statement","original":"./comments"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/link.ts","kind":"import-statement","original":"./link"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/listener.ts","kind":"import-statement","original":"./listener"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts","kind":"import-statement","original":"./markdown"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tasklist.ts","kind":"import-statement","original":"./tasklist"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tooltip.tsx","kind":"import-statement","original":"./tooltip"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/themes/default.ts":{"bytes":15385,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts":{"bytes":495,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/themes/default.ts","kind":"import-statement","original":"./default"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytes":19485,"imports":[{"path":"@codemirror/state","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":"lodash.defaultsdeep","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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts","kind":"import-statement","original":"./themes"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytes":892,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts","kind":"import-statement","original":"./themes"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":484,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/index.ts","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/amToCodemirror.ts":{"bytes":11060,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/codeMirrorToAm.ts":{"bytes":3912,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/PatchSemaphore.ts":{"bytes":8482,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/amToCodemirror.ts","kind":"import-statement","original":"./amToCodemirror"},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/codeMirrorToAm.ts","kind":"import-statement","original":"./codeMirrorToAm"},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts":{"bytes":13082,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/PatchSemaphore.ts","kind":"import-statement","original":"./PatchSemaphore"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/automerge/index.ts":{"bytes":651,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytes":2636,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytes":15639,"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/hooks/yjs/index.ts":{"bytes":582,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytes":9937,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/automerge/index.ts","kind":"import-statement","original":"./automerge"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytes":564,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/useTextModel.ts","kind":"import-statement","original":"./useTextModel"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1026,"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":98508},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/state","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/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":"@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":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@codemirror/state","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":"lodash.defaultsdeep","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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","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}],"exports":["BaseTextEditor","Doc","EditorModes","MarkdownEditor","SpaceAwarenessProvider","TextEditor","TextKind","YText","YXmlFragment","autocomplete","basicBundle","codeTheme","comments","cursorColor","defaultMarkdownSlots","defaultSlots","defaultTextSlots","defaultTheme","link","listener","markdownBundle","markdownHighlightStyle","markdownTags","markdownTagsExtension","markdownTheme","tags","tasklist","textTheme","tooltip","useTextModel"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":132},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytesInOutput":50},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts":{"bytesInOutput":1098},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic.ts":{"bytesInOutput":738},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/comments.ts":{"bytesInOutput":3165},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/link.ts":{"bytesInOutput":2573},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/listener.ts":{"bytesInOutput":296},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytesInOutput":2731},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts":{"bytesInOutput":3415},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":1029},"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/TextEditor/extensions/markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tasklist.ts":{"bytesInOutput":2416},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/tooltip.tsx":{"bytesInOutput":1033},"packages/ui/react-ui-editor/src/components/TextEditor/themes/default.ts":{"bytesInOutput":4060},"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytesInOutput":4276},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytesInOutput":2039},"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts":{"bytesInOutput":2340},"packages/ui/react-ui-editor/src/hooks/automerge/PatchSemaphore.ts":{"bytesInOutput":1519},"packages/ui/react-ui-editor/src/hooks/automerge/amToCodemirror.ts":{"bytesInOutput":2412},"packages/ui/react-ui-editor/src/hooks/automerge/codeMirrorToAm.ts":{"bytesInOutput":644},"packages/ui/react-ui-editor/src/hooks/automerge/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/hooks/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytesInOutput":3769},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytesInOutput":0}},"bytes":42844}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/MarkdownEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAIpB,OAAO,KAAuC,MAAM,OAAO,CAAC;AAQ5D,OAAO,EAAkB,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;AAoKxF,wBAKE;AAEF,eAAO,MAAM,OAAO;;CAcnB,CAAC;AAEF,eAAO,MAAM,MAAM;;CAElB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAEpB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,eAAO,MAAM,QAAQ;;
|
|
1
|
+
{"version":3,"file":"MarkdownEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/MarkdownEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAIpB,OAAO,KAAuC,MAAM,OAAO,CAAC;AAQ5D,OAAO,EAAkB,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;AAoKxF,wBAKE;AAEF,eAAO,MAAM,OAAO;;CAcnB,CAAC;AAEF,eAAO,MAAM,MAAM;;CAElB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAEpB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAYpB,CAAC;AAEF,eAAO,MAAM,YAAY;;CAYxB,CAAC;AAGF,eAAO,MAAM,QAAQ;;CAcpB,CAAC;AAEF,eAAO,MAAM,WAAW;;CAYvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/TextEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,OAAO,KAAK,EAAE,EACZ,KAAK,cAAc,EAOpB,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,WAAW,6BAA8B,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,uFA0F1B,CAAC;
|
|
1
|
+
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/TextEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,OAAO,KAAK,EAAE,EACZ,KAAK,cAAc,EAOpB,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,WAAW,6BAA8B,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,uFA0F1B,CAAC;AAGF,eAAO,MAAM,UAAU,uFAatB,CAAC;AAEF,eAAO,MAAM,cAAc,uFAa1B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,eAI1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eAK9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAKlC,CAAC"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
2
|
import { type Rect } from '@codemirror/view';
|
|
3
|
-
type CommentsInfo = {
|
|
4
|
-
active?: string;
|
|
5
|
-
items: {
|
|
6
|
-
id: string;
|
|
7
|
-
pos: number;
|
|
8
|
-
location: Rect | null;
|
|
9
|
-
}[];
|
|
10
|
-
};
|
|
11
3
|
export type CommentsOptions = {
|
|
12
4
|
key?: string;
|
|
13
5
|
onCreate?: () => string | void;
|
|
14
|
-
onUpdate?: (info:
|
|
6
|
+
onUpdate?: (info: {
|
|
7
|
+
items: string[];
|
|
8
|
+
active: string;
|
|
9
|
+
pos: number;
|
|
10
|
+
location: Rect;
|
|
11
|
+
}) => void;
|
|
15
12
|
};
|
|
16
13
|
export declare const comments: (options?: CommentsOptions) => Extension;
|
|
17
|
-
export {};
|
|
18
14
|
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/comments.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/comments.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAML,KAAK,IAAI,EAIV,MAAM,kBAAkB,CAAC;AAmD1B,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE,KAAK,IAAI,CAAC;CAC7F,CAAC;AAKF,eAAO,MAAM,QAAQ,aAAa,eAAe,KAAQ,SAiGxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { StateField } from '@codemirror/state';
|
|
2
|
-
export type
|
|
3
|
-
onChange: (text: string) => void;
|
|
4
|
-
};
|
|
2
|
+
export type TextListener = (text: string) => void;
|
|
5
3
|
/**
|
|
6
4
|
* Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799
|
|
7
5
|
*/
|
|
8
|
-
export declare const listener: (
|
|
6
|
+
export declare const listener: (onChange: TextListener) => StateField<null>;
|
|
9
7
|
//# sourceMappingURL=listener.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/listener.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/listener.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAElD;;GAEG;AAEH,eAAO,MAAM,QAAQ,aAAc,YAAY,qBAU3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-editor",
|
|
3
|
-
"version": "0.3.10-
|
|
3
|
+
"version": "0.3.10-next.5353ed8",
|
|
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",
|
|
@@ -36,19 +36,18 @@
|
|
|
36
36
|
"y-codemirror.next": "^0.3.2",
|
|
37
37
|
"y-protocols": "^1.0.5",
|
|
38
38
|
"yjs": "^13.6.10",
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/log": "0.3.10-
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/react-async": "0.3.10-
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/react-ui": "0.3.10-
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/util": "0.3.10-main.f916973"
|
|
39
|
+
"@dxos/automerge": "0.3.10-next.5353ed8",
|
|
40
|
+
"@dxos/invariant": "0.3.10-next.5353ed8",
|
|
41
|
+
"@dxos/echo-schema": "0.3.10-next.5353ed8",
|
|
42
|
+
"@dxos/display-name": "0.3.10-next.5353ed8",
|
|
43
|
+
"@dxos/debug": "0.3.10-next.5353ed8",
|
|
44
|
+
"@dxos/log": "0.3.10-next.5353ed8",
|
|
45
|
+
"@dxos/protocols": "0.3.10-next.5353ed8",
|
|
46
|
+
"@dxos/react-async": "0.3.10-next.5353ed8",
|
|
47
|
+
"@dxos/react-ui-theme": "0.3.10-next.5353ed8",
|
|
48
|
+
"@dxos/react-ui": "0.3.10-next.5353ed8",
|
|
49
|
+
"@dxos/text-model": "0.3.10-next.5353ed8",
|
|
50
|
+
"@dxos/util": "0.3.10-next.5353ed8"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@automerge/automerge-repo-network-broadcastchannel": "^1.0.19",
|
|
@@ -61,17 +60,17 @@
|
|
|
61
60
|
"@types/react-dom": "^18.0.6",
|
|
62
61
|
"react": "^18.2.0",
|
|
63
62
|
"react-dom": "^18.2.0",
|
|
64
|
-
"@dxos/echo-typegen": "0.3.10-
|
|
65
|
-
"@dxos/config": "0.3.10-
|
|
66
|
-
"@dxos/react-client": "0.3.10-
|
|
67
|
-
"@dxos/react-ui": "0.3.10-
|
|
68
|
-
"@dxos/storybook-utils": "0.3.10-
|
|
63
|
+
"@dxos/echo-typegen": "0.3.10-next.5353ed8",
|
|
64
|
+
"@dxos/config": "0.3.10-next.5353ed8",
|
|
65
|
+
"@dxos/react-client": "0.3.10-next.5353ed8",
|
|
66
|
+
"@dxos/react-ui": "0.3.10-next.5353ed8",
|
|
67
|
+
"@dxos/storybook-utils": "0.3.10-next.5353ed8"
|
|
69
68
|
},
|
|
70
69
|
"peerDependencies": {
|
|
71
70
|
"@phosphor-icons/react": "^2.0.5",
|
|
72
71
|
"react": "^18.2.0",
|
|
73
72
|
"react-dom": "^18.2.0",
|
|
74
|
-
"@dxos/react-client": "0.3.10-
|
|
73
|
+
"@dxos/react-client": "0.3.10-next.5353ed8"
|
|
75
74
|
},
|
|
76
75
|
"publishConfig": {
|
|
77
76
|
"access": "public"
|
|
@@ -21,7 +21,7 @@ import { generateName } from '@dxos/display-name';
|
|
|
21
21
|
import { useThemeContext } from '@dxos/react-ui';
|
|
22
22
|
import { getColorForValue, inputSurface, mx } from '@dxos/react-ui-theme';
|
|
23
23
|
|
|
24
|
-
import { basicBundle,
|
|
24
|
+
import { basicBundle, markdownBundle } from './extensions';
|
|
25
25
|
import { defaultTheme, markdownTheme, textTheme } from './themes';
|
|
26
26
|
import { type EditorModel } from '../../hooks';
|
|
27
27
|
import { type ThemeStyles } from '../../styles';
|
|
@@ -157,17 +157,7 @@ export const BaseTextEditor = forwardRef<TextEditorRef, TextEditorProps>(
|
|
|
157
157
|
},
|
|
158
158
|
);
|
|
159
159
|
|
|
160
|
-
// TODO(burdon):
|
|
161
|
-
const maybeDebug = (): Extension => {
|
|
162
|
-
// TODO(burdon): Parse JSON script format (with key bindings?)
|
|
163
|
-
const items = localStorage.getItem('dxos.composer.demo');
|
|
164
|
-
if (items) {
|
|
165
|
-
return demo({ items: items.split(',') });
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return [];
|
|
169
|
-
};
|
|
170
|
-
|
|
160
|
+
// TODO(burdon): Set default text theme?
|
|
171
161
|
export const TextEditor = forwardRef<TextEditorRef, TextEditorProps>(
|
|
172
162
|
({ extensions = [], slots: _slots, ...props }, forwardedRef) => {
|
|
173
163
|
const { themeMode } = useThemeContext();
|
|
@@ -175,7 +165,7 @@ export const TextEditor = forwardRef<TextEditorRef, TextEditorProps>(
|
|
|
175
165
|
return (
|
|
176
166
|
<BaseTextEditor
|
|
177
167
|
ref={forwardedRef}
|
|
178
|
-
extensions={[basicBundle({ themeMode, placeholder: slots?.editor?.placeholder }),
|
|
168
|
+
extensions={[basicBundle({ themeMode, placeholder: slots?.editor?.placeholder }), ...extensions]}
|
|
179
169
|
slots={slots}
|
|
180
170
|
{...props}
|
|
181
171
|
/>
|
|
@@ -190,11 +180,7 @@ export const MarkdownEditor = forwardRef<TextEditorRef, TextEditorProps>(
|
|
|
190
180
|
return (
|
|
191
181
|
<BaseTextEditor
|
|
192
182
|
ref={forwardedRef}
|
|
193
|
-
extensions={[
|
|
194
|
-
markdownBundle({ themeMode, placeholder: slots?.editor?.placeholder }),
|
|
195
|
-
maybeDebug(),
|
|
196
|
-
...extensions,
|
|
197
|
-
]}
|
|
183
|
+
extensions={[markdownBundle({ themeMode, placeholder: slots?.editor?.placeholder }), ...extensions]}
|
|
198
184
|
slots={slots}
|
|
199
185
|
{...props}
|
|
200
186
|
/>
|
|
@@ -4,18 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension } from '@codemirror/state';
|
|
6
6
|
import {
|
|
7
|
-
keymap,
|
|
8
|
-
type DecorationSet,
|
|
9
|
-
type Rect,
|
|
10
|
-
type ViewUpdate,
|
|
11
7
|
Decoration,
|
|
8
|
+
type DecorationSet,
|
|
12
9
|
EditorView,
|
|
10
|
+
keymap,
|
|
13
11
|
MatchDecorator,
|
|
12
|
+
type Rect,
|
|
14
13
|
ViewPlugin,
|
|
14
|
+
type ViewUpdate,
|
|
15
15
|
WidgetType,
|
|
16
16
|
} from '@codemirror/view';
|
|
17
17
|
|
|
18
|
-
import { debounce } from '@dxos/async';
|
|
19
18
|
import { invariant } from '@dxos/invariant';
|
|
20
19
|
|
|
21
20
|
// 1. TODO(burdon): Make atomic (for tasklist also).
|
|
@@ -45,10 +44,10 @@ class BookmarkWidget extends WidgetType {
|
|
|
45
44
|
return this._id === other._id;
|
|
46
45
|
}
|
|
47
46
|
|
|
47
|
+
// TODO(burdon): Click to select.
|
|
48
48
|
override toDOM() {
|
|
49
49
|
const span = document.createElement('span');
|
|
50
50
|
span.className = 'cm-bookmark';
|
|
51
|
-
// TODO(burdon): Call out to react?
|
|
52
51
|
// https://emojifinder.com/comment
|
|
53
52
|
span.textContent = '💬';
|
|
54
53
|
return span;
|
|
@@ -63,28 +62,18 @@ const styles = EditorView.baseTheme({
|
|
|
63
62
|
padding: '4px',
|
|
64
63
|
backgroundColor: 'yellow',
|
|
65
64
|
},
|
|
66
|
-
'& .cm-bookmark-selected': {
|
|
67
|
-
backgroundColor: 'orange',
|
|
68
|
-
},
|
|
69
65
|
});
|
|
70
66
|
|
|
71
|
-
type CommentsInfo = {
|
|
72
|
-
active?: string;
|
|
73
|
-
items: { id: string; pos: number; location: Rect | null }[];
|
|
74
|
-
};
|
|
75
|
-
|
|
76
67
|
export type CommentsOptions = {
|
|
77
68
|
key?: string;
|
|
78
69
|
onCreate?: () => string | void;
|
|
79
|
-
onUpdate?: (info:
|
|
70
|
+
onUpdate?: (info: { items: string[]; active: string; pos: number; location: Rect }) => void;
|
|
80
71
|
};
|
|
81
72
|
|
|
82
73
|
// https://www.markdownguide.org/extended-syntax/#footnotes
|
|
83
74
|
// TODO(burdon): Record span in automerge model?
|
|
84
75
|
// TODO(burdon): Extended markdown: https://www.markdownguide.org/extended-syntax
|
|
85
76
|
export const comments = (options: CommentsOptions = {}): Extension => {
|
|
86
|
-
let active: string | undefined;
|
|
87
|
-
|
|
88
77
|
const bookmarkMatcher = new MatchDecorator({
|
|
89
78
|
regexp: /\[\^(\w+)\]/g,
|
|
90
79
|
decoration: (match, view, pos) => {
|
|
@@ -116,14 +105,10 @@ export const comments = (options: CommentsOptions = {}): Extension => {
|
|
|
116
105
|
},
|
|
117
106
|
);
|
|
118
107
|
|
|
119
|
-
const doUpdate = debounce((data: CommentsInfo) => {
|
|
120
|
-
options.onUpdate?.(data);
|
|
121
|
-
}, 200);
|
|
122
|
-
|
|
123
108
|
return [
|
|
124
109
|
keymap.of([
|
|
125
110
|
{
|
|
126
|
-
key: options?.key ?? '
|
|
111
|
+
key: options?.key ?? 'alt-meta-c',
|
|
127
112
|
run: (view) => {
|
|
128
113
|
// Insert footnote.
|
|
129
114
|
const id = options.onCreate?.();
|
|
@@ -147,41 +132,39 @@ export const comments = (options: CommentsOptions = {}): Extension => {
|
|
|
147
132
|
|
|
148
133
|
// Monitor cursor movement.
|
|
149
134
|
EditorView.updateListener.of((update) => {
|
|
150
|
-
active = undefined;
|
|
151
|
-
if (!options.onUpdate) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
135
|
const view = update.view;
|
|
156
136
|
const pos = view.state.selection.main.head;
|
|
157
137
|
|
|
158
138
|
const decorations: { from: number; to: number; value: Decoration }[] = [];
|
|
159
139
|
const rangeSet = view.plugin(bookmarks)?.bookmarks;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
rangeSet?.between(from, to, (from, to, value) => {
|
|
164
|
-
decorations.push({ from, to, value });
|
|
165
|
-
const d = Math.min(Math.abs(pos - from), Math.abs(pos - to));
|
|
166
|
-
if (d < closest) {
|
|
167
|
-
// TODO(burdon): Update class of selected.
|
|
168
|
-
active = value.spec.id;
|
|
169
|
-
closest = d;
|
|
140
|
+
rangeSet?.between(pos, pos + 1, (from, to, value) => {
|
|
141
|
+
if (value.spec.widget) {
|
|
142
|
+
decorations.push({ from, to, value });
|
|
170
143
|
}
|
|
171
144
|
});
|
|
172
145
|
|
|
173
146
|
if (decorations.length) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
147
|
+
const {
|
|
148
|
+
from,
|
|
149
|
+
value: {
|
|
150
|
+
spec: { id },
|
|
151
|
+
},
|
|
152
|
+
} = decorations[0];
|
|
153
|
+
const location = view.coordsAtPos(from);
|
|
154
|
+
if (location) {
|
|
155
|
+
options.onUpdate?.({
|
|
156
|
+
items: decorations.map(
|
|
157
|
+
({
|
|
158
|
+
value: {
|
|
159
|
+
spec: { id },
|
|
160
|
+
},
|
|
161
|
+
}) => id,
|
|
162
|
+
),
|
|
163
|
+
active: id,
|
|
164
|
+
pos,
|
|
165
|
+
location,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
185
168
|
}
|
|
186
169
|
}),
|
|
187
170
|
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import { StateField } from '@codemirror/state';
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type TextListener = (text: string) => void;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799
|
|
11
11
|
*/
|
|
12
12
|
// TODO(burdon): Expose options.
|
|
13
|
-
export const listener = (
|
|
13
|
+
export const listener = (onChange: TextListener) =>
|
|
14
14
|
StateField.define({
|
|
15
15
|
create: () => null,
|
|
16
16
|
update: (_value, transaction) => {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type DemoOptions = {
|
|
2
|
-
delay?: number;
|
|
3
|
-
items?: string[];
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Demo script.
|
|
7
|
-
* Configurable plugin that let's user cycle through pre-configured input script.
|
|
8
|
-
*/
|
|
9
|
-
export declare const demo: ({ delay, items }?: DemoOptions) => import("@codemirror/state").Extension[];
|
|
10
|
-
//# sourceMappingURL=demo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/demo.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,IAAI,sBAA0C,WAAW,4CAgDrE,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { keymap } from '@codemirror/view';
|
|
6
|
-
|
|
7
|
-
export type DemoOptions = {
|
|
8
|
-
delay?: number;
|
|
9
|
-
items?: string[];
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const defaultItems = ['hello world!', 'this is a test.', 'this is [DXOS](https://dxos.org)'];
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Demo script.
|
|
16
|
-
* Configurable plugin that let's user cycle through pre-configured input script.
|
|
17
|
-
*/
|
|
18
|
-
export const demo = ({ delay = 75, items = defaultItems }: DemoOptions = {}) => {
|
|
19
|
-
let t: any;
|
|
20
|
-
let idx = 0;
|
|
21
|
-
|
|
22
|
-
return [
|
|
23
|
-
keymap.of([
|
|
24
|
-
{
|
|
25
|
-
// Reset.
|
|
26
|
-
key: "alt-meta-'",
|
|
27
|
-
run: (view) => {
|
|
28
|
-
clearTimeout(t);
|
|
29
|
-
idx = 0;
|
|
30
|
-
return true;
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
// Next prompt.
|
|
35
|
-
// TODO(burdon): Press 1-9 to select prompt?
|
|
36
|
-
key: "shift-meta-'",
|
|
37
|
-
run: (view) => {
|
|
38
|
-
clearTimeout(t);
|
|
39
|
-
// TODO(burdon): Add space if needed.
|
|
40
|
-
const text = items[idx++];
|
|
41
|
-
if (idx === items?.length) {
|
|
42
|
-
idx = 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
let i = 0;
|
|
46
|
-
const insert = (d = 0) => {
|
|
47
|
-
t = setTimeout(() => {
|
|
48
|
-
const pos = view.state.selection.main.head;
|
|
49
|
-
view.dispatch({
|
|
50
|
-
changes: { from: pos, insert: text[i++] },
|
|
51
|
-
selection: { anchor: pos + 1 },
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
if (i < text.length) {
|
|
55
|
-
insert(Math.random() * delay * (text[i] === ' ' ? 2 : 1));
|
|
56
|
-
}
|
|
57
|
-
}, d);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
insert();
|
|
61
|
-
return true;
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
]),
|
|
65
|
-
];
|
|
66
|
-
};
|