@dxos/plugin-markdown 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
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/MarkdownCard-HFNNE4B4.mjs +12 -0
- package/dist/lib/browser/MarkdownContainer-V7EAADMF.mjs +12 -0
- package/dist/lib/browser/{anchor-sort-3MYLO74J.mjs → anchor-sort-WQ3TL7ZI.mjs} +7 -7
- package/dist/lib/browser/anchor-sort-WQ3TL7ZI.mjs.map +7 -0
- package/dist/lib/browser/app-graph-serializer-ULZUJKOD.mjs +58 -0
- package/dist/lib/browser/app-graph-serializer-ULZUJKOD.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-TLV4PNZW.mjs +19 -0
- package/dist/lib/browser/blueprint-definition-TLV4PNZW.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-BX73DASG.mjs +702 -0
- package/dist/lib/browser/chunk-BX73DASG.mjs.map +7 -0
- package/dist/lib/browser/chunk-CUGDX7KA.mjs +8 -0
- package/dist/lib/browser/chunk-CUGDX7KA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BE3IO2CM.mjs → chunk-FWQQW6KU.mjs} +41 -47
- package/dist/lib/browser/chunk-FWQQW6KU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NXT2E2BG.mjs → chunk-JOXYQLKH.mjs} +3 -5
- package/dist/lib/browser/{chunk-NXT2E2BG.mjs.map → chunk-JOXYQLKH.mjs.map} +1 -1
- package/dist/lib/browser/chunk-KDKXFKDN.mjs +104 -0
- package/dist/lib/browser/chunk-KDKXFKDN.mjs.map +7 -0
- package/dist/lib/browser/chunk-LMO5UVKL.mjs +167 -0
- package/dist/lib/browser/chunk-LMO5UVKL.mjs.map +7 -0
- package/dist/lib/browser/chunk-S45ULIOG.mjs +101 -0
- package/dist/lib/browser/chunk-S45ULIOG.mjs.map +7 -0
- package/dist/lib/browser/chunk-VQ3WOAB6.mjs +60 -0
- package/dist/lib/browser/chunk-VQ3WOAB6.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +32 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +121 -129
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-EGCWOQKJ.mjs +53 -0
- package/dist/lib/browser/operation-resolver-EGCWOQKJ.mjs.map +7 -0
- package/dist/lib/browser/react-surface-64FZ7T7F.mjs +213 -0
- package/dist/lib/browser/react-surface-64FZ7T7F.mjs.map +7 -0
- package/dist/lib/browser/settings-JY5JE7MI.mjs +35 -0
- package/dist/lib/browser/settings-JY5JE7MI.mjs.map +7 -0
- package/dist/lib/browser/state-QE7VSJWJ.mjs +29 -0
- package/dist/lib/browser/state-QE7VSJWJ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -3
- package/dist/lib/node-esm/{MarkdownCard-FTEHVH7P.mjs → MarkdownCard-GMNXUWWR.mjs} +5 -5
- package/dist/lib/node-esm/MarkdownContainer-LUSMORP2.mjs +13 -0
- package/dist/lib/node-esm/{anchor-sort-W4HCTYUQ.mjs → anchor-sort-G7D5TAI6.mjs} +7 -7
- package/dist/lib/node-esm/anchor-sort-G7D5TAI6.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-serializer-W5YMQP7P.mjs +59 -0
- package/dist/lib/node-esm/app-graph-serializer-W5YMQP7P.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-HYFA7BKQ.mjs +20 -0
- package/dist/lib/node-esm/blueprint-definition-HYFA7BKQ.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/chunk-3JYPCC7M.mjs +105 -0
- package/dist/lib/node-esm/chunk-3JYPCC7M.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-I5JSQBPI.mjs → chunk-44VJC3QF.mjs} +3 -5
- package/dist/lib/node-esm/{chunk-I5JSQBPI.mjs.map → chunk-44VJC3QF.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-D4BCFPKK.mjs +703 -0
- package/dist/lib/node-esm/chunk-D4BCFPKK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3DN4DPVA.mjs → chunk-EYAFC4N7.mjs} +41 -47
- package/dist/lib/node-esm/chunk-EYAFC4N7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KXEQCFMB.mjs +61 -0
- package/dist/lib/node-esm/chunk-KXEQCFMB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PRV35A7Z.mjs +168 -0
- package/dist/lib/node-esm/chunk-PRV35A7Z.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7GN66TDQ.mjs → chunk-SDTYEGGL.mjs} +56 -6
- package/dist/lib/node-esm/chunk-SDTYEGGL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-W3IIKDV5.mjs +10 -0
- package/dist/lib/node-esm/chunk-W3IIKDV5.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +33 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +121 -129
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-2HIS2AQZ.mjs +54 -0
- package/dist/lib/node-esm/operation-resolver-2HIS2AQZ.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-PKEVHTJK.mjs +214 -0
- package/dist/lib/node-esm/react-surface-PKEVHTJK.mjs.map +7 -0
- package/dist/lib/node-esm/settings-4UGMPIRY.mjs +36 -0
- package/dist/lib/node-esm/settings-4UGMPIRY.mjs.map +7 -0
- package/dist/lib/node-esm/state-LXE5XIN4.mjs +30 -0
- package/dist/lib/node-esm/state-LXE5XIN4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -3
- package/dist/types/src/MarkdownPlugin.d.ts +2 -1
- package/dist/types/src/MarkdownPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/create.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/open.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown-blueprint.d.ts +21 -0
- package/dist/types/src/blueprints/markdown-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +5 -0
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +1 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts +3 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +5 -0
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +5 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +10 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -13
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +3 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +3 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +5 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts +4 -3
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownCard/MarkdownCard.stories.d.ts +5 -5
- package/dist/types/src/components/MarkdownCard/MarkdownCard.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownContainer.d.ts +19 -5
- package/dist/types/src/components/MarkdownContainer.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts +2 -2
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts +8 -7
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts +12 -8
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts +4 -4
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts +4 -2
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts.map +1 -1
- package/dist/types/src/components/Suggestions.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useEditorMenuOptions.d.ts.map +1 -1
- package/dist/types/src/hooks/useExtensions.d.ts +3 -3
- package/dist/types/src/hooks/useExtensions.d.ts.map +1 -1
- package/dist/types/src/hooks/useLinkQuery.d.ts +2 -2
- package/dist/types/src/hooks/useLinkQuery.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectCurrentThread.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +2 -2
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/types/Markdown.d.ts +12 -12
- package/dist/types/src/types/Markdown.d.ts.map +1 -1
- package/dist/types/src/types/MarkdownAction.d.ts +62 -30
- package/dist/types/src/types/MarkdownAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +22 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +3 -0
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/src/util.test.d.ts +2 -0
- package/dist/types/src/util.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +81 -66
- package/src/MarkdownPlugin.tsx +61 -74
- package/src/blueprints/functions/create.conversations.json +1 -0
- package/src/{functions → blueprints/functions}/create.test.ts +20 -23
- package/src/{functions → blueprints/functions}/create.ts +1 -1
- package/src/blueprints/functions/index.ts +7 -0
- package/src/{functions → blueprints/functions}/open.ts +4 -3
- package/src/blueprints/functions/update.conversations.json +1 -0
- package/src/{functions → blueprints/functions}/update.test.ts +23 -25
- package/src/{functions → blueprints/functions}/update.ts +4 -3
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/markdown-blueprint.ts +38 -0
- package/src/capabilities/anchor-sort/anchor-sort.ts +36 -0
- package/src/capabilities/anchor-sort/index.ts +7 -0
- package/src/capabilities/app-graph-serializer/app-graph-serializer.ts +59 -0
- package/src/capabilities/app-graph-serializer/index.ts +7 -0
- package/src/capabilities/artifact-definition/artifact-definition.ts +110 -0
- package/src/capabilities/artifact-definition/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +25 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +6 -11
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +45 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +100 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +36 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +31 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +29 -0
- package/src/components/MarkdownCard/MarkdownCard.stories.tsx +25 -43
- package/src/components/MarkdownCard/MarkdownCard.tsx +17 -44
- package/src/components/MarkdownContainer.stories.tsx +47 -60
- package/src/components/MarkdownContainer.tsx +86 -88
- package/src/components/MarkdownEditor/FileUpload.tsx +3 -3
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +16 -17
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +14 -15
- package/src/components/MarkdownEditor/MarkdownEditorContent.tsx +44 -18
- package/src/components/MarkdownEditor/MarkdownEditorToolbar.tsx +7 -4
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +24 -10
- package/src/components/Suggestions.stories.tsx +21 -32
- package/src/components/index.ts +8 -3
- package/src/hooks/useEditorMenuOptions.ts +10 -13
- package/src/hooks/useExtensions.tsx +23 -28
- package/src/hooks/useLinkQuery.ts +13 -13
- package/src/hooks/useSelectCurrentThread.tsx +37 -42
- package/src/index.ts +1 -2
- package/src/meta.ts +2 -2
- package/src/testing.ts +3 -3
- package/src/types/Markdown.ts +2 -2
- package/src/types/MarkdownAction.ts +48 -18
- package/src/types/capabilities.ts +38 -0
- package/src/types/events.ts +13 -0
- package/src/types/index.ts +3 -0
- package/src/types/types.ts +3 -2
- package/src/util.test.ts +44 -0
- package/src/util.tsx +75 -5
- package/dist/lib/browser/MarkdownCard-TC3GGUSX.mjs +0 -12
- package/dist/lib/browser/MarkdownContainer-YF22DV4M.mjs +0 -15
- package/dist/lib/browser/anchor-sort-3MYLO74J.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-BZJ4TQOE.mjs +0 -51
- package/dist/lib/browser/app-graph-serializer-BZJ4TQOE.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-HED54GGW.mjs +0 -13
- package/dist/lib/browser/chunk-3IPVL3E4.mjs +0 -20
- package/dist/lib/browser/chunk-3IPVL3E4.mjs.map +0 -7
- package/dist/lib/browser/chunk-BE3IO2CM.mjs.map +0 -7
- package/dist/lib/browser/chunk-BQTYJOFB.mjs +0 -28
- package/dist/lib/browser/chunk-BQTYJOFB.mjs.map +0 -7
- package/dist/lib/browser/chunk-CN35HEBX.mjs +0 -79
- package/dist/lib/browser/chunk-CN35HEBX.mjs.map +0 -7
- package/dist/lib/browser/chunk-DLZ5RR3P.mjs +0 -96
- package/dist/lib/browser/chunk-DLZ5RR3P.mjs.map +0 -7
- package/dist/lib/browser/chunk-IBCHVMZW.mjs +0 -16
- package/dist/lib/browser/chunk-IBCHVMZW.mjs.map +0 -7
- package/dist/lib/browser/chunk-OKNQ57GF.mjs +0 -51
- package/dist/lib/browser/chunk-OKNQ57GF.mjs.map +0 -7
- package/dist/lib/browser/chunk-V7P7EIWG.mjs +0 -829
- package/dist/lib/browser/chunk-V7P7EIWG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-55ASQRIW.mjs +0 -62
- package/dist/lib/browser/intent-resolver-55ASQRIW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GPD6T435.mjs +0 -211
- package/dist/lib/browser/react-surface-GPD6T435.mjs.map +0 -7
- package/dist/lib/browser/settings-G3ZOXJQY.mjs +0 -28
- package/dist/lib/browser/settings-G3ZOXJQY.mjs.map +0 -7
- package/dist/lib/browser/state-BTUKVZHY.mjs +0 -37
- package/dist/lib/browser/state-BTUKVZHY.mjs.map +0 -7
- package/dist/lib/browser/toolkit.mjs +0 -13
- package/dist/lib/node-esm/MarkdownContainer-L75AIJFM.mjs +0 -16
- package/dist/lib/node-esm/anchor-sort-W4HCTYUQ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-OCTHXWLF.mjs +0 -52
- package/dist/lib/node-esm/app-graph-serializer-OCTHXWLF.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-HAQGJOMQ.mjs +0 -14
- package/dist/lib/node-esm/blueprint-definition-HAQGJOMQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3DN4DPVA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7GN66TDQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GMMVSXQ6.mjs +0 -17
- package/dist/lib/node-esm/chunk-GMMVSXQ6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SHAMSMKQ.mjs +0 -29
- package/dist/lib/node-esm/chunk-SHAMSMKQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TYUGABTD.mjs +0 -22
- package/dist/lib/node-esm/chunk-TYUGABTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UVLACSAE.mjs +0 -830
- package/dist/lib/node-esm/chunk-UVLACSAE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YFRTKXTB.mjs +0 -80
- package/dist/lib/node-esm/chunk-YFRTKXTB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZNS55FS3.mjs +0 -97
- package/dist/lib/node-esm/chunk-ZNS55FS3.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DTBVWCNO.mjs +0 -63
- package/dist/lib/node-esm/intent-resolver-DTBVWCNO.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QWG7CJ5U.mjs +0 -212
- package/dist/lib/node-esm/react-surface-QWG7CJ5U.mjs.map +0 -7
- package/dist/lib/node-esm/settings-IBFFCGNL.mjs +0 -29
- package/dist/lib/node-esm/settings-IBFFCGNL.mjs.map +0 -7
- package/dist/lib/node-esm/state-K6EH7SRZ.mjs +0 -38
- package/dist/lib/node-esm/state-K6EH7SRZ.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit.mjs +0 -14
- package/dist/lib/node-esm/toolkit.mjs.map +0 -7
- package/dist/types/src/capabilities/anchor-sort.d.ts +0 -4
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -12
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -11
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/functions/create.d.ts.map +0 -1
- package/dist/types/src/functions/create.test.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -18
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/open.d.ts.map +0 -1
- package/dist/types/src/functions/update.d.ts.map +0 -1
- package/dist/types/src/functions/update.test.d.ts.map +0 -1
- package/dist/types/src/toolkit.d.ts +0 -3
- package/dist/types/src/toolkit.d.ts.map +0 -1
- package/src/capabilities/anchor-sort.ts +0 -31
- package/src/capabilities/app-graph-serializer.ts +0 -54
- package/src/capabilities/artifact-definition.ts +0 -112
- package/src/capabilities/blueprint-definition.ts +0 -43
- package/src/capabilities/capabilities.ts +0 -22
- package/src/capabilities/intent-resolver.ts +0 -58
- package/src/capabilities/react-surface.tsx +0 -93
- package/src/capabilities/settings.ts +0 -25
- package/src/capabilities/state.ts +0 -31
- package/src/events.ts +0 -11
- package/src/functions/create.conversations.json +0 -1
- package/src/functions/index.ts +0 -13
- package/src/functions/update.conversations.json +0 -1
- package/src/toolkit.ts +0 -6
- /package/dist/lib/browser/{MarkdownCard-TC3GGUSX.mjs.map → MarkdownCard-HFNNE4B4.mjs.map} +0 -0
- /package/dist/lib/browser/{MarkdownContainer-YF22DV4M.mjs.map → MarkdownContainer-V7EAADMF.mjs.map} +0 -0
- /package/dist/lib/browser/{blueprint-definition-HED54GGW.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{browser/toolkit.mjs.map → node-esm/MarkdownCard-GMNXUWWR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{MarkdownCard-FTEHVH7P.mjs.map → MarkdownContainer-LUSMORP2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{MarkdownContainer-L75AIJFM.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/types/src/{functions → blueprints/functions}/create.d.ts +0 -0
- /package/dist/types/src/{functions → blueprints/functions}/create.test.d.ts +0 -0
- /package/dist/types/src/{functions → blueprints/functions}/open.d.ts +0 -0
- /package/dist/types/src/{functions → blueprints/functions}/update.d.ts +0 -0
- /package/dist/types/src/{functions → blueprints/functions}/update.test.d.ts +0 -0
|
@@ -7,8 +7,8 @@ import React, { forwardRef, useEffect, useImperativeHandle } from 'react';
|
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { useDropzone } from 'react-dropzone';
|
|
9
9
|
|
|
10
|
-
import { type
|
|
11
|
-
import { addLink } from '@dxos/
|
|
10
|
+
import { type Common } from '@dxos/app-framework';
|
|
11
|
+
import { addLink } from '@dxos/ui-editor';
|
|
12
12
|
|
|
13
13
|
export const IMAGE_FILES = ['.jpg', '.jpeg', '.png', '.gif'];
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ export type FileUploadAction = () => void;
|
|
|
16
16
|
|
|
17
17
|
export type FileUploadProps = {
|
|
18
18
|
editorView?: EditorView;
|
|
19
|
-
onFileUpload?: (file: File) => Promise<FileInfo | undefined>;
|
|
19
|
+
onFileUpload?: (file: File) => Promise<Common.FileInfo | undefined>;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// TODO(burdon): Factor out.
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
|
-
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Filter, Obj } from '@dxos/echo';
|
|
11
|
-
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
12
11
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
13
13
|
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
14
14
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
15
15
|
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
16
16
|
import { translations as editorTranslations } from '@dxos/react-ui-editor';
|
|
17
|
-
import {
|
|
17
|
+
import { Layout } from '@dxos/react-ui-mosaic';
|
|
18
18
|
|
|
19
19
|
import { translations } from '../../translations';
|
|
20
20
|
import { Markdown } from '../../types';
|
|
@@ -30,19 +30,18 @@ const DefaultStory = (props: StoryProps) => {
|
|
|
30
30
|
const [doc] = useQuery(space?.db, Filter.type(Markdown.Document));
|
|
31
31
|
const id = doc && Obj.getDXN(doc).toString();
|
|
32
32
|
const attentionAttrs = useAttentionAttributes(id);
|
|
33
|
-
|
|
34
33
|
if (!id) {
|
|
35
34
|
return null;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
return (
|
|
39
38
|
<div className='contents' {...attentionAttrs}>
|
|
40
|
-
<
|
|
39
|
+
<Layout.Main toolbar>
|
|
41
40
|
<MarkdownEditor.Root id={id} object={doc} {...props}>
|
|
42
41
|
<MarkdownEditor.Toolbar id={id} />
|
|
43
42
|
<MarkdownEditor.Content />
|
|
44
43
|
</MarkdownEditor.Root>
|
|
45
|
-
</
|
|
44
|
+
</Layout.Main>
|
|
46
45
|
</div>
|
|
47
46
|
);
|
|
48
47
|
};
|
|
@@ -53,22 +52,22 @@ const meta: Meta<typeof DefaultStory> = {
|
|
|
53
52
|
render: DefaultStory as any,
|
|
54
53
|
decorators: [
|
|
55
54
|
withTheme,
|
|
56
|
-
withLayout({
|
|
57
|
-
// TODO(burdon): Create story without client.
|
|
55
|
+
withLayout({ layout: 'column' }),
|
|
58
56
|
withPluginManager({
|
|
59
57
|
plugins: [
|
|
58
|
+
...corePlugins(),
|
|
60
59
|
ClientPlugin({
|
|
61
60
|
types: [Markdown.Document],
|
|
62
|
-
onClientInitialized:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
onClientInitialized: ({ client }) =>
|
|
62
|
+
Effect.gen(function* () {
|
|
63
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
64
|
+
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
65
|
+
const space = client.spaces.default;
|
|
66
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
67
|
+
|
|
68
|
+
space.db.add(Markdown.make({ content }));
|
|
69
|
+
}),
|
|
69
70
|
}),
|
|
70
|
-
IntentPlugin(),
|
|
71
|
-
AttentionPlugin(),
|
|
72
71
|
],
|
|
73
72
|
}),
|
|
74
73
|
],
|
|
@@ -4,23 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension } from '@codemirror/state';
|
|
6
6
|
import { type EditorView } from '@codemirror/view';
|
|
7
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
7
8
|
import { createContext } from '@radix-ui/react-context';
|
|
8
9
|
import React, { type PropsWithChildren, useMemo, useState } from 'react';
|
|
9
10
|
import { createPortal } from 'react-dom';
|
|
10
11
|
|
|
11
12
|
import { Surface } from '@dxos/app-framework/react';
|
|
12
13
|
import { DXN } from '@dxos/keys';
|
|
13
|
-
import { type Live } from '@dxos/live-object';
|
|
14
14
|
import { useClient } from '@dxos/react-client';
|
|
15
15
|
import {
|
|
16
16
|
EditorMenuProvider,
|
|
17
17
|
type EditorToolbarState,
|
|
18
|
-
type PreviewBlock,
|
|
19
|
-
type PreviewOptions,
|
|
20
18
|
type UseEditorMenu,
|
|
21
19
|
useEditorMenu,
|
|
22
20
|
useEditorToolbar,
|
|
23
21
|
} from '@dxos/react-ui-editor';
|
|
22
|
+
import { type PreviewBlock, type PreviewOptions } from '@dxos/ui-editor';
|
|
24
23
|
import { isNonNullable } from '@dxos/util';
|
|
25
24
|
|
|
26
25
|
import {
|
|
@@ -49,10 +48,10 @@ type MarkdownEditorContextValue = {
|
|
|
49
48
|
setEditorView: (view: EditorView) => void;
|
|
50
49
|
extensions: Extension[];
|
|
51
50
|
previewBlocks: PreviewBlock[];
|
|
52
|
-
toolbarState:
|
|
51
|
+
toolbarState: Atom.Writable<EditorToolbarState>;
|
|
53
52
|
popoverMenu: Omit<UseEditorMenu, 'extension'>;
|
|
54
53
|
} & (Pick<ExtensionsOptions, 'viewMode'> &
|
|
55
|
-
Pick<NaturalMarkdownToolbarProps, 'editorView' | 'onFileUpload' | 'onViewModeChange'>);
|
|
54
|
+
Pick<NaturalMarkdownToolbarProps, 'editorView' | 'onAction' | 'onFileUpload' | 'onViewModeChange'>);
|
|
56
55
|
|
|
57
56
|
const [MarkdownEditorContextProvider, useMarkdownEditorContext] =
|
|
58
57
|
createContext<MarkdownEditorContextValue>('MarkdownEditor.Context');
|
|
@@ -65,7 +64,7 @@ type MarkdownEditorRootProps = PropsWithChildren<
|
|
|
65
64
|
{
|
|
66
65
|
object?: DocumentType;
|
|
67
66
|
extensions?: Extension[];
|
|
68
|
-
} & Pick<MarkdownEditorContextValue, 'id' | 'onFileUpload' | 'onViewModeChange' | 'viewMode'> &
|
|
67
|
+
} & Pick<MarkdownEditorContextValue, 'id' | 'onAction' | 'onFileUpload' | 'onViewModeChange' | 'viewMode'> &
|
|
69
68
|
Pick<UseEditorMenuOptionsProps, 'slashCommandGroups' | 'onLinkQuery'> &
|
|
70
69
|
Pick<ExtensionsOptions, 'editorStateStore' | 'selectionManager' | 'settings'>
|
|
71
70
|
>;
|
|
@@ -78,7 +77,7 @@ const MarkdownEditorRoot = ({
|
|
|
78
77
|
selectionManager,
|
|
79
78
|
settings,
|
|
80
79
|
viewMode,
|
|
81
|
-
extensions:
|
|
80
|
+
extensions: extensionsProp,
|
|
82
81
|
slashCommandGroups,
|
|
83
82
|
onLinkQuery,
|
|
84
83
|
...props
|
|
@@ -122,8 +121,8 @@ const MarkdownEditorRoot = ({
|
|
|
122
121
|
});
|
|
123
122
|
|
|
124
123
|
const extensions = useMemo(
|
|
125
|
-
() => [coreExtensions, menuExtension,
|
|
126
|
-
[coreExtensions, menuExtension,
|
|
124
|
+
() => [coreExtensions, menuExtension, extensionsProp].filter(isNonNullable),
|
|
125
|
+
[coreExtensions, menuExtension, extensionsProp],
|
|
127
126
|
);
|
|
128
127
|
|
|
129
128
|
return (
|
|
@@ -154,11 +153,11 @@ type MarkdownEditorContentProps = Omit<NaturalMarkdownEditorContentProps, 'id' |
|
|
|
154
153
|
const MarkdownEditorContent = (props: MarkdownEditorContentProps) => {
|
|
155
154
|
const {
|
|
156
155
|
id,
|
|
157
|
-
extensions,
|
|
158
156
|
editorView,
|
|
159
157
|
setEditorView,
|
|
160
|
-
toolbarState,
|
|
161
158
|
viewMode,
|
|
159
|
+
toolbarState,
|
|
160
|
+
extensions,
|
|
162
161
|
popoverMenu: { groupsRef, ...menuProps },
|
|
163
162
|
} = useMarkdownEditorContext(MarkdownEditorContent.displayName);
|
|
164
163
|
|
|
@@ -167,9 +166,9 @@ const MarkdownEditorContent = (props: MarkdownEditorContentProps) => {
|
|
|
167
166
|
<NaturalMarkdownEditorContent
|
|
168
167
|
{...props}
|
|
169
168
|
id={id}
|
|
170
|
-
extensions={extensions}
|
|
171
|
-
toolbarState={toolbarState}
|
|
172
169
|
viewMode={viewMode}
|
|
170
|
+
toolbarState={toolbarState}
|
|
171
|
+
extensions={extensions}
|
|
173
172
|
ref={setEditorView}
|
|
174
173
|
/>
|
|
175
174
|
</EditorMenuProvider>
|
|
@@ -184,7 +183,7 @@ MarkdownEditorContent.displayName = 'MarkdownEditor.Content';
|
|
|
184
183
|
|
|
185
184
|
type MarkdownEditorToolbarProps = Omit<
|
|
186
185
|
NaturalMarkdownToolbarProps,
|
|
187
|
-
'state' | 'editorView' | 'onFileUpload' | 'onViewModeChange'
|
|
186
|
+
'state' | 'editorView' | 'onAction' | 'onFileUpload' | 'onViewModeChange'
|
|
188
187
|
>;
|
|
189
188
|
|
|
190
189
|
const MarkdownEditorToolbar = (props: MarkdownEditorToolbarProps) => {
|
|
@@ -218,7 +217,7 @@ MarkdownEditorBlocks.displayName = 'MarkdownEditor.Blocks';
|
|
|
218
217
|
const PreviewBlock = ({ el, link }: PreviewBlock) => {
|
|
219
218
|
const client = useClient();
|
|
220
219
|
const dxn = DXN.parse(link.ref);
|
|
221
|
-
const subject = client.graph.
|
|
220
|
+
const subject = client.graph.makeRef(dxn).target;
|
|
222
221
|
const data = useMemo(() => ({ subject }), [subject]);
|
|
223
222
|
|
|
224
223
|
return createPortal(<Surface role='card--transclusion' data={data} limit={1} />, el);
|
|
@@ -3,28 +3,31 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type EditorView } from '@codemirror/view';
|
|
6
|
-
import
|
|
6
|
+
import { type Atom, RegistryContext } from '@effect-atom/atom-react';
|
|
7
|
+
import React, { forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
7
8
|
|
|
8
|
-
import { type
|
|
9
|
-
import { useDynamicRef, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import {
|
|
11
11
|
type EditorMenuGroup,
|
|
12
|
+
type EditorToolbarState,
|
|
13
|
+
type UseTextEditorProps,
|
|
14
|
+
useTextEditor,
|
|
15
|
+
} from '@dxos/react-ui-editor';
|
|
16
|
+
import {
|
|
12
17
|
type EditorSelectionState,
|
|
13
18
|
type EditorStateStore,
|
|
14
|
-
type EditorToolbarState,
|
|
15
19
|
type EditorViewMode,
|
|
16
|
-
type
|
|
20
|
+
type ThemeExtensionsOptions,
|
|
17
21
|
createBasicExtensions,
|
|
18
22
|
createMarkdownExtensions,
|
|
19
23
|
createThemeExtensions,
|
|
20
24
|
dropFile,
|
|
21
|
-
editorGutter,
|
|
22
25
|
editorSlots,
|
|
23
26
|
formattingListener,
|
|
24
27
|
processEditorPayload,
|
|
25
28
|
stackItemContentEditorClassNames,
|
|
26
|
-
|
|
27
|
-
} from '@dxos/
|
|
29
|
+
} from '@dxos/ui-editor';
|
|
30
|
+
import { mx } from '@dxos/ui-theme';
|
|
28
31
|
import { isTruthy } from '@dxos/util';
|
|
29
32
|
|
|
30
33
|
import { useSelectCurrentThread } from '../../hooks';
|
|
@@ -32,27 +35,51 @@ import { meta } from '../../meta';
|
|
|
32
35
|
|
|
33
36
|
import { type MarkdownEditorToolbarProps } from './MarkdownEditorToolbar';
|
|
34
37
|
|
|
35
|
-
export type MarkdownEditorContentProps = {
|
|
38
|
+
export type MarkdownEditorContentProps = ThemedClassName<{
|
|
36
39
|
id: string;
|
|
37
40
|
role?: string;
|
|
38
41
|
viewMode?: EditorViewMode;
|
|
39
42
|
scrollPastEnd?: boolean;
|
|
40
43
|
slashCommandGroups?: EditorMenuGroup[];
|
|
41
44
|
editorStateStore?: EditorStateStore;
|
|
42
|
-
toolbarState?:
|
|
45
|
+
toolbarState?: Atom.Writable<EditorToolbarState>;
|
|
43
46
|
onLinkQuery?: (query?: string) => Promise<EditorMenuGroup[]>;
|
|
44
|
-
}
|
|
47
|
+
}> &
|
|
48
|
+
// prettier-ignore
|
|
49
|
+
Pick<UseTextEditorProps, 'initialValue' | 'extensions'> &
|
|
50
|
+
Pick<MarkdownEditorToolbarProps, 'onFileUpload'> &
|
|
51
|
+
Pick<ThemeExtensionsOptions, 'slots'>;
|
|
45
52
|
|
|
46
53
|
export const MarkdownEditorContent = forwardRef<EditorView | null, MarkdownEditorContentProps>(
|
|
47
54
|
(
|
|
48
|
-
{
|
|
55
|
+
{
|
|
56
|
+
classNames,
|
|
57
|
+
id,
|
|
58
|
+
role,
|
|
59
|
+
viewMode,
|
|
60
|
+
initialValue,
|
|
61
|
+
editorStateStore,
|
|
62
|
+
toolbarState,
|
|
63
|
+
extensions,
|
|
64
|
+
scrollPastEnd,
|
|
65
|
+
slots = editorSlots,
|
|
66
|
+
onFileUpload,
|
|
67
|
+
},
|
|
49
68
|
forwardedRef,
|
|
50
69
|
) => {
|
|
51
70
|
const { t } = useTranslation(meta.id);
|
|
52
71
|
const { themeMode } = useThemeContext();
|
|
72
|
+
const registry = useContext(RegistryContext);
|
|
53
73
|
|
|
54
|
-
//
|
|
55
|
-
const
|
|
74
|
+
// Callback to update toolbar state atom.
|
|
75
|
+
const updateToolbarState = useCallback(
|
|
76
|
+
(formatting: EditorToolbarState) => {
|
|
77
|
+
if (toolbarState) {
|
|
78
|
+
registry.set(toolbarState, { ...registry.get(toolbarState), ...formatting });
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
[registry, toolbarState],
|
|
82
|
+
);
|
|
56
83
|
|
|
57
84
|
// Restore last selection and scroll point.
|
|
58
85
|
const { scrollTo, selection } = useMemo<EditorSelectionState>(() => editorStateStore?.getState(id) ?? {}, [id]);
|
|
@@ -81,12 +108,11 @@ export const MarkdownEditorContent = forwardRef<EditorView | null, MarkdownEdito
|
|
|
81
108
|
}),
|
|
82
109
|
createThemeExtensions({
|
|
83
110
|
themeMode,
|
|
84
|
-
slots
|
|
111
|
+
slots,
|
|
85
112
|
syntaxHighlighting: true,
|
|
86
113
|
}),
|
|
87
114
|
createMarkdownExtensions(),
|
|
88
|
-
formattingListener(
|
|
89
|
-
editorGutter,
|
|
115
|
+
toolbarState && formattingListener(updateToolbarState),
|
|
90
116
|
role !== 'section' &&
|
|
91
117
|
onFileUpload &&
|
|
92
118
|
dropFile({
|
|
@@ -116,7 +142,7 @@ export const MarkdownEditorContent = forwardRef<EditorView | null, MarkdownEdito
|
|
|
116
142
|
role='none'
|
|
117
143
|
ref={parentRef}
|
|
118
144
|
data-testid='composer.markdownRoot'
|
|
119
|
-
className={stackItemContentEditorClassNames(role)}
|
|
145
|
+
className={mx(stackItemContentEditorClassNames(role), classNames)}
|
|
120
146
|
data-popover-collision-boundary={true}
|
|
121
147
|
{...focusAttributes}
|
|
122
148
|
/>
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import { type EditorView } from '@codemirror/view';
|
|
6
6
|
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
8
|
+
import { type Common } from '@dxos/app-framework';
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
10
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
11
|
-
import { EditorToolbar, type EditorToolbarProps
|
|
11
|
+
import { EditorToolbar, type EditorToolbarProps } from '@dxos/react-ui-editor';
|
|
12
|
+
import { type EditorViewMode } from '@dxos/ui-editor';
|
|
12
13
|
|
|
13
14
|
import { FileUpload, type FileUploadAction } from './FileUpload';
|
|
14
15
|
|
|
@@ -16,8 +17,8 @@ export type MarkdownEditorToolbarProps = ThemedClassName<
|
|
|
16
17
|
{
|
|
17
18
|
id: string;
|
|
18
19
|
editorView?: EditorView;
|
|
19
|
-
onFileUpload?: (file: File) => Promise<FileInfo | undefined>;
|
|
20
|
-
} & Pick<EditorToolbarProps, 'role' | 'state' | 'customActions' | 'onViewModeChange'>
|
|
20
|
+
onFileUpload?: (file: File) => Promise<Common.FileInfo | undefined>;
|
|
21
|
+
} & Pick<EditorToolbarProps, 'role' | 'state' | 'customActions' | 'onAction' | 'onViewModeChange'>
|
|
21
22
|
>;
|
|
22
23
|
|
|
23
24
|
export const MarkdownEditorToolbar = ({
|
|
@@ -27,6 +28,7 @@ export const MarkdownEditorToolbar = ({
|
|
|
27
28
|
state,
|
|
28
29
|
editorView,
|
|
29
30
|
customActions,
|
|
31
|
+
onAction,
|
|
30
32
|
onFileUpload,
|
|
31
33
|
onViewModeChange,
|
|
32
34
|
}: MarkdownEditorToolbarProps) => {
|
|
@@ -53,6 +55,7 @@ export const MarkdownEditorToolbar = ({
|
|
|
53
55
|
state={state}
|
|
54
56
|
customActions={customActions}
|
|
55
57
|
getView={getView}
|
|
58
|
+
onAction={onAction}
|
|
56
59
|
onImageUpload={upload ?? undefined}
|
|
57
60
|
onViewModeChange={handleViewModeChange}
|
|
58
61
|
/>
|
|
@@ -5,13 +5,18 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { type EditorInputMode, EditorInputModes, type EditorViewMode, EditorViewModes } from '@dxos/react-ui-editor';
|
|
9
8
|
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
9
|
+
import { type EditorInputMode, EditorInputModes, type EditorViewMode, EditorViewModes } from '@dxos/ui-editor';
|
|
10
10
|
|
|
11
11
|
import { meta } from '../../meta';
|
|
12
12
|
import { type Markdown } from '../../types';
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export type MarkdownSettingsComponentProps = {
|
|
15
|
+
settings: Markdown.Settings;
|
|
16
|
+
onSettingsChange: (fn: (current: Markdown.Settings) => Markdown.Settings) => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const MarkdownSettings = ({ settings, onSettingsChange }: MarkdownSettingsComponentProps) => {
|
|
15
20
|
const { t } = useTranslation(meta.id);
|
|
16
21
|
|
|
17
22
|
// TODO(wittjosiah): Add skill test confirmation for entering vim mode.
|
|
@@ -23,7 +28,7 @@ export const MarkdownSettings = ({ settings }: { settings: Markdown.Settings })
|
|
|
23
28
|
<Select.Root
|
|
24
29
|
value={settings.defaultViewMode}
|
|
25
30
|
onValueChange={(value) => {
|
|
26
|
-
|
|
31
|
+
onSettingsChange((s) => ({ ...s, defaultViewMode: value as EditorViewMode }));
|
|
27
32
|
}}
|
|
28
33
|
>
|
|
29
34
|
<Select.TriggerButton />
|
|
@@ -46,7 +51,7 @@ export const MarkdownSettings = ({ settings }: { settings: Markdown.Settings })
|
|
|
46
51
|
<Select.Root
|
|
47
52
|
value={settings.editorInputMode ?? 'default'}
|
|
48
53
|
onValueChange={(value) => {
|
|
49
|
-
|
|
54
|
+
onSettingsChange((s) => ({ ...s, editorInputMode: value as EditorInputMode }));
|
|
50
55
|
}}
|
|
51
56
|
>
|
|
52
57
|
<Select.TriggerButton placeholder={t('select editor input mode placeholder')} />
|
|
@@ -66,29 +71,38 @@ export const MarkdownSettings = ({ settings }: { settings: Markdown.Settings })
|
|
|
66
71
|
</ControlItemInput>
|
|
67
72
|
|
|
68
73
|
<ControlItemInput title={t('settings toolbar label')}>
|
|
69
|
-
<Input.Switch
|
|
74
|
+
<Input.Switch
|
|
75
|
+
checked={settings.toolbar}
|
|
76
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, toolbar: !!checked }))}
|
|
77
|
+
/>
|
|
70
78
|
</ControlItemInput>
|
|
71
79
|
|
|
72
80
|
<ControlItemInput title={t('settings numbered headings label')}>
|
|
73
81
|
<Input.Switch
|
|
74
82
|
checked={settings.numberedHeadings}
|
|
75
|
-
onCheckedChange={(checked) => (
|
|
83
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, numberedHeadings: !!checked }))}
|
|
76
84
|
/>
|
|
77
85
|
</ControlItemInput>
|
|
78
86
|
|
|
79
87
|
<ControlItemInput title={t('settings folding label')}>
|
|
80
|
-
<Input.Switch
|
|
88
|
+
<Input.Switch
|
|
89
|
+
checked={settings.folding}
|
|
90
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, folding: !!checked }))}
|
|
91
|
+
/>
|
|
81
92
|
</ControlItemInput>
|
|
82
93
|
|
|
83
94
|
<ControlItemInput title={t('settings experimental label')}>
|
|
84
95
|
<Input.Switch
|
|
85
96
|
checked={settings.experimental}
|
|
86
|
-
onCheckedChange={(checked) => (
|
|
97
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, experimental: !!checked }))}
|
|
87
98
|
/>
|
|
88
99
|
</ControlItemInput>
|
|
89
100
|
|
|
90
101
|
<ControlItemInput title={t('settings debug label')}>
|
|
91
|
-
<Input.Switch
|
|
102
|
+
<Input.Switch
|
|
103
|
+
checked={settings.debug}
|
|
104
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, debug: !!checked }))}
|
|
105
|
+
/>
|
|
92
106
|
</ControlItemInput>
|
|
93
107
|
|
|
94
108
|
{settings.debug && (
|
|
@@ -96,7 +110,7 @@ export const MarkdownSettings = ({ settings }: { settings: Markdown.Settings })
|
|
|
96
110
|
<Input.TextArea
|
|
97
111
|
rows={5}
|
|
98
112
|
value={settings.typewriter}
|
|
99
|
-
onChange={({ target: { value } }) => (
|
|
113
|
+
onChange={({ target: { value } }) => onSettingsChange((s) => ({ ...s, typewriter: value }))}
|
|
100
114
|
placeholder={t('settings debug placeholder')}
|
|
101
115
|
/>
|
|
102
116
|
</ControlItemInput>
|
|
@@ -3,39 +3,34 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import * as Function from 'effect/Function';
|
|
7
8
|
import * as Match from 'effect/Match';
|
|
8
9
|
import * as Option from 'effect/Option';
|
|
9
10
|
import * as Schema from 'effect/Schema';
|
|
10
11
|
import React, { type FC, useEffect, useMemo, useState } from 'react';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
-
import { useCapability, useIntentDispatcher } from '@dxos/app-framework/react';
|
|
13
|
+
import { useAtomCapability, useCapability } from '@dxos/app-framework/react';
|
|
14
14
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
15
15
|
import { Obj, Ref, Type } from '@dxos/echo';
|
|
16
16
|
import { createDocAccessor, toCursorRange } from '@dxos/echo-db';
|
|
17
17
|
import { invariant } from '@dxos/invariant';
|
|
18
18
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
19
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
20
19
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
21
|
-
import {
|
|
22
|
-
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
23
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
20
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
24
21
|
import { faker } from '@dxos/random';
|
|
25
22
|
import { useQueue, useSpace } from '@dxos/react-client/echo';
|
|
26
23
|
import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
27
24
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { defaultTx } from '@dxos/react-ui-theme';
|
|
25
|
+
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
26
|
+
import { Layout } from '@dxos/react-ui-mosaic';
|
|
31
27
|
import { render } from '@dxos/storybook-utils';
|
|
32
28
|
import { Message } from '@dxos/types';
|
|
29
|
+
import { type EditorSelection, type Range } from '@dxos/ui-editor';
|
|
33
30
|
|
|
34
|
-
import { MarkdownCapabilities } from '../capabilities';
|
|
35
31
|
import { MarkdownPlugin } from '../MarkdownPlugin';
|
|
36
|
-
import { meta } from '../meta';
|
|
37
32
|
import { translations } from '../translations';
|
|
38
|
-
import { Markdown } from '../types';
|
|
33
|
+
import { Markdown, MarkdownCapabilities } from '../types';
|
|
39
34
|
|
|
40
35
|
import { MarkdownContainer } from './MarkdownContainer';
|
|
41
36
|
|
|
@@ -51,16 +46,15 @@ const TestItem = Schema.Struct({
|
|
|
51
46
|
description: 'Product description',
|
|
52
47
|
}),
|
|
53
48
|
}).pipe(
|
|
54
|
-
Type.
|
|
49
|
+
Type.object({
|
|
55
50
|
typename: 'dxos.org/type/Test',
|
|
56
51
|
version: '0.1.0',
|
|
57
52
|
}),
|
|
58
53
|
);
|
|
59
54
|
|
|
60
55
|
const TestChat: FC<{ doc: Markdown.Document; content: string }> = ({ doc, content }) => {
|
|
61
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
62
56
|
const { parentRef } = useTextEditor({ initialValue: content });
|
|
63
|
-
const
|
|
57
|
+
const editorState = useCapability(MarkdownCapabilities.EditorState);
|
|
64
58
|
|
|
65
59
|
const space = useSpace();
|
|
66
60
|
const queueDxn = useMemo(() => space && space.queues.create().dxn, [space]);
|
|
@@ -96,7 +90,7 @@ const TestChat: FC<{ doc: Markdown.Document; content: string }> = ({ doc, conten
|
|
|
96
90
|
|
|
97
91
|
// void dispatch(
|
|
98
92
|
// createIntent(CollaborationActions.InsertContent, {
|
|
99
|
-
// target: doc as any as
|
|
93
|
+
// target: doc as any as TestSchema.Expando,
|
|
100
94
|
// object: Ref.fromDXN(new DXN(DXN.kind.QUEUE, [...queue.dxn.parts, message.id])),
|
|
101
95
|
// at: cursor,
|
|
102
96
|
// label: 'Proposal',
|
|
@@ -105,20 +99,20 @@ const TestChat: FC<{ doc: Markdown.Document; content: string }> = ({ doc, conten
|
|
|
105
99
|
};
|
|
106
100
|
|
|
107
101
|
return (
|
|
108
|
-
<
|
|
102
|
+
<Layout.Main toolbar>
|
|
109
103
|
<Toolbar.Root>
|
|
110
104
|
<IconButton icon='ph--plus--regular' disabled={!queue} label='Insert' onClick={handleInsert} />
|
|
111
105
|
</Toolbar.Root>
|
|
112
106
|
<div ref={parentRef} className='p-4' />
|
|
113
|
-
</
|
|
107
|
+
</Layout.Main>
|
|
114
108
|
);
|
|
115
109
|
};
|
|
116
110
|
|
|
117
111
|
const DefaultStory = ({ document, chat }: { document: string; chat: string }) => {
|
|
118
112
|
const space = useSpace();
|
|
119
113
|
const [doc, setDoc] = useState<Markdown.Document>();
|
|
120
|
-
const settings =
|
|
121
|
-
const
|
|
114
|
+
const settings = useAtomCapability(MarkdownCapabilities.Settings);
|
|
115
|
+
const editorState = useCapability(MarkdownCapabilities.EditorState);
|
|
122
116
|
|
|
123
117
|
useEffect(() => {
|
|
124
118
|
if (!space) {
|
|
@@ -148,10 +142,9 @@ const DefaultStory = ({ document, chat }: { document: string; chat: string }) =>
|
|
|
148
142
|
return null;
|
|
149
143
|
}
|
|
150
144
|
|
|
151
|
-
// TODO(burdon): Layout issue.
|
|
152
145
|
return (
|
|
153
146
|
<div className='grid grid-cols-2 bs-full overflow-hidden'>
|
|
154
|
-
<MarkdownContainer id={doc.id}
|
|
147
|
+
<MarkdownContainer id={doc.id} subject={doc} settings={settings} editorStateStore={editorState} />
|
|
155
148
|
<TestChat doc={doc} content={chat} />
|
|
156
149
|
</div>
|
|
157
150
|
);
|
|
@@ -164,22 +157,18 @@ const storybook: Meta<typeof DefaultStory> = {
|
|
|
164
157
|
withTheme,
|
|
165
158
|
withPluginManager({
|
|
166
159
|
plugins: [
|
|
160
|
+
...corePlugins(),
|
|
161
|
+
StorybookPlugin({}),
|
|
167
162
|
ClientPlugin({
|
|
168
163
|
types: [Markdown.Document, TestItem],
|
|
169
|
-
onClientInitialized:
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
onClientInitialized: ({ client }) =>
|
|
165
|
+
Effect.gen(function* () {
|
|
166
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
167
|
+
}),
|
|
172
168
|
}),
|
|
173
|
-
SpacePlugin({}),
|
|
174
|
-
GraphPlugin(),
|
|
175
|
-
IntentPlugin(),
|
|
176
|
-
SettingsPlugin(),
|
|
177
169
|
|
|
178
|
-
// UI
|
|
179
|
-
ThemePlugin({ tx: defaultTx }),
|
|
180
170
|
MarkdownPlugin(),
|
|
181
171
|
PreviewPlugin(),
|
|
182
|
-
StorybookLayoutPlugin({}),
|
|
183
172
|
],
|
|
184
173
|
}),
|
|
185
174
|
],
|
package/src/components/index.ts
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
5
|
+
import { type LazyExoticComponent, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type MarkdownCard as MarkdownCardType } from './MarkdownCard';
|
|
8
|
+
import { type MarkdownContainer as MarkdownContainerType } from './MarkdownContainer';
|
|
6
9
|
|
|
7
10
|
export * from './MarkdownCard';
|
|
8
11
|
export * from './MarkdownContainer';
|
|
9
12
|
export * from './MarkdownSettings';
|
|
10
13
|
|
|
11
|
-
export const MarkdownCard = lazy(() => import('./MarkdownCard'));
|
|
12
|
-
export const MarkdownContainer = lazy(
|
|
14
|
+
export const MarkdownCard: LazyExoticComponent<typeof MarkdownCardType> = lazy(() => import('./MarkdownCard'));
|
|
15
|
+
export const MarkdownContainer: LazyExoticComponent<typeof MarkdownContainerType> = lazy(
|
|
16
|
+
() => import('./MarkdownContainer'),
|
|
17
|
+
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type EditorView } from '@codemirror/view';
|
|
6
6
|
import { useCallback, useMemo, useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import {
|
|
10
10
|
type EditorMenuGroup,
|
|
11
11
|
type UseEditorMenuProps,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
formattingCommands,
|
|
14
14
|
linkSlashCommands,
|
|
15
15
|
} from '@dxos/react-ui-editor';
|
|
16
|
+
import { Domino } from '@dxos/ui';
|
|
16
17
|
|
|
17
18
|
import { meta } from '../meta';
|
|
18
19
|
|
|
@@ -52,18 +53,14 @@ export const useEditorMenuOptions = ({
|
|
|
52
53
|
const trigger = onLinkQuery ? ['/', '@'] : ['/'];
|
|
53
54
|
const placeholder = {
|
|
54
55
|
delay: 3_000,
|
|
55
|
-
content: () =>
|
|
56
|
-
Domino.of('
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
),
|
|
64
|
-
Domino.of('span').text('for commands.'),
|
|
65
|
-
)
|
|
66
|
-
.build(),
|
|
56
|
+
content: () => {
|
|
57
|
+
const pressEl = Domino.of('span').text('Press');
|
|
58
|
+
const triggerEls = trigger.map((text) =>
|
|
59
|
+
Domino.of('span').classNames('mx-1 pli-1.5 pt-[1px] pb-[2px] border border-separator rounded-sm').text(text),
|
|
60
|
+
);
|
|
61
|
+
const forCommandsEl = Domino.of('span').text('for commands.');
|
|
62
|
+
return Domino.of('div').children(pressEl, ...triggerEls, forCommandsEl).root;
|
|
63
|
+
},
|
|
67
64
|
};
|
|
68
65
|
|
|
69
66
|
return { viewRef, getMenu, trigger, placeholder };
|