@dxos/plugin-sheet 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-KE3AKN5W.mjs → chunk-CBNIKBPQ.mjs} +21 -140
- package/dist/lib/browser/chunk-CBNIKBPQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-GZ2EV64I.mjs +118 -0
- package/dist/lib/browser/chunk-GZ2EV64I.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/drop-axis-PB7F3LBV.mjs +23 -0
- package/dist/lib/browser/drop-axis-PB7F3LBV.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +104 -86
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/insert-axis-DH5CO4AY.mjs +16 -0
- package/dist/lib/browser/insert-axis-DH5CO4AY.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/restore-axis-Y5H5IOC6.mjs +16 -0
- package/dist/lib/browser/restore-axis-Y5H5IOC6.mjs.map +7 -0
- package/dist/lib/browser/scroll-to-anchor-MN36E3X7.mjs +65 -0
- package/dist/lib/browser/scroll-to-anchor-MN36E3X7.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -3
- package/dist/lib/node-esm/{chunk-6J5L47IB.mjs → chunk-3ZYLQWHC.mjs} +21 -140
- package/dist/lib/node-esm/chunk-3ZYLQWHC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-74MOADQ7.mjs +119 -0
- package/dist/lib/node-esm/chunk-74MOADQ7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/drop-axis-UBBQCU6D.mjs +24 -0
- package/dist/lib/node-esm/drop-axis-UBBQCU6D.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +104 -86
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/insert-axis-S7BR2RSJ.mjs +17 -0
- package/dist/lib/node-esm/insert-axis-S7BR2RSJ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/restore-axis-6B25SOHX.mjs +17 -0
- package/dist/lib/node-esm/restore-axis-6B25SOHX.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-to-anchor-YLB4MYGF.mjs +66 -0
- package/dist/lib/node-esm/scroll-to-anchor-YLB4MYGF.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -3
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort.d.ts +6 -0
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry.d.ts +5 -0
- package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +9 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +6 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts +29 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/index.d.ts +2 -0
- package/dist/types/src/components/Sheet/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts +10 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +63 -0
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/index.d.ts +2 -0
- package/dist/types/src/components/SheetContent/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/util.d.ts.map +1 -0
- package/dist/types/src/components/{SheetContext/SheetContext.d.ts → SheetRoot/SheetRoot.d.ts} +7 -5
- package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -0
- package/dist/types/src/components/SheetRoot/index.d.ts +2 -0
- package/dist/types/src/components/SheetRoot/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +10 -0
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -0
- package/dist/types/src/components/SheetStatusbar/index.d.ts +2 -0
- package/dist/types/src/components/SheetStatusbar/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +9 -5
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +72 -68
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/align.d.ts +1 -1
- package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/style.d.ts +1 -1
- package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/RangeList/RangeList.d.ts +1 -1
- package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -0
- package/dist/types/src/containers/RangeList/index.d.ts +3 -0
- package/dist/types/src/containers/RangeList/index.d.ts.map +1 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts +12 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts.map +1 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts +58 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SheetContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts +0 -2
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +1 -1
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/model/testing.d.ts +1 -1
- package/dist/types/src/model/testing.d.ts.map +1 -1
- package/dist/types/src/model/useSheetModel.d.ts +1 -1
- package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +45 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/drop-axis.d.ts +5 -0
- package/dist/types/src/operations/drop-axis.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/insert-axis.d.ts +5 -0
- package/dist/types/src/operations/insert-axis.d.ts.map +1 -0
- package/dist/types/src/operations/restore-axis.d.ts +5 -0
- package/dist/types/src/operations/restore-axis.d.ts.map +1 -0
- package/dist/types/src/operations/scroll-to-anchor.d.ts +5 -0
- package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -0
- package/dist/types/src/serializer.d.ts +1 -1
- package/dist/types/src/serializer.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +1 -1
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +5 -5
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +38 -36
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Sheet.d.ts +7 -7
- package/dist/types/src/types/Sheet.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +12 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +0 -92
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +81 -63
- package/src/SheetPlugin.tsx +46 -28
- package/src/capabilities/{anchor-sort/anchor-sort.ts → anchor-sort.ts} +4 -3
- package/src/capabilities/{compute-graph-registry/compute-graph-registry.ts → compute-graph-registry.ts} +2 -2
- package/src/capabilities/index.ts +13 -5
- package/src/capabilities/{markdown/markdown.ts → markdown.ts} +2 -2
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +49 -0
- package/src/capabilities/state.ts +29 -0
- package/src/capabilities/undo-mappings.ts +30 -0
- package/src/components/ComputeGraph/compute-graph.stories.tsx +13 -8
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.tsx +6 -6
- package/src/components/{GridSheet/GridSheet.stories.tsx → SheetContent/SheetContent.stories.tsx} +15 -14
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +42 -22
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +4 -4
- package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +45 -38
- package/src/components/{GridSheet → SheetRoot}/index.ts +1 -1
- package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx} +19 -7
- package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +4 -4
- package/src/components/SheetToolbar/SheetToolbar.tsx +18 -21
- package/src/components/SheetToolbar/align.ts +13 -13
- package/src/components/SheetToolbar/style.ts +10 -10
- package/src/components/index.ts +1 -7
- package/src/{components → containers}/RangeList/RangeList.tsx +16 -15
- package/src/containers/RangeList/index.ts +7 -0
- package/src/{components → containers}/SheetContainer/SheetContainer.stories.tsx +38 -42
- package/src/containers/SheetContainer/SheetContainer.tsx +57 -0
- package/src/{components → containers}/SheetContainer/index.ts +1 -1
- package/src/containers/index.ts +8 -0
- package/src/extensions/compute.stories.tsx +13 -12
- package/src/extensions/editor/sheet-extension.ts +10 -10
- package/src/integrations/thread-ranges.ts +6 -39
- package/src/meta.ts +1 -1
- package/src/model/sheet-model.test.ts +3 -3
- package/src/model/sheet-model.ts +38 -36
- package/src/model/testing.ts +1 -1
- package/src/model/useSheetModel.ts +1 -1
- package/src/operations/definitions.ts +73 -0
- package/src/operations/drop-axis.ts +26 -0
- package/src/operations/index.ts +14 -0
- package/src/operations/insert-axis.ts +19 -0
- package/src/operations/restore-axis.ts +19 -0
- package/src/operations/scroll-to-anchor.ts +31 -0
- package/src/playwright/playwright.config.ts +1 -1
- package/src/playwright/sheet.spec.ts +1 -1
- package/src/sanity.test.ts +6 -3
- package/src/serializer.ts +1 -1
- package/src/testing/data.ts +1 -1
- package/src/testing/testing.tsx +2 -2
- package/src/translations.ts +38 -36
- package/src/types/Sheet.ts +13 -7
- package/src/types/capabilities.ts +14 -2
- package/src/types/sheet-range-types.ts +3 -3
- package/src/types/types.ts +0 -80
- package/dist/lib/browser/SheetContainer-J72HS2FI.mjs +0 -397
- package/dist/lib/browser/SheetContainer-J72HS2FI.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-LLO7PZKF.mjs +0 -23
- package/dist/lib/browser/anchor-sort-LLO7PZKF.mjs.map +0 -7
- package/dist/lib/browser/chunk-IFLWVS2V.mjs +0 -234
- package/dist/lib/browser/chunk-IFLWVS2V.mjs.map +0 -7
- package/dist/lib/browser/chunk-KE3AKN5W.mjs.map +0 -7
- package/dist/lib/browser/chunk-S27QJYTN.mjs +0 -1473
- package/dist/lib/browser/chunk-S27QJYTN.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-RC5L7RE4.mjs +0 -21
- package/dist/lib/browser/compute-graph-registry-RC5L7RE4.mjs.map +0 -7
- package/dist/lib/browser/markdown-D2T2DOVX.mjs +0 -29
- package/dist/lib/browser/markdown-D2T2DOVX.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-YDOW72CN.mjs +0 -79
- package/dist/lib/browser/operation-resolver-YDOW72CN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JIYVFH42.mjs +0 -51
- package/dist/lib/browser/react-surface-JIYVFH42.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-OGSSDOZU.mjs +0 -398
- package/dist/lib/node-esm/SheetContainer-OGSSDOZU.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-OX5I2YOW.mjs +0 -24
- package/dist/lib/node-esm/anchor-sort-OX5I2YOW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6J5L47IB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PPOYR7DK.mjs +0 -236
- package/dist/lib/node-esm/chunk-PPOYR7DK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Y4V6HVHO.mjs +0 -1474
- package/dist/lib/node-esm/chunk-Y4V6HVHO.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-ZGXVLVGD.mjs +0 -22
- package/dist/lib/node-esm/compute-graph-registry-ZGXVLVGD.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-PTV72DLO.mjs +0 -30
- package/dist/lib/node-esm/markdown-PTV72DLO.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-Q63VQBVA.mjs +0 -80
- package/dist/lib/node-esm/operation-resolver-Q63VQBVA.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SWRZSZVR.mjs +0 -52
- package/dist/lib/node-esm/react-surface-SWRZSZVR.mjs.map +0 -7
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +0 -5
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +0 -1
- package/dist/types/src/capabilities/anchor-sort/index.d.ts +0 -3
- package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts +0 -5
- package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-graph-registry/index.d.ts +0 -3
- package/dist/types/src/capabilities/compute-graph-registry/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +0 -3
- package/dist/types/src/capabilities/markdown/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown/markdown.d.ts +0 -5
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +0 -3
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +0 -1
- package/dist/types/src/components/FunctionEditor/index.d.ts +0 -2
- package/dist/types/src/components/FunctionEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts +0 -3
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +0 -55
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/index.d.ts +0 -2
- package/dist/types/src/components/GridSheet/index.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/util.d.ts.map +0 -1
- package/dist/types/src/components/RangeList/RangeList.d.ts.map +0 -1
- package/dist/types/src/components/RangeList/index.d.ts +0 -2
- package/dist/types/src/components/RangeList/index.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +0 -10
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +0 -57
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +0 -1
- package/dist/types/src/components/SheetContext/index.d.ts +0 -2
- package/dist/types/src/components/SheetContext/index.d.ts.map +0 -1
- package/src/capabilities/anchor-sort/index.ts +0 -7
- package/src/capabilities/compute-graph-registry/index.ts +0 -7
- package/src/capabilities/markdown/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -77
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -43
- package/src/components/SheetContainer/SheetContainer.tsx +0 -48
- package/src/components/SheetContext/index.ts +0 -5
- /package/dist/types/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.d.ts +0 -0
- /package/dist/types/src/components/{GridSheet → SheetContent}/util.d.ts +0 -0
- /package/dist/types/src/{components → containers}/SheetContainer/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.bcb3aa67d6",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,23 +12,41 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#meta": "./src/meta.ts",
|
|
20
|
+
"#operations": "./src/operations/index.ts",
|
|
21
|
+
"#testing": "./src/testing/index.ts",
|
|
22
|
+
"#types": "./src/types/index.ts"
|
|
23
|
+
},
|
|
15
24
|
"exports": {
|
|
16
25
|
".": {
|
|
26
|
+
"source": "./src/index.ts",
|
|
17
27
|
"browser": "./dist/lib/browser/index.mjs",
|
|
18
28
|
"node": "./dist/lib/node-esm/index.mjs",
|
|
19
|
-
"source": "./src/index.ts",
|
|
20
29
|
"types": "./dist/types/src/index.d.ts"
|
|
21
30
|
},
|
|
31
|
+
"./operations": {
|
|
32
|
+
"source": "./src/operations/index.ts",
|
|
33
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
34
|
+
"node": "./dist/lib/node-esm/operations/index.mjs",
|
|
35
|
+
"types": "./dist/types/src/operations/index.d.ts"
|
|
36
|
+
},
|
|
22
37
|
"./types": {
|
|
38
|
+
"source": "./src/types/index.ts",
|
|
23
39
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
24
40
|
"node": "./dist/lib/node-esm/types/index.mjs",
|
|
25
|
-
"source": "./src/types/index.ts",
|
|
26
41
|
"types": "./dist/types/src/types/index.d.ts"
|
|
27
42
|
}
|
|
28
43
|
},
|
|
29
44
|
"types": "dist/types/src/index.d.ts",
|
|
30
45
|
"typesVersions": {
|
|
31
46
|
"*": {
|
|
47
|
+
"operations": [
|
|
48
|
+
"dist/types/src/operations/index.d.ts"
|
|
49
|
+
],
|
|
32
50
|
"types": [
|
|
33
51
|
"dist/types/src/types/index.d.ts"
|
|
34
52
|
]
|
|
@@ -53,83 +71,83 @@
|
|
|
53
71
|
"@lezer/lr": "^1.4.2",
|
|
54
72
|
"@radix-ui/react-context": "1.1.1",
|
|
55
73
|
"codemirror-lang-spreadsheet": "^1.3.0",
|
|
56
|
-
"date-fns": "^3.
|
|
74
|
+
"date-fns": "^3.6.0",
|
|
57
75
|
"lodash.defaultsdeep": "^4.6.1",
|
|
58
76
|
"re-resizable": "^6.9.17",
|
|
59
77
|
"react-markdown": "^10.1.0",
|
|
60
78
|
"react-resize-detector": "^11.0.1",
|
|
61
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/context": "0.8.4-main.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/debug": "0.8.4-main.
|
|
69
|
-
"@dxos/echo
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/log": "0.8.4-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/plugin-
|
|
80
|
-
"@dxos/plugin-
|
|
81
|
-
"@dxos/plugin-
|
|
82
|
-
"@dxos/plugin-
|
|
83
|
-
"@dxos/plugin-
|
|
84
|
-
"@dxos/plugin-
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/react-
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/react-ui-
|
|
89
|
-
"@dxos/react-ui-
|
|
90
|
-
"@dxos/react-ui-
|
|
91
|
-
"@dxos/react-
|
|
92
|
-
"@dxos/react-ui-
|
|
93
|
-
"@dxos/react-ui-
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/react-ui-
|
|
96
|
-
"@dxos/ui-
|
|
97
|
-
"@dxos/schema": "0.8.4-main.
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/
|
|
79
|
+
"@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
|
|
80
|
+
"@dxos/async": "0.8.4-main.bcb3aa67d6",
|
|
81
|
+
"@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
82
|
+
"@dxos/client": "0.8.4-main.bcb3aa67d6",
|
|
83
|
+
"@dxos/context": "0.8.4-main.bcb3aa67d6",
|
|
84
|
+
"@dxos/compute": "0.8.4-main.bcb3aa67d6",
|
|
85
|
+
"@dxos/crypto": "0.8.4-main.bcb3aa67d6",
|
|
86
|
+
"@dxos/debug": "0.8.4-main.bcb3aa67d6",
|
|
87
|
+
"@dxos/echo": "0.8.4-main.bcb3aa67d6",
|
|
88
|
+
"@dxos/echo-db": "0.8.4-main.bcb3aa67d6",
|
|
89
|
+
"@dxos/invariant": "0.8.4-main.bcb3aa67d6",
|
|
90
|
+
"@dxos/keys": "0.8.4-main.bcb3aa67d6",
|
|
91
|
+
"@dxos/functions": "0.8.4-main.bcb3aa67d6",
|
|
92
|
+
"@dxos/log": "0.8.4-main.bcb3aa67d6",
|
|
93
|
+
"@dxos/lit-grid": "0.8.4-main.bcb3aa67d6",
|
|
94
|
+
"@dxos/operation": "0.8.4-main.bcb3aa67d6",
|
|
95
|
+
"@dxos/plugin-automation": "0.8.4-main.bcb3aa67d6",
|
|
96
|
+
"@dxos/plugin-attention": "0.8.4-main.bcb3aa67d6",
|
|
97
|
+
"@dxos/plugin-client": "0.8.4-main.bcb3aa67d6",
|
|
98
|
+
"@dxos/plugin-graph": "0.8.4-main.bcb3aa67d6",
|
|
99
|
+
"@dxos/plugin-script": "0.8.4-main.bcb3aa67d6",
|
|
100
|
+
"@dxos/plugin-markdown": "0.8.4-main.bcb3aa67d6",
|
|
101
|
+
"@dxos/plugin-deck": "0.8.4-main.bcb3aa67d6",
|
|
102
|
+
"@dxos/plugin-space": "0.8.4-main.bcb3aa67d6",
|
|
103
|
+
"@dxos/plugin-thread": "0.8.4-main.bcb3aa67d6",
|
|
104
|
+
"@dxos/react-hooks": "0.8.4-main.bcb3aa67d6",
|
|
105
|
+
"@dxos/plugin-stack": "0.8.4-main.bcb3aa67d6",
|
|
106
|
+
"@dxos/react-ui-attention": "0.8.4-main.bcb3aa67d6",
|
|
107
|
+
"@dxos/react-ui-form": "0.8.4-main.bcb3aa67d6",
|
|
108
|
+
"@dxos/react-ui-editor": "0.8.4-main.bcb3aa67d6",
|
|
109
|
+
"@dxos/react-client": "0.8.4-main.bcb3aa67d6",
|
|
110
|
+
"@dxos/react-ui-list": "0.8.4-main.bcb3aa67d6",
|
|
111
|
+
"@dxos/react-ui-grid": "0.8.4-main.bcb3aa67d6",
|
|
112
|
+
"@dxos/react-ui-menu": "0.8.4-main.bcb3aa67d6",
|
|
113
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bcb3aa67d6",
|
|
114
|
+
"@dxos/react-ui-stack": "0.8.4-main.bcb3aa67d6",
|
|
115
|
+
"@dxos/schema": "0.8.4-main.bcb3aa67d6",
|
|
116
|
+
"@dxos/types": "0.8.4-main.bcb3aa67d6",
|
|
117
|
+
"@dxos/util": "0.8.4-main.bcb3aa67d6",
|
|
118
|
+
"@dxos/ui-editor": "0.8.4-main.bcb3aa67d6"
|
|
100
119
|
},
|
|
101
120
|
"devDependencies": {
|
|
102
|
-
"@effect-atom/atom-react": "^0.
|
|
103
|
-
"@effect/platform": "0.
|
|
121
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
122
|
+
"@effect/platform": "0.94.4",
|
|
104
123
|
"@lezer/generator": "^1.7.1",
|
|
105
124
|
"@tldraw/indices": "^2.0.0-alpha.14",
|
|
106
125
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
107
126
|
"@types/react": "~19.2.7",
|
|
108
127
|
"@types/react-dom": "~19.2.3",
|
|
109
|
-
"
|
|
110
|
-
"effect": "3.19.11",
|
|
128
|
+
"effect": "3.20.0",
|
|
111
129
|
"react": "~19.2.3",
|
|
112
130
|
"react-dom": "~19.2.3",
|
|
113
|
-
"vite": "7.1.
|
|
114
|
-
"@dxos/
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/random": "0.8.4-main.
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
119
|
-
"@dxos/
|
|
120
|
-
"@dxos/
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
123
|
-
"@dxos/
|
|
131
|
+
"vite": "^7.1.11",
|
|
132
|
+
"@dxos/echo-generator": "0.8.4-main.bcb3aa67d6",
|
|
133
|
+
"@dxos/plugin-testing": "0.8.4-main.bcb3aa67d6",
|
|
134
|
+
"@dxos/random": "0.8.4-main.bcb3aa67d6",
|
|
135
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
136
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.bcb3aa67d6",
|
|
137
|
+
"@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
|
|
138
|
+
"@dxos/test-utils": "0.8.4-main.bcb3aa67d6",
|
|
139
|
+
"@dxos/ui-types": "0.8.4-main.bcb3aa67d6",
|
|
140
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6",
|
|
141
|
+
"@dxos/lit-grid": "0.8.4-main.bcb3aa67d6"
|
|
124
142
|
},
|
|
125
143
|
"peerDependencies": {
|
|
126
|
-
"@effect-atom/atom-react": "^0.
|
|
127
|
-
"@effect/platform": "0.
|
|
128
|
-
"effect": "3.
|
|
144
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
145
|
+
"@effect/platform": "0.94.4",
|
|
146
|
+
"effect": "3.20.0",
|
|
129
147
|
"react": "~19.2.3",
|
|
130
148
|
"react-dom": "~19.2.3",
|
|
131
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
132
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
149
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6",
|
|
150
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6"
|
|
133
151
|
},
|
|
134
152
|
"publishConfig": {
|
|
135
153
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -3,50 +3,70 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
|
|
7
|
-
import { ActivationEvent,
|
|
8
|
+
import { ActivationEvent, Plugin } from '@dxos/app-framework';
|
|
9
|
+
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Annotation } from '@dxos/echo';
|
|
8
11
|
import { Operation } from '@dxos/operation';
|
|
9
|
-
import { AutomationEvents } from '@dxos/plugin-automation';
|
|
10
|
-
import { ClientEvents } from '@dxos/plugin-client';
|
|
12
|
+
import { AutomationEvents } from '@dxos/plugin-automation/types';
|
|
13
|
+
import { ClientEvents } from '@dxos/plugin-client/types';
|
|
11
14
|
import { MarkdownEvents } from '@dxos/plugin-markdown';
|
|
12
|
-
import { SpaceCapabilities, SpaceEvents } from '@dxos/plugin-space';
|
|
13
15
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
16
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
14
17
|
|
|
15
|
-
import {
|
|
16
|
-
import { meta } from './meta';
|
|
18
|
+
import { meta } from '#meta';
|
|
17
19
|
import { serializer } from './serializer';
|
|
18
20
|
import { translations } from './translations';
|
|
19
|
-
import { Sheet
|
|
21
|
+
import { Sheet } from '#types';
|
|
22
|
+
import { SheetOperation } from '#operations';
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
AnchorSort,
|
|
26
|
+
ComputeGraphRegistry,
|
|
27
|
+
Markdown,
|
|
28
|
+
OperationHandler,
|
|
29
|
+
UndoMappings,
|
|
30
|
+
ReactSurface,
|
|
31
|
+
SheetState,
|
|
32
|
+
} from '#capabilities';
|
|
20
33
|
|
|
21
34
|
export const SheetPlugin = Plugin.define(meta).pipe(
|
|
22
|
-
|
|
23
|
-
activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, AutomationEvents.ComputeRuntimeReady),
|
|
24
|
-
activate: ComputeGraphRegistry,
|
|
25
|
-
}),
|
|
26
|
-
Common.Plugin.addTranslationsModule({ translations }),
|
|
27
|
-
Common.Plugin.addMetadataModule({
|
|
35
|
+
AppPlugin.addMetadataModule({
|
|
28
36
|
metadata: {
|
|
29
37
|
id: Sheet.Sheet.typename,
|
|
30
38
|
metadata: {
|
|
31
39
|
label: (object: Sheet.Sheet) => object.name,
|
|
32
|
-
icon:
|
|
33
|
-
iconHue: '
|
|
40
|
+
icon: Annotation.IconAnnotation.get(Sheet.Sheet).pipe(Option.getOrThrow).icon,
|
|
41
|
+
iconHue: Annotation.IconAnnotation.get(Sheet.Sheet).pipe(Option.getOrThrow).hue ?? 'white',
|
|
34
42
|
serializer,
|
|
35
43
|
comments: 'anchored',
|
|
36
|
-
createObject: ((props
|
|
44
|
+
createObject: ((props, options) =>
|
|
45
|
+
Effect.gen(function* () {
|
|
46
|
+
const object = Sheet.make(props);
|
|
47
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
48
|
+
object,
|
|
49
|
+
target: options.target,
|
|
50
|
+
hidden: true,
|
|
51
|
+
targetNodeId: options.targetNodeId,
|
|
52
|
+
});
|
|
53
|
+
})) satisfies CreateObject,
|
|
54
|
+
scrollToAnchor: SheetOperation.ScrollToAnchor,
|
|
37
55
|
},
|
|
38
56
|
},
|
|
39
57
|
}),
|
|
40
|
-
|
|
58
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
59
|
+
AppPlugin.addOperationHandlerModule({ id: 'undo-mappings', activate: UndoMappings }),
|
|
60
|
+
AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }),
|
|
61
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
62
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
41
63
|
Plugin.addModule({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
),
|
|
64
|
+
activatesOn: AppActivationEvents.SetupSettings,
|
|
65
|
+
activate: SheetState,
|
|
66
|
+
}),
|
|
67
|
+
Plugin.addModule({
|
|
68
|
+
activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, AutomationEvents.ComputeRuntimeReady),
|
|
69
|
+
activate: ComputeGraphRegistry,
|
|
50
70
|
}),
|
|
51
71
|
Plugin.addModule({
|
|
52
72
|
activatesOn: MarkdownEvents.SetupExtensions,
|
|
@@ -54,10 +74,8 @@ export const SheetPlugin = Plugin.define(meta).pipe(
|
|
|
54
74
|
}),
|
|
55
75
|
Plugin.addModule({
|
|
56
76
|
// TODO(wittjosiah): More relevant event?
|
|
57
|
-
activatesOn:
|
|
77
|
+
activatesOn: AppActivationEvents.AppGraphReady,
|
|
58
78
|
activate: AnchorSort,
|
|
59
79
|
}),
|
|
60
|
-
Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
|
|
61
|
-
Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
62
80
|
Plugin.make,
|
|
63
81
|
);
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { Relation } from '@dxos/echo';
|
|
9
10
|
|
|
10
|
-
import { Sheet, compareIndexPositions } from '
|
|
11
|
+
import { Sheet, compareIndexPositions } from '#types';
|
|
11
12
|
|
|
12
13
|
export default Capability.makeModule(() =>
|
|
13
14
|
Effect.succeed(
|
|
14
|
-
Capability.contributes(
|
|
15
|
+
Capability.contributes(AppCapabilities.AnchorSort, {
|
|
15
16
|
key: Sheet.Sheet.typename,
|
|
16
17
|
sort: (anchorA, anchorB) => {
|
|
17
18
|
const sheet = Relation.getTarget(anchorA) as Sheet.Sheet;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
8
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
9
9
|
|
|
10
|
-
import { SheetCapabilities } from '
|
|
10
|
+
import { SheetCapabilities } from '#types';
|
|
11
11
|
|
|
12
12
|
// Locally declare the Automation ComputeRuntime capability by ID to avoid direct import dependency.
|
|
13
13
|
|
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
|
|
9
|
+
export const ComputeGraphRegistry = Capability.lazy('ComputeGraphRegistry', () => import('./compute-graph-registry'));
|
|
10
|
+
export const Markdown = Capability.lazy('Markdown', () => import('./markdown'));
|
|
11
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
12
|
+
'OperationHandler',
|
|
13
|
+
() => import('./operation-handler'),
|
|
14
|
+
);
|
|
15
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
16
|
+
export const SheetState = Capability.lazy('SheetState', () => import('./state'));
|
|
17
|
+
export const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));
|
|
@@ -8,8 +8,8 @@ import { Capability } from '@dxos/app-framework';
|
|
|
8
8
|
import { getSpace } from '@dxos/client/echo';
|
|
9
9
|
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
10
10
|
|
|
11
|
-
import { computeGraphFacet } from '
|
|
12
|
-
import { SheetCapabilities } from '
|
|
11
|
+
import { computeGraphFacet } from '../extensions';
|
|
12
|
+
import { SheetCapabilities } from '#types';
|
|
13
13
|
|
|
14
14
|
export default Capability.makeModule(
|
|
15
15
|
Effect.fnUntraced(function* () {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { SheetOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, SheetOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useCapability } from '@dxos/app-framework/ui';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
12
|
+
|
|
13
|
+
import { RangeList, SheetContainer } from '#containers';
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
import { Sheet, SheetCapabilities } from '#types';
|
|
16
|
+
|
|
17
|
+
export default Capability.makeModule(() =>
|
|
18
|
+
Effect.succeed(
|
|
19
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
20
|
+
Surface.create({
|
|
21
|
+
id: `${meta.id}.sheet`,
|
|
22
|
+
role: ['article', 'section'],
|
|
23
|
+
filter: (data): data is { attendableId: string; subject: Sheet.Sheet } =>
|
|
24
|
+
typeof data.attendableId === 'string' &&
|
|
25
|
+
Obj.instanceOf(Sheet.Sheet, data.subject) &&
|
|
26
|
+
!!getSpace(data.subject),
|
|
27
|
+
component: ({ data, role }) => {
|
|
28
|
+
const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<SheetContainer
|
|
32
|
+
role={role}
|
|
33
|
+
subject={data.subject}
|
|
34
|
+
attendableId={data.attendableId}
|
|
35
|
+
space={getSpace(data.subject)!}
|
|
36
|
+
registry={computeGraphRegistry}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
Surface.create({
|
|
42
|
+
id: `${meta.id}.object-settings`,
|
|
43
|
+
role: 'object-settings',
|
|
44
|
+
filter: (data): data is { subject: Sheet.Sheet } => Obj.instanceOf(Sheet.Sheet, data.subject),
|
|
45
|
+
component: ({ data }) => <RangeList sheet={data.subject} />,
|
|
46
|
+
}),
|
|
47
|
+
]),
|
|
48
|
+
),
|
|
49
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { type GridEntry, type GridRegistry, SheetCapabilities } from '#types';
|
|
10
|
+
|
|
11
|
+
const createGridRegistry = (): GridRegistry => {
|
|
12
|
+
const grids = new Map<string, GridEntry>();
|
|
13
|
+
return {
|
|
14
|
+
register: (attendableId, grid, setActiveRefs) => {
|
|
15
|
+
grids.set(attendableId, { grid, setActiveRefs });
|
|
16
|
+
},
|
|
17
|
+
unregister: (attendableId) => {
|
|
18
|
+
grids.delete(attendableId);
|
|
19
|
+
},
|
|
20
|
+
get: (attendableId) => grids.get(attendableId),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Capability.makeModule(
|
|
25
|
+
Effect.fnUntraced(function* () {
|
|
26
|
+
const gridInstances = createGridRegistry();
|
|
27
|
+
return Capability.contributes(SheetCapabilities.GridInstances, gridInstances);
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability, UndoMapping } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { SheetOperation } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule(() =>
|
|
13
|
+
Effect.succeed(
|
|
14
|
+
Capability.contributes(Capabilities.UndoMapping, [
|
|
15
|
+
UndoMapping.make({
|
|
16
|
+
operation: SheetOperation.DropAxis,
|
|
17
|
+
inverse: SheetOperation.RestoreAxis,
|
|
18
|
+
deriveContext: (input, output) => ({
|
|
19
|
+
model: input.model,
|
|
20
|
+
axis: output.axis,
|
|
21
|
+
axisIndex: output.axisIndex,
|
|
22
|
+
index: output.index,
|
|
23
|
+
axisMeta: output.axisMeta,
|
|
24
|
+
values: output.values,
|
|
25
|
+
}),
|
|
26
|
+
message: ['axis-dropped.label', { ns: meta.id }],
|
|
27
|
+
}),
|
|
28
|
+
]),
|
|
29
|
+
),
|
|
30
|
+
);
|
|
@@ -7,7 +7,8 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { testFunctionPlugins } from '@dxos/compute/testing';
|
|
9
9
|
import { Filter } from '@dxos/echo';
|
|
10
|
-
import {
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
11
12
|
import { useSpace } from '@dxos/react-client/echo';
|
|
12
13
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
14
|
import { Button, Input, Toolbar } from '@dxos/react-ui';
|
|
@@ -15,8 +16,8 @@ import { withTheme } from '@dxos/react-ui/testing';
|
|
|
15
16
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
16
17
|
|
|
17
18
|
import { useSheetModel } from '../../model';
|
|
18
|
-
import { withComputeGraphDecorator } from '
|
|
19
|
-
import { Sheet } from '
|
|
19
|
+
import { withComputeGraphDecorator } from '#testing';
|
|
20
|
+
import { Sheet } from '#types';
|
|
20
21
|
|
|
21
22
|
import { useComputeGraph } from './ComputeGraphContextProvider';
|
|
22
23
|
|
|
@@ -44,14 +45,14 @@ const DefaultStory = () => {
|
|
|
44
45
|
setResult({ functions: { standard: f1.length, echo: f2.length } });
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
space.db.add(
|
|
48
|
+
space.db.add(Obj.make(Operation.PersistentOperation, { name: 'test', version: '0.0.1', binding: FUNCTION_NAME }));
|
|
48
49
|
}
|
|
49
50
|
}, [space, graph]);
|
|
50
51
|
|
|
51
52
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
52
53
|
const handleTest = async () => {
|
|
53
54
|
if (space && graph) {
|
|
54
|
-
const objects = await space.db.query(Filter.type(
|
|
55
|
+
const objects = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
|
|
55
56
|
const mapped = graph.mapFunctionBindingToId(text);
|
|
56
57
|
const unmapped = graph.mapFunctionBindingFromId(mapped);
|
|
57
58
|
const internal = graph.mapFormulaToNative(text);
|
|
@@ -84,11 +85,15 @@ const DefaultStory = () => {
|
|
|
84
85
|
export const Default: Story = {};
|
|
85
86
|
|
|
86
87
|
const meta = {
|
|
87
|
-
title: 'plugins/plugin-sheet/functions',
|
|
88
|
+
title: 'plugins/plugin-sheet/components/functions',
|
|
88
89
|
render: DefaultStory,
|
|
89
90
|
decorators: [
|
|
90
|
-
withTheme,
|
|
91
|
-
withClientProvider({
|
|
91
|
+
withTheme(),
|
|
92
|
+
withClientProvider({
|
|
93
|
+
types: [Operation.PersistentOperation, Sheet.Sheet],
|
|
94
|
+
createIdentity: true,
|
|
95
|
+
createSpace: true,
|
|
96
|
+
}),
|
|
92
97
|
withComputeGraphDecorator({ plugins: testFunctionPlugins }),
|
|
93
98
|
],
|
|
94
99
|
} satisfies Meta<typeof DefaultStory>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { SheetContent } from '../SheetContent';
|
|
6
|
+
import { SheetRoot } from '../SheetRoot';
|
|
7
|
+
import { SheetStatusbar } from '../SheetStatusbar';
|
|
8
|
+
import { SheetToolbar } from '../SheetToolbar';
|
|
9
|
+
|
|
10
|
+
export { useSheetContext, type SheetContextValue, type SheetRootProps } from '../SheetRoot';
|
|
11
|
+
export { type SheetContentProps } from '../SheetContent';
|
|
12
|
+
export { type SheetToolbarProps } from '../SheetToolbar';
|
|
13
|
+
export { type SheetStatusbarProps } from '../SheetStatusbar';
|
|
14
|
+
|
|
15
|
+
export const Sheet = {
|
|
16
|
+
Root: SheetRoot,
|
|
17
|
+
Toolbar: SheetToolbar,
|
|
18
|
+
Content: SheetContent,
|
|
19
|
+
Statusbar: SheetStatusbar,
|
|
20
|
+
};
|
|
@@ -16,7 +16,7 @@ import { CellEditor, type CellEditorProps } from '@dxos/react-ui-grid';
|
|
|
16
16
|
import { automerge } from '@dxos/ui-editor';
|
|
17
17
|
|
|
18
18
|
import { sheetExtension } from '../../extensions';
|
|
19
|
-
import { Sheet } from '
|
|
19
|
+
import { Sheet } from '#types';
|
|
20
20
|
|
|
21
21
|
const DefaultStory = ({ value, ...props }: CellEditorProps) => {
|
|
22
22
|
const extensions = useMemo(() => {
|
|
@@ -38,9 +38,9 @@ const AutomergeStory = ({ value, ...props }: CellEditorProps) => {
|
|
|
38
38
|
const space = await client.spaces.create();
|
|
39
39
|
|
|
40
40
|
const sheet = Sheet.make();
|
|
41
|
-
Obj.change(sheet, (
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
Obj.change(sheet, (obj) => {
|
|
42
|
+
obj.name = 'Test';
|
|
43
|
+
obj.cells[cell] = { value };
|
|
44
44
|
});
|
|
45
45
|
space.db.add(sheet);
|
|
46
46
|
setObject(sheet);
|
|
@@ -61,9 +61,9 @@ const AutomergeStory = ({ value, ...props }: CellEditorProps) => {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
const meta = {
|
|
64
|
-
title: 'plugins/plugin-sheet/CellEditor',
|
|
64
|
+
title: 'plugins/plugin-sheet/components/CellEditor',
|
|
65
65
|
|
|
66
|
-
decorators: [withTheme],
|
|
66
|
+
decorators: [withTheme()],
|
|
67
67
|
component: CellEditor,
|
|
68
68
|
render: DefaultStory,
|
|
69
69
|
} satisfies Meta<typeof DefaultStory>;
|