@dxos/plugin-markdown 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a
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/neutral/{MarkdownArticle-I4UMD7AA.mjs → MarkdownArticle-ZHBXH7YF.mjs} +3 -5
- package/dist/lib/neutral/{MarkdownArticle-I4UMD7AA.mjs.map → MarkdownArticle-ZHBXH7YF.mjs.map} +2 -2
- package/dist/lib/neutral/{MarkdownCard-OYO2HYZF.mjs → MarkdownCard-2HUXCGZP.mjs} +2 -2
- package/dist/lib/neutral/{MarkdownCard-OYO2HYZF.mjs.map → MarkdownCard-2HUXCGZP.mjs.map} +1 -1
- package/dist/lib/neutral/MarkdownPlugin.mjs +3 -7
- package/dist/lib/neutral/MarkdownPlugin.mjs.map +3 -3
- package/dist/lib/neutral/MarkdownPlugin.node.mjs +4 -2
- package/dist/lib/neutral/MarkdownPlugin.node.mjs.map +3 -3
- package/dist/lib/neutral/MarkdownPlugin.workerd.mjs +6 -17
- package/dist/lib/neutral/MarkdownPlugin.workerd.mjs.map +4 -4
- package/dist/lib/neutral/MarkdownSettings-5VMOYMND.mjs +43 -0
- package/dist/lib/neutral/MarkdownSettings-5VMOYMND.mjs.map +7 -0
- package/dist/lib/neutral/{anchor-sort-UXN4RHFX.mjs → anchor-sort-QF7UDG2A.mjs} +4 -3
- package/dist/lib/neutral/anchor-sort-QF7UDG2A.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +9 -13
- package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
- package/dist/lib/neutral/capabilities/node.mjs +5 -3
- package/dist/lib/neutral/capabilities/node.mjs.map +3 -3
- package/dist/lib/neutral/chunk-2V6A5NDQ.mjs +8 -0
- package/dist/lib/neutral/{operation-handler-2ARMPBGZ.mjs → chunk-ANHHOTCD.mjs} +3 -4
- package/dist/lib/neutral/{operation-handler-2ARMPBGZ.mjs.map → chunk-ANHHOTCD.mjs.map} +1 -1
- package/dist/lib/neutral/chunk-CNYFGIDS.mjs +32 -0
- package/dist/lib/neutral/chunk-CNYFGIDS.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-LXNSKCPD.mjs → chunk-EV4ZOL4P.mjs} +12 -11
- package/dist/lib/neutral/chunk-EV4ZOL4P.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GUXWFDD4.mjs → chunk-OC3JD73N.mjs} +2 -2
- package/dist/lib/neutral/{chunk-GUXWFDD4.mjs.map → chunk-OC3JD73N.mjs.map} +1 -1
- package/dist/lib/neutral/chunk-YJF6XOXX.mjs +175 -0
- package/dist/lib/neutral/chunk-YJF6XOXX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YMBC62S7.mjs +14 -0
- package/dist/lib/neutral/chunk-YMBC62S7.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-CRKAIDRD.mjs → chunk-ZJ3GWRUJ.mjs} +15 -14
- package/dist/lib/neutral/chunk-ZJ3GWRUJ.mjs.map +7 -0
- package/dist/lib/neutral/{comment-config-EGY7RPPW.mjs → comment-config-M5OGFULS.mjs} +6 -4
- package/dist/lib/neutral/comment-config-M5OGFULS.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +13 -52
- package/dist/lib/neutral/components/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +5 -3
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-XW2FQNLK.mjs → create-OQUMKL5I.mjs} +2 -2
- package/dist/lib/neutral/{create-markdown-KLSVQCT7.mjs → create-markdown-4O5FDA77.mjs} +2 -2
- package/dist/lib/neutral/{create-object-3WMEQJ2C.mjs → create-object-RSEWTCMM.mjs} +2 -6
- package/dist/lib/neutral/create-object-RSEWTCMM.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +41 -15
- package/dist/lib/neutral/hooks/index.mjs.map +3 -3
- package/dist/lib/neutral/index.mjs +10 -16
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/{open-F7KLNKVN.mjs → open-BAZIRXII.mjs} +2 -2
- package/dist/lib/neutral/operation-handler-SDCXGMGK.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/plugin.workerd.mjs +12 -0
- package/dist/lib/neutral/plugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/{react-surface-6LX4ZQ2H.mjs → react-surface-37GL3UVG.mjs} +4 -4
- package/dist/lib/neutral/react-surface-37GL3UVG.mjs.map +7 -0
- package/dist/lib/neutral/{scroll-to-anchor-ACND3WJU.mjs → scroll-to-anchor-I6HFE5AH.mjs} +2 -2
- package/dist/lib/neutral/{set-view-mode-WDC7CAEC.mjs → set-view-mode-NY5OYYIM.mjs} +2 -2
- package/dist/lib/neutral/skill-definition-ET7BYY47.mjs +8 -0
- package/dist/lib/neutral/skill-definition-ET7BYY47.mjs.map +7 -0
- package/dist/lib/neutral/skills/index.mjs +8 -0
- package/dist/lib/neutral/skills/index.mjs.map +7 -0
- package/dist/lib/neutral/{state-ZYT3JRWT.mjs → state-3BR7L6CW.mjs} +1 -1
- package/dist/lib/neutral/{state-ZYT3JRWT.mjs.map → state-3BR7L6CW.mjs.map} +2 -2
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/lib/neutral/update-markdown-M4PTA6VS.mjs +24 -0
- package/dist/lib/neutral/update-markdown-M4PTA6VS.mjs.map +7 -0
- package/dist/types/src/MarkdownPlugin.d.ts.map +1 -1
- package/dist/types/src/MarkdownPlugin.node.d.ts.map +1 -1
- package/dist/types/src/MarkdownPlugin.workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort.d.ts +1 -2
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
- package/dist/types/src/capabilities/comment-config.d.ts +1 -2
- package/dist/types/src/capabilities/comment-config.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -7
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
- package/dist/types/src/capabilities/editor-view-state.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +1 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +1 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts +3 -4
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts +3 -2
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/PreviewComponent/PreviewComponent.d.ts +17 -0
- package/dist/types/src/components/PreviewComponent/PreviewComponent.d.ts.map +1 -0
- package/dist/types/src/components/PreviewComponent/index.d.ts +2 -0
- package/dist/types/src/components/PreviewComponent/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/MarkdownArticle/MarkdownArticle.d.ts +2 -13
- package/dist/types/src/containers/MarkdownArticle/MarkdownArticle.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/MarkdownSettings/MarkdownSettings.d.ts +1 -1
- package/dist/types/src/{components → containers}/MarkdownSettings/MarkdownSettings.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/MarkdownSettings/MarkdownSettings.stories.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/MarkdownSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +1 -0
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useExtensions.d.ts +3 -3
- package/dist/types/src/hooks/useExtensions.d.ts.map +1 -1
- package/dist/types/src/hooks/useLinkQuery.d.ts +2 -2
- package/dist/types/src/hooks/useLinkQuery.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/update-markdown.d.ts.map +1 -1
- package/dist/types/src/plugin.workerd.d.ts +2 -0
- package/dist/types/src/plugin.workerd.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/skills/markdown-skill.d.ts +4 -0
- package/dist/types/src/skills/markdown-skill.d.ts.map +1 -0
- package/dist/types/src/types/Markdown.d.ts +12 -20
- package/dist/types/src/types/Markdown.d.ts.map +1 -1
- package/dist/types/src/types/MarkdownOperation.d.ts +5 -28
- package/dist/types/src/types/MarkdownOperation.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -1
- package/package.json +66 -59
- package/src/MarkdownPlugin.node.ts +2 -1
- package/src/MarkdownPlugin.tsx +2 -6
- package/src/MarkdownPlugin.workerd.ts +5 -2
- package/src/capabilities/anchor-sort.ts +3 -2
- package/src/capabilities/comment-config.ts +6 -9
- package/src/capabilities/create-object.ts +1 -4
- package/src/capabilities/editor-view-state.ts +1 -1
- package/src/capabilities/index.ts +1 -3
- package/src/capabilities/node.ts +1 -0
- package/src/capabilities/react-surface.tsx +9 -3
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +72 -30
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +11 -37
- package/src/components/MarkdownEditor/MarkdownEditorContent.tsx +3 -3
- package/src/components/PreviewComponent/PreviewComponent.tsx +195 -0
- package/src/components/PreviewComponent/index.ts +5 -0
- package/src/components/index.ts +1 -4
- package/src/containers/MarkdownArticle/MarkdownArticle.tsx +3 -3
- package/src/containers/MarkdownCard/MarkdownCard.tsx +1 -1
- package/src/{components → containers}/MarkdownSettings/MarkdownSettings.stories.tsx +1 -1
- package/src/containers/MarkdownSettings/MarkdownSettings.tsx +54 -0
- package/src/containers/index.ts +1 -0
- package/src/hooks/useEditorMenuOptions.ts +1 -1
- package/src/hooks/useExtensions.tsx +32 -12
- package/src/hooks/useLinkQuery.ts +5 -3
- package/src/index.ts +1 -2
- package/src/operations/create.conversations.json +1 -1
- package/src/operations/create.test.ts +5 -12
- package/src/operations/update-markdown.ts +7 -27
- package/src/operations/update.conversations.json +1 -1
- package/src/operations/update.test.ts +86 -16
- package/src/plugin.workerd.ts +5 -0
- package/src/skills/index.ts +5 -0
- package/src/{blueprints/markdown-blueprint.ts → skills/markdown-skill.ts} +8 -7
- package/src/types/Markdown.ts +19 -18
- package/src/types/MarkdownOperation.ts +11 -5
- package/src/types/types.ts +2 -7
- package/dist/lib/neutral/MarkdownSettings-F5AWRDT3.mjs +0 -32
- package/dist/lib/neutral/MarkdownSettings-F5AWRDT3.mjs.map +0 -7
- package/dist/lib/neutral/anchor-sort-UXN4RHFX.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-6Y5NHTNR.mjs +0 -66
- package/dist/lib/neutral/app-graph-builder-6Y5NHTNR.mjs.map +0 -7
- package/dist/lib/neutral/blueprint-definition-DSPXK77L.mjs +0 -15
- package/dist/lib/neutral/blueprint-definition-DSPXK77L.mjs.map +0 -7
- package/dist/lib/neutral/blueprints/index.mjs +0 -8
- package/dist/lib/neutral/chunk-4ULSRZRL.mjs +0 -10
- package/dist/lib/neutral/chunk-4ULSRZRL.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BL46CERY.mjs +0 -8
- package/dist/lib/neutral/chunk-CRKAIDRD.mjs.map +0 -7
- package/dist/lib/neutral/chunk-LXNSKCPD.mjs.map +0 -7
- package/dist/lib/neutral/comment-config-EGY7RPPW.mjs.map +0 -7
- package/dist/lib/neutral/create-object-3WMEQJ2C.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-3WEM7SSC.mjs +0 -14
- package/dist/lib/neutral/navigation-resolver-3WEM7SSC.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-6LX4ZQ2H.mjs.map +0 -7
- package/dist/lib/neutral/update-markdown-FGVN3LD4.mjs +0 -44
- package/dist/lib/neutral/update-markdown-FGVN3LD4.mjs.map +0 -7
- package/dist/types/src/blueprints/index.d.ts +0 -2
- package/dist/types/src/blueprints/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/markdown-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation-resolver.d.ts +0 -6
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +0 -1
- package/dist/types/src/paths.d.ts +0 -3
- package/dist/types/src/paths.d.ts.map +0 -1
- package/src/blueprints/index.ts +0 -5
- package/src/capabilities/app-graph-builder.ts +0 -61
- package/src/capabilities/blueprint-definition.ts +0 -19
- package/src/capabilities/navigation-resolver.ts +0 -19
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +0 -35
- package/src/paths.ts +0 -13
- /package/dist/lib/neutral/{chunk-BL46CERY.mjs.map → chunk-2V6A5NDQ.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-XW2FQNLK.mjs.map → create-OQUMKL5I.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-markdown-KLSVQCT7.mjs.map → create-markdown-4O5FDA77.mjs.map} +0 -0
- /package/dist/lib/neutral/{open-F7KLNKVN.mjs.map → open-BAZIRXII.mjs.map} +0 -0
- /package/dist/lib/neutral/{blueprints/index.mjs.map → operation-handler-SDCXGMGK.mjs.map} +0 -0
- /package/dist/lib/neutral/{scroll-to-anchor-ACND3WJU.mjs.map → scroll-to-anchor-I6HFE5AH.mjs.map} +0 -0
- /package/dist/lib/neutral/{set-view-mode-WDC7CAEC.mjs.map → set-view-mode-NY5OYYIM.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/MarkdownSettings/MarkdownSettings.stories.d.ts +0 -0
- /package/dist/types/src/{components → containers}/MarkdownSettings/index.d.ts +0 -0
- /package/src/{components → containers}/MarkdownSettings/index.ts +0 -0
package/dx.config.ts
CHANGED
|
@@ -17,7 +17,7 @@ export default Config2.make({
|
|
|
17
17
|
|
|
18
18
|
The editor integrates with the rest of the workspace through @ references that link to any ECHO object, image and file uploads stored in the active space, and anchored comment threads on text ranges. Comments can optionally be routed to an AI agent on every message or only on @mention.
|
|
19
19
|
|
|
20
|
-
A built-in
|
|
20
|
+
A built-in skill exposes create, open, and update operations as tools for AI agents. Updates are applied as compact find-and-replace diffs against the document, making it safe for agents to edit large documents incrementally while you continue collaborating.
|
|
21
21
|
`,
|
|
22
22
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-markdown',
|
|
23
23
|
icon: { key: 'ph--text-aa--regular', hue: 'indigo' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-markdown",
|
|
3
|
-
"version": "0.9.1-
|
|
3
|
+
"version": "0.9.1-staging.ee54ba693a",
|
|
4
4
|
"description": "DXOS Surface plugin for interacting with Markdown",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
-
"#
|
|
17
|
-
"source": "./src/
|
|
18
|
-
"types": "./dist/types/src/
|
|
19
|
-
"default": "./dist/lib/neutral/
|
|
16
|
+
"#skills": {
|
|
17
|
+
"source": "./src/skills/index.ts",
|
|
18
|
+
"types": "./dist/types/src/skills/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/skills/index.mjs"
|
|
20
20
|
},
|
|
21
21
|
"#capabilities": {
|
|
22
22
|
"source": {
|
|
@@ -85,14 +85,18 @@
|
|
|
85
85
|
"types": "./dist/types/src/index.d.ts",
|
|
86
86
|
"default": "./dist/lib/neutral/index.mjs"
|
|
87
87
|
},
|
|
88
|
-
"./
|
|
89
|
-
"source": "./src/
|
|
90
|
-
"types": "./dist/types/src/
|
|
91
|
-
"default": "./dist/lib/neutral/
|
|
88
|
+
"./skills": {
|
|
89
|
+
"source": "./src/skills/index.ts",
|
|
90
|
+
"types": "./dist/types/src/skills/index.d.ts",
|
|
91
|
+
"default": "./dist/lib/neutral/skills/index.mjs"
|
|
92
92
|
},
|
|
93
93
|
"./plugin": {
|
|
94
|
-
"source":
|
|
94
|
+
"source": {
|
|
95
|
+
"workerd": "./src/plugin.workerd.ts",
|
|
96
|
+
"default": "./src/plugin.ts"
|
|
97
|
+
},
|
|
95
98
|
"types": "./dist/types/src/plugin.d.ts",
|
|
99
|
+
"workerd": "./dist/lib/neutral/plugin.workerd.mjs",
|
|
96
100
|
"default": "./dist/lib/neutral/plugin.mjs"
|
|
97
101
|
},
|
|
98
102
|
"./testing": {
|
|
@@ -118,7 +122,7 @@
|
|
|
118
122
|
"src"
|
|
119
123
|
],
|
|
120
124
|
"dependencies": {
|
|
121
|
-
"@automerge/automerge": "3.3.0-fragments.
|
|
125
|
+
"@automerge/automerge": "3.3.0-fragments.2",
|
|
122
126
|
"@codemirror/state": "^6.6.0",
|
|
123
127
|
"@codemirror/view": "^6.43.0",
|
|
124
128
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -126,62 +130,65 @@
|
|
|
126
130
|
"@effect/experimental": "0.60.0",
|
|
127
131
|
"@radix-ui/react-context": "1.1.1",
|
|
128
132
|
"react-dropzone": "^14.2.3",
|
|
129
|
-
"@dxos/ai": "0.9.1-
|
|
130
|
-
"@dxos/app-
|
|
131
|
-
"@dxos/app-
|
|
132
|
-
"@dxos/
|
|
133
|
-
"@dxos/
|
|
134
|
-
"@dxos/
|
|
135
|
-
"@dxos/
|
|
136
|
-
"@dxos/
|
|
137
|
-
"@dxos/echo-client": "0.9.1-
|
|
138
|
-
"@dxos/
|
|
139
|
-
"@dxos/
|
|
140
|
-
"@dxos/
|
|
141
|
-
"@dxos/
|
|
142
|
-
"@dxos/
|
|
143
|
-
"@dxos/
|
|
144
|
-
"@dxos/plugin-
|
|
145
|
-
"@dxos/plugin-
|
|
146
|
-
"@dxos/
|
|
147
|
-
"@dxos/plugin-
|
|
148
|
-
"@dxos/
|
|
149
|
-
"@dxos/
|
|
150
|
-
"@dxos/react-ui-
|
|
151
|
-
"@dxos/react-ui-
|
|
152
|
-
"@dxos/react-
|
|
153
|
-
"@dxos/
|
|
154
|
-
"@dxos/
|
|
155
|
-
"@dxos/ui-
|
|
156
|
-
"@dxos/
|
|
157
|
-
"@dxos/
|
|
158
|
-
"@dxos/
|
|
133
|
+
"@dxos/ai": "0.9.1-staging.ee54ba693a",
|
|
134
|
+
"@dxos/app-framework": "0.9.1-staging.ee54ba693a",
|
|
135
|
+
"@dxos/app-toolkit": "0.9.1-staging.ee54ba693a",
|
|
136
|
+
"@dxos/assistant": "0.9.1-staging.ee54ba693a",
|
|
137
|
+
"@dxos/async": "0.9.1-staging.ee54ba693a",
|
|
138
|
+
"@dxos/echo": "0.9.1-staging.ee54ba693a",
|
|
139
|
+
"@dxos/client": "0.9.1-staging.ee54ba693a",
|
|
140
|
+
"@dxos/client-protocol": "0.9.1-staging.ee54ba693a",
|
|
141
|
+
"@dxos/echo-client": "0.9.1-staging.ee54ba693a",
|
|
142
|
+
"@dxos/invariant": "0.9.1-staging.ee54ba693a",
|
|
143
|
+
"@dxos/echo-doc": "0.9.1-staging.ee54ba693a",
|
|
144
|
+
"@dxos/functions-runtime": "0.9.1-staging.ee54ba693a",
|
|
145
|
+
"@dxos/effect": "0.9.1-staging.ee54ba693a",
|
|
146
|
+
"@dxos/log": "0.9.1-staging.ee54ba693a",
|
|
147
|
+
"@dxos/plugin-attention": "0.9.1-staging.ee54ba693a",
|
|
148
|
+
"@dxos/plugin-client": "0.9.1-staging.ee54ba693a",
|
|
149
|
+
"@dxos/plugin-graph": "0.9.1-staging.ee54ba693a",
|
|
150
|
+
"@dxos/keys": "0.9.1-staging.ee54ba693a",
|
|
151
|
+
"@dxos/plugin-preview": "0.9.1-staging.ee54ba693a",
|
|
152
|
+
"@dxos/plugin-sketch": "0.9.1-staging.ee54ba693a",
|
|
153
|
+
"@dxos/plugin-space": "0.9.1-staging.ee54ba693a",
|
|
154
|
+
"@dxos/react-ui-attention": "0.9.1-staging.ee54ba693a",
|
|
155
|
+
"@dxos/react-ui-dnd": "0.9.1-staging.ee54ba693a",
|
|
156
|
+
"@dxos/react-client": "0.9.1-staging.ee54ba693a",
|
|
157
|
+
"@dxos/react-ui-editor": "0.9.1-staging.ee54ba693a",
|
|
158
|
+
"@dxos/react-ui-mosaic": "0.9.1-staging.ee54ba693a",
|
|
159
|
+
"@dxos/react-ui-form": "0.9.1-staging.ee54ba693a",
|
|
160
|
+
"@dxos/compute": "0.9.1-staging.ee54ba693a",
|
|
161
|
+
"@dxos/types": "0.9.1-staging.ee54ba693a",
|
|
162
|
+
"@dxos/ui-editor": "0.9.1-staging.ee54ba693a",
|
|
163
|
+
"@dxos/ui": "0.9.1-staging.ee54ba693a",
|
|
164
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a",
|
|
165
|
+
"@dxos/schema": "0.9.1-staging.ee54ba693a"
|
|
159
166
|
},
|
|
160
167
|
"devDependencies": {
|
|
161
168
|
"@effect-atom/atom-react": "^0.5.0",
|
|
162
|
-
"@effect/platform": "0.96.
|
|
163
|
-
"@types/react": "~19.2.
|
|
169
|
+
"@effect/platform": "0.96.2",
|
|
170
|
+
"@types/react": "~19.2.17",
|
|
164
171
|
"@types/react-dom": "~19.2.3",
|
|
165
|
-
"effect": "3.21.
|
|
166
|
-
"react": "~19.2.
|
|
167
|
-
"react-dom": "~19.2.
|
|
172
|
+
"effect": "3.21.4",
|
|
173
|
+
"react": "~19.2.7",
|
|
174
|
+
"react-dom": "~19.2.7",
|
|
168
175
|
"vite": "^8.0.16",
|
|
169
|
-
"@dxos/debug": "0.9.1-
|
|
170
|
-
"@dxos/plugin-testing": "0.9.1-
|
|
171
|
-
"@dxos/plugin-theme": "0.9.1-
|
|
172
|
-
"@dxos/
|
|
173
|
-
"@dxos/ui
|
|
174
|
-
"@dxos/
|
|
175
|
-
"@dxos/
|
|
176
|
+
"@dxos/debug": "0.9.1-staging.ee54ba693a",
|
|
177
|
+
"@dxos/plugin-testing": "0.9.1-staging.ee54ba693a",
|
|
178
|
+
"@dxos/plugin-theme": "0.9.1-staging.ee54ba693a",
|
|
179
|
+
"@dxos/random": "0.9.1-staging.ee54ba693a",
|
|
180
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
181
|
+
"@dxos/storybook-utils": "0.9.1-staging.ee54ba693a",
|
|
182
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
176
183
|
},
|
|
177
184
|
"peerDependencies": {
|
|
178
185
|
"@effect-atom/atom-react": "^0.5.0",
|
|
179
|
-
"@effect/platform": "0.96.
|
|
180
|
-
"effect": "3.21.
|
|
181
|
-
"react": "~19.2.
|
|
182
|
-
"react-dom": "~19.2.
|
|
183
|
-
"@dxos/ui-theme": "0.9.1-
|
|
184
|
-
"@dxos/react-ui": "0.9.1-
|
|
186
|
+
"@effect/platform": "0.96.2",
|
|
187
|
+
"effect": "3.21.4",
|
|
188
|
+
"react": "~19.2.7",
|
|
189
|
+
"react-dom": "~19.2.7",
|
|
190
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
|
|
191
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a"
|
|
185
192
|
},
|
|
186
193
|
"publishConfig": {
|
|
187
194
|
"access": "public"
|
|
@@ -6,11 +6,12 @@ import { Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
import { Text } from '@dxos/schema';
|
|
8
8
|
|
|
9
|
-
import { CreateObject, OperationHandler } from '#capabilities';
|
|
9
|
+
import { CreateObject, OperationHandler, SkillDefinition } from '#capabilities';
|
|
10
10
|
import { meta } from '#meta';
|
|
11
11
|
import { Markdown } from '#types';
|
|
12
12
|
|
|
13
13
|
export const MarkdownPlugin = Plugin.define(meta).pipe(
|
|
14
|
+
AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),
|
|
14
15
|
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
15
16
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
16
17
|
AppPlugin.addSchemaModule({ schema: [Markdown.Document, Text.Text] }),
|
package/src/MarkdownPlugin.tsx
CHANGED
|
@@ -10,24 +10,20 @@ import { Text } from '@dxos/schema';
|
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
AnchorSort,
|
|
13
|
-
AppGraphBuilder,
|
|
14
|
-
NavigationResolver,
|
|
15
|
-
BlueprintDefinition,
|
|
16
13
|
CommentConfig,
|
|
17
14
|
CreateObject,
|
|
18
15
|
MarkdownSettings,
|
|
19
16
|
MarkdownState,
|
|
20
17
|
OperationHandler,
|
|
21
18
|
ReactSurface,
|
|
19
|
+
SkillDefinition,
|
|
22
20
|
} from '#capabilities';
|
|
23
21
|
import { meta } from '#meta';
|
|
24
22
|
import { translations } from '#translations';
|
|
25
23
|
import { Markdown, MarkdownEvents } from '#types';
|
|
26
24
|
|
|
27
25
|
export const MarkdownPlugin = Plugin.define(meta).pipe(
|
|
28
|
-
AppPlugin.
|
|
29
|
-
AppPlugin.addNavigationResolverModule({ activate: NavigationResolver }),
|
|
30
|
-
AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
|
|
26
|
+
AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),
|
|
31
27
|
AppPlugin.addCommentConfigModule({ activate: CommentConfig }),
|
|
32
28
|
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
33
29
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
@@ -6,12 +6,15 @@ import { Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
import { Text } from '@dxos/schema';
|
|
8
8
|
|
|
9
|
-
import { OperationHandler } from '#capabilities';
|
|
10
9
|
import { meta } from '#meta';
|
|
11
10
|
import { Markdown } from '#types';
|
|
12
11
|
|
|
12
|
+
import OperationHandler from './capabilities/operation-handler';
|
|
13
|
+
import SkillDefinition from './capabilities/skill-definition';
|
|
14
|
+
|
|
13
15
|
export const MarkdownPlugin = Plugin.define(meta).pipe(
|
|
14
|
-
AppPlugin.
|
|
16
|
+
AppPlugin.addSkillDefinitionModule({ id: 'skill-definition', activate: SkillDefinition }),
|
|
17
|
+
AppPlugin.addOperationHandlerModule({ id: 'operation-handler', activate: OperationHandler }),
|
|
15
18
|
AppPlugin.addSchemaModule({ schema: [Markdown.Document, Text.Text] }),
|
|
16
19
|
Plugin.make,
|
|
17
20
|
);
|
|
@@ -7,7 +7,8 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { Relation, Type } from '@dxos/echo';
|
|
10
|
-
import {
|
|
10
|
+
import { getRangeFromCursor } from '@dxos/echo-client';
|
|
11
|
+
import { Doc } from '@dxos/echo-doc';
|
|
11
12
|
import { type AnchoredTo } from '@dxos/types';
|
|
12
13
|
|
|
13
14
|
import { Markdown } from '#types';
|
|
@@ -18,7 +19,7 @@ export default Capability.makeModule(() =>
|
|
|
18
19
|
key: Type.getTypename(Markdown.Document),
|
|
19
20
|
sort: (anchorA: AnchoredTo.AnchoredTo, anchorB: AnchoredTo.AnchoredTo) => {
|
|
20
21
|
const doc = Relation.getTarget(anchorA) as Markdown.Document;
|
|
21
|
-
const accessor = doc.content.target ?
|
|
22
|
+
const accessor = doc.content.target ? Doc.createAccessor(doc.content.target, ['content']) : undefined;
|
|
22
23
|
if (doc !== Relation.getTarget(anchorB) || !accessor) {
|
|
23
24
|
return 0;
|
|
24
25
|
}
|
|
@@ -7,25 +7,22 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { Type } from '@dxos/echo';
|
|
10
|
-
import {
|
|
10
|
+
import { getTextInRange } from '@dxos/echo-client';
|
|
11
|
+
import { Doc } from '@dxos/echo-doc';
|
|
11
12
|
|
|
12
13
|
import { MarkdownOperation } from '#types';
|
|
13
14
|
import { Markdown } from '#types';
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
const activate: () => Effect.Effect<
|
|
17
|
-
Capability.Capability<typeof AppCapabilities.CommentConfig>,
|
|
18
|
-
never,
|
|
19
|
-
Capability.Service
|
|
20
|
-
> = Effect.fnUntraced(function* () {
|
|
16
|
+
const activate = Effect.fnUntraced(function* () {
|
|
21
17
|
const config: AppCapabilities.CommentConfig = {
|
|
22
18
|
id: Type.getTypename(Markdown.Document),
|
|
23
19
|
comments: 'anchored',
|
|
24
20
|
selectionMode: 'multi-range',
|
|
25
21
|
getAnchorLabel: (doc: Markdown.Document, anchor: string): string | undefined => {
|
|
26
|
-
|
|
22
|
+
const target = doc.content?.target;
|
|
23
|
+
if (target) {
|
|
27
24
|
const [start, end] = anchor.split(':');
|
|
28
|
-
return getTextInRange(
|
|
25
|
+
return getTextInRange(Doc.createAccessor(target, ['content']), start, end);
|
|
29
26
|
}
|
|
30
27
|
},
|
|
31
28
|
scrollToAnchor: MarkdownOperation.ScrollToAnchor,
|
|
@@ -12,8 +12,6 @@ import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
|
12
12
|
|
|
13
13
|
import { Markdown } from '#types';
|
|
14
14
|
|
|
15
|
-
import { getDocumentsPath } from '../paths';
|
|
16
|
-
|
|
17
15
|
export default Capability.makeModule(
|
|
18
16
|
Effect.fnUntraced(function* () {
|
|
19
17
|
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
@@ -24,8 +22,7 @@ export default Capability.makeModule(
|
|
|
24
22
|
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
25
23
|
object,
|
|
26
24
|
target: options.target,
|
|
27
|
-
|
|
28
|
-
targetNodeId: options.targetNodeId ?? getDocumentsPath(options.db.spaceId),
|
|
25
|
+
targetNodeId: options.targetNodeId,
|
|
29
26
|
});
|
|
30
27
|
}),
|
|
31
28
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { invariant } from '@dxos/invariant';
|
|
6
6
|
import { type ViewStateManager, defineViewState } from '@dxos/react-ui-attention';
|
|
7
|
-
import { type EditorStateStore
|
|
7
|
+
import { EditorSelectionStateSchema, type EditorStateStore } from '@dxos/ui-editor';
|
|
8
8
|
|
|
9
9
|
/** Per-document editor scroll/caret state, persisted to localStorage on this device. */
|
|
10
10
|
export const editorViewStateAspect = defineViewState({
|
|
@@ -5,12 +5,10 @@
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
import type { OperationHandlerSet } from '@dxos/compute';
|
|
7
7
|
|
|
8
|
-
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
-
export const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));
|
|
10
8
|
export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
|
|
11
9
|
export const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));
|
|
12
10
|
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
13
|
-
export const
|
|
11
|
+
export const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));
|
|
14
12
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
15
13
|
'OperationHandler',
|
|
16
14
|
() => import('./operation-handler'),
|
package/src/capabilities/node.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
import { OperationHandlerSet } from '@dxos/compute';
|
|
7
7
|
|
|
8
|
+
export const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));
|
|
8
9
|
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
9
10
|
|
|
10
11
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
@@ -19,9 +19,15 @@ import { Obj } from '@dxos/echo';
|
|
|
19
19
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
20
20
|
import { Text } from '@dxos/schema';
|
|
21
21
|
import { type EditorViewMode } from '@dxos/ui-editor/types';
|
|
22
|
+
import { Position } from '@dxos/util';
|
|
22
23
|
|
|
23
|
-
import {
|
|
24
|
-
|
|
24
|
+
import {
|
|
25
|
+
EditableMarkdownCard,
|
|
26
|
+
MarkdownArticle,
|
|
27
|
+
type MarkdownArticleProps,
|
|
28
|
+
MarkdownCard,
|
|
29
|
+
MarkdownSettings,
|
|
30
|
+
} from '#containers';
|
|
25
31
|
import { meta } from '#meta';
|
|
26
32
|
import { Markdown, MarkdownCapabilities } from '#types';
|
|
27
33
|
|
|
@@ -79,7 +85,7 @@ export default Capability.makeModule(() =>
|
|
|
79
85
|
}),
|
|
80
86
|
Surface.create({
|
|
81
87
|
id: 'surface.editable',
|
|
82
|
-
position:
|
|
88
|
+
position: Position.first,
|
|
83
89
|
filter: AppSurface.object(
|
|
84
90
|
AppSurface.CardContent,
|
|
85
91
|
[Markdown.Document, Text.Text],
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { MarkdownSkill } from '#skills';
|
|
11
|
+
|
|
12
|
+
const skillDefinition = () => Effect.succeed([Capability.contributes(AppCapabilities.SkillDefinition, MarkdownSkill)]);
|
|
13
|
+
|
|
14
|
+
export default skillDefinition;
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
5
|
+
import { type Decorator, type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
10
11
|
import { Filter, Obj } from '@dxos/echo';
|
|
11
|
-
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
12
|
-
import {
|
|
12
|
+
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
13
|
+
import { Sketch } from '@dxos/plugin-sketch';
|
|
14
|
+
import { SketchPlugin } from '@dxos/plugin-sketch/plugin';
|
|
15
|
+
import { SketchBuilder } from '@dxos/plugin-sketch/testing';
|
|
13
16
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
17
|
+
import { type Client } from '@dxos/react-client';
|
|
14
18
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
15
19
|
import { Panel } from '@dxos/react-ui';
|
|
16
20
|
import { AttendableContainer } from '@dxos/react-ui-attention';
|
|
@@ -19,16 +23,23 @@ import { translations as editorTranslations } from '@dxos/react-ui-editor/transl
|
|
|
19
23
|
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
20
24
|
import { Text } from '@dxos/schema';
|
|
21
25
|
|
|
26
|
+
import { useLinkQuery } from '#hooks';
|
|
22
27
|
import { translations } from '#translations';
|
|
23
28
|
import { Markdown } from '#types';
|
|
24
29
|
|
|
25
30
|
import { MarkdownEditor, MarkdownEditorProvider, type MarkdownEditorProviderProps } from './MarkdownEditor';
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
// A minimal sketch (tldraw `tldraw.com/2`) snapshot, used as a test sketch.
|
|
33
|
+
const SKETCH_CONTENT = new SketchBuilder()
|
|
34
|
+
.rectangle({ id: 'rect', x: 0, y: 0, text: 'DXOS', color: 'blue', fill: 'solid', size: 'l' })
|
|
35
|
+
.build();
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
type StoryArgs = Omit<MarkdownEditorProviderProps, 'id' | 'extensions' | 'children'>;
|
|
38
|
+
|
|
39
|
+
const DefaultStory = (props: StoryArgs) => {
|
|
30
40
|
const [space] = useSpaces();
|
|
31
41
|
const [doc] = useQuery(space?.db, Filter.type(Markdown.Document));
|
|
42
|
+
const handleLinkQuery = useLinkQuery(space?.db, doc);
|
|
32
43
|
const id = doc && Obj.getURI(doc);
|
|
33
44
|
if (!id) {
|
|
34
45
|
return <Loading data={{ id }} />;
|
|
@@ -36,15 +47,19 @@ const DefaultStory = (props: DefaultStoryProps) => {
|
|
|
36
47
|
|
|
37
48
|
return (
|
|
38
49
|
<AttendableContainer id={id} tabIndex={0} classNames='dx-container'>
|
|
39
|
-
<MarkdownEditorProvider id={id} object={doc} {...props}>
|
|
50
|
+
<MarkdownEditorProvider id={id} attendableId={id} object={doc} onLinkQuery={handleLinkQuery} {...props}>
|
|
40
51
|
{(editorRootProps) => (
|
|
41
52
|
<Editor.Root {...editorRootProps}>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
{/* Mirror MarkdownArticle: Panel.Toolbar/Content are NOT `asChild` (MarkdownEditor.Toolbar is not
|
|
54
|
+
composable, so asChild wraps it in a dx-slot-warning div that breaks the grid-area layout). */}
|
|
55
|
+
<Panel.Root role='article'>
|
|
56
|
+
<Panel.Toolbar>
|
|
57
|
+
<MarkdownEditor.Toolbar classNames='dx-document' />
|
|
45
58
|
</Panel.Toolbar>
|
|
46
|
-
<Panel.Content
|
|
59
|
+
<Panel.Content>
|
|
47
60
|
<MarkdownEditor.Content />
|
|
61
|
+
{/* Embedded objects (transclusions) portal into block-container elements created by the editor. */}
|
|
62
|
+
<MarkdownEditor.Blocks />
|
|
48
63
|
</Panel.Content>
|
|
49
64
|
</Panel.Root>
|
|
50
65
|
</Editor.Root>
|
|
@@ -54,28 +69,49 @@ const DefaultStory = (props: DefaultStoryProps) => {
|
|
|
54
69
|
);
|
|
55
70
|
};
|
|
56
71
|
|
|
72
|
+
const withClient = (seed: (client: Client) => Effect.Effect<void>): Decorator =>
|
|
73
|
+
withPluginManager({
|
|
74
|
+
// SketchPlugin's section surface reads its Settings atom, contributed on SetupSettings.
|
|
75
|
+
setupEvents: [AppActivationEvents.SetupSettings],
|
|
76
|
+
plugins: [
|
|
77
|
+
...corePlugins(),
|
|
78
|
+
SketchPlugin(),
|
|
79
|
+
ClientPlugin({
|
|
80
|
+
types: [Markdown.Document, Text.Text, Sketch.Sketch, Sketch.Canvas],
|
|
81
|
+
onClientInitialized: ({ client }) => seed(client),
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const seedPlainDocument = (client: Client) =>
|
|
87
|
+
Effect.gen(function* () {
|
|
88
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
89
|
+
personalSpace.db.add(Markdown.make({ content: Array.from({ length: 100 }, (_, i) => `Line ${i + 1}`).join('\n') }));
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const seedEmbeddedSketch = (client: Client) =>
|
|
93
|
+
Effect.gen(function* () {
|
|
94
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
95
|
+
const sketch = personalSpace.db.add(Sketch.make({ name: 'Test Sketch', canvas: { content: SKETCH_CONTENT } }));
|
|
96
|
+
const uri = Obj.getURI(sketch);
|
|
97
|
+
personalSpace.db.add(
|
|
98
|
+
Markdown.make({
|
|
99
|
+
content: [
|
|
100
|
+
'# Test Document',
|
|
101
|
+
'',
|
|
102
|
+
'The sketch below renders inline as a block surface:',
|
|
103
|
+
'',
|
|
104
|
+
``,
|
|
105
|
+
'',
|
|
106
|
+
].join('\n'),
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
|
|
57
111
|
const meta: Meta<typeof DefaultStory> = {
|
|
58
112
|
title: 'plugins/plugin-markdown/components/MarkdownEditor',
|
|
59
113
|
render: DefaultStory,
|
|
60
|
-
decorators: [
|
|
61
|
-
withLayout({ layout: 'column' }),
|
|
62
|
-
withPluginManager({
|
|
63
|
-
plugins: [
|
|
64
|
-
...corePlugins(),
|
|
65
|
-
// TODO(burdon): Try to write story without ClientPlugin.
|
|
66
|
-
ClientPlugin({
|
|
67
|
-
types: [Markdown.Document, Text.Text],
|
|
68
|
-
onClientInitialized: ({ client }) =>
|
|
69
|
-
Effect.gen(function* () {
|
|
70
|
-
const { personalSpace } = yield* initializeIdentity(client);
|
|
71
|
-
personalSpace.db.add(
|
|
72
|
-
Markdown.make({ content: Array.from({ length: 100 }, (_, i) => `Line ${i + 1}`).join('\n') }),
|
|
73
|
-
);
|
|
74
|
-
}),
|
|
75
|
-
}),
|
|
76
|
-
],
|
|
77
|
-
}),
|
|
78
|
-
],
|
|
114
|
+
decorators: [withLayout({ layout: 'column' })],
|
|
79
115
|
parameters: {
|
|
80
116
|
translations: [...translations, ...editorTranslations],
|
|
81
117
|
},
|
|
@@ -85,4 +121,10 @@ export default meta;
|
|
|
85
121
|
|
|
86
122
|
type Story = StoryObj<typeof meta>;
|
|
87
123
|
|
|
88
|
-
export const Default: Story = {
|
|
124
|
+
export const Default: Story = {
|
|
125
|
+
decorators: [withClient(seedPlainDocument)],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const WithEmbeddedSketch: Story = {
|
|
129
|
+
decorators: [withClient(seedEmbeddedSketch)],
|
|
130
|
+
};
|