@dxos/plugin-sheet 0.8.4-main.70d3990 → 0.8.4-main.765dc60934
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/LICENSE +102 -5
- package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs +46 -0
- package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +7 -0
- package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs +33 -0
- package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +7 -0
- package/dist/lib/neutral/SheetPlugin.mjs +48 -0
- package/dist/lib/neutral/SheetPlugin.mjs.map +7 -0
- package/dist/lib/neutral/SheetPlugin.node.mjs +27 -0
- package/dist/lib/neutral/SheetPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/anchor-sort-TTCKGX7V.mjs +22 -0
- package/dist/lib/neutral/anchor-sort-TTCKGX7V.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +25 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-7VEWYJJN.mjs → neutral/chunk-4SBAIU6F.mjs} +15 -15
- package/dist/lib/neutral/chunk-4SBAIU6F.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FZWVUKE2.mjs +8 -0
- package/dist/lib/neutral/chunk-FZWVUKE2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-KC2SMDNF.mjs +373 -0
- package/dist/lib/neutral/chunk-KC2SMDNF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YFY6U524.mjs +83 -0
- package/dist/lib/neutral/chunk-YFY6U524.mjs.map +7 -0
- package/dist/lib/{browser/chunk-FWFAAGXL.mjs → neutral/chunk-ZWOQCLH7.mjs} +2 -9
- package/dist/lib/neutral/chunk-ZWOQCLH7.mjs.map +7 -0
- package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs +20 -0
- package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1551 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs +20 -0
- package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +11 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-OKQAXJCW.mjs +27 -0
- package/dist/lib/neutral/create-object-OKQAXJCW.mjs.map +7 -0
- package/dist/lib/neutral/drop-axis-G6UOXG54.mjs +23 -0
- package/dist/lib/neutral/drop-axis-G6UOXG54.mjs.map +7 -0
- package/dist/lib/{node-esm/types → neutral}/index.mjs +14 -3
- package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs +16 -0
- package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs.map +7 -0
- package/dist/lib/neutral/markdown-I2AKJYPF.mjs +28 -0
- package/dist/lib/neutral/markdown-I2AKJYPF.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs +13 -0
- package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-VSTQNVPT.mjs +44 -0
- package/dist/lib/neutral/react-surface-VSTQNVPT.mjs.map +7 -0
- package/dist/lib/neutral/restore-axis-44DM6N54.mjs +16 -0
- package/dist/lib/neutral/restore-axis-44DM6N54.mjs.map +7 -0
- package/dist/lib/neutral/scroll-to-anchor-QPOGMAQG.mjs +33 -0
- package/dist/lib/neutral/scroll-to-anchor-QPOGMAQG.mjs.map +7 -0
- package/dist/lib/neutral/state-HPA27MX2.mjs +29 -0
- package/dist/lib/neutral/state-HPA27MX2.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +103 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +55 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +6 -2
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs +31 -0
- package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs.map +7 -0
- package/dist/types/src/SheetPlugin.d.ts +3 -1
- 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 +4 -2
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
- package/dist/types/src/capabilities/comment-config.d.ts +12 -0
- package/dist/types/src/capabilities/comment-config.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry.d.ts +3 -2
- package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +23 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +3 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- 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 +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- 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/{GridSheet → SheetContent}/SheetCellEditor.stories.d.ts +1 -1
- package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts +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 +14 -21
- package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/style.d.ts +14 -20
- 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/containers/RangeList/RangeList.d.ts +7 -0
- 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/SheetArticle/SheetArticle.d.ts +12 -0
- package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts.map +1 -0
- package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts +92 -0
- package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SheetArticle/index.d.ts +2 -0
- package/dist/types/src/containers/SheetArticle/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 +2 -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/meta.d.ts +2 -2
- package/dist/types/src/meta.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/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 +3 -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/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- 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 +1 -1
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +17 -17
- 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 +40 -34
- package/dist/types/src/types/Sheet.d.ts.map +1 -1
- package/dist/types/src/types/SheetCapabilities.d.ts +16 -0
- package/dist/types/src/types/SheetCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/SheetOperation.d.ts +45 -0
- package/dist/types/src/types/SheetOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.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 +2 -68
- 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 +130 -82
- package/src/SheetPlugin.node.ts +21 -0
- package/src/SheetPlugin.test.ts +30 -0
- package/src/SheetPlugin.tsx +38 -63
- package/src/capabilities/anchor-sort.ts +19 -13
- package/src/capabilities/comment-config.ts +24 -0
- package/src/capabilities/compute-graph-registry.ts +19 -13
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +16 -8
- package/src/capabilities/markdown.ts +21 -13
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +38 -30
- 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 +25 -17
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.tsx +13 -9
- package/src/components/{GridSheet/GridSheet.stories.tsx → SheetContent/SheetContent.stories.tsx} +21 -20
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +68 -50
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +7 -6
- package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +55 -42
- 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 +46 -39
- package/src/components/SheetToolbar/align.ts +50 -25
- package/src/components/SheetToolbar/style.ts +52 -22
- package/src/components/SheetToolbar/useToolbarState.ts +22 -5
- package/src/components/index.ts +1 -7
- package/src/{components → containers}/RangeList/RangeList.tsx +23 -18
- package/src/containers/RangeList/index.ts +5 -0
- package/src/containers/SheetArticle/SheetArticle.stories.tsx +110 -0
- package/src/containers/SheetArticle/SheetArticle.tsx +57 -0
- package/src/containers/SheetArticle/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/extensions/compute.stories.tsx +31 -21
- package/src/extensions/compute.ts +2 -2
- package/src/extensions/editor/sheet-extension.test.ts +1 -1
- package/src/extensions/editor/sheet-extension.ts +18 -15
- package/src/index.ts +2 -2
- package/src/integrations/thread-ranges.ts +18 -55
- package/src/meta.ts +3 -3
- package/src/model/sheet-model.test.ts +5 -5
- package/src/model/sheet-model.ts +72 -40
- package/src/model/testing.ts +2 -2
- package/src/model/useSheetModel.ts +3 -2
- package/src/operations/drop-axis.ts +26 -0
- package/src/operations/index.ts +12 -0
- package/src/operations/insert-axis.ts +19 -0
- package/src/operations/restore-axis.ts +19 -0
- package/src/operations/scroll-to-anchor.ts +30 -0
- package/src/playwright/playwright.config.ts +1 -1
- package/src/playwright/sheet.spec.ts +4 -3
- package/src/plugin.ts +11 -0
- package/src/sanity.test.ts +10 -3
- package/src/serializer.ts +2 -2
- 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 +31 -31
- package/src/types/SheetCapabilities.ts +26 -0
- package/src/types/SheetOperation.ts +75 -0
- package/src/types/index.ts +4 -1
- package/src/types/sheet-range-types.ts +3 -3
- package/src/types/types.ts +4 -40
- package/src/types/util.ts +3 -2
- package/dist/lib/browser/SheetContainer-WDKJPYCB.mjs +0 -349
- package/dist/lib/browser/SheetContainer-WDKJPYCB.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-OWOAGQM6.mjs +0 -23
- package/dist/lib/browser/anchor-sort-OWOAGQM6.mjs.map +0 -7
- package/dist/lib/browser/chunk-6ILNTWSF.mjs +0 -852
- package/dist/lib/browser/chunk-6ILNTWSF.mjs.map +0 -7
- package/dist/lib/browser/chunk-73AV3NH6.mjs +0 -15
- package/dist/lib/browser/chunk-73AV3NH6.mjs.map +0 -7
- package/dist/lib/browser/chunk-7VEWYJJN.mjs.map +0 -7
- package/dist/lib/browser/chunk-FWFAAGXL.mjs.map +0 -7
- package/dist/lib/browser/chunk-GBK6OLCY.mjs +0 -907
- package/dist/lib/browser/chunk-GBK6OLCY.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-AP5RA7W3.mjs +0 -21
- package/dist/lib/browser/compute-graph-registry-AP5RA7W3.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -154
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-OMHQGXFL.mjs +0 -56
- package/dist/lib/browser/intent-resolver-OMHQGXFL.mjs.map +0 -7
- package/dist/lib/browser/markdown-B6VKYY2S.mjs +0 -26
- package/dist/lib/browser/markdown-B6VKYY2S.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-VPLFBQSV.mjs +0 -54
- package/dist/lib/browser/react-surface-VPLFBQSV.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-62MZAU6Q.mjs +0 -350
- package/dist/lib/node-esm/SheetContainer-62MZAU6Q.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-FG3DS4HM.mjs +0 -24
- package/dist/lib/node-esm/anchor-sort-FG3DS4HM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-44YTKTMP.mjs +0 -16
- package/dist/lib/node-esm/chunk-44YTKTMP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4QV4AGWK.mjs +0 -236
- package/dist/lib/node-esm/chunk-4QV4AGWK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HILDMVPL.mjs +0 -29
- package/dist/lib/node-esm/chunk-HILDMVPL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KSHCRK5J.mjs +0 -908
- package/dist/lib/node-esm/chunk-KSHCRK5J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QI3PNRCD.mjs +0 -853
- package/dist/lib/node-esm/chunk-QI3PNRCD.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-UMQ5UYCL.mjs +0 -22
- package/dist/lib/node-esm/compute-graph-registry-UMQ5UYCL.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -155
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DHEHYV3B.mjs +0 -57
- package/dist/lib/node-esm/intent-resolver-DHEHYV3B.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-VKY7HXU2.mjs +0 -27
- package/dist/lib/node-esm/markdown-VKY7HXU2.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-YLTZQVNL.mjs +0 -55
- package/dist/lib/node-esm/react-surface-YLTZQVNL.mjs.map +0 -7
- 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/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.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 +0 -7
- 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 -56
- 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/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -38
- package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -93
- package/src/components/SheetContainer/SheetContainer.tsx +0 -41
- package/src/components/SheetContainer/index.ts +0 -7
- package/src/components/SheetContext/index.ts +0 -5
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
package/src/sanity.test.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { describe, expect, test } from 'vitest';
|
|
6
6
|
|
|
7
7
|
import { Client } from '@dxos/client';
|
|
8
|
-
import {
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
|
|
10
11
|
// Part 2.
|
|
11
12
|
// TODO(burdon): Cannot test outside of browser.
|
|
@@ -22,7 +23,7 @@ import { Function } from '@dxos/functions';
|
|
|
22
23
|
describe('test', () => {
|
|
23
24
|
test('test', async () => {
|
|
24
25
|
const client = new Client();
|
|
25
|
-
client.addTypes([
|
|
26
|
+
await client.addTypes([Operation.PersistentOperation]);
|
|
26
27
|
await client.initialize();
|
|
27
28
|
await client.halo.createIdentity();
|
|
28
29
|
|
|
@@ -33,7 +34,13 @@ describe('test', () => {
|
|
|
33
34
|
// - ERROR "process.nextTick is not a function"
|
|
34
35
|
// - ERROR "Identifier 'Buffer' has already been declared" if { nodeExternal: true }
|
|
35
36
|
const space = await client.spaces.create();
|
|
36
|
-
const fn = space.db.add(
|
|
37
|
+
const fn = space.db.add(
|
|
38
|
+
Obj.make(Operation.PersistentOperation, {
|
|
39
|
+
[Obj.Meta]: { key: 'com.example.function.test', version: '0.0.1' },
|
|
40
|
+
name: 'test',
|
|
41
|
+
binding: 'HELLO',
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
37
44
|
expect(fn).to.exist;
|
|
38
45
|
});
|
|
39
46
|
});
|
package/src/serializer.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { Obj } from '@dxos/echo';
|
|
6
6
|
import { getObjectCore } from '@dxos/echo-db';
|
|
7
|
-
import { type TypedObjectSerializer } from '@dxos/plugin-space
|
|
7
|
+
import { type TypedObjectSerializer } from '@dxos/plugin-space';
|
|
8
8
|
|
|
9
|
-
import { Sheet } from '
|
|
9
|
+
import { Sheet } from '#types';
|
|
10
10
|
|
|
11
11
|
export const serializer: TypedObjectSerializer<Sheet.Sheet> = {
|
|
12
12
|
serialize: async ({ object }): Promise<string> => {
|
package/src/testing/data.ts
CHANGED
package/src/testing/testing.tsx
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
import { type Decorator } from '@storybook/react';
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type ComputeGraph, type ComputeGraphOptions, ComputeGraphRegistry } from '@dxos/compute';
|
|
9
|
-
import { createMockedComputeRuntimeProvider } from '@dxos/compute/testing';
|
|
8
|
+
import { type ComputeGraph, type ComputeGraphOptions, ComputeGraphRegistry } from '@dxos/compute-hyperformula';
|
|
9
|
+
import { createMockedComputeRuntimeProvider } from '@dxos/compute-hyperformula/testing';
|
|
10
10
|
import { type Space } from '@dxos/react-client/echo';
|
|
11
11
|
import { useAsyncState } from '@dxos/react-hooks';
|
|
12
12
|
|
|
13
|
-
import { ComputeGraphContextProvider } from '
|
|
14
|
-
import { Sheet } from '
|
|
13
|
+
import { ComputeGraphContextProvider } from '#components';
|
|
14
|
+
import { Sheet } from '#types';
|
|
15
15
|
|
|
16
16
|
export const useTestSheet = (space?: Space, graph?: ComputeGraph, options?: Sheet.SheetProps) => {
|
|
17
17
|
const [sheet] = useAsyncState(async () => {
|
package/src/translations.ts
CHANGED
|
@@ -4,49 +4,54 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
8
|
-
import { Sheet } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
import { Sheet } from '#types';
|
|
9
9
|
|
|
10
10
|
export const translations = [
|
|
11
11
|
{
|
|
12
12
|
'en-US': {
|
|
13
13
|
[Sheet.Sheet.typename]: {
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'object
|
|
14
|
+
'typename.label': 'Sheet',
|
|
15
|
+
'typename.label_zero': 'Sheets',
|
|
16
|
+
'typename.label_one': 'Sheet',
|
|
17
|
+
'typename.label_other': 'Sheets',
|
|
18
|
+
'object-name.placeholder': 'New sheet',
|
|
19
|
+
'add-object.label': 'Add sheet',
|
|
20
|
+
'rename-object.label': 'Rename sheet',
|
|
21
|
+
'delete-object.label': 'Delete sheet',
|
|
22
|
+
'object-deleted.label': 'Sheet deleted',
|
|
22
23
|
},
|
|
23
24
|
[meta.id]: {
|
|
24
|
-
'plugin
|
|
25
|
-
'cell
|
|
26
|
-
|
|
27
|
-
'range
|
|
28
|
-
'range
|
|
29
|
-
|
|
30
|
-
'range
|
|
31
|
-
'range
|
|
32
|
-
'range
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'add
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'range
|
|
48
|
-
'
|
|
49
|
-
'
|
|
25
|
+
'plugin.name': 'Sheets',
|
|
26
|
+
'cell.placeholder': 'Cell value...',
|
|
27
|
+
|
|
28
|
+
'range-key.alignment.label': 'Align',
|
|
29
|
+
'range-key.style.label': 'Style',
|
|
30
|
+
|
|
31
|
+
'range-value.start.label': 'Align left',
|
|
32
|
+
'range-value.center.label': 'Align center',
|
|
33
|
+
'range-value.end.label': 'Align right',
|
|
34
|
+
'range-value.softwrap.label': 'Wrap text',
|
|
35
|
+
'range-value.highlight.label': 'Highlight',
|
|
36
|
+
|
|
37
|
+
'toolbar-action.label': '{{value}}',
|
|
38
|
+
'selection-overlaps-existing-comment.label': 'Selected cell already has a comment',
|
|
39
|
+
'comment.label': 'Add comment',
|
|
40
|
+
'comment-ranges-not-supported.label': 'Commenting on ranges is not yet supported',
|
|
41
|
+
'no-cursor.label': 'Select a cell to comment',
|
|
42
|
+
'add-col-before.label': 'Add column before',
|
|
43
|
+
'add-col-after.label': 'Add column after',
|
|
44
|
+
'delete-col.label': 'Delete column',
|
|
45
|
+
'add-row-before.label': 'Add row before',
|
|
46
|
+
'add-row-after.label': 'Add row after',
|
|
47
|
+
'delete-row.label': 'Delete row',
|
|
48
|
+
'range-list.heading': 'Ranges',
|
|
49
|
+
'no-ranges.message': 'No ranges',
|
|
50
|
+
'range.title': '{{position}} — {{value}}',
|
|
51
|
+
'col-dropped.label': 'Deleted a column',
|
|
52
|
+
'row-dropped.label': 'Deleted a row',
|
|
53
|
+
'align.label': 'Text align',
|
|
54
|
+
'axis-dropped.label': 'Drop axis', // TODO(burdon): What does this mean?
|
|
50
55
|
},
|
|
51
56
|
},
|
|
52
57
|
},
|
package/src/types/Sheet.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
7
|
-
import { addressFromA1Notation, isFormula } from '@dxos/compute';
|
|
8
|
-
import { Obj, Type } from '@dxos/echo';
|
|
9
|
+
import { addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
|
|
10
|
+
import { Annotation, Obj, Type } from '@dxos/echo';
|
|
9
11
|
import { FormInputAnnotation } from '@dxos/echo/internal';
|
|
10
12
|
|
|
11
13
|
import { addressToIndex, initialize, mapFormulaRefsToIndices } from './util';
|
|
@@ -44,36 +46,31 @@ export const Sheet = Schema.Struct({
|
|
|
44
46
|
name: Schema.optional(Schema.String),
|
|
45
47
|
|
|
46
48
|
// Sparse map of cells referenced by index.
|
|
47
|
-
cells: Schema.Record({ key: Schema.String, value:
|
|
48
|
-
Schema.mutable,
|
|
49
|
-
FormInputAnnotation.set(false),
|
|
50
|
-
),
|
|
49
|
+
cells: Schema.Record({ key: Schema.String, value: CellValue }).pipe(FormInputAnnotation.set(false)),
|
|
51
50
|
|
|
52
51
|
// Ordered row indices.
|
|
53
|
-
rows: Schema.Array(Schema.String).pipe(
|
|
52
|
+
rows: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
|
|
54
53
|
|
|
55
54
|
// Ordered column indices.
|
|
56
|
-
columns: Schema.Array(Schema.String).pipe(
|
|
55
|
+
columns: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
|
|
57
56
|
|
|
58
57
|
// Row metadata referenced by index.
|
|
59
|
-
rowMeta: Schema.Record({ key: Schema.String, value:
|
|
60
|
-
Schema.mutable,
|
|
61
|
-
FormInputAnnotation.set(false),
|
|
62
|
-
),
|
|
58
|
+
rowMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
|
|
63
59
|
|
|
64
60
|
// Column metadata referenced by index.
|
|
65
|
-
columnMeta: Schema.Record({ key: Schema.String, value:
|
|
66
|
-
Schema.mutable,
|
|
67
|
-
FormInputAnnotation.set(false),
|
|
68
|
-
),
|
|
61
|
+
columnMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
|
|
69
62
|
|
|
70
63
|
// Cell formatting referenced by indexed range.
|
|
71
|
-
ranges: Schema.Array(Range).pipe(
|
|
64
|
+
ranges: Schema.Array(Range).pipe(FormInputAnnotation.set(false)),
|
|
72
65
|
}).pipe(
|
|
73
|
-
Type.
|
|
74
|
-
typename: 'dxos.
|
|
66
|
+
Type.object({
|
|
67
|
+
typename: 'org.dxos.type.sheet',
|
|
75
68
|
version: '0.1.0',
|
|
76
69
|
}),
|
|
70
|
+
Annotation.IconAnnotation.set({
|
|
71
|
+
icon: 'ph--grid-nine--regular',
|
|
72
|
+
hue: 'indigo',
|
|
73
|
+
}),
|
|
77
74
|
);
|
|
78
75
|
|
|
79
76
|
export interface Sheet extends Schema.Schema.Type<typeof Sheet> {}
|
|
@@ -86,18 +83,21 @@ export type SheetProps = {
|
|
|
86
83
|
export const make = ({ name, cells = {}, ...size }: SheetProps = {}) => {
|
|
87
84
|
const sheet = Obj.make(Sheet, { name, cells: {}, rows: [], columns: [], rowMeta: {}, columnMeta: {}, ranges: [] });
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
// Initialize and set cells within Obj.update to satisfy change context requirements.
|
|
87
|
+
Obj.update(sheet, (sheet) => {
|
|
88
|
+
initialize(sheet, size);
|
|
89
|
+
|
|
90
|
+
if (cells) {
|
|
91
|
+
Object.entries(cells).forEach(([key, { value }]) => {
|
|
92
|
+
const idx = addressToIndex(sheet, addressFromA1Notation(key));
|
|
93
|
+
if (isFormula(value)) {
|
|
94
|
+
value = mapFormulaRefsToIndices(sheet, value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
sheet.cells[idx] = { value };
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
101
|
|
|
102
102
|
return sheet;
|
|
103
103
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { type ComputeGraphRegistry as ComputeGraphRegistryType } from '@dxos/compute-hyperformula';
|
|
9
|
+
import { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
export type GridEntry = { grid: DxGridElement; setActiveRefs: (refs: GridContentProps['activeRefs']) => void };
|
|
14
|
+
|
|
15
|
+
export type GridRegistry = {
|
|
16
|
+
register: (attendableId: string, grid: DxGridElement, setActiveRefs: GridEntry['setActiveRefs']) => void;
|
|
17
|
+
unregister: (attendableId: string) => void;
|
|
18
|
+
get: (attendableId: string) => GridEntry | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const ComputeGraphRegistry = Capability.make<ComputeGraphRegistryType>(
|
|
22
|
+
`${meta.id}.capability.compute-graph-registry`,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
/** Registry of active grid instances keyed by attendable ID. */
|
|
26
|
+
export const GridInstances = Capability.make<GridRegistry>(`${meta.id}.capability.grid-instances`);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
const SHEET_OPERATION = `${meta.id}.operation`;
|
|
15
|
+
|
|
16
|
+
// TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.
|
|
17
|
+
const Axis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));
|
|
18
|
+
|
|
19
|
+
export const InsertAxis = Operation.make({
|
|
20
|
+
meta: { key: `${SHEET_OPERATION}.axis-insert`, name: 'Insert Axis' },
|
|
21
|
+
input: Schema.Struct({
|
|
22
|
+
model: Schema.Any,
|
|
23
|
+
axis: Axis,
|
|
24
|
+
index: Schema.Number,
|
|
25
|
+
count: Schema.optional(Schema.Number),
|
|
26
|
+
}),
|
|
27
|
+
output: Schema.Void,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const DropAxisOutput = Schema.Struct({
|
|
31
|
+
axis: Axis.annotations({ description: 'The axis type (row or col).' }),
|
|
32
|
+
axisIndex: Schema.String.annotations({ description: 'The dropped axis index.' }),
|
|
33
|
+
index: Schema.Number.annotations({ description: 'The position the axis was at.' }),
|
|
34
|
+
axisMeta: Schema.Any.annotations({ description: 'The row/column metadata.' }),
|
|
35
|
+
values: Schema.Array(Schema.Any).annotations({ description: 'The cell values that were dropped.' }),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type DropAxisOutput = Schema.Schema.Type<typeof DropAxisOutput>;
|
|
39
|
+
|
|
40
|
+
export const DropAxis = Operation.make({
|
|
41
|
+
meta: { key: `${SHEET_OPERATION}.axis-drop`, name: 'Drop Axis' },
|
|
42
|
+
input: Schema.Struct({
|
|
43
|
+
model: Schema.Any,
|
|
44
|
+
axis: Axis,
|
|
45
|
+
axisIndex: Schema.String,
|
|
46
|
+
}),
|
|
47
|
+
output: DropAxisOutput,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const ScrollToAnchor = Operation.make({
|
|
51
|
+
meta: { key: `${SHEET_OPERATION}.scroll-to-anchor`, name: 'Scroll To Anchor' },
|
|
52
|
+
services: [Capability.Service],
|
|
53
|
+
input: Schema.Struct({
|
|
54
|
+
subject: Schema.String.annotations({ description: 'Attendable ID of the sheet.' }),
|
|
55
|
+
cursor: Schema.String.annotations({ description: 'Cell range coordinates.' }),
|
|
56
|
+
ref: Schema.optional(Schema.Any.annotations({ description: 'Active refs for highlighting.' })),
|
|
57
|
+
}),
|
|
58
|
+
output: Schema.Void,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Restore a dropped axis (inverse of DropAxis).
|
|
63
|
+
*/
|
|
64
|
+
export const RestoreAxis = Operation.make({
|
|
65
|
+
meta: { key: `${SHEET_OPERATION}.restore-axis`, name: 'Restore Axis' },
|
|
66
|
+
input: Schema.Struct({
|
|
67
|
+
model: Schema.Any.annotations({ description: 'The sheet model.' }),
|
|
68
|
+
axis: Axis.annotations({ description: 'The axis type (row or col).' }),
|
|
69
|
+
axisIndex: Schema.String.annotations({ description: 'The axis index to restore.' }),
|
|
70
|
+
index: Schema.Number.annotations({ description: 'The position to restore at.' }),
|
|
71
|
+
axisMeta: Schema.Any.annotations({ description: 'The row/column metadata.' }),
|
|
72
|
+
values: Schema.Array(Schema.Any).annotations({ description: 'The cell values to restore.' }),
|
|
73
|
+
}),
|
|
74
|
+
output: Schema.Void,
|
|
75
|
+
});
|
package/src/types/index.ts
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * as Sheet from './Sheet';
|
|
6
5
|
export * from './sheet-range-types';
|
|
7
6
|
export * from './types';
|
|
8
7
|
export * from './util';
|
|
8
|
+
|
|
9
|
+
export * as Sheet from './Sheet';
|
|
10
|
+
export * as SheetCapabilities from './SheetCapabilities';
|
|
11
|
+
export * as SheetOperation from './SheetOperation';
|
|
@@ -34,14 +34,14 @@ export const cellClassNameForRange = ({ key, value }: Sheet.Sheet['ranges'][numb
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
case commentKey:
|
|
37
|
-
return 'bg-
|
|
37
|
+
return 'bg-grid-comment';
|
|
38
38
|
|
|
39
39
|
case styleKey:
|
|
40
40
|
switch (value) {
|
|
41
41
|
case 'highlight':
|
|
42
|
-
return '
|
|
42
|
+
return 'bg-grid-highlight!';
|
|
43
43
|
case 'softwrap':
|
|
44
|
-
return '
|
|
44
|
+
return 'whitespace-normal!';
|
|
45
45
|
default:
|
|
46
46
|
return undefined;
|
|
47
47
|
}
|
package/src/types/types.ts
CHANGED
|
@@ -4,39 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { meta } from '../meta';
|
|
8
|
-
import { SheetModel } from '../model';
|
|
9
|
-
|
|
10
7
|
import * as Sheet from './Sheet';
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export class Create extends Schema.TaggedClass<Create>()(`${SHEET_ACTION}/create`, {
|
|
16
|
-
input: Schema.Struct({
|
|
17
|
-
name: Schema.optional(Schema.String),
|
|
18
|
-
}),
|
|
19
|
-
output: Schema.Struct({
|
|
20
|
-
object: Sheet.Sheet,
|
|
21
|
-
}),
|
|
22
|
-
}) {}
|
|
23
|
-
|
|
24
|
-
// TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.
|
|
25
|
-
const Axis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));
|
|
26
|
-
|
|
27
|
-
export class InsertAxis extends Schema.TaggedClass<InsertAxis>()(`${SHEET_ACTION}/axis-insert`, {
|
|
28
|
-
input: Schema.Struct({
|
|
29
|
-
// TODO(wittjosiah): Schema.instanceOf(SheetModel) throws when running tests.
|
|
30
|
-
model: Schema.Any.pipe(Schema.filter((model) => model instanceof SheetModel)) as Schema.Schema<SheetModel>,
|
|
31
|
-
axis: Axis,
|
|
32
|
-
index: Schema.Number,
|
|
33
|
-
count: Schema.optional(Schema.Number),
|
|
34
|
-
}),
|
|
35
|
-
output: Schema.Void,
|
|
36
|
-
}) {}
|
|
9
|
+
// TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.
|
|
10
|
+
const ActionAxis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));
|
|
37
11
|
|
|
12
|
+
export namespace SheetAction {
|
|
38
13
|
export const RestoreAxis = Schema.Struct({
|
|
39
|
-
axis:
|
|
14
|
+
axis: ActionAxis,
|
|
40
15
|
axisIndex: Schema.String,
|
|
41
16
|
index: Schema.Number,
|
|
42
17
|
axisMeta: Sheet.RowColumnMeta,
|
|
@@ -44,15 +19,4 @@ export namespace SheetAction {
|
|
|
44
19
|
});
|
|
45
20
|
|
|
46
21
|
export type RestoreAxis = Schema.Schema.Type<typeof RestoreAxis>;
|
|
47
|
-
|
|
48
|
-
export class DropAxis extends Schema.TaggedClass<DropAxis>()(`${SHEET_ACTION}/axis-drop`, {
|
|
49
|
-
input: Schema.Struct({
|
|
50
|
-
// TODO(wittjosiah): Schema.instanceOf(SheetModel) throws when running tests.
|
|
51
|
-
model: Schema.Any.pipe(Schema.filter((model) => model instanceof SheetModel)) as Schema.Schema<SheetModel>,
|
|
52
|
-
axis: Axis,
|
|
53
|
-
axisIndex: Schema.String,
|
|
54
|
-
deletionData: Schema.optional(RestoreAxis),
|
|
55
|
-
}),
|
|
56
|
-
output: Schema.Void,
|
|
57
|
-
}) {}
|
|
58
22
|
}
|
package/src/types/util.ts
CHANGED
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
addressFromA1Notation,
|
|
10
10
|
addressToA1Notation,
|
|
11
11
|
isFormula,
|
|
12
|
-
} from '@dxos/compute';
|
|
12
|
+
} from '@dxos/compute-hyperformula';
|
|
13
13
|
import { randomBytes } from '@dxos/crypto';
|
|
14
|
+
import { type Obj } from '@dxos/echo';
|
|
14
15
|
import { invariant } from '@dxos/invariant';
|
|
15
16
|
|
|
16
17
|
import { type Sheet } from '../types';
|
|
@@ -55,7 +56,7 @@ export const insertIndices = (indices: string[], i: number, n: number, max: numb
|
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
export const initialize = (
|
|
58
|
-
sheet: Sheet.Sheet
|
|
59
|
+
sheet: Obj.Mutable<Sheet.Sheet>,
|
|
59
60
|
{ rows = DEFAULT_ROWS, columns = DEFAULT_COLS }: Partial<Sheet.SheetSize> = {},
|
|
60
61
|
) => {
|
|
61
62
|
if (!sheet.rows.length) {
|