@dxos/plugin-markdown 0.8.4-main.3eb6e50203 → 0.8.4-main.422d1c7879
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/MarkdownSettings-62YSRY7L.mjs +32 -0
- package/dist/lib/browser/MarkdownSettings-62YSRY7L.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +47 -4
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/chunk-4KOZEH2H.mjs +121 -0
- package/dist/lib/browser/chunk-4KOZEH2H.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-QFPZONKP.mjs +158 -0
- package/dist/lib/browser/chunk-QFPZONKP.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +19 -13
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/create-YL5ELZWP.mjs +30 -0
- package/dist/lib/browser/create-YL5ELZWP.mjs.map +7 -0
- package/dist/lib/browser/create-markdown-LU5IDKMH.mjs +22 -0
- package/dist/lib/browser/create-markdown-LU5IDKMH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +544 -67
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-AFSOZZ6G.mjs +21 -0
- package/dist/lib/browser/open-AFSOZZ6G.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/scroll-to-anchor-IPXV32A6.mjs +49 -0
- package/dist/lib/browser/scroll-to-anchor-IPXV32A6.mjs.map +7 -0
- package/dist/lib/browser/set-view-mode-2QWB24RR.mjs +26 -0
- package/dist/lib/browser/set-view-mode-2QWB24RR.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -7
- package/dist/lib/browser/update-HZNVYBMO.mjs +45 -0
- package/dist/lib/browser/update-HZNVYBMO.mjs.map +7 -0
- package/dist/lib/node-esm/MarkdownSettings-QMPISOEU.mjs +33 -0
- package/dist/lib/node-esm/MarkdownSettings-QMPISOEU.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +47 -4
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-3OPDJJJH.mjs +122 -0
- package/dist/lib/node-esm/chunk-3OPDJJJH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-JUGS6RKO.mjs +159 -0
- package/dist/lib/node-esm/chunk-JUGS6RKO.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +19 -13
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/create-SMQAIM3V.mjs +31 -0
- package/dist/lib/node-esm/create-SMQAIM3V.mjs.map +7 -0
- package/dist/lib/node-esm/create-markdown-X2OASYKG.mjs +23 -0
- package/dist/lib/node-esm/create-markdown-X2OASYKG.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +544 -67
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-SRWLLOKE.mjs +22 -0
- package/dist/lib/node-esm/open-SRWLLOKE.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-to-anchor-M76GXKYQ.mjs +50 -0
- package/dist/lib/node-esm/scroll-to-anchor-M76GXKYQ.mjs.map +7 -0
- package/dist/lib/node-esm/set-view-mode-6BB6KIDS.mjs +27 -0
- package/dist/lib/node-esm/set-view-mode-6BB6KIDS.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -7
- package/dist/lib/node-esm/update-4CELTLXK.mjs +46 -0
- package/dist/lib/node-esm/update-4CELTLXK.mjs.map +7 -0
- package/dist/types/src/MarkdownPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +1 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/markdown-blueprint.d.ts +3 -20
- package/dist/types/src/blueprints/markdown-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort.d.ts +6 -0
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +5 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts +5 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +9 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +4 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +6 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts +25 -22
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts +3 -3
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts +4 -2
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts +5 -4
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts +4 -6
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.stories.d.ts +94 -0
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownSettings/index.d.ts +1 -1
- package/dist/types/src/components/MarkdownSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/MarkdownCard/MarkdownCard.d.ts +1 -1
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownCard/index.d.ts +2 -0
- package/dist/types/src/containers/MarkdownCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownCard/snippet.d.ts +17 -0
- package/dist/types/src/containers/MarkdownCard/snippet.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.d.ts +36 -0
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.stories.d.ts +77 -0
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownContainer/index.d.ts +3 -0
- package/dist/types/src/containers/MarkdownContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.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/useExtensions.d.ts +8 -5
- package/dist/types/src/hooks/useExtensions.d.ts.map +1 -1
- package/dist/types/src/hooks/useLinkQuery.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-markdown.d.ts +5 -0
- package/dist/types/src/operations/create-markdown.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/create.test.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +64 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/scroll-to-anchor.d.ts +5 -0
- package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -0
- package/dist/types/src/operations/set-view-mode.d.ts +5 -0
- package/dist/types/src/operations/set-view-mode.d.ts.map +1 -0
- package/dist/types/src/operations/update.d.ts +5 -0
- package/dist/types/src/operations/update.d.ts.map +1 -0
- package/dist/types/src/operations/update.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +48 -59
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Markdown.d.ts +17 -18
- package/dist/types/src/types/Markdown.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +17 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +13 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +2 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +77 -68
- package/src/MarkdownPlugin.tsx +28 -24
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/markdown-blueprint.ts +14 -8
- package/src/capabilities/{anchor-sort/anchor-sort.ts → anchor-sort.ts} +1 -1
- package/src/capabilities/{app-graph-serializer/app-graph-serializer.ts → app-graph-serializer.ts} +11 -6
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +3 -3
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/index.ts +13 -7
- package/src/capabilities/node.ts +11 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +121 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +2 -2
- package/src/capabilities/state.ts +47 -0
- package/src/cli/plugin.ts +16 -7
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +38 -34
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +125 -94
- package/src/components/MarkdownEditor/MarkdownEditorContent.tsx +25 -17
- package/src/components/MarkdownEditor/MarkdownEditorToolbar.tsx +36 -55
- package/src/components/MarkdownSettings/MarkdownSettings.stories.tsx +39 -0
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +22 -109
- package/src/components/MarkdownSettings/index.ts +1 -1
- package/src/components/index.ts +4 -12
- package/src/{components → containers}/MarkdownCard/MarkdownCard.stories.tsx +20 -11
- package/src/containers/MarkdownCard/MarkdownCard.tsx +68 -0
- package/src/containers/MarkdownCard/index.ts +5 -0
- package/src/containers/MarkdownCard/snippet.ts +52 -0
- package/src/{components → containers/MarkdownContainer}/MarkdownContainer.stories.tsx +34 -22
- package/src/containers/MarkdownContainer/MarkdownContainer.tsx +145 -0
- package/src/containers/MarkdownContainer/index.ts +6 -0
- package/src/containers/index.ts +10 -0
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useEditorMenuOptions.ts +3 -3
- package/src/hooks/useExtensions.tsx +82 -93
- package/src/hooks/useLinkQuery.ts +28 -3
- package/src/index.ts +2 -1
- package/src/meta.ts +1 -1
- package/src/operations/create-markdown.ts +20 -0
- package/src/operations/create.conversations.json +1 -0
- package/src/{blueprints/functions → operations}/create.test.ts +26 -20
- package/src/operations/create.ts +27 -0
- package/src/operations/definitions.ts +120 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/open.ts +25 -0
- package/src/operations/scroll-to-anchor.ts +39 -0
- package/src/operations/set-view-mode.ts +24 -0
- package/src/operations/update.conversations.json +1 -0
- package/src/{blueprints/functions → operations}/update.test.ts +46 -46
- package/src/operations/update.ts +51 -0
- package/src/testing.ts +1 -1
- package/src/translations.ts +24 -36
- package/src/types/Markdown.ts +18 -25
- package/src/types/Settings.ts +65 -0
- package/src/types/capabilities.ts +17 -5
- package/src/types/events.ts +2 -2
- package/src/types/index.ts +3 -4
- package/src/util.tsx +5 -5
- package/dist/lib/browser/MarkdownCard-7VIO7R66.mjs +0 -11
- package/dist/lib/browser/MarkdownContainer-6E43EDAU.mjs +0 -11
- package/dist/lib/browser/anchor-sort-JBAZRPE7.mjs +0 -33
- package/dist/lib/browser/anchor-sort-JBAZRPE7.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-6Q5YBUPW.mjs +0 -59
- package/dist/lib/browser/app-graph-serializer-6Q5YBUPW.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-6HOAW2E6.mjs +0 -20
- package/dist/lib/browser/blueprint-definition-6HOAW2E6.mjs.map +0 -7
- package/dist/lib/browser/chunk-2AAD3W6X.mjs +0 -57
- package/dist/lib/browser/chunk-2AAD3W6X.mjs.map +0 -7
- package/dist/lib/browser/chunk-4GT3QWMK.mjs +0 -167
- package/dist/lib/browser/chunk-4GT3QWMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-6SM75KL3.mjs +0 -8
- package/dist/lib/browser/chunk-6SM75KL3.mjs.map +0 -7
- package/dist/lib/browser/chunk-7AQTX6D5.mjs +0 -105
- package/dist/lib/browser/chunk-7AQTX6D5.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZZFREFN.mjs +0 -58
- package/dist/lib/browser/chunk-EZZFREFN.mjs.map +0 -7
- package/dist/lib/browser/chunk-HHRUUWGH.mjs +0 -796
- package/dist/lib/browser/chunk-HHRUUWGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-HQTBT5IY.mjs +0 -176
- package/dist/lib/browser/chunk-HQTBT5IY.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-UBQUPSXC.mjs +0 -53
- package/dist/lib/browser/operation-resolver-UBQUPSXC.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7Z6AB26V.mjs +0 -213
- package/dist/lib/browser/react-surface-7Z6AB26V.mjs.map +0 -7
- package/dist/lib/browser/settings-V2XOFSD5.mjs +0 -36
- package/dist/lib/browser/settings-V2XOFSD5.mjs.map +0 -7
- package/dist/lib/browser/state-6Y3JB64H.mjs +0 -29
- package/dist/lib/browser/state-6Y3JB64H.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownCard-YC3R2TQW.mjs +0 -12
- package/dist/lib/node-esm/MarkdownCard-YC3R2TQW.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownContainer-TTRUOXU6.mjs +0 -12
- package/dist/lib/node-esm/MarkdownContainer-TTRUOXU6.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-IQMDZRA3.mjs +0 -34
- package/dist/lib/node-esm/anchor-sort-IQMDZRA3.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-STEPJH57.mjs +0 -60
- package/dist/lib/node-esm/app-graph-serializer-STEPJH57.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-UGDFF5OZ.mjs +0 -21
- package/dist/lib/node-esm/blueprint-definition-UGDFF5OZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AGZOFIK2.mjs +0 -10
- package/dist/lib/node-esm/chunk-AGZOFIK2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D46D75SK.mjs +0 -797
- package/dist/lib/node-esm/chunk-D46D75SK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCKB3AVD.mjs +0 -59
- package/dist/lib/node-esm/chunk-DCKB3AVD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K2IIYNCG.mjs +0 -106
- package/dist/lib/node-esm/chunk-K2IIYNCG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LOZVC2WA.mjs +0 -177
- package/dist/lib/node-esm/chunk-LOZVC2WA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MLZQCT2N.mjs +0 -58
- package/dist/lib/node-esm/chunk-MLZQCT2N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-USKAPINH.mjs +0 -168
- package/dist/lib/node-esm/chunk-USKAPINH.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-QAGXDA5E.mjs +0 -54
- package/dist/lib/node-esm/operation-resolver-QAGXDA5E.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-VIXAH5CF.mjs +0 -214
- package/dist/lib/node-esm/react-surface-VIXAH5CF.mjs.map +0 -7
- package/dist/lib/node-esm/settings-EXSH2KF4.mjs +0 -37
- package/dist/lib/node-esm/settings-EXSH2KF4.mjs.map +0 -7
- package/dist/lib/node-esm/state-TVF2XT2T.mjs +0 -30
- package/dist/lib/node-esm/state-TVF2XT2T.mjs.map +0 -7
- package/dist/types/src/blueprints/functions/create.d.ts +0 -8
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/create.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts +0 -4
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/open.d.ts +0 -14
- package/dist/types/src/blueprints/functions/open.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/update.d.ts +0 -19
- package/dist/types/src/blueprints/functions/update.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/update.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +0 -6
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +0 -1
- package/dist/types/src/capabilities/anchor-sort/index.d.ts +0 -3
- package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +0 -5
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +0 -5
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -11
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -3
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -7
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -3
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts +0 -5
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/MarkdownCard.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/index.d.ts +0 -4
- package/dist/types/src/components/MarkdownCard/index.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownContainer.d.ts +0 -28
- package/dist/types/src/components/MarkdownContainer.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownContainer.stories.d.ts +0 -88
- package/dist/types/src/components/MarkdownContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Suggestions.stories.d.ts +0 -11
- package/dist/types/src/components/Suggestions.stories.d.ts.map +0 -1
- package/dist/types/src/hooks/useSelectCurrentThread.d.ts +0 -6
- package/dist/types/src/hooks/useSelectCurrentThread.d.ts.map +0 -1
- package/dist/types/src/types/MarkdownAction.d.ts +0 -66
- package/dist/types/src/types/MarkdownAction.d.ts.map +0 -1
- package/src/blueprints/functions/create.conversations.json +0 -1
- package/src/blueprints/functions/create.ts +0 -35
- package/src/blueprints/functions/index.ts +0 -7
- package/src/blueprints/functions/open.ts +0 -33
- package/src/blueprints/functions/update.conversations.json +0 -1
- package/src/blueprints/functions/update.ts +0 -79
- package/src/capabilities/anchor-sort/index.ts +0 -7
- package/src/capabilities/app-graph-serializer/index.ts +0 -7
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -26
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -45
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -102
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/state/state.ts +0 -31
- package/src/components/MarkdownCard/MarkdownCard.tsx +0 -64
- package/src/components/MarkdownCard/index.ts +0 -9
- package/src/components/MarkdownContainer.tsx +0 -113
- package/src/components/Suggestions.stories.tsx +0 -215
- package/src/hooks/useSelectCurrentThread.tsx +0 -61
- package/src/types/MarkdownAction.ts +0 -59
- /package/dist/lib/browser/{MarkdownCard-7VIO7R66.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/MarkdownContainer-6E43EDAU.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/MarkdownCard/MarkdownCard.stories.d.ts +0 -0
- /package/dist/types/src/{blueprints/functions → operations}/create.test.d.ts +0 -0
- /package/dist/types/src/{blueprints/functions → operations}/update.test.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-markdown",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.422d1c7879",
|
|
4
4
|
"description": "DXOS Surface plugin for interacting with Markdown",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,22 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#blueprints": "./src/blueprints/index.ts",
|
|
17
|
+
"#capabilities": {
|
|
18
|
+
"source": "./src/capabilities/index.ts",
|
|
19
|
+
"types": "./src/capabilities/index.ts",
|
|
20
|
+
"browser": "./src/capabilities/index.ts",
|
|
21
|
+
"node": "./src/capabilities/node.ts"
|
|
22
|
+
},
|
|
23
|
+
"#components": "./src/components/index.ts",
|
|
24
|
+
"#containers": "./src/containers/index.ts",
|
|
25
|
+
"#hooks": "./src/hooks/index.ts",
|
|
26
|
+
"#meta": "./src/meta.ts",
|
|
27
|
+
"#operations": "./src/operations/index.ts",
|
|
28
|
+
"#testing": "./src/testing.ts",
|
|
29
|
+
"#types": "./src/types/index.ts"
|
|
30
|
+
},
|
|
15
31
|
"exports": {
|
|
16
32
|
".": {
|
|
17
33
|
"source": "./src/index.ts",
|
|
@@ -31,33 +47,26 @@
|
|
|
31
47
|
"browser": "./dist/lib/browser/cli/index.mjs",
|
|
32
48
|
"node": "./dist/lib/node-esm/cli/index.mjs"
|
|
33
49
|
},
|
|
34
|
-
"./
|
|
35
|
-
"source": "./src/
|
|
36
|
-
"types": "./dist/types/src/
|
|
37
|
-
"browser": "./dist/lib/browser/
|
|
38
|
-
"node": "./dist/lib/node-esm/
|
|
50
|
+
"./operations": {
|
|
51
|
+
"source": "./src/operations/index.ts",
|
|
52
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
53
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
54
|
+
"node": "./dist/lib/node-esm/operations/index.mjs"
|
|
39
55
|
},
|
|
40
56
|
"./testing": {
|
|
41
57
|
"source": "./src/testing.ts",
|
|
42
58
|
"types": "./dist/types/src/testing.d.ts",
|
|
43
59
|
"browser": "./dist/lib/browser/testing.mjs",
|
|
44
60
|
"node": "./dist/lib/node-esm/testing.mjs"
|
|
61
|
+
},
|
|
62
|
+
"./types": {
|
|
63
|
+
"source": "./src/types/index.ts",
|
|
64
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
65
|
+
"browser": "./dist/lib/browser/types/index.mjs",
|
|
66
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
45
67
|
}
|
|
46
68
|
},
|
|
47
69
|
"types": "dist/types/src/index.d.ts",
|
|
48
|
-
"typesVersions": {
|
|
49
|
-
"*": {
|
|
50
|
-
"blueprints": [
|
|
51
|
-
"dist/types/src/blueprints/index.d.ts"
|
|
52
|
-
],
|
|
53
|
-
"toolkit": [
|
|
54
|
-
"dist/types/src/toolkit.d.ts"
|
|
55
|
-
],
|
|
56
|
-
"types": [
|
|
57
|
-
"dist/types/src/types/index.d.ts"
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
70
|
"files": [
|
|
62
71
|
"dist",
|
|
63
72
|
"src"
|
|
@@ -73,69 +82,69 @@
|
|
|
73
82
|
"@effect/experimental": "0.58.0",
|
|
74
83
|
"@radix-ui/react-context": "1.1.1",
|
|
75
84
|
"react-dropzone": "^14.2.3",
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/app-toolkit": "0.8.4-main.
|
|
79
|
-
"@dxos/assistant": "0.8.4-main.
|
|
80
|
-
"@dxos/async": "0.8.4-main.
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/echo": "0.8.4-main.
|
|
84
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/functions
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/log": "0.8.4-main.
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/plugin-attention": "0.8.4-main.
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/plugin-
|
|
95
|
-
"@dxos/plugin-
|
|
96
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
97
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
100
|
-
"@dxos/react-hooks": "0.8.4-main.
|
|
101
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/react-ui-
|
|
104
|
-
"@dxos/react-ui-
|
|
105
|
-
"@dxos/react-ui-
|
|
106
|
-
"@dxos/react-ui-
|
|
107
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/ui-editor": "0.8.4-main.
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/
|
|
85
|
+
"@dxos/app-framework": "0.8.4-main.422d1c7879",
|
|
86
|
+
"@dxos/ai": "0.8.4-main.422d1c7879",
|
|
87
|
+
"@dxos/app-toolkit": "0.8.4-main.422d1c7879",
|
|
88
|
+
"@dxos/assistant": "0.8.4-main.422d1c7879",
|
|
89
|
+
"@dxos/async": "0.8.4-main.422d1c7879",
|
|
90
|
+
"@dxos/client-protocol": "0.8.4-main.422d1c7879",
|
|
91
|
+
"@dxos/blueprints": "0.8.4-main.422d1c7879",
|
|
92
|
+
"@dxos/echo": "0.8.4-main.422d1c7879",
|
|
93
|
+
"@dxos/echo-db": "0.8.4-main.422d1c7879",
|
|
94
|
+
"@dxos/effect": "0.8.4-main.422d1c7879",
|
|
95
|
+
"@dxos/functions": "0.8.4-main.422d1c7879",
|
|
96
|
+
"@dxos/functions-runtime": "0.8.4-main.422d1c7879",
|
|
97
|
+
"@dxos/keys": "0.8.4-main.422d1c7879",
|
|
98
|
+
"@dxos/invariant": "0.8.4-main.422d1c7879",
|
|
99
|
+
"@dxos/log": "0.8.4-main.422d1c7879",
|
|
100
|
+
"@dxos/operation": "0.8.4-main.422d1c7879",
|
|
101
|
+
"@dxos/plugin-attention": "0.8.4-main.422d1c7879",
|
|
102
|
+
"@dxos/plugin-client": "0.8.4-main.422d1c7879",
|
|
103
|
+
"@dxos/plugin-deck": "0.8.4-main.422d1c7879",
|
|
104
|
+
"@dxos/plugin-preview": "0.8.4-main.422d1c7879",
|
|
105
|
+
"@dxos/plugin-graph": "0.8.4-main.422d1c7879",
|
|
106
|
+
"@dxos/plugin-space": "0.8.4-main.422d1c7879",
|
|
107
|
+
"@dxos/react-client": "0.8.4-main.422d1c7879",
|
|
108
|
+
"@dxos/plugin-theme": "0.8.4-main.422d1c7879",
|
|
109
|
+
"@dxos/react-hooks": "0.8.4-main.422d1c7879",
|
|
110
|
+
"@dxos/react-ui-attention": "0.8.4-main.422d1c7879",
|
|
111
|
+
"@dxos/lit-ui": "0.8.4-main.422d1c7879",
|
|
112
|
+
"@dxos/react-ui-form": "0.8.4-main.422d1c7879",
|
|
113
|
+
"@dxos/react-ui-editor": "0.8.4-main.422d1c7879",
|
|
114
|
+
"@dxos/react-ui-menu": "0.8.4-main.422d1c7879",
|
|
115
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.422d1c7879",
|
|
116
|
+
"@dxos/react-ui-stack": "0.8.4-main.422d1c7879",
|
|
117
|
+
"@dxos/types": "0.8.4-main.422d1c7879",
|
|
118
|
+
"@dxos/ui": "0.8.4-main.422d1c7879",
|
|
119
|
+
"@dxos/ui-editor": "0.8.4-main.422d1c7879",
|
|
120
|
+
"@dxos/util": "0.8.4-main.422d1c7879",
|
|
121
|
+
"@dxos/schema": "0.8.4-main.422d1c7879"
|
|
113
122
|
},
|
|
114
123
|
"devDependencies": {
|
|
115
124
|
"@effect-atom/atom-react": "^0.5.0",
|
|
116
125
|
"@effect/platform": "0.94.4",
|
|
117
126
|
"@types/react": "~19.2.7",
|
|
118
127
|
"@types/react-dom": "~19.2.3",
|
|
119
|
-
"effect": "3.
|
|
128
|
+
"effect": "3.20.0",
|
|
120
129
|
"react": "~19.2.3",
|
|
121
130
|
"react-dom": "~19.2.3",
|
|
122
|
-
"vite": "7.1.
|
|
123
|
-
"@dxos/
|
|
124
|
-
"@dxos/
|
|
125
|
-
"@dxos/
|
|
126
|
-
"@dxos/
|
|
127
|
-
"@dxos/
|
|
128
|
-
"@dxos/
|
|
129
|
-
"@dxos/
|
|
131
|
+
"vite": "^7.1.11",
|
|
132
|
+
"@dxos/debug": "0.8.4-main.422d1c7879",
|
|
133
|
+
"@dxos/plugin-testing": "0.8.4-main.422d1c7879",
|
|
134
|
+
"@dxos/plugin-theme": "0.8.4-main.422d1c7879",
|
|
135
|
+
"@dxos/react-ui": "0.8.4-main.422d1c7879",
|
|
136
|
+
"@dxos/storybook-utils": "0.8.4-main.422d1c7879",
|
|
137
|
+
"@dxos/random": "0.8.4-main.422d1c7879",
|
|
138
|
+
"@dxos/ui-theme": "0.8.4-main.422d1c7879"
|
|
130
139
|
},
|
|
131
140
|
"peerDependencies": {
|
|
132
141
|
"@effect-atom/atom-react": "^0.5.0",
|
|
133
142
|
"@effect/platform": "0.94.4",
|
|
134
|
-
"effect": "3.
|
|
143
|
+
"effect": "3.20.0",
|
|
135
144
|
"react": "~19.2.3",
|
|
136
145
|
"react-dom": "~19.2.3",
|
|
137
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
138
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
146
|
+
"@dxos/ui-theme": "0.8.4-main.422d1c7879",
|
|
147
|
+
"@dxos/react-ui": "0.8.4-main.422d1c7879"
|
|
139
148
|
},
|
|
140
149
|
"publishConfig": {
|
|
141
150
|
"access": "public"
|
package/src/MarkdownPlugin.tsx
CHANGED
|
@@ -3,30 +3,33 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import { Plugin } from '@dxos/app-framework';
|
|
8
9
|
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
9
|
-
import { type Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { Annotation, type Obj, Ref } from '@dxos/echo';
|
|
10
11
|
import { createDocAccessor, getTextInRange } from '@dxos/echo-db';
|
|
11
12
|
import { Operation } from '@dxos/operation';
|
|
12
|
-
import {
|
|
13
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
13
14
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
14
15
|
import { translations as editorTranslations } from '@dxos/react-ui-editor';
|
|
15
16
|
import { Text } from '@dxos/schema';
|
|
16
17
|
|
|
17
|
-
import { MarkdownBlueprint } from '
|
|
18
|
+
import { MarkdownBlueprint } from '#blueprints';
|
|
18
19
|
import {
|
|
19
20
|
AnchorSort,
|
|
20
21
|
AppGraphSerializer,
|
|
21
22
|
BlueprintDefinition,
|
|
22
23
|
MarkdownSettings,
|
|
23
24
|
MarkdownState,
|
|
24
|
-
|
|
25
|
+
OperationHandler,
|
|
25
26
|
ReactSurface,
|
|
26
|
-
} from '
|
|
27
|
-
import { meta } from '
|
|
27
|
+
} from '#capabilities';
|
|
28
|
+
import { meta } from '#meta';
|
|
29
|
+
import { MarkdownOperation } from '#operations';
|
|
30
|
+
import { Markdown, MarkdownEvents } from '#types';
|
|
31
|
+
|
|
28
32
|
import { translations } from './translations';
|
|
29
|
-
import { Markdown, MarkdownEvents, MarkdownOperation } from './types';
|
|
30
33
|
import { serializer } from './util';
|
|
31
34
|
|
|
32
35
|
export const MarkdownPlugin = Plugin.define(meta).pipe(
|
|
@@ -35,10 +38,11 @@ export const MarkdownPlugin = Plugin.define(meta).pipe(
|
|
|
35
38
|
metadata: {
|
|
36
39
|
id: Markdown.Document.typename,
|
|
37
40
|
metadata: {
|
|
41
|
+
// TODO(dmaretskyi): Remove label, icon and iconHue and query them of schema.
|
|
38
42
|
label: (object: Markdown.Document) => object.name || object.fallbackName,
|
|
39
|
-
icon:
|
|
40
|
-
iconHue: '
|
|
41
|
-
blueprints: [MarkdownBlueprint.
|
|
43
|
+
icon: Annotation.IconAnnotation.get(Markdown.Document).pipe(Option.getOrThrow).icon,
|
|
44
|
+
iconHue: Annotation.IconAnnotation.get(Markdown.Document).pipe(Option.getOrThrow).hue ?? 'white',
|
|
45
|
+
blueprints: [MarkdownBlueprint.key],
|
|
42
46
|
graphProps: {
|
|
43
47
|
managesAutofocus: true,
|
|
44
48
|
},
|
|
@@ -54,15 +58,25 @@ export const MarkdownPlugin = Plugin.define(meta).pipe(
|
|
|
54
58
|
return getTextInRange(createDocAccessor(doc.content.target!, ['content']), start, end);
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
|
-
createObject: ((props
|
|
61
|
+
createObject: ((props, options) =>
|
|
62
|
+
Effect.gen(function* () {
|
|
63
|
+
const object = Markdown.make(props);
|
|
64
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
65
|
+
object,
|
|
66
|
+
target: options.target,
|
|
67
|
+
hidden: true,
|
|
68
|
+
targetNodeId: options.targetNodeId,
|
|
69
|
+
});
|
|
70
|
+
})) satisfies CreateObject,
|
|
71
|
+
scrollToAnchor: MarkdownOperation.ScrollToAnchor,
|
|
58
72
|
},
|
|
59
73
|
},
|
|
60
74
|
}),
|
|
61
|
-
AppPlugin.
|
|
75
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
62
76
|
AppPlugin.addSchemaModule({ schema: [Markdown.Document, Text.Text] }),
|
|
63
77
|
AppPlugin.addSurfaceModule({
|
|
64
78
|
activate: ReactSurface,
|
|
65
|
-
|
|
79
|
+
firesBeforeActivation: [MarkdownEvents.SetupExtensions],
|
|
66
80
|
}),
|
|
67
81
|
AppPlugin.addTranslationsModule({ translations: [...translations, ...editorTranslations] }),
|
|
68
82
|
Plugin.addModule({
|
|
@@ -77,16 +91,6 @@ export const MarkdownPlugin = Plugin.define(meta).pipe(
|
|
|
77
91
|
activatesOn: AppActivationEvents.SetupSettings,
|
|
78
92
|
activate: MarkdownState,
|
|
79
93
|
}),
|
|
80
|
-
Plugin.addModule({
|
|
81
|
-
id: 'on-space-created',
|
|
82
|
-
activatesOn: SpaceEvents.SpaceCreated,
|
|
83
|
-
activate: () =>
|
|
84
|
-
Effect.succeed(
|
|
85
|
-
Capability.contributes(SpaceCapabilities.OnCreateSpace, (params) =>
|
|
86
|
-
Operation.invoke(MarkdownOperation.OnCreateSpace, params),
|
|
87
|
-
),
|
|
88
|
-
),
|
|
89
|
-
}),
|
|
90
94
|
Plugin.addModule({
|
|
91
95
|
activatesOn: AppActivationEvents.AppGraphReady,
|
|
92
96
|
activate: AppGraphSerializer,
|
package/src/blueprints/index.ts
CHANGED
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
5
6
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
6
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
7
7
|
import { trim } from '@dxos/util';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Create, Open, Update } from '../operations/definitions';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.markdown';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const make = () =>
|
|
13
|
+
const make = () =>
|
|
16
14
|
Blueprint.make({
|
|
17
|
-
key:
|
|
15
|
+
key: BLUEPRINT_KEY,
|
|
18
16
|
name: 'Markdown',
|
|
19
|
-
|
|
17
|
+
description: 'Work with markdown documents. Preferred over raw database operations.',
|
|
18
|
+
tools: Blueprint.toolDefinitions({ operations: [Create, Open, Update] }),
|
|
20
19
|
instructions: Template.make({
|
|
21
20
|
// TODO(wittjosiah): Move example to function input schema annotation.
|
|
22
21
|
source: trim`
|
|
@@ -36,3 +35,10 @@ export const make = () =>
|
|
|
36
35
|
`,
|
|
37
36
|
}),
|
|
38
37
|
});
|
|
38
|
+
|
|
39
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
40
|
+
key: BLUEPRINT_KEY,
|
|
41
|
+
make,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default blueprint;
|
|
@@ -10,7 +10,7 @@ import { Relation } from '@dxos/echo';
|
|
|
10
10
|
import { createDocAccessor, getRangeFromCursor } from '@dxos/echo-db';
|
|
11
11
|
import { type AnchoredTo } from '@dxos/types';
|
|
12
12
|
|
|
13
|
-
import { Markdown } from '
|
|
13
|
+
import { Markdown } from '#types';
|
|
14
14
|
|
|
15
15
|
export default Capability.makeModule(() =>
|
|
16
16
|
Effect.succeed(
|
package/src/capabilities/{app-graph-serializer/app-graph-serializer.ts → app-graph-serializer.ts}
RENAMED
|
@@ -7,12 +7,14 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
|
-
import {
|
|
10
|
+
import { Collection } from '@dxos/echo';
|
|
11
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
11
12
|
import { isSpace } from '@dxos/react-client/echo';
|
|
12
|
-
import { Collection } from '@dxos/schema';
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
import { Markdown
|
|
14
|
+
import { MarkdownOperation } from '#operations';
|
|
15
|
+
import { Markdown } from '#types';
|
|
16
|
+
|
|
17
|
+
import { translations } from '../translations';
|
|
16
18
|
|
|
17
19
|
export default Capability.makeModule(
|
|
18
20
|
Effect.fnUntraced(function* () {
|
|
@@ -31,7 +33,7 @@ export default Capability.makeModule(
|
|
|
31
33
|
name:
|
|
32
34
|
doc.name ||
|
|
33
35
|
doc.fallbackName ||
|
|
34
|
-
translations[0]['en-US'][Markdown.Document.typename]['object
|
|
36
|
+
translations[0]['en-US'][Markdown.Document.typename]['object-name.placeholder'],
|
|
35
37
|
data: content.content,
|
|
36
38
|
type: 'text/markdown',
|
|
37
39
|
};
|
|
@@ -46,7 +48,10 @@ export default Capability.makeModule(
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);
|
|
49
|
-
const createResult = await invokePromise(MarkdownOperation.
|
|
51
|
+
const createResult = await invokePromise(MarkdownOperation.CreateMarkdown, {
|
|
52
|
+
name: data.name,
|
|
53
|
+
content: data.data,
|
|
54
|
+
});
|
|
50
55
|
if (!createResult.data?.object) {
|
|
51
56
|
return undefined;
|
|
52
57
|
}
|
package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts}
RENAMED
|
@@ -14,11 +14,11 @@ import { ArtifactId, createArtifactElement } from '@dxos/assistant';
|
|
|
14
14
|
import { defineArtifact } from '@dxos/blueprints';
|
|
15
15
|
import { Obj } from '@dxos/echo';
|
|
16
16
|
import { assertArgument, invariant } from '@dxos/invariant';
|
|
17
|
-
import { SpaceOperation } from '@dxos/plugin-space/
|
|
17
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
18
18
|
import { Filter } from '@dxos/react-client/echo';
|
|
19
19
|
|
|
20
|
-
import { meta } from '
|
|
21
|
-
import { Markdown } from '
|
|
20
|
+
import { meta } from '#meta';
|
|
21
|
+
import { Markdown } from '#types';
|
|
22
22
|
|
|
23
23
|
export default Capability.makeModule(() =>
|
|
24
24
|
Effect.sync(() => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { MarkdownBlueprint } from '#blueprints';
|
|
11
|
+
|
|
12
|
+
const blueprintDefinition = Capability.makeModule<
|
|
13
|
+
[],
|
|
14
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
15
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, MarkdownBlueprint)]));
|
|
16
|
+
|
|
17
|
+
export default blueprintDefinition;
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
|
|
9
|
+
export const AppGraphSerializer = Capability.lazy('AppGraphSerializer', () => import('./app-graph-serializer'));
|
|
10
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
11
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
12
|
+
'OperationHandler',
|
|
13
|
+
() => import('./operation-handler'),
|
|
14
|
+
);
|
|
15
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
16
|
+
export const MarkdownSettings = Capability.lazy('MarkdownSettings', () => import('./settings'));
|
|
17
|
+
export const MarkdownState = Capability.lazy('MarkdownState', () => import('./state'));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
9
|
+
'OperationHandler',
|
|
10
|
+
() => import('./operation-handler'),
|
|
11
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { MarkdownOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, MarkdownOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import {
|
|
10
|
+
Surface,
|
|
11
|
+
useAtomCapability,
|
|
12
|
+
useAtomCapabilityState,
|
|
13
|
+
useCapability,
|
|
14
|
+
useSettingsState,
|
|
15
|
+
} from '@dxos/app-framework/ui';
|
|
16
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
17
|
+
import { Obj } from '@dxos/echo';
|
|
18
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention/types';
|
|
19
|
+
import { Text } from '@dxos/schema';
|
|
20
|
+
import { type EditorViewMode } from '@dxos/ui-editor';
|
|
21
|
+
|
|
22
|
+
import { MarkdownSettings } from '#components';
|
|
23
|
+
import { MarkdownCard, MarkdownContainer, type MarkdownContainerProps } from '#containers';
|
|
24
|
+
import { meta } from '#meta';
|
|
25
|
+
import { Markdown, MarkdownCapabilities } from '#types';
|
|
26
|
+
|
|
27
|
+
export default Capability.makeModule(() =>
|
|
28
|
+
Effect.succeed(
|
|
29
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
30
|
+
Surface.create({
|
|
31
|
+
id: 'surface.document',
|
|
32
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
33
|
+
role: ['article', 'section', 'tabpanel'],
|
|
34
|
+
filter: (data): data is { subject: Markdown.Document; attendableId: string; variant: undefined } =>
|
|
35
|
+
typeof data.attendableId === 'string' && Obj.instanceOf(Markdown.Document, data.subject) && !data.variant,
|
|
36
|
+
component: ({ data, role, ref }) => {
|
|
37
|
+
return (
|
|
38
|
+
<Container
|
|
39
|
+
id={Obj.getDXN(data.subject).toString()}
|
|
40
|
+
attendableId={data.attendableId}
|
|
41
|
+
subject={data.subject}
|
|
42
|
+
role={role}
|
|
43
|
+
ref={ref}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
Surface.create({
|
|
49
|
+
id: 'surface.text',
|
|
50
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
51
|
+
// TODO(burdon): Why is attendableId required? See EventArticle.tsx
|
|
52
|
+
filter: AppSurface.oneOf(
|
|
53
|
+
AppSurface.object(AppSurface.Article, Text.Text),
|
|
54
|
+
AppSurface.object(AppSurface.Section, Text.Text),
|
|
55
|
+
AppSurface.object(AppSurface.Tabpanel, Text.Text),
|
|
56
|
+
),
|
|
57
|
+
component: ({ data, role, ref }) => {
|
|
58
|
+
return (
|
|
59
|
+
<Container
|
|
60
|
+
id={Obj.getDXN(data.subject).toString()}
|
|
61
|
+
attendableId={data.attendableId}
|
|
62
|
+
subject={data.subject}
|
|
63
|
+
role={role}
|
|
64
|
+
ref={ref}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
Surface.create({
|
|
70
|
+
id: 'surface.plugin-settings',
|
|
71
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
72
|
+
component: ({ data: { subject } }) => {
|
|
73
|
+
const { settings, updateSettings } = useSettingsState<Markdown.Settings>(subject.atom);
|
|
74
|
+
return <MarkdownSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
Surface.create({
|
|
78
|
+
id: 'surface.preview',
|
|
79
|
+
filter: AppSurface.object(AppSurface.Card, [Markdown.Document, Text.Text]),
|
|
80
|
+
component: ({ data }) => <MarkdownCard {...data} />,
|
|
81
|
+
}),
|
|
82
|
+
]),
|
|
83
|
+
),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Common wrapper.
|
|
88
|
+
*/
|
|
89
|
+
const Container = forwardRef<
|
|
90
|
+
HTMLDivElement,
|
|
91
|
+
AppSurface.ObjectArticleProps<Markdown.Document | Text.Text, { id: string }>
|
|
92
|
+
>(({ id, attendableId, subject, role }, forwardedRef) => {
|
|
93
|
+
const selectionManager = useCapability(AttentionCapabilities.Selection);
|
|
94
|
+
const settings = useAtomCapability(MarkdownCapabilities.Settings);
|
|
95
|
+
const [state, setState] = useAtomCapabilityState(MarkdownCapabilities.State);
|
|
96
|
+
const editorState = useCapability(MarkdownCapabilities.EditorState);
|
|
97
|
+
const extensions = useCapability(MarkdownCapabilities.Extensions);
|
|
98
|
+
const extensionProviders = useMemo(() => extensions.flat(), [extensions]);
|
|
99
|
+
|
|
100
|
+
const viewMode: EditorViewMode = (id && state.viewMode[id]) || settings?.defaultViewMode || 'source';
|
|
101
|
+
const handleViewModeChange = useCallback<NonNullable<MarkdownContainerProps['onViewModeChange']>>(
|
|
102
|
+
(mode) => setState((current) => ({ ...current, viewMode: { ...current.viewMode, [id]: mode } })),
|
|
103
|
+
[id, setState],
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<MarkdownContainer
|
|
108
|
+
role={role}
|
|
109
|
+
subject={subject}
|
|
110
|
+
id={id}
|
|
111
|
+
attendableId={attendableId}
|
|
112
|
+
settings={settings}
|
|
113
|
+
selectionManager={selectionManager}
|
|
114
|
+
extensionProviders={extensionProviders}
|
|
115
|
+
editorStateStore={editorState}
|
|
116
|
+
viewMode={viewMode}
|
|
117
|
+
onViewModeChange={handleViewModeChange}
|
|
118
|
+
ref={forwardedRef}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
});
|
|
@@ -8,8 +8,8 @@ import { Capability } from '@dxos/app-framework';
|
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { createKvsStore } from '@dxos/effect';
|
|
10
10
|
|
|
11
|
-
import { meta } from '
|
|
12
|
-
import { Markdown, MarkdownCapabilities } from '
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { Markdown, MarkdownCapabilities } from '#types';
|
|
13
13
|
|
|
14
14
|
export default Capability.makeModule(() =>
|
|
15
15
|
Effect.sync(() => {
|