@dxos/plugin-markdown 0.8.4-main.7996785055 → 0.8.4-main.8baae0fced
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-LXBXN3OW.mjs +32 -0
- package/dist/lib/neutral/EditableMarkdownCard-LXBXN3OW.mjs.map +7 -0
- package/dist/lib/{node-esm/MarkdownContainer-25WFZLCC.mjs → neutral/MarkdownArticle-Z4QRU3WD.mjs} +25 -25
- package/dist/lib/neutral/MarkdownArticle-Z4QRU3WD.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownCard-INMBLUL4.mjs +102 -0
- package/dist/lib/neutral/MarkdownCard-INMBLUL4.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownPlugin.mjs +58 -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/neutral/MarkdownSettings-YCTZJL5V.mjs +32 -0
- package/dist/lib/neutral/MarkdownSettings-YCTZJL5V.mjs.map +7 -0
- package/dist/lib/{browser/anchor-sort-PSCEA6EJ.mjs → neutral/anchor-sort-L4VCKDO6.mjs} +5 -7
- package/dist/lib/neutral/anchor-sort-L4VCKDO6.mjs.map +7 -0
- package/dist/lib/{browser/app-graph-serializer-DAVFEX7R.mjs → neutral/app-graph-serializer-YI72EEVM.mjs} +11 -19
- package/dist/lib/neutral/app-graph-serializer-YI72EEVM.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-33OK2KUL.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-33OK2KUL.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/blueprints/index.mjs +2 -4
- package/dist/lib/neutral/capabilities/index.mjs +25 -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-5JWFZVBC.mjs +8 -0
- package/dist/lib/neutral/chunk-5JWFZVBC.mjs.map +7 -0
- package/dist/lib/{browser/chunk-RYZHVXZ5.mjs → neutral/chunk-ISCL3BB2.mjs} +3 -8
- package/dist/lib/neutral/chunk-ISCL3BB2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-KDN4GKG2.mjs +98 -0
- package/dist/lib/neutral/chunk-KDN4GKG2.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ZN75YHSV.mjs → neutral/chunk-LXNSKCPD.mjs} +8 -14
- package/dist/lib/neutral/chunk-LXNSKCPD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SOLAMEK3.mjs +276 -0
- package/dist/lib/neutral/chunk-SOLAMEK3.mjs.map +7 -0
- package/dist/lib/neutral/comment-config-7VTHRUIZ.mjs +30 -0
- package/dist/lib/neutral/comment-config-7VTHRUIZ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +370 -0
- 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/{browser/create-QD27F6E7.mjs → neutral/create-3PGJ2NEK.mjs} +6 -8
- package/dist/lib/neutral/create-3PGJ2NEK.mjs.map +7 -0
- package/dist/lib/neutral/create-markdown-5LS46GMH.mjs +20 -0
- package/dist/lib/neutral/create-markdown-5LS46GMH.mjs.map +7 -0
- package/dist/lib/neutral/create-object-ZA6VXLJJ.mjs +27 -0
- package/dist/lib/neutral/create-object-ZA6VXLJJ.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +321 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +42 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/{browser/open-YDABYPCA.mjs → neutral/open-WCYGBLAG.mjs} +6 -7
- package/dist/lib/neutral/open-WCYGBLAG.mjs.map +7 -0
- package/dist/lib/{browser/operation-handler-W3QXMMMQ.mjs → neutral/operation-handler-2ARMPBGZ.mjs} +4 -8
- package/dist/lib/neutral/operation-handler-2ARMPBGZ.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-N7FV3PXH.mjs → neutral/react-surface-SG4YNXBS.mjs} +33 -34
- package/dist/lib/neutral/react-surface-SG4YNXBS.mjs.map +7 -0
- package/dist/lib/{browser/scroll-to-anchor-3CGV3XI7.mjs → neutral/scroll-to-anchor-6FIOKVKT.mjs} +8 -10
- package/dist/lib/neutral/scroll-to-anchor-6FIOKVKT.mjs.map +7 -0
- package/dist/lib/neutral/set-view-mode-37RSPFEN.mjs +24 -0
- package/dist/lib/neutral/set-view-mode-37RSPFEN.mjs.map +7 -0
- package/dist/lib/{browser/settings-3UMXG4TP.mjs → neutral/settings-TDGDLCUR.mjs} +7 -11
- package/dist/lib/neutral/settings-TDGDLCUR.mjs.map +7 -0
- package/dist/lib/{browser/state-IYKJ6EV3.mjs → neutral/state-5COCF5PN.mjs} +6 -10
- package/dist/lib/neutral/state-5COCF5PN.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +19 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +43 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/lib/{browser/update-WKAMI4AD.mjs → neutral/update-markdown-5EDRD3SH.mjs} +9 -10
- package/dist/lib/neutral/update-markdown-5EDRD3SH.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 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -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/comment-config.d.ts +12 -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 +22 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +10 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/{operation-handler/operation-handler.d.ts → operation-handler.d.ts} +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +1 -2
- 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/components/MarkdownEditor/MarkdownEditor.d.ts +29 -23
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts +2 -2
- 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 -6
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts +6 -0
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts.map +1 -0
- 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 +2 -0
- package/dist/types/src/components/MarkdownSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.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/index.d.ts +3 -0
- package/dist/types/src/containers/EditableMarkdownCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownArticle/MarkdownArticle.d.ts +36 -0
- 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 +1 -1
- 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/index.d.ts +1 -2
- package/dist/types/src/containers/MarkdownCard/index.d.ts.map +1 -1
- package/dist/types/src/containers/MarkdownCard/snippet.d.ts +7 -5
- package/dist/types/src/containers/MarkdownCard/snippet.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +3 -3
- 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 +4 -2
- 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 -3
- package/dist/types/src/index.d.ts.map +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/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 -63
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Markdown.d.ts +15 -15
- 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} +6 -3
- package/dist/types/src/types/MarkdownOperation.d.ts.map +1 -0
- 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/index.d.ts +5 -3
- 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 +2 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +123 -90
- package/src/MarkdownPlugin.node.ts +20 -0
- package/src/MarkdownPlugin.test.ts +26 -0
- package/src/MarkdownPlugin.tsx +12 -55
- package/src/MarkdownPlugin.workerd.ts +19 -0
- package/src/blueprints/markdown-blueprint.ts +8 -9
- 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} +6 -7
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +5 -6
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
- package/src/capabilities/comment-config.ts +32 -0
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +16 -7
- package/src/capabilities/{operation-handler/index.ts → node.ts} +3 -1
- package/src/capabilities/{operation-handler/operation-handler.ts → operation-handler.ts} +2 -2
- package/src/capabilities/react-surface.tsx +127 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +2 -2
- package/src/capabilities/{state/state.ts → state.ts} +5 -5
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +24 -19
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +100 -87
- package/src/components/MarkdownEditor/MarkdownEditorContent.tsx +10 -14
- package/src/components/MarkdownEditor/MarkdownEditorToolbar.tsx +6 -17
- package/src/components/MarkdownSettings/MarkdownSettings.stories.tsx +40 -0
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +35 -0
- package/src/components/MarkdownSettings/index.ts +5 -0
- package/src/components/index.ts +4 -0
- package/src/containers/EditableMarkdownCard/EditableMarkdownCard.tsx +42 -0
- package/src/containers/EditableMarkdownCard/index.ts +6 -0
- package/src/containers/{MarkdownContainer/MarkdownContainer.stories.tsx → MarkdownArticle/MarkdownArticle.stories.tsx} +15 -13
- package/src/containers/{MarkdownContainer/MarkdownContainer.tsx → MarkdownArticle/MarkdownArticle.tsx} +38 -26
- package/src/containers/MarkdownArticle/index.ts +6 -0
- package/src/containers/MarkdownCard/MarkdownCard.stories.tsx +10 -10
- package/src/containers/MarkdownCard/MarkdownCard.tsx +25 -15
- package/src/containers/MarkdownCard/index.ts +1 -3
- package/src/containers/MarkdownCard/snippet.ts +27 -48
- package/src/containers/index.ts +3 -3
- package/src/hooks/useEditorMenuOptions.ts +2 -2
- package/src/hooks/useExtensions.tsx +14 -13
- package/src/hooks/useLinkQuery.ts +33 -27
- package/src/index.ts +2 -6
- package/src/meta.ts +5 -1
- package/src/operations/create-markdown.ts +3 -5
- package/src/operations/create.conversations.json +1 -1
- package/src/operations/create.test.ts +25 -22
- package/src/operations/create.ts +3 -4
- package/src/operations/index.ts +2 -4
- package/src/operations/open.ts +3 -3
- package/src/operations/scroll-to-anchor.ts +3 -5
- package/src/operations/set-view-mode.ts +3 -5
- package/src/operations/{update.ts → update-markdown.ts} +3 -3
- package/src/operations/update.conversations.json +1 -1
- package/src/operations/update.test.ts +45 -48
- package/src/plugin.ts +11 -0
- package/src/testing.ts +8 -3
- package/src/translations.ts +25 -38
- package/src/types/Markdown.ts +11 -21
- package/src/types/MarkdownCapabilities.ts +51 -0
- package/src/types/MarkdownEvents.ts +14 -0
- package/src/{operations/definitions.ts → types/MarkdownOperation.ts} +6 -3
- package/src/types/Settings.ts +65 -0
- package/src/types/index.ts +6 -4
- package/src/types/types.ts +4 -1
- package/src/util.tsx +4 -4
- package/dist/lib/browser/MarkdownCard-ZHQBD4AV.mjs +0 -122
- package/dist/lib/browser/MarkdownCard-ZHQBD4AV.mjs.map +0 -7
- package/dist/lib/browser/MarkdownContainer-XEUOYBPA.mjs +0 -125
- package/dist/lib/browser/MarkdownContainer-XEUOYBPA.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSettings-OD7AJSSJ.mjs +0 -106
- package/dist/lib/browser/MarkdownSettings-OD7AJSSJ.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-PSCEA6EJ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-DAVFEX7R.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-LHVNOMJT.mjs +0 -19
- package/dist/lib/browser/blueprint-definition-LHVNOMJT.mjs.map +0 -7
- package/dist/lib/browser/chunk-5VT6IW5B.mjs +0 -84
- package/dist/lib/browser/chunk-5VT6IW5B.mjs.map +0 -7
- package/dist/lib/browser/chunk-CJSWKCKU.mjs +0 -60
- package/dist/lib/browser/chunk-CJSWKCKU.mjs.map +0 -7
- package/dist/lib/browser/chunk-G6BRWY3G.mjs +0 -158
- package/dist/lib/browser/chunk-G6BRWY3G.mjs.map +0 -7
- package/dist/lib/browser/chunk-M2XFCKXA.mjs +0 -8
- package/dist/lib/browser/chunk-M2XFCKXA.mjs.map +0 -7
- package/dist/lib/browser/chunk-RYZHVXZ5.mjs.map +0 -7
- package/dist/lib/browser/chunk-XWYF5LFE.mjs +0 -8
- package/dist/lib/browser/chunk-XWYF5LFE.mjs.map +0 -7
- package/dist/lib/browser/chunk-YALLVET2.mjs +0 -757
- package/dist/lib/browser/chunk-YALLVET2.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZN75YHSV.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -44
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/create-QD27F6E7.mjs.map +0 -7
- package/dist/lib/browser/create-markdown-LEAJPLHT.mjs +0 -22
- package/dist/lib/browser/create-markdown-LEAJPLHT.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -164
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/open-YDABYPCA.mjs.map +0 -7
- package/dist/lib/browser/operation-handler-W3QXMMMQ.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/react-surface-N7FV3PXH.mjs.map +0 -7
- package/dist/lib/browser/scroll-to-anchor-3CGV3XI7.mjs.map +0 -7
- package/dist/lib/browser/set-view-mode-XLD3RXW4.mjs +0 -26
- package/dist/lib/browser/set-view-mode-XLD3RXW4.mjs.map +0 -7
- package/dist/lib/browser/settings-3UMXG4TP.mjs.map +0 -7
- package/dist/lib/browser/state-IYKJ6EV3.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/browser/update-WKAMI4AD.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownCard-VB3NHVX4.mjs +0 -123
- package/dist/lib/node-esm/MarkdownCard-VB3NHVX4.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownContainer-25WFZLCC.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownSettings-U7GJ4OP3.mjs +0 -107
- package/dist/lib/node-esm/MarkdownSettings-U7GJ4OP3.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-6GD4SGQL.mjs +0 -35
- package/dist/lib/node-esm/anchor-sort-6GD4SGQL.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-JURUUUBI.mjs +0 -64
- package/dist/lib/node-esm/app-graph-serializer-JURUUUBI.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-3LUZEJ4Z.mjs +0 -20
- package/dist/lib/node-esm/blueprint-definition-3LUZEJ4Z.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -11
- package/dist/lib/node-esm/chunk-6LHNAAMP.mjs +0 -159
- package/dist/lib/node-esm/chunk-6LHNAAMP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CRUJMQR2.mjs +0 -758
- package/dist/lib/node-esm/chunk-CRUJMQR2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CW4FZNMZ.mjs +0 -29
- package/dist/lib/node-esm/chunk-CW4FZNMZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EPNCYA73.mjs +0 -85
- package/dist/lib/node-esm/chunk-EPNCYA73.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FC3GPLJG.mjs +0 -61
- package/dist/lib/node-esm/chunk-FC3GPLJG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-G6W4DJBM.mjs +0 -51
- package/dist/lib/node-esm/chunk-G6W4DJBM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JLOCBILO.mjs +0 -10
- package/dist/lib/node-esm/chunk-JLOCBILO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YWQQYV76.mjs +0 -10
- package/dist/lib/node-esm/chunk-YWQQYV76.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -45
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/create-X7H4LYI5.mjs +0 -31
- package/dist/lib/node-esm/create-X7H4LYI5.mjs.map +0 -7
- package/dist/lib/node-esm/create-markdown-7POKQDVQ.mjs +0 -23
- package/dist/lib/node-esm/create-markdown-7POKQDVQ.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -165
- 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-FZVFWXC7.mjs +0 -22
- package/dist/lib/node-esm/open-FZVFWXC7.mjs.map +0 -7
- package/dist/lib/node-esm/operation-handler-TP26H7QE.mjs +0 -18
- package/dist/lib/node-esm/operation-handler-TP26H7QE.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/react-surface-XSKLSF6A.mjs +0 -121
- package/dist/lib/node-esm/react-surface-XSKLSF6A.mjs.map +0 -7
- package/dist/lib/node-esm/scroll-to-anchor-KWBJLM5Q.mjs +0 -50
- package/dist/lib/node-esm/scroll-to-anchor-KWBJLM5Q.mjs.map +0 -7
- package/dist/lib/node-esm/set-view-mode-FFEKYLU3.mjs +0 -27
- package/dist/lib/node-esm/set-view-mode-FFEKYLU3.mjs.map +0 -7
- package/dist/lib/node-esm/settings-UAN22O42.mjs +0 -39
- package/dist/lib/node-esm/settings-UAN22O42.mjs.map +0 -7
- package/dist/lib/node-esm/state-62IBFPTK.mjs +0 -49
- package/dist/lib/node-esm/state-62IBFPTK.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- package/dist/lib/node-esm/update-WPEFBY4M.mjs +0 -46
- package/dist/lib/node-esm/update-WPEFBY4M.mjs.map +0 -7
- 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.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.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 -6
- 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-handler/index.d.ts +0 -4
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/operation-handler.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.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.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 -6
- package/dist/types/src/capabilities/state/state.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 +0 -30
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.d.ts.map +0 -1
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.stories.d.ts +0 -89
- 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/containers/MarkdownSettings/MarkdownSettings.d.ts +0 -8
- package/dist/types/src/containers/MarkdownSettings/MarkdownSettings.d.ts.map +0 -1
- package/dist/types/src/containers/MarkdownSettings/index.d.ts +0 -3
- package/dist/types/src/containers/MarkdownSettings/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 -34
- 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/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/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -120
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -40
- package/src/containers/MarkdownContainer/index.ts +0 -6
- package/src/containers/MarkdownSettings/MarkdownSettings.tsx +0 -122
- package/src/containers/MarkdownSettings/index.ts +0 -7
- package/src/types/capabilities.ts +0 -50
- package/src/types/events.ts +0 -14
- /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
- /package/dist/lib/{browser/operations/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/blueprints/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm → neutral}/operations/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{anchor-sort/anchor-sort.d.ts → anchor-sort.d.ts} +0 -0
- /package/dist/types/src/capabilities/{app-graph-serializer/app-graph-serializer.d.ts → app-graph-serializer.d.ts} +0 -0
- /package/dist/types/src/capabilities/{artifact-definition/artifact-definition.d.ts → artifact-definition.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -4,34 +4,40 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, expect, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Layer from 'effect/Layer';
|
|
8
7
|
|
|
9
8
|
import { MemoizedAiService } from '@dxos/ai/testing';
|
|
10
|
-
import { AiContextService, AiConversationService } from '@dxos/assistant';
|
|
11
|
-
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
12
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
13
9
|
import { SpaceProperties } from '@dxos/client-protocol';
|
|
14
|
-
import {
|
|
15
|
-
import { Collection } from '@dxos/echo';
|
|
10
|
+
import { Blueprint, Operation } from '@dxos/compute';
|
|
11
|
+
import { Collection, Database, Feed, Obj, Query, Ref } from '@dxos/echo';
|
|
16
12
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
17
|
-
import {
|
|
13
|
+
import { AgentService } from '@dxos/functions-runtime';
|
|
14
|
+
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
18
15
|
import { invariant } from '@dxos/invariant';
|
|
19
16
|
import { ObjectId } from '@dxos/keys';
|
|
20
|
-
import { Markdown } from '@dxos/plugin-markdown
|
|
17
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
21
18
|
import { HasSubject } from '@dxos/types';
|
|
22
19
|
import { trim } from '@dxos/util';
|
|
23
20
|
|
|
24
|
-
import { WithProperties } from '
|
|
25
|
-
import MarkdownBlueprint from '../blueprints/markdown-blueprint';
|
|
21
|
+
import { WithProperties } from '#testing';
|
|
26
22
|
|
|
27
|
-
import
|
|
23
|
+
import MarkdownBlueprint from '../blueprints/markdown-blueprint';
|
|
24
|
+
import { MarkdownOperation } from '../types';
|
|
28
25
|
import { MarkdownOperationHandlerSet } from './index';
|
|
29
26
|
|
|
30
27
|
ObjectId.dangerouslyDisableRandomness();
|
|
31
28
|
|
|
32
29
|
const TestLayer = AssistantTestLayer({
|
|
30
|
+
aiServicePreset: 'edge-remote',
|
|
33
31
|
operationHandlers: MarkdownOperationHandlerSet,
|
|
34
|
-
types: [
|
|
32
|
+
types: [
|
|
33
|
+
SpaceProperties,
|
|
34
|
+
Collection.Collection,
|
|
35
|
+
Blueprint.Blueprint,
|
|
36
|
+
Markdown.Document,
|
|
37
|
+
HasSubject.HasSubject,
|
|
38
|
+
Feed.Feed,
|
|
39
|
+
],
|
|
40
|
+
blueprints: [MarkdownBlueprint.make()],
|
|
35
41
|
tracing: 'pretty',
|
|
36
42
|
});
|
|
37
43
|
|
|
@@ -46,7 +52,7 @@ describe('update', () => {
|
|
|
46
52
|
});
|
|
47
53
|
yield* Database.add(doc);
|
|
48
54
|
|
|
49
|
-
yield*
|
|
55
|
+
yield* Operation.invoke(MarkdownOperation.Update, {
|
|
50
56
|
doc: Ref.make(doc),
|
|
51
57
|
edits: [{ oldString: 'Founders', newString: '# Founders' }],
|
|
52
58
|
});
|
|
@@ -62,18 +68,16 @@ describe('update', () => {
|
|
|
62
68
|
),
|
|
63
69
|
);
|
|
64
70
|
|
|
65
|
-
it.
|
|
71
|
+
it.effect(
|
|
66
72
|
'create and update a markdown document',
|
|
67
73
|
Effect.fnUntraced(
|
|
68
74
|
function* (_) {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
blueprints: [Ref.make(markdownBlueprint)],
|
|
75
|
+
const agent = yield* AgentService.createSession({
|
|
76
|
+
blueprints: [MarkdownBlueprint.make()],
|
|
72
77
|
});
|
|
73
78
|
|
|
74
|
-
yield*
|
|
75
|
-
|
|
76
|
-
});
|
|
79
|
+
yield* agent.submitPrompt('Create a document with a cookie recipe.');
|
|
80
|
+
yield* agent.waitForCompletion();
|
|
77
81
|
{
|
|
78
82
|
const docs = yield* Database.runQuery(Query.type(Markdown.Document));
|
|
79
83
|
if (docs.length !== 1) {
|
|
@@ -88,9 +92,8 @@ describe('update', () => {
|
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
yield*
|
|
92
|
-
|
|
93
|
-
});
|
|
95
|
+
yield* agent.submitPrompt('Add a section with a holiday-themed variation.');
|
|
96
|
+
yield* agent.waitForCompletion();
|
|
94
97
|
{
|
|
95
98
|
const docs = yield* Database.runQuery(Query.type(Markdown.Document));
|
|
96
99
|
if (docs.length !== 1) {
|
|
@@ -106,13 +109,13 @@ describe('update', () => {
|
|
|
106
109
|
}
|
|
107
110
|
},
|
|
108
111
|
WithProperties,
|
|
109
|
-
Effect.provide(
|
|
112
|
+
Effect.provide(TestLayer),
|
|
110
113
|
TestHelpers.provideTestContext,
|
|
111
114
|
),
|
|
112
115
|
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
113
116
|
);
|
|
114
117
|
|
|
115
|
-
it.
|
|
118
|
+
it.effect(
|
|
116
119
|
'update existing document',
|
|
117
120
|
Effect.fnUntraced(
|
|
118
121
|
function* (_) {
|
|
@@ -128,15 +131,13 @@ describe('update', () => {
|
|
|
128
131
|
`,
|
|
129
132
|
}),
|
|
130
133
|
);
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
objects: [Ref.make(document)],
|
|
134
|
+
const agent = yield* AgentService.createSession({
|
|
135
|
+
blueprints: [MarkdownBlueprint.make()],
|
|
136
|
+
context: [Ref.make(document)],
|
|
135
137
|
});
|
|
136
138
|
|
|
137
|
-
yield*
|
|
138
|
-
|
|
139
|
-
});
|
|
139
|
+
yield* agent.submitPrompt('Add the missing ingredient (its flour).');
|
|
140
|
+
yield* agent.waitForCompletion();
|
|
140
141
|
|
|
141
142
|
{
|
|
142
143
|
const docs = yield* Database.runQuery(Query.type(Markdown.Document));
|
|
@@ -155,13 +156,13 @@ describe('update', () => {
|
|
|
155
156
|
}
|
|
156
157
|
},
|
|
157
158
|
WithProperties,
|
|
158
|
-
Effect.provide(
|
|
159
|
+
Effect.provide(TestLayer),
|
|
159
160
|
TestHelpers.provideTestContext,
|
|
160
161
|
),
|
|
161
162
|
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
162
163
|
);
|
|
163
164
|
|
|
164
|
-
it.
|
|
165
|
+
it.effect(
|
|
165
166
|
'add lines to document one by one',
|
|
166
167
|
Effect.fnUntraced(
|
|
167
168
|
function* (_) {
|
|
@@ -173,21 +174,17 @@ describe('update', () => {
|
|
|
173
174
|
`,
|
|
174
175
|
}),
|
|
175
176
|
);
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
objects: [Ref.make(document)],
|
|
177
|
+
const agent = yield* AgentService.createSession({
|
|
178
|
+
blueprints: [MarkdownBlueprint.make()],
|
|
179
|
+
context: [Ref.make(document)],
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
yield*
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
yield*
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
yield* AiConversationService.run({
|
|
189
|
-
prompt: 'Add eggs to the shopping list.',
|
|
190
|
-
});
|
|
182
|
+
yield* agent.submitPrompt('Add milk to the shopping list.');
|
|
183
|
+
yield* agent.waitForCompletion();
|
|
184
|
+
yield* agent.submitPrompt('Add bread to the shopping list.');
|
|
185
|
+
yield* agent.waitForCompletion();
|
|
186
|
+
yield* agent.submitPrompt('Add eggs to the shopping list.');
|
|
187
|
+
yield* agent.waitForCompletion();
|
|
191
188
|
|
|
192
189
|
{
|
|
193
190
|
const docs = yield* Database.runQuery(Query.type(Markdown.Document));
|
|
@@ -208,7 +205,7 @@ describe('update', () => {
|
|
|
208
205
|
}
|
|
209
206
|
},
|
|
210
207
|
WithProperties,
|
|
211
|
-
Effect.provide(
|
|
208
|
+
Effect.provide(TestLayer),
|
|
212
209
|
TestHelpers.provideTestContext,
|
|
213
210
|
),
|
|
214
211
|
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
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
|
@@ -6,9 +6,14 @@ import * as Toolkit from '@effect/ai/Toolkit';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
8
|
import { SpaceProperties } from '@dxos/client-protocol';
|
|
9
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import { Collection, Database, Obj, Ref } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
// Eager re-export of `MarkdownPlugin`. See `@dxos/plugin-testing/src/core.ts`
|
|
12
|
+
// for the rationale. Uses the `#plugin` subpath so the node-only build is
|
|
13
|
+
// re-exported in test environments, avoiding the browser-only `MarkdownPlugin.tsx`
|
|
14
|
+
// which references React-surface capabilities that are intentionally omitted
|
|
15
|
+
// from `capabilities/node.ts`.
|
|
16
|
+
export * from '#plugin';
|
|
12
17
|
|
|
13
18
|
// TODO(wittjosiah): Factor out.
|
|
14
19
|
export const WithProperties = <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R | Database.Service> =>
|
package/src/translations.ts
CHANGED
|
@@ -3,52 +3,39 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
|
-
import { translations as editorTranslations } from '@dxos/react-ui-editor';
|
|
6
|
+
import { translations as editorTranslations } from '@dxos/react-ui-editor/translations';
|
|
7
7
|
|
|
8
|
-
import { meta } from '
|
|
9
|
-
import { Markdown } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
|
+
import { Markdown } from '#types';
|
|
10
10
|
|
|
11
11
|
export const translations = [
|
|
12
12
|
{
|
|
13
13
|
'en-US': {
|
|
14
14
|
[Markdown.Document.typename]: {
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'typename
|
|
19
|
-
'object
|
|
20
|
-
'add
|
|
21
|
-
'rename
|
|
22
|
-
'delete
|
|
23
|
-
'object
|
|
15
|
+
'typename.label': 'Document',
|
|
16
|
+
'typename.label_zero': 'Documents',
|
|
17
|
+
'typename.label_one': 'Document',
|
|
18
|
+
'typename.label_other': 'Documents',
|
|
19
|
+
'object-name.placeholder': 'New document',
|
|
20
|
+
'add-object.label': 'Add document',
|
|
21
|
+
'rename-object.label': 'Rename document',
|
|
22
|
+
'delete-object.label': 'Delete document',
|
|
23
|
+
'object-deleted.label': 'Document deleted',
|
|
24
24
|
},
|
|
25
25
|
[meta.id]: {
|
|
26
|
-
'plugin
|
|
27
|
-
'
|
|
28
|
-
'choose
|
|
29
|
-
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'settings numbered headings label': 'Numbered headings',
|
|
40
|
-
'settings folding label': 'Folding',
|
|
41
|
-
'settings experimental label': 'Enable experimental features',
|
|
42
|
-
'settings debug label': 'Enable debugging features',
|
|
43
|
-
'settings debug placeholder': 'Typewriter script...',
|
|
44
|
-
'toggle view mode label': 'Toggle read-only',
|
|
45
|
-
'default view mode label': 'Default view mode',
|
|
46
|
-
'upload image label': 'Upload image',
|
|
47
|
-
'fallback title': 'Untitled',
|
|
48
|
-
'navigate to document label': 'Open document',
|
|
49
|
-
'words label_zero': 'words',
|
|
50
|
-
'words label_one': 'word',
|
|
51
|
-
'words label_other': 'words',
|
|
26
|
+
'plugin.name': 'Editor',
|
|
27
|
+
'choose-markdown-from-space-dialog.title': 'Choose one or more documents to add',
|
|
28
|
+
'empty-choose-markdown-from-space.message': 'None available; try creating a new one instead?',
|
|
29
|
+
'chooser-done.label': 'Add selected',
|
|
30
|
+
'editor.placeholder': 'Enter text…',
|
|
31
|
+
'toggle-view-mode.label': 'Toggle read-only',
|
|
32
|
+
'upload-image.label': 'Upload image',
|
|
33
|
+
'fallback.title': 'Untitled',
|
|
34
|
+
'navigate-to-document.label': 'Open document',
|
|
35
|
+
'words.label': 'words',
|
|
36
|
+
'words.label_zero': 'words',
|
|
37
|
+
'words.label_one': 'word',
|
|
38
|
+
'words.label_other': 'words',
|
|
52
39
|
},
|
|
53
40
|
},
|
|
54
41
|
},
|
package/src/types/Markdown.ts
CHANGED
|
@@ -4,10 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
+
import { BlueprintsAnnotation, GraphPropsAnnotation } from '@dxos/app-toolkit';
|
|
7
8
|
import { Annotation, Obj, Ref, Type } from '@dxos/echo';
|
|
8
9
|
import { DescriptionAnnotation, FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
|
|
9
10
|
import { Text } from '@dxos/schema';
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
export const BLUEPRINT_KEY = 'org.dxos.blueprint.markdown';
|
|
13
|
+
|
|
14
|
+
// Re-export Settings as merged const/type (not as namespace).
|
|
15
|
+
import * as SettingsModule from './Settings';
|
|
16
|
+
export const Settings = SettingsModule.Settings;
|
|
17
|
+
export type Settings = SettingsModule.Settings;
|
|
11
18
|
|
|
12
19
|
/**
|
|
13
20
|
* Document Item type.
|
|
@@ -28,6 +35,8 @@ export const Document = Schema.Struct({
|
|
|
28
35
|
icon: 'ph--text-aa--regular',
|
|
29
36
|
hue: 'indigo',
|
|
30
37
|
}),
|
|
38
|
+
BlueprintsAnnotation.set([BLUEPRINT_KEY]),
|
|
39
|
+
GraphPropsAnnotation.set({ managesAutofocus: true }),
|
|
31
40
|
);
|
|
32
41
|
|
|
33
42
|
export type Document = Schema.Schema.Type<typeof Document>;
|
|
@@ -39,27 +48,8 @@ export const make = ({
|
|
|
39
48
|
content = '',
|
|
40
49
|
...props
|
|
41
50
|
}: Partial<{ name: string; fallbackName: string; content: string }> = {}) => {
|
|
42
|
-
const doc = Obj.make(Document, { ...props, content: Ref.make(Text.make(content)) });
|
|
51
|
+
const doc = Obj.make(Document, { ...props, content: Ref.make(Text.make({ content })) });
|
|
43
52
|
// TODO(dmaretskyi): We need a better way to set parents when creating hierarchies.
|
|
44
53
|
Obj.setParent(doc.content.target!, doc);
|
|
45
54
|
return doc;
|
|
46
55
|
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Plugin settings.
|
|
50
|
-
*/
|
|
51
|
-
export const Settings = Schema.mutable(
|
|
52
|
-
Schema.Struct({
|
|
53
|
-
defaultViewMode: EditorViewMode,
|
|
54
|
-
editorInputMode: Schema.optional(EditorInputMode),
|
|
55
|
-
experimental: Schema.optional(Schema.Boolean),
|
|
56
|
-
debug: Schema.optional(Schema.Boolean),
|
|
57
|
-
toolbar: Schema.optional(Schema.Boolean),
|
|
58
|
-
typewriter: Schema.optional(Schema.String),
|
|
59
|
-
// TODO(burdon): Per document settings.
|
|
60
|
-
numberedHeadings: Schema.optional(Schema.Boolean),
|
|
61
|
-
folding: Schema.optional(Schema.Boolean),
|
|
62
|
-
}),
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
export interface Settings extends Schema.Schema.Type<typeof Settings> {}
|
|
@@ -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 Extensions = 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,16 +2,19 @@
|
|
|
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';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
8
11
|
import { Database, Ref } from '@dxos/echo';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
12
|
import { EditorViewMode } from '@dxos/ui-editor/types';
|
|
11
13
|
import { trim } from '@dxos/util';
|
|
12
14
|
|
|
13
|
-
import { meta } from '
|
|
14
|
-
|
|
15
|
+
import { meta } from '#meta';
|
|
16
|
+
|
|
17
|
+
import * as Markdown from './Markdown';
|
|
15
18
|
|
|
16
19
|
const MARKDOWN_OPERATION = `${meta.id}.operation`;
|
|
17
20
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { EditorInputMode, EditorViewMode } from '@dxos/ui-editor/types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Plugin settings.
|
|
13
|
+
*/
|
|
14
|
+
export const Settings = Schema.mutable(
|
|
15
|
+
Schema.Struct({
|
|
16
|
+
defaultViewMode: EditorViewMode.annotations({
|
|
17
|
+
title: 'Default view mode',
|
|
18
|
+
description: 'Set whether documents open in editing or read-only mode.',
|
|
19
|
+
}),
|
|
20
|
+
editorInputMode: Schema.optional(
|
|
21
|
+
EditorInputMode.annotations({
|
|
22
|
+
title: 'Editor input mode',
|
|
23
|
+
description: 'Choose keyboard bindings for the editor.',
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
toolbar: Schema.optional(
|
|
27
|
+
Schema.Boolean.annotations({
|
|
28
|
+
title: 'Show toolbar',
|
|
29
|
+
description: 'Display a formatting toolbar above the editor.',
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
numberedHeadings: Schema.optional(
|
|
33
|
+
Schema.Boolean.annotations({
|
|
34
|
+
title: 'Numbered headings',
|
|
35
|
+
description: 'Automatically number heading levels in the document.',
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
folding: Schema.optional(
|
|
39
|
+
Schema.Boolean.annotations({
|
|
40
|
+
title: 'Folding',
|
|
41
|
+
description: 'Allow collapsing and expanding sections by heading.',
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
44
|
+
experimental: Schema.optional(
|
|
45
|
+
Schema.Boolean.annotations({
|
|
46
|
+
title: 'Enable experimental features',
|
|
47
|
+
description: 'Turn on features that are still in development.',
|
|
48
|
+
}),
|
|
49
|
+
),
|
|
50
|
+
debug: Schema.optional(
|
|
51
|
+
Schema.Boolean.annotations({
|
|
52
|
+
title: 'Enable debugging features',
|
|
53
|
+
description: 'Show developer tools and diagnostics for the editor.',
|
|
54
|
+
}),
|
|
55
|
+
),
|
|
56
|
+
snippets: Schema.optional(
|
|
57
|
+
Schema.String.annotations({
|
|
58
|
+
title: 'Snippets',
|
|
59
|
+
description: 'Input snippets to replay for testing purposes.',
|
|
60
|
+
}),
|
|
61
|
+
),
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
export interface Settings extends Schema.Schema.Type<typeof Settings> {}
|
package/src/types/index.ts
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * as Markdown from './Markdown';
|
|
6
|
-
|
|
7
|
-
export * from './capabilities';
|
|
8
|
-
export * from './events';
|
|
9
5
|
export * from './types';
|
|
6
|
+
|
|
7
|
+
export * as Markdown from './Markdown';
|
|
8
|
+
export * as MarkdownCapabilities from './MarkdownCapabilities';
|
|
9
|
+
export * as MarkdownEvents from './MarkdownEvents';
|
|
10
|
+
export * as MarkdownOperation from './MarkdownOperation';
|
|
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,9 +4,9 @@
|
|
|
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
|
-
import { Markdown } from '
|
|
9
|
+
import { Markdown } from '#types';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Checks if an object conforms to the interface needed to render an editor.
|
|
@@ -116,8 +116,8 @@ 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.
|
|
120
|
-
|
|
119
|
+
Obj.update(doc, (doc) => {
|
|
120
|
+
doc.fallbackName = name;
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
}, 200);
|