@dxos/plugin-markdown 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/MarkdownSettings-5AD3X3II.mjs +124 -0
- package/dist/lib/browser/MarkdownSettings-5AD3X3II.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +47 -4
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/chunk-46WIDM4R.mjs +98 -0
- package/dist/lib/browser/chunk-46WIDM4R.mjs.map +7 -0
- package/dist/lib/browser/chunk-GQKARRJU.mjs +158 -0
- package/dist/lib/browser/chunk-GQKARRJU.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/cli/index.mjs +26 -19
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/create-I7QWPBMS.mjs +30 -0
- package/dist/lib/browser/create-I7QWPBMS.mjs.map +7 -0
- package/dist/lib/browser/create-markdown-6QQXSF3Q.mjs +22 -0
- package/dist/lib/browser/create-markdown-6QQXSF3Q.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +586 -85
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-NSBN4NKR.mjs +21 -0
- package/dist/lib/browser/open-NSBN4NKR.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/scroll-to-anchor-RA5OMQCP.mjs +49 -0
- package/dist/lib/browser/scroll-to-anchor-RA5OMQCP.mjs.map +7 -0
- package/dist/lib/browser/set-view-mode-75MBU6CB.mjs +26 -0
- package/dist/lib/browser/set-view-mode-75MBU6CB.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -7
- package/dist/lib/browser/update-QQJYONAC.mjs +45 -0
- package/dist/lib/browser/update-QQJYONAC.mjs.map +7 -0
- package/dist/lib/node-esm/MarkdownSettings-ODDM67XG.mjs +125 -0
- package/dist/lib/node-esm/MarkdownSettings-ODDM67XG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +47 -4
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-4MSJO6IJ.mjs +99 -0
- package/dist/lib/node-esm/chunk-4MSJO6IJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-QRCQ55W7.mjs +159 -0
- package/dist/lib/node-esm/chunk-QRCQ55W7.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +26 -19
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/create-VJ5SIKYF.mjs +31 -0
- package/dist/lib/node-esm/create-VJ5SIKYF.mjs.map +7 -0
- package/dist/lib/node-esm/create-markdown-P5KNGLZ5.mjs +23 -0
- package/dist/lib/node-esm/create-markdown-P5KNGLZ5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +586 -85
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-U3T6IVHN.mjs +22 -0
- package/dist/lib/node-esm/open-U3T6IVHN.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-to-anchor-CVM3LVSQ.mjs +50 -0
- package/dist/lib/node-esm/scroll-to-anchor-CVM3LVSQ.mjs.map +7 -0
- package/dist/lib/node-esm/set-view-mode-WQJBCUXY.mjs +27 -0
- package/dist/lib/node-esm/set-view-mode-WQJBCUXY.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -7
- package/dist/lib/node-esm/update-24CQM75C.mjs +46 -0
- package/dist/lib/node-esm/update-24CQM75C.mjs.map +7 -0
- package/dist/types/src/MarkdownPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +1 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/markdown-blueprint.d.ts +3 -20
- package/dist/types/src/blueprints/markdown-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort.d.ts +6 -0
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +5 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts +5 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +27 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +4 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +24 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +6 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts +2 -2
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts +14 -9
- 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 +4 -2
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts +11 -6
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts +4 -6
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.stories.d.ts +138 -0
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownSettings/index.d.ts +2 -1
- package/dist/types/src/components/MarkdownSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/MarkdownCard/MarkdownCard.d.ts +1 -1
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.stories.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/MarkdownCard/index.d.ts +0 -1
- package/dist/types/src/containers/MarkdownCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownCard/snippet.d.ts +15 -0
- package/dist/types/src/containers/MarkdownCard/snippet.d.ts.map +1 -0
- package/dist/types/src/{components → containers/MarkdownContainer}/MarkdownContainer.d.ts +10 -7
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.stories.d.ts +99 -0
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownContainer/index.d.ts +3 -0
- package/dist/types/src/containers/MarkdownContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useExtensions.d.ts +7 -5
- package/dist/types/src/hooks/useExtensions.d.ts.map +1 -1
- package/dist/types/src/hooks/useLinkQuery.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-markdown.d.ts +5 -0
- package/dist/types/src/operations/create-markdown.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/create.test.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +64 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/scroll-to-anchor.d.ts +5 -0
- package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -0
- package/dist/types/src/operations/set-view-mode.d.ts +5 -0
- package/dist/types/src/operations/set-view-mode.d.ts.map +1 -0
- package/dist/types/src/operations/update.d.ts +5 -0
- package/dist/types/src/operations/update.d.ts.map +1 -0
- package/dist/types/src/operations/update.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +75 -35
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Markdown.d.ts +15 -16
- package/dist/types/src/types/Markdown.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +16 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +31 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +2 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +89 -57
- package/src/MarkdownPlugin.tsx +49 -44
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/markdown-blueprint.ts +14 -8
- package/src/capabilities/{anchor-sort/anchor-sort.ts → anchor-sort.ts} +4 -3
- package/src/capabilities/{app-graph-serializer/app-graph-serializer.ts → app-graph-serializer.ts} +14 -9
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +5 -5
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/index.ts +13 -7
- package/src/capabilities/node.ts +11 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +48 -27
- package/src/capabilities/{settings/settings.ts → settings.ts} +5 -4
- package/src/capabilities/state.ts +47 -0
- package/src/cli/plugin.ts +21 -10
- package/src/components/MarkdownEditor/FileUpload.tsx +2 -2
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +29 -29
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +63 -32
- package/src/components/MarkdownEditor/MarkdownEditorContent.tsx +24 -17
- package/src/components/MarkdownEditor/MarkdownEditorToolbar.tsx +47 -55
- package/src/components/MarkdownSettings/MarkdownSettings.stories.tsx +40 -0
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +114 -98
- package/src/components/MarkdownSettings/index.ts +3 -1
- package/src/components/index.ts +4 -12
- package/src/{components → containers}/MarkdownCard/MarkdownCard.stories.tsx +17 -7
- package/src/{components → containers}/MarkdownCard/MarkdownCard.tsx +23 -30
- package/src/{components → containers}/MarkdownCard/index.ts +0 -2
- package/src/containers/MarkdownCard/snippet.ts +75 -0
- package/src/{components → containers/MarkdownContainer}/MarkdownContainer.stories.tsx +28 -18
- package/src/{components → containers/MarkdownContainer}/MarkdownContainer.tsx +59 -36
- package/src/containers/MarkdownContainer/index.ts +6 -0
- package/src/containers/index.ts +10 -0
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useEditorMenuOptions.ts +2 -2
- package/src/hooks/useExtensions.tsx +80 -93
- package/src/hooks/useLinkQuery.ts +31 -6
- package/src/index.ts +2 -0
- package/src/meta.ts +1 -1
- package/src/operations/create-markdown.ts +21 -0
- package/src/operations/create.conversations.json +1 -0
- package/src/operations/create.test.ts +98 -0
- package/src/operations/create.ts +27 -0
- package/src/operations/definitions.ts +119 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/open.ts +25 -0
- package/src/operations/scroll-to-anchor.ts +40 -0
- package/src/operations/set-view-mode.ts +25 -0
- package/src/operations/update.conversations.json +1 -0
- package/src/operations/update.test.ts +215 -0
- package/src/operations/update.ts +51 -0
- package/src/testing.ts +2 -2
- package/src/translations.ts +49 -35
- package/src/types/Markdown.ts +18 -25
- package/src/types/Settings.ts +28 -0
- package/src/types/capabilities.ts +17 -5
- package/src/types/events.ts +5 -4
- package/src/types/index.ts +3 -4
- package/src/util.tsx +5 -5
- package/dist/lib/browser/MarkdownCard-WHK3ORP7.mjs +0 -12
- package/dist/lib/browser/MarkdownContainer-V7EAADMF.mjs +0 -12
- package/dist/lib/browser/anchor-sort-WQ3TL7ZI.mjs +0 -32
- package/dist/lib/browser/anchor-sort-WQ3TL7ZI.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-ULZUJKOD.mjs +0 -58
- package/dist/lib/browser/app-graph-serializer-ULZUJKOD.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-TLV4PNZW.mjs +0 -19
- package/dist/lib/browser/blueprint-definition-TLV4PNZW.mjs.map +0 -7
- package/dist/lib/browser/chunk-BX73DASG.mjs +0 -702
- package/dist/lib/browser/chunk-BX73DASG.mjs.map +0 -7
- package/dist/lib/browser/chunk-CUGDX7KA.mjs +0 -8
- package/dist/lib/browser/chunk-CUGDX7KA.mjs.map +0 -7
- package/dist/lib/browser/chunk-FWQQW6KU.mjs +0 -144
- package/dist/lib/browser/chunk-FWQQW6KU.mjs.map +0 -7
- package/dist/lib/browser/chunk-JOXYQLKH.mjs +0 -55
- package/dist/lib/browser/chunk-JOXYQLKH.mjs.map +0 -7
- package/dist/lib/browser/chunk-KDKXFKDN.mjs +0 -104
- package/dist/lib/browser/chunk-KDKXFKDN.mjs.map +0 -7
- package/dist/lib/browser/chunk-LMO5UVKL.mjs +0 -167
- package/dist/lib/browser/chunk-LMO5UVKL.mjs.map +0 -7
- package/dist/lib/browser/chunk-S45ULIOG.mjs +0 -101
- package/dist/lib/browser/chunk-S45ULIOG.mjs.map +0 -7
- package/dist/lib/browser/chunk-WIPSLZ6L.mjs +0 -60
- package/dist/lib/browser/chunk-WIPSLZ6L.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-EGCWOQKJ.mjs +0 -53
- package/dist/lib/browser/operation-resolver-EGCWOQKJ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SRPLD3ED.mjs +0 -213
- package/dist/lib/browser/react-surface-SRPLD3ED.mjs.map +0 -7
- package/dist/lib/browser/settings-JY5JE7MI.mjs +0 -35
- package/dist/lib/browser/settings-JY5JE7MI.mjs.map +0 -7
- package/dist/lib/browser/state-QE7VSJWJ.mjs +0 -29
- package/dist/lib/browser/state-QE7VSJWJ.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownCard-WJPLQTFS.mjs +0 -13
- package/dist/lib/node-esm/MarkdownCard-WJPLQTFS.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownContainer-LUSMORP2.mjs +0 -13
- package/dist/lib/node-esm/MarkdownContainer-LUSMORP2.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-G7D5TAI6.mjs +0 -33
- package/dist/lib/node-esm/anchor-sort-G7D5TAI6.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-W5YMQP7P.mjs +0 -59
- package/dist/lib/node-esm/app-graph-serializer-W5YMQP7P.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-HYFA7BKQ.mjs +0 -20
- package/dist/lib/node-esm/blueprint-definition-HYFA7BKQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3JYPCC7M.mjs +0 -105
- package/dist/lib/node-esm/chunk-3JYPCC7M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-44VJC3QF.mjs +0 -56
- package/dist/lib/node-esm/chunk-44VJC3QF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D4BCFPKK.mjs +0 -703
- package/dist/lib/node-esm/chunk-D4BCFPKK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EYAFC4N7.mjs +0 -145
- package/dist/lib/node-esm/chunk-EYAFC4N7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PRV35A7Z.mjs +0 -168
- package/dist/lib/node-esm/chunk-PRV35A7Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RQP7G7XW.mjs +0 -61
- package/dist/lib/node-esm/chunk-RQP7G7XW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SDTYEGGL.mjs +0 -102
- package/dist/lib/node-esm/chunk-SDTYEGGL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W3IIKDV5.mjs +0 -10
- package/dist/lib/node-esm/chunk-W3IIKDV5.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-2HIS2AQZ.mjs +0 -54
- package/dist/lib/node-esm/operation-resolver-2HIS2AQZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RONSOJIQ.mjs +0 -214
- package/dist/lib/node-esm/react-surface-RONSOJIQ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-4UGMPIRY.mjs +0 -36
- package/dist/lib/node-esm/settings-4UGMPIRY.mjs.map +0 -7
- package/dist/lib/node-esm/state-LXE5XIN4.mjs +0 -30
- package/dist/lib/node-esm/state-LXE5XIN4.mjs.map +0 -7
- package/dist/types/src/blueprints/functions/create.d.ts +0 -8
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/create.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts +0 -4
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/open.d.ts +0 -7
- package/dist/types/src/blueprints/functions/open.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/update.d.ts +0 -6
- package/dist/types/src/blueprints/functions/update.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/update.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +0 -5
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +0 -1
- package/dist/types/src/capabilities/anchor-sort/index.d.ts +0 -3
- package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +0 -5
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +0 -5
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -10
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -3
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -6
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -3
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts +0 -5
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/MarkdownCard.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/index.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownContainer.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownContainer.stories.d.ts +0 -59
- package/dist/types/src/components/MarkdownContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Suggestions.stories.d.ts +0 -11
- package/dist/types/src/components/Suggestions.stories.d.ts.map +0 -1
- package/dist/types/src/hooks/useSelectCurrentThread.d.ts +0 -6
- package/dist/types/src/hooks/useSelectCurrentThread.d.ts.map +0 -1
- package/dist/types/src/types/MarkdownAction.d.ts +0 -66
- package/dist/types/src/types/MarkdownAction.d.ts.map +0 -1
- package/src/blueprints/functions/create.conversations.json +0 -1
- package/src/blueprints/functions/create.test.ts +0 -125
- package/src/blueprints/functions/create.ts +0 -34
- package/src/blueprints/functions/index.ts +0 -7
- package/src/blueprints/functions/open.ts +0 -33
- package/src/blueprints/functions/update.conversations.json +0 -1
- package/src/blueprints/functions/update.test.ts +0 -149
- package/src/blueprints/functions/update.ts +0 -38
- package/src/capabilities/anchor-sort/index.ts +0 -7
- package/src/capabilities/app-graph-serializer/index.ts +0 -7
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -25
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -45
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/state/state.ts +0 -31
- package/src/components/Suggestions.stories.tsx +0 -215
- package/src/hooks/useSelectCurrentThread.tsx +0 -61
- package/src/types/MarkdownAction.ts +0 -59
- /package/dist/lib/browser/{MarkdownCard-WHK3ORP7.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/MarkdownContainer-V7EAADMF.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/MarkdownCard/MarkdownCard.stories.d.ts +0 -0
- /package/dist/types/src/{blueprints/functions → operations}/create.test.d.ts +0 -0
- /package/dist/types/src/{blueprints/functions → operations}/update.test.d.ts +0 -0
|
@@ -5,60 +5,53 @@
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj } from '@dxos/echo';
|
|
8
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { Card } from '@dxos/react-ui-mosaic';
|
|
8
|
+
import { Card, useTranslation } from '@dxos/react-ui';
|
|
10
9
|
import { Text } from '@dxos/schema';
|
|
11
10
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
11
|
+
import { MarkdownEditor } from '#components';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { Markdown } from '#types';
|
|
14
|
+
import { getContentSnippet } from '../../util';
|
|
15
|
+
|
|
16
|
+
import { snippet as snippetExtension } from './snippet';
|
|
16
17
|
|
|
17
18
|
export type MarkdownCardProps = { subject: Markdown.Document | Text.Text };
|
|
18
19
|
|
|
19
20
|
export const MarkdownCard = ({ subject }: MarkdownCardProps) => {
|
|
20
21
|
const { t } = useTranslation(meta.id);
|
|
21
22
|
const snippet = useMemo(() => getSnippet(subject), [subject]);
|
|
23
|
+
const extensions = useMemo(() => [snippetExtension({ height: 240, scale: 0.8 })], []);
|
|
22
24
|
const info = getInfo(subject);
|
|
23
25
|
|
|
24
26
|
return (
|
|
25
27
|
<Card.Content>
|
|
26
28
|
{snippet && (
|
|
27
|
-
<Card.
|
|
28
|
-
<MarkdownEditor.Root id={subject.id} viewMode='readonly'>
|
|
29
|
-
<MarkdownEditor.Content initialValue={snippet} slots={{
|
|
29
|
+
<Card.Section className='px-1'>
|
|
30
|
+
<MarkdownEditor.Root id={subject.id} viewMode='readonly' extensions={extensions}>
|
|
31
|
+
<MarkdownEditor.Content initialValue={snippet} slots={{ content: { className: 'm-0' } }} />
|
|
30
32
|
</MarkdownEditor.Root>
|
|
31
|
-
</Card.
|
|
33
|
+
</Card.Section>
|
|
32
34
|
)}
|
|
33
|
-
<Card.
|
|
34
|
-
<Card.Text classNames='text-xs text-description'>
|
|
35
|
-
{info.words} {t('words
|
|
35
|
+
<Card.Section>
|
|
36
|
+
<Card.Text classNames='px-1.5 text-xs text-description'>
|
|
37
|
+
{info.words} {t('words.label', { count: info.words })}
|
|
36
38
|
</Card.Text>
|
|
37
|
-
</Card.
|
|
39
|
+
</Card.Section>
|
|
38
40
|
</Card.Content>
|
|
39
41
|
);
|
|
40
42
|
};
|
|
41
43
|
|
|
42
|
-
const
|
|
43
|
-
const text = (Obj.instanceOf(Markdown.Document, subject) ? subject.content?.target?.content : subject.content) ?? '';
|
|
44
|
-
return { words: text.split(' ').length };
|
|
45
|
-
};
|
|
44
|
+
const MAX_LINES = 5;
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
const getTitle = (subject: Markdown.Document | Text.Text, fallback: string) => {
|
|
46
|
+
const getSnippet = (subject: Markdown.Document | Text.Text, fallback?: string) => {
|
|
49
47
|
if (Obj.instanceOf(Markdown.Document, subject)) {
|
|
50
|
-
|
|
51
|
-
return title ?? getFallbackName(subject.content?.target?.content ?? fallback);
|
|
48
|
+
return Obj.getDescription(subject) || getContentSnippet(subject.content?.target?.content ?? fallback, MAX_LINES);
|
|
52
49
|
} else if (Obj.instanceOf(Text.Text, subject)) {
|
|
53
|
-
return
|
|
50
|
+
return getContentSnippet(subject.content ?? fallback, MAX_LINES);
|
|
54
51
|
}
|
|
55
52
|
};
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
return Obj.getDescription(subject) || getContentSnippet(subject.content?.target?.content ?? fallback);
|
|
61
|
-
} else if (Obj.instanceOf(Text.Text, subject)) {
|
|
62
|
-
return getContentSnippet(subject.content ?? fallback);
|
|
63
|
-
}
|
|
54
|
+
const getInfo = (subject: Markdown.Document | Text.Text) => {
|
|
55
|
+
const text = (Obj.instanceOf(Markdown.Document, subject) ? subject.content?.target?.content : subject.content) ?? '';
|
|
56
|
+
return { words: text.split(' ').length };
|
|
64
57
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type PluginValue, EditorView, ViewPlugin, type ViewUpdate } from '@codemirror/view';
|
|
6
|
+
|
|
7
|
+
export type SnippetOptions = {
|
|
8
|
+
/** Maximum height of the editor in pixels. Content is clipped to whole lines within this height. */
|
|
9
|
+
height: number;
|
|
10
|
+
/** Zoom factor applied to the editor (e.g. 0.5 renders at 50%). @default 1 */
|
|
11
|
+
scale?: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* CodeMirror extension for rendering a non-scrollable snippet of editor content.
|
|
16
|
+
* Constrains the editor to the given height, clips to whole line boundaries,
|
|
17
|
+
* and disables scrolling entirely.
|
|
18
|
+
* Uses requestMeasure to read post-layout heights and lineBlockAtHeight to handle
|
|
19
|
+
* varying line heights from headings and other decorated blocks.
|
|
20
|
+
*/
|
|
21
|
+
export const snippet = ({ height, scale = 1 }: SnippetOptions) => {
|
|
22
|
+
// Internal height is divided by scale so the visible area matches the requested height.
|
|
23
|
+
const internalHeight = Math.round(height / scale);
|
|
24
|
+
|
|
25
|
+
const clipPlugin = ViewPlugin.fromClass(
|
|
26
|
+
class SnippetPlugin implements PluginValue {
|
|
27
|
+
private clipHeight = 0;
|
|
28
|
+
|
|
29
|
+
update(update: ViewUpdate) {
|
|
30
|
+
update.view.requestMeasure({
|
|
31
|
+
// key dedupliactes concurrent requests within the same animation frame.
|
|
32
|
+
key: this,
|
|
33
|
+
read: (view) => {
|
|
34
|
+
const containerHeight = view.dom.clientHeight;
|
|
35
|
+
if (containerHeight === 0) {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
// Find the block (line) at the very bottom of the visible area.
|
|
39
|
+
const block = view.lineBlockAtHeight(containerHeight - 1);
|
|
40
|
+
// If the block overflows the container, clip at the block's top edge.
|
|
41
|
+
return block.top + block.height > containerHeight ? block.top : containerHeight;
|
|
42
|
+
},
|
|
43
|
+
write: (clipHeight, view) => {
|
|
44
|
+
if (clipHeight > 0 && clipHeight !== this.clipHeight) {
|
|
45
|
+
this.clipHeight = clipHeight;
|
|
46
|
+
view.dom.style.maxHeight = `${clipHeight}px`;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return [
|
|
55
|
+
clipPlugin,
|
|
56
|
+
EditorView.theme({
|
|
57
|
+
'&': {
|
|
58
|
+
maxHeight: `${internalHeight}px`,
|
|
59
|
+
overflow: 'hidden',
|
|
60
|
+
...(scale !== 1 && { zoom: `${scale}` }),
|
|
61
|
+
},
|
|
62
|
+
'.cm-content': {
|
|
63
|
+
whiteSpace: 'pre',
|
|
64
|
+
margin: '0',
|
|
65
|
+
padding: '0',
|
|
66
|
+
},
|
|
67
|
+
'.cm-line': {
|
|
68
|
+
padding: '0',
|
|
69
|
+
},
|
|
70
|
+
'.cm-scroller': {
|
|
71
|
+
overflow: 'hidden !important',
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
];
|
|
75
|
+
};
|
|
@@ -6,30 +6,42 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { Surface, useOperationInvoker } from '@dxos/app-framework/react';
|
|
9
|
+
import { Capability, Plugin } from '@dxos/app-framework';
|
|
11
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
12
|
+
import { AppActivationEvents, LayoutOperation } from '@dxos/app-toolkit';
|
|
12
13
|
import { Obj, Query } from '@dxos/echo';
|
|
13
14
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
15
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
14
16
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
15
17
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
16
18
|
import { faker } from '@dxos/random';
|
|
17
19
|
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
18
20
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
|
-
import { withLayout
|
|
21
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
20
22
|
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
21
23
|
import { Text } from '@dxos/schema';
|
|
22
24
|
import { type ValueGenerator, createObjectFactory } from '@dxos/schema/testing';
|
|
23
25
|
import { Organization, Person } from '@dxos/types';
|
|
24
26
|
|
|
25
|
-
import { MarkdownPlugin } from '
|
|
26
|
-
import { translations } from '
|
|
27
|
-
import { Markdown } from '
|
|
27
|
+
import { MarkdownPlugin } from '../../MarkdownPlugin';
|
|
28
|
+
import { translations } from '../../translations';
|
|
29
|
+
import { Markdown, MarkdownCapabilities, MarkdownEvents } from '#types';
|
|
28
30
|
|
|
29
31
|
faker.seed(1);
|
|
30
32
|
|
|
31
33
|
const generator: ValueGenerator = faker as any;
|
|
32
34
|
|
|
35
|
+
/** Minimal plugin that contributes an empty Extensions capability for stories. */
|
|
36
|
+
const MarkdownExtensionsPlugin = Plugin.define({ id: 'story-markdown-extensions', name: 'Story Extensions' }).pipe(
|
|
37
|
+
Plugin.addModule({
|
|
38
|
+
id: 'extensions',
|
|
39
|
+
activatesOn: MarkdownEvents.SetupExtensions,
|
|
40
|
+
activate: () => Effect.succeed(Capability.contributes(MarkdownCapabilities.Extensions, [])),
|
|
41
|
+
}),
|
|
42
|
+
Plugin.make,
|
|
43
|
+
);
|
|
44
|
+
|
|
33
45
|
const DefaultStory = () => {
|
|
34
46
|
const { invokePromise } = useOperationInvoker();
|
|
35
47
|
const space = useSpace();
|
|
@@ -40,45 +52,43 @@ const DefaultStory = () => {
|
|
|
40
52
|
|
|
41
53
|
useAsyncEffect(async () => {
|
|
42
54
|
if (space) {
|
|
43
|
-
await invokePromise(
|
|
55
|
+
await invokePromise(LayoutOperation.SwitchWorkspace, { subject: space.id });
|
|
44
56
|
}
|
|
45
57
|
}, [space, invokePromise]);
|
|
46
58
|
|
|
47
59
|
return (
|
|
48
60
|
<div className='contents' {...attentionAttrs}>
|
|
49
|
-
<Surface role='article' data={data} limit={1} />
|
|
61
|
+
<Surface.Surface role='article' data={data} limit={1} />
|
|
50
62
|
</div>
|
|
51
63
|
);
|
|
52
64
|
};
|
|
53
65
|
|
|
54
66
|
const meta = {
|
|
55
|
-
title: 'plugins/plugin-markdown/MarkdownContainer',
|
|
67
|
+
title: 'plugins/plugin-markdown/containers/MarkdownContainer',
|
|
56
68
|
render: DefaultStory,
|
|
57
69
|
decorators: [
|
|
58
|
-
withTheme,
|
|
59
70
|
withLayout({ layout: 'column' }),
|
|
60
71
|
withPluginManager<{ title?: string; content?: string }>((context) => ({
|
|
72
|
+
setupEvents: [AppActivationEvents.SetupSettings, MarkdownEvents.SetupExtensions],
|
|
61
73
|
plugins: [
|
|
62
74
|
...corePlugins(),
|
|
63
75
|
StorybookPlugin({}),
|
|
76
|
+
MarkdownExtensionsPlugin(),
|
|
64
77
|
ClientPlugin({
|
|
65
78
|
types: [Markdown.Document, Text.Text, Person.Person, Organization.Organization],
|
|
66
79
|
onClientInitialized: ({ client }) =>
|
|
67
80
|
Effect.gen(function* () {
|
|
68
|
-
yield*
|
|
69
|
-
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
70
|
-
yield* Effect.promise(() => client.spaces.default.waitUntilReady());
|
|
81
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
71
82
|
|
|
72
|
-
const
|
|
73
|
-
const createObjects = createObjectFactory(space.db, generator);
|
|
83
|
+
const createObjects = createObjectFactory(personalSpace.db, generator);
|
|
74
84
|
yield* Effect.promise(() => createObjects([{ type: Organization.Organization, count: 10 }]));
|
|
75
85
|
|
|
76
|
-
const queue =
|
|
86
|
+
const queue = personalSpace.queues.create();
|
|
77
87
|
const kai = Obj.make(Person.Person, { fullName: 'Kai' });
|
|
78
88
|
const dxos = Obj.make(Organization.Organization, { name: 'DXOS' });
|
|
79
89
|
yield* Effect.promise(() => queue.append([kai, dxos]));
|
|
80
90
|
|
|
81
|
-
|
|
91
|
+
personalSpace.db.add(
|
|
82
92
|
Markdown.make({
|
|
83
93
|
name: context.args.title ?? 'Testing',
|
|
84
94
|
content: [
|
|
@@ -95,7 +105,7 @@ const meta = {
|
|
|
95
105
|
}),
|
|
96
106
|
);
|
|
97
107
|
|
|
98
|
-
yield* Effect.promise(() =>
|
|
108
|
+
yield* Effect.promise(() => personalSpace.db.flush({ indexes: true }));
|
|
99
109
|
}),
|
|
100
110
|
}),
|
|
101
111
|
|
|
@@ -4,43 +4,45 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension } from '@codemirror/state';
|
|
6
6
|
import { Atom } from '@effect-atom/atom-react';
|
|
7
|
-
import React, { forwardRef, useMemo } from 'react';
|
|
7
|
+
import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
11
|
+
import { type ObjectSurfaceProps } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
11
13
|
import { Obj } from '@dxos/echo';
|
|
12
14
|
import { useActionRunner } from '@dxos/plugin-graph';
|
|
13
15
|
import { useObject } from '@dxos/react-client/echo';
|
|
16
|
+
import { Panel } from '@dxos/react-ui';
|
|
14
17
|
import { type SelectionManager } from '@dxos/react-ui-attention';
|
|
15
|
-
import { Layout } from '@dxos/react-ui-mosaic';
|
|
16
18
|
import { Text } from '@dxos/schema';
|
|
17
19
|
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
+
import { MarkdownEditor, type MarkdownEditorContentProps, type MarkdownEditorRootProps } from '#components';
|
|
21
|
+
import { useLinkQuery } from '#hooks';
|
|
22
|
+
import { Markdown, MarkdownCapabilities, type MarkdownPluginState } from '#types';
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export type MarkdownContainerProps = SurfaceComponentProps<
|
|
24
|
+
export type MarkdownContainerProps = ObjectSurfaceProps<
|
|
24
25
|
Markdown.Document | Text.Text,
|
|
25
26
|
{
|
|
26
27
|
id: string;
|
|
27
28
|
settings: Markdown.Settings;
|
|
28
29
|
selectionManager?: SelectionManager;
|
|
29
|
-
} & Pick<
|
|
30
|
-
Pick<
|
|
31
|
-
Pick<
|
|
30
|
+
} & Pick<MarkdownPluginState, 'extensionProviders'> &
|
|
31
|
+
Pick<MarkdownEditorRootProps, 'viewMode' | 'onSelectObject' | 'onViewModeChange'> &
|
|
32
|
+
Pick<MarkdownEditorContentProps, 'editorStateStore'>
|
|
32
33
|
>;
|
|
33
34
|
|
|
34
35
|
export const MarkdownContainer = forwardRef<HTMLDivElement, MarkdownContainerProps>(
|
|
35
|
-
(
|
|
36
|
+
(
|
|
37
|
+
{ role, subject: object, id, attendableId, settings, extensionProviders, onSelectObject, ...props },
|
|
38
|
+
forwardedRef,
|
|
39
|
+
) => {
|
|
36
40
|
const db = Obj.isObject(object) ? Obj.getDatabase(object) : undefined;
|
|
37
|
-
const attendableId = Obj.instanceOf(Markdown.Document, object) ? Obj.getDXN(object).toString() : undefined;
|
|
38
41
|
const [docContent] = useObject(Obj.instanceOf(Markdown.Document, object) ? object.content : undefined, 'content');
|
|
39
42
|
const [textContent] = useObject(Obj.instanceOf(Text.Text, object) ? object : undefined, 'content');
|
|
40
43
|
const initialValue = docContent ?? textContent;
|
|
41
44
|
|
|
42
45
|
// Extensions from other plugins.
|
|
43
|
-
// TODO(burdon): Document MarkdownPluginState.extensionProviders
|
|
44
46
|
const otherExtensionProviders = useCapabilities(MarkdownCapabilities.Extensions);
|
|
45
47
|
const extensions = useMemo<Extension[]>(() => {
|
|
46
48
|
if (!Obj.instanceOf(Markdown.Document, object) && !Obj.instanceOf(Text.Text, object)) {
|
|
@@ -65,15 +67,15 @@ export const MarkdownContainer = forwardRef<HTMLDivElement, MarkdownContainerPro
|
|
|
65
67
|
const runAction = useActionRunner();
|
|
66
68
|
const customActions = useMemo(() => {
|
|
67
69
|
return Atom.make((get) => {
|
|
68
|
-
const actions = get(graph.actions(id));
|
|
70
|
+
const actions = get(graph.actions(attendableId ?? id));
|
|
69
71
|
const nodes = actions.filter((action) => action.properties.disposition === 'toolbar');
|
|
70
|
-
const edges = nodes.map((node) => ({ source: 'root', target: node.id }));
|
|
72
|
+
const edges = nodes.map((node) => ({ source: 'root', target: node.id, relation: 'child' }));
|
|
71
73
|
return { nodes, edges };
|
|
72
74
|
});
|
|
73
75
|
}, [graph]);
|
|
74
76
|
|
|
75
77
|
// File upload.
|
|
76
|
-
const [upload] = useCapabilities(
|
|
78
|
+
const [upload] = useCapabilities(AppCapabilities.FileUploader);
|
|
77
79
|
const handleFileUpload = useMemo(() => {
|
|
78
80
|
if (!db || !upload) {
|
|
79
81
|
return undefined;
|
|
@@ -85,27 +87,48 @@ export const MarkdownContainer = forwardRef<HTMLDivElement, MarkdownContainerPro
|
|
|
85
87
|
// Query for @ refs.
|
|
86
88
|
const handleLinkQuery = useLinkQuery(db);
|
|
87
89
|
|
|
90
|
+
// Open linked objects.
|
|
91
|
+
const { invokePromise } = useOperationInvoker();
|
|
92
|
+
const handleSelectObject = useCallback(
|
|
93
|
+
(targetId: string) => {
|
|
94
|
+
if (onSelectObject) {
|
|
95
|
+
onSelectObject(targetId);
|
|
96
|
+
} else {
|
|
97
|
+
void invokePromise?.(LayoutOperation.Open, {
|
|
98
|
+
subject: [targetId],
|
|
99
|
+
pivotId: attendableId,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
[onSelectObject, invokePromise, object, id],
|
|
104
|
+
);
|
|
105
|
+
|
|
88
106
|
return (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
<MarkdownEditor.Root
|
|
108
|
+
id={id}
|
|
109
|
+
attendableId={attendableId}
|
|
110
|
+
object={object}
|
|
111
|
+
compact={role !== 'article'}
|
|
112
|
+
extensions={extensions}
|
|
113
|
+
settings={settings}
|
|
114
|
+
onAction={runAction}
|
|
115
|
+
onFileUpload={handleFileUpload}
|
|
116
|
+
onLinkQuery={handleLinkQuery}
|
|
117
|
+
onSelectObject={handleSelectObject}
|
|
118
|
+
{...props}
|
|
119
|
+
>
|
|
120
|
+
<Panel.Root role={role} ref={forwardedRef}>
|
|
100
121
|
{settings.toolbar && (
|
|
101
|
-
<
|
|
122
|
+
<Panel.Toolbar classNames='bg-toolbar-surface'>
|
|
123
|
+
<MarkdownEditor.Toolbar classNames='dx-document' customActions={customActions} />
|
|
124
|
+
</Panel.Toolbar>
|
|
102
125
|
)}
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
126
|
+
<Panel.Content>
|
|
127
|
+
<MarkdownEditor.Content initialValue={initialValue} />
|
|
128
|
+
<MarkdownEditor.Blocks />
|
|
129
|
+
</Panel.Content>
|
|
130
|
+
</Panel.Root>
|
|
131
|
+
</MarkdownEditor.Root>
|
|
107
132
|
);
|
|
108
133
|
},
|
|
109
134
|
);
|
|
110
|
-
|
|
111
|
-
export default MarkdownContainer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export type { MarkdownContainerProps } from './MarkdownContainer';
|
|
8
|
+
|
|
9
|
+
export const MarkdownCard: ComponentType<any> = lazy(() => import('./MarkdownCard'));
|
|
10
|
+
export const MarkdownContainer: ComponentType<any> = lazy(() => import('./MarkdownContainer'));
|
package/src/hooks/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '@dxos/react-ui-editor';
|
|
16
16
|
import { Domino } from '@dxos/ui';
|
|
17
17
|
|
|
18
|
-
import { meta } from '
|
|
18
|
+
import { meta } from '#meta';
|
|
19
19
|
|
|
20
20
|
export type UseEditorMenuOptionsProps = {
|
|
21
21
|
editorView?: EditorView;
|
|
@@ -56,7 +56,7 @@ export const useEditorMenuOptions = ({
|
|
|
56
56
|
content: () => {
|
|
57
57
|
const pressEl = Domino.of('span').text('Press');
|
|
58
58
|
const triggerEls = trigger.map((text) =>
|
|
59
|
-
Domino.of('span').classNames('mx-1
|
|
59
|
+
Domino.of('span').classNames('mx-1 px-1.5 pt-[1px] pb-[2px] border border-separator rounded-xs').text(text),
|
|
60
60
|
);
|
|
61
61
|
const forCommandsEl = Domino.of('span').text('for commands.');
|
|
62
62
|
return Domino.of('div').children(pressEl, ...triggerEls, forCommandsEl).root;
|