@dxos/plugin-markdown 0.8.4-main.67995b8 → 0.8.4-main.dedc0f3
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/{MarkdownPreview-7VG3K24R.mjs → MarkdownCard-JLUQITYK.mjs} +11 -11
- package/dist/lib/browser/MarkdownCard-JLUQITYK.mjs.map +7 -0
- package/dist/lib/browser/{MarkdownContainer-NNBPE6A5.mjs → MarkdownContainer-JW7TRDSA.mjs} +250 -274
- package/dist/lib/browser/MarkdownContainer-JW7TRDSA.mjs.map +7 -0
- package/dist/lib/browser/{anchor-sort-Z7JQA7RL.mjs → anchor-sort-E33BSTYF.mjs} +3 -3
- package/dist/lib/browser/{app-graph-serializer-ZT5OVF5G.mjs → app-graph-serializer-OX62DNPT.mjs} +5 -6
- package/dist/lib/browser/{app-graph-serializer-ZT5OVF5G.mjs.map → app-graph-serializer-OX62DNPT.mjs.map} +3 -3
- package/dist/lib/browser/blueprint-definition-5YKFUHRU.mjs +11 -0
- package/dist/lib/browser/blueprint-definition-5YKFUHRU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YHMGUSO7.mjs → chunk-BEE7VQPU.mjs} +7 -9
- package/dist/lib/browser/chunk-BEE7VQPU.mjs.map +7 -0
- package/dist/lib/browser/chunk-F6JJLKLN.mjs +102 -0
- package/dist/lib/browser/chunk-F6JJLKLN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VMX5SDGW.mjs → chunk-LAVZ2W6X.mjs} +2 -2
- package/dist/lib/browser/{chunk-ZGY3DYC2.mjs → chunk-ODB2PTBP.mjs} +2 -4
- package/dist/lib/browser/{chunk-ZGY3DYC2.mjs.map → chunk-ODB2PTBP.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-CD4E4K7J.mjs → chunk-OY6CGPOO.mjs} +2 -2
- package/dist/lib/browser/{chunk-CD4E4K7J.mjs.map → chunk-OY6CGPOO.mjs.map} +1 -1
- package/dist/lib/browser/chunk-SUOK6YMI.mjs +22 -0
- package/dist/lib/browser/chunk-SUOK6YMI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-K7ZFMSC4.mjs → chunk-Z7P6JGGW.mjs} +4 -3
- package/dist/lib/browser/chunk-Z7P6JGGW.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +28 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-EBEF7WEI.mjs → intent-resolver-WDDH56JC.mjs} +18 -16
- package/dist/lib/browser/intent-resolver-WDDH56JC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-ZPMZT4VU.mjs → react-surface-L3NTMD4D.mjs} +38 -31
- package/dist/lib/browser/react-surface-L3NTMD4D.mjs.map +7 -0
- package/dist/lib/browser/{settings-MBDK4TWE.mjs → settings-AABBTB4Q.mjs} +3 -3
- package/dist/lib/browser/{state-ZA6PZPUI.mjs → state-FTHQQX7V.mjs} +3 -3
- package/dist/lib/browser/state-FTHQQX7V.mjs.map +7 -0
- package/dist/lib/browser/toolkit-2AJTHG74.mjs +74 -0
- package/dist/lib/browser/toolkit-2AJTHG74.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{MarkdownPreview-UVWR2YK3.mjs → MarkdownCard-XL5EVSJ7.mjs} +11 -11
- package/dist/lib/node-esm/MarkdownCard-XL5EVSJ7.mjs.map +7 -0
- package/dist/lib/node-esm/{MarkdownContainer-Q6UO7DKT.mjs → MarkdownContainer-HRGQXIXP.mjs} +250 -274
- package/dist/lib/node-esm/MarkdownContainer-HRGQXIXP.mjs.map +7 -0
- package/dist/lib/node-esm/{anchor-sort-R6AAKYNG.mjs → anchor-sort-ALP2NH24.mjs} +3 -3
- package/dist/lib/node-esm/{app-graph-serializer-X4M5QEI6.mjs → app-graph-serializer-56TD3BMX.mjs} +5 -6
- package/dist/lib/node-esm/{app-graph-serializer-X4M5QEI6.mjs.map → app-graph-serializer-56TD3BMX.mjs.map} +3 -3
- package/dist/lib/node-esm/blueprint-definition-GVW67KGV.mjs +12 -0
- package/dist/lib/node-esm/blueprint-definition-GVW67KGV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-B3J2M4YL.mjs → chunk-CB2R4YIY.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-B3J2M4YL.mjs.map → chunk-CB2R4YIY.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-DVK63TD3.mjs +103 -0
- package/dist/lib/node-esm/chunk-DVK63TD3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6GCOJS4Y.mjs → chunk-FXILAQ5F.mjs} +7 -9
- package/dist/lib/node-esm/chunk-FXILAQ5F.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YGNVDYMB.mjs → chunk-J7A6TUB2.mjs} +4 -3
- package/dist/lib/node-esm/chunk-J7A6TUB2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JC2YWB5D.mjs +24 -0
- package/dist/lib/node-esm/chunk-JC2YWB5D.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LZK3TLKM.mjs → chunk-O6EXWGGS.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-RCIXKCVG.mjs → chunk-VCG2U522.mjs} +2 -4
- package/dist/lib/node-esm/{chunk-RCIXKCVG.mjs.map → chunk-VCG2U522.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +28 -17
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-L2UGZ72W.mjs → intent-resolver-2I5HKCUU.mjs} +18 -16
- package/dist/lib/node-esm/intent-resolver-2I5HKCUU.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-3JJSTTQP.mjs → react-surface-YZSZFR5D.mjs} +38 -31
- package/dist/lib/node-esm/react-surface-YZSZFR5D.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-LBDWWPZJ.mjs → settings-CXGR6DH4.mjs} +3 -3
- package/dist/lib/node-esm/{state-UIHO2SFZ.mjs → state-NWMQ3XAI.mjs} +3 -3
- package/dist/lib/node-esm/state-NWMQ3XAI.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-RC44I2MI.mjs +75 -0
- package/dist/lib/node-esm/toolkit-RC44I2MI.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/MarkdownPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +1 -9
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +12 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +4 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts +7 -0
- package/dist/types/src/components/MarkdownCard/MarkdownCard.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownCard/MarkdownCard.stories.d.ts +10 -0
- package/dist/types/src/components/MarkdownCard/MarkdownCard.stories.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownCard/index.d.ts +4 -0
- package/dist/types/src/components/MarkdownCard/index.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownContainer.d.ts +1 -1
- package/dist/types/src/components/MarkdownContainer.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownContainer.stories.d.ts +50 -4
- package/dist/types/src/components/MarkdownContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts +110 -12
- package/dist/types/src/components/MarkdownEditor/MarkdownEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSettings/MarkdownSettings.d.ts.map +1 -1
- package/dist/types/src/components/Suggestions.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar.stories.d.ts +44 -7
- package/dist/types/src/components/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/extensions.d.ts +0 -2
- package/dist/types/src/extensions.d.ts.map +1 -1
- package/dist/types/src/functions/diff.d.ts +6 -0
- package/dist/types/src/functions/diff.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +3 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/open.d.ts +7 -0
- package/dist/types/src/functions/open.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Markdown.d.ts +2 -2
- package/dist/types/src/types/Markdown.d.ts.map +1 -1
- package/dist/types/src/types/MarkdownAction.d.ts +4 -13
- package/dist/types/src/types/MarkdownAction.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -47
- package/src/MarkdownPlugin.tsx +15 -6
- package/src/capabilities/app-graph-serializer.ts +2 -2
- package/src/capabilities/artifact-definition.ts +13 -18
- package/src/capabilities/blueprint-definition.ts +39 -0
- package/src/capabilities/capabilities.ts +1 -1
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/intent-resolver.ts +13 -13
- package/src/capabilities/react-surface.tsx +5 -4
- package/src/capabilities/state.ts +3 -2
- package/src/capabilities/toolkit.ts +47 -0
- package/src/components/{MarkdownPreview/MarkdownPreview.stories.tsx → MarkdownCard/MarkdownCard.stories.tsx} +14 -12
- package/src/components/{MarkdownPreview/MarkdownPreview.tsx → MarkdownCard/MarkdownCard.tsx} +4 -2
- package/src/components/MarkdownCard/index.ts +9 -0
- package/src/components/MarkdownContainer.stories.tsx +7 -7
- package/src/components/MarkdownContainer.tsx +4 -3
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +10 -7
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +21 -21
- package/src/components/MarkdownSettings/MarkdownSettings.tsx +77 -74
- package/src/components/Suggestions.stories.tsx +14 -16
- package/src/components/Toolbar.stories.tsx +18 -12
- package/src/components/index.ts +1 -1
- package/src/extensions.tsx +7 -35
- package/src/functions/diff.ts +35 -0
- package/src/functions/index.ts +6 -0
- package/src/functions/open.ts +30 -0
- package/src/hooks/useSelectCurrentThread.tsx +1 -1
- package/src/index.ts +3 -1
- package/src/meta.ts +0 -3
- package/src/translations.ts +1 -0
- package/src/types/Markdown.ts +2 -1
- package/src/types/MarkdownAction.ts +4 -5
- package/src/types/types.ts +1 -0
- package/dist/lib/browser/MarkdownContainer-NNBPE6A5.mjs.map +0 -7
- package/dist/lib/browser/MarkdownPreview-7VG3K24R.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-7VNP5PCP.mjs +0 -145
- package/dist/lib/browser/artifact-definition-7VNP5PCP.mjs.map +0 -7
- package/dist/lib/browser/chunk-K7ZFMSC4.mjs.map +0 -7
- package/dist/lib/browser/chunk-VCUKIILA.mjs +0 -20
- package/dist/lib/browser/chunk-VCUKIILA.mjs.map +0 -7
- package/dist/lib/browser/chunk-YHMGUSO7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-EBEF7WEI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-ZPMZT4VU.mjs.map +0 -7
- package/dist/lib/browser/state-ZA6PZPUI.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownContainer-Q6UO7DKT.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownPreview-UVWR2YK3.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-IRIILD7S.mjs +0 -146
- package/dist/lib/node-esm/artifact-definition-IRIILD7S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6GCOJS4Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-A7LLVI34.mjs +0 -22
- package/dist/lib/node-esm/chunk-A7LLVI34.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YGNVDYMB.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-L2UGZ72W.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-3JJSTTQP.mjs.map +0 -7
- package/dist/lib/node-esm/state-UIHO2SFZ.mjs.map +0 -7
- package/dist/types/src/components/MarkdownPreview/MarkdownPreview.d.ts +0 -6
- package/dist/types/src/components/MarkdownPreview/MarkdownPreview.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownPreview/MarkdownPreview.stories.d.ts +0 -10
- package/dist/types/src/components/MarkdownPreview/MarkdownPreview.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownPreview/index.d.ts +0 -4
- package/dist/types/src/components/MarkdownPreview/index.d.ts.map +0 -1
- package/src/components/MarkdownPreview/index.ts +0 -9
- /package/dist/lib/browser/{anchor-sort-Z7JQA7RL.mjs.map → anchor-sort-E33BSTYF.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-VMX5SDGW.mjs.map → chunk-LAVZ2W6X.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-MBDK4TWE.mjs.map → settings-AABBTB4Q.mjs.map} +0 -0
- /package/dist/lib/node-esm/{anchor-sort-R6AAKYNG.mjs.map → anchor-sort-ALP2NH24.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-LZK3TLKM.mjs.map → chunk-O6EXWGGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-LBDWWPZJ.mjs.map → settings-CXGR6DH4.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-markdown",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dedc0f3",
|
|
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",
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
-
"source": "./src/index.ts"
|
|
16
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
17
|
},
|
|
18
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
19
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
20
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
21
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
22
|
-
"source": "./src/types/index.ts"
|
|
22
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -36,56 +36,59 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@automerge/automerge": "3.1.1",
|
|
39
|
-
"@codemirror/search": "^6.5.
|
|
40
|
-
"@codemirror/view": "^6.
|
|
39
|
+
"@codemirror/search": "^6.5.11",
|
|
40
|
+
"@codemirror/view": "^6.38.2",
|
|
41
|
+
"@effect/ai": "0.25.2",
|
|
41
42
|
"@preact-signals/safe-react": "^0.9.0",
|
|
42
43
|
"@preact/signals-core": "^1.9.0",
|
|
43
44
|
"react-dropzone": "^14.2.3",
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/echo-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/plugin-
|
|
60
|
-
"@dxos/plugin-
|
|
61
|
-
"@dxos/plugin-
|
|
62
|
-
"@dxos/plugin-
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/react-
|
|
68
|
-
"@dxos/react-ui-
|
|
69
|
-
"@dxos/react-ui-
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
45
|
+
"@dxos/ai": "0.8.4-main.dedc0f3",
|
|
46
|
+
"@dxos/app-framework": "0.8.4-main.dedc0f3",
|
|
47
|
+
"@dxos/assistant": "0.8.4-main.dedc0f3",
|
|
48
|
+
"@dxos/async": "0.8.4-main.dedc0f3",
|
|
49
|
+
"@dxos/echo": "0.8.4-main.dedc0f3",
|
|
50
|
+
"@dxos/blueprints": "0.8.4-main.dedc0f3",
|
|
51
|
+
"@dxos/echo-db": "0.8.4-main.dedc0f3",
|
|
52
|
+
"@dxos/echo-schema": "0.8.4-main.dedc0f3",
|
|
53
|
+
"@dxos/functions": "0.8.4-main.dedc0f3",
|
|
54
|
+
"@dxos/invariant": "0.8.4-main.dedc0f3",
|
|
55
|
+
"@dxos/lit-ui": "0.8.4-main.dedc0f3",
|
|
56
|
+
"@dxos/keys": "0.8.4-main.dedc0f3",
|
|
57
|
+
"@dxos/live-object": "0.8.4-main.dedc0f3",
|
|
58
|
+
"@dxos/local-storage": "0.8.4-main.dedc0f3",
|
|
59
|
+
"@dxos/log": "0.8.4-main.dedc0f3",
|
|
60
|
+
"@dxos/plugin-attention": "0.8.4-main.dedc0f3",
|
|
61
|
+
"@dxos/plugin-client": "0.8.4-main.dedc0f3",
|
|
62
|
+
"@dxos/plugin-deck": "0.8.4-main.dedc0f3",
|
|
63
|
+
"@dxos/plugin-graph": "0.8.4-main.dedc0f3",
|
|
64
|
+
"@dxos/plugin-preview": "0.8.4-main.dedc0f3",
|
|
65
|
+
"@dxos/plugin-theme": "0.8.4-main.dedc0f3",
|
|
66
|
+
"@dxos/plugin-space": "0.8.4-main.dedc0f3",
|
|
67
|
+
"@dxos/react-client": "0.8.4-main.dedc0f3",
|
|
68
|
+
"@dxos/react-hooks": "0.8.4-main.dedc0f3",
|
|
69
|
+
"@dxos/react-ui-attention": "0.8.4-main.dedc0f3",
|
|
70
|
+
"@dxos/react-ui-editor": "0.8.4-main.dedc0f3",
|
|
71
|
+
"@dxos/react-ui-form": "0.8.4-main.dedc0f3",
|
|
72
|
+
"@dxos/react-ui-stack": "0.8.4-main.dedc0f3",
|
|
73
|
+
"@dxos/schema": "0.8.4-main.dedc0f3",
|
|
74
|
+
"@dxos/util": "0.8.4-main.dedc0f3"
|
|
72
75
|
},
|
|
73
76
|
"devDependencies": {
|
|
74
77
|
"@effect-rx/rx-react": "0.38.0",
|
|
75
|
-
"@effect/platform": "0.
|
|
78
|
+
"@effect/platform": "0.90.2",
|
|
76
79
|
"@types/react": "~18.2.0",
|
|
77
80
|
"@types/react-dom": "~18.2.0",
|
|
78
|
-
"effect": "3.17.
|
|
81
|
+
"effect": "3.17.7",
|
|
79
82
|
"react": "~18.2.0",
|
|
80
83
|
"react-dom": "~18.2.0",
|
|
81
|
-
"vite": "
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
85
|
-
"@dxos/random": "0.8.4-main.
|
|
86
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
87
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
88
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
84
|
+
"vite": "7.1.1",
|
|
85
|
+
"@dxos/plugin-storybook-layout": "0.8.4-main.dedc0f3",
|
|
86
|
+
"@dxos/debug": "0.8.4-main.dedc0f3",
|
|
87
|
+
"@dxos/plugin-theme": "0.8.4-main.dedc0f3",
|
|
88
|
+
"@dxos/random": "0.8.4-main.dedc0f3",
|
|
89
|
+
"@dxos/react-ui": "0.8.4-main.dedc0f3",
|
|
90
|
+
"@dxos/react-ui-theme": "0.8.4-main.dedc0f3",
|
|
91
|
+
"@dxos/storybook-utils": "0.8.4-main.dedc0f3"
|
|
89
92
|
},
|
|
90
93
|
"peerDependencies": {
|
|
91
94
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -93,8 +96,8 @@
|
|
|
93
96
|
"effect": "^3.13.3",
|
|
94
97
|
"react": "~18.2.0",
|
|
95
98
|
"react-dom": "~18.2.0",
|
|
96
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
97
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
99
|
+
"@dxos/react-ui": "0.8.4-main.dedc0f3",
|
|
100
|
+
"@dxos/react-ui-theme": "0.8.4-main.dedc0f3"
|
|
98
101
|
},
|
|
99
102
|
"publishConfig": {
|
|
100
103
|
"access": "public"
|
package/src/MarkdownPlugin.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, createIntent, defineModule, definePlugin
|
|
5
|
+
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
import { type Obj, Ref } from '@dxos/echo';
|
|
7
7
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
8
8
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
@@ -14,11 +14,13 @@ import { DataType } from '@dxos/schema';
|
|
|
14
14
|
import {
|
|
15
15
|
AnchorSort,
|
|
16
16
|
AppGraphSerializer,
|
|
17
|
-
|
|
17
|
+
BLUEPRINT_KEY,
|
|
18
|
+
BlueprintDefinition,
|
|
18
19
|
IntentResolver,
|
|
19
|
-
MarkdownState,
|
|
20
20
|
MarkdownSettings,
|
|
21
|
+
MarkdownState,
|
|
21
22
|
ReactSurface,
|
|
23
|
+
Toolkit,
|
|
22
24
|
} from './capabilities';
|
|
23
25
|
import { MarkdownEvents } from './events';
|
|
24
26
|
import { meta } from './meta';
|
|
@@ -55,6 +57,7 @@ export const MarkdownPlugin = () =>
|
|
|
55
57
|
metadata: {
|
|
56
58
|
label: (object: Markdown.Document) => object.name || object.fallbackName,
|
|
57
59
|
icon: 'ph--text-aa--regular',
|
|
60
|
+
blueprints: [BLUEPRINT_KEY],
|
|
58
61
|
graphProps: {
|
|
59
62
|
managesAutofocus: true,
|
|
60
63
|
},
|
|
@@ -81,7 +84,7 @@ export const MarkdownPlugin = () =>
|
|
|
81
84
|
SpaceCapabilities.ObjectForm,
|
|
82
85
|
defineObjectForm({
|
|
83
86
|
objectSchema: Markdown.Document,
|
|
84
|
-
getIntent: (
|
|
87
|
+
getIntent: () => createIntent(MarkdownAction.Create, {}),
|
|
85
88
|
}),
|
|
86
89
|
),
|
|
87
90
|
}),
|
|
@@ -114,8 +117,14 @@ export const MarkdownPlugin = () =>
|
|
|
114
117
|
activate: AnchorSort,
|
|
115
118
|
}),
|
|
116
119
|
defineModule({
|
|
117
|
-
id: `${meta.id}/module/
|
|
120
|
+
id: `${meta.id}/module/blueprint`,
|
|
118
121
|
activatesOn: Events.SetupArtifactDefinition,
|
|
119
|
-
activate:
|
|
122
|
+
activate: BlueprintDefinition,
|
|
123
|
+
}),
|
|
124
|
+
defineModule({
|
|
125
|
+
id: `${meta.id}/module/toolkit`,
|
|
126
|
+
// TODO(wittjosiah): Use a different event.
|
|
127
|
+
activatesOn: Events.Startup,
|
|
128
|
+
activate: Toolkit,
|
|
120
129
|
}),
|
|
121
130
|
]);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { pipe } from 'effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, type PluginContext, chain, contributes, createIntent } from '@dxos/app-framework';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
10
10
|
import { isSpace } from '@dxos/react-client/echo';
|
|
@@ -43,7 +43,7 @@ export default (context: PluginContext) =>
|
|
|
43
43
|
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
44
44
|
const result = await dispatch(
|
|
45
45
|
pipe(
|
|
46
|
-
createIntent(MarkdownAction.Create, {
|
|
46
|
+
createIntent(MarkdownAction.Create, { name: data.name, content: data.data }),
|
|
47
47
|
chain(SpaceAction.AddObject, { target }),
|
|
48
48
|
),
|
|
49
49
|
);
|
|
@@ -2,36 +2,31 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// ISSUE(burdon): defineArtifact
|
|
6
|
+
// @ts-nocheck
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import {
|
|
8
|
+
import { Schema, pipe } from 'effect';
|
|
9
|
+
|
|
10
|
+
import { ToolResult, createTool } from '@dxos/ai';
|
|
11
|
+
import { Capabilities, chain, contributes, createIntent } from '@dxos/app-framework';
|
|
12
|
+
import { ArtifactId, createArtifactElement } from '@dxos/assistant';
|
|
10
13
|
import { defineArtifact } from '@dxos/blueprints';
|
|
11
14
|
import { Obj } from '@dxos/echo';
|
|
12
|
-
import {
|
|
15
|
+
import { assertArgument, invariant } from '@dxos/invariant';
|
|
13
16
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
14
|
-
import { Filter, fullyQualifiedId
|
|
17
|
+
import { Filter, fullyQualifiedId } from '@dxos/react-client/echo';
|
|
15
18
|
|
|
16
19
|
import { meta } from '../meta';
|
|
17
20
|
import { Markdown, MarkdownAction } from '../types';
|
|
18
21
|
|
|
19
|
-
// TODO(burdon): Factor out.
|
|
20
|
-
declare global {
|
|
21
|
-
interface ToolContextExtensions {
|
|
22
|
-
space?: Space;
|
|
23
|
-
dispatch?: PromiseIntentDispatcher;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
export default () => {
|
|
28
23
|
const definition = defineArtifact({
|
|
29
24
|
id: `artifact:${meta.id}`, // TODO(burdon): meta.id/artifact?
|
|
30
25
|
name: meta.name,
|
|
31
26
|
instructions: `
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
The markdown plugin allows you to work with text documents in the current space.
|
|
28
|
+
Use these tools to interact with documents, including listing available documents and retrieving their content.
|
|
29
|
+
Documents are stored in Markdown format.
|
|
35
30
|
`,
|
|
36
31
|
schema: Markdown.Document,
|
|
37
32
|
tools: [
|
|
@@ -99,7 +94,7 @@ export default () => {
|
|
|
99
94
|
execute: async ({ id }, { extensions }) => {
|
|
100
95
|
invariant(extensions?.space, 'No space');
|
|
101
96
|
const document = await extensions.space.db.query(Filter.ids(ArtifactId.toDXN(id).toString())).first();
|
|
102
|
-
assertArgument(Obj.instanceOf(Markdown.Document, document), 'Invalid type');
|
|
97
|
+
assertArgument(Obj.instanceOf(Markdown.Document, document), 'document', 'Invalid type');
|
|
103
98
|
|
|
104
99
|
const { content } = await document.content?.load();
|
|
105
100
|
return ToolResult.Success({
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
+
import { type FunctionDefinition } from '@dxos/functions';
|
|
8
|
+
import { trim } from '@dxos/util';
|
|
9
|
+
|
|
10
|
+
import { diff, open } from '../functions';
|
|
11
|
+
|
|
12
|
+
const functions: FunctionDefinition[] = [diff, open];
|
|
13
|
+
const tools = ['add-proposals', 'create-document'];
|
|
14
|
+
|
|
15
|
+
export const BLUEPRINT_KEY = 'dxos.org/blueprint/markdown';
|
|
16
|
+
|
|
17
|
+
export default (): Capability<any>[] => [
|
|
18
|
+
contributes(Capabilities.Functions, functions),
|
|
19
|
+
contributes(
|
|
20
|
+
Capabilities.BlueprintDefinition,
|
|
21
|
+
Blueprint.make({
|
|
22
|
+
key: BLUEPRINT_KEY,
|
|
23
|
+
name: 'Markdown',
|
|
24
|
+
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
25
|
+
instructions: Template.make({
|
|
26
|
+
source: trim`
|
|
27
|
+
You can create and update markdown documents.
|
|
28
|
+
When asked to edit or update documents return updates as a set of compact diff string pairs.
|
|
29
|
+
For each diff, respond with the smallest possible matching span.
|
|
30
|
+
For example:
|
|
31
|
+
- "There is a tyop in this sentence."
|
|
32
|
+
+ "There is a typo in this sentence."
|
|
33
|
+
- "This id goof."
|
|
34
|
+
+ "This is good."
|
|
35
|
+
`,
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
),
|
|
39
|
+
];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type
|
|
6
|
+
import { type EditorStateStore, type EditorViewMode } from '@dxos/react-ui-editor';
|
|
7
7
|
|
|
8
8
|
import { meta } from '../meta';
|
|
9
9
|
import { type MarkdownExtensionProvider, type MarkdownPluginState } from '../types';
|
|
@@ -6,10 +6,12 @@ import { lazy } from '@dxos/app-framework';
|
|
|
6
6
|
|
|
7
7
|
export const AnchorSort = lazy(() => import('./anchor-sort'));
|
|
8
8
|
export const AppGraphSerializer = lazy(() => import('./app-graph-serializer'));
|
|
9
|
-
export const
|
|
9
|
+
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
10
10
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
11
11
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
12
12
|
export const MarkdownSettings = lazy(() => import('./settings'));
|
|
13
13
|
export const MarkdownState = lazy(() => import('./state'));
|
|
14
|
+
export const Toolkit = lazy(() => import('./toolkit'));
|
|
14
15
|
|
|
16
|
+
export * from './blueprint-definition';
|
|
15
17
|
export * from './capabilities';
|
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { next as A } from '@automerge/automerge';
|
|
6
|
-
import { Option,
|
|
6
|
+
import { Option, type Schema } from 'effect';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Capabilities,
|
|
10
10
|
CollaborationActions,
|
|
11
|
+
type PluginContext,
|
|
11
12
|
contributes,
|
|
12
13
|
createResolver,
|
|
13
|
-
type PluginContext,
|
|
14
14
|
} from '@dxos/app-framework';
|
|
15
15
|
import { Obj } from '@dxos/echo';
|
|
16
16
|
import { createDocAccessor, getRangeFromCursor } from '@dxos/react-client/echo';
|
|
17
17
|
|
|
18
|
-
import { MarkdownCapabilities } from './capabilities';
|
|
19
18
|
import { Markdown, MarkdownAction } from '../types';
|
|
20
19
|
|
|
20
|
+
import { MarkdownCapabilities } from './capabilities';
|
|
21
|
+
|
|
21
22
|
export default (context: PluginContext) =>
|
|
22
23
|
contributes(Capabilities.IntentResolver, [
|
|
23
24
|
createResolver({
|
|
@@ -34,23 +35,22 @@ export default (context: PluginContext) =>
|
|
|
34
35
|
},
|
|
35
36
|
}),
|
|
36
37
|
createResolver({
|
|
37
|
-
intent: CollaborationActions.
|
|
38
|
+
intent: CollaborationActions.AcceptProposal,
|
|
38
39
|
filter: (
|
|
39
40
|
data,
|
|
40
|
-
): data is Omit<Schema.Schema.Type<typeof CollaborationActions.
|
|
41
|
-
|
|
42
|
-
} => Obj.instanceOf(Markdown.Document, data.
|
|
43
|
-
resolve: async ({
|
|
44
|
-
const text = await
|
|
41
|
+
): data is Omit<Schema.Schema.Type<typeof CollaborationActions.AcceptProposal.fields.input>, 'subject'> & {
|
|
42
|
+
subject: Markdown.Document;
|
|
43
|
+
} => Obj.instanceOf(Markdown.Document, data.subject),
|
|
44
|
+
resolve: async ({ subject, anchor, proposal }) => {
|
|
45
|
+
const text = await subject.content.load();
|
|
45
46
|
const accessor = createDocAccessor(text, ['content']);
|
|
46
|
-
const { start, end } = pipe(
|
|
47
|
-
Option.fromNullable(at),
|
|
47
|
+
const { start, end } = Option.fromNullable(anchor).pipe(
|
|
48
48
|
Option.flatMap((at) => Option.fromNullable(getRangeFromCursor(accessor, at))),
|
|
49
|
+
// Fallback to the end of the document.
|
|
49
50
|
Option.getOrElse(() => ({ start: text.content.length - 1, end: text.content.length - 1 })),
|
|
50
51
|
);
|
|
51
52
|
accessor.handle.change((doc) => {
|
|
52
|
-
|
|
53
|
-
A.splice(doc, accessor.path.slice(), start, end - start, ref);
|
|
53
|
+
A.splice(doc, accessor.path.slice(), start, end - start, proposal.text);
|
|
54
54
|
});
|
|
55
55
|
},
|
|
56
56
|
}),
|
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
10
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
11
11
|
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
12
12
|
import { DataType } from '@dxos/schema';
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
import { MarkdownContainer, MarkdownSettings, MarkdownPreview } from '../components';
|
|
14
|
+
import { MarkdownCard, MarkdownContainer, MarkdownSettings } from '../components';
|
|
16
15
|
import { meta } from '../meta';
|
|
17
16
|
import { Markdown } from '../types';
|
|
18
17
|
import { isEditorModel } from '../util';
|
|
19
18
|
|
|
19
|
+
import { MarkdownCapabilities } from './capabilities';
|
|
20
|
+
|
|
20
21
|
export default () =>
|
|
21
22
|
contributes(Capabilities.ReactSurface, [
|
|
22
23
|
createSurface({
|
|
@@ -109,6 +110,6 @@ export default () =>
|
|
|
109
110
|
role: ['card--popover', 'card--intrinsic', 'card--extrinsic', 'card--transclusion', 'card'],
|
|
110
111
|
filter: (data): data is { subject: Markdown.Document | DataType.Text } =>
|
|
111
112
|
Obj.instanceOf(Markdown.Document, data.subject) || Obj.instanceOf(DataType.Text, data.subject),
|
|
112
|
-
component: ({ data, role }) => <
|
|
113
|
+
component: ({ data, role }) => <MarkdownCard {...data} role={role} />,
|
|
113
114
|
}),
|
|
114
115
|
]);
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
7
|
import { type EditorViewMode, createEditorStateStore } from '@dxos/react-ui-editor';
|
|
8
8
|
|
|
9
|
-
import { MarkdownCapabilities } from './capabilities';
|
|
10
9
|
import { meta } from '../meta';
|
|
11
10
|
import { type Markdown, type MarkdownPluginState } from '../types';
|
|
12
11
|
|
|
12
|
+
import { MarkdownCapabilities } from './capabilities';
|
|
13
|
+
|
|
13
14
|
export default (context: PluginContext) => {
|
|
14
15
|
const state = new LocalStorageStore<MarkdownPluginState>(meta.id, { extensionProviders: [], viewMode: {} });
|
|
15
16
|
state.prop({ key: 'viewMode', type: LocalStorageStore.json<{ [key: string]: EditorViewMode }>() });
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { AiTool, AiToolkit } from '@effect/ai';
|
|
6
|
+
import { Effect, Schema } from 'effect';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, type Capability, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { getActiveSpace } from '@dxos/plugin-space';
|
|
11
|
+
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
12
|
+
|
|
13
|
+
import { MarkdownAction } from '../types';
|
|
14
|
+
|
|
15
|
+
// TODO(burdon): Reconcile with functions (currently reuses plugin framework intents).
|
|
16
|
+
class Toolkit extends AiToolkit.make(
|
|
17
|
+
AiTool.make('create-document', {
|
|
18
|
+
description: 'Creates a new markdown document.',
|
|
19
|
+
parameters: {
|
|
20
|
+
name: Schema.optional(Schema.String),
|
|
21
|
+
content: Schema.optional(Schema.String),
|
|
22
|
+
},
|
|
23
|
+
// TODO(wittjosiah): Return document.
|
|
24
|
+
success: Schema.Any,
|
|
25
|
+
failure: Schema.Never,
|
|
26
|
+
}),
|
|
27
|
+
) {
|
|
28
|
+
static layer = (context: PluginContext) =>
|
|
29
|
+
Toolkit.toLayer({
|
|
30
|
+
'create-document': ({ name, content }) => {
|
|
31
|
+
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
32
|
+
const space = getActiveSpace(context);
|
|
33
|
+
invariant(space, 'No active space');
|
|
34
|
+
|
|
35
|
+
return Effect.gen(function* () {
|
|
36
|
+
const { object } = yield* dispatch(createIntent(MarkdownAction.Create, { name, content }));
|
|
37
|
+
yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space }));
|
|
38
|
+
return { id: object.id };
|
|
39
|
+
}).pipe(Effect.orDie);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default (context: PluginContext): Capability<any>[] => [
|
|
45
|
+
contributes(Capabilities.Toolkit, Toolkit),
|
|
46
|
+
contributes(Capabilities.ToolkitHandler, Toolkit.layer(context)),
|
|
47
|
+
];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
@@ -12,20 +12,21 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
12
12
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
13
13
|
import { faker } from '@dxos/random';
|
|
14
14
|
import { CardContainer } from '@dxos/react-ui-stack/testing';
|
|
15
|
-
import {
|
|
15
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
16
16
|
|
|
17
|
-
import { MarkdownPreview } from './MarkdownPreview';
|
|
18
17
|
import { translations } from '../../translations';
|
|
19
18
|
|
|
19
|
+
import { MarkdownCard } from './MarkdownCard';
|
|
20
|
+
|
|
20
21
|
faker.seed(1234);
|
|
21
22
|
|
|
22
|
-
const meta: Meta<typeof
|
|
23
|
-
title: '
|
|
24
|
-
component:
|
|
23
|
+
const meta: Meta<typeof MarkdownCard> = {
|
|
24
|
+
title: 'plugins/plugin-markdown/Card',
|
|
25
|
+
component: MarkdownCard,
|
|
25
26
|
render: ({ role, subject, ...args }) => {
|
|
26
27
|
return (
|
|
27
28
|
<CardContainer icon='ph--text-aa--regular' role={role}>
|
|
28
|
-
<
|
|
29
|
+
<MarkdownCard role={role} subject={subject} {...args} />
|
|
29
30
|
</CardContainer>
|
|
30
31
|
);
|
|
31
32
|
},
|
|
@@ -40,7 +41,8 @@ const meta: Meta<typeof MarkdownPreview> = {
|
|
|
40
41
|
layout: 'centered',
|
|
41
42
|
translations,
|
|
42
43
|
},
|
|
43
|
-
|
|
44
|
+
tags: ['cards'],
|
|
45
|
+
} satisfies Meta<typeof MarkdownCard>;
|
|
44
46
|
|
|
45
47
|
export default meta;
|
|
46
48
|
|
|
@@ -56,9 +58,9 @@ export const Popover: Story = {
|
|
|
56
58
|
},
|
|
57
59
|
};
|
|
58
60
|
|
|
59
|
-
export const
|
|
61
|
+
export const Intrinsic: Story = {
|
|
60
62
|
args: {
|
|
61
|
-
role: 'card--
|
|
63
|
+
role: 'card--intrinsic',
|
|
62
64
|
subject: Markdown.makeDocument({
|
|
63
65
|
name: faker.lorem.words(3),
|
|
64
66
|
content: faker.lorem.paragraphs(3),
|
|
@@ -66,9 +68,9 @@ export const Extrinsic: Story = {
|
|
|
66
68
|
},
|
|
67
69
|
};
|
|
68
70
|
|
|
69
|
-
export const
|
|
71
|
+
export const Extrinsic: Story = {
|
|
70
72
|
args: {
|
|
71
|
-
role: 'card--
|
|
73
|
+
role: 'card--extrinsic',
|
|
72
74
|
subject: Markdown.makeDocument({
|
|
73
75
|
name: faker.lorem.words(3),
|
|
74
76
|
content: faker.lorem.paragraphs(3),
|
package/src/components/{MarkdownPreview/MarkdownPreview.tsx → MarkdownCard/MarkdownCard.tsx}
RENAMED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { pipe } from 'effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import { chain, createIntent,
|
|
8
|
+
import { LayoutAction, chain, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import { type PreviewProps } from '@dxos/plugin-preview';
|
|
11
11
|
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
@@ -35,7 +35,9 @@ const getSnippet = (subject: Markdown.Document | DataType.Text, fallback: string
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
export
|
|
38
|
+
export type MarkdownCardProps = PreviewProps<Markdown.Document | DataType.Text>;
|
|
39
|
+
|
|
40
|
+
export const MarkdownCard = ({ subject, role }: MarkdownCardProps) => {
|
|
39
41
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
40
42
|
const { t } = useTranslation(meta.id);
|
|
41
43
|
const snippet = getSnippet(subject, t('fallback abstract'));
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useMemo } from 'react';
|
|
9
9
|
|
|
10
|
-
import { Capabilities,
|
|
10
|
+
import { Capabilities, IntentPlugin, SettingsPlugin, Surface, contributes } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import { todo } from '@dxos/debug';
|
|
13
13
|
import { Query, Type } from '@dxos/echo';
|
|
@@ -22,7 +22,7 @@ import { faker } from '@dxos/random';
|
|
|
22
22
|
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
23
23
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
24
24
|
import { DataType } from '@dxos/schema';
|
|
25
|
-
import {
|
|
25
|
+
import { Testing, type ValueGenerator, createObjectFactory } from '@dxos/schema/testing';
|
|
26
26
|
import { withLayout } from '@dxos/storybook-utils';
|
|
27
27
|
|
|
28
28
|
import { MarkdownPlugin } from '../MarkdownPlugin';
|
|
@@ -41,7 +41,7 @@ const DefaultStory = () => {
|
|
|
41
41
|
return <Surface role='article' data={data} />;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const meta
|
|
44
|
+
const meta = {
|
|
45
45
|
title: 'plugins/plugin-markdown/MarkdownContainer',
|
|
46
46
|
render: DefaultStory,
|
|
47
47
|
decorators: [
|
|
@@ -52,7 +52,7 @@ const meta: Meta<typeof DefaultStory> = {
|
|
|
52
52
|
StorybookLayoutPlugin(),
|
|
53
53
|
ClientPlugin({
|
|
54
54
|
types: [Markdown.Document, DataType.Text, Testing.Contact],
|
|
55
|
-
onClientInitialized: async (
|
|
55
|
+
onClientInitialized: async ({ client }) => {
|
|
56
56
|
await client.halo.createIdentity();
|
|
57
57
|
await client.spaces.waitUntilReady();
|
|
58
58
|
await client.spaces.default.waitUntilReady();
|
|
@@ -91,10 +91,10 @@ const meta: Meta<typeof DefaultStory> = {
|
|
|
91
91
|
translations,
|
|
92
92
|
controls: { disable: true },
|
|
93
93
|
},
|
|
94
|
-
}
|
|
94
|
+
} satisfies Meta<typeof Capabilities>;
|
|
95
95
|
|
|
96
96
|
export default meta;
|
|
97
97
|
|
|
98
|
-
type Story =
|
|
98
|
+
type Story = StoryObj<typeof meta>;
|
|
99
99
|
|
|
100
100
|
export const Default: Story = {};
|