@dxos/plugin-sheet 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/PLUGIN.mdl +359 -0
- package/dist/lib/{browser/RangeList-S3SHV7T6.mjs → neutral/RangeList-HYB5S6KQ.mjs} +21 -28
- 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 +59 -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/SheetPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/SheetPlugin.workerd.mjs.map +7 -0
- package/dist/lib/{browser/anchor-sort-DZ3IHHJJ.mjs → neutral/anchor-sort-2POWTKTD.mjs} +6 -8
- package/dist/lib/neutral/anchor-sort-2POWTKTD.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/neutral/chunk-3AIMSE7U.mjs +83 -0
- package/dist/lib/neutral/chunk-3AIMSE7U.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7ZUM64KO.mjs +8 -0
- package/dist/lib/neutral/chunk-7ZUM64KO.mjs.map +7 -0
- package/dist/lib/{browser/chunk-NNWF7EKC.mjs → neutral/chunk-ERHMBRSU.mjs} +4 -4
- package/dist/lib/neutral/chunk-ERHMBRSU.mjs.map +7 -0
- package/dist/lib/{browser/chunk-S445OQGW.mjs → neutral/chunk-EUM3RVML.mjs} +173 -196
- package/dist/lib/neutral/chunk-EUM3RVML.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FQHTXKMF.mjs +34 -0
- package/dist/lib/neutral/chunk-FQHTXKMF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/comment-config-6JAROASH.mjs +21 -0
- package/dist/lib/neutral/comment-config-6JAROASH.mjs.map +7 -0
- package/dist/lib/{browser/SheetContainer-I3NFVVDQ.mjs → neutral/components/index.mjs} +163 -416
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/compute-graph-registry-YYINTFC2.mjs +26 -0
- package/dist/lib/neutral/compute-graph-registry-YYINTFC2.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-6FZSSROF.mjs +28 -0
- package/dist/lib/neutral/create-object-6FZSSROF.mjs.map +7 -0
- package/dist/lib/neutral/drop-axis-MO3KUU4C.mjs +23 -0
- package/dist/lib/neutral/drop-axis-MO3KUU4C.mjs.map +7 -0
- package/dist/lib/{browser/types → neutral}/index.mjs +14 -5
- package/dist/lib/neutral/insert-axis-V7E5PTMG.mjs +16 -0
- package/dist/lib/neutral/insert-axis-V7E5PTMG.mjs.map +7 -0
- package/dist/lib/{browser/markdown-S6GVLHB4.mjs → neutral/markdown-O37EE3ER.mjs} +5 -6
- package/dist/lib/neutral/markdown-O37EE3ER.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/{browser/react-surface-KIU6DGKW.mjs → neutral/react-surface-4H3PC4WG.mjs} +13 -20
- package/dist/lib/neutral/react-surface-4H3PC4WG.mjs.map +7 -0
- package/dist/lib/neutral/restore-axis-BAM44OPG.mjs +16 -0
- package/dist/lib/neutral/restore-axis-BAM44OPG.mjs.map +7 -0
- package/dist/lib/neutral/scroll-to-anchor-TBE2FTTT.mjs +33 -0
- package/dist/lib/neutral/scroll-to-anchor-TBE2FTTT.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 +56 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{node-esm → neutral}/types/index.mjs +6 -6
- 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 +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/SheetPlugin.workerd.d.ts +4 -0
- package/dist/types/src/SheetPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -0
- 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 +11 -0
- package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -0
- 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 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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.map +1 -0
- package/dist/types/src/capabilities/{compute-graph-registry/compute-graph-registry.d.ts → state.d.ts} +3 -2
- 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 +10 -4
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetContent/SheetContent.d.ts +4 -3
- package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -1
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +77 -39
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetContent/util.d.ts +1 -1
- package/dist/types/src/components/SheetContent/util.d.ts.map +1 -1
- package/dist/types/src/components/SheetRoot/SheetRoot.d.ts +5 -3
- package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -1
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +4 -3
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +5 -8
- 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/containers/RangeList/RangeList.d.ts +2 -2
- package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -1
- package/dist/types/src/containers/RangeList/index.d.ts +1 -2
- package/dist/types/src/containers/RangeList/index.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +27 -3
- 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 +5 -5
- 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 +5 -6
- 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 -2
- 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 +0 -92
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/types/util.d.ts +1 -1
- package/dist/types/src/types/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +120 -94
- package/src/SheetPlugin.node.ts +21 -0
- package/src/SheetPlugin.test.ts +30 -0
- package/src/SheetPlugin.tsx +31 -36
- package/src/SheetPlugin.workerd.ts +18 -0
- package/src/capabilities/{anchor-sort/anchor-sort.ts → anchor-sort.ts} +3 -3
- package/src/capabilities/comment-config.ts +25 -0
- package/src/capabilities/compute-graph-registry.ts +42 -0
- package/src/capabilities/create-object.ts +31 -0
- package/src/capabilities/index.ts +17 -5
- package/src/capabilities/{markdown/markdown.ts → markdown.ts} +3 -2
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +13 -10
- 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 +23 -15
- package/src/components/SheetContent/SheetCellEditor.stories.tsx +8 -7
- package/src/components/SheetContent/SheetContent.stories.tsx +11 -11
- package/src/components/SheetContent/SheetContent.tsx +40 -23
- package/src/components/SheetContent/util.ts +4 -3
- package/src/components/SheetRoot/SheetRoot.tsx +18 -7
- package/src/components/SheetStatusbar/SheetStatusbar.tsx +16 -8
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +1 -1
- package/src/components/SheetToolbar/SheetToolbar.tsx +15 -20
- package/src/components/SheetToolbar/align.ts +9 -9
- package/src/components/SheetToolbar/style.ts +7 -7
- package/src/containers/RangeList/RangeList.tsx +17 -17
- package/src/containers/RangeList/index.ts +1 -3
- package/src/containers/{SheetContainer/SheetContainer.stories.tsx → SheetArticle/SheetArticle.stories.tsx} +42 -26
- package/src/containers/{SheetContainer/SheetContainer.tsx → SheetArticle/SheetArticle.tsx} +12 -12
- package/src/containers/SheetArticle/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/extensions/compute.stories.tsx +11 -11
- package/src/extensions/compute.ts +1 -1
- package/src/extensions/editor/sheet-extension.test.ts +1 -1
- package/src/extensions/editor/sheet-extension.ts +3 -3
- package/src/index.ts +2 -2
- package/src/integrations/thread-ranges.ts +10 -42
- package/src/meta.ts +18 -6
- package/src/model/sheet-model.test.ts +5 -5
- package/src/model/sheet-model.ts +19 -19
- 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/sheet.spec.ts +3 -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 +43 -37
- package/src/types/Sheet.ts +13 -13
- package/src/types/SheetCapabilities.ts +26 -0
- package/src/types/SheetOperation.ts +84 -0
- package/src/types/index.ts +4 -2
- package/src/types/types.ts +0 -80
- package/src/types/util.ts +4 -4
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/RangeList-S3SHV7T6.mjs.map +0 -7
- package/dist/lib/browser/SheetContainer-I3NFVVDQ.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-DZ3IHHJJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-NNWF7EKC.mjs.map +0 -7
- package/dist/lib/browser/chunk-S445OQGW.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-W6HO2G3P.mjs +0 -21
- package/dist/lib/browser/compute-graph-registry-W6HO2G3P.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -145
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/markdown-S6GVLHB4.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-Z4X4UWNR.mjs +0 -79
- package/dist/lib/browser/operation-resolver-Z4X4UWNR.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KIU6DGKW.mjs.map +0 -7
- package/dist/lib/node-esm/RangeList-IB23OJK2.mjs +0 -54
- package/dist/lib/node-esm/RangeList-IB23OJK2.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-KUXNCSFP.mjs +0 -1806
- package/dist/lib/node-esm/SheetContainer-KUXNCSFP.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-24OXMOSX.mjs +0 -25
- package/dist/lib/node-esm/anchor-sort-24OXMOSX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-M52YLLWU.mjs +0 -236
- package/dist/lib/node-esm/chunk-M52YLLWU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NKZ3O4OR.mjs +0 -398
- package/dist/lib/node-esm/chunk-NKZ3O4OR.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-2C3Y2RPQ.mjs +0 -22
- package/dist/lib/node-esm/compute-graph-registry-2C3Y2RPQ.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -146
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-YT5KJTQT.mjs +0 -30
- package/dist/lib/node-esm/markdown-YT5KJTQT.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-7VD2YXSQ.mjs +0 -80
- package/dist/lib/node-esm/operation-resolver-7VD2YXSQ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7FZAE3S7.mjs +0 -52
- package/dist/lib/node-esm/react-surface-7FZAE3S7.mjs.map +0 -7
- 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.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.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.map +0 -1
- package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts +0 -12
- package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts.map +0 -1
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts +0 -56
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/SheetContainer/index.d.ts +0 -3
- package/dist/types/src/containers/SheetContainer/index.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -6
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/src/capabilities/anchor-sort/index.ts +0 -7
- package/src/capabilities/compute-graph-registry/compute-graph-registry.ts +0 -27
- 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/containers/SheetContainer/index.ts +0 -7
- package/src/types/capabilities.ts +0 -14
- /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/dist/types/src/capabilities/{anchor-sort/anchor-sort.d.ts → anchor-sort.d.ts} +0 -0
- /package/dist/types/src/capabilities/{markdown/markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -2,23 +2,19 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
5
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
7
6
|
|
|
8
|
-
import { useOperationInvoker
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
8
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
10
9
|
import { debounce } from '@dxos/async';
|
|
11
|
-
import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute';
|
|
12
|
-
import { Obj, Relation } from '@dxos/echo';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { Filter, Query, useQuery } from '@dxos/react-client/echo';
|
|
17
|
-
import { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';
|
|
10
|
+
import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
|
|
11
|
+
import { Filter, Obj, Query, Relation } from '@dxos/echo';
|
|
12
|
+
import { ThreadOperation } from '@dxos/plugin-thread';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
14
|
+
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
18
15
|
import { AnchoredTo, Thread } from '@dxos/types';
|
|
19
16
|
|
|
20
|
-
import { useSheetContext } from '
|
|
21
|
-
import { meta } from '../meta';
|
|
17
|
+
import { useSheetContext } from '#components';
|
|
22
18
|
|
|
23
19
|
export const completeCellRangeToThreadCursor = (range: CompleteCellRange): string => {
|
|
24
20
|
return `${range.from.col},${range.from.row},${range.to.col},${range.to.row}`;
|
|
@@ -37,33 +33,6 @@ export const parseThreadAnchorAsCellRange = (cursor: string): CompleteCellRange
|
|
|
37
33
|
}
|
|
38
34
|
};
|
|
39
35
|
|
|
40
|
-
export const useUpdateFocusedCellOnThreadSelection = (grid: DxGridElement | null) => {
|
|
41
|
-
const { model, setActiveRefs } = useSheetContext();
|
|
42
|
-
const sheetId = Obj.getDXN(model.sheet).toString();
|
|
43
|
-
|
|
44
|
-
const scrollIntoViewHandler = useMemo(
|
|
45
|
-
() =>
|
|
46
|
-
OperationResolver.make({
|
|
47
|
-
operation: LayoutOperation.ScrollIntoView,
|
|
48
|
-
position: 'hoist',
|
|
49
|
-
filter: (input) => input.subject === sheetId && !!input.cursor,
|
|
50
|
-
handler: (input) =>
|
|
51
|
-
Effect.sync(() => {
|
|
52
|
-
const { cursor, ref } = input;
|
|
53
|
-
if (cursor) {
|
|
54
|
-
setActiveRefs(ref as GridContentProps['activeRefs']);
|
|
55
|
-
// TODO(Zan): Everywhere we refer to the cursor in a thread context should change to `anchor`.
|
|
56
|
-
const range = parseThreadAnchorAsCellRange(cursor);
|
|
57
|
-
range && grid?.setFocus({ ...range.to, plane: 'grid' }, true);
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
|
-
}),
|
|
61
|
-
[sheetId, setActiveRefs, grid],
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
useOperationResolver(meta.id, scrollIntoViewHandler);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
36
|
export const useSelectThreadOnCellFocus = () => {
|
|
68
37
|
const { model, cursor } = useSheetContext();
|
|
69
38
|
const { invokePromise } = useOperationInvoker();
|
|
@@ -88,11 +57,10 @@ export const useSelectThreadOnCellFocus = () => {
|
|
|
88
57
|
});
|
|
89
58
|
|
|
90
59
|
if (closestThread) {
|
|
91
|
-
const primary = Obj.getDXN(model.sheet).toString();
|
|
92
60
|
void (async () => {
|
|
93
|
-
await invokePromise(ThreadOperation.Select, { current: Relation.
|
|
94
|
-
await invokePromise(
|
|
95
|
-
|
|
61
|
+
await invokePromise(ThreadOperation.Select, { current: Relation.getURI(closestThread) });
|
|
62
|
+
await invokePromise(LayoutOperation.UpdateCompanion, {
|
|
63
|
+
subject: linkedSegment('comments'),
|
|
96
64
|
});
|
|
97
65
|
})();
|
|
98
66
|
}
|
package/src/meta.ts
CHANGED
|
@@ -2,18 +2,30 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.sheet'),
|
|
10
11
|
name: 'Sheet',
|
|
12
|
+
author: 'DXOS',
|
|
11
13
|
description: trim`
|
|
12
|
-
Full-featured spreadsheet
|
|
13
|
-
|
|
14
|
+
Full-featured spreadsheet for DXOS Composer backed by ECHO for local-first, real-time collaborative editing.
|
|
15
|
+
Cells, row/column metadata, and range-based formatting are all stored as ECHO objects and replicated to peers instantly.
|
|
16
|
+
|
|
17
|
+
Formula evaluation is powered by HyperFormula, providing over 400 built-in functions covering arithmetic, statistics,
|
|
18
|
+
text manipulation, date/time, financial, and logical operations. Formulas are stored with internal cell indices and
|
|
19
|
+
translated to A1-notation on display, keeping references stable across row and column insertions.
|
|
20
|
+
|
|
21
|
+
The plugin integrates with plugin-markdown to expose formula results inside document fenced code blocks, and
|
|
22
|
+
contributes anchor-navigation support so other plugins can scroll and highlight specific cell ranges by DXN reference.
|
|
23
|
+
AI agents can invoke sheet operations — insert/drop axes, scroll to anchor, and read or write cell values — through
|
|
24
|
+
the standard operations framework.
|
|
14
25
|
`,
|
|
15
26
|
icon: 'ph--grid-nine--regular',
|
|
16
27
|
iconHue: 'indigo',
|
|
17
28
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-sheet',
|
|
29
|
+
spec: 'PLUGIN.mdl',
|
|
18
30
|
screenshots: ['https://dxos.network/plugin-details-sheet-dark.png'],
|
|
19
|
-
};
|
|
31
|
+
});
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import { afterEach, beforeEach, describe, expect, onTestFinished, test } from 'vitest';
|
|
6
6
|
|
|
7
7
|
import { Trigger } from '@dxos/async';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { type CellScalarValue, addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
|
|
10
|
+
import { TestBuilder, testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
|
|
13
|
-
import { Sheet, mapFormulaIndicesToRefs, mapFormulaRefsToIndices } from '
|
|
13
|
+
import { Sheet, mapFormulaIndicesToRefs, mapFormulaRefsToIndices } from '#types';
|
|
14
14
|
|
|
15
15
|
import { SheetModel } from './sheet-model';
|
|
16
16
|
import { createTestGrid } from './testing';
|
|
@@ -18,7 +18,7 @@ import { createTestGrid } from './testing';
|
|
|
18
18
|
describe('SheetModel', () => {
|
|
19
19
|
let testBuilder: TestBuilder;
|
|
20
20
|
beforeEach(async () => {
|
|
21
|
-
testBuilder = new TestBuilder({ types: [
|
|
21
|
+
testBuilder = new TestBuilder({ types: [Operation.PersistentOperation], plugins: testFunctionPlugins });
|
|
22
22
|
await testBuilder.open();
|
|
23
23
|
});
|
|
24
24
|
afterEach(async () => {
|
package/src/model/sheet-model.ts
CHANGED
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
addressToA1Notation,
|
|
21
21
|
createSheetName,
|
|
22
22
|
isFormula,
|
|
23
|
-
} from '@dxos/compute';
|
|
23
|
+
} from '@dxos/compute-hyperformula';
|
|
24
24
|
import { Resource } from '@dxos/context';
|
|
25
25
|
import { Obj } from '@dxos/echo';
|
|
26
26
|
import { Format, TypeEnum } from '@dxos/echo/internal';
|
|
27
|
-
import { invariant } from '@dxos/invariant';
|
|
27
|
+
import { assertArgument, invariant } from '@dxos/invariant';
|
|
28
28
|
import { PublicKey } from '@dxos/keys';
|
|
29
29
|
import { log } from '@dxos/log';
|
|
30
30
|
|
|
@@ -38,8 +38,8 @@ import {
|
|
|
38
38
|
insertIndices,
|
|
39
39
|
mapFormulaIndicesToRefs,
|
|
40
40
|
mapFormulaRefsToIndices,
|
|
41
|
-
} from '
|
|
42
|
-
import { type Sheet, type SheetAction } from '
|
|
41
|
+
} from '#types';
|
|
42
|
+
import { type Sheet, type SheetAction } from '#types';
|
|
43
43
|
|
|
44
44
|
// TODO(burdon): Move to compute.
|
|
45
45
|
// Map sheet types to system types.
|
|
@@ -122,7 +122,7 @@ export class SheetModel extends Resource {
|
|
|
122
122
|
*/
|
|
123
123
|
protected override async _open(): Promise<void> {
|
|
124
124
|
log('initialize', { id: this.id });
|
|
125
|
-
Obj.
|
|
125
|
+
Obj.update(this._sheet, (obj) => {
|
|
126
126
|
initialize(obj);
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -184,7 +184,7 @@ export class SheetModel extends Resource {
|
|
|
184
184
|
|
|
185
185
|
insertRows(i: number, n = 1): string[] {
|
|
186
186
|
let idx: string[] = [];
|
|
187
|
-
Obj.
|
|
187
|
+
Obj.update(this._sheet, (obj) => {
|
|
188
188
|
idx = insertIndices(obj.rows, i, n, MAX_ROWS);
|
|
189
189
|
});
|
|
190
190
|
this.reset();
|
|
@@ -193,7 +193,7 @@ export class SheetModel extends Resource {
|
|
|
193
193
|
|
|
194
194
|
insertColumns(i: number, n = 1): string[] {
|
|
195
195
|
let idx: string[] = [];
|
|
196
|
-
Obj.
|
|
196
|
+
Obj.update(this._sheet, (obj) => {
|
|
197
197
|
idx = insertIndices(obj.columns, i, n, MAX_COLS);
|
|
198
198
|
});
|
|
199
199
|
this.reset();
|
|
@@ -208,7 +208,7 @@ export class SheetModel extends Resource {
|
|
|
208
208
|
const values = this.getCellValues(range).flat();
|
|
209
209
|
const index = this._sheet.rows.indexOf(rowIndex);
|
|
210
210
|
this.clear(range);
|
|
211
|
-
Obj.
|
|
211
|
+
Obj.update(this._sheet, (obj) => {
|
|
212
212
|
obj.rows.splice(index, 1);
|
|
213
213
|
delete obj.rowMeta[rowIndex];
|
|
214
214
|
});
|
|
@@ -224,7 +224,7 @@ export class SheetModel extends Resource {
|
|
|
224
224
|
const values = this.getCellValues(range).flat();
|
|
225
225
|
const index = this._sheet.columns.indexOf(colIndex);
|
|
226
226
|
this.clear(range);
|
|
227
|
-
Obj.
|
|
227
|
+
Obj.update(this._sheet, (obj) => {
|
|
228
228
|
obj.columns.splice(index, 1);
|
|
229
229
|
delete obj.columnMeta[colIndex];
|
|
230
230
|
});
|
|
@@ -233,7 +233,7 @@ export class SheetModel extends Resource {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
restoreRow({ index, axisIndex, axisMeta, values }: SheetAction.RestoreAxis): void {
|
|
236
|
-
Obj.
|
|
236
|
+
Obj.update(this._sheet, (obj) => {
|
|
237
237
|
obj.rows.splice(index, 0, axisIndex);
|
|
238
238
|
values.forEach((value, col) => {
|
|
239
239
|
if (value) {
|
|
@@ -249,7 +249,7 @@ export class SheetModel extends Resource {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
restoreColumn({ index, axisIndex, axisMeta, values }: SheetAction.RestoreAxis): void {
|
|
252
|
-
Obj.
|
|
252
|
+
Obj.update(this._sheet, (obj) => {
|
|
253
253
|
obj.columns.splice(index, 0, axisIndex);
|
|
254
254
|
values.forEach((value, row) => {
|
|
255
255
|
if (value) {
|
|
@@ -277,7 +277,7 @@ export class SheetModel extends Resource {
|
|
|
277
277
|
const topLeft = getTopLeft(range);
|
|
278
278
|
const values = this._iterRange(range, () => null);
|
|
279
279
|
this._node.graph.hf.setCellContents(toSimpleCellAddress(this._node.sheetId, topLeft), values);
|
|
280
|
-
Obj.
|
|
280
|
+
Obj.update(this._sheet, (obj) => {
|
|
281
281
|
this._iterRange(range, (cell) => {
|
|
282
282
|
const idx = addressToIndex(this._sheet, cell);
|
|
283
283
|
delete obj.cells[idx];
|
|
@@ -288,7 +288,7 @@ export class SheetModel extends Resource {
|
|
|
288
288
|
cut(range: CellRange): void {
|
|
289
289
|
invariant(this._node);
|
|
290
290
|
this._node.graph.hf.cut(toModelRange(this._node.sheetId, range));
|
|
291
|
-
Obj.
|
|
291
|
+
Obj.update(this._sheet, (obj) => {
|
|
292
292
|
this._iterRange(range, (cell) => {
|
|
293
293
|
const idx = addressToIndex(this._sheet, cell);
|
|
294
294
|
delete obj.cells[idx];
|
|
@@ -305,7 +305,7 @@ export class SheetModel extends Resource {
|
|
|
305
305
|
invariant(this._node);
|
|
306
306
|
if (!this._node.graph.hf.isClipboardEmpty()) {
|
|
307
307
|
const changes = this._node.graph.hf.paste(toSimpleCellAddress(this._node.sheetId, cell));
|
|
308
|
-
Obj.
|
|
308
|
+
Obj.update(this._sheet, (obj) => {
|
|
309
309
|
for (const change of changes) {
|
|
310
310
|
if (change instanceof ExportedCellChange) {
|
|
311
311
|
const { address, newValue } = change;
|
|
@@ -404,13 +404,13 @@ export class SheetModel extends Resource {
|
|
|
404
404
|
// Reallocate if > current bounds.
|
|
405
405
|
let refresh = false;
|
|
406
406
|
if (cell.row >= this._sheet.rows.length) {
|
|
407
|
-
Obj.
|
|
407
|
+
Obj.update(this._sheet, (obj) => {
|
|
408
408
|
insertIndices(obj.rows, cell.row, 1, MAX_ROWS);
|
|
409
409
|
});
|
|
410
410
|
refresh = true;
|
|
411
411
|
}
|
|
412
412
|
if (cell.col >= this._sheet.columns.length) {
|
|
413
|
-
Obj.
|
|
413
|
+
Obj.update(this._sheet, (obj) => {
|
|
414
414
|
insertIndices(obj.columns, cell.col, 1, MAX_COLS);
|
|
415
415
|
});
|
|
416
416
|
refresh = true;
|
|
@@ -429,7 +429,7 @@ export class SheetModel extends Resource {
|
|
|
429
429
|
// Insert into sheet.
|
|
430
430
|
const idx = addressToIndex(this._sheet, cell);
|
|
431
431
|
if (value === undefined || value === null) {
|
|
432
|
-
Obj.
|
|
432
|
+
Obj.update(this._sheet, (obj) => {
|
|
433
433
|
delete obj.cells[idx];
|
|
434
434
|
});
|
|
435
435
|
} else {
|
|
@@ -437,7 +437,7 @@ export class SheetModel extends Resource {
|
|
|
437
437
|
value = this._graph.mapFunctionBindingToId(mapFormulaRefsToIndices(this._sheet, value));
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
-
Obj.
|
|
440
|
+
Obj.update(this._sheet, (obj) => {
|
|
441
441
|
obj.cells[idx] = { value };
|
|
442
442
|
});
|
|
443
443
|
}
|
|
@@ -489,7 +489,7 @@ export class SheetModel extends Resource {
|
|
|
489
489
|
* Map from indices to A1 notation.
|
|
490
490
|
*/
|
|
491
491
|
mapFormulaIndicesToRefs(formula: string): string {
|
|
492
|
-
|
|
492
|
+
assertArgument(isFormula(formula), 'formula');
|
|
493
493
|
return formula.replace(/([a-zA-Z0-9]+)@([a-zA-Z0-9]+)/g, (idx) => {
|
|
494
494
|
return addressToA1Notation(addressFromIndex(this._sheet, idx));
|
|
495
495
|
});
|
package/src/model/testing.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { addressToA1Notation } from '@dxos/compute';
|
|
5
|
+
import { addressToA1Notation } from '@dxos/compute-hyperformula';
|
|
6
6
|
|
|
7
|
-
import { Sheet } from '
|
|
7
|
+
import { Sheet } from '#types';
|
|
8
8
|
|
|
9
9
|
// TODO(burdon): Create testing endpoint.
|
|
10
10
|
// TODO(burdon): Move to react-ui-sheet.
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type ComputeGraph } from '@dxos/compute';
|
|
7
|
+
import { type ComputeGraph } from '@dxos/compute-hyperformula';
|
|
8
|
+
|
|
9
|
+
import { type Sheet } from '#types';
|
|
8
10
|
|
|
9
11
|
import { SheetModel } from '../model';
|
|
10
|
-
import { type Sheet } from '../types';
|
|
11
12
|
|
|
12
13
|
export type UseSheetModelOptions = {
|
|
13
14
|
readonly?: boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
// Copyright 2025 DXOS.org
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
import { SheetOperation } from '../types';
|
|
10
|
+
|
|
11
|
+
const handler: Operation.WithHandler<typeof SheetOperation.DropAxis> = SheetOperation.DropAxis.pipe(
|
|
12
|
+
Operation.withHandler(({ model, axis, axisIndex }) =>
|
|
13
|
+
Effect.sync(() => {
|
|
14
|
+
const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
15
|
+
return {
|
|
16
|
+
axis: undoData.axis,
|
|
17
|
+
axisIndex: undoData.axisIndex,
|
|
18
|
+
index: undoData.index,
|
|
19
|
+
axisMeta: undoData.axisMeta,
|
|
20
|
+
values: undoData.values,
|
|
21
|
+
};
|
|
22
|
+
}),
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default handler;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
|
+
|
|
7
|
+
export const SheetOperationHandlerSet = OperationHandlerSet.lazy(
|
|
8
|
+
() => import('./drop-axis'),
|
|
9
|
+
() => import('./insert-axis'),
|
|
10
|
+
() => import('./restore-axis'),
|
|
11
|
+
() => import('./scroll-to-anchor'),
|
|
12
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
// Copyright 2025 DXOS.org
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
import { SheetOperation } from '../types';
|
|
10
|
+
|
|
11
|
+
const handler: Operation.WithHandler<typeof SheetOperation.InsertAxis> = SheetOperation.InsertAxis.pipe(
|
|
12
|
+
Operation.withHandler(({ model, axis, index, count }) =>
|
|
13
|
+
Effect.sync(() => {
|
|
14
|
+
model[axis === 'col' ? 'insertColumns' : 'insertRows'](index, count);
|
|
15
|
+
}),
|
|
16
|
+
),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default handler;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
// Copyright 2025 DXOS.org
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
import { SheetOperation } from '../types';
|
|
10
|
+
|
|
11
|
+
const handler: Operation.WithHandler<typeof SheetOperation.RestoreAxis> = SheetOperation.RestoreAxis.pipe(
|
|
12
|
+
Operation.withHandler(({ model, axis, ...restoreData }) =>
|
|
13
|
+
Effect.sync(() => {
|
|
14
|
+
model[axis === 'col' ? 'restoreColumn' : 'restoreRow'](restoreData);
|
|
15
|
+
}),
|
|
16
|
+
),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default handler;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { parseThreadAnchorAsCellRange } from '../integrations/thread-ranges';
|
|
11
|
+
import { SheetCapabilities, SheetOperation } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof SheetOperation.ScrollToAnchor> = SheetOperation.ScrollToAnchor.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* ({ subject, cursor, ref }) {
|
|
16
|
+
const gridInstances = yield* Capability.get(SheetCapabilities.GridInstances);
|
|
17
|
+
const entry = gridInstances.get(subject);
|
|
18
|
+
if (!entry) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
entry.setActiveRefs(ref);
|
|
22
|
+
const range = parseThreadAnchorAsCellRange(cursor);
|
|
23
|
+
if (range) {
|
|
24
|
+
entry.grid.setFocus({ ...range.to, plane: 'grid' }, true);
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export default handler;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Page, expect, test } from '@playwright/test';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { random } from '@dxos/random';
|
|
8
8
|
import { setupPage, storybookUrl } from '@dxos/test-utils/playwright';
|
|
9
9
|
|
|
10
10
|
import { SheetManager } from './sheet-manager';
|
|
@@ -15,7 +15,7 @@ test.describe('plugin-sheet', () => {
|
|
|
15
15
|
|
|
16
16
|
test.beforeEach(async ({ browser }) => {
|
|
17
17
|
const setup = await setupPage(browser, {
|
|
18
|
-
url: storybookUrl('plugins-plugin-sheet-containers-
|
|
18
|
+
url: storybookUrl('plugins-plugin-sheet-containers-sheetarticle--spec', 9005),
|
|
19
19
|
viewportSize: { width: 1280, height: 720 },
|
|
20
20
|
});
|
|
21
21
|
page = setup.page;
|
|
@@ -39,7 +39,7 @@ test.describe('plugin-sheet', () => {
|
|
|
39
39
|
// Confirm editor displays
|
|
40
40
|
await expect(sheet.cellEditor()).toBeVisible();
|
|
41
41
|
// Type in a value and press enter
|
|
42
|
-
const testString =
|
|
42
|
+
const testString = random.string.uuid();
|
|
43
43
|
await sheet.setFocusedCellValue(testString, 'Enter');
|
|
44
44
|
// Expect that value to now show in the grid
|
|
45
45
|
await expect(sheet.cellByText(testString)).toBeVisible();
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const SheetPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { SheetOperationHandlerSet } from './operations';
|
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
|
-
await 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
|
@@ -2,51 +2,57 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
5
6
|
import { type Resource } from '@dxos/react-ui';
|
|
6
7
|
|
|
7
|
-
import { meta } from '
|
|
8
|
-
import { Sheet } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
|
+
import { Sheet } from '#types';
|
|
9
10
|
|
|
10
11
|
export const translations = [
|
|
11
12
|
{
|
|
12
13
|
'en-US': {
|
|
13
|
-
[Sheet.Sheet
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'object
|
|
14
|
+
[Type.getTypename(Sheet.Sheet)]: {
|
|
15
|
+
'typename.label': 'Sheet',
|
|
16
|
+
'typename.label_zero': 'Sheets',
|
|
17
|
+
'typename.label_one': 'Sheet',
|
|
18
|
+
'typename.label_other': 'Sheets',
|
|
19
|
+
'object-name.placeholder': 'New sheet',
|
|
20
|
+
'add-object.label': 'Add sheet',
|
|
21
|
+
'rename-object.label': 'Rename sheet',
|
|
22
|
+
'delete-object.label': 'Delete sheet',
|
|
23
|
+
'object-deleted.label': 'Sheet deleted',
|
|
22
24
|
},
|
|
23
25
|
[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
|
-
'
|
|
26
|
+
'plugin.name': 'Sheets',
|
|
27
|
+
'cell.placeholder': 'Cell value...',
|
|
28
|
+
|
|
29
|
+
'range-key.alignment.label': 'Align',
|
|
30
|
+
'range-key.style.label': 'Style',
|
|
31
|
+
|
|
32
|
+
'range-value.start.label': 'Align left',
|
|
33
|
+
'range-value.center.label': 'Align center',
|
|
34
|
+
'range-value.end.label': 'Align right',
|
|
35
|
+
'range-value.softwrap.label': 'Wrap text',
|
|
36
|
+
'range-value.highlight.label': 'Highlight',
|
|
37
|
+
|
|
38
|
+
'toolbar-action.label': '{{value}}',
|
|
39
|
+
'selection-overlaps-existing-comment.label': 'Selected cell already has a comment',
|
|
40
|
+
'comment.label': 'Add comment',
|
|
41
|
+
'comment-ranges-not-supported.label': 'Commenting on ranges is not yet supported',
|
|
42
|
+
'no-cursor.label': 'Select a cell to comment',
|
|
43
|
+
'add-col-before.label': 'Add column before',
|
|
44
|
+
'add-col-after.label': 'Add column after',
|
|
45
|
+
'delete-col.label': 'Delete column',
|
|
46
|
+
'add-row-before.label': 'Add row before',
|
|
47
|
+
'add-row-after.label': 'Add row after',
|
|
48
|
+
'delete-row.label': 'Delete row',
|
|
49
|
+
'range-list.heading': 'Ranges',
|
|
50
|
+
'no-ranges.message': 'No ranges',
|
|
51
|
+
'range.title': '{{position}} — {{value}}',
|
|
52
|
+
'col-dropped.label': 'Deleted a column',
|
|
53
|
+
'row-dropped.label': 'Deleted a row',
|
|
54
|
+
'align.label': 'Text align',
|
|
55
|
+
'axis-dropped.label': 'Drop axis', // TODO(burdon): What does this mean?
|
|
50
56
|
},
|
|
51
57
|
},
|
|
52
58
|
},
|