@dxos/plugin-markdown 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/MarkdownCard-5NPSEJ2M.mjs +61 -0
- package/dist/lib/browser/MarkdownCard-5NPSEJ2M.mjs.map +7 -0
- package/dist/lib/browser/MarkdownContainer-KER2N5M2.mjs +108 -0
- package/dist/lib/browser/MarkdownContainer-KER2N5M2.mjs.map +7 -0
- package/dist/lib/browser/MarkdownSettings-2N4TT2FG.mjs +106 -0
- package/dist/lib/browser/MarkdownSettings-2N4TT2FG.mjs.map +7 -0
- package/dist/lib/browser/anchor-sort-EHJGOCYW.mjs +34 -0
- package/dist/lib/browser/anchor-sort-EHJGOCYW.mjs.map +7 -0
- package/dist/lib/browser/app-graph-serializer-QBZDVASK.mjs +60 -0
- package/dist/lib/browser/app-graph-serializer-QBZDVASK.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-ASGDSKKE.mjs +18 -0
- package/dist/lib/browser/blueprint-definition-ASGDSKKE.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +9 -0
- package/dist/lib/browser/chunk-7JEOX3X6.mjs +783 -0
- package/dist/lib/browser/chunk-7JEOX3X6.mjs.map +7 -0
- package/dist/lib/browser/chunk-HK6EGNP5.mjs +8 -0
- package/dist/lib/browser/chunk-HK6EGNP5.mjs.map +7 -0
- package/dist/lib/browser/chunk-P3TN2W6M.mjs +154 -0
- package/dist/lib/browser/chunk-P3TN2W6M.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NGXGBWSS.mjs → chunk-RJO5W5YX.mjs} +12 -6
- package/dist/lib/browser/chunk-RJO5W5YX.mjs.map +7 -0
- package/dist/lib/browser/chunk-W24NJ6WB.mjs +178 -0
- package/dist/lib/browser/chunk-W24NJ6WB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ODB2PTBP.mjs → chunk-YBMRREXE.mjs} +4 -4
- package/dist/lib/browser/chunk-YBMRREXE.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +35 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +127 -143
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-3KOXJM7P.mjs +54 -0
- package/dist/lib/browser/operation-resolver-3KOXJM7P.mjs.map +7 -0
- package/dist/lib/browser/react-surface-WU4VTE43.mjs +115 -0
- package/dist/lib/browser/react-surface-WU4VTE43.mjs.map +7 -0
- package/dist/lib/browser/settings-7FMWKB7N.mjs +38 -0
- package/dist/lib/browser/settings-7FMWKB7N.mjs.map +7 -0
- package/dist/lib/browser/state-7UJKJDGE.mjs +31 -0
- package/dist/lib/browser/state-7UJKJDGE.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +11 -3
- package/dist/lib/node-esm/MarkdownCard-4MXS7AQR.mjs +62 -0
- package/dist/lib/node-esm/MarkdownCard-4MXS7AQR.mjs.map +7 -0
- package/dist/lib/node-esm/MarkdownContainer-BZ637MS3.mjs +109 -0
- package/dist/lib/node-esm/MarkdownContainer-BZ637MS3.mjs.map +7 -0
- package/dist/lib/node-esm/MarkdownSettings-FQTYCTD7.mjs +107 -0
- package/dist/lib/node-esm/MarkdownSettings-FQTYCTD7.mjs.map +7 -0
- package/dist/lib/node-esm/anchor-sort-QWZO6B2R.mjs +35 -0
- package/dist/lib/node-esm/anchor-sort-QWZO6B2R.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-serializer-3UVXEHJG.mjs +61 -0
- package/dist/lib/node-esm/app-graph-serializer-3UVXEHJG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-TG7OZIWW.mjs +19 -0
- package/dist/lib/node-esm/blueprint-definition-TG7OZIWW.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +10 -0
- package/dist/lib/node-esm/{chunk-YGSNWTGP.mjs → chunk-ANIFP6M2.mjs} +12 -6
- package/dist/lib/node-esm/chunk-ANIFP6M2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KCH3EL53.mjs +10 -0
- package/dist/lib/node-esm/chunk-KCH3EL53.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-N73JZ4CD.mjs +784 -0
- package/dist/lib/node-esm/chunk-N73JZ4CD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NBGAJPVH.mjs +179 -0
- package/dist/lib/node-esm/chunk-NBGAJPVH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-VCG2U522.mjs → chunk-W7AM4HCG.mjs} +4 -4
- package/dist/lib/node-esm/chunk-W7AM4HCG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WBZQ246U.mjs +155 -0
- package/dist/lib/node-esm/chunk-WBZQ246U.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +36 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +127 -143
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-2MEWKRFP.mjs +55 -0
- package/dist/lib/node-esm/operation-resolver-2MEWKRFP.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-LC5CI6VP.mjs +116 -0
- package/dist/lib/node-esm/react-surface-LC5CI6VP.mjs.map +7 -0
- package/dist/lib/node-esm/settings-DBK2SPWT.mjs +39 -0
- package/dist/lib/node-esm/settings-DBK2SPWT.mjs.map +7 -0
- package/dist/lib/node-esm/state-EEPLRAOT.mjs +32 -0
- package/dist/lib/node-esm/state-EEPLRAOT.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +11 -3
- package/dist/types/src/MarkdownPlugin.d.ts +2 -1
- package/dist/types/src/MarkdownPlugin.d.ts.map +1 -1
- package/dist/types/src/{functions/open.d.ts → blueprints/functions/create.d.ts} +5 -4
- package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/create.test.d.ts +2 -0
- package/dist/types/src/blueprints/functions/create.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/index.d.ts +42 -0
- package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/open.d.ts +14 -0
- package/dist/types/src/blueprints/functions/open.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.d.ts +19 -0
- package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.test.d.ts +2 -0
- package/dist/types/src/blueprints/functions/update.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/markdown-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +6 -0
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +1 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts +3 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +5 -0
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +5 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -17
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +3 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +7 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +3 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +5 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts +11 -0
- package/dist/types/src/components/MarkdownEditor/FileUpload.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts +43 -23
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts +5 -110
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts +30 -0
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorContent.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts +12 -0
- package/dist/types/src/components/MarkdownEditor/MarkdownEditorToolbar.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.d.ts +8 -0
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownCard/MarkdownCard.stories.d.ts +9 -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/MarkdownContainer/MarkdownContainer.d.ts +27 -0
- package/dist/types/src/containers/MarkdownContainer/MarkdownContainer.d.ts.map +1 -0
- package/dist/types/src/{components → containers/MarkdownContainer}/MarkdownContainer.stories.d.ts +34 -1
- 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/MarkdownSettings/MarkdownSettings.d.ts +8 -0
- package/dist/types/src/containers/MarkdownSettings/MarkdownSettings.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownSettings/index.d.ts +3 -0
- package/dist/types/src/containers/MarkdownSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useEditorMenuOptions.d.ts +9 -0
- package/dist/types/src/hooks/useEditorMenuOptions.d.ts.map +1 -0
- package/dist/types/src/hooks/useExtensions.d.ts +21 -0
- package/dist/types/src/hooks/useExtensions.d.ts.map +1 -0
- package/dist/types/src/hooks/useLinkQuery.d.ts +4 -0
- package/dist/types/src/hooks/useLinkQuery.d.ts.map +1 -0
- package/dist/types/src/hooks/useSelectCurrentThread.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +6 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +33 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Markdown.d.ts +16 -14
- package/dist/types/src/types/Markdown.d.ts.map +1 -1
- package/dist/types/src/types/MarkdownAction.d.ts +63 -30
- package/dist/types/src/types/MarkdownAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +22 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/src/util.test.d.ts +2 -0
- package/dist/types/src/util.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -57
- package/src/MarkdownPlugin.tsx +65 -94
- package/src/blueprints/functions/create.conversations.json +1 -0
- package/src/blueprints/functions/create.test.ts +92 -0
- package/src/blueprints/functions/create.ts +35 -0
- package/src/blueprints/functions/index.ts +15 -0
- package/src/{functions → blueprints/functions}/open.ts +11 -10
- package/src/blueprints/functions/update.conversations.json +1 -0
- package/src/blueprints/functions/update.test.ts +215 -0
- package/src/blueprints/functions/update.ts +79 -0
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/markdown-blueprint.ts +46 -0
- package/src/capabilities/anchor-sort/anchor-sort.ts +37 -0
- package/src/capabilities/anchor-sort/index.ts +7 -0
- package/src/capabilities/app-graph-serializer/app-graph-serializer.ts +60 -0
- package/src/capabilities/app-graph-serializer/index.ts +7 -0
- package/src/capabilities/artifact-definition/artifact-definition.ts +110 -0
- package/src/capabilities/artifact-definition/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +6 -12
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +45 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +102 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +37 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +31 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +30 -0
- package/src/components/MarkdownEditor/FileUpload.tsx +63 -0
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +59 -39
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +235 -271
- package/src/components/MarkdownEditor/MarkdownEditorContent.tsx +161 -0
- package/src/components/MarkdownEditor/MarkdownEditorToolbar.tsx +67 -0
- package/src/components/index.ts +2 -7
- package/src/containers/MarkdownCard/MarkdownCard.stories.tsx +68 -0
- package/src/containers/MarkdownCard/MarkdownCard.tsx +61 -0
- package/src/{components → containers}/MarkdownCard/index.ts +0 -2
- package/src/containers/MarkdownContainer/MarkdownContainer.stories.tsx +136 -0
- package/src/containers/MarkdownContainer/MarkdownContainer.tsx +114 -0
- package/src/containers/MarkdownContainer/index.ts +7 -0
- package/src/containers/MarkdownSettings/MarkdownSettings.tsx +122 -0
- package/src/containers/MarkdownSettings/index.ts +7 -0
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useEditorMenuOptions.ts +68 -0
- package/src/hooks/useExtensions.tsx +245 -0
- package/src/hooks/useLinkQuery.ts +83 -0
- package/src/hooks/useSelectCurrentThread.tsx +37 -32
- package/src/index.ts +3 -2
- package/src/meta.ts +5 -5
- package/src/testing.ts +27 -0
- package/src/translations.ts +6 -0
- package/src/types/Markdown.ts +20 -11
- package/src/types/MarkdownAction.ts +48 -18
- package/src/types/capabilities.ts +38 -0
- package/src/types/events.ts +14 -0
- package/src/types/index.ts +4 -0
- package/src/types/types.ts +3 -2
- package/src/util.test.ts +44 -0
- package/src/util.tsx +82 -7
- package/dist/lib/browser/MarkdownCard-ZHTH6EVA.mjs +0 -80
- package/dist/lib/browser/MarkdownCard-ZHTH6EVA.mjs.map +0 -7
- package/dist/lib/browser/MarkdownContainer-XDYFBDCI.mjs +0 -750
- package/dist/lib/browser/MarkdownContainer-XDYFBDCI.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-53E7TJGF.mjs +0 -32
- package/dist/lib/browser/anchor-sort-53E7TJGF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-IEPNJZBR.mjs +0 -51
- package/dist/lib/browser/app-graph-serializer-IEPNJZBR.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-XDLVVSUN.mjs +0 -11
- package/dist/lib/browser/chunk-EVQGTH3P.mjs +0 -22
- package/dist/lib/browser/chunk-EVQGTH3P.mjs.map +0 -7
- package/dist/lib/browser/chunk-NGXGBWSS.mjs.map +0 -7
- package/dist/lib/browser/chunk-ODB2PTBP.mjs.map +0 -7
- package/dist/lib/browser/chunk-OY6CGPOO.mjs +0 -16
- package/dist/lib/browser/chunk-OY6CGPOO.mjs.map +0 -7
- package/dist/lib/browser/chunk-PMBWHKDI.mjs +0 -78
- package/dist/lib/browser/chunk-PMBWHKDI.mjs.map +0 -7
- package/dist/lib/browser/chunk-VZU7BRGW.mjs +0 -106
- package/dist/lib/browser/chunk-VZU7BRGW.mjs.map +0 -7
- package/dist/lib/browser/chunk-XYQDM6PM.mjs +0 -50
- package/dist/lib/browser/chunk-XYQDM6PM.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-66ZUQ6JC.mjs +0 -62
- package/dist/lib/browser/intent-resolver-66ZUQ6JC.mjs.map +0 -7
- package/dist/lib/browser/react-surface-ONX5RNFM.mjs +0 -215
- package/dist/lib/browser/react-surface-ONX5RNFM.mjs.map +0 -7
- package/dist/lib/browser/settings-HXM36BCZ.mjs +0 -28
- package/dist/lib/browser/settings-HXM36BCZ.mjs.map +0 -7
- package/dist/lib/browser/state-6QODXCSZ.mjs +0 -37
- package/dist/lib/browser/state-6QODXCSZ.mjs.map +0 -7
- package/dist/lib/browser/toolkit-73U3A7SD.mjs +0 -76
- package/dist/lib/browser/toolkit-73U3A7SD.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownCard-MEA4QAAI.mjs +0 -81
- package/dist/lib/node-esm/MarkdownCard-MEA4QAAI.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownContainer-7GYMOJVT.mjs +0 -751
- package/dist/lib/node-esm/MarkdownContainer-7GYMOJVT.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-V2FWEYDN.mjs +0 -33
- package/dist/lib/node-esm/anchor-sort-V2FWEYDN.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-HIN4NMUG.mjs +0 -52
- package/dist/lib/node-esm/app-graph-serializer-HIN4NMUG.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-PDXZ67UQ.mjs +0 -12
- package/dist/lib/node-esm/chunk-35WAARP4.mjs +0 -79
- package/dist/lib/node-esm/chunk-35WAARP4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CB2R4YIY.mjs +0 -17
- package/dist/lib/node-esm/chunk-CB2R4YIY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IOC54NCF.mjs +0 -51
- package/dist/lib/node-esm/chunk-IOC54NCF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VCG2U522.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VELFUWUH.mjs +0 -107
- package/dist/lib/node-esm/chunk-VELFUWUH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W4XXBX33.mjs +0 -24
- package/dist/lib/node-esm/chunk-W4XXBX33.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YGSNWTGP.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-TNRIFHNH.mjs +0 -63
- package/dist/lib/node-esm/intent-resolver-TNRIFHNH.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-X2GV6WQH.mjs +0 -216
- package/dist/lib/node-esm/react-surface-X2GV6WQH.mjs.map +0 -7
- package/dist/lib/node-esm/settings-KPLQ5ONI.mjs +0 -29
- package/dist/lib/node-esm/settings-KPLQ5ONI.mjs.map +0 -7
- package/dist/lib/node-esm/state-W3PECOJX.mjs +0 -38
- package/dist/lib/node-esm/state-W3PECOJX.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-GUBDYF72.mjs +0 -77
- package/dist/lib/node-esm/toolkit-GUBDYF72.mjs.map +0 -7
- package/dist/types/src/capabilities/anchor-sort.d.ts +0 -6
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -12
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -11
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts +0 -7
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownCard/MarkdownCard.stories.d.ts +0 -9
- 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 +0 -18
- package/dist/types/src/components/MarkdownContainer.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts +0 -6
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownSettings/index.d.ts +0 -2
- package/dist/types/src/components/MarkdownSettings/index.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/components/Toolbar.stories.d.ts +0 -48
- package/dist/types/src/components/Toolbar.stories.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/extensions.d.ts +0 -22
- package/dist/types/src/extensions.d.ts.map +0 -1
- package/dist/types/src/functions/diff.d.ts +0 -6
- package/dist/types/src/functions/diff.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -3
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/open.d.ts.map +0 -1
- package/src/capabilities/anchor-sort.ts +0 -30
- package/src/capabilities/app-graph-serializer.ts +0 -54
- package/src/capabilities/artifact-definition.ts +0 -112
- package/src/capabilities/blueprint-definition.ts +0 -39
- package/src/capabilities/capabilities.ts +0 -21
- package/src/capabilities/intent-resolver.ts +0 -58
- package/src/capabilities/react-surface.tsx +0 -115
- package/src/capabilities/settings.ts +0 -25
- package/src/capabilities/state.ts +0 -31
- package/src/capabilities/toolkit.ts +0 -49
- package/src/components/MarkdownCard/MarkdownCard.stories.tsx +0 -76
- package/src/components/MarkdownCard/MarkdownCard.tsx +0 -75
- package/src/components/MarkdownContainer.stories.tsx +0 -109
- package/src/components/MarkdownContainer.tsx +0 -257
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +0 -108
- package/src/components/MarkdownSettings/index.ts +0 -5
- package/src/components/Suggestions.stories.tsx +0 -221
- package/src/components/Toolbar.stories.tsx +0 -118
- package/src/events.ts +0 -11
- package/src/extensions.tsx +0 -300
- package/src/functions/diff.ts +0 -37
- package/src/functions/index.ts +0 -6
- /package/dist/lib/browser/{blueprint-definition-XDLVVSUN.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-PDXZ67UQ.mjs.map → blueprints/index.mjs.map} +0 -0
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
10
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
11
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
12
|
-
import { DataType } from '@dxos/schema';
|
|
13
|
-
|
|
14
|
-
import { MarkdownCard, MarkdownContainer, MarkdownSettings } from '../components';
|
|
15
|
-
import { meta } from '../meta';
|
|
16
|
-
import { Markdown } from '../types';
|
|
17
|
-
import { isEditorModel } from '../util';
|
|
18
|
-
|
|
19
|
-
import { MarkdownCapabilities } from './capabilities';
|
|
20
|
-
|
|
21
|
-
export default () =>
|
|
22
|
-
contributes(Capabilities.ReactSurface, [
|
|
23
|
-
createSurface({
|
|
24
|
-
id: `${meta.id}/surface/document`,
|
|
25
|
-
role: ['article', 'section', 'tabpanel'],
|
|
26
|
-
filter: (data): data is { subject: Markdown.Document; variant: undefined } =>
|
|
27
|
-
Obj.instanceOf(Markdown.Document, data.subject) && !data.variant,
|
|
28
|
-
component: ({ data, role }) => {
|
|
29
|
-
const selectionManager = useCapability(AttentionCapabilities.Selection);
|
|
30
|
-
const settingsStore = useCapability(Capabilities.SettingsStore);
|
|
31
|
-
const settings = settingsStore.getStore<Markdown.Settings>(meta.id)!.value;
|
|
32
|
-
const { state, editorState, getViewMode, setViewMode } = useCapability(MarkdownCapabilities.State);
|
|
33
|
-
const viewMode = getViewMode(fullyQualifiedId(data.subject));
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<MarkdownContainer
|
|
37
|
-
id={fullyQualifiedId(data.subject)}
|
|
38
|
-
object={data.subject}
|
|
39
|
-
role={role}
|
|
40
|
-
settings={settings}
|
|
41
|
-
selectionManager={selectionManager}
|
|
42
|
-
extensionProviders={state.extensionProviders}
|
|
43
|
-
viewMode={viewMode}
|
|
44
|
-
editorStateStore={editorState}
|
|
45
|
-
onViewModeChange={setViewMode}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
createSurface({
|
|
51
|
-
id: `${meta.id}/surface/text`,
|
|
52
|
-
role: ['article', 'section', 'tabpanel'],
|
|
53
|
-
filter: (data): data is { id: string; subject: DataType.Text } =>
|
|
54
|
-
typeof data.id === 'string' && Obj.instanceOf(DataType.Text, data.subject),
|
|
55
|
-
component: ({ data, role }) => {
|
|
56
|
-
const selectionManager = useCapability(AttentionCapabilities.Selection);
|
|
57
|
-
const settingsStore = useCapability(Capabilities.SettingsStore);
|
|
58
|
-
const settings = settingsStore.getStore<Markdown.Settings>(meta.id)!.value;
|
|
59
|
-
const { state, editorState, getViewMode, setViewMode } = useCapability(MarkdownCapabilities.State);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<MarkdownContainer
|
|
63
|
-
id={data.id}
|
|
64
|
-
object={data.subject}
|
|
65
|
-
role={role}
|
|
66
|
-
settings={settings}
|
|
67
|
-
selectionManager={selectionManager}
|
|
68
|
-
extensionProviders={state.extensionProviders}
|
|
69
|
-
viewMode={getViewMode(data.id)}
|
|
70
|
-
editorStateStore={editorState}
|
|
71
|
-
onViewModeChange={setViewMode}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
76
|
-
createSurface({
|
|
77
|
-
id: `${meta.id}/surface/editor`,
|
|
78
|
-
role: ['article', 'section'],
|
|
79
|
-
filter: (data): data is { subject: { id: string; text: string } } => isEditorModel(data.subject),
|
|
80
|
-
component: ({ data, role }) => {
|
|
81
|
-
const selectionManager = useCapability(AttentionCapabilities.Selection);
|
|
82
|
-
const settingsStore = useCapability(Capabilities.SettingsStore);
|
|
83
|
-
const settings = settingsStore.getStore<Markdown.Settings>(meta.id)!.value;
|
|
84
|
-
const { state, editorState, getViewMode, setViewMode } = useCapability(MarkdownCapabilities.State);
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<MarkdownContainer
|
|
88
|
-
id={data.subject.id}
|
|
89
|
-
object={data.subject}
|
|
90
|
-
role={role}
|
|
91
|
-
settings={settings}
|
|
92
|
-
selectionManager={selectionManager}
|
|
93
|
-
extensionProviders={state.extensionProviders}
|
|
94
|
-
viewMode={getViewMode(data.subject.id)}
|
|
95
|
-
editorStateStore={editorState}
|
|
96
|
-
onViewModeChange={setViewMode}
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
createSurface({
|
|
102
|
-
id: `${meta.id}/surface/plugin-settings`,
|
|
103
|
-
role: 'article',
|
|
104
|
-
filter: (data): data is { subject: SettingsStore<Markdown.Settings> } =>
|
|
105
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
106
|
-
component: ({ data: { subject } }) => <MarkdownSettings settings={subject.value} />,
|
|
107
|
-
}),
|
|
108
|
-
createSurface({
|
|
109
|
-
id: `${meta.id}/surface/preview`,
|
|
110
|
-
role: ['card--popover', 'card--intrinsic', 'card--extrinsic', 'card--transclusion', 'card'],
|
|
111
|
-
filter: (data): data is { subject: Markdown.Document | DataType.Text } =>
|
|
112
|
-
Obj.instanceOf(Markdown.Document, data.subject) || Obj.instanceOf(DataType.Text, data.subject),
|
|
113
|
-
component: ({ data, role }) => <MarkdownCard {...data} role={role} />,
|
|
114
|
-
}),
|
|
115
|
-
]);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { Markdown } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
const settings = live<Markdown.Settings>({
|
|
13
|
-
defaultViewMode: 'preview',
|
|
14
|
-
toolbar: true,
|
|
15
|
-
numberedHeadings: true,
|
|
16
|
-
folding: true,
|
|
17
|
-
experimental: false,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return contributes(Capabilities.Settings, {
|
|
21
|
-
prefix: meta.id,
|
|
22
|
-
schema: Markdown.Settings,
|
|
23
|
-
value: settings,
|
|
24
|
-
});
|
|
25
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
|
-
import { type EditorViewMode, createEditorStateStore } from '@dxos/react-ui-editor';
|
|
8
|
-
|
|
9
|
-
import { meta } from '../meta';
|
|
10
|
-
import { type Markdown, type MarkdownPluginState } from '../types';
|
|
11
|
-
|
|
12
|
-
import { MarkdownCapabilities } from './capabilities';
|
|
13
|
-
|
|
14
|
-
export default (context: PluginContext) => {
|
|
15
|
-
const state = new LocalStorageStore<MarkdownPluginState>(meta.id, { extensionProviders: [], viewMode: {} });
|
|
16
|
-
state.prop({ key: 'viewMode', type: LocalStorageStore.json<{ [key: string]: EditorViewMode }>() });
|
|
17
|
-
|
|
18
|
-
// TODO(wittjosiah): Fold into state.
|
|
19
|
-
const editorState = createEditorStateStore(`${meta.id}/editor`);
|
|
20
|
-
|
|
21
|
-
const getViewMode = (id: string) => {
|
|
22
|
-
const defaultViewMode = context.getCapability(Capabilities.SettingsStore).getStore<Markdown.Settings>(meta.id)!
|
|
23
|
-
.value.defaultViewMode;
|
|
24
|
-
return (id && state.values.viewMode[id]) || defaultViewMode;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const setViewMode = (id: string, viewMode: EditorViewMode) => (state.values.viewMode[id] = viewMode);
|
|
28
|
-
|
|
29
|
-
// Return object with methods.
|
|
30
|
-
return contributes(MarkdownCapabilities.State, { state: state.values, editorState, getViewMode, setViewMode });
|
|
31
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Tool from '@effect/ai/Tool';
|
|
6
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
7
|
-
import * as Effect from 'effect/Effect';
|
|
8
|
-
import * as Schema from 'effect/Schema';
|
|
9
|
-
|
|
10
|
-
import { Capabilities, type Capability, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
11
|
-
import { invariant } from '@dxos/invariant';
|
|
12
|
-
import { getActiveSpace } from '@dxos/plugin-space';
|
|
13
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
14
|
-
|
|
15
|
-
import { MarkdownAction } from '../types';
|
|
16
|
-
|
|
17
|
-
// TODO(burdon): Reconcile with functions (currently reuses plugin framework intents).
|
|
18
|
-
class MarkdownToolkit extends Toolkit.make(
|
|
19
|
-
Tool.make('create-document', {
|
|
20
|
-
description: 'Creates a new markdown document.',
|
|
21
|
-
parameters: {
|
|
22
|
-
name: Schema.optional(Schema.String),
|
|
23
|
-
content: Schema.optional(Schema.String),
|
|
24
|
-
},
|
|
25
|
-
// TODO(wittjosiah): Return document.
|
|
26
|
-
success: Schema.Any,
|
|
27
|
-
failure: Schema.Never,
|
|
28
|
-
}),
|
|
29
|
-
) {
|
|
30
|
-
static layer = (context: PluginContext) =>
|
|
31
|
-
MarkdownToolkit.toLayer({
|
|
32
|
-
'create-document': ({ name, content }) => {
|
|
33
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
34
|
-
const space = getActiveSpace(context);
|
|
35
|
-
invariant(space, 'No active space');
|
|
36
|
-
|
|
37
|
-
return Effect.gen(function* () {
|
|
38
|
-
const { object } = yield* dispatch(createIntent(MarkdownAction.Create, { name, content }));
|
|
39
|
-
yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space }));
|
|
40
|
-
return { id: object.id };
|
|
41
|
-
}).pipe(Effect.orDie);
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default (context: PluginContext): Capability<any>[] => [
|
|
47
|
-
contributes(Capabilities.Toolkit, MarkdownToolkit),
|
|
48
|
-
contributes(Capabilities.ToolkitHandler, MarkdownToolkit.layer(context)),
|
|
49
|
-
];
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
-
import { faker } from '@dxos/random';
|
|
12
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
|
-
import { CardContainer } from '@dxos/react-ui-stack/testing';
|
|
14
|
-
|
|
15
|
-
import { translations } from '../../translations';
|
|
16
|
-
|
|
17
|
-
import { MarkdownCard } from './MarkdownCard';
|
|
18
|
-
|
|
19
|
-
faker.seed(1234);
|
|
20
|
-
|
|
21
|
-
const meta: Meta<typeof MarkdownCard> = {
|
|
22
|
-
title: 'plugins/plugin-markdown/Card',
|
|
23
|
-
component: MarkdownCard,
|
|
24
|
-
render: ({ role, subject, ...args }) => {
|
|
25
|
-
return (
|
|
26
|
-
<CardContainer icon='ph--text-aa--regular' role={role}>
|
|
27
|
-
<MarkdownCard role={role} subject={subject} {...args} />
|
|
28
|
-
</CardContainer>
|
|
29
|
-
);
|
|
30
|
-
},
|
|
31
|
-
decorators: [
|
|
32
|
-
withTheme,
|
|
33
|
-
withPluginManager({
|
|
34
|
-
plugins: [IntentPlugin()],
|
|
35
|
-
}),
|
|
36
|
-
],
|
|
37
|
-
parameters: {
|
|
38
|
-
layout: 'centered',
|
|
39
|
-
translations,
|
|
40
|
-
},
|
|
41
|
-
tags: ['cards'],
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default meta;
|
|
45
|
-
|
|
46
|
-
type Story = StoryObj<typeof meta>;
|
|
47
|
-
|
|
48
|
-
export const Popover: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
role: 'card--popover',
|
|
51
|
-
subject: Markdown.makeDocument({
|
|
52
|
-
name: faker.lorem.words(3),
|
|
53
|
-
content: faker.lorem.paragraphs(3),
|
|
54
|
-
}),
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Intrinsic: Story = {
|
|
59
|
-
args: {
|
|
60
|
-
role: 'card--intrinsic',
|
|
61
|
-
subject: Markdown.makeDocument({
|
|
62
|
-
name: faker.lorem.words(3),
|
|
63
|
-
content: faker.lorem.paragraphs(3),
|
|
64
|
-
}),
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const Extrinsic: Story = {
|
|
69
|
-
args: {
|
|
70
|
-
role: 'card--extrinsic',
|
|
71
|
-
subject: Markdown.makeDocument({
|
|
72
|
-
name: faker.lorem.words(3),
|
|
73
|
-
content: faker.lorem.paragraphs(3),
|
|
74
|
-
}),
|
|
75
|
-
},
|
|
76
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Function from 'effect/Function';
|
|
6
|
-
import React, { useCallback } from 'react';
|
|
7
|
-
|
|
8
|
-
import { LayoutAction, chain, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
import { type PreviewProps } from '@dxos/plugin-preview';
|
|
11
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
12
|
-
import { Button, Icon, useTranslation } from '@dxos/react-ui';
|
|
13
|
-
import { Card } from '@dxos/react-ui-stack';
|
|
14
|
-
import { DataType } from '@dxos/schema';
|
|
15
|
-
|
|
16
|
-
import { meta } from '../../meta';
|
|
17
|
-
import { Markdown } from '../../types';
|
|
18
|
-
import { getAbstract, getFallbackName } from '../../util';
|
|
19
|
-
|
|
20
|
-
// TODO(burdon): Factor out.
|
|
21
|
-
const getTitle = (subject: Markdown.Document | DataType.Text, fallback: string) => {
|
|
22
|
-
if (Obj.instanceOf(Markdown.Document, subject)) {
|
|
23
|
-
return subject.name ?? subject.fallbackName ?? getFallbackName(subject.content?.target?.content ?? fallback);
|
|
24
|
-
} else if (Obj.instanceOf(DataType.Text, subject)) {
|
|
25
|
-
return getFallbackName(subject.content);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// TODO(burdon): Factor out.
|
|
30
|
-
const getSnippet = (subject: Markdown.Document | DataType.Text, fallback: string) => {
|
|
31
|
-
if (Obj.instanceOf(Markdown.Document, subject)) {
|
|
32
|
-
return getAbstract(subject.content?.target?.content ?? fallback);
|
|
33
|
-
} else if (Obj.instanceOf(DataType.Text, subject)) {
|
|
34
|
-
return getAbstract(subject.content);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type MarkdownCardProps = PreviewProps<Markdown.Document | DataType.Text>;
|
|
39
|
-
|
|
40
|
-
export const MarkdownCard = ({ subject, role }: MarkdownCardProps) => {
|
|
41
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
42
|
-
const { t } = useTranslation(meta.id);
|
|
43
|
-
const snippet = getSnippet(subject, t('fallback abstract'));
|
|
44
|
-
|
|
45
|
-
// TODO(wittjosiah): Factor out so this component isn't dependent on the app framework.
|
|
46
|
-
const handleNavigate = useCallback(
|
|
47
|
-
() =>
|
|
48
|
-
dispatch(
|
|
49
|
-
Function.pipe(
|
|
50
|
-
createIntent(LayoutAction.UpdatePopover, {
|
|
51
|
-
part: 'popover',
|
|
52
|
-
subject: null,
|
|
53
|
-
options: { state: false, anchorId: '' },
|
|
54
|
-
}),
|
|
55
|
-
chain(LayoutAction.Open, { part: 'main', subject: [fullyQualifiedId(subject)] }),
|
|
56
|
-
),
|
|
57
|
-
),
|
|
58
|
-
[dispatch, subject],
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<Card.SurfaceRoot role={role}>
|
|
63
|
-
<Card.Heading>{getTitle(subject, t('fallback title'))}</Card.Heading>
|
|
64
|
-
{snippet && <Card.Text classNames='line-clamp-3 break-words col-span-2'>{snippet}</Card.Text>}
|
|
65
|
-
{role === 'card--popover' && (
|
|
66
|
-
<Card.Chrome>
|
|
67
|
-
<Button onClick={handleNavigate}>
|
|
68
|
-
<span className='grow'>{t('navigate to document label')}</span>
|
|
69
|
-
<Icon icon='ph--arrow-right--regular' />
|
|
70
|
-
</Button>
|
|
71
|
-
</Card.Chrome>
|
|
72
|
-
)}
|
|
73
|
-
</Card.SurfaceRoot>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
type Capabilities,
|
|
10
|
-
IntentPlugin,
|
|
11
|
-
LayoutAction,
|
|
12
|
-
SettingsPlugin,
|
|
13
|
-
Surface,
|
|
14
|
-
createIntent,
|
|
15
|
-
useIntentDispatcher,
|
|
16
|
-
} from '@dxos/app-framework';
|
|
17
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
18
|
-
import { Obj, Query } from '@dxos/echo';
|
|
19
|
-
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
20
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
21
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
22
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
23
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
24
|
-
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
25
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
26
|
-
import { faker } from '@dxos/random';
|
|
27
|
-
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
28
|
-
import { useAsyncEffect } from '@dxos/react-ui';
|
|
29
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
30
|
-
import { defaultTx } from '@dxos/react-ui-theme';
|
|
31
|
-
import { DataType } from '@dxos/schema';
|
|
32
|
-
import { type ValueGenerator, createObjectFactory } from '@dxos/schema/testing';
|
|
33
|
-
|
|
34
|
-
import { MarkdownPlugin } from '../MarkdownPlugin';
|
|
35
|
-
import { translations } from '../translations';
|
|
36
|
-
import { Markdown } from '../types';
|
|
37
|
-
|
|
38
|
-
faker.seed(1);
|
|
39
|
-
|
|
40
|
-
const generator: ValueGenerator = faker as any;
|
|
41
|
-
|
|
42
|
-
const DefaultStory = () => {
|
|
43
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
44
|
-
const space = useSpace();
|
|
45
|
-
const [doc] = useQuery(space, Query.type(Markdown.Document));
|
|
46
|
-
const data = useMemo(() => ({ subject: doc }), [doc]);
|
|
47
|
-
|
|
48
|
-
useAsyncEffect(async () => {
|
|
49
|
-
if (space) {
|
|
50
|
-
await dispatch(createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: space.id }));
|
|
51
|
-
}
|
|
52
|
-
}, [space, dispatch]);
|
|
53
|
-
|
|
54
|
-
return <Surface role='article' data={data} limit={1} />;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const meta = {
|
|
58
|
-
title: 'plugins/plugin-markdown/MarkdownContainer',
|
|
59
|
-
render: DefaultStory,
|
|
60
|
-
decorators: [
|
|
61
|
-
withTheme,
|
|
62
|
-
withPluginManager({
|
|
63
|
-
plugins: [
|
|
64
|
-
ClientPlugin({
|
|
65
|
-
types: [Markdown.Document, DataType.Text, DataType.Person, DataType.Organization],
|
|
66
|
-
onClientInitialized: async ({ client }) => {
|
|
67
|
-
await client.halo.createIdentity();
|
|
68
|
-
await client.spaces.waitUntilReady();
|
|
69
|
-
await client.spaces.default.waitUntilReady();
|
|
70
|
-
const space = client.spaces.default;
|
|
71
|
-
const queue = space.queues.create();
|
|
72
|
-
const alice = Obj.make(DataType.Person, { fullName: 'Alice' });
|
|
73
|
-
const acme = Obj.make(DataType.Organization, { name: 'ACME' });
|
|
74
|
-
await queue.append([alice, acme]);
|
|
75
|
-
const doc = Markdown.makeDocument({
|
|
76
|
-
name: 'Test',
|
|
77
|
-
content: `# Test\n\n})\n\n})`,
|
|
78
|
-
});
|
|
79
|
-
space.db.add(doc);
|
|
80
|
-
const createObjects = createObjectFactory(space.db, generator);
|
|
81
|
-
await createObjects([{ type: DataType.Organization, count: 10 }]);
|
|
82
|
-
await space.db.flush({ indexes: true });
|
|
83
|
-
},
|
|
84
|
-
}),
|
|
85
|
-
SpacePlugin({}),
|
|
86
|
-
GraphPlugin(),
|
|
87
|
-
IntentPlugin(),
|
|
88
|
-
SettingsPlugin(),
|
|
89
|
-
// UI
|
|
90
|
-
ThemePlugin({ tx: defaultTx }),
|
|
91
|
-
AttentionPlugin(),
|
|
92
|
-
MarkdownPlugin(),
|
|
93
|
-
PreviewPlugin(),
|
|
94
|
-
StorybookLayoutPlugin({}),
|
|
95
|
-
],
|
|
96
|
-
}),
|
|
97
|
-
],
|
|
98
|
-
parameters: {
|
|
99
|
-
layout: 'fullscreen',
|
|
100
|
-
controls: { disable: true },
|
|
101
|
-
translations,
|
|
102
|
-
},
|
|
103
|
-
} satisfies Meta<typeof Capabilities>;
|
|
104
|
-
|
|
105
|
-
export default meta;
|
|
106
|
-
|
|
107
|
-
type Story = StoryObj<typeof meta>;
|
|
108
|
-
|
|
109
|
-
export const Default: Story = {};
|