@dxos/plugin-markdown 0.8.4-main.fcfe5033a5 → 0.8.4-staging.60fe92afc8
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/EditableMarkdownCard-AW7MD35U.mjs +34 -0
- package/dist/lib/neutral/EditableMarkdownCard-AW7MD35U.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownArticle-LWT5RFFJ.mjs +126 -0
- package/dist/lib/neutral/MarkdownArticle-LWT5RFFJ.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownCard-TBLIRDBO.mjs +108 -0
- package/dist/lib/neutral/MarkdownCard-TBLIRDBO.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownPlugin.mjs +62 -0
- package/dist/lib/neutral/MarkdownPlugin.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownPlugin.node.mjs +25 -0
- package/dist/lib/neutral/MarkdownPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownPlugin.workerd.mjs +23 -0
- package/dist/lib/neutral/MarkdownPlugin.workerd.mjs.map +7 -0
- package/dist/lib/{browser/MarkdownSettings-62YSRY7L.mjs → neutral/MarkdownSettings-YCTZJL5V.mjs} +4 -4
- package/dist/lib/neutral/MarkdownSettings-YCTZJL5V.mjs.map +7 -0
- package/dist/lib/neutral/anchor-sort-UXN4RHFX.mjs +32 -0
- package/dist/lib/neutral/anchor-sort-UXN4RHFX.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-BWBA23FF.mjs +67 -0
- package/dist/lib/neutral/app-graph-builder-BWBA23FF.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-serializer-EN5E3BMG.mjs +56 -0
- package/dist/lib/neutral/app-graph-serializer-EN5E3BMG.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-DSPXK77L.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-DSPXK77L.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +29 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +11 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-36QFEVOZ.mjs +30 -0
- package/dist/lib/neutral/chunk-36QFEVOZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-67DKWOKF.mjs +10 -0
- package/dist/lib/neutral/chunk-67DKWOKF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CIJD7P6X.mjs +8 -0
- package/dist/lib/neutral/chunk-CIJD7P6X.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KDN4GKG2.mjs +98 -0
- package/dist/lib/neutral/chunk-KDN4GKG2.mjs.map +7 -0
- package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-LXNSKCPD.mjs} +10 -17
- package/dist/lib/neutral/chunk-LXNSKCPD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Y2LQRUU7.mjs +285 -0
- package/dist/lib/neutral/chunk-Y2LQRUU7.mjs.map +7 -0
- package/dist/lib/neutral/comment-config-EGY7RPPW.mjs +32 -0
- package/dist/lib/neutral/comment-config-EGY7RPPW.mjs.map +7 -0
- package/dist/lib/{browser → neutral/components}/index.mjs +33 -287
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-JK35XC4R.mjs +29 -0
- package/dist/lib/neutral/create-JK35XC4R.mjs.map +7 -0
- package/dist/lib/{browser/create-markdown-LU5IDKMH.mjs → neutral/create-markdown-7MLE625M.mjs} +5 -7
- package/dist/lib/neutral/create-markdown-7MLE625M.mjs.map +7 -0
- package/dist/lib/neutral/create-object-MU2LGXG6.mjs +31 -0
- package/dist/lib/neutral/create-object-MU2LGXG6.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +317 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +48 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/navigation-resolver-3KBOMN4U.mjs +14 -0
- package/dist/lib/neutral/navigation-resolver-3KBOMN4U.mjs.map +7 -0
- package/dist/lib/{browser/open-AFSOZZ6G.mjs → neutral/open-5YC77C4O.mjs} +5 -6
- package/dist/lib/neutral/open-5YC77C4O.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-2ARMPBGZ.mjs +13 -0
- package/dist/lib/neutral/operation-handler-2ARMPBGZ.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-XYZJBKHZ.mjs +119 -0
- package/dist/lib/neutral/react-surface-XYZJBKHZ.mjs.map +7 -0
- package/dist/lib/neutral/scroll-to-anchor-GAFB7W55.mjs +38 -0
- package/dist/lib/neutral/scroll-to-anchor-GAFB7W55.mjs.map +7 -0
- package/dist/lib/neutral/set-view-mode-N7UHYMPG.mjs +24 -0
- package/dist/lib/neutral/set-view-mode-N7UHYMPG.mjs.map +7 -0
- package/dist/lib/neutral/settings-TDGDLCUR.mjs +34 -0
- package/dist/lib/neutral/settings-TDGDLCUR.mjs.map +7 -0
- package/dist/lib/neutral/state-5COCF5PN.mjs +44 -0
- package/dist/lib/neutral/state-5COCF5PN.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +30 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +44 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/{browser/update-HZNVYBMO.mjs → neutral/update-markdown-NNINDDV5.mjs} +9 -10
- package/dist/lib/neutral/update-markdown-NNINDDV5.mjs.map +7 -0
- package/dist/types/src/MarkdownPlugin.d.ts +1 -0
- package/dist/types/src/MarkdownPlugin.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → MarkdownPlugin.node.d.ts} +2 -1
- package/dist/types/src/MarkdownPlugin.node.d.ts.map +1 -0
- package/dist/types/src/MarkdownPlugin.test.d.ts +2 -0
- package/dist/types/src/MarkdownPlugin.test.d.ts.map +1 -0
- package/dist/types/src/MarkdownPlugin.workerd.d.ts +4 -0
- package/dist/types/src/MarkdownPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/markdown-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/comment-config.d.ts +6 -0
- package/dist/types/src/capabilities/comment-config.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +15 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +7 -1
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts +1 -1
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts +14 -6
- 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 +2 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts +2 -2
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.stories.d.ts +46 -46
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.stories.d.ts.map +1 -1
- package/dist/types/src/containers/EditableMarkdownCard/EditableMarkdownCard.d.ts +15 -0
- package/dist/types/src/containers/EditableMarkdownCard/EditableMarkdownCard.d.ts.map +1 -0
- package/dist/types/src/containers/EditableMarkdownCard/EditableMarkdownCard.stories.d.ts +9 -0
- package/dist/types/src/containers/EditableMarkdownCard/EditableMarkdownCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/EditableMarkdownCard/index.d.ts +3 -0
- package/dist/types/src/containers/EditableMarkdownCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/{MarkdownContainer/MarkdownContainer.d.ts → MarkdownArticle/MarkdownArticle.d.ts} +14 -10
- package/dist/types/src/containers/MarkdownArticle/MarkdownArticle.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownArticle/MarkdownArticle.stories.d.ts +97 -0
- package/dist/types/src/containers/MarkdownArticle/MarkdownArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownArticle/index.d.ts +3 -0
- package/dist/types/src/containers/MarkdownArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.d.ts.map +1 -1
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.stories.d.ts +1 -1
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.stories.d.ts.map +1 -1
- package/dist/types/src/containers/MarkdownCard/snippet.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +3 -2
- package/dist/types/src/containers/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 +2 -1
- 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 +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-markdown.d.ts +3 -3
- package/dist/types/src/operations/create-markdown.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +3 -3
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts +3 -3
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/scroll-to-anchor.d.ts +3 -3
- package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -1
- package/dist/types/src/operations/set-view-mode.d.ts +3 -3
- package/dist/types/src/operations/set-view-mode.d.ts.map +1 -1
- package/dist/types/src/operations/update-markdown.d.ts +5 -0
- package/dist/types/src/operations/update-markdown.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts +3 -0
- package/dist/types/src/paths.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +1 -0
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +70 -51
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Markdown.d.ts +12 -10
- package/dist/types/src/types/Markdown.d.ts.map +1 -1
- package/dist/types/src/types/MarkdownCapabilities.d.ts +32 -0
- package/dist/types/src/types/MarkdownCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/MarkdownEvents.d.ts +3 -0
- package/dist/types/src/types/MarkdownEvents.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/MarkdownOperation.d.ts} +17 -17
- package/dist/types/src/types/MarkdownOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +14 -1
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +127 -107
- package/src/MarkdownPlugin.node.ts +20 -0
- package/src/MarkdownPlugin.test.ts +26 -0
- package/src/MarkdownPlugin.tsx +12 -52
- package/src/MarkdownPlugin.workerd.ts +19 -0
- package/src/blueprints/markdown-blueprint.ts +8 -9
- package/src/capabilities/anchor-sort.ts +3 -3
- package/src/capabilities/app-graph-builder.ts +63 -0
- package/src/capabilities/app-graph-serializer.ts +9 -10
- package/src/capabilities/blueprint-definition.ts +6 -4
- package/src/capabilities/comment-config.ts +36 -0
- package/src/capabilities/create-object.ts +33 -0
- package/src/capabilities/index.ts +17 -2
- package/src/capabilities/navigation-resolver.ts +19 -0
- package/src/capabilities/node.ts +3 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +17 -10
- package/src/capabilities/state.ts +4 -4
- package/src/components/MarkdownEditor/FileUpload.tsx +42 -37
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +5 -4
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +41 -30
- package/src/components/MarkdownEditor/MarkdownEditorContent.tsx +4 -3
- package/src/components/MarkdownEditor/MarkdownEditorToolbar.tsx +9 -6
- package/src/components/MarkdownSettings/MarkdownSettings.stories.tsx +2 -1
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +3 -3
- package/src/containers/EditableMarkdownCard/EditableMarkdownCard.stories.tsx +86 -0
- package/src/containers/EditableMarkdownCard/EditableMarkdownCard.tsx +44 -0
- package/src/containers/EditableMarkdownCard/index.ts +6 -0
- package/src/containers/{MarkdownContainer/MarkdownContainer.stories.tsx → MarkdownArticle/MarkdownArticle.stories.tsx} +15 -9
- package/src/containers/{MarkdownContainer/MarkdownContainer.tsx → MarkdownArticle/MarkdownArticle.tsx} +8 -7
- package/src/containers/MarkdownArticle/index.ts +6 -0
- package/src/containers/MarkdownCard/MarkdownCard.stories.tsx +8 -7
- package/src/containers/MarkdownCard/MarkdownCard.tsx +29 -21
- package/src/containers/MarkdownCard/snippet.ts +3 -1
- package/src/containers/index.ts +3 -2
- package/src/hooks/useExtensions.tsx +13 -9
- package/src/hooks/useLinkQuery.ts +21 -35
- package/src/index.ts +3 -7
- package/src/meta.ts +17 -7
- package/src/operations/create-markdown.ts +3 -4
- package/src/operations/create.conversations.json +1 -1
- package/src/operations/create.test.ts +11 -13
- package/src/operations/create.ts +22 -9
- package/src/operations/index.ts +2 -4
- package/src/operations/open.ts +3 -3
- package/src/operations/scroll-to-anchor.ts +18 -16
- package/src/operations/set-view-mode.ts +3 -4
- package/src/operations/{update.ts → update-markdown.ts} +4 -4
- package/src/operations/update.conversations.json +1 -1
- package/src/operations/update.test.ts +14 -16
- package/src/paths.ts +11 -0
- package/src/plugin.ts +11 -0
- package/src/testing.ts +22 -9
- package/src/translations.ts +4 -3
- package/src/types/Markdown.ts +10 -11
- package/src/types/MarkdownCapabilities.ts +51 -0
- package/src/types/MarkdownEvents.ts +14 -0
- package/src/{operations/definitions.ts → types/MarkdownOperation.ts} +24 -11
- package/src/types/Settings.ts +23 -3
- package/src/types/index.ts +3 -2
- package/src/types/types.ts +4 -1
- package/src/util.tsx +2 -2
- package/dist/lib/browser/MarkdownSettings-62YSRY7L.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-4KOZEH2H.mjs +0 -121
- package/dist/lib/browser/chunk-4KOZEH2H.mjs.map +0 -7
- package/dist/lib/browser/chunk-QFPZONKP.mjs +0 -158
- package/dist/lib/browser/chunk-QFPZONKP.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -39
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/create-YL5ELZWP.mjs +0 -30
- package/dist/lib/browser/create-YL5ELZWP.mjs.map +0 -7
- package/dist/lib/browser/create-markdown-LU5IDKMH.mjs.map +0 -7
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/open-AFSOZZ6G.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -14
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/scroll-to-anchor-IPXV32A6.mjs +0 -49
- package/dist/lib/browser/scroll-to-anchor-IPXV32A6.mjs.map +0 -7
- package/dist/lib/browser/set-view-mode-2QWB24RR.mjs +0 -26
- package/dist/lib/browser/set-view-mode-2QWB24RR.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -16
- package/dist/lib/browser/update-HZNVYBMO.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownSettings-QMPISOEU.mjs +0 -33
- package/dist/lib/node-esm/MarkdownSettings-QMPISOEU.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -52
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3OPDJJJH.mjs +0 -122
- package/dist/lib/node-esm/chunk-3OPDJJJH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-JUGS6RKO.mjs +0 -159
- package/dist/lib/node-esm/chunk-JUGS6RKO.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -40
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/create-SMQAIM3V.mjs +0 -31
- package/dist/lib/node-esm/create-SMQAIM3V.mjs.map +0 -7
- package/dist/lib/node-esm/create-markdown-X2OASYKG.mjs +0 -23
- package/dist/lib/node-esm/create-markdown-X2OASYKG.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -633
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/open-SRWLLOKE.mjs +0 -22
- package/dist/lib/node-esm/open-SRWLLOKE.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -15
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/scroll-to-anchor-M76GXKYQ.mjs +0 -50
- package/dist/lib/node-esm/scroll-to-anchor-M76GXKYQ.mjs.map +0 -7
- package/dist/lib/node-esm/set-view-mode-6BB6KIDS.mjs +0 -27
- package/dist/lib/node-esm/set-view-mode-6BB6KIDS.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -17
- package/dist/lib/node-esm/update-4CELTLXK.mjs +0 -46
- package/dist/lib/node-esm/update-4CELTLXK.mjs.map +0 -7
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -5
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.d.ts.map +0 -1
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.stories.d.ts +0 -77
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/MarkdownContainer/index.d.ts +0 -3
- package/dist/types/src/containers/MarkdownContainer/index.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/operations/update.d.ts +0 -5
- package/dist/types/src/operations/update.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -33
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/artifact-definition.ts +0 -110
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -39
- package/src/containers/MarkdownContainer/index.ts +0 -6
- package/src/types/capabilities.ts +0 -50
- package/src/types/events.ts +0 -14
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -6,27 +6,25 @@ import { describe, expect, it } from '@effect/vitest';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
8
|
import { MemoizedAiService } from '@dxos/ai/testing';
|
|
9
|
-
import { AgentService } from '@dxos/assistant';
|
|
10
|
-
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
11
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
12
9
|
import { SpaceProperties } from '@dxos/client-protocol';
|
|
13
|
-
import {
|
|
14
|
-
import { Collection } from '@dxos/echo';
|
|
10
|
+
import { Blueprint, Operation } from '@dxos/compute';
|
|
11
|
+
import { Collection, Database, Feed, Obj, Query, Ref } from '@dxos/echo';
|
|
15
12
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
13
|
+
import { AgentService } from '@dxos/functions-runtime';
|
|
14
|
+
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
16
15
|
import { invariant } from '@dxos/invariant';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
16
|
+
import { EntityId } from '@dxos/keys';
|
|
17
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
20
18
|
import { HasSubject } from '@dxos/types';
|
|
21
19
|
import { trim } from '@dxos/util';
|
|
22
20
|
|
|
23
21
|
import { WithProperties } from '#testing';
|
|
24
22
|
|
|
25
23
|
import MarkdownBlueprint from '../blueprints/markdown-blueprint';
|
|
26
|
-
import {
|
|
24
|
+
import { MarkdownOperation } from '../types';
|
|
27
25
|
import { MarkdownOperationHandlerSet } from './index';
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
EntityId.dangerouslyDisableRandomness();
|
|
30
28
|
|
|
31
29
|
const TestLayer = AssistantTestLayer({
|
|
32
30
|
aiServicePreset: 'edge-remote',
|
|
@@ -54,12 +52,12 @@ describe('update', () => {
|
|
|
54
52
|
});
|
|
55
53
|
yield* Database.add(doc);
|
|
56
54
|
|
|
57
|
-
yield* Operation.invoke(Update, {
|
|
55
|
+
yield* Operation.invoke(MarkdownOperation.Update, {
|
|
58
56
|
doc: Ref.make(doc),
|
|
59
57
|
edits: [{ oldString: 'Founders', newString: '# Founders' }],
|
|
60
58
|
});
|
|
61
59
|
|
|
62
|
-
const updatedDoc = yield* Database.resolve(Obj.
|
|
60
|
+
const updatedDoc = yield* Database.resolve(Obj.getURI(doc), Markdown.Document);
|
|
63
61
|
expect(updatedDoc.name).toBe(doc.name);
|
|
64
62
|
const text = yield* Database.load(updatedDoc.content);
|
|
65
63
|
expect(text.content).toBe('# Founders and portfolio of BlueYard.');
|
|
@@ -81,7 +79,7 @@ describe('update', () => {
|
|
|
81
79
|
yield* agent.submitPrompt('Create a document with a cookie recipe.');
|
|
82
80
|
yield* agent.waitForCompletion();
|
|
83
81
|
{
|
|
84
|
-
const docs = yield* Database.
|
|
82
|
+
const docs = yield* Database.query(Query.type(Markdown.Document)).run;
|
|
85
83
|
if (docs.length !== 1) {
|
|
86
84
|
throw new Error(`Expected 1 document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
87
85
|
}
|
|
@@ -97,7 +95,7 @@ describe('update', () => {
|
|
|
97
95
|
yield* agent.submitPrompt('Add a section with a holiday-themed variation.');
|
|
98
96
|
yield* agent.waitForCompletion();
|
|
99
97
|
{
|
|
100
|
-
const docs = yield* Database.
|
|
98
|
+
const docs = yield* Database.query(Query.type(Markdown.Document)).run;
|
|
101
99
|
if (docs.length !== 1) {
|
|
102
100
|
throw new Error(`Expected 1 document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
103
101
|
}
|
|
@@ -142,7 +140,7 @@ describe('update', () => {
|
|
|
142
140
|
yield* agent.waitForCompletion();
|
|
143
141
|
|
|
144
142
|
{
|
|
145
|
-
const docs = yield* Database.
|
|
143
|
+
const docs = yield* Database.query(Query.type(Markdown.Document)).run;
|
|
146
144
|
if (docs.length !== 1) {
|
|
147
145
|
throw new Error(`Expected 1 document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
148
146
|
}
|
|
@@ -189,7 +187,7 @@ describe('update', () => {
|
|
|
189
187
|
yield* agent.waitForCompletion();
|
|
190
188
|
|
|
191
189
|
{
|
|
192
|
-
const docs = yield* Database.
|
|
190
|
+
const docs = yield* Database.query(Query.type(Markdown.Document)).run;
|
|
193
191
|
if (docs.length !== 1) {
|
|
194
192
|
throw new Error(`Expected 1 document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
195
193
|
}
|
package/src/paths.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createTypeSectionPaths } from '@dxos/app-toolkit';
|
|
6
|
+
|
|
7
|
+
import { Markdown } from '#types';
|
|
8
|
+
|
|
9
|
+
const { getSectionPath: getDocumentsPath, getObjectPath: getDocumentPath } = createTypeSectionPaths(Markdown.Document);
|
|
10
|
+
|
|
11
|
+
export { getDocumentsPath, getDocumentPath };
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const MarkdownPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { MarkdownOperationHandlerSet } from './operations';
|
package/src/testing.ts
CHANGED
|
@@ -5,21 +5,34 @@
|
|
|
5
5
|
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
+
import { RootCollectionAnnotation } from '@dxos/app-toolkit';
|
|
8
9
|
import { SpaceProperties } from '@dxos/client-protocol';
|
|
9
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import { Annotation, Collection, Database, Obj, Ref } from '@dxos/echo';
|
|
11
|
+
|
|
12
|
+
// Eager re-export of `MarkdownPlugin`. See `@dxos/plugin-testing/src/core.ts`
|
|
13
|
+
// for the rationale. Uses the `#plugin` subpath so the node-only build is
|
|
14
|
+
// re-exported in test environments, avoiding the browser-only `MarkdownPlugin.tsx`
|
|
15
|
+
// which references React-surface capabilities that are intentionally omitted
|
|
16
|
+
// from `capabilities/node.ts`.
|
|
17
|
+
export * from '#plugin';
|
|
12
18
|
|
|
13
19
|
// TODO(wittjosiah): Factor out.
|
|
14
20
|
export const WithProperties = <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R | Database.Service> =>
|
|
15
21
|
Effect.zipRight(
|
|
16
22
|
Effect.gen(function* () {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
)
|
|
23
|
+
const collection = Collection.make({ objects: [] });
|
|
24
|
+
const properties = Obj.make(SpaceProperties, {});
|
|
25
|
+
yield* Database.add(collection);
|
|
26
|
+
yield* Database.add(properties);
|
|
27
|
+
// Both entities are in the DB before setting the annotation so Database.load
|
|
28
|
+
// works in CollectionModel.add (which uses the Effect DB context, not Ref.load).
|
|
29
|
+
Obj.update(properties, (properties) => {
|
|
30
|
+
const meta = Obj.getMeta(properties);
|
|
31
|
+
if (!meta.annotations) {
|
|
32
|
+
meta.annotations = {};
|
|
33
|
+
}
|
|
34
|
+
Annotation.setDictionary(meta.annotations, RootCollectionAnnotation, Ref.make(collection));
|
|
35
|
+
});
|
|
23
36
|
}),
|
|
24
37
|
effect,
|
|
25
38
|
);
|
package/src/translations.ts
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
5
6
|
import { type Resource } from '@dxos/react-ui';
|
|
6
|
-
import { translations as editorTranslations } from '@dxos/react-ui-editor';
|
|
7
|
+
import { translations as editorTranslations } from '@dxos/react-ui-editor/translations';
|
|
7
8
|
|
|
8
9
|
import { meta } from '#meta';
|
|
9
10
|
import { Markdown } from '#types';
|
|
@@ -11,7 +12,7 @@ import { Markdown } from '#types';
|
|
|
11
12
|
export const translations = [
|
|
12
13
|
{
|
|
13
14
|
'en-US': {
|
|
14
|
-
[Markdown.Document
|
|
15
|
+
[Type.getTypename(Markdown.Document)]: {
|
|
15
16
|
'typename.label': 'Document',
|
|
16
17
|
'typename.label_zero': 'Documents',
|
|
17
18
|
'typename.label_one': 'Document',
|
|
@@ -27,7 +28,7 @@ export const translations = [
|
|
|
27
28
|
'choose-markdown-from-space-dialog.title': 'Choose one or more documents to add',
|
|
28
29
|
'empty-choose-markdown-from-space.message': 'None available; try creating a new one instead?',
|
|
29
30
|
'chooser-done.label': 'Add selected',
|
|
30
|
-
'editor.placeholder': '
|
|
31
|
+
'editor.placeholder': 'Enter text…',
|
|
31
32
|
'toggle-view-mode.label': 'Toggle read-only',
|
|
32
33
|
'upload-image.label': 'Upload image',
|
|
33
34
|
'fallback.title': 'Untitled',
|
package/src/types/Markdown.ts
CHANGED
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { BlueprintsAnnotation, GraphPropsAnnotation } from '@dxos/app-toolkit';
|
|
8
|
+
import { DXN, Annotation, Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
+
import { DescriptionAnnotation, FormInputAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';
|
|
9
10
|
import { Text } from '@dxos/schema';
|
|
10
11
|
|
|
12
|
+
export const BLUEPRINT_KEY = 'org.dxos.blueprint.markdown';
|
|
13
|
+
|
|
11
14
|
// Re-export Settings as merged const/type (not as namespace).
|
|
12
15
|
import * as SettingsModule from './Settings';
|
|
13
16
|
export const Settings = SettingsModule.Settings;
|
|
@@ -22,19 +25,15 @@ export const Document = Schema.Struct({
|
|
|
22
25
|
fallbackName: Schema.String.pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
23
26
|
content: Ref.Ref(Text.Text).pipe(FormInputAnnotation.set(false)),
|
|
24
27
|
}).pipe(
|
|
25
|
-
Type.object({
|
|
26
|
-
typename: 'org.dxos.type.document',
|
|
27
|
-
version: '0.1.0',
|
|
28
|
-
}),
|
|
29
28
|
LabelAnnotation.set(['name', 'fallbackName']),
|
|
30
29
|
DescriptionAnnotation.set('description'),
|
|
31
|
-
Annotation.IconAnnotation.set({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
Annotation.IconAnnotation.set({ icon: 'ph--text-aa--regular', hue: 'indigo' }),
|
|
31
|
+
BlueprintsAnnotation.set([BLUEPRINT_KEY]),
|
|
32
|
+
GraphPropsAnnotation.set({ managesAutofocus: true }),
|
|
33
|
+
Type.makeObject(DXN.make('org.dxos.type.document', '0.1.0')),
|
|
35
34
|
);
|
|
36
35
|
|
|
37
|
-
export type Document =
|
|
36
|
+
export type Document = Type.InstanceType<typeof Document>;
|
|
38
37
|
|
|
39
38
|
/**
|
|
40
39
|
* Document factory.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type EditorView } from '@codemirror/view';
|
|
8
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
9
|
+
import * as Schema from 'effect/Schema';
|
|
10
|
+
|
|
11
|
+
import { Capability } from '@dxos/app-framework';
|
|
12
|
+
import { type EditorStateStore } from '@dxos/ui-editor';
|
|
13
|
+
import { type EditorViewMode } from '@dxos/ui-editor/types';
|
|
14
|
+
|
|
15
|
+
import { meta } from '#meta';
|
|
16
|
+
|
|
17
|
+
import type * as Markdown from './Markdown';
|
|
18
|
+
import { type MarkdownExtensionProvider } from './types';
|
|
19
|
+
|
|
20
|
+
/** Schema for persisted markdown state. */
|
|
21
|
+
export const StateSchema = Schema.mutable(
|
|
22
|
+
Schema.Struct({
|
|
23
|
+
viewMode: Schema.Record({ key: Schema.String, value: Schema.String }),
|
|
24
|
+
}),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export type MarkdownState = {
|
|
28
|
+
viewMode: Record<string, EditorViewMode>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type EditorViewEntry = { view: EditorView; documentId: string };
|
|
32
|
+
|
|
33
|
+
export type EditorViewRegistry = {
|
|
34
|
+
register: (attendableId: string, view: EditorView, documentId: string) => void;
|
|
35
|
+
unregister: (attendableId: string) => void;
|
|
36
|
+
get: (attendableId: string) => EditorViewEntry | undefined;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Settings = Capability.make<Atom.Writable<Markdown.Settings>>(`${meta.id}.capability.settings`);
|
|
40
|
+
|
|
41
|
+
/** Persisted state atom for view mode per document. */
|
|
42
|
+
export const State = Capability.make<Atom.Writable<MarkdownState>>(`${meta.id}.capability.state`);
|
|
43
|
+
|
|
44
|
+
/** Editor state store for cursor positions, scroll state, etc. */
|
|
45
|
+
export const EditorState = Capability.make<EditorStateStore>(`${meta.id}.capability.editor-state`);
|
|
46
|
+
|
|
47
|
+
/** Registry of active EditorView instances keyed by attendable ID. */
|
|
48
|
+
export const EditorViews = Capability.make<EditorViewRegistry>(`${meta.id}.capability.editor-views`);
|
|
49
|
+
|
|
50
|
+
// TODO(burdon): Move to ./types (external API)?
|
|
51
|
+
export const ExtensionProvider = Capability.make<MarkdownExtensionProvider[]>(`${meta.id}.capability.extensions`);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type ActivationEvent } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
|
|
12
|
+
export const SetupExtensions: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
13
|
+
`${meta.id}.event.setup-extensions`,
|
|
14
|
+
);
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
7
9
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
import { Database, Ref, Type, DXN } from '@dxos/echo';
|
|
10
12
|
import { EditorViewMode } from '@dxos/ui-editor/types';
|
|
11
13
|
import { trim } from '@dxos/util';
|
|
12
14
|
|
|
13
15
|
import { meta } from '#meta';
|
|
14
16
|
|
|
15
|
-
import
|
|
17
|
+
import * as Markdown from './Markdown';
|
|
16
18
|
|
|
17
|
-
const
|
|
19
|
+
const makeKey = (name: string) => DXN.make(`${meta.id}.operation.${name}`);
|
|
18
20
|
|
|
19
21
|
const Edit = Schema.Struct({
|
|
20
22
|
oldString: Schema.String.annotations({
|
|
@@ -30,9 +32,10 @@ const Edit = Schema.Struct({
|
|
|
30
32
|
|
|
31
33
|
export const Create = Operation.make({
|
|
32
34
|
meta: {
|
|
33
|
-
key: 'org.dxos.function.markdown.create',
|
|
35
|
+
key: DXN.make('org.dxos.function.markdown.create'),
|
|
34
36
|
name: 'Create',
|
|
35
37
|
description: 'Creates a new markdown document and adds it to the space.',
|
|
38
|
+
icon: 'ph--file-text--regular',
|
|
36
39
|
},
|
|
37
40
|
input: Schema.Struct({
|
|
38
41
|
name: Schema.String,
|
|
@@ -47,22 +50,27 @@ export const Create = Operation.make({
|
|
|
47
50
|
});
|
|
48
51
|
|
|
49
52
|
export const CreateMarkdown = Operation.make({
|
|
50
|
-
meta: {
|
|
53
|
+
meta: {
|
|
54
|
+
key: makeKey('create'),
|
|
55
|
+
name: 'Create Markdown Document',
|
|
56
|
+
icon: 'ph--file-text--regular',
|
|
57
|
+
},
|
|
51
58
|
services: [Capability.Service],
|
|
52
59
|
input: Schema.Struct({
|
|
53
60
|
name: Schema.optional(Schema.String),
|
|
54
61
|
content: Schema.optional(Schema.String),
|
|
55
62
|
}),
|
|
56
63
|
output: Schema.Struct({
|
|
57
|
-
object: Markdown.Document,
|
|
64
|
+
object: Type.getSchema(Markdown.Document),
|
|
58
65
|
}),
|
|
59
66
|
});
|
|
60
67
|
|
|
61
68
|
export const Open = Operation.make({
|
|
62
69
|
meta: {
|
|
63
|
-
key: 'org.dxos.function.markdown.open',
|
|
70
|
+
key: DXN.make('org.dxos.function.markdown.open'),
|
|
64
71
|
name: 'Open',
|
|
65
72
|
description: 'Opens and reads the contents of a new markdown document.',
|
|
73
|
+
icon: 'ph--arrow-square-out--regular',
|
|
66
74
|
},
|
|
67
75
|
input: Schema.Struct({
|
|
68
76
|
doc: Ref.Ref(Markdown.Document).annotations({
|
|
@@ -76,7 +84,11 @@ export const Open = Operation.make({
|
|
|
76
84
|
});
|
|
77
85
|
|
|
78
86
|
export const ScrollToAnchor = Operation.make({
|
|
79
|
-
meta: {
|
|
87
|
+
meta: {
|
|
88
|
+
key: makeKey('scrollToAnchor'),
|
|
89
|
+
name: 'Scroll To Anchor',
|
|
90
|
+
icon: 'ph--anchor-simple--regular',
|
|
91
|
+
},
|
|
80
92
|
services: [Capability.Service],
|
|
81
93
|
input: Schema.Struct({
|
|
82
94
|
subject: Schema.String.annotations({ description: 'Attendable ID of the markdown editor.' }),
|
|
@@ -88,7 +100,7 @@ export const ScrollToAnchor = Operation.make({
|
|
|
88
100
|
|
|
89
101
|
// TODO(wittjosiah): This appears to be unused.
|
|
90
102
|
export const SetViewMode = Operation.make({
|
|
91
|
-
meta: { key:
|
|
103
|
+
meta: { key: makeKey('setViewMode'), name: 'Set View Mode', icon: 'ph--layout--regular' },
|
|
92
104
|
services: [Capability.Service],
|
|
93
105
|
input: Schema.Struct({
|
|
94
106
|
id: Schema.String,
|
|
@@ -99,11 +111,12 @@ export const SetViewMode = Operation.make({
|
|
|
99
111
|
|
|
100
112
|
export const Update = Operation.make({
|
|
101
113
|
meta: {
|
|
102
|
-
key: 'org.dxos.function.markdown.update',
|
|
114
|
+
key: DXN.make('org.dxos.function.markdown.update'),
|
|
103
115
|
name: 'Update',
|
|
104
116
|
description: trim`
|
|
105
117
|
Applies a set of edits to the markdown document.
|
|
106
118
|
`,
|
|
119
|
+
icon: 'ph--pencil-simple--regular',
|
|
107
120
|
},
|
|
108
121
|
input: Schema.Struct({
|
|
109
122
|
doc: Ref.Ref(Markdown.Document).annotations({
|
package/src/types/Settings.ts
CHANGED
|
@@ -8,6 +8,19 @@ import * as Schema from 'effect/Schema';
|
|
|
8
8
|
|
|
9
9
|
import { EditorInputMode, EditorViewMode } from '@dxos/ui-editor/types';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Determines how new comment threads on markdown documents are wired up to
|
|
13
|
+
* the comment-thread AI agent (plugin-thread). The agent's identity (name,
|
|
14
|
+
* DID) is resolved at runtime via the AgentIdentity capability — this
|
|
15
|
+
* setting only controls whether and when the agent fires.
|
|
16
|
+
*
|
|
17
|
+
* - `off`: comments are plain user-only threads (no agent).
|
|
18
|
+
* - `auto`: every user message in a thread triggers an agent response.
|
|
19
|
+
* - `mention`: agent only responds when the message contains `@{agentName}`.
|
|
20
|
+
*/
|
|
21
|
+
export const CommentAgentMode = Schema.Union(Schema.Literal('off'), Schema.Literal('auto'), Schema.Literal('mention'));
|
|
22
|
+
export type CommentAgentMode = Schema.Schema.Type<typeof CommentAgentMode>;
|
|
23
|
+
|
|
11
24
|
/**
|
|
12
25
|
* Plugin settings.
|
|
13
26
|
*/
|
|
@@ -17,6 +30,13 @@ export const Settings = Schema.mutable(
|
|
|
17
30
|
title: 'Default view mode',
|
|
18
31
|
description: 'Set whether documents open in editing or read-only mode.',
|
|
19
32
|
}),
|
|
33
|
+
commentAgentMode: Schema.optional(
|
|
34
|
+
CommentAgentMode.annotations({
|
|
35
|
+
title: 'Comment agent mode',
|
|
36
|
+
description:
|
|
37
|
+
"How new comment threads on markdown documents are processed: 'off' (no AI), 'auto' (AI responds to every user message), or 'mention' (AI responds only on @mention).",
|
|
38
|
+
}),
|
|
39
|
+
),
|
|
20
40
|
editorInputMode: Schema.optional(
|
|
21
41
|
EditorInputMode.annotations({
|
|
22
42
|
title: 'Editor input mode',
|
|
@@ -53,10 +73,10 @@ export const Settings = Schema.mutable(
|
|
|
53
73
|
description: 'Show developer tools and diagnostics for the editor.',
|
|
54
74
|
}),
|
|
55
75
|
),
|
|
56
|
-
|
|
76
|
+
snippets: Schema.optional(
|
|
57
77
|
Schema.String.annotations({
|
|
58
|
-
title: '
|
|
59
|
-
description: '
|
|
78
|
+
title: 'Snippets',
|
|
79
|
+
description: 'Input snippets to replay for testing purposes.',
|
|
60
80
|
}),
|
|
61
81
|
),
|
|
62
82
|
}),
|
package/src/types/index.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './capabilities';
|
|
6
|
-
export * from './events';
|
|
7
5
|
export * from './types';
|
|
8
6
|
|
|
9
7
|
export * as Markdown from './Markdown';
|
|
8
|
+
export * as MarkdownCapabilities from './MarkdownCapabilities';
|
|
9
|
+
export * as MarkdownEvents from './MarkdownEvents';
|
|
10
|
+
export * as MarkdownOperation from './MarkdownOperation';
|
|
10
11
|
export * as Settings from './Settings';
|
package/src/types/types.ts
CHANGED
|
@@ -12,7 +12,10 @@ import { type Document } from './Markdown';
|
|
|
12
12
|
// TODO(wittjosiah): MarkdownExtensionProvider is a part of the MarkdownCapabilities api which should be in ./types.
|
|
13
13
|
|
|
14
14
|
// TODO(burdon): Async?
|
|
15
|
-
export type MarkdownExtensionProvider = (props: {
|
|
15
|
+
export type MarkdownExtensionProvider = (props: {
|
|
16
|
+
document?: Document;
|
|
17
|
+
viewMode?: EditorViewMode;
|
|
18
|
+
}) => Extension | undefined;
|
|
16
19
|
|
|
17
20
|
export type MarkdownPluginState = {
|
|
18
21
|
// Codemirror extensions provided by other plugins.
|
package/src/util.tsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { debounce } from '@dxos/async';
|
|
6
6
|
import { Obj } from '@dxos/echo';
|
|
7
|
-
import { type TypedObjectSerializer } from '@dxos/plugin-space
|
|
7
|
+
import { type TypedObjectSerializer } from '@dxos/plugin-space';
|
|
8
8
|
|
|
9
9
|
import { Markdown } from '#types';
|
|
10
10
|
|
|
@@ -116,7 +116,7 @@ export const getContentSnippet = (content = '', maxLines = 3) => {
|
|
|
116
116
|
export const setFallbackName = debounce((doc: Markdown.Document, content = '') => {
|
|
117
117
|
const name = getFallbackName(content);
|
|
118
118
|
if (doc.fallbackName !== name) {
|
|
119
|
-
Obj.
|
|
119
|
+
Obj.update(doc, (doc) => {
|
|
120
120
|
doc.fallbackName = name;
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/MarkdownSettings/MarkdownSettings.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Input } from '@dxos/react-ui';\nimport { Settings as SettingsForm, type SettingsFieldProps } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { Markdown } from '#types';\n\nexport type MarkdownSettingsProps = AppSurface.SettingsArticleProps<Markdown.Settings>;\n\nconst TypewriterField = ({ value, onChange, readonly }: SettingsFieldProps<string>) => (\n <Input.TextArea disabled={readonly} rows={5} value={value ?? ''} onChange={(event) => onChange(event.target.value)} />\n);\n\nexport const MarkdownSettings = ({ settings, onSettingsChange }: MarkdownSettingsProps) => {\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={meta.name ?? 'Editor'}>\n <SettingsForm.FieldSet\n readonly={!onSettingsChange}\n schema={Markdown.Settings}\n visible={(path, values) => path !== 'typewriter' || !!values.debug}\n fieldMap={{ typewriter: TypewriterField }}\n values={settings}\n onValuesChanged={(values) => onSettingsChange?.(() => values)}\n />\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,aAAa;AACtB,SAASC,YAAYC,oBAA6C;AAElE,SAASC,YAAY;AACrB,SAASC,gBAAgB;AAIzB,IAAMC,kBAAkB,CAAC,EAAEC,OAAOC,UAAUC,SAAQ,MAClD,sBAAA,cAACC,MAAMC,UAAQ;EAACC,UAAUH;EAAUI,MAAM;EAAGN,OAAOA,SAAS;EAAIC,UAAU,CAACM,UAAUN,SAASM,MAAMC,OAAOR,KAAK;;AAG5G,IAAMS,mBAAmB,CAAC,EAAEC,UAAUC,iBAAgB,MAAyB;AACpF,SACE,sBAAA,cAACC,aAAaC,UAAQ,MACpB,sBAAA,cAACD,aAAaE,SAAO;IAACC,OAAOC,KAAKC,QAAQ;KACxC,sBAAA,cAACL,aAAaM,UAAQ;IACpBhB,UAAU,CAACS;IACXQ,QAAQC,SAASC;IACjBC,SAAS,CAACC,MAAMC,WAAWD,SAAS,gBAAgB,CAAC,CAACC,OAAOC;IAC7DC,UAAU;MAAEC,YAAY5B;IAAgB;IACxCyB,QAAQd;IACRkB,iBAAiB,CAACJ,WAAWb,mBAAmB,MAAMa,MAAAA;;AAKhE;",
|
|
6
|
-
"names": ["React", "Input", "Settings", "SettingsForm", "meta", "Markdown", "TypewriterField", "value", "onChange", "readonly", "Input", "TextArea", "disabled", "rows", "event", "target", "MarkdownSettings", "settings", "onSettingsChange", "SettingsForm", "Viewport", "Section", "title", "meta", "name", "FieldSet", "schema", "Markdown", "Settings", "visible", "path", "values", "debug", "fieldMap", "typewriter", "onValuesChanged"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/blueprints/markdown-blueprint.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { trim } from '@dxos/util';\n\nimport { Create, Open, Update } from '../operations/definitions';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.markdown';\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Markdown',\n description: 'Work with markdown documents. Preferred over raw database operations.',\n tools: Blueprint.toolDefinitions({ operations: [Create, Open, Update] }),\n instructions: Template.make({\n // TODO(wittjosiah): Move example to function input schema annotation.\n source: trim`\n {{! Markdown }}\n\n You can create, read and update markdown documents.\n When asked to edit or update documents return updates as a set of compact diff string pairs.\n For each diff, respond with the smallest possible matching span.\n\n Example:\n ${'```'}diff\n - \"There is a tyop in this sentence.\"\n + \"There is a typo in this sentence.\"\n - \"This id good.\"\n + \"This sentence is really good.\"\n ${'```'}\n `,\n }),\n });\n\nconst blueprint: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAKA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAIrB,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKH;EACLI,MAAM;EACNC,aAAa;EACbC,OAAOJ,UAAUK,gBAAgB;IAAEC,YAAY;MAACC;MAAQC;MAAMC;;EAAQ,CAAA;EACtEC,cAAcC,SAASZ,KAAK;;IAE1Ba,QAAQC;;;;;;;;UAQJ,KAAA;;;;;UAKA,KAAA;;EAEN,CAAA;AACF,CAAA;AAEF,IAAMC,YAAiD;EACrDb,KAAKH;EACLC;AACF;AAEA,IAAA,6BAAee;",
|
|
6
|
-
"names": ["Blueprint", "Template", "trim", "BLUEPRINT_KEY", "make", "Blueprint", "key", "name", "description", "tools", "toolDefinitions", "operations", "Create", "Open", "Update", "instructions", "Template", "source", "trim", "blueprint"]
|
|
7
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__export
|
|
3
|
-
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
-
|
|
5
|
-
// src/types/capabilities.ts
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
|
-
import { Capability } from "@dxos/app-framework";
|
|
8
|
-
import { meta } from "#meta";
|
|
9
|
-
var MarkdownStateSchema = Schema.mutable(Schema.Struct({
|
|
10
|
-
viewMode: Schema.Record({
|
|
11
|
-
key: Schema.String,
|
|
12
|
-
value: Schema.String
|
|
13
|
-
})
|
|
14
|
-
}));
|
|
15
|
-
(function(MarkdownCapabilities2) {
|
|
16
|
-
MarkdownCapabilities2.Settings = Capability.make(`${meta.id}.capability.settings`);
|
|
17
|
-
MarkdownCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
|
|
18
|
-
MarkdownCapabilities2.EditorState = Capability.make(`${meta.id}.capability.editor-state`);
|
|
19
|
-
MarkdownCapabilities2.EditorViews = Capability.make(`${meta.id}.capability.editor-views`);
|
|
20
|
-
MarkdownCapabilities2.Extensions = Capability.make(`${meta.id}.capability.extensions`);
|
|
21
|
-
})(MarkdownCapabilities || (MarkdownCapabilities = {}));
|
|
22
|
-
var MarkdownCapabilities;
|
|
23
|
-
|
|
24
|
-
// src/types/events.ts
|
|
25
|
-
import { AppActivationEvents } from "@dxos/app-toolkit";
|
|
26
|
-
import { meta as meta2 } from "#meta";
|
|
27
|
-
(function(MarkdownEvents2) {
|
|
28
|
-
MarkdownEvents2.SetupExtensions = AppActivationEvents.createStateEvent(`${meta2.id}.event.setup-extensions`);
|
|
29
|
-
})(MarkdownEvents || (MarkdownEvents = {}));
|
|
30
|
-
var MarkdownEvents;
|
|
31
|
-
|
|
32
|
-
// src/types/Markdown.ts
|
|
33
|
-
var Markdown_exports = {};
|
|
34
|
-
__export(Markdown_exports, {
|
|
35
|
-
Document: () => Document,
|
|
36
|
-
Settings: () => Settings2,
|
|
37
|
-
make: () => make
|
|
38
|
-
});
|
|
39
|
-
import * as Schema3 from "effect/Schema";
|
|
40
|
-
import { Annotation, Obj, Ref, Type } from "@dxos/echo";
|
|
41
|
-
import { DescriptionAnnotation, FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
42
|
-
import { Text } from "@dxos/schema";
|
|
43
|
-
|
|
44
|
-
// src/types/Settings.ts
|
|
45
|
-
var Settings_exports = {};
|
|
46
|
-
__export(Settings_exports, {
|
|
47
|
-
Settings: () => Settings
|
|
48
|
-
});
|
|
49
|
-
import * as Schema2 from "effect/Schema";
|
|
50
|
-
import { EditorInputMode, EditorViewMode } from "@dxos/ui-editor/types";
|
|
51
|
-
var Settings = Schema2.mutable(Schema2.Struct({
|
|
52
|
-
defaultViewMode: EditorViewMode.annotations({
|
|
53
|
-
title: "Default view mode",
|
|
54
|
-
description: "Set whether documents open in editing or read-only mode."
|
|
55
|
-
}),
|
|
56
|
-
editorInputMode: Schema2.optional(EditorInputMode.annotations({
|
|
57
|
-
title: "Editor input mode",
|
|
58
|
-
description: "Choose keyboard bindings for the editor."
|
|
59
|
-
})),
|
|
60
|
-
toolbar: Schema2.optional(Schema2.Boolean.annotations({
|
|
61
|
-
title: "Show toolbar",
|
|
62
|
-
description: "Display a formatting toolbar above the editor."
|
|
63
|
-
})),
|
|
64
|
-
numberedHeadings: Schema2.optional(Schema2.Boolean.annotations({
|
|
65
|
-
title: "Numbered headings",
|
|
66
|
-
description: "Automatically number heading levels in the document."
|
|
67
|
-
})),
|
|
68
|
-
folding: Schema2.optional(Schema2.Boolean.annotations({
|
|
69
|
-
title: "Folding",
|
|
70
|
-
description: "Allow collapsing and expanding sections by heading."
|
|
71
|
-
})),
|
|
72
|
-
experimental: Schema2.optional(Schema2.Boolean.annotations({
|
|
73
|
-
title: "Enable experimental features",
|
|
74
|
-
description: "Turn on features that are still in development."
|
|
75
|
-
})),
|
|
76
|
-
debug: Schema2.optional(Schema2.Boolean.annotations({
|
|
77
|
-
title: "Enable debugging features",
|
|
78
|
-
description: "Show developer tools and diagnostics for the editor."
|
|
79
|
-
})),
|
|
80
|
-
typewriter: Schema2.optional(Schema2.String.annotations({
|
|
81
|
-
title: "Typewriter script",
|
|
82
|
-
description: "Script to replay typed input for testing purposes."
|
|
83
|
-
}))
|
|
84
|
-
}));
|
|
85
|
-
|
|
86
|
-
// src/types/Markdown.ts
|
|
87
|
-
var Settings2 = Settings;
|
|
88
|
-
var Document = Schema3.Struct({
|
|
89
|
-
name: Schema3.optional(Schema3.String),
|
|
90
|
-
description: Schema3.optional(Schema3.String),
|
|
91
|
-
fallbackName: Schema3.String.pipe(FormInputAnnotation.set(false), Schema3.optional),
|
|
92
|
-
content: Ref.Ref(Text.Text).pipe(FormInputAnnotation.set(false))
|
|
93
|
-
}).pipe(Type.object({
|
|
94
|
-
typename: "org.dxos.type.document",
|
|
95
|
-
version: "0.1.0"
|
|
96
|
-
}), LabelAnnotation.set([
|
|
97
|
-
"name",
|
|
98
|
-
"fallbackName"
|
|
99
|
-
]), DescriptionAnnotation.set("description"), Annotation.IconAnnotation.set({
|
|
100
|
-
icon: "ph--text-aa--regular",
|
|
101
|
-
hue: "indigo"
|
|
102
|
-
}));
|
|
103
|
-
var make = ({ content = "", ...props } = {}) => {
|
|
104
|
-
const doc = Obj.make(Document, {
|
|
105
|
-
...props,
|
|
106
|
-
content: Ref.make(Text.make({
|
|
107
|
-
content
|
|
108
|
-
}))
|
|
109
|
-
});
|
|
110
|
-
Obj.setParent(doc.content.target, doc);
|
|
111
|
-
return doc;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export {
|
|
115
|
-
MarkdownStateSchema,
|
|
116
|
-
MarkdownCapabilities,
|
|
117
|
-
MarkdownEvents,
|
|
118
|
-
Settings_exports,
|
|
119
|
-
Markdown_exports
|
|
120
|
-
};
|
|
121
|
-
//# sourceMappingURL=chunk-4KOZEH2H.mjs.map
|