@dxos/plugin-sheet 0.6.11 → 0.6.12-main.5a87ad5
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/SheetContainer-VISF3VUB.mjs +261 -0
- package/dist/lib/browser/SheetContainer-VISF3VUB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JRL5LGCE.mjs → chunk-QILRZNE5.mjs} +2 -5
- package/dist/lib/browser/chunk-QILRZNE5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FUAGSXA4.mjs → chunk-WZMOZKQZ.mjs} +9 -16
- package/dist/lib/browser/chunk-WZMOZKQZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-D5AGLXJP.mjs → chunk-Z2XOOC2R.mjs} +385 -678
- package/dist/lib/browser/chunk-Z2XOOC2R.mjs.map +7 -0
- package/dist/lib/browser/{SheetContainer-U4H5D34A.mjs → chunk-ZLJ2GRE2.mjs} +1151 -240
- package/dist/lib/browser/chunk-ZLJ2GRE2.mjs.map +7 -0
- package/dist/lib/browser/graph-4XFKIHRL.mjs +21 -0
- package/dist/lib/browser/graph-4XFKIHRL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +74 -60
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types.mjs +4 -6
- package/dist/lib/node/SheetContainer-2MEALQWW.cjs +279 -0
- package/dist/lib/node/SheetContainer-2MEALQWW.cjs.map +7 -0
- package/dist/lib/node/{SheetContainer-AXQV3ZT5.cjs → chunk-6DQABRGJ.cjs} +1182 -279
- package/dist/lib/node/chunk-6DQABRGJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-DSYKOI4E.cjs → chunk-AOP42UAA.cjs} +13 -21
- package/dist/lib/node/chunk-AOP42UAA.cjs.map +7 -0
- package/dist/lib/node/{chunk-BJ6ZD7MN.cjs → chunk-BNARJ5GM.cjs} +5 -18
- package/dist/lib/node/chunk-BNARJ5GM.cjs.map +7 -0
- package/dist/lib/node/{chunk-5KKJ4NPP.cjs → chunk-P5QYYEHQ.cjs} +388 -676
- package/dist/lib/node/chunk-P5QYYEHQ.cjs.map +7 -0
- package/dist/lib/node/graph-2LRDUXBZ.cjs +43 -0
- package/dist/lib/node/graph-2LRDUXBZ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +86 -66
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +3 -3
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +10 -12
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/SheetContainer-RPSUSXWS.mjs +262 -0
- package/dist/lib/node-esm/SheetContainer-RPSUSXWS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4MM7THJW.mjs +2944 -0
- package/dist/lib/node-esm/chunk-4MM7THJW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5RLTCIE2.mjs +2684 -0
- package/dist/lib/node-esm/chunk-5RLTCIE2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IU2L277A.mjs +17 -0
- package/dist/lib/node-esm/chunk-IU2L277A.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RR2AO4SM.mjs +76 -0
- package/dist/lib/node-esm/chunk-RR2AO4SM.mjs.map +7 -0
- package/dist/lib/node-esm/graph-WG5EKOMO.mjs +22 -0
- package/dist/lib/node-esm/graph-WG5EKOMO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +263 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +10 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +21 -0
- package/dist/lib/node-esm/types.mjs.map +7 -0
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/CellEditor.d.ts +23 -3
- package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts +2 -2
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/extension.d.ts +1 -1
- package/dist/types/src/components/CellEditor/extension.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +11 -0
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/index.d.ts +1 -3
- package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts +10 -0
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -0
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +9 -0
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -0
- package/dist/types/src/components/GridSheet/util.d.ts +7 -0
- package/dist/types/src/components/GridSheet/util.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts +5 -6
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/decorations.d.ts +24 -0
- package/dist/types/src/components/Sheet/decorations.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/grid.d.ts +2 -2
- package/dist/types/src/components/Sheet/grid.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/nav.d.ts +3 -3
- package/dist/types/src/components/Sheet/nav.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/sheet-context.d.ts +8 -7
- package/dist/types/src/components/Sheet/sheet-context.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/threads.d.ts +2 -0
- package/dist/types/src/components/Sheet/threads.d.ts.map +1 -0
- package/dist/types/src/components/SheetContainer.d.ts +2 -3
- package/dist/types/src/components/SheetContainer.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +19 -3
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +18 -13
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/defs/index.d.ts +3 -0
- package/dist/types/src/defs/index.d.ts.map +1 -0
- package/dist/types/src/{model → defs}/types.d.ts +8 -3
- package/dist/types/src/defs/types.d.ts.map +1 -0
- package/dist/types/src/defs/types.test.d.ts.map +1 -0
- package/dist/types/src/defs/util.d.ts +43 -0
- package/dist/types/src/defs/util.d.ts.map +1 -0
- package/dist/types/src/extensions/compute.d.ts +9 -0
- package/dist/types/src/extensions/compute.d.ts.map +1 -0
- package/dist/types/src/extensions/compute.stories.d.ts +26 -0
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/{components/ComputeGraph → graph}/async-function.d.ts +8 -2
- package/dist/types/src/graph/async-function.d.ts.map +1 -0
- package/dist/types/src/graph/compute-graph.d.ts +84 -0
- package/dist/types/src/graph/compute-graph.d.ts.map +1 -0
- package/dist/types/src/graph/compute-graph.stories.d.ts +10 -0
- package/dist/types/src/graph/compute-graph.stories.d.ts.map +1 -0
- package/dist/types/src/graph/compute-graph.test.d.ts +2 -0
- package/dist/types/src/graph/compute-graph.test.d.ts.map +1 -0
- package/dist/types/src/graph/compute-node.d.ts +26 -0
- package/dist/types/src/graph/compute-node.d.ts.map +1 -0
- package/dist/types/src/graph/edge-function.d.ts.map +1 -0
- package/dist/types/src/{model/functions.d.ts → graph/function-defs.d.ts} +1 -1
- package/dist/types/src/graph/function-defs.d.ts.map +1 -0
- package/dist/types/src/graph/hyperformula.test.d.ts +2 -0
- package/dist/types/src/graph/hyperformula.test.d.ts.map +1 -0
- package/dist/types/src/graph/index.d.ts +4 -0
- package/dist/types/src/graph/index.d.ts.map +1 -0
- package/dist/types/src/{components/ComputeGraph/custom.d.ts → graph/testing/custom-function.d.ts} +4 -2
- package/dist/types/src/graph/testing/custom-function.d.ts.map +1 -0
- package/dist/types/src/graph/testing/index.d.ts +2 -0
- package/dist/types/src/graph/testing/index.d.ts.map +1 -0
- package/dist/types/src/graph/util.d.ts +2 -0
- package/dist/types/src/graph/util.d.ts.map +1 -0
- package/dist/types/src/hooks/hooks.stories.d.ts +11 -0
- package/dist/types/src/hooks/hooks.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeGraph.d.ts +7 -0
- package/dist/types/src/hooks/useComputeGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useFormattingModel.d.ts +3 -0
- package/dist/types/src/hooks/useFormattingModel.d.ts.map +1 -0
- package/dist/types/src/hooks/useSheetModel.d.ts +8 -0
- package/dist/types/src/hooks/useSheetModel.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +1 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/formatting-model.d.ts +16 -0
- package/dist/types/src/model/formatting-model.d.ts.map +1 -0
- package/dist/types/src/model/index.d.ts +2 -3
- package/dist/types/src/model/index.d.ts.map +1 -1
- package/dist/types/src/model/{model.d.ts → sheet-model.d.ts} +10 -65
- package/dist/types/src/model/sheet-model.d.ts.map +1 -0
- package/dist/types/src/sanity.test.d.ts +2 -0
- package/dist/types/src/sanity.test.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +8 -0
- package/dist/types/src/testing/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +17 -12
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +86 -5
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/vendor/hyperformula.mjs +37145 -0
- package/package.json +48 -41
- package/src/SheetPlugin.tsx +48 -73
- package/src/components/CellEditor/CellEditor.stories.tsx +5 -4
- package/src/components/CellEditor/CellEditor.tsx +59 -9
- package/src/components/CellEditor/extension.test.ts +4 -5
- package/src/components/CellEditor/extension.ts +1 -3
- package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +20 -0
- package/src/components/ComputeGraph/index.ts +1 -3
- package/src/components/GridSheet/GridSheet.stories.tsx +36 -0
- package/src/components/GridSheet/GridSheet.tsx +153 -0
- package/src/components/GridSheet/util.ts +108 -0
- package/src/components/Sheet/Sheet.stories.tsx +52 -88
- package/src/components/Sheet/Sheet.tsx +57 -18
- package/src/components/Sheet/decorations.ts +62 -0
- package/src/components/Sheet/grid.ts +3 -3
- package/src/components/Sheet/nav.ts +19 -19
- package/src/components/Sheet/sheet-context.tsx +18 -80
- package/src/components/Sheet/threads.tsx +205 -0
- package/src/components/SheetContainer.tsx +73 -19
- package/src/components/Toolbar/Toolbar.tsx +53 -12
- package/src/components/index.ts +1 -0
- package/src/defs/index.ts +6 -0
- package/src/{model → defs}/types.test.ts +8 -9
- package/src/{model → defs}/types.ts +24 -14
- package/src/defs/util.ts +151 -0
- package/src/extensions/compute.stories.tsx +153 -0
- package/src/extensions/compute.ts +131 -0
- package/src/extensions/index.ts +5 -0
- package/src/{components/ComputeGraph → graph}/async-function.ts +15 -6
- package/src/graph/compute-graph.stories.tsx +93 -0
- package/src/graph/compute-graph.test.ts +127 -0
- package/src/graph/compute-graph.ts +313 -0
- package/src/graph/compute-node.ts +62 -0
- package/src/{components/ComputeGraph → graph}/edge-function.ts +3 -3
- package/src/graph/hyperformula.test.ts +15 -0
- package/src/graph/index.ts +7 -0
- package/src/{components/ComputeGraph/custom.ts → graph/testing/custom-function.ts} +11 -7
- package/src/graph/testing/index.ts +5 -0
- package/src/graph/util.ts +8 -0
- package/src/hooks/hooks.stories.tsx +50 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useComputeGraph.ts +21 -0
- package/src/hooks/useFormattingModel.ts +11 -0
- package/src/hooks/useSheetModel.ts +40 -0
- package/src/meta.tsx +1 -5
- package/src/{components/Sheet/formatting.ts → model/formatting-model.ts} +20 -13
- package/src/model/index.ts +2 -3
- package/src/model/sheet-model.ts +414 -0
- package/src/sanity.test.ts +40 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/testing.tsx +68 -0
- package/src/translations.ts +6 -1
- package/src/types.ts +31 -6
- package/dist/lib/browser/SheetContainer-U4H5D34A.mjs.map +0 -7
- package/dist/lib/browser/chunk-APHOLYUB.mjs +0 -175
- package/dist/lib/browser/chunk-APHOLYUB.mjs.map +0 -7
- package/dist/lib/browser/chunk-D5AGLXJP.mjs.map +0 -7
- package/dist/lib/browser/chunk-FUAGSXA4.mjs.map +0 -7
- package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +0 -7
- package/dist/lib/browser/chunk-NU4PBN33.mjs +0 -8
- package/dist/lib/browser/chunk-NU4PBN33.mjs.map +0 -7
- package/dist/lib/browser/testing.mjs +0 -92
- package/dist/lib/browser/testing.mjs.map +0 -7
- package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs.map +0 -7
- package/dist/lib/node/chunk-5KKJ4NPP.cjs.map +0 -7
- package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +0 -7
- package/dist/lib/node/chunk-CN3RPESU.cjs +0 -202
- package/dist/lib/node/chunk-CN3RPESU.cjs.map +0 -7
- package/dist/lib/node/chunk-DSYKOI4E.cjs.map +0 -7
- package/dist/lib/node/chunk-PYXHNAAK.cjs +0 -40
- package/dist/lib/node/chunk-PYXHNAAK.cjs.map +0 -7
- package/dist/lib/node/testing.cjs +0 -111
- package/dist/lib/node/testing.cjs.map +0 -7
- package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/custom.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts +0 -12
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +0 -2
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/graph.d.ts +0 -26
- package/dist/types/src/components/ComputeGraph/graph.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/formatting.d.ts +0 -14
- package/dist/types/src/components/Sheet/formatting.d.ts.map +0 -1
- package/dist/types/src/model/functions.d.ts.map +0 -1
- package/dist/types/src/model/model.browser.test.d.ts +0 -2
- package/dist/types/src/model/model.browser.test.d.ts.map +0 -1
- package/dist/types/src/model/model.d.ts.map +0 -1
- package/dist/types/src/model/types.d.ts.map +0 -1
- package/dist/types/src/model/types.test.d.ts.map +0 -1
- package/dist/types/src/model/util.d.ts +0 -15
- package/dist/types/src/model/util.d.ts.map +0 -1
- package/dist/types/src/testing.d.ts +0 -9
- package/dist/types/src/testing.d.ts.map +0 -1
- package/src/components/ComputeGraph/graph-context.tsx +0 -50
- package/src/components/ComputeGraph/graph.browser.test.ts +0 -50
- package/src/components/ComputeGraph/graph.ts +0 -62
- package/src/model/model.browser.test.ts +0 -100
- package/src/model/model.ts +0 -550
- package/src/model/util.ts +0 -36
- package/src/testing.ts +0 -50
- /package/dist/types/src/{model → defs}/types.test.d.ts +0 -0
- /package/dist/types/src/{components/ComputeGraph → graph}/edge-function.d.ts +0 -0
- /package/src/{model/functions.ts → graph/function-defs.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12-main.5a87ad5",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
|
+
"imports": {
|
|
10
|
+
"#hyperformula": {
|
|
11
|
+
"types": "hyperformula",
|
|
12
|
+
"default": "./dist/vendor/hyperformula.mjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
9
15
|
"exports": {
|
|
10
16
|
".": {
|
|
11
17
|
"browser": "./dist/lib/browser/index.mjs",
|
|
12
18
|
"node": {
|
|
13
|
-
"
|
|
19
|
+
"require": "./dist/lib/node/index.cjs",
|
|
20
|
+
"default": "./dist/lib/node-esm/index.mjs"
|
|
14
21
|
},
|
|
15
22
|
"types": "./dist/types/src/index.d.ts"
|
|
16
23
|
},
|
|
17
24
|
"./meta": {
|
|
18
25
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
26
|
"node": {
|
|
20
|
-
"
|
|
27
|
+
"require": "./dist/lib/node/meta.cjs",
|
|
28
|
+
"default": "./dist/lib/node-esm/meta.mjs"
|
|
21
29
|
},
|
|
22
30
|
"types": "./dist/types/src/meta.d.ts"
|
|
23
31
|
},
|
|
24
|
-
"./testing": {
|
|
25
|
-
"browser": "./dist/lib/browser/testing.mjs",
|
|
26
|
-
"node": {
|
|
27
|
-
"default": "./dist/lib/node/testing.cjs"
|
|
28
|
-
},
|
|
29
|
-
"types": "./dist/types/src/testing.d.ts"
|
|
30
|
-
},
|
|
31
32
|
"./types": {
|
|
32
33
|
"browser": "./dist/lib/browser/types.mjs",
|
|
33
34
|
"node": {
|
|
34
|
-
"
|
|
35
|
+
"require": "./dist/lib/node/types.cjs",
|
|
36
|
+
"default": "./dist/lib/node-esm/types.mjs"
|
|
35
37
|
},
|
|
36
38
|
"types": "./dist/types/src/types.d.ts"
|
|
37
39
|
}
|
|
@@ -76,25 +78,29 @@
|
|
|
76
78
|
"re-resizable": "^6.9.17",
|
|
77
79
|
"react-markdown": "^8.0.5",
|
|
78
80
|
"react-resize-detector": "^11.0.1",
|
|
79
|
-
"@dxos/app-framework": "0.6.
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/context": "0.6.
|
|
82
|
-
"@dxos/client": "0.6.
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/echo-schema": "0.6.
|
|
86
|
-
"@dxos/invariant": "0.6.
|
|
87
|
-
"@dxos/keys": "0.6.
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/plugin-
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/plugin-
|
|
93
|
-
"@dxos/plugin-
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/react-
|
|
97
|
-
"@dxos/
|
|
81
|
+
"@dxos/app-framework": "0.6.12-main.5a87ad5",
|
|
82
|
+
"@dxos/crypto": "0.6.12-main.5a87ad5",
|
|
83
|
+
"@dxos/context": "0.6.12-main.5a87ad5",
|
|
84
|
+
"@dxos/client": "0.6.12-main.5a87ad5",
|
|
85
|
+
"@dxos/debug": "0.6.12-main.5a87ad5",
|
|
86
|
+
"@dxos/async": "0.6.12-main.5a87ad5",
|
|
87
|
+
"@dxos/echo-schema": "0.6.12-main.5a87ad5",
|
|
88
|
+
"@dxos/invariant": "0.6.12-main.5a87ad5",
|
|
89
|
+
"@dxos/keys": "0.6.12-main.5a87ad5",
|
|
90
|
+
"@dxos/log": "0.6.12-main.5a87ad5",
|
|
91
|
+
"@dxos/plugin-attention": "0.6.12-main.5a87ad5",
|
|
92
|
+
"@dxos/plugin-markdown": "0.6.12-main.5a87ad5",
|
|
93
|
+
"@dxos/plugin-client": "0.6.12-main.5a87ad5",
|
|
94
|
+
"@dxos/plugin-graph": "0.6.12-main.5a87ad5",
|
|
95
|
+
"@dxos/plugin-script": "0.6.12-main.5a87ad5",
|
|
96
|
+
"@dxos/plugin-space": "0.6.12-main.5a87ad5",
|
|
97
|
+
"@dxos/plugin-stack": "0.6.12-main.5a87ad5",
|
|
98
|
+
"@dxos/react-client": "0.6.12-main.5a87ad5",
|
|
99
|
+
"@dxos/react-ui-editor": "0.6.12-main.5a87ad5",
|
|
100
|
+
"@dxos/react-ui-attention": "0.6.12-main.5a87ad5",
|
|
101
|
+
"@dxos/react-hooks": "0.6.12-main.5a87ad5",
|
|
102
|
+
"@dxos/react-ui-grid": "0.6.12-main.5a87ad5",
|
|
103
|
+
"@dxos/util": "0.6.12-main.5a87ad5"
|
|
98
104
|
},
|
|
99
105
|
"devDependencies": {
|
|
100
106
|
"@lezer/generator": "^1.7.1",
|
|
@@ -106,20 +112,21 @@
|
|
|
106
112
|
"@types/react-window": "^1.8.8",
|
|
107
113
|
"react": "~18.2.0",
|
|
108
114
|
"react-dom": "~18.2.0",
|
|
109
|
-
"vite": "
|
|
110
|
-
"@dxos/echo-generator": "0.6.
|
|
111
|
-
"@dxos/random": "0.6.
|
|
112
|
-
"@dxos/react-ui": "0.6.
|
|
113
|
-
"@dxos/react-ui-
|
|
114
|
-
"@dxos/
|
|
115
|
-
"@dxos/react-ui-
|
|
115
|
+
"vite": "5.4.7",
|
|
116
|
+
"@dxos/echo-generator": "0.6.12-main.5a87ad5",
|
|
117
|
+
"@dxos/random": "0.6.12-main.5a87ad5",
|
|
118
|
+
"@dxos/react-ui": "0.6.12-main.5a87ad5",
|
|
119
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.12-main.5a87ad5",
|
|
120
|
+
"@dxos/react-ui-theme": "0.6.12-main.5a87ad5",
|
|
121
|
+
"@dxos/react-ui-types": "0.6.12-main.5a87ad5",
|
|
122
|
+
"@dxos/storybook-utils": "0.6.12-main.5a87ad5"
|
|
116
123
|
},
|
|
117
124
|
"optionalDependencies": {
|
|
118
125
|
"@phosphor-icons/react": "^2.1.5",
|
|
119
|
-
"react": "
|
|
120
|
-
"react-dom": "
|
|
121
|
-
"@dxos/react-ui
|
|
122
|
-
"@dxos/react-ui": "0.6.
|
|
126
|
+
"react": "~18.2.0",
|
|
127
|
+
"react-dom": "~18.2.0",
|
|
128
|
+
"@dxos/react-ui": "0.6.12-main.5a87ad5",
|
|
129
|
+
"@dxos/react-ui-theme": "0.6.12-main.5a87ad5"
|
|
123
130
|
},
|
|
124
131
|
"publishConfig": {
|
|
125
132
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -2,84 +2,70 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { GridNine } from '@phosphor-icons/react';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
parseIntentPlugin,
|
|
11
|
-
resolvePlugin,
|
|
12
|
-
type PluginDefinition,
|
|
13
|
-
type LayoutCoordinate,
|
|
14
|
-
} from '@dxos/app-framework';
|
|
15
|
-
import { create } from '@dxos/echo-schema';
|
|
8
|
+
import { NavigationAction, parseIntentPlugin, resolvePlugin, type PluginDefinition } from '@dxos/app-framework';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
16
10
|
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
17
|
-
import {
|
|
11
|
+
import { createExtension, isActionGroup, type ActionGroup } from '@dxos/plugin-graph';
|
|
18
12
|
import { FunctionType } from '@dxos/plugin-script/types';
|
|
19
13
|
import { SpaceAction } from '@dxos/plugin-space';
|
|
20
14
|
import { getSpace, isEchoObject } from '@dxos/react-client/echo';
|
|
21
15
|
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
SheetContainer,
|
|
27
|
-
type ComputeGraph,
|
|
28
|
-
} from './components';
|
|
29
|
-
// TODO(wittjosiah): Refactor. These are not exported from ./components due to depending on ECHO.
|
|
30
|
-
import { EdgeFunctionPlugin, EdgeFunctionPluginTranslations } from './components/ComputeGraph/edge-function';
|
|
31
|
-
import { ComputeGraphContextProvider } from './components/ComputeGraph/graph-context';
|
|
16
|
+
import { ComputeGraphContextProvider, SheetContainer } from './components';
|
|
17
|
+
import { compareIndexPositions, createSheet } from './defs';
|
|
18
|
+
import { type ComputeGraphRegistry } from './graph';
|
|
19
|
+
import { useComputeGraph } from './hooks';
|
|
32
20
|
import meta, { SHEET_PLUGIN } from './meta';
|
|
33
|
-
import { SheetModel } from './model';
|
|
34
21
|
import translations from './translations';
|
|
35
|
-
import {
|
|
22
|
+
import { SheetAction, SheetType, type SheetPluginProvides } from './types';
|
|
36
23
|
|
|
37
24
|
export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
const graphs = create<Record<string, ComputeGraph>>({});
|
|
41
|
-
const setGraph = (key: string, graph: ComputeGraph) => {
|
|
42
|
-
graphs[key] = graph;
|
|
43
|
-
};
|
|
25
|
+
let graphRegistry: ComputeGraphRegistry | undefined;
|
|
44
26
|
|
|
45
27
|
return {
|
|
46
28
|
meta,
|
|
47
29
|
ready: async (plugins) => {
|
|
48
30
|
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
31
|
+
invariant(client);
|
|
32
|
+
let remoteFunctionUrl: string | undefined;
|
|
53
33
|
if (client.config.values.runtime?.services?.edge?.url) {
|
|
54
34
|
const url = new URL('/functions', client.config.values.runtime?.services?.edge?.url);
|
|
55
35
|
url.protocol = 'https';
|
|
56
36
|
remoteFunctionUrl = url.toString();
|
|
57
37
|
}
|
|
38
|
+
|
|
39
|
+
// Async import removes direct dependency on hyperformula.
|
|
40
|
+
const { ComputeGraphRegistry } = await import('./graph');
|
|
41
|
+
graphRegistry = new ComputeGraphRegistry({ remoteFunctionUrl });
|
|
58
42
|
},
|
|
59
43
|
provides: {
|
|
60
44
|
context: ({ children }) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{children}
|
|
64
|
-
</ComputeGraphContextProvider>
|
|
65
|
-
);
|
|
45
|
+
invariant(graphRegistry);
|
|
46
|
+
return <ComputeGraphContextProvider registry={graphRegistry}>{children}</ComputeGraphContextProvider>;
|
|
66
47
|
},
|
|
67
48
|
metadata: {
|
|
68
49
|
records: {
|
|
69
50
|
[SheetType.typename]: {
|
|
70
|
-
label: (object: any) => (object instanceof SheetType ? object.
|
|
51
|
+
label: (object: any) => (object instanceof SheetType ? object.name : undefined),
|
|
71
52
|
placeholder: ['sheet title placeholder', { ns: SHEET_PLUGIN }],
|
|
72
|
-
icon:
|
|
73
|
-
iconSymbol: 'ph--grid-nine--regular',
|
|
53
|
+
icon: 'ph--grid-nine--regular',
|
|
74
54
|
},
|
|
75
55
|
},
|
|
76
56
|
},
|
|
77
57
|
translations,
|
|
78
58
|
echo: {
|
|
79
59
|
// TODO(wittjosiah): Factor out to common package/plugin.
|
|
80
|
-
//
|
|
60
|
+
// FunctionType is currently registered here in case script plugin isn't enabled.
|
|
81
61
|
schema: [SheetType, FunctionType],
|
|
82
62
|
},
|
|
63
|
+
space: {
|
|
64
|
+
onSpaceCreate: {
|
|
65
|
+
label: ['create sheet label', { ns: SHEET_PLUGIN }],
|
|
66
|
+
action: SheetAction.CREATE,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
83
69
|
graph: {
|
|
84
70
|
builder: (plugins) => {
|
|
85
71
|
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
@@ -113,8 +99,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
113
99
|
},
|
|
114
100
|
properties: {
|
|
115
101
|
label: ['create sheet label', { ns: SHEET_PLUGIN }],
|
|
116
|
-
icon:
|
|
117
|
-
iconSymbol: 'ph--grid-nine--regular',
|
|
102
|
+
icon: 'ph--grid-nine--regular',
|
|
118
103
|
testId: 'sheetPlugin.createObject',
|
|
119
104
|
},
|
|
120
105
|
},
|
|
@@ -123,6 +108,15 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
123
108
|
});
|
|
124
109
|
},
|
|
125
110
|
},
|
|
111
|
+
markdown: {
|
|
112
|
+
// TODO(burdon): Facet to get current space/compute graph.
|
|
113
|
+
extensions: ({ document }) => {
|
|
114
|
+
return undefined;
|
|
115
|
+
// return [
|
|
116
|
+
// compute(document)
|
|
117
|
+
// ];
|
|
118
|
+
},
|
|
119
|
+
},
|
|
126
120
|
stack: {
|
|
127
121
|
creators: [
|
|
128
122
|
{
|
|
@@ -138,23 +132,20 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
138
132
|
},
|
|
139
133
|
],
|
|
140
134
|
},
|
|
135
|
+
thread: {
|
|
136
|
+
predicate: (data) => data instanceof SheetType,
|
|
137
|
+
createSort: (sheet) => (indexA, indexB) =>
|
|
138
|
+
!indexA || !indexB ? 0 : compareIndexPositions(sheet, indexA, indexB),
|
|
139
|
+
},
|
|
141
140
|
surface: {
|
|
142
|
-
component: ({ data, role
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
141
|
+
component: ({ data, role }) => {
|
|
142
|
+
const space = isEchoObject(data.object) ? getSpace(data.object) : undefined;
|
|
143
|
+
const graph = useComputeGraph(space);
|
|
144
|
+
if (graph && data.object instanceof SheetType) {
|
|
146
145
|
switch (role) {
|
|
147
146
|
case 'article':
|
|
148
147
|
case 'section': {
|
|
149
|
-
return
|
|
150
|
-
<SheetContainer
|
|
151
|
-
sheet={data.object}
|
|
152
|
-
space={space}
|
|
153
|
-
role={role}
|
|
154
|
-
coordinate={data.coordinate as LayoutCoordinate}
|
|
155
|
-
remoteFunctionUrl={remoteFunctionUrl}
|
|
156
|
-
/>
|
|
157
|
-
);
|
|
148
|
+
return <SheetContainer graph={graph} sheet={data.object} role={role} />;
|
|
158
149
|
}
|
|
159
150
|
}
|
|
160
151
|
}
|
|
@@ -166,23 +157,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
166
157
|
resolver: async (intent) => {
|
|
167
158
|
switch (intent.action) {
|
|
168
159
|
case SheetAction.CREATE: {
|
|
169
|
-
|
|
170
|
-
const sheet = createSheet();
|
|
171
|
-
const graph =
|
|
172
|
-
graphs[space.id] ??
|
|
173
|
-
createComputeGraph(
|
|
174
|
-
[
|
|
175
|
-
{ plugin: EdgeFunctionPlugin, translations: EdgeFunctionPluginTranslations },
|
|
176
|
-
// TODO(wittjosiah): Remove. Needed for current test sheet generated data.
|
|
177
|
-
{ plugin: CustomPlugin, translations: CustomPluginTranslations },
|
|
178
|
-
],
|
|
179
|
-
space,
|
|
180
|
-
{ remoteFunctionUrl },
|
|
181
|
-
);
|
|
182
|
-
const model = new SheetModel(graph, sheet);
|
|
183
|
-
await model.initialize();
|
|
184
|
-
await model.destroy();
|
|
185
|
-
return { data: sheet };
|
|
160
|
+
return { data: createSheet() };
|
|
186
161
|
}
|
|
187
162
|
}
|
|
188
163
|
},
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { HyperFormula } from 'hyperformula';
|
|
8
7
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import { Client } from '@dxos/client';
|
|
@@ -12,10 +11,12 @@ import { createDocAccessor, type EchoReactiveObject } from '@dxos/client/echo';
|
|
|
12
11
|
import { automerge } from '@dxos/react-ui-editor';
|
|
13
12
|
import { withTheme } from '@dxos/storybook-utils';
|
|
14
13
|
|
|
14
|
+
import { HyperFormula } from '#hyperformula';
|
|
15
15
|
import { CellEditor, type CellEditorProps } from './CellEditor';
|
|
16
16
|
import { sheetExtension } from './extension';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { createSheet } from '../../defs';
|
|
18
|
+
import { defaultFunctions } from '../../graph';
|
|
19
|
+
import { SheetType } from '../../types';
|
|
19
20
|
|
|
20
21
|
export default {
|
|
21
22
|
title: 'plugin-sheet/CellEditor',
|
|
@@ -48,7 +49,7 @@ const AutomergeStory = ({ value, ...props }: StoryProps) => {
|
|
|
48
49
|
client.addTypes([SheetType]);
|
|
49
50
|
|
|
50
51
|
const sheet = createSheet();
|
|
51
|
-
sheet.
|
|
52
|
+
sheet.name = 'Test';
|
|
52
53
|
sheet.cells[cell] = { value };
|
|
53
54
|
space.db.add(sheet);
|
|
54
55
|
setObject(sheet);
|
|
@@ -14,10 +14,13 @@ import {
|
|
|
14
14
|
preventNewline,
|
|
15
15
|
useTextEditor,
|
|
16
16
|
} from '@dxos/react-ui-editor';
|
|
17
|
+
import { type GridEditBox } from '@dxos/react-ui-grid';
|
|
18
|
+
|
|
19
|
+
type EditorKeyEvent = Pick<KeyboardEvent<HTMLInputElement>, 'key'> & { shift?: boolean };
|
|
17
20
|
|
|
18
21
|
export type EditorKeysProps = {
|
|
19
|
-
onClose: (value: string | undefined) => void;
|
|
20
|
-
onNav?: (value: string | undefined,
|
|
22
|
+
onClose: (value: string | undefined, event: EditorKeyEvent) => void;
|
|
23
|
+
onNav?: (value: string | undefined, event: EditorKeyEvent) => void;
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
export const editorKeys = ({ onNav, onClose }: EditorKeysProps): Extension => {
|
|
@@ -57,14 +60,29 @@ export const editorKeys = ({ onNav, onClose }: EditorKeysProps): Extension => {
|
|
|
57
60
|
{
|
|
58
61
|
key: 'Enter',
|
|
59
62
|
run: (editor) => {
|
|
60
|
-
onClose(editor.state.doc.toString());
|
|
63
|
+
onClose(editor.state.doc.toString(), { key: 'Enter' });
|
|
64
|
+
return true;
|
|
65
|
+
},
|
|
66
|
+
shift: (editor) => {
|
|
67
|
+
onClose(editor.state.doc.toString(), { key: 'Enter', shift: true });
|
|
68
|
+
return true;
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
key: 'Tab',
|
|
73
|
+
run: (editor) => {
|
|
74
|
+
onClose(editor.state.doc.toString(), { key: 'Tab' });
|
|
75
|
+
return true;
|
|
76
|
+
},
|
|
77
|
+
shift: (editor) => {
|
|
78
|
+
onClose(editor.state.doc.toString(), { key: 'Tab', shift: true });
|
|
61
79
|
return true;
|
|
62
80
|
},
|
|
63
81
|
},
|
|
64
82
|
{
|
|
65
83
|
key: 'Escape',
|
|
66
84
|
run: () => {
|
|
67
|
-
onClose(undefined);
|
|
85
|
+
onClose(undefined, { key: 'Escape' });
|
|
68
86
|
return true;
|
|
69
87
|
},
|
|
70
88
|
},
|
|
@@ -74,10 +92,35 @@ export const editorKeys = ({ onNav, onClose }: EditorKeysProps): Extension => {
|
|
|
74
92
|
export type CellEditorProps = {
|
|
75
93
|
value?: string;
|
|
76
94
|
extension?: Extension;
|
|
95
|
+
variant?: keyof typeof editorVariants;
|
|
96
|
+
box?: GridEditBox;
|
|
97
|
+
gridId?: string;
|
|
77
98
|
} & Pick<UseTextEditorProps, 'autoFocus'> &
|
|
78
99
|
Pick<DOMAttributes<HTMLInputElement>, 'onBlur' | 'onKeyDown'>;
|
|
79
100
|
|
|
80
|
-
|
|
101
|
+
const editorVariants = {
|
|
102
|
+
// TODO(thure): remove when legacy is no longer used.
|
|
103
|
+
legacy: {
|
|
104
|
+
root: 'flex w-full',
|
|
105
|
+
editor: 'flex w-full [&>.cm-scroller]:scrollbar-none',
|
|
106
|
+
content: '!px-2 !py-1',
|
|
107
|
+
},
|
|
108
|
+
grid: {
|
|
109
|
+
root: 'absolute z-[1]',
|
|
110
|
+
editor: '[&>.cm-scroller]:scrollbar-none tabular-nums',
|
|
111
|
+
content: '!border !border-transparent !p-0.5',
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const CellEditor = ({
|
|
116
|
+
value,
|
|
117
|
+
extension,
|
|
118
|
+
autoFocus,
|
|
119
|
+
onBlur,
|
|
120
|
+
variant = 'legacy',
|
|
121
|
+
box,
|
|
122
|
+
gridId,
|
|
123
|
+
}: CellEditorProps) => {
|
|
81
124
|
const { themeMode } = useThemeContext();
|
|
82
125
|
const { parentRef } = useTextEditor(() => {
|
|
83
126
|
return {
|
|
@@ -98,16 +141,23 @@ export const CellEditor = ({ value, extension, autoFocus, onBlur }: CellEditorPr
|
|
|
98
141
|
themeMode,
|
|
99
142
|
slots: {
|
|
100
143
|
editor: {
|
|
101
|
-
className:
|
|
144
|
+
className: editorVariants[variant].editor,
|
|
102
145
|
},
|
|
103
146
|
content: {
|
|
104
|
-
className:
|
|
147
|
+
className: editorVariants[variant].content,
|
|
105
148
|
},
|
|
106
149
|
},
|
|
107
150
|
}),
|
|
108
151
|
],
|
|
109
152
|
};
|
|
110
|
-
}, [extension]);
|
|
153
|
+
}, [extension, autoFocus, value, variant, onBlur]);
|
|
111
154
|
|
|
112
|
-
return
|
|
155
|
+
return (
|
|
156
|
+
<div
|
|
157
|
+
ref={parentRef}
|
|
158
|
+
className={editorVariants[variant].root}
|
|
159
|
+
style={box}
|
|
160
|
+
{...(gridId && { 'data-grid': gridId })}
|
|
161
|
+
/>
|
|
162
|
+
);
|
|
113
163
|
};
|
|
@@ -6,12 +6,11 @@ import { CompletionContext, type CompletionSource } from '@codemirror/autocomple
|
|
|
6
6
|
import { EditorState } from '@codemirror/state';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import { testTree } from '@lezer/generator/test';
|
|
9
|
-
import { expect } from 'chai';
|
|
10
9
|
import { spreadsheet } from 'codemirror-lang-spreadsheet';
|
|
11
|
-
import { describe, test } from 'vitest';
|
|
10
|
+
import { describe, expect, test } from 'vitest';
|
|
12
11
|
|
|
13
12
|
import { sheetExtension } from './extension';
|
|
14
|
-
import { defaultFunctions } from '../../
|
|
13
|
+
import { defaultFunctions } from '../../graph';
|
|
15
14
|
|
|
16
15
|
describe('formula parser', () => {
|
|
17
16
|
const {
|
|
@@ -37,8 +36,8 @@ describe('formula parser', () => {
|
|
|
37
36
|
extensions: sheetExtension({ functions }),
|
|
38
37
|
});
|
|
39
38
|
|
|
40
|
-
const [
|
|
41
|
-
const result = await
|
|
39
|
+
const [fn] = state.languageDataAt<CompletionSource>('autocomplete', text.length);
|
|
40
|
+
const result = await fn(new CompletionContext(state, text.length, true));
|
|
42
41
|
expect(result?.options).to.have.length(1);
|
|
43
42
|
});
|
|
44
43
|
});
|
|
@@ -20,7 +20,7 @@ import { spreadsheet } from 'codemirror-lang-spreadsheet';
|
|
|
20
20
|
|
|
21
21
|
import { mx } from '@dxos/react-ui-theme';
|
|
22
22
|
|
|
23
|
-
import { type FunctionDefinition } from '../../
|
|
23
|
+
import { type FunctionDefinition } from '../../graph';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* https://codemirror.net/examples/styling
|
|
@@ -165,8 +165,6 @@ export const sheetExtension = ({ functions = [] }: SheetExtensionOptions): Exten
|
|
|
165
165
|
icons: false,
|
|
166
166
|
tooltipClass: () =>
|
|
167
167
|
mx(
|
|
168
|
-
// TODO(burdon): Factor out fragments.
|
|
169
|
-
// TODO(burdon): Size to make width same as column.
|
|
170
168
|
'!-left-[1px] !top-[33px] !-m-0 border !border-t-0 [&>ul]:!min-w-[198px]',
|
|
171
169
|
'[&>ul>li[aria-selected]]:!bg-accentSurface',
|
|
172
170
|
'border-separator',
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { createContext, type PropsWithChildren } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ComputeGraphRegistry } from '../../graph';
|
|
8
|
+
|
|
9
|
+
export type ComputeGraphContextType = {
|
|
10
|
+
registry: ComputeGraphRegistry;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The compute graph context manages a ComputeGraph for each space.
|
|
15
|
+
*/
|
|
16
|
+
export const ComputeGraphContext = createContext<ComputeGraphContextType | undefined>(undefined);
|
|
17
|
+
|
|
18
|
+
export const ComputeGraphContextProvider = ({ registry, children }: PropsWithChildren<ComputeGraphContextType>) => {
|
|
19
|
+
return <ComputeGraphContext.Provider value={{ registry }}>{children}</ComputeGraphContext.Provider>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
8
|
+
import { withClientProvider } from '@dxos/react-client/testing';
|
|
9
|
+
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { GridSheet } from './GridSheet';
|
|
12
|
+
import { useComputeGraph } from '../../hooks';
|
|
13
|
+
import { useTestSheet, withComputeGraphDecorator } from '../../testing';
|
|
14
|
+
import { SheetType } from '../../types';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: 'plugin-sheet/GridSheet',
|
|
18
|
+
component: GridSheet,
|
|
19
|
+
decorators: [
|
|
20
|
+
withClientProvider({ types: [SheetType], createSpace: true }),
|
|
21
|
+
withComputeGraphDecorator(),
|
|
22
|
+
withTheme,
|
|
23
|
+
withLayout({ fullscreen: true, tooltips: true }),
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Basic = () => {
|
|
28
|
+
const space = useSpace();
|
|
29
|
+
const graph = useComputeGraph(space);
|
|
30
|
+
const sheet = useTestSheet(space, graph);
|
|
31
|
+
if (!sheet || !space) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return <GridSheet graph={graph} sheet={sheet} />;
|
|
36
|
+
};
|