@dxos/plugin-sheet 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/RangeList-S3SHV7T6.mjs +53 -0
- package/dist/lib/browser/RangeList-S3SHV7T6.mjs.map +7 -0
- package/dist/lib/browser/SheetContainer-I3NFVVDQ.mjs +1805 -0
- package/dist/lib/browser/SheetContainer-I3NFVVDQ.mjs.map +7 -0
- package/dist/lib/browser/anchor-sort-DZ3IHHJJ.mjs +24 -0
- package/dist/lib/browser/anchor-sort-DZ3IHHJJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SSN4HYJL.mjs → chunk-NNWF7EKC.mjs} +17 -17
- package/dist/lib/browser/chunk-NNWF7EKC.mjs.map +7 -0
- package/dist/lib/browser/chunk-S445OQGW.mjs +397 -0
- package/dist/lib/browser/chunk-S445OQGW.mjs.map +7 -0
- package/dist/lib/browser/compute-graph-registry-W6HO2G3P.mjs +21 -0
- package/dist/lib/browser/compute-graph-registry-W6HO2G3P.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +71 -80
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/markdown-S6GVLHB4.mjs +29 -0
- package/dist/lib/browser/markdown-S6GVLHB4.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-Z4X4UWNR.mjs +79 -0
- package/dist/lib/browser/operation-resolver-Z4X4UWNR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-KIU6DGKW.mjs +51 -0
- package/dist/lib/browser/react-surface-KIU6DGKW.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -12
- package/dist/lib/node-esm/RangeList-IB23OJK2.mjs +54 -0
- package/dist/lib/node-esm/RangeList-IB23OJK2.mjs.map +7 -0
- package/dist/lib/node-esm/SheetContainer-KUXNCSFP.mjs +1806 -0
- package/dist/lib/node-esm/SheetContainer-KUXNCSFP.mjs.map +7 -0
- package/dist/lib/node-esm/anchor-sort-24OXMOSX.mjs +25 -0
- package/dist/lib/node-esm/anchor-sort-24OXMOSX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IK4O7FUJ.mjs → chunk-M52YLLWU.mjs} +17 -17
- package/dist/lib/node-esm/chunk-M52YLLWU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NKZ3O4OR.mjs +398 -0
- package/dist/lib/node-esm/chunk-NKZ3O4OR.mjs.map +7 -0
- package/dist/lib/node-esm/compute-graph-registry-2C3Y2RPQ.mjs +22 -0
- package/dist/lib/node-esm/compute-graph-registry-2C3Y2RPQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +71 -80
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/markdown-YT5KJTQT.mjs +30 -0
- package/dist/lib/node-esm/markdown-YT5KJTQT.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-7VD2YXSQ.mjs +80 -0
- package/dist/lib/node-esm/operation-resolver-7VD2YXSQ.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-7FZAE3S7.mjs +52 -0
- package/dist/lib/node-esm/react-surface-7FZAE3S7.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -12
- package/dist/types/src/SheetPlugin.d.ts +2 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +6 -0
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +1 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts +3 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts +5 -0
- package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry/index.d.ts +3 -0
- package/dist/types/src/capabilities/compute-graph-registry/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
- package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts +11 -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/{GridSheet → SheetContent}/SheetCellEditor.stories.d.ts +1 -1
- package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts +5 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -0
- package/dist/types/src/components/{GridSheet/GridSheet.stories.d.ts → SheetContent/SheetContent.stories.d.ts} +5 -4
- 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} +6 -6
- 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 +5 -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 +6 -4
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +2 -0
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/align.d.ts +12 -19
- package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/style.d.ts +12 -18
- package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +14 -1
- package/dist/types/src/components/SheetToolbar/useToolbarState.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 +2 -2
- 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/{components → containers}/SheetContainer/SheetContainer.stories.d.ts +4 -3
- 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/extensions/editor/sheet-extension.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +6 -6
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/model/testing.d.ts +2 -2
- package/dist/types/src/model/testing.d.ts.map +1 -1
- package/dist/types/src/model/useSheetModel.d.ts +2 -2
- package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
- package/dist/types/src/serializer.d.ts +2 -2
- package/dist/types/src/serializer.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +2 -2
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +26 -2
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Sheet.d.ts +76 -0
- package/dist/types/src/types/Sheet.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +6 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/sheet-range-types.d.ts +2 -2
- package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +91 -74
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/types/util.d.ts +10 -10
- package/dist/types/src/types/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +74 -67
- package/src/SheetPlugin.tsx +41 -61
- package/src/capabilities/anchor-sort/anchor-sort.ts +27 -0
- package/src/capabilities/anchor-sort/index.ts +7 -0
- package/src/capabilities/compute-graph-registry/compute-graph-registry.ts +27 -0
- package/src/capabilities/compute-graph-registry/index.ts +7 -0
- package/src/capabilities/index.ts +5 -9
- package/src/capabilities/markdown/index.ts +7 -0
- package/src/capabilities/markdown/markdown.ts +30 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +77 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +46 -0
- package/src/components/ComputeGraph/compute-graph.stories.tsx +10 -10
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.tsx +13 -10
- package/src/components/{GridSheet/GridSheet.stories.tsx → SheetContent/SheetContent.stories.tsx} +16 -15
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +52 -39
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +14 -8
- package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +42 -40
- package/src/components/{GridSheet → SheetRoot}/index.ts +1 -1
- package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx} +10 -5
- package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +4 -4
- package/src/components/SheetToolbar/SheetToolbar.tsx +45 -35
- package/src/components/SheetToolbar/align.ts +44 -19
- package/src/components/SheetToolbar/style.ts +48 -18
- package/src/components/SheetToolbar/useToolbarState.ts +22 -5
- package/src/components/index.ts +1 -7
- package/src/{components → containers}/RangeList/RangeList.tsx +17 -12
- package/src/containers/RangeList/index.ts +7 -0
- package/src/containers/SheetContainer/SheetContainer.stories.tsx +94 -0
- 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 +24 -14
- package/src/extensions/compute.ts +1 -1
- package/src/extensions/editor/sheet-extension.ts +16 -13
- package/src/index.ts +1 -1
- package/src/integrations/thread-ranges.ts +38 -49
- package/src/meta.ts +8 -4
- package/src/model/sheet-model.test.ts +4 -4
- package/src/model/sheet-model.ts +80 -48
- package/src/model/testing.ts +4 -4
- package/src/model/useSheetModel.ts +2 -2
- package/src/playwright/playwright.config.ts +1 -1
- package/src/playwright/sheet.spec.ts +2 -1
- package/src/sanity.test.ts +3 -4
- package/src/serializer.ts +4 -4
- package/src/testing/data.ts +2 -2
- package/src/testing/testing.tsx +3 -3
- package/src/translations.ts +3 -2
- package/src/types/Sheet.ts +97 -0
- package/src/{capabilities → types}/capabilities.ts +2 -2
- package/src/types/index.ts +2 -1
- package/src/types/sheet-range-types.ts +5 -5
- package/src/types/types.ts +82 -48
- package/src/types/util.ts +11 -38
- package/dist/lib/browser/SheetContainer-VL34UND4.mjs +0 -351
- package/dist/lib/browser/SheetContainer-VL34UND4.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-3N44DS5F.mjs +0 -24
- package/dist/lib/browser/anchor-sort-3N44DS5F.mjs.map +0 -7
- package/dist/lib/browser/chunk-ADK2HW4A.mjs +0 -906
- package/dist/lib/browser/chunk-ADK2HW4A.mjs.map +0 -7
- package/dist/lib/browser/chunk-CSBSADPQ.mjs +0 -16
- package/dist/lib/browser/chunk-CSBSADPQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-SSN4HYJL.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZJWJMX4E.mjs +0 -852
- package/dist/lib/browser/chunk-ZJWJMX4E.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZMPNHFIP.mjs +0 -15
- package/dist/lib/browser/chunk-ZMPNHFIP.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-MF65HGGM.mjs +0 -21
- package/dist/lib/browser/compute-graph-registry-MF65HGGM.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BQLV6IAA.mjs +0 -56
- package/dist/lib/browser/intent-resolver-BQLV6IAA.mjs.map +0 -7
- package/dist/lib/browser/markdown-RMTMI237.mjs +0 -26
- package/dist/lib/browser/markdown-RMTMI237.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7ZDMQDCT.mjs +0 -53
- package/dist/lib/browser/react-surface-7ZDMQDCT.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-NWJ7L6FC.mjs +0 -352
- package/dist/lib/node-esm/SheetContainer-NWJ7L6FC.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-YL2OZHYM.mjs +0 -25
- package/dist/lib/node-esm/anchor-sort-YL2OZHYM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BZAPYBSH.mjs +0 -907
- package/dist/lib/node-esm/chunk-BZAPYBSH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H3GSD33H.mjs +0 -18
- package/dist/lib/node-esm/chunk-H3GSD33H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IK4O7FUJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LN6ZSAII.mjs +0 -16
- package/dist/lib/node-esm/chunk-LN6ZSAII.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YL7BVJPC.mjs +0 -853
- package/dist/lib/node-esm/chunk-YL7BVJPC.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-P2O5LDFZ.mjs +0 -22
- package/dist/lib/node-esm/compute-graph-registry-P2O5LDFZ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MV5ZFXAQ.mjs +0 -57
- package/dist/lib/node-esm/intent-resolver-MV5ZFXAQ.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-EDIWHA3P.mjs +0 -27
- package/dist/lib/node-esm/markdown-EDIWHA3P.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-TUME5MM2.mjs +0 -54
- package/dist/lib/node-esm/react-surface-TUME5MM2.mjs.map +0 -7
- package/dist/types/src/capabilities/anchor-sort.d.ts +0 -6
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-graph-registry.d.ts +0 -4
- package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown.d.ts +0 -4
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/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.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 -11
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +0 -1
- 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/dist/types/src/types/schema.d.ts +0 -37
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/anchor-sort.ts +0 -22
- package/src/capabilities/compute-graph-registry.ts +0 -23
- package/src/capabilities/intent-resolver.ts +0 -38
- package/src/capabilities/markdown.ts +0 -23
- package/src/capabilities/react-surface.tsx +0 -40
- package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -90
- package/src/components/SheetContainer/SheetContainer.tsx +0 -40
- package/src/components/SheetContext/index.ts +0 -5
- package/src/types/schema.ts +0 -61
- /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,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.c85a9c8dae",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
@@ -11,15 +15,15 @@
|
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
13
17
|
"source": "./src/index.ts",
|
|
14
|
-
"types": "./dist/types/src/index.d.ts",
|
|
15
18
|
"browser": "./dist/lib/browser/index.mjs",
|
|
16
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
19
|
+
"node": "./dist/lib/node-esm/index.mjs",
|
|
20
|
+
"types": "./dist/types/src/index.d.ts"
|
|
17
21
|
},
|
|
18
22
|
"./types": {
|
|
19
23
|
"source": "./src/types/index.ts",
|
|
20
|
-
"types": "./dist/types/src/types/index.d.ts",
|
|
21
24
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
22
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
25
|
+
"node": "./dist/lib/node-esm/types/index.mjs",
|
|
26
|
+
"types": "./dist/types/src/types/index.d.ts"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -47,8 +51,6 @@
|
|
|
47
51
|
"@lezer/highlight": "^1.2.1",
|
|
48
52
|
"@lezer/lezer": "^1.1.2",
|
|
49
53
|
"@lezer/lr": "^1.4.2",
|
|
50
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
51
|
-
"@preact/signals-core": "^1.12.1",
|
|
52
54
|
"@radix-ui/react-context": "1.1.1",
|
|
53
55
|
"codemirror-lang-spreadsheet": "^1.3.0",
|
|
54
56
|
"date-fns": "^3.3.1",
|
|
@@ -56,73 +58,78 @@
|
|
|
56
58
|
"re-resizable": "^6.9.17",
|
|
57
59
|
"react-markdown": "^10.1.0",
|
|
58
60
|
"react-resize-detector": "^11.0.1",
|
|
59
|
-
"@dxos/app-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/async": "0.8.4-main.
|
|
62
|
-
"@dxos/compute": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/context": "0.8.4-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/lit-grid": "0.8.4-main.
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/plugin-
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/plugin-
|
|
80
|
-
"@dxos/plugin-
|
|
81
|
-
"@dxos/plugin-
|
|
82
|
-
"@dxos/plugin-
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/react-
|
|
85
|
-
"@dxos/react-
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/react-
|
|
89
|
-
"@dxos/react-
|
|
90
|
-
"@dxos/react-ui-
|
|
91
|
-
"@dxos/react-ui-
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
61
|
+
"@dxos/app-toolkit": "0.8.4-main.c85a9c8dae",
|
|
62
|
+
"@dxos/app-framework": "0.8.4-main.c85a9c8dae",
|
|
63
|
+
"@dxos/async": "0.8.4-main.c85a9c8dae",
|
|
64
|
+
"@dxos/compute": "0.8.4-main.c85a9c8dae",
|
|
65
|
+
"@dxos/client": "0.8.4-main.c85a9c8dae",
|
|
66
|
+
"@dxos/context": "0.8.4-main.c85a9c8dae",
|
|
67
|
+
"@dxos/debug": "0.8.4-main.c85a9c8dae",
|
|
68
|
+
"@dxos/crypto": "0.8.4-main.c85a9c8dae",
|
|
69
|
+
"@dxos/echo": "0.8.4-main.c85a9c8dae",
|
|
70
|
+
"@dxos/echo-db": "0.8.4-main.c85a9c8dae",
|
|
71
|
+
"@dxos/functions": "0.8.4-main.c85a9c8dae",
|
|
72
|
+
"@dxos/invariant": "0.8.4-main.c85a9c8dae",
|
|
73
|
+
"@dxos/lit-grid": "0.8.4-main.c85a9c8dae",
|
|
74
|
+
"@dxos/keys": "0.8.4-main.c85a9c8dae",
|
|
75
|
+
"@dxos/operation": "0.8.4-main.c85a9c8dae",
|
|
76
|
+
"@dxos/log": "0.8.4-main.c85a9c8dae",
|
|
77
|
+
"@dxos/plugin-attention": "0.8.4-main.c85a9c8dae",
|
|
78
|
+
"@dxos/plugin-client": "0.8.4-main.c85a9c8dae",
|
|
79
|
+
"@dxos/plugin-automation": "0.8.4-main.c85a9c8dae",
|
|
80
|
+
"@dxos/plugin-deck": "0.8.4-main.c85a9c8dae",
|
|
81
|
+
"@dxos/plugin-graph": "0.8.4-main.c85a9c8dae",
|
|
82
|
+
"@dxos/plugin-markdown": "0.8.4-main.c85a9c8dae",
|
|
83
|
+
"@dxos/plugin-script": "0.8.4-main.c85a9c8dae",
|
|
84
|
+
"@dxos/plugin-space": "0.8.4-main.c85a9c8dae",
|
|
85
|
+
"@dxos/plugin-stack": "0.8.4-main.c85a9c8dae",
|
|
86
|
+
"@dxos/react-client": "0.8.4-main.c85a9c8dae",
|
|
87
|
+
"@dxos/react-hooks": "0.8.4-main.c85a9c8dae",
|
|
88
|
+
"@dxos/plugin-thread": "0.8.4-main.c85a9c8dae",
|
|
89
|
+
"@dxos/react-ui-attention": "0.8.4-main.c85a9c8dae",
|
|
90
|
+
"@dxos/react-ui-form": "0.8.4-main.c85a9c8dae",
|
|
91
|
+
"@dxos/react-ui-grid": "0.8.4-main.c85a9c8dae",
|
|
92
|
+
"@dxos/react-ui-editor": "0.8.4-main.c85a9c8dae",
|
|
93
|
+
"@dxos/react-ui-list": "0.8.4-main.c85a9c8dae",
|
|
94
|
+
"@dxos/react-ui-menu": "0.8.4-main.c85a9c8dae",
|
|
95
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.c85a9c8dae",
|
|
96
|
+
"@dxos/react-ui-stack": "0.8.4-main.c85a9c8dae",
|
|
97
|
+
"@dxos/types": "0.8.4-main.c85a9c8dae",
|
|
98
|
+
"@dxos/ui-editor": "0.8.4-main.c85a9c8dae",
|
|
99
|
+
"@dxos/schema": "0.8.4-main.c85a9c8dae",
|
|
100
|
+
"@dxos/util": "0.8.4-main.c85a9c8dae"
|
|
94
101
|
},
|
|
95
102
|
"devDependencies": {
|
|
96
|
-
"@effect-
|
|
97
|
-
"@effect/platform": "0.
|
|
103
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
104
|
+
"@effect/platform": "0.94.4",
|
|
98
105
|
"@lezer/generator": "^1.7.1",
|
|
99
106
|
"@tldraw/indices": "^2.0.0-alpha.14",
|
|
100
107
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
101
|
-
"@types/react": "~19.2.
|
|
102
|
-
"@types/react-dom": "~19.2.
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"react": "~19.2.
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/
|
|
108
|
+
"@types/react": "~19.2.7",
|
|
109
|
+
"@types/react-dom": "~19.2.3",
|
|
110
|
+
"effect": "3.19.16",
|
|
111
|
+
"react": "~19.2.3",
|
|
112
|
+
"react-dom": "~19.2.3",
|
|
113
|
+
"vite": "^7.1.11",
|
|
114
|
+
"@dxos/echo-generator": "0.8.4-main.c85a9c8dae",
|
|
115
|
+
"@dxos/lit-grid": "0.8.4-main.c85a9c8dae",
|
|
116
|
+
"@dxos/random": "0.8.4-main.c85a9c8dae",
|
|
117
|
+
"@dxos/react-ui": "0.8.4-main.c85a9c8dae",
|
|
118
|
+
"@dxos/plugin-testing": "0.8.4-main.c85a9c8dae",
|
|
119
|
+
"@dxos/storybook-utils": "0.8.4-main.c85a9c8dae",
|
|
120
|
+
"@dxos/test-utils": "0.8.4-main.c85a9c8dae",
|
|
121
|
+
"@dxos/ui-theme": "0.8.4-main.c85a9c8dae",
|
|
122
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.c85a9c8dae",
|
|
123
|
+
"@dxos/ui-types": "0.8.4-main.c85a9c8dae"
|
|
117
124
|
},
|
|
118
125
|
"peerDependencies": {
|
|
119
|
-
"@effect-
|
|
120
|
-
"@effect/platform": "
|
|
121
|
-
"effect": "
|
|
122
|
-
"react": "
|
|
123
|
-
"react-dom": "
|
|
124
|
-
"@dxos/
|
|
125
|
-
"@dxos/react-ui
|
|
126
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
127
|
+
"@effect/platform": "0.94.4",
|
|
128
|
+
"effect": "3.19.16",
|
|
129
|
+
"react": "~19.2.3",
|
|
130
|
+
"react-dom": "~19.2.3",
|
|
131
|
+
"@dxos/ui-theme": "0.8.4-main.c85a9c8dae",
|
|
132
|
+
"@dxos/react-ui": "0.8.4-main.c85a9c8dae"
|
|
126
133
|
},
|
|
127
134
|
"publishConfig": {
|
|
128
135
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -2,83 +2,63 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
createIntent,
|
|
11
|
-
defineModule,
|
|
12
|
-
definePlugin,
|
|
13
|
-
} from '@dxos/app-framework';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { ActivationEvent, Capability, Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
14
10
|
import { AutomationEvents } from '@dxos/plugin-automation';
|
|
15
11
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
16
12
|
import { MarkdownEvents } from '@dxos/plugin-markdown';
|
|
17
|
-
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
18
|
-
import {
|
|
13
|
+
import { SpaceCapabilities, SpaceEvents } from '@dxos/plugin-space';
|
|
14
|
+
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
19
15
|
|
|
20
|
-
import { AnchorSort, ComputeGraphRegistry,
|
|
16
|
+
import { AnchorSort, ComputeGraphRegistry, Markdown, OperationResolver, ReactSurface } from './capabilities';
|
|
21
17
|
import { meta } from './meta';
|
|
22
18
|
import { serializer } from './serializer';
|
|
23
19
|
import { translations } from './translations';
|
|
24
|
-
import {
|
|
20
|
+
import { Sheet, SheetOperation } from './types';
|
|
25
21
|
|
|
26
|
-
export const SheetPlugin =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
export const SheetPlugin = Plugin.define(meta).pipe(
|
|
23
|
+
AppPlugin.addMetadataModule({
|
|
24
|
+
metadata: {
|
|
25
|
+
id: Sheet.Sheet.typename,
|
|
26
|
+
metadata: {
|
|
27
|
+
label: (object: Sheet.Sheet) => object.name,
|
|
28
|
+
icon: 'ph--grid-nine--regular',
|
|
29
|
+
iconHue: 'indigo',
|
|
30
|
+
serializer,
|
|
31
|
+
comments: 'anchored',
|
|
32
|
+
createObject: ((props) => Effect.sync(() => Sheet.make(props))) satisfies CreateObject,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
31
35
|
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
activatesOn: Events.SetupMetadata,
|
|
40
|
-
activate: () =>
|
|
41
|
-
contributes(Capabilities.Metadata, {
|
|
42
|
-
id: SheetType.typename,
|
|
43
|
-
metadata: {
|
|
44
|
-
label: (object: SheetType) => object.name,
|
|
45
|
-
icon: 'ph--grid-nine--regular',
|
|
46
|
-
serializer,
|
|
47
|
-
comments: 'anchored',
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
36
|
+
AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
37
|
+
AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }),
|
|
38
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
39
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
40
|
+
Plugin.addModule({
|
|
41
|
+
activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, AutomationEvents.ComputeRuntimeReady),
|
|
42
|
+
activate: ComputeGraphRegistry,
|
|
50
43
|
}),
|
|
51
|
-
|
|
52
|
-
id:
|
|
53
|
-
activatesOn:
|
|
44
|
+
Plugin.addModule({
|
|
45
|
+
id: 'on-space-created',
|
|
46
|
+
activatesOn: SpaceEvents.SpaceCreated,
|
|
54
47
|
activate: () =>
|
|
55
|
-
|
|
56
|
-
SpaceCapabilities.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
getIntent: (props, options) => createIntent(SheetAction.Create, { ...props, space: options.space }),
|
|
60
|
-
}),
|
|
48
|
+
Effect.succeed(
|
|
49
|
+
Capability.contributes(SpaceCapabilities.OnCreateSpace, (params) =>
|
|
50
|
+
Operation.invoke(SheetOperation.OnCreateSpace, params),
|
|
51
|
+
),
|
|
61
52
|
),
|
|
62
53
|
}),
|
|
63
|
-
|
|
64
|
-
id: `${meta.id}/module/markdown`,
|
|
54
|
+
Plugin.addModule({
|
|
65
55
|
activatesOn: MarkdownEvents.SetupExtensions,
|
|
66
56
|
activate: Markdown,
|
|
67
57
|
}),
|
|
68
|
-
|
|
69
|
-
id: `${meta.id}/module/anchor-sort`,
|
|
58
|
+
Plugin.addModule({
|
|
70
59
|
// TODO(wittjosiah): More relevant event?
|
|
71
|
-
activatesOn:
|
|
60
|
+
activatesOn: AppActivationEvents.AppGraphReady,
|
|
72
61
|
activate: AnchorSort,
|
|
73
62
|
}),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
activatesOn: Events.SetupReactSurface,
|
|
77
|
-
activate: ReactSurface,
|
|
78
|
-
}),
|
|
79
|
-
defineModule({
|
|
80
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
81
|
-
activatesOn: Events.SetupIntentResolver,
|
|
82
|
-
activate: IntentResolver,
|
|
83
|
-
}),
|
|
84
|
-
]);
|
|
63
|
+
Plugin.make,
|
|
64
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
import { Relation } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
import { Sheet, compareIndexPositions } from '../../types';
|
|
12
|
+
|
|
13
|
+
export default Capability.makeModule(() =>
|
|
14
|
+
Effect.succeed(
|
|
15
|
+
Capability.contributes(AppCapabilities.AnchorSort, {
|
|
16
|
+
key: Sheet.Sheet.typename,
|
|
17
|
+
sort: (anchorA, anchorB) => {
|
|
18
|
+
const sheet = Relation.getTarget(anchorA) as Sheet.Sheet;
|
|
19
|
+
if (sheet !== Relation.getTarget(anchorB)) {
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return !anchorA.anchor || !anchorB.anchor ? 0 : compareIndexPositions(sheet, anchorA.anchor, anchorB.anchor);
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
9
|
+
|
|
10
|
+
import { SheetCapabilities } from '../../types';
|
|
11
|
+
|
|
12
|
+
// Locally declare the Automation ComputeRuntime capability by ID to avoid direct import dependency.
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
const computeRuntimeResolver = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
|
|
17
|
+
// TODO(wittjosiah): This can probably be a module level import now due to lazy capability loading.
|
|
18
|
+
// Async import removes direct dependency on hyperformula.
|
|
19
|
+
const { defaultPlugins, ComputeGraphRegistry } = yield* Effect.tryPromise(() => import('@dxos/compute'));
|
|
20
|
+
const computeGraphRegistry = new ComputeGraphRegistry({
|
|
21
|
+
plugins: defaultPlugins,
|
|
22
|
+
computeRuntime: computeRuntimeResolver,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return Capability.contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export const Markdown = lazy(() => import('./markdown'));
|
|
11
|
-
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
12
|
-
|
|
13
|
-
export * from './capabilities';
|
|
5
|
+
export * from './anchor-sort';
|
|
6
|
+
export * from './compute-graph-registry';
|
|
7
|
+
export * from './markdown';
|
|
8
|
+
export * from './operation-resolver';
|
|
9
|
+
export * from './react-surface';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { getSpace } from '@dxos/client/echo';
|
|
9
|
+
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
10
|
+
|
|
11
|
+
import { computeGraphFacet } from '../../extensions';
|
|
12
|
+
import { SheetCapabilities } from '../../types';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
// Get context for lazy capability access in callbacks.
|
|
17
|
+
const capabilities = yield* Capability.Service;
|
|
18
|
+
|
|
19
|
+
return Capability.contributes(MarkdownCapabilities.Extensions, [
|
|
20
|
+
({ document: doc }) => {
|
|
21
|
+
const computeGraphRegistry = capabilities.get(SheetCapabilities.ComputeGraphRegistry);
|
|
22
|
+
const space = getSpace(doc);
|
|
23
|
+
if (space) {
|
|
24
|
+
const computeGraph = computeGraphRegistry.getOrCreateGraph(space);
|
|
25
|
+
return computeGraphFacet.of(computeGraph);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
]);
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
import { Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
+
import { OperationResolver } from '@dxos/operation';
|
|
10
|
+
import { ManagedCollection } from '@dxos/schema';
|
|
11
|
+
|
|
12
|
+
import { meta } from '../../meta';
|
|
13
|
+
import { Sheet, SheetOperation } from '../../types';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(() =>
|
|
16
|
+
Effect.succeed([
|
|
17
|
+
Capability.contributes(Capabilities.UndoMapping, [
|
|
18
|
+
UndoMapping.make({
|
|
19
|
+
operation: SheetOperation.DropAxis,
|
|
20
|
+
inverse: SheetOperation.RestoreAxis,
|
|
21
|
+
deriveContext: (input, output) => ({
|
|
22
|
+
model: input.model,
|
|
23
|
+
axis: output.axis,
|
|
24
|
+
axisIndex: output.axisIndex,
|
|
25
|
+
index: output.index,
|
|
26
|
+
axisMeta: output.axisMeta,
|
|
27
|
+
values: output.values,
|
|
28
|
+
}),
|
|
29
|
+
message: ['axis dropped label', { ns: meta.id }],
|
|
30
|
+
}),
|
|
31
|
+
]),
|
|
32
|
+
Capability.contributes(Capabilities.OperationResolver, [
|
|
33
|
+
OperationResolver.make({
|
|
34
|
+
operation: SheetOperation.OnCreateSpace,
|
|
35
|
+
handler: Effect.fnUntraced(function* ({ rootCollection }) {
|
|
36
|
+
const collection = ManagedCollection.makeManagedCollection({ key: Type.getTypename(Sheet.Sheet) });
|
|
37
|
+
Obj.change(rootCollection, (c) => {
|
|
38
|
+
c.objects.push(Ref.make(collection));
|
|
39
|
+
});
|
|
40
|
+
}),
|
|
41
|
+
}),
|
|
42
|
+
OperationResolver.make({
|
|
43
|
+
operation: SheetOperation.InsertAxis,
|
|
44
|
+
handler: ({ model, axis, index, count }) =>
|
|
45
|
+
Effect.sync(() => {
|
|
46
|
+
model[axis === 'col' ? 'insertColumns' : 'insertRows'](index, count);
|
|
47
|
+
}),
|
|
48
|
+
}),
|
|
49
|
+
OperationResolver.make({
|
|
50
|
+
operation: SheetOperation.DropAxis,
|
|
51
|
+
handler: ({ model, axis, axisIndex }) =>
|
|
52
|
+
Effect.sync(() => {
|
|
53
|
+
const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
54
|
+
// Return data needed for undo.
|
|
55
|
+
return {
|
|
56
|
+
axis: undoData.axis,
|
|
57
|
+
axisIndex: undoData.axisIndex,
|
|
58
|
+
index: undoData.index,
|
|
59
|
+
axisMeta: undoData.axisMeta,
|
|
60
|
+
values: undoData.values,
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
63
|
+
}),
|
|
64
|
+
|
|
65
|
+
//
|
|
66
|
+
// RestoreAxis (inverse of DropAxis)
|
|
67
|
+
//
|
|
68
|
+
OperationResolver.make({
|
|
69
|
+
operation: SheetOperation.RestoreAxis,
|
|
70
|
+
handler: ({ model, axis, ...restoreData }) =>
|
|
71
|
+
Effect.sync(() => {
|
|
72
|
+
model[axis === 'col' ? 'restoreColumn' : 'restoreRow'](restoreData);
|
|
73
|
+
}),
|
|
74
|
+
}),
|
|
75
|
+
]),
|
|
76
|
+
]),
|
|
77
|
+
);
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { subject: Sheet.Sheet } =>
|
|
24
|
+
Obj.instanceOf(Sheet.Sheet, data.subject) && !!getSpace(data.subject),
|
|
25
|
+
component: ({ data, role }) => {
|
|
26
|
+
const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<SheetContainer
|
|
30
|
+
role={role}
|
|
31
|
+
subject={data.subject}
|
|
32
|
+
space={getSpace(data.subject)!}
|
|
33
|
+
registry={computeGraphRegistry}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
Surface.create({
|
|
39
|
+
id: `${meta.id}/object-settings`,
|
|
40
|
+
role: 'object-settings',
|
|
41
|
+
filter: (data): data is { subject: Sheet.Sheet } => Obj.instanceOf(Sheet.Sheet, data.subject),
|
|
42
|
+
component: ({ data }) => <RangeList sheet={data.subject} />,
|
|
43
|
+
}),
|
|
44
|
+
]),
|
|
45
|
+
),
|
|
46
|
+
);
|
|
@@ -6,8 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { useEffect, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { testFunctionPlugins } from '@dxos/compute/testing';
|
|
9
|
-
import { Filter
|
|
10
|
-
import {
|
|
9
|
+
import { Filter } from '@dxos/echo';
|
|
10
|
+
import { Function } from '@dxos/functions';
|
|
11
11
|
import { useSpace } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { Button, Input, Toolbar } from '@dxos/react-ui';
|
|
@@ -16,7 +16,7 @@ import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
|
16
16
|
|
|
17
17
|
import { useSheetModel } from '../../model';
|
|
18
18
|
import { withComputeGraphDecorator } from '../../testing';
|
|
19
|
-
import {
|
|
19
|
+
import { Sheet } from '../../types';
|
|
20
20
|
|
|
21
21
|
import { useComputeGraph } from './ComputeGraphContextProvider';
|
|
22
22
|
|
|
@@ -25,13 +25,13 @@ const FUNCTION_NAME = 'TEST';
|
|
|
25
25
|
const DefaultStory = () => {
|
|
26
26
|
const space = useSpace();
|
|
27
27
|
const graph = useComputeGraph(space);
|
|
28
|
-
const [sheet, setSheet] = useState<
|
|
28
|
+
const [sheet, setSheet] = useState<Sheet.Sheet>();
|
|
29
29
|
const [text, setText] = useState(`${FUNCTION_NAME}(100)`);
|
|
30
30
|
const [result, setResult] = useState<any>();
|
|
31
31
|
const model = useSheetModel(graph, sheet);
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
if (space) {
|
|
34
|
-
const sheet = space.db.add(
|
|
34
|
+
const sheet = space.db.add(Sheet.make());
|
|
35
35
|
setSheet(sheet);
|
|
36
36
|
}
|
|
37
37
|
}, [space]);
|
|
@@ -44,14 +44,14 @@ const DefaultStory = () => {
|
|
|
44
44
|
setResult({ functions: { standard: f1.length, echo: f2.length } });
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
space.db.add(
|
|
47
|
+
space.db.add(Function.make({ name: 'test', version: '0.0.1', binding: FUNCTION_NAME }));
|
|
48
48
|
}
|
|
49
49
|
}, [space, graph]);
|
|
50
50
|
|
|
51
51
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
52
52
|
const handleTest = async () => {
|
|
53
53
|
if (space && graph) {
|
|
54
|
-
const
|
|
54
|
+
const objects = await space.db.query(Filter.type(Function.Function)).run();
|
|
55
55
|
const mapped = graph.mapFunctionBindingToId(text);
|
|
56
56
|
const unmapped = graph.mapFunctionBindingFromId(mapped);
|
|
57
57
|
const internal = graph.mapFormulaToNative(text);
|
|
@@ -84,11 +84,11 @@ const DefaultStory = () => {
|
|
|
84
84
|
export const Default: Story = {};
|
|
85
85
|
|
|
86
86
|
const meta = {
|
|
87
|
-
title: 'plugins/plugin-sheet/functions',
|
|
87
|
+
title: 'plugins/plugin-sheet/components/functions',
|
|
88
88
|
render: DefaultStory,
|
|
89
89
|
decorators: [
|
|
90
|
-
withTheme,
|
|
91
|
-
withClientProvider({ types: [
|
|
90
|
+
withTheme(),
|
|
91
|
+
withClientProvider({ types: [Function.Function, Sheet.Sheet], createIdentity: true, createSpace: true }),
|
|
92
92
|
withComputeGraphDecorator({ plugins: testFunctionPlugins }),
|
|
93
93
|
],
|
|
94
94
|
} satisfies Meta<typeof DefaultStory>;
|