@dxos/plugin-sheet 0.8.4-main.c1de068 → 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-7HQX4NQP.mjs → chunk-NNWF7EKC.mjs} +14 -14
- 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 +72 -82
- 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-Q6UYC4G5.mjs → chunk-M52YLLWU.mjs} +14 -14
- 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 +72 -82
- 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 -11
- 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/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts +9 -4
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
- 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/SheetContent/SheetCellEditor.stories.d.ts +16 -0
- 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/SheetContent/SheetContent.stories.d.ts +55 -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/{GridSheet → SheetContent}/util.d.ts +1 -1
- 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 -7
- 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 +88 -4
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/align.d.ts +13 -20
- 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/containers/SheetContainer/SheetContainer.stories.d.ts +56 -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.d.ts +1 -1
- package/dist/types/src/extensions/compute.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.stories.d.ts +10 -13
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/editor/index.d.ts +1 -1
- package/dist/types/src/extensions/editor/index.d.ts.map +1 -1
- package/dist/types/src/extensions/editor/{extension.d.ts → sheet-extension.d.ts} +1 -1
- package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -0
- package/dist/types/src/extensions/editor/sheet-extension.test.d.ts +2 -0
- package/dist/types/src/extensions/editor/sheet-extension.test.d.ts.map +1 -0
- 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 -3
- 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/playwright/sheet-manager.d.ts +1 -1
- package/dist/types/src/playwright/sheet-manager.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 +27 -3
- 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 +92 -75
- 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 +81 -72
- package/src/SheetPlugin.tsx +52 -64
- 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/ComputeGraphContextProvider.tsx +1 -1
- package/src/components/ComputeGraph/compute-graph.stories.tsx +22 -21
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/SheetContent/SheetCellEditor.stories.tsx +94 -0
- package/src/components/SheetContent/SheetContent.stories.tsx +60 -0
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +74 -60
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +20 -14
- package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +43 -41
- 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 +20 -14
- package/src/components/SheetToolbar/SheetToolbar.tsx +57 -46
- package/src/components/SheetToolbar/align.ts +49 -23
- package/src/components/SheetToolbar/style.ts +51 -21
- package/src/components/SheetToolbar/useToolbarState.ts +22 -5
- package/src/components/index.ts +1 -7
- package/src/{components → containers}/RangeList/RangeList.tsx +20 -15
- 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 +46 -32
- package/src/extensions/compute.ts +3 -4
- package/src/extensions/editor/index.ts +1 -1
- package/src/extensions/editor/{extension.test.ts → sheet-extension.test.ts} +1 -1
- package/src/extensions/editor/{extension.ts → sheet-extension.ts} +16 -13
- package/src/index.ts +1 -1
- package/src/integrations/thread-ranges.ts +39 -49
- package/src/meta.ts +9 -7
- package/src/model/sheet-model.test.ts +5 -4
- package/src/model/sheet-model.ts +85 -53
- 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-manager.ts +1 -1
- package/src/playwright/sheet.spec.ts +3 -2
- package/src/sanity.test.ts +4 -5
- package/src/serializer.ts +4 -4
- package/src/testing/data.ts +2 -2
- package/src/testing/testing.tsx +11 -5
- package/src/translations.ts +3 -2
- package/src/types/Sheet.ts +97 -0
- package/src/types/capabilities.ts +14 -0
- package/src/types/index.ts +2 -1
- package/src/types/sheet-range-types.ts +5 -5
- package/src/types/types.ts +84 -49
- package/src/types/util.ts +14 -41
- package/dist/lib/browser/SheetContainer-KDGD4AVG.mjs +0 -351
- package/dist/lib/browser/SheetContainer-KDGD4AVG.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-VHURGBOY.mjs +0 -24
- package/dist/lib/browser/anchor-sort-VHURGBOY.mjs.map +0 -7
- package/dist/lib/browser/chunk-6AKBCBL4.mjs +0 -18
- package/dist/lib/browser/chunk-6AKBCBL4.mjs.map +0 -7
- package/dist/lib/browser/chunk-7HQX4NQP.mjs.map +0 -7
- package/dist/lib/browser/chunk-JUOVL3LE.mjs +0 -847
- package/dist/lib/browser/chunk-JUOVL3LE.mjs.map +0 -7
- package/dist/lib/browser/chunk-KJWZUQVA.mjs +0 -15
- package/dist/lib/browser/chunk-KJWZUQVA.mjs.map +0 -7
- package/dist/lib/browser/chunk-SI4X5GUR.mjs +0 -892
- package/dist/lib/browser/chunk-SI4X5GUR.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-VG7VP7IV.mjs +0 -30
- package/dist/lib/browser/compute-graph-registry-VG7VP7IV.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WOJGZMSV.mjs +0 -56
- package/dist/lib/browser/intent-resolver-WOJGZMSV.mjs.map +0 -7
- package/dist/lib/browser/markdown-VXMIPUQC.mjs +0 -26
- package/dist/lib/browser/markdown-VXMIPUQC.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SE4HGAEH.mjs +0 -53
- package/dist/lib/browser/react-surface-SE4HGAEH.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-RMG24NZC.mjs +0 -352
- package/dist/lib/node-esm/SheetContainer-RMG24NZC.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-CTJGOPET.mjs +0 -25
- package/dist/lib/node-esm/anchor-sort-CTJGOPET.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3K5VNYOF.mjs +0 -20
- package/dist/lib/node-esm/chunk-3K5VNYOF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs +0 -16
- package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CADTJFAS.mjs +0 -893
- package/dist/lib/node-esm/chunk-CADTJFAS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IFMIRCZH.mjs +0 -848
- package/dist/lib/node-esm/chunk-IFMIRCZH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q6UYC4G5.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-3K3Q2A5T.mjs +0 -31
- package/dist/lib/node-esm/compute-graph-registry-3K3Q2A5T.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-PZRXBNIJ.mjs +0 -57
- package/dist/lib/node-esm/intent-resolver-PZRXBNIJ.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-4VPQJZNZ.mjs +0 -27
- package/dist/lib/node-esm/markdown-4VPQJZNZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-LAU23XBH.mjs +0 -54
- package/dist/lib/node-esm/react-surface-LAU23XBH.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 -6
- 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 +0 -7
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts +0 -25
- 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 +0 -8
- 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/extensions/editor/extension.d.ts.map +0 -1
- package/dist/types/src/extensions/editor/extension.test.d.ts +0 -2
- package/dist/types/src/extensions/editor/extension.test.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/capabilities.ts +0 -14
- package/src/capabilities/compute-graph-registry.ts +0 -28
- package/src/capabilities/intent-resolver.ts +0 -38
- package/src/capabilities/markdown.ts +0 -22
- package/src/capabilities/react-surface.tsx +0 -39
- package/src/components/GridSheet/GridSheet.stories.tsx +0 -53
- package/src/components/GridSheet/SheetCellEditor.stories.tsx +0 -93
- package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -89
- package/src/components/SheetContainer/SheetContainer.tsx +0 -36
- package/src/components/SheetContext/index.ts +0 -5
- package/src/types/schema.ts +0 -61
- /package/dist/types/src/{components → containers}/SheetContainer/index.d.ts +0 -0
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
3
|
-
import { type SheetType } from '../../types';
|
|
4
|
-
export type SheetContainerProps = {
|
|
5
|
-
space: Space;
|
|
6
|
-
sheet: SheetType;
|
|
7
|
-
role?: string;
|
|
8
|
-
ignoreAttention?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare const SheetContainer: ({ space, sheet, role, ignoreAttention }: SheetContainerProps) => React.JSX.Element | null;
|
|
11
|
-
//# sourceMappingURL=SheetContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContainer/SheetContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGvE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAO7C,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,yCAAyC,mBAAmB,6BAY1F,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import { type Meta } from '@storybook/react-vite';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export declare const Basic: () => React.JSX.Element | null;
|
|
5
|
-
export declare const Spec: () => React.JSX.Element | null;
|
|
6
|
-
declare const meta: Meta;
|
|
7
|
-
export default meta;
|
|
8
|
-
//# sourceMappingURL=SheetContainer.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContainer.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContainer/SheetContainer.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,eAAO,MAAM,KAAK,gCAajB,CAAC;AAEF,eAAO,MAAM,IAAI,gCAkBhB,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IA0BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContext/SheetContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAoD,MAAM,OAAO,CAAC;AAExG,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAG5G,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAGjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,EAAE,UAAU,CAAC;IAIlB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAC;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IACjD,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IAGxC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAG3C,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAIpE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAGpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAIF,eAAO,MAAM,eAAe,QAAO,iBAIlC,CAAC;AA2DF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AAEtC,eAAO,MAAM,aAAa,GAAI,gEAO3B,iBAAiB,CAAC,kBAAkB,CAAC,6BAUvC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContext/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/editor/extension.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AA4CxD,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,sBAA2B,qBAAqB,KAAG,SAuHjF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,KAAK,IAAI,CAAC;CACtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,2BAA2B,qBAAqB,KAAG,SAyEjF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/editor/extension.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
import { Type } from '@dxos/echo';
|
|
3
|
-
export declare const CellValue: Schema.Struct<{
|
|
4
|
-
value: typeof Schema.Any;
|
|
5
|
-
}>;
|
|
6
|
-
export type CellValue = Schema.Schema.Type<typeof CellValue>;
|
|
7
|
-
export declare const Range: Schema.Struct<{
|
|
8
|
-
range: typeof Schema.String;
|
|
9
|
-
key: typeof Schema.String;
|
|
10
|
-
value: typeof Schema.String;
|
|
11
|
-
}>;
|
|
12
|
-
export type Range = Schema.Schema.Type<typeof Range>;
|
|
13
|
-
export declare const RowColumnMeta: Schema.Struct<{
|
|
14
|
-
size: Schema.optional<typeof Schema.Number>;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const SheetType: Type.obj<Schema.Struct<{
|
|
17
|
-
name: Schema.optional<typeof Schema.String>;
|
|
18
|
-
cells: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
19
|
-
value: typeof Schema.Any;
|
|
20
|
-
}>>>>;
|
|
21
|
-
rows: Schema.mutable<Schema.Array$<typeof Schema.String>>;
|
|
22
|
-
columns: Schema.mutable<Schema.Array$<typeof Schema.String>>;
|
|
23
|
-
rowMeta: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
24
|
-
size: Schema.optional<typeof Schema.Number>;
|
|
25
|
-
}>>>>;
|
|
26
|
-
columnMeta: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
27
|
-
size: Schema.optional<typeof Schema.Number>;
|
|
28
|
-
}>>>>;
|
|
29
|
-
ranges: Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
30
|
-
range: typeof Schema.String;
|
|
31
|
-
key: typeof Schema.String;
|
|
32
|
-
value: typeof Schema.String;
|
|
33
|
-
}>>>;
|
|
34
|
-
}>>;
|
|
35
|
-
export interface SheetType extends Schema.Schema.Type<typeof SheetType> {
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,eAAO,MAAM,SAAS;;EAKpB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAG7D,eAAO,MAAM,KAAK;;;;EAIhB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAGrD,eAAO,MAAM,aAAa;;EAExB,CAAC;AAIH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;GAyBrB,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { Type } from '@dxos/echo';
|
|
7
|
-
import { getTarget } from '@dxos/react-client/echo';
|
|
8
|
-
|
|
9
|
-
import { compareIndexPositions, SheetType } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () =>
|
|
12
|
-
contributes(Capabilities.AnchorSort, {
|
|
13
|
-
key: Type.getTypename(SheetType)!,
|
|
14
|
-
sort: (anchorA, anchorB) => {
|
|
15
|
-
const sheet = getTarget(anchorA) as SheetType;
|
|
16
|
-
if (sheet !== getTarget(anchorB)) {
|
|
17
|
-
return 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return !anchorA.anchor || !anchorB.anchor ? 0 : compareIndexPositions(sheet, anchorA.anchor, anchorB.anchor);
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type ComputeGraphRegistry } from '@dxos/compute';
|
|
7
|
-
|
|
8
|
-
import { SHEET_PLUGIN } from '../meta';
|
|
9
|
-
|
|
10
|
-
export namespace SheetCapabilities {
|
|
11
|
-
export const ComputeGraphRegistry = defineCapability<ComputeGraphRegistry>(
|
|
12
|
-
`${SHEET_PLUGIN}/capability/compute-graph-registry`,
|
|
13
|
-
);
|
|
14
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes, type PluginContext } from '@dxos/app-framework';
|
|
6
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
|
-
|
|
8
|
-
import { SheetCapabilities } from './capabilities';
|
|
9
|
-
|
|
10
|
-
const isSecure = (protocol: string) => {
|
|
11
|
-
return protocol === 'https:' || protocol === 'wss:';
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default async (context: PluginContext) => {
|
|
15
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
16
|
-
let remoteFunctionUrl: string | undefined;
|
|
17
|
-
if (client.config.values.runtime?.services?.edge?.url) {
|
|
18
|
-
const url = new URL('/functions', client.config.values.runtime?.services?.edge?.url);
|
|
19
|
-
url.protocol = isSecure(url.protocol) ? 'https' : 'http';
|
|
20
|
-
remoteFunctionUrl = url.toString();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// TODO(wittjosiah): This can probably be a module level import now due to lazy capability loading.
|
|
24
|
-
// Async import removes direct dependency on hyperformula.
|
|
25
|
-
const { defaultPlugins, ComputeGraphRegistry } = await import('@dxos/compute');
|
|
26
|
-
const computeGraphRegistry = new ComputeGraphRegistry({ plugins: defaultPlugins, remoteFunctionUrl });
|
|
27
|
-
return contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);
|
|
28
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes, Capabilities, createResolver } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { SHEET_PLUGIN } from '../meta';
|
|
8
|
-
import { createSheet, SheetAction } from '../types';
|
|
9
|
-
|
|
10
|
-
export default () =>
|
|
11
|
-
contributes(Capabilities.IntentResolver, [
|
|
12
|
-
createResolver({
|
|
13
|
-
intent: SheetAction.Create,
|
|
14
|
-
resolve: ({ name }) => ({ data: { object: createSheet({ name }) } }),
|
|
15
|
-
}),
|
|
16
|
-
createResolver({
|
|
17
|
-
intent: SheetAction.InsertAxis,
|
|
18
|
-
resolve: ({ model, axis, index, count }) => {
|
|
19
|
-
const _indices = model[axis === 'col' ? 'insertColumns' : 'insertRows'](index, count);
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
createResolver({
|
|
23
|
-
intent: SheetAction.DropAxis,
|
|
24
|
-
resolve: ({ model, axis, axisIndex, deletionData }, undo) => {
|
|
25
|
-
if (!undo) {
|
|
26
|
-
const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
27
|
-
return {
|
|
28
|
-
undoable: {
|
|
29
|
-
message: [`${axis} dropped label`, { ns: SHEET_PLUGIN }],
|
|
30
|
-
data: { ...undoData, model },
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
} else if (undo && deletionData) {
|
|
34
|
-
model[deletionData.axis === 'col' ? 'restoreColumn' : 'restoreRow'](deletionData);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
}),
|
|
38
|
-
]);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes, type PluginContext } from '@dxos/app-framework';
|
|
6
|
-
import { getSpace } from '@dxos/client/echo';
|
|
7
|
-
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
8
|
-
|
|
9
|
-
import { SheetCapabilities } from './capabilities';
|
|
10
|
-
import { computeGraphFacet } from '../extensions';
|
|
11
|
-
|
|
12
|
-
export default (context: PluginContext) =>
|
|
13
|
-
contributes(MarkdownCapabilities.Extensions, [
|
|
14
|
-
({ document: doc }) => {
|
|
15
|
-
const computeGraphRegistry = context.getCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
16
|
-
const space = getSpace(doc);
|
|
17
|
-
if (space) {
|
|
18
|
-
const computeGraph = computeGraphRegistry.getOrCreateGraph(space);
|
|
19
|
-
return computeGraphFacet.of(computeGraph);
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
]);
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
10
|
-
|
|
11
|
-
import { SheetCapabilities } from './capabilities';
|
|
12
|
-
import { ComputeGraphContextProvider, RangeList, SheetContainer } from '../components';
|
|
13
|
-
import { SHEET_PLUGIN } from '../meta';
|
|
14
|
-
import { SheetType } from '../types';
|
|
15
|
-
|
|
16
|
-
export default () =>
|
|
17
|
-
contributes(Capabilities.ReactSurface, [
|
|
18
|
-
createSurface({
|
|
19
|
-
id: `${SHEET_PLUGIN}/sheet`,
|
|
20
|
-
role: ['article', 'section'],
|
|
21
|
-
filter: (data): data is { subject: SheetType } =>
|
|
22
|
-
Obj.instanceOf(SheetType, data.subject) && !!getSpace(data.subject),
|
|
23
|
-
component: ({ data, role }) => {
|
|
24
|
-
const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<ComputeGraphContextProvider registry={computeGraphRegistry}>
|
|
28
|
-
<SheetContainer space={getSpace(data.subject)!} sheet={data.subject} role={role} />
|
|
29
|
-
</ComputeGraphContextProvider>
|
|
30
|
-
);
|
|
31
|
-
},
|
|
32
|
-
}),
|
|
33
|
-
createSurface({
|
|
34
|
-
id: `${SHEET_PLUGIN}/object-settings`,
|
|
35
|
-
role: 'object-settings',
|
|
36
|
-
filter: (data): data is { subject: SheetType } => Obj.instanceOf(SheetType, data.subject),
|
|
37
|
-
component: ({ data }) => <RangeList sheet={data.subject} />,
|
|
38
|
-
}),
|
|
39
|
-
]);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import { IntentPlugin } from '@dxos/app-framework';
|
|
11
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { useSpace } from '@dxos/react-client/echo';
|
|
13
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
14
|
-
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
15
|
-
|
|
16
|
-
import { GridSheet } from './GridSheet';
|
|
17
|
-
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '../../testing';
|
|
18
|
-
import { translations } from '../../translations';
|
|
19
|
-
import { SheetType } from '../../types';
|
|
20
|
-
import { useComputeGraph } from '../ComputeGraph';
|
|
21
|
-
import { SheetProvider } from '../SheetContext';
|
|
22
|
-
|
|
23
|
-
export const Basic = () => {
|
|
24
|
-
const space = useSpace();
|
|
25
|
-
const graph = useComputeGraph(space);
|
|
26
|
-
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
27
|
-
if (!sheet || !graph) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<SheetProvider graph={graph} sheet={sheet} ignoreAttention>
|
|
33
|
-
<GridSheet />
|
|
34
|
-
</SheetProvider>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const meta: Meta = {
|
|
39
|
-
title: 'plugins/plugin-sheet/GridSheet',
|
|
40
|
-
component: GridSheet,
|
|
41
|
-
decorators: [
|
|
42
|
-
withClientProvider({ types: [SheetType], createSpace: true }),
|
|
43
|
-
withComputeGraphDecorator(),
|
|
44
|
-
withTheme,
|
|
45
|
-
withLayout({ fullscreen: true, classNames: 'grid' }),
|
|
46
|
-
withPluginManager({
|
|
47
|
-
plugins: [IntentPlugin()],
|
|
48
|
-
}),
|
|
49
|
-
],
|
|
50
|
-
parameters: { translations },
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export default meta;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { Client } from '@dxos/client';
|
|
11
|
-
import { createDocAccessor } from '@dxos/client/echo';
|
|
12
|
-
import { defaultFunctions } from '@dxos/compute';
|
|
13
|
-
import { getRegisteredFunctionNames } from '@dxos/compute/testing';
|
|
14
|
-
import { automerge } from '@dxos/react-ui-editor';
|
|
15
|
-
import { CellEditor, type CellEditorProps } from '@dxos/react-ui-grid';
|
|
16
|
-
import { withTheme } from '@dxos/storybook-utils';
|
|
17
|
-
|
|
18
|
-
import { sheetExtension } from '../../extensions';
|
|
19
|
-
import { createSheet, SheetType } from '../../types';
|
|
20
|
-
|
|
21
|
-
type StoryProps = CellEditorProps;
|
|
22
|
-
|
|
23
|
-
const Story = ({ value, ...props }: StoryProps) => {
|
|
24
|
-
const extension = useMemo(() => {
|
|
25
|
-
const functionNames = getRegisteredFunctionNames();
|
|
26
|
-
const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
|
|
27
|
-
return [sheetExtension({ functions })];
|
|
28
|
-
}, []);
|
|
29
|
-
|
|
30
|
-
return <CellEditor {...props} value={value} extension={extension} />;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const AutomergeStory = ({ value, ...props }: StoryProps) => {
|
|
34
|
-
const cell = 'A1';
|
|
35
|
-
const [object, setObject] = useState<SheetType>();
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
setTimeout(async () => {
|
|
38
|
-
const client = new Client({ types: [SheetType] });
|
|
39
|
-
await client.initialize();
|
|
40
|
-
await client.halo.createIdentity();
|
|
41
|
-
const space = await client.spaces.create();
|
|
42
|
-
|
|
43
|
-
const sheet = createSheet();
|
|
44
|
-
sheet.name = 'Test';
|
|
45
|
-
sheet.cells[cell] = { value };
|
|
46
|
-
space.db.add(sheet);
|
|
47
|
-
setObject(sheet);
|
|
48
|
-
});
|
|
49
|
-
}, [value]);
|
|
50
|
-
|
|
51
|
-
const extension = useMemo(() => {
|
|
52
|
-
if (!object) {
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const functionNames = getRegisteredFunctionNames();
|
|
57
|
-
const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
|
|
58
|
-
const accessor = createDocAccessor(object, ['cells', cell, 'value']);
|
|
59
|
-
return [automerge(accessor), sheetExtension({ functions })];
|
|
60
|
-
}, [object]);
|
|
61
|
-
|
|
62
|
-
return <CellEditor {...props} value={value} extension={extension} />;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const Default = {};
|
|
66
|
-
|
|
67
|
-
export const AutoComplete = {
|
|
68
|
-
args: {
|
|
69
|
-
value: '=SUM',
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Formatting = {
|
|
74
|
-
args: {
|
|
75
|
-
value: '=SUM(A1:A2, 100, TRUE, "100", SUM(A1:A2, B1:B2))',
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const Automerge = {
|
|
80
|
-
render: (args: StoryProps) => <AutomergeStory {...args} />,
|
|
81
|
-
args: {
|
|
82
|
-
value: '=SUM(A1:A2, 100, TRUE, "100", SUM(A1:A2, B1:B2))',
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const meta: Meta = {
|
|
87
|
-
title: 'plugins/plugin-sheet/CellEditor',
|
|
88
|
-
component: CellEditor,
|
|
89
|
-
decorators: [withTheme],
|
|
90
|
-
render: (args: StoryProps) => <Story {...args} />,
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export default meta;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import { Capabilities, contributes, createResolver, IntentPlugin } from '@dxos/app-framework';
|
|
11
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
13
|
-
import { fullyQualifiedId, useSpace } from '@dxos/react-client/echo';
|
|
14
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import { AttendableContainer } from '@dxos/react-ui-attention';
|
|
16
|
-
import { withAttention } from '@dxos/react-ui-attention/testing';
|
|
17
|
-
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
18
|
-
|
|
19
|
-
import { SheetContainer } from './SheetContainer';
|
|
20
|
-
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '../../testing';
|
|
21
|
-
import { translations } from '../../translations';
|
|
22
|
-
import { SheetAction, SheetType } from '../../types';
|
|
23
|
-
import { useComputeGraph } from '../ComputeGraph';
|
|
24
|
-
import { RangeList } from '../RangeList';
|
|
25
|
-
|
|
26
|
-
export const Basic = () => {
|
|
27
|
-
const space = useSpace();
|
|
28
|
-
const graph = useComputeGraph(space);
|
|
29
|
-
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
30
|
-
if (!sheet || !space) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
|
|
36
|
-
<SheetContainer space={space} sheet={sheet} role='article' ignoreAttention />
|
|
37
|
-
</AttendableContainer>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const Spec = () => {
|
|
42
|
-
const space = useSpace();
|
|
43
|
-
const graph = useComputeGraph(space);
|
|
44
|
-
const sheet = useTestSheet(space, graph, { cells: { A1: { value: 'Ready' } } });
|
|
45
|
-
if (!sheet || !space) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
|
|
51
|
-
<div role='none' className='grid grid-rows-[66%_33%] grid-cols-1'>
|
|
52
|
-
<SheetContainer space={space} sheet={sheet} role='article' ignoreAttention />
|
|
53
|
-
<div role='none' data-testid='grid.range-list'>
|
|
54
|
-
<RangeList sheet={sheet} />
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</AttendableContainer>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const meta: Meta = {
|
|
62
|
-
title: 'plugins/plugin-sheet/SheetContainer',
|
|
63
|
-
component: SheetContainer,
|
|
64
|
-
decorators: [
|
|
65
|
-
withClientProvider({ types: [SheetType], createSpace: true }),
|
|
66
|
-
withComputeGraphDecorator(),
|
|
67
|
-
withTheme,
|
|
68
|
-
withLayout({ fullscreen: true, classNames: 'grid' }),
|
|
69
|
-
withAttention,
|
|
70
|
-
// TODO(wittjosiah): Consider whether we should refactor component so story doesn't need to depend on intents.
|
|
71
|
-
withPluginManager({
|
|
72
|
-
plugins: [IntentPlugin(), GraphPlugin()],
|
|
73
|
-
capabilities: [
|
|
74
|
-
contributes(
|
|
75
|
-
Capabilities.IntentResolver,
|
|
76
|
-
createResolver({
|
|
77
|
-
intent: SheetAction.DropAxis,
|
|
78
|
-
resolve: ({ model, axis, axisIndex }) => {
|
|
79
|
-
model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
),
|
|
83
|
-
],
|
|
84
|
-
}),
|
|
85
|
-
],
|
|
86
|
-
parameters: { translations },
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export default meta;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { fullyQualifiedId, type Space } from '@dxos/react-client/echo';
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
|
|
10
|
-
import { type SheetType } from '../../types';
|
|
11
|
-
import { useComputeGraph } from '../ComputeGraph';
|
|
12
|
-
import { FunctionEditor } from '../FunctionEditor';
|
|
13
|
-
import { GridSheet } from '../GridSheet';
|
|
14
|
-
import { SheetProvider } from '../SheetContext';
|
|
15
|
-
import { SheetToolbar } from '../SheetToolbar';
|
|
16
|
-
|
|
17
|
-
export type SheetContainerProps = {
|
|
18
|
-
space: Space;
|
|
19
|
-
sheet: SheetType;
|
|
20
|
-
role?: string;
|
|
21
|
-
ignoreAttention?: boolean;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const SheetContainer = ({ space, sheet, role, ignoreAttention }: SheetContainerProps) => {
|
|
25
|
-
const graph = useComputeGraph(space);
|
|
26
|
-
|
|
27
|
-
return graph ? (
|
|
28
|
-
<SheetProvider sheet={sheet} graph={graph} ignoreAttention={ignoreAttention}>
|
|
29
|
-
<StackItem.Content toolbar statusbar {...(role === 'section' && { classNames: 'aspect-video' })}>
|
|
30
|
-
<SheetToolbar id={fullyQualifiedId(sheet)} />
|
|
31
|
-
<GridSheet />
|
|
32
|
-
<FunctionEditor />
|
|
33
|
-
</StackItem.Content>
|
|
34
|
-
</SheetProvider>
|
|
35
|
-
) : null;
|
|
36
|
-
};
|
package/src/types/schema.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
8
|
-
|
|
9
|
-
export const CellValue = Schema.Struct({
|
|
10
|
-
// TODO(burdon): How to store dates (datetime, date, time), percentages, etc.
|
|
11
|
-
// Consider import/export; natural access for other plugins. Special handling for currency (precision).
|
|
12
|
-
// TODO(burdon): Automerge (long string) or short string or number.
|
|
13
|
-
value: Schema.Any,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export type CellValue = Schema.Schema.Type<typeof CellValue>;
|
|
17
|
-
|
|
18
|
-
// TODO(burdon): IMPORTANT: Reconcile with Field definition.
|
|
19
|
-
export const Range = Schema.Struct({
|
|
20
|
-
range: Schema.String,
|
|
21
|
-
key: Schema.String,
|
|
22
|
-
value: Schema.String,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export type Range = Schema.Schema.Type<typeof Range>;
|
|
26
|
-
|
|
27
|
-
// TODO(burdon): Visibility, locked, frozen, etc.
|
|
28
|
-
export const RowColumnMeta = Schema.Struct({
|
|
29
|
-
size: Schema.optional(Schema.Number),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// TODO(burdon): Reconcile col/column (across packages).
|
|
33
|
-
// TODO(burdon): Index to all updates when rows/columns are inserted/deleted.
|
|
34
|
-
export const SheetType = Schema.Struct({
|
|
35
|
-
name: Schema.optional(Schema.String),
|
|
36
|
-
|
|
37
|
-
// Sparse map of cells referenced by index.
|
|
38
|
-
cells: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(CellValue) })),
|
|
39
|
-
|
|
40
|
-
// Ordered row indices.
|
|
41
|
-
rows: Schema.mutable(Schema.Array(Schema.String)),
|
|
42
|
-
|
|
43
|
-
// Ordered column indices.
|
|
44
|
-
columns: Schema.mutable(Schema.Array(Schema.String)),
|
|
45
|
-
|
|
46
|
-
// Row metadata referenced by index.
|
|
47
|
-
rowMeta: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(RowColumnMeta) })),
|
|
48
|
-
|
|
49
|
-
// Column metadata referenced by index.
|
|
50
|
-
columnMeta: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(RowColumnMeta) })),
|
|
51
|
-
|
|
52
|
-
// Cell formatting referenced by indexed range.
|
|
53
|
-
ranges: Schema.mutable(Schema.Array(Range)),
|
|
54
|
-
}).pipe(
|
|
55
|
-
Type.Obj({
|
|
56
|
-
typename: 'dxos.org/type/Sheet',
|
|
57
|
-
version: '0.1.0',
|
|
58
|
-
}),
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
export interface SheetType extends Schema.Schema.Type<typeof SheetType> {}
|
|
File without changes
|