@dxos/plugin-sheet 0.8.4-main.937b3ca → 0.8.4-main.abd8ff62ef
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/SheetPlugin-W4PFP6WG.mjs +92 -0
- package/dist/lib/browser/SheetPlugin-W4PFP6WG.mjs.map +7 -0
- package/dist/lib/browser/chunk-5TXOUIGZ.mjs +118 -0
- package/dist/lib/browser/chunk-5TXOUIGZ.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/{chunk-2SAGT3BB.mjs → chunk-SVGX3MWY.mjs} +34 -169
- package/dist/lib/browser/chunk-SVGX3MWY.mjs.map +7 -0
- package/dist/lib/browser/drop-axis-ZLERPPPH.mjs +23 -0
- package/dist/lib/browser/drop-axis-ZLERPPPH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +24 -135
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/insert-axis-WTRA3HE7.mjs +16 -0
- package/dist/lib/browser/insert-axis-WTRA3HE7.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-PYGPW2TB.mjs +16 -0
- package/dist/lib/browser/restore-axis-PYGPW2TB.mjs.map +7 -0
- package/dist/lib/browser/scroll-to-anchor-6I4DNKBW.mjs +65 -0
- package/dist/lib/browser/scroll-to-anchor-6I4DNKBW.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +55 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -3
- package/dist/lib/node-esm/SheetPlugin-ZJRSEYHB.mjs +93 -0
- package/dist/lib/node-esm/SheetPlugin-ZJRSEYHB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IMWGSIDG.mjs → chunk-4A2KAXTF.mjs} +34 -169
- package/dist/lib/node-esm/chunk-4A2KAXTF.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/chunk-MCZFRYOP.mjs +119 -0
- package/dist/lib/node-esm/chunk-MCZFRYOP.mjs.map +7 -0
- package/dist/lib/node-esm/drop-axis-FV2GXSZP.mjs +24 -0
- package/dist/lib/node-esm/drop-axis-FV2GXSZP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +24 -135
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/insert-axis-THXK6DCC.mjs +17 -0
- package/dist/lib/node-esm/insert-axis-THXK6DCC.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-JIFT3Q7Z.mjs +17 -0
- package/dist/lib/node-esm/restore-axis-JIFT3Q7Z.mjs.map +7 -0
- package/dist/lib/node-esm/scroll-to-anchor-JRDC5KK2.mjs +66 -0
- package/dist/lib/node-esm/scroll-to-anchor-JRDC5KK2.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +56 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -3
- package/dist/types/src/SheetPlugin.d.ts +1 -0
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/SheetPlugin.node.d.ts +4 -0
- package/dist/types/src/SheetPlugin.node.d.ts.map +1 -0
- package/dist/types/src/SheetPlugin.test.d.ts +2 -0
- package/dist/types/src/SheetPlugin.test.d.ts.map +1 -0
- 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/ComputeGraphContextProvider.d.ts +1 -1
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts +17 -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 +6 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +93 -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} +8 -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 +6 -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 +5 -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 +2 -2
- package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/style.d.ts +2 -2
- package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -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 +1 -1
- package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -0
- package/dist/types/src/containers/RangeList/index.d.ts +2 -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 +92 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SheetContainer/index.d.ts +2 -0
- package/dist/types/src/containers/SheetContainer/index.d.ts.map +1 -0
- 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.map +1 -1
- package/dist/types/src/extensions/editor/sheet-extension.d.ts +1 -1
- package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts +1 -3
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +2 -2
- 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 +2 -2
- 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/playwright/playwright.config.d.ts.map +1 -1
- package/dist/types/src/playwright/sheet-manager.d.ts.map +1 -1
- 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 +13 -13
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +74 -39
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Sheet.d.ts +21 -21
- package/dist/types/src/types/Sheet.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +13 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/sheet-range-types.d.ts +1 -1
- package/dist/types/src/types/sheet-range-types.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/src/types/util.d.ts +3 -2
- package/dist/types/src/types/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +89 -70
- package/src/SheetPlugin.node.ts +36 -0
- package/src/SheetPlugin.test.ts +30 -0
- package/src/SheetPlugin.tsx +51 -31
- 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} +5 -3
- package/src/capabilities/index.ts +13 -5
- package/src/capabilities/{markdown/markdown.ts → markdown.ts} +4 -3
- 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/ComputeGraphContextProvider.tsx +1 -1
- package/src/components/ComputeGraph/compute-graph.stories.tsx +19 -16
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.tsx +10 -9
- package/src/components/{GridSheet/GridSheet.stories.tsx → SheetContent/SheetContent.stories.tsx} +20 -19
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +56 -33
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +6 -5
- package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +52 -39
- package/src/components/{GridSheet → SheetRoot}/index.ts +1 -1
- package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx} +20 -8
- package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +5 -5
- package/src/components/SheetToolbar/SheetToolbar.tsx +19 -23
- package/src/components/SheetToolbar/align.ts +15 -15
- package/src/components/SheetToolbar/style.ts +12 -12
- package/src/components/index.ts +1 -7
- package/src/{components → containers}/RangeList/RangeList.tsx +17 -16
- package/src/containers/RangeList/index.ts +5 -0
- package/src/{components → containers}/SheetContainer/SheetContainer.stories.tsx +42 -46
- package/src/containers/SheetContainer/SheetContainer.tsx +57 -0
- package/src/containers/SheetContainer/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/extensions/compute.stories.tsx +17 -16
- package/src/extensions/compute.ts +1 -1
- package/src/extensions/editor/sheet-extension.test.ts +1 -1
- package/src/extensions/editor/sheet-extension.ts +12 -12
- package/src/index.ts +8 -2
- package/src/integrations/thread-ranges.ts +8 -41
- package/src/meta.ts +1 -1
- package/src/model/sheet-model.test.ts +5 -5
- package/src/model/sheet-model.ts +39 -37
- package/src/model/testing.ts +2 -2
- package/src/model/useSheetModel.ts +3 -2
- 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 +3 -3
- 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 +4 -4
- package/src/translations.ts +41 -36
- package/src/types/Sheet.ts +17 -20
- package/src/types/capabilities.ts +15 -3
- package/src/types/sheet-range-types.ts +3 -3
- package/src/types/types.ts +0 -80
- package/src/types/util.ts +3 -2
- package/dist/lib/browser/SheetContainer-ESCXPI7Y.mjs +0 -397
- package/dist/lib/browser/SheetContainer-ESCXPI7Y.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-JBRMW6OY.mjs +0 -23
- package/dist/lib/browser/anchor-sort-JBRMW6OY.mjs.map +0 -7
- package/dist/lib/browser/chunk-2SAGT3BB.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-W6N44ONZ.mjs +0 -1470
- package/dist/lib/browser/chunk-W6N44ONZ.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-DL2PX7TF.mjs +0 -21
- package/dist/lib/browser/compute-graph-registry-DL2PX7TF.mjs.map +0 -7
- package/dist/lib/browser/markdown-BC4KBDUO.mjs +0 -29
- package/dist/lib/browser/markdown-BC4KBDUO.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-FJ4UWZUM.mjs +0 -79
- package/dist/lib/browser/operation-resolver-FJ4UWZUM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-5BXM6TJ3.mjs +0 -51
- package/dist/lib/browser/react-surface-5BXM6TJ3.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-YVIDJKP4.mjs +0 -398
- package/dist/lib/node-esm/SheetContainer-YVIDJKP4.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-C3XFPI6S.mjs +0 -24
- package/dist/lib/node-esm/anchor-sort-C3XFPI6S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IMWGSIDG.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-S7RYX7DG.mjs +0 -1471
- package/dist/lib/node-esm/chunk-S7RYX7DG.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-VXH55GDI.mjs +0 -22
- package/dist/lib/node-esm/compute-graph-registry-VXH55GDI.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-6DGZCJRM.mjs +0 -30
- package/dist/lib/node-esm/markdown-6DGZCJRM.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-OGXEUWHA.mjs +0 -80
- package/dist/lib/node-esm/operation-resolver-OGXEUWHA.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RLHC6B77.mjs +0 -52
- package/dist/lib/node-esm/react-surface-RLHC6B77.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/SheetContainer/index.d.ts +0 -3
- package/dist/types/src/components/SheetContainer/index.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/SheetContainer/index.ts +0 -7
- package/src/components/SheetContext/index.ts +0 -5
- /package/dist/types/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.d.ts +0 -0
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
9
|
|
|
10
|
-
import { translations } from '
|
|
10
|
+
import { translations } from '#translations';
|
|
11
11
|
|
|
12
12
|
import { SheetToolbar } from './SheetToolbar';
|
|
13
13
|
|
|
14
14
|
const DefaultStory = () => {
|
|
15
|
-
// TODO(wittjosiah): Depends on
|
|
15
|
+
// TODO(wittjosiah): Depends on SheetRoot.
|
|
16
16
|
// return <SheetToolbar id='test' />;
|
|
17
17
|
return <>TODO</>;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const meta = {
|
|
21
|
-
title: 'plugins/plugin-sheet/Toolbar',
|
|
21
|
+
title: 'plugins/plugin-sheet/components/Toolbar',
|
|
22
22
|
component: SheetToolbar as any,
|
|
23
23
|
render: DefaultStory,
|
|
24
|
-
decorators: [withTheme],
|
|
24
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
25
25
|
parameters: {
|
|
26
26
|
layout: 'fullscreen',
|
|
27
27
|
translations,
|
|
@@ -3,21 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Atom, type Registry, RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useContext, useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useAppGraph } from '@dxos/app-
|
|
9
|
-
import { type CompleteCellRange } from '@dxos/compute';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
MenuProvider,
|
|
13
|
-
ToolbarMenu,
|
|
14
|
-
createGapSeparator,
|
|
15
|
-
useMenuActions,
|
|
16
|
-
} from '@dxos/react-ui-menu';
|
|
8
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type CompleteCellRange } from '@dxos/compute-hyperformula';
|
|
10
|
+
import { type ActionGraphProps, Menu, createGapSeparator, useMenuActions } from '@dxos/react-ui-menu';
|
|
11
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
17
12
|
|
|
18
13
|
import { type SheetModel } from '../../model';
|
|
19
|
-
import { useSheetContext } from '../
|
|
20
|
-
|
|
14
|
+
import { useSheetContext } from '../SheetRoot';
|
|
21
15
|
import { createAlign, useAlignState } from './align';
|
|
22
16
|
import { createStyle, useStyleState } from './style';
|
|
23
17
|
import { type ToolbarStateAtom, useToolbarState } from './useToolbarState';
|
|
@@ -59,10 +53,10 @@ const createToolbarActions = ({
|
|
|
59
53
|
});
|
|
60
54
|
};
|
|
61
55
|
|
|
62
|
-
export type SheetToolbarProps =
|
|
56
|
+
export type SheetToolbarProps = {};
|
|
63
57
|
|
|
64
|
-
export const SheetToolbar = (
|
|
65
|
-
const { model, cursorFallbackRange } = useSheetContext();
|
|
58
|
+
export const SheetToolbar = composable<HTMLDivElement, SheetToolbarProps>((props, forwardedRef) => {
|
|
59
|
+
const { attendableId, model, cursorFallbackRange } = useSheetContext();
|
|
66
60
|
const stateAtom = useToolbarState({});
|
|
67
61
|
const registry = useContext(RegistryContext);
|
|
68
62
|
useAlignState(stateAtom);
|
|
@@ -71,24 +65,26 @@ export const SheetToolbar = ({ id }: SheetToolbarProps) => {
|
|
|
71
65
|
const { graph } = useAppGraph();
|
|
72
66
|
const customActions = useMemo(() => {
|
|
73
67
|
return Atom.make((get) => {
|
|
74
|
-
const actions = get(graph.actions(
|
|
68
|
+
const actions = get(graph.actions(attendableId));
|
|
75
69
|
const nodes = actions.filter((action) => action.properties.disposition === 'toolbar');
|
|
76
70
|
return {
|
|
77
71
|
nodes,
|
|
78
|
-
edges: nodes.map((node) => ({ source: 'root', target: node.id })),
|
|
72
|
+
edges: nodes.map((node) => ({ source: 'root', target: node.id, relation: 'child' })),
|
|
79
73
|
};
|
|
80
74
|
});
|
|
81
|
-
}, [graph,
|
|
75
|
+
}, [graph, attendableId]);
|
|
82
76
|
|
|
83
77
|
const actionsCreator = useMemo(
|
|
84
78
|
() => createToolbarActions({ model, stateAtom, registry, cursorFallbackRange, customActions }),
|
|
85
79
|
[model, stateAtom, registry, cursorFallbackRange, customActions],
|
|
86
80
|
);
|
|
87
|
-
const
|
|
81
|
+
const menuActions = useMenuActions(actionsCreator);
|
|
88
82
|
|
|
89
83
|
return (
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
</
|
|
84
|
+
<Menu.Root {...menuActions} attendableId={attendableId}>
|
|
85
|
+
<Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />
|
|
86
|
+
</Menu.Root>
|
|
93
87
|
);
|
|
94
|
-
};
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
SheetToolbar.displayName = 'SheetToolbar';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Registry, RegistryContext } from '@effect-atom/atom-react';
|
|
6
6
|
import { useContext, useEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type CompleteCellRange, inRange } from '@dxos/compute';
|
|
8
|
+
import { type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import {
|
|
11
11
|
type ActionGraphProps,
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
createMenuItemGroup,
|
|
15
15
|
} from '@dxos/react-ui-menu';
|
|
16
16
|
|
|
17
|
-
import { meta } from '
|
|
18
|
-
import { type
|
|
19
|
-
import { type AlignKey, type AlignValue, alignKey, rangeFromIndex, rangeToIndex } from '../../types';
|
|
20
|
-
import { useSheetContext } from '../SheetContext';
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { type AlignKey, type AlignValue, alignKey, rangeFromIndex, rangeToIndex } from '#types';
|
|
21
19
|
|
|
20
|
+
import { type SheetModel } from '../../model';
|
|
21
|
+
import { useSheetContext } from '../SheetRoot';
|
|
22
22
|
import { type ToolbarState, type ToolbarStateAtom } from './useToolbarState';
|
|
23
23
|
|
|
24
24
|
export type AlignAction = { key: AlignKey; value: AlignValue };
|
|
@@ -50,7 +50,7 @@ export const useAlignState = (stateAtom: ToolbarStateAtom) => {
|
|
|
50
50
|
|
|
51
51
|
const createAlignGroupAction = (value?: AlignValue) =>
|
|
52
52
|
createMenuItemGroup('align', {
|
|
53
|
-
label: ['align
|
|
53
|
+
label: ['align.label', { ns: meta.id }],
|
|
54
54
|
variant: 'toggleGroup',
|
|
55
55
|
selectCardinality: 'single',
|
|
56
56
|
value: `${alignKey}--${value}`,
|
|
@@ -84,18 +84,18 @@ const createAlignActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
84
84
|
};
|
|
85
85
|
const currentState = registry.get(stateAtom);
|
|
86
86
|
if (index < 0) {
|
|
87
|
-
Obj.
|
|
88
|
-
|
|
87
|
+
Obj.update(model.sheet, (obj) => {
|
|
88
|
+
obj.ranges?.push(nextRangeEntity);
|
|
89
89
|
});
|
|
90
90
|
registry.set(stateAtom, { ...currentState, [alignKey]: nextRangeEntity.value });
|
|
91
91
|
} else if (model.sheet.ranges![index].value === nextRangeEntity.value) {
|
|
92
|
-
Obj.
|
|
93
|
-
|
|
92
|
+
Obj.update(model.sheet, (obj) => {
|
|
93
|
+
obj.ranges?.splice(index, 1);
|
|
94
94
|
});
|
|
95
95
|
registry.set(stateAtom, { ...currentState, [alignKey]: undefined });
|
|
96
96
|
} else {
|
|
97
|
-
Obj.
|
|
98
|
-
|
|
97
|
+
Obj.update(model.sheet, (obj) => {
|
|
98
|
+
obj.ranges?.splice(index, 1, nextRangeEntity);
|
|
99
99
|
});
|
|
100
100
|
registry.set(stateAtom, { ...currentState, [alignKey]: nextRangeEntity.value });
|
|
101
101
|
}
|
|
@@ -104,7 +104,7 @@ const createAlignActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
104
104
|
key: alignKey,
|
|
105
105
|
value: alignValue as AlignValue,
|
|
106
106
|
checked: state[alignKey] === alignValue,
|
|
107
|
-
label: [`range
|
|
107
|
+
label: [`range-value.${alignValue}.label`, { ns: meta.id }],
|
|
108
108
|
icon,
|
|
109
109
|
testId: `grid.toolbar.${alignKey}.${alignValue}`,
|
|
110
110
|
},
|
|
@@ -117,8 +117,8 @@ export const createAlign = (context: AlignActionsContext): ActionGraphProps => {
|
|
|
117
117
|
return {
|
|
118
118
|
nodes: [alignGroup, ...alignActions],
|
|
119
119
|
edges: [
|
|
120
|
-
{ source: 'root', target: 'align' },
|
|
121
|
-
...alignActions.map(({ id }) => ({ source: alignGroup.id, target: id })),
|
|
120
|
+
{ source: 'root', target: 'align', relation: 'child' },
|
|
121
|
+
...alignActions.map(({ id }) => ({ source: alignGroup.id, target: id, relation: 'child' })),
|
|
122
122
|
],
|
|
123
123
|
};
|
|
124
124
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Registry, RegistryContext } from '@effect-atom/atom-react';
|
|
6
6
|
import { useContext, useEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type CompleteCellRange, inRange } from '@dxos/compute';
|
|
8
|
+
import { type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import {
|
|
11
11
|
type ActionGraphProps,
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
createMenuItemGroup,
|
|
15
15
|
} from '@dxos/react-ui-menu';
|
|
16
16
|
|
|
17
|
-
import { meta } from '
|
|
18
|
-
import { type
|
|
19
|
-
import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '../../types';
|
|
20
|
-
import { useSheetContext } from '../SheetContext';
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '#types';
|
|
21
19
|
|
|
20
|
+
import { type SheetModel } from '../../model';
|
|
21
|
+
import { useSheetContext } from '../SheetRoot';
|
|
22
22
|
import { type ToolbarState, type ToolbarStateAtom } from './useToolbarState';
|
|
23
23
|
|
|
24
24
|
export type StyleState = Partial<Record<StyleValue, boolean>>;
|
|
@@ -103,14 +103,14 @@ const createStyleActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
103
103
|
) {
|
|
104
104
|
// this value should be unset
|
|
105
105
|
if (index >= 0) {
|
|
106
|
-
Obj.
|
|
107
|
-
|
|
106
|
+
Obj.update(model.sheet, (obj) => {
|
|
107
|
+
obj.ranges?.splice(index, 1);
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
registry.set(stateAtom, { ...currentState, [nextRangeEntity.value]: false });
|
|
111
111
|
} else {
|
|
112
|
-
Obj.
|
|
113
|
-
|
|
112
|
+
Obj.update(model.sheet, (obj) => {
|
|
113
|
+
obj.ranges?.push(nextRangeEntity);
|
|
114
114
|
});
|
|
115
115
|
registry.set(stateAtom, { ...currentState, [nextRangeEntity.value]: true });
|
|
116
116
|
}
|
|
@@ -119,7 +119,7 @@ const createStyleActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
119
119
|
key: 'style',
|
|
120
120
|
value: styleValue as StyleValue,
|
|
121
121
|
icon,
|
|
122
|
-
label: [`range
|
|
122
|
+
label: [`range-value.${styleValue}.label`, { ns: meta.id }],
|
|
123
123
|
checked: !!state[styleValue as StyleValue],
|
|
124
124
|
},
|
|
125
125
|
);
|
|
@@ -131,8 +131,8 @@ export const createStyle = (context: StyleActionsContext): ActionGraphProps => {
|
|
|
131
131
|
return {
|
|
132
132
|
nodes: [styleGroupAction, ...styleActions],
|
|
133
133
|
edges: [
|
|
134
|
-
{ source: 'root', target: 'style' },
|
|
135
|
-
...styleActions.map(({ id }) => ({ source: styleGroupAction.id, target: id })),
|
|
134
|
+
{ source: 'root', target: 'style', relation: 'child' },
|
|
135
|
+
...styleActions.map(({ id }) => ({ source: styleGroupAction.id, target: id, relation: 'child' })),
|
|
136
136
|
],
|
|
137
137
|
};
|
|
138
138
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -2,11 +2,5 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
6
|
-
|
|
7
5
|
export * from './ComputeGraph';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './RangeList';
|
|
10
|
-
export * from './SheetContext';
|
|
11
|
-
|
|
12
|
-
export const SheetContainer = lazy(() => import('./SheetContainer'));
|
|
6
|
+
export * from './Sheet';
|
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import { rangeToA1Notation } from '@dxos/compute';
|
|
8
|
+
import { rangeToA1Notation } from '@dxos/compute-hyperformula';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
|
-
import {
|
|
10
|
+
import { Input, Message, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { List } from '@dxos/react-ui-list';
|
|
12
|
-
import { ghostHover } from '@dxos/ui-theme';
|
|
13
12
|
|
|
14
|
-
import { meta } from '
|
|
15
|
-
import { rangeFromIndex } from '
|
|
16
|
-
import { Sheet } from '
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
import { rangeFromIndex } from '#types';
|
|
15
|
+
import { Sheet } from '#types';
|
|
17
16
|
|
|
18
17
|
export type RangeListProps = {
|
|
19
18
|
sheet: Sheet.Sheet;
|
|
@@ -26,30 +25,32 @@ export const RangeList = ({ sheet }: RangeListProps) => {
|
|
|
26
25
|
const handleDeleteRange = useCallback(
|
|
27
26
|
(range: Sheet.Range) => {
|
|
28
27
|
const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);
|
|
29
|
-
Obj.
|
|
30
|
-
|
|
28
|
+
Obj.update(sheet, (sheet) => {
|
|
29
|
+
sheet.ranges.splice(index, 1);
|
|
31
30
|
});
|
|
32
31
|
},
|
|
33
32
|
[sheet],
|
|
34
33
|
);
|
|
35
34
|
return (
|
|
36
35
|
<>
|
|
37
|
-
<
|
|
36
|
+
<Input.Root>
|
|
37
|
+
<Input.Label>{t('range-list.heading')}</Input.Label>
|
|
38
|
+
</Input.Root>
|
|
38
39
|
{sheet.ranges.length < 1 ? (
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
</
|
|
40
|
+
<Message.Root>
|
|
41
|
+
<Message.Title>{t('no-ranges.message')}</Message.Title>
|
|
42
|
+
</Message.Root>
|
|
42
43
|
) : (
|
|
43
44
|
<List.Root<Sheet.Range> items={sheet.ranges} isItem={Schema.is(Sheet.Range)}>
|
|
44
45
|
{({ items: ranges }) =>
|
|
45
46
|
ranges.map((range, i) => (
|
|
46
|
-
<List.Item key={i} item={range}
|
|
47
|
+
<List.Item key={i} item={range}>
|
|
47
48
|
<List.ItemDragHandle />
|
|
48
49
|
<List.ItemTitle onClick={() => handleSelectRange(range)}>
|
|
49
|
-
{t('range
|
|
50
|
+
{t('range.title', {
|
|
50
51
|
position: rangeToA1Notation(rangeFromIndex(sheet, range.range)),
|
|
51
|
-
key: t(`range
|
|
52
|
-
value: t(`range
|
|
52
|
+
key: t(`range-key.${range.key}.label`),
|
|
53
|
+
value: t(`range-value.${range.value}.label`),
|
|
53
54
|
})}
|
|
54
55
|
</List.ItemTitle>
|
|
55
56
|
<List.ItemDeleteButton onClick={() => handleDeleteRange(range)} />
|
|
@@ -4,49 +4,48 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { useContext } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { Operation, OperationHandlerSet } from '@dxos/compute';
|
|
11
12
|
import { Obj } from '@dxos/echo';
|
|
12
|
-
import { OperationResolver } from '@dxos/operation';
|
|
13
13
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
14
|
-
import {
|
|
14
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
15
15
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
16
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
16
|
import { AttendableContainer } from '@dxos/react-ui-attention';
|
|
17
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
19
|
+
import { ComputeGraphContext, useComputeGraph } from '#components';
|
|
20
|
+
import { SheetOperation } from '#operations';
|
|
21
|
+
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '#testing';
|
|
22
|
+
import { translations } from '#translations';
|
|
23
|
+
import { Sheet } from '#types';
|
|
24
24
|
|
|
25
|
+
import RangeList from '../RangeList';
|
|
25
26
|
import { SheetContainer } from './SheetContainer';
|
|
26
27
|
|
|
27
28
|
const meta = {
|
|
28
|
-
title: 'plugins/plugin-sheet/SheetContainer',
|
|
29
|
+
title: 'plugins/plugin-sheet/containers/SheetContainer',
|
|
29
30
|
component: SheetContainer,
|
|
30
31
|
decorators: [
|
|
31
|
-
withTheme,
|
|
32
32
|
withLayout({ layout: 'fullscreen' }),
|
|
33
33
|
withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
|
|
34
34
|
withComputeGraphDecorator(),
|
|
35
|
-
// TODO(wittjosiah): Consider whether we should refactor component so story doesn't need to depend on intents.
|
|
36
35
|
withPluginManager({
|
|
37
36
|
plugins: [...corePlugins()],
|
|
38
37
|
capabilities: [
|
|
39
|
-
Capability.contributes(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
Capability.contributes(
|
|
39
|
+
Capabilities.OperationHandler,
|
|
40
|
+
OperationHandlerSet.make(
|
|
41
|
+
Operation.withHandler(SheetOperation.DropAxis, ({ model, axis, axisIndex }) =>
|
|
43
42
|
Effect.sync(() => {
|
|
44
43
|
model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
45
|
-
// Return stub output for story purposes.
|
|
46
44
|
return { axis, axisIndex, index: 0, axisMeta: null, values: [] };
|
|
47
45
|
}),
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
),
|
|
50
49
|
],
|
|
51
50
|
}),
|
|
52
51
|
],
|
|
@@ -59,51 +58,48 @@ const meta = {
|
|
|
59
58
|
export default meta;
|
|
60
59
|
|
|
61
60
|
export const Default = () => {
|
|
62
|
-
const space =
|
|
61
|
+
const [space] = useSpaces();
|
|
63
62
|
const graph = useComputeGraph(space);
|
|
63
|
+
const { registry } = useContext(ComputeGraphContext) ?? {};
|
|
64
64
|
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
65
|
-
if (!sheet || !space) {
|
|
65
|
+
if (!sheet || !space || !registry) {
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
70
|
<AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
|
|
71
|
-
<SheetContainer
|
|
71
|
+
<SheetContainer
|
|
72
|
+
role='article'
|
|
73
|
+
space={space}
|
|
74
|
+
subject={sheet}
|
|
75
|
+
attendableId='test'
|
|
76
|
+
registry={registry}
|
|
77
|
+
ignoreAttention
|
|
78
|
+
/>
|
|
72
79
|
</AttendableContainer>
|
|
73
80
|
);
|
|
74
81
|
};
|
|
75
82
|
|
|
76
|
-
export const Section = () => {
|
|
77
|
-
const space = useSpace();
|
|
78
|
-
const graph = useComputeGraph(space);
|
|
79
|
-
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
80
|
-
if (!sheet || !space) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<div className='is-full flex justify-center'>
|
|
86
|
-
<div className='is-[40rem]'>
|
|
87
|
-
<AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
|
|
88
|
-
<SheetContainer role='section' space={space} subject={sheet} ignoreAttention />
|
|
89
|
-
</AttendableContainer>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
83
|
export const Spec = () => {
|
|
96
|
-
const space =
|
|
84
|
+
const [space] = useSpaces();
|
|
97
85
|
const graph = useComputeGraph(space);
|
|
86
|
+
const { registry } = useContext(ComputeGraphContext) ?? {};
|
|
98
87
|
const sheet = useTestSheet(space, graph, { cells: { A1: { value: 'Ready' } } });
|
|
99
|
-
if (!sheet || !space) {
|
|
88
|
+
if (!sheet || !space || !registry) {
|
|
100
89
|
return null;
|
|
101
90
|
}
|
|
102
91
|
|
|
103
92
|
return (
|
|
104
93
|
<AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
|
|
105
|
-
<div role='none' className='
|
|
106
|
-
<SheetContainer
|
|
94
|
+
<div role='none' className='w-full grid grid-cols-[1fr_20rem]'>
|
|
95
|
+
<SheetContainer
|
|
96
|
+
role='article'
|
|
97
|
+
space={space}
|
|
98
|
+
subject={sheet}
|
|
99
|
+
attendableId='test'
|
|
100
|
+
registry={registry}
|
|
101
|
+
ignoreAttention
|
|
102
|
+
/>
|
|
107
103
|
<div role='none' data-testid='grid.range-list'>
|
|
108
104
|
<RangeList sheet={sheet} />
|
|
109
105
|
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
|
|
9
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
+
import { Panel } from '@dxos/react-ui';
|
|
11
|
+
|
|
12
|
+
import { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';
|
|
13
|
+
import { type Sheet as SheetType } from '#types';
|
|
14
|
+
|
|
15
|
+
export type SheetContainerProps = AppSurface.ObjectArticleProps<
|
|
16
|
+
SheetType.Sheet,
|
|
17
|
+
{
|
|
18
|
+
space: Space;
|
|
19
|
+
registry: ComputeGraphRegistry;
|
|
20
|
+
ignoreAttention?: boolean;
|
|
21
|
+
}
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export const SheetContainer = ({ registry, ...props }: SheetContainerProps) => (
|
|
25
|
+
<ComputeGraphContextProvider registry={registry}>
|
|
26
|
+
<SheetContainerInner {...props} />
|
|
27
|
+
</ComputeGraphContextProvider>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const SheetContainerInner = ({
|
|
31
|
+
role,
|
|
32
|
+
subject: sheet,
|
|
33
|
+
attendableId,
|
|
34
|
+
space,
|
|
35
|
+
ignoreAttention,
|
|
36
|
+
}: Omit<SheetContainerProps, 'registry'>) => {
|
|
37
|
+
const graph = useComputeGraph(space);
|
|
38
|
+
if (!graph) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Sheet.Root graph={graph} sheet={sheet} attendableId={attendableId!} ignoreAttention={ignoreAttention}>
|
|
44
|
+
<Panel.Root classNames={role === 'section' && 'aspect-aquare'}>
|
|
45
|
+
<Panel.Toolbar asChild>
|
|
46
|
+
<Sheet.Toolbar />
|
|
47
|
+
</Panel.Toolbar>
|
|
48
|
+
<Panel.Content asChild>
|
|
49
|
+
<Sheet.Content />
|
|
50
|
+
</Panel.Content>
|
|
51
|
+
<Panel.Statusbar asChild>
|
|
52
|
+
<Sheet.Statusbar />
|
|
53
|
+
</Panel.Statusbar>
|
|
54
|
+
</Panel.Root>
|
|
55
|
+
</Sheet.Root>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const RangeList: ComponentType<any> = lazy(() => import('./RangeList'));
|
|
8
|
+
export const SheetContainer: ComponentType<any> = lazy(() => import('./SheetContainer'));
|
|
@@ -8,11 +8,11 @@ import React, { useEffect, useMemo } from 'react';
|
|
|
8
8
|
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { PublicKey } from '@dxos/keys';
|
|
11
|
-
import {
|
|
11
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { useThemeContext } from '@dxos/react-ui';
|
|
14
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
15
14
|
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
15
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
16
16
|
import {
|
|
17
17
|
createBasicExtensions,
|
|
18
18
|
createMarkdownExtensions,
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
} from '@dxos/ui-editor';
|
|
23
23
|
import { isNonNullable } from '@dxos/util';
|
|
24
24
|
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { Sheet } from '../types';
|
|
25
|
+
import { Sheet, useComputeGraph } from '#components';
|
|
26
|
+
import { useTestSheet, withComputeGraphDecorator } from '#testing';
|
|
27
|
+
import { Sheet as SheetType } from '#types';
|
|
29
28
|
|
|
29
|
+
import { useSheetModel } from '../model';
|
|
30
30
|
import { compute, computeGraphFacet } from './compute';
|
|
31
31
|
|
|
32
32
|
const str = (...lines: string[]) => lines.join('\n');
|
|
@@ -45,7 +45,7 @@ const SHEET_NAME = 'Test Sheet';
|
|
|
45
45
|
const DefaultStory = ({ text }: EditorProps) => {
|
|
46
46
|
const id = useMemo(() => PublicKey.random(), []);
|
|
47
47
|
const { themeMode } = useThemeContext();
|
|
48
|
-
const space =
|
|
48
|
+
const [space] = useSpaces();
|
|
49
49
|
const computeGraph = useComputeGraph(space);
|
|
50
50
|
const { parentRef, focusAttributes } = useTextEditor(
|
|
51
51
|
() => ({
|
|
@@ -63,11 +63,11 @@ const DefaultStory = ({ text }: EditorProps) => {
|
|
|
63
63
|
[computeGraph, themeMode],
|
|
64
64
|
);
|
|
65
65
|
|
|
66
|
-
return <div className='
|
|
66
|
+
return <div className='w-[40rem] overflow-hidden' ref={parentRef} {...focusAttributes} />;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const Grid = () => {
|
|
70
|
-
const space =
|
|
70
|
+
const [space] = useSpaces();
|
|
71
71
|
const graph = useComputeGraph(space);
|
|
72
72
|
const sheet = useTestSheet(space, graph, { name: SHEET_NAME });
|
|
73
73
|
const model = useSheetModel(graph, sheet);
|
|
@@ -87,10 +87,10 @@ const Grid = () => {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
|
-
<div className='flex
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
</
|
|
90
|
+
<div className='flex w-[40rem] overflow-hidden'>
|
|
91
|
+
<Sheet.Root graph={graph} sheet={sheet} attendableId='test'>
|
|
92
|
+
<Sheet.Content />
|
|
93
|
+
</Sheet.Root>
|
|
94
94
|
</div>
|
|
95
95
|
);
|
|
96
96
|
};
|
|
@@ -105,11 +105,12 @@ const GraphStory = (props: EditorProps) => {
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
const meta = {
|
|
108
|
-
title: 'plugins/plugin-sheet/extensions',
|
|
108
|
+
title: 'plugins/plugin-sheet/extensions/compute',
|
|
109
109
|
decorators: [
|
|
110
|
-
withTheme,
|
|
110
|
+
withTheme(),
|
|
111
|
+
withLayout({ layout: 'fullscreen' }),
|
|
111
112
|
withClientProvider({
|
|
112
|
-
types: [
|
|
113
|
+
types: [SheetType.Sheet],
|
|
113
114
|
createIdentity: true,
|
|
114
115
|
createSpace: true,
|
|
115
116
|
}),
|
|
@@ -8,7 +8,7 @@ import { testTree } from '@lezer/generator/test';
|
|
|
8
8
|
import { spreadsheet } from 'codemirror-lang-spreadsheet';
|
|
9
9
|
import { describe, expect, test } from 'vitest';
|
|
10
10
|
|
|
11
|
-
import { defaultFunctions } from '@dxos/compute';
|
|
11
|
+
import { defaultFunctions } from '@dxos/compute-hyperformula';
|
|
12
12
|
|
|
13
13
|
import { sheetExtension } from './sheet-extension';
|
|
14
14
|
|