@dxos/react-ui-editor 0.3.10-main.3645708 → 0.3.10-main.375af01
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 +74 -99
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/types/src/hooks/automerge/PatchSemaphore.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/amToCodemirror.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/automerge.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/codeMirrorToAm.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/handle.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/index.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/plugin.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useTextModel.d.ts +3 -4
- package/dist/types/src/hooks/useTextModel.d.ts.map +1 -1
- package/dist/types/src/testing/replicator.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/components/TextEditor/TextEditor.tsx +7 -10
- package/src/{automerge → hooks/automerge}/automerge.stories.tsx +2 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useTextModel.ts +47 -42
- package/src/testing/replicator.ts +2 -3
- package/dist/types/src/automerge/automerge-plugin/PatchSemaphore.d.ts.map +0 -1
- package/dist/types/src/automerge/automerge-plugin/amToCodemirror.d.ts.map +0 -1
- package/dist/types/src/automerge/automerge-plugin/codeMirrorToAm.d.ts.map +0 -1
- package/dist/types/src/automerge/automerge-plugin/handle.d.ts.map +0 -1
- package/dist/types/src/automerge/automerge-plugin/index.d.ts.map +0 -1
- package/dist/types/src/automerge/automerge-plugin/plugin.d.ts.map +0 -1
- package/dist/types/src/automerge/automerge.stories.d.ts.map +0 -1
- package/dist/types/src/hooks/useCollaboration.d.ts +0 -9
- package/dist/types/src/hooks/useCollaboration.d.ts.map +0 -1
- package/src/hooks/useCollaboration.ts +0 -45
- /package/dist/types/src/{automerge/automerge-plugin → hooks/automerge}/PatchSemaphore.d.ts +0 -0
- /package/dist/types/src/{automerge/automerge-plugin → hooks/automerge}/amToCodemirror.d.ts +0 -0
- /package/dist/types/src/{automerge → hooks/automerge}/automerge.stories.d.ts +0 -0
- /package/dist/types/src/{automerge/automerge-plugin → hooks/automerge}/codeMirrorToAm.d.ts +0 -0
- /package/dist/types/src/{automerge/automerge-plugin → hooks/automerge}/handle.d.ts +0 -0
- /package/dist/types/src/{automerge/automerge-plugin → hooks/automerge}/index.d.ts +0 -0
- /package/dist/types/src/{automerge/automerge-plugin → hooks/automerge}/plugin.d.ts +0 -0
- /package/src/{automerge/automerge-plugin → hooks/automerge}/PatchSemaphore.ts +0 -0
- /package/src/{automerge/automerge-plugin → hooks/automerge}/amToCodemirror.ts +0 -0
- /package/src/{automerge/automerge-plugin → hooks/automerge}/codeMirrorToAm.ts +0 -0
- /package/src/{automerge/automerge-plugin → hooks/automerge}/handle.ts +0 -0
- /package/src/{automerge/automerge-plugin → hooks/automerge}/index.ts +0 -0
- /package/src/{automerge/automerge-plugin → hooks/automerge}/plugin.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts":{"bytes":7048,"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/link.ts":{"bytes":18414,"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":1953,"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":15706,"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":10429,"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":"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":11192,"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/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":1024,"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/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":13987,"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":19675,"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":"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":"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/automerge/automerge-plugin/amToCodemirror.ts":{"bytes":11071,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts":{"bytes":3923,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts":{"bytes":8493,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts","kind":"import-statement","original":"./amToCodemirror"},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts","kind":"import-statement","original":"./codeMirrorToAm"},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts":{"bytes":13093,"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/automerge/automerge-plugin/PatchSemaphore.ts","kind":"import-statement","original":"./PatchSemaphore"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts":{"bytes":662,"imports":[{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts":{"bytes":5351,"imports":[{"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/echo-schema","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/automerge/automerge-plugin/index.ts","kind":"import-statement","original":"../automerge/automerge-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":8066,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"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":672,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts","kind":"import-statement","original":"./useCollaboration"},{"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":91618},"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/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/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":"@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/language","kind":"import-statement","external":true},{"path":"@codemirror/state","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":"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":"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/echo-schema","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":"@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":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","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","cursorColor","defaultSlots","defaultTextSlots","defaultTheme","link","listener","markdownBundle","markdownHighlightStyle","markdownTags","markdownTagsExtension","statefield","styles","tags","tasklist","textTheme","tooltip","useCollaboration","useTextModel"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":142},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytesInOutput":50},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts":{"bytesInOutput":1102},"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/link.ts":{"bytesInOutput":2482},"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":2822},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts":{"bytesInOutput":3329},"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":2507},"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":3670},"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytesInOutput":4269},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts":{"bytesInOutput":1203},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts":{"bytesInOutput":2324},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts":{"bytesInOutput":1519},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts":{"bytesInOutput":2412},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts":{"bytesInOutput":644},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytesInOutput":1336},"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":3766}},"bytes":39892}}}
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-editor/src/components/TextEditor/extensions/autocomplete.ts":{"bytes":7048,"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/link.ts":{"bytes":18414,"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":1953,"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":15706,"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":10429,"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":"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":11192,"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/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":1024,"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/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":13987,"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":18963,"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":10035,"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":89660},"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/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/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":"@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/language","kind":"import-statement","external":true},{"path":"@codemirror/state","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","cursorColor","defaultSlots","defaultTextSlots","defaultTheme","link","listener","markdownBundle","markdownHighlightStyle","markdownTags","markdownTagsExtension","statefield","styles","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":1102},"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/link.ts":{"bytesInOutput":2482},"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":2822},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/highlight.ts":{"bytesInOutput":3329},"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":2507},"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":3670},"packages/ui/react-ui-editor/src/components/TextEditor/themes/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytesInOutput":4176},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytesInOutput":2065},"packages/ui/react-ui-editor/src/hooks/automerge/plugin.ts":{"bytesInOutput":2324},"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":3766},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytesInOutput":0}},"bytes":39095}}}
|
|
@@ -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,m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,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAM;gBAEjB,KAAK,CAAC,EAAE,KAAK;IAMzB,SAAS,WAAY,UAAU,QAAQ,UAAU,UA2C/C;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amToCodemirror.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/amToCodemirror.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8B,KAAK,eAAe,EAAoB,MAAM,mBAAmB,CAAC;AACvG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,IAAI,EAGV,MAAM,2BAA2B,CAAC;+BAIb,UAAU,aAAa,eAAe,UAAU,IAAI,EAAE,WAAW,KAAK,EAAE;AAA9F,wBAgBE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,uBAAuB,CAAC;;;;AA+E/B,wBAEE;AAEF,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeMirrorToAm.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/codeMirrorToAm.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAa,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;+CAI5B,UAAU,gBACJ,WAAW,EAAE,SACpB,WAAW,KACjB,KAAK,GAAG,SAAS;AALpB,wBA6BE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/handle.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,CAAC,MAAM,2BAA2B,CAAC;AAEpD,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,GAAG,IAAI;IAChC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACpE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAEtG,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACzD,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,WAAW,EACX,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,wBAAwB,EAAE,WAAW,EAAE,CAAC;CACzC,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,UAAU,0DAAsC,CAAC;AAE9D,eAAO,MAAM,WAAW,sCAAsB,YAAY,WAAW,CAAgC,CAAC;AAEtG,eAAO,MAAM,YAAY,UAAW,WAAW,uCAAsD,CAAC;AAEtG,eAAO,MAAM,OAAO,UAAW,WAAW,mBAAiB,IAAI,EAA6B,CAAC;AAE7F,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAMtC,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,UAAU,QAAQ,IAAI,EAAE,KAAG,eA8DlE,CAAC;AAEF,eAAO,MAAM,uBAAuB,qDAA+B,CAAC;AAEpE,eAAO,MAAM,aAAa,OAAQ,WAAW,KAAG,OAAmD,CAAC;AAEpG,eAAO,MAAM,aAAa,OAAQ,eAAe,SAchD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
1
2
|
import type * as awarenessProtocol from 'y-protocols/awareness';
|
|
2
3
|
import { type DocAccessor, type Space, type TextObject } from '@dxos/react-client/echo';
|
|
3
4
|
import { type Identity } from '@dxos/react-client/halo';
|
|
4
5
|
import type { YText, YXmlFragment } from '@dxos/text-model';
|
|
5
6
|
type Awareness = awarenessProtocol.Awareness;
|
|
6
|
-
type Provider = {
|
|
7
|
-
awareness: Awareness;
|
|
8
|
-
};
|
|
9
7
|
export type EditorModel = {
|
|
10
8
|
id: string;
|
|
11
9
|
content: string | YText | YXmlFragment | DocAccessor;
|
|
12
10
|
text: () => string;
|
|
13
|
-
|
|
11
|
+
extension?: Extension;
|
|
12
|
+
awareness?: Awareness;
|
|
14
13
|
peer?: {
|
|
15
14
|
id: string;
|
|
16
15
|
name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTextModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTextModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextModel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,KAAK,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,UAAU,EAIhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAM5D,KAAK,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;AAG7C,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,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AAE,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.10-main.
|
|
3
|
+
"version": "0.3.10-main.375af01",
|
|
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,18 +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/display-name": "0.3.10-main.
|
|
41
|
-
"@dxos/echo-schema": "0.3.10-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/protocols": "0.3.10-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/react-
|
|
47
|
-
"@dxos/react-ui": "0.3.10-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/text-model": "0.3.10-main.
|
|
50
|
-
"@dxos/
|
|
39
|
+
"@dxos/automerge": "0.3.10-main.375af01",
|
|
40
|
+
"@dxos/display-name": "0.3.10-main.375af01",
|
|
41
|
+
"@dxos/echo-schema": "0.3.10-main.375af01",
|
|
42
|
+
"@dxos/invariant": "0.3.10-main.375af01",
|
|
43
|
+
"@dxos/log": "0.3.10-main.375af01",
|
|
44
|
+
"@dxos/protocols": "0.3.10-main.375af01",
|
|
45
|
+
"@dxos/react-async": "0.3.10-main.375af01",
|
|
46
|
+
"@dxos/react-ui": "0.3.10-main.375af01",
|
|
47
|
+
"@dxos/react-ui-theme": "0.3.10-main.375af01",
|
|
48
|
+
"@dxos/util": "0.3.10-main.375af01",
|
|
49
|
+
"@dxos/text-model": "0.3.10-main.375af01",
|
|
50
|
+
"@dxos/debug": "0.3.10-main.375af01"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@automerge/automerge-repo-network-broadcastchannel": "^1.0.19",
|
|
@@ -60,17 +60,17 @@
|
|
|
60
60
|
"@types/react-dom": "^18.0.6",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
63
|
+
"@dxos/react-client": "0.3.10-main.375af01",
|
|
64
|
+
"@dxos/react-ui": "0.3.10-main.375af01",
|
|
65
|
+
"@dxos/echo-typegen": "0.3.10-main.375af01",
|
|
66
|
+
"@dxos/storybook-utils": "0.3.10-main.375af01",
|
|
67
|
+
"@dxos/config": "0.3.10-main.375af01"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@phosphor-icons/react": "^2.0.5",
|
|
71
71
|
"react": "^18.2.0",
|
|
72
72
|
"react-dom": "^18.2.0",
|
|
73
|
-
"@dxos/react-client": "0.3.10-main.
|
|
73
|
+
"@dxos/react-client": "0.3.10-main.375af01"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
@@ -16,12 +16,10 @@ import React, {
|
|
|
16
16
|
useImperativeHandle,
|
|
17
17
|
useState,
|
|
18
18
|
} from 'react';
|
|
19
|
-
import { yCollab } from 'y-codemirror.next';
|
|
20
19
|
|
|
21
20
|
import { generateName } from '@dxos/display-name';
|
|
22
21
|
import { useThemeContext } from '@dxos/react-ui';
|
|
23
22
|
import { getColorForValue, inputSurface, mx } from '@dxos/react-ui-theme';
|
|
24
|
-
import { type YText } from '@dxos/text-model';
|
|
25
23
|
|
|
26
24
|
import { basicBundle, markdownBundle } from './extensions';
|
|
27
25
|
import { defaultTheme, textTheme } from './themes';
|
|
@@ -72,18 +70,17 @@ export const BaseTextEditor = forwardRef<TextEditorRef, TextEditorProps>(
|
|
|
72
70
|
const { themeMode } = useThemeContext();
|
|
73
71
|
const tabsterDOMAttribute = useFocusableGroup({ tabBehavior: 'limited' });
|
|
74
72
|
|
|
75
|
-
// TODO(burdon): Factor out
|
|
76
|
-
|
|
77
|
-
const { provider, peer } = model;
|
|
73
|
+
// TODO(burdon): Factor out?
|
|
74
|
+
const { awareness, peer } = model;
|
|
78
75
|
useEffect(() => {
|
|
79
|
-
if (
|
|
80
|
-
|
|
76
|
+
if (awareness && peer) {
|
|
77
|
+
awareness.setLocalStateField('user', {
|
|
81
78
|
name: peer.name ?? generateName(peer.id),
|
|
82
79
|
color: getColorForValue({ value: peer.id, type: 'color' }),
|
|
83
80
|
colorLight: getColorForValue({ value: peer.id, themeMode, type: 'highlight' }),
|
|
84
81
|
});
|
|
85
82
|
}
|
|
86
|
-
}, [
|
|
83
|
+
}, [awareness, peer, themeMode]);
|
|
87
84
|
|
|
88
85
|
const [root, setRoot] = useState<HTMLDivElement | null>(null);
|
|
89
86
|
const [state, setState] = useState<EditorState>();
|
|
@@ -108,7 +105,7 @@ export const BaseTextEditor = forwardRef<TextEditorRef, TextEditorProps>(
|
|
|
108
105
|
EditorView.darkTheme.of(themeMode === 'dark'),
|
|
109
106
|
|
|
110
107
|
// Storage and replication.
|
|
111
|
-
|
|
108
|
+
model.extension,
|
|
112
109
|
|
|
113
110
|
// Custom.
|
|
114
111
|
...extensions,
|
|
@@ -127,7 +124,7 @@ export const BaseTextEditor = forwardRef<TextEditorRef, TextEditorProps>(
|
|
|
127
124
|
setView(undefined);
|
|
128
125
|
setState(undefined);
|
|
129
126
|
};
|
|
130
|
-
}, [root, model
|
|
127
|
+
}, [root, model, themeMode, editorMode]);
|
|
131
128
|
|
|
132
129
|
const handleKeyUp = useCallback(
|
|
133
130
|
(event: KeyboardEvent) => {
|
|
@@ -12,7 +12,8 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
12
12
|
import { type Prop } from '@dxos/automerge/automerge';
|
|
13
13
|
import { type DocHandle, Repo } from '@dxos/automerge/automerge-repo';
|
|
14
14
|
|
|
15
|
-
import { type IDocHandle
|
|
15
|
+
import { type IDocHandle } from './handle';
|
|
16
|
+
import { automergePlugin } from './plugin';
|
|
16
17
|
|
|
17
18
|
type EditorProps = {
|
|
18
19
|
handle: IDocHandle;
|
package/src/hooks/index.ts
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Extension } from '@codemirror/state';
|
|
6
|
+
import get from 'lodash.get';
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
|
+
import { yCollab } from 'y-codemirror.next';
|
|
6
9
|
import type * as awarenessProtocol from 'y-protocols/awareness';
|
|
7
10
|
|
|
11
|
+
import { invariant } from '@dxos/invariant';
|
|
8
12
|
import {
|
|
9
13
|
type DocAccessor,
|
|
10
14
|
type Space,
|
|
@@ -16,18 +20,19 @@ import {
|
|
|
16
20
|
import { type Identity } from '@dxos/react-client/halo';
|
|
17
21
|
import type { YText, YXmlFragment } from '@dxos/text-model';
|
|
18
22
|
|
|
23
|
+
import { automergePlugin } from './automerge';
|
|
19
24
|
import { SpaceAwarenessProvider } from './yjs';
|
|
20
25
|
|
|
21
26
|
// TODO(burdon): Move.
|
|
22
27
|
type Awareness = awarenessProtocol.Awareness;
|
|
23
|
-
type Provider = { awareness: Awareness };
|
|
24
28
|
|
|
25
29
|
// TODO(wittjosiah): Factor out to common package? @dxos/react-client?
|
|
26
30
|
export type EditorModel = {
|
|
27
31
|
id: string;
|
|
28
32
|
content: string | YText | YXmlFragment | DocAccessor;
|
|
29
33
|
text: () => string;
|
|
30
|
-
|
|
34
|
+
extension?: Extension;
|
|
35
|
+
awareness?: Awareness;
|
|
31
36
|
peer?: {
|
|
32
37
|
id: string;
|
|
33
38
|
name?: string;
|
|
@@ -41,57 +46,57 @@ export type UseTextModelOptions = {
|
|
|
41
46
|
text?: TextObject;
|
|
42
47
|
};
|
|
43
48
|
|
|
44
|
-
// TODO(burdon):
|
|
45
|
-
// TODO(burdon): Decouple space (make Editor less dependent on entire stack)?
|
|
49
|
+
// TODO(burdon): Remove YJS/Automerge deps (from UI component -- create abstraction; incl. all ECHO/Space deps).
|
|
46
50
|
// TODO(wittjosiah): Factor out to common package? @dxos/react-client?
|
|
47
51
|
export const useTextModel = ({ identity, space, text }: UseTextModelOptions): EditorModel | undefined => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (!space || !text?.doc) {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
52
|
+
const [model, setModel] = useState<EditorModel | undefined>(() => createModel({ identity, space, text }));
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
setModel(createModel({ identity, space, text }));
|
|
55
|
+
}, [identity, space, text]);
|
|
56
|
+
return model;
|
|
57
|
+
};
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const createModel = (options: UseTextModelOptions) => {
|
|
60
|
+
const { space, text } = options;
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return text?.content;
|
|
62
|
+
if (isActualAutomergeObject(text)) {
|
|
63
|
+
return createAutomergeModel(options);
|
|
64
|
+
} else {
|
|
65
|
+
if (!space || !text?.doc || !text?.content) {
|
|
66
|
+
return undefined;
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!text?.doc || !text?.content) {
|
|
72
|
-
return undefined;
|
|
68
|
+
return createYjsModel(options);
|
|
73
69
|
}
|
|
70
|
+
};
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
id: obj.id,
|
|
79
|
-
content: content!,
|
|
80
|
-
text: () => content!.toString(),
|
|
81
|
-
provider: undefined,
|
|
82
|
-
peer: identity
|
|
83
|
-
? {
|
|
84
|
-
id: identity.identityKey.toHex(),
|
|
85
|
-
name: identity.profile?.displayName,
|
|
86
|
-
}
|
|
87
|
-
: undefined,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
72
|
+
const createYjsModel = ({ identity, space, text }: UseTextModelOptions): EditorModel => {
|
|
73
|
+
invariant(space && text?.doc && text?.content);
|
|
74
|
+
const provider = new SpaceAwarenessProvider({ space, doc: text.doc, channel: `yjs.awareness.${text.id}` });
|
|
90
75
|
|
|
91
76
|
return {
|
|
92
77
|
id: text.doc.guid,
|
|
93
78
|
content: text.content,
|
|
94
79
|
text: () => text.content!.toString(),
|
|
80
|
+
extension: yCollab(text.content as YText, provider.awareness),
|
|
81
|
+
awareness: provider.awareness,
|
|
82
|
+
peer: identity
|
|
83
|
+
? {
|
|
84
|
+
id: identity.identityKey.toHex(),
|
|
85
|
+
name: identity.profile?.displayName,
|
|
86
|
+
}
|
|
87
|
+
: undefined,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const createAutomergeModel = ({ identity, space, text }: UseTextModelOptions): EditorModel => {
|
|
92
|
+
const obj = text as any as AutomergeTextCompat;
|
|
93
|
+
const doc = getRawDoc(obj, [obj.field]);
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
id: obj.id,
|
|
97
|
+
content: doc,
|
|
98
|
+
text: () => get(doc.handle.docSync(), doc.path),
|
|
99
|
+
extension: automergePlugin(doc.handle, doc.path),
|
|
95
100
|
peer: identity
|
|
96
101
|
? {
|
|
97
102
|
id: identity.identityKey.toHex(),
|
|
@@ -163,12 +163,11 @@ export class Replicator {
|
|
|
163
163
|
colorLight: cursorColor.light,
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
// TODO(burdon): Create concrete class that implements SyncModel?
|
|
167
166
|
const model: EditorModel = {
|
|
168
167
|
id: doc.guid,
|
|
169
168
|
content: this._kind === TextKind.PLAIN ? doc.getText('content') : doc.getXmlFragment('content'),
|
|
170
|
-
text: () => model.content.toString(),
|
|
171
|
-
provider,
|
|
169
|
+
text: () => model.content.toString(),
|
|
170
|
+
awareness: provider.awareness,
|
|
172
171
|
peer: { id },
|
|
173
172
|
};
|
|
174
173
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PatchSemaphore.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/PatchSemaphore.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI9D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAA8E,MAAM,UAAU,CAAC;AAElH,KAAK,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/B,KAAK,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;AAE7B,KAAK,QAAQ,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,KAAK,KAAK,GAAG,SAAS,CAAC;AAE3F,qBAAa,cAAc;IACzB,MAAM,EAAG,KAAK,CAAC;IACf,YAAY,UAAS;IACrB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAM;gBAEjB,KAAK,CAAC,EAAE,KAAK;IAMzB,SAAS,WAAY,UAAU,QAAQ,UAAU,UA2C/C;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"amToCodemirror.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/amToCodemirror.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8B,KAAK,eAAe,EAAoB,MAAM,mBAAmB,CAAC;AACvG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,IAAI,EAGV,MAAM,2BAA2B,CAAC;+BAIb,UAAU,aAAa,eAAe,UAAU,IAAI,EAAE,WAAW,KAAK,EAAE;AAA9F,wBAgBE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codeMirrorToAm.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/codeMirrorToAm.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAa,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;+CAI5B,UAAU,gBACJ,WAAW,EAAE,SACpB,WAAW,KACjB,KAAK,GAAG,SAAS;AALpB,wBA6BE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/handle.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,CAAC,MAAM,2BAA2B,CAAC;AAEpD,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,GAAG,IAAI;IAChC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACpE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAEtG,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACzD,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC7D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,KAAK,UAAU,EAAE,MA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AC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../src/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,uBAAuB,CAAC;;;;AA8E/B,wBAEE;AAEF,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Extension } from '@codemirror/state';
|
|
2
|
-
import type { ThemeMode } from '@dxos/react-ui';
|
|
3
|
-
import type { EditorModel } from './useTextModel';
|
|
4
|
-
/**
|
|
5
|
-
* Replication and awareness (incl. remote selection).
|
|
6
|
-
* https://codemirror.net/docs/ref/#collab
|
|
7
|
-
*/
|
|
8
|
-
export declare const useCollaboration: (model: EditorModel, themeMode: ThemeMode) => Extension | undefined;
|
|
9
|
-
//# sourceMappingURL=useCollaboration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCollaboration.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCollaboration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,WAAW,aAAa,SAAS,KAAG,SAAS,GAAG,SAuBvF,CAAC"}
|