@dxos/plugin-sheet 0.8.4-main.7996785055 → 0.8.4-main.8baae0fced
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/{browser/RangeList-RRNK4LL5.mjs → neutral/RangeList-HYB5S6KQ.mjs} +20 -24
- package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +7 -0
- package/dist/lib/{browser/SheetContainer-N7GPNSOM.mjs → neutral/SheetArticle-5AJRM3V3.mjs} +8 -19
- package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +7 -0
- package/dist/lib/neutral/SheetPlugin.mjs +47 -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-J4Y5NKYR.mjs → neutral/anchor-sort-TTCKGX7V.mjs} +5 -8
- 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-NNWF7EKC.mjs → neutral/chunk-4SBAIU6F.mjs} +3 -3
- package/dist/lib/neutral/chunk-4SBAIU6F.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CGWDLWFZ.mjs +8 -0
- package/dist/lib/neutral/chunk-CGWDLWFZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{browser/chunk-BZEV7AQM.mjs → neutral/chunk-KC2SMDNF.mjs} +171 -76
- package/dist/lib/neutral/chunk-KC2SMDNF.mjs.map +7 -0
- package/dist/lib/{browser/chunk-MFMDZ433.mjs → neutral/chunk-UVFW5VID.mjs} +2 -8
- package/dist/lib/neutral/chunk-UVFW5VID.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/neutral/comment-config-ZBWNCJMZ.mjs +20 -0
- package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs.map +7 -0
- package/dist/lib/{browser/chunk-T5XHKC7L.mjs → neutral/components/index.mjs} +80 -300
- 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-OKQAXJCW.mjs +27 -0
- package/dist/lib/neutral/create-object-OKQAXJCW.mjs.map +7 -0
- package/dist/lib/{browser/drop-axis-UTOJ5MVT.mjs → neutral/drop-axis-G6UOXG54.mjs} +6 -6
- package/dist/lib/neutral/drop-axis-G6UOXG54.mjs.map +7 -0
- package/dist/lib/{node-esm/types → neutral}/index.mjs +14 -5
- package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs +16 -0
- package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs.map +7 -0
- package/dist/lib/{browser/markdown-ZDM2HMK6.mjs → neutral/markdown-I2AKJYPF.mjs} +5 -7
- 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/{browser/operation-handler-5PGGEH6O.mjs → neutral/operation-handler-TB6LFV2H.mjs} +4 -7
- package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-7LK375A6.mjs → neutral/react-surface-VSTQNVPT.mjs} +12 -22
- 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/{browser/scroll-to-anchor-HNCUXJGW.mjs → neutral/scroll-to-anchor-QPOGMAQG.mjs} +10 -14
- package/dist/lib/neutral/scroll-to-anchor-QPOGMAQG.mjs.map +7 -0
- package/dist/lib/{browser/state-35W4C372.mjs → neutral/state-HPA27MX2.mjs} +4 -6
- 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 -4
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/{browser/undo-mappings-GTX6XUZK.mjs → neutral/undo-mappings-3FQLSTCZ.mjs} +8 -12
- 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 -7
- 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/operation-handler.d.ts → operation-handler.d.ts} +1 -1
- 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/{state/state.d.ts → state.d.ts} +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -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 +3 -15
- 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 +1 -5
- package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -1
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +75 -44
- 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 +2 -2
- package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -1
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +1 -5
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +1 -5
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +72 -70
- 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 -1
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- 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 +3 -3
- package/dist/types/src/operations/drop-axis.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/insert-axis.d.ts +3 -3
- package/dist/types/src/operations/insert-axis.d.ts.map +1 -1
- package/dist/types/src/operations/restore-axis.d.ts +3 -3
- package/dist/types/src/operations/restore-axis.d.ts.map +1 -1
- package/dist/types/src/operations/scroll-to-anchor.d.ts +3 -3
- package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -1
- 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 -40
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Sheet.d.ts +6 -6
- package/dist/types/src/types/Sheet.d.ts.map +1 -1
- package/dist/types/src/types/{capabilities.d.ts → SheetCapabilities.d.ts} +5 -7
- package/dist/types/src/types/SheetCapabilities.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/SheetOperation.d.ts} +12 -12
- 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.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 +116 -80
- package/src/SheetPlugin.node.ts +21 -0
- package/src/SheetPlugin.test.ts +30 -0
- package/src/SheetPlugin.tsx +13 -40
- package/src/SheetPlugin.workerd.ts +18 -0
- package/src/capabilities/{anchor-sort/anchor-sort.ts → anchor-sort.ts} +1 -1
- package/src/capabilities/comment-config.ts +24 -0
- package/src/capabilities/compute-graph-registry.ts +42 -0
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +17 -7
- package/src/capabilities/{markdown/markdown.ts → markdown.ts} +3 -2
- package/src/capabilities/{operation-handler/operation-handler.ts → operation-handler.ts} +2 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +9 -9
- package/src/capabilities/{state/state.ts → state.ts} +3 -3
- package/src/capabilities/{undo-mappings/undo-mappings.ts → undo-mappings.ts} +3 -3
- package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +1 -1
- package/src/components/ComputeGraph/compute-graph.stories.tsx +17 -14
- package/src/components/SheetContent/SheetCellEditor.stories.tsx +8 -7
- package/src/components/SheetContent/SheetContent.stories.tsx +10 -10
- package/src/components/SheetContent/SheetContent.tsx +10 -10
- package/src/components/SheetContent/util.ts +3 -2
- package/src/components/SheetRoot/SheetRoot.tsx +8 -2
- package/src/components/SheetStatusbar/SheetStatusbar.tsx +3 -3
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +1 -1
- package/src/components/SheetToolbar/SheetToolbar.tsx +1 -2
- package/src/components/SheetToolbar/align.ts +9 -9
- package/src/components/SheetToolbar/style.ts +7 -7
- package/src/containers/RangeList/RangeList.tsx +16 -15
- package/src/containers/RangeList/index.ts +1 -3
- package/src/containers/{SheetContainer/SheetContainer.stories.tsx → SheetArticle/SheetArticle.stories.tsx} +20 -19
- package/src/containers/{SheetContainer/SheetContainer.tsx → SheetArticle/SheetArticle.tsx} +9 -9
- package/src/containers/SheetArticle/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/extensions/compute.stories.tsx +10 -10
- package/src/extensions/compute.ts +1 -1
- package/src/extensions/editor/sheet-extension.test.ts +1 -1
- package/src/extensions/editor/sheet-extension.ts +2 -2
- package/src/index.ts +2 -2
- package/src/integrations/thread-ranges.ts +9 -9
- package/src/meta.ts +1 -0
- package/src/model/sheet-model.test.ts +4 -4
- package/src/model/sheet-model.ts +17 -17
- package/src/model/testing.ts +2 -2
- package/src/model/useSheetModel.ts +3 -2
- package/src/operations/drop-axis.ts +5 -5
- package/src/operations/index.ts +1 -3
- package/src/operations/insert-axis.ts +5 -5
- package/src/operations/restore-axis.ts +5 -5
- package/src/operations/scroll-to-anchor.ts +3 -4
- package/src/playwright/sheet.spec.ts +3 -3
- package/src/plugin.ts +11 -0
- package/src/sanity.test.ts +6 -2
- 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 -37
- package/src/types/Sheet.ts +7 -7
- package/src/types/{capabilities.ts → SheetCapabilities.ts} +9 -9
- package/src/{operations/definitions.ts → types/SheetOperation.ts} +4 -2
- package/src/types/index.ts +4 -2
- package/src/types/util.ts +1 -1
- package/dist/lib/browser/RangeList-RRNK4LL5.mjs.map +0 -7
- package/dist/lib/browser/SheetContainer-N7GPNSOM.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-J4Y5NKYR.mjs.map +0 -7
- package/dist/lib/browser/chunk-AIOU5OTJ.mjs +0 -118
- package/dist/lib/browser/chunk-AIOU5OTJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-BZEV7AQM.mjs.map +0 -7
- package/dist/lib/browser/chunk-MFMDZ433.mjs.map +0 -7
- package/dist/lib/browser/chunk-NNWF7EKC.mjs.map +0 -7
- package/dist/lib/browser/chunk-T5XHKC7L.mjs.map +0 -7
- package/dist/lib/browser/chunk-UZ4SHAES.mjs +0 -8
- package/dist/lib/browser/chunk-UZ4SHAES.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-FEG3DN5R.mjs +0 -22
- package/dist/lib/browser/compute-graph-registry-FEG3DN5R.mjs.map +0 -7
- package/dist/lib/browser/drop-axis-UTOJ5MVT.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -172
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/insert-axis-OS5VFQDK.mjs +0 -16
- package/dist/lib/browser/insert-axis-OS5VFQDK.mjs.map +0 -7
- package/dist/lib/browser/markdown-ZDM2HMK6.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-handler-5PGGEH6O.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -12
- package/dist/lib/browser/react-surface-7LK375A6.mjs.map +0 -7
- package/dist/lib/browser/restore-axis-O7PHU7ON.mjs +0 -16
- package/dist/lib/browser/restore-axis-O7PHU7ON.mjs.map +0 -7
- package/dist/lib/browser/scroll-to-anchor-HNCUXJGW.mjs.map +0 -7
- package/dist/lib/browser/state-35W4C372.mjs.map +0 -7
- package/dist/lib/browser/undo-mappings-GTX6XUZK.mjs.map +0 -7
- package/dist/lib/node-esm/RangeList-X6IU5QKI.mjs +0 -51
- package/dist/lib/node-esm/RangeList-X6IU5QKI.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-QFRHGZZE.mjs +0 -45
- package/dist/lib/node-esm/SheetContainer-QFRHGZZE.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-XLGKHSB4.mjs +0 -26
- package/dist/lib/node-esm/anchor-sort-XLGKHSB4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HI3E7P4K.mjs +0 -10
- package/dist/lib/node-esm/chunk-HI3E7P4K.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J7XCAKTA.mjs +0 -279
- package/dist/lib/node-esm/chunk-J7XCAKTA.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-PK76XIMN.mjs +0 -1772
- package/dist/lib/node-esm/chunk-PK76XIMN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMXU7BDG.mjs +0 -29
- package/dist/lib/node-esm/chunk-UMXU7BDG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z4BXHF76.mjs +0 -119
- package/dist/lib/node-esm/chunk-Z4BXHF76.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-TOMM5AGM.mjs +0 -23
- package/dist/lib/node-esm/compute-graph-registry-TOMM5AGM.mjs.map +0 -7
- package/dist/lib/node-esm/drop-axis-XFFTKE4J.mjs +0 -24
- package/dist/lib/node-esm/drop-axis-XFFTKE4J.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -173
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/insert-axis-QYN6V3NH.mjs +0 -17
- package/dist/lib/node-esm/insert-axis-QYN6V3NH.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-TTSQDUPW.mjs +0 -31
- package/dist/lib/node-esm/markdown-TTSQDUPW.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-handler-G6SZSFCD.mjs +0 -17
- package/dist/lib/node-esm/operation-handler-G6SZSFCD.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -13
- package/dist/lib/node-esm/react-surface-OVBFWYD7.mjs +0 -55
- package/dist/lib/node-esm/react-surface-OVBFWYD7.mjs.map +0 -7
- package/dist/lib/node-esm/restore-axis-WUXX5KAE.mjs +0 -17
- package/dist/lib/node-esm/restore-axis-WUXX5KAE.mjs.map +0 -7
- package/dist/lib/node-esm/scroll-to-anchor-UUXINUVP.mjs +0 -38
- package/dist/lib/node-esm/scroll-to-anchor-UUXINUVP.mjs.map +0 -7
- package/dist/lib/node-esm/state-L3SAQ6V7.mjs +0 -32
- package/dist/lib/node-esm/state-L3SAQ6V7.mjs.map +0 -7
- package/dist/lib/node-esm/undo-mappings-CQIVZKAC.mjs +0 -36
- package/dist/lib/node-esm/undo-mappings-CQIVZKAC.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 +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.map +0 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -4
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/operation-handler.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/capabilities/state/index.d.ts +0 -3
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/undo-mappings/index.d.ts +0 -3
- package/dist/types/src/capabilities/undo-mappings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/undo-mappings/undo-mappings.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 -57
- 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/operations/definitions.d.ts.map +0 -1
- 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-handler/index.ts +0 -11
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/undo-mappings/index.ts +0 -7
- package/src/containers/SheetContainer/index.ts +0 -7
- /package/dist/lib/{browser/operations/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/operations/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/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
- /package/dist/types/src/capabilities/{undo-mappings/undo-mappings.d.ts → undo-mappings.d.ts} +0 -0
|
@@ -6,8 +6,8 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability, UndoMapping } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
import { meta } from '
|
|
10
|
-
import { SheetOperation } from '
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { SheetOperation } from '#types';
|
|
11
11
|
|
|
12
12
|
export default Capability.makeModule(() =>
|
|
13
13
|
Effect.succeed(
|
|
@@ -23,7 +23,7 @@ export default Capability.makeModule(() =>
|
|
|
23
23
|
axisMeta: output.axisMeta,
|
|
24
24
|
values: output.values,
|
|
25
25
|
}),
|
|
26
|
-
message: ['axis
|
|
26
|
+
message: ['axis-dropped.label', { ns: meta.id }],
|
|
27
27
|
}),
|
|
28
28
|
]),
|
|
29
29
|
),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type PropsWithChildren, createContext, useContext } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type ComputeGraph, type ComputeGraphRegistry } from '@dxos/compute';
|
|
7
|
+
import { type ComputeGraph, type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
|
|
8
8
|
import { raise } from '@dxos/debug';
|
|
9
9
|
import { type Space } from '@dxos/react-client/echo';
|
|
10
10
|
import { useAsyncState } from '@dxos/react-hooks';
|
|
@@ -5,26 +5,25 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React, { useEffect, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import {
|
|
12
|
-
import { useSpace } from '@dxos/react-client/echo';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
|
|
10
|
+
import { Filter, Obj } from '@dxos/echo';
|
|
11
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
13
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
14
13
|
import { Button, Input, Toolbar } from '@dxos/react-ui';
|
|
14
|
+
import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
15
15
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
16
|
-
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
17
16
|
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { Sheet } from '../../types';
|
|
17
|
+
import { withComputeGraphDecorator } from '#testing';
|
|
18
|
+
import { Sheet } from '#types';
|
|
21
19
|
|
|
20
|
+
import { useSheetModel } from '../../model';
|
|
22
21
|
import { useComputeGraph } from './ComputeGraphContextProvider';
|
|
23
22
|
|
|
24
23
|
const FUNCTION_NAME = 'TEST';
|
|
25
24
|
|
|
26
25
|
const DefaultStory = () => {
|
|
27
|
-
const space =
|
|
26
|
+
const [space] = useSpaces();
|
|
28
27
|
const graph = useComputeGraph(space);
|
|
29
28
|
const [sheet, setSheet] = useState<Sheet.Sheet>();
|
|
30
29
|
const [text, setText] = useState(`${FUNCTION_NAME}(100)`);
|
|
@@ -45,7 +44,13 @@ const DefaultStory = () => {
|
|
|
45
44
|
setResult({ functions: { standard: f1.length, echo: f2.length } });
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
space.db.add(
|
|
47
|
+
space.db.add(
|
|
48
|
+
Obj.make(Operation.PersistentOperation, {
|
|
49
|
+
[Obj.Meta]: { version: '0.0.1' },
|
|
50
|
+
name: 'test',
|
|
51
|
+
binding: FUNCTION_NAME,
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
49
54
|
}
|
|
50
55
|
}, [space, graph]);
|
|
51
56
|
|
|
@@ -75,9 +80,7 @@ const DefaultStory = () => {
|
|
|
75
80
|
</Input.Root>
|
|
76
81
|
<Button onClick={handleTest}>Test</Button>
|
|
77
82
|
</Toolbar.Root>
|
|
78
|
-
<
|
|
79
|
-
{JSON.stringify({ space: space?.id, graph: graph?.id, sheet: sheet?.id, model: model?.id, result }, null, 2)}
|
|
80
|
-
</SyntaxHighlighter>
|
|
83
|
+
<JsonHighlighter data={{ space: space?.id, graph: graph?.id, sheet: sheet?.id, model: model?.id, result }} />
|
|
81
84
|
</div>
|
|
82
85
|
);
|
|
83
86
|
};
|
|
@@ -6,17 +6,18 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Client } from '@dxos/client';
|
|
9
|
-
import { defaultFunctions } from '@dxos/compute';
|
|
10
|
-
import { getRegisteredFunctionNames } from '@dxos/compute/testing';
|
|
9
|
+
import { defaultFunctions } from '@dxos/compute-hyperformula';
|
|
10
|
+
import { getRegisteredFunctionNames } from '@dxos/compute-hyperformula/testing';
|
|
11
11
|
import { Obj } from '@dxos/echo';
|
|
12
12
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
13
13
|
import { useAsyncEffect } from '@dxos/react-hooks';
|
|
14
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
15
14
|
import { CellEditor, type CellEditorProps } from '@dxos/react-ui-grid';
|
|
15
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
16
16
|
import { automerge } from '@dxos/ui-editor';
|
|
17
17
|
|
|
18
|
+
import { Sheet } from '#types';
|
|
19
|
+
|
|
18
20
|
import { sheetExtension } from '../../extensions';
|
|
19
|
-
import { Sheet } from '../../types';
|
|
20
21
|
|
|
21
22
|
const DefaultStory = ({ value, ...props }: CellEditorProps) => {
|
|
22
23
|
const extensions = useMemo(() => {
|
|
@@ -38,9 +39,9 @@ const AutomergeStory = ({ value, ...props }: CellEditorProps) => {
|
|
|
38
39
|
const space = await client.spaces.create();
|
|
39
40
|
|
|
40
41
|
const sheet = Sheet.make();
|
|
41
|
-
Obj.
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
Obj.update(sheet, (sheet) => {
|
|
43
|
+
sheet.name = 'Test';
|
|
44
|
+
sheet.cells[cell] = { value };
|
|
44
45
|
});
|
|
45
46
|
space.db.add(sheet);
|
|
46
47
|
setObject(sheet);
|
|
@@ -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 { ProcessManagerPlugin } from '@dxos/app-framework';
|
|
8
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
9
|
-
import { testFunctionPlugins } from '@dxos/compute/testing';
|
|
10
|
-
import {
|
|
11
|
-
import { useSpace } from '@dxos/react-client/echo';
|
|
10
|
+
import { testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
|
|
11
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
14
|
|
|
15
|
-
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '
|
|
16
|
-
import { translations } from '
|
|
17
|
-
import { Sheet } from '
|
|
15
|
+
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '#testing';
|
|
16
|
+
import { translations } from '#translations';
|
|
17
|
+
import { Sheet } from '#types';
|
|
18
|
+
|
|
18
19
|
import { useComputeGraph } from '../ComputeGraph';
|
|
19
20
|
import { SheetRoot } from '../SheetRoot';
|
|
20
|
-
|
|
21
21
|
import { SheetContent } from './SheetContent';
|
|
22
22
|
|
|
23
23
|
export const Basic = () => {
|
|
24
|
-
const space =
|
|
24
|
+
const [space] = useSpaces();
|
|
25
25
|
const graph = useComputeGraph(space);
|
|
26
26
|
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
27
27
|
if (!sheet || !graph) {
|
|
@@ -30,7 +30,7 @@ export const Basic = () => {
|
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<SheetRoot graph={graph} sheet={sheet} attendableId='test' ignoreAttention>
|
|
33
|
-
<div
|
|
33
|
+
<div className='grid h-full w-full'>
|
|
34
34
|
<SheetContent />
|
|
35
35
|
</div>
|
|
36
36
|
</SheetRoot>
|
|
@@ -46,7 +46,7 @@ const meta = {
|
|
|
46
46
|
withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
|
|
47
47
|
withComputeGraphDecorator({ plugins: testFunctionPlugins }),
|
|
48
48
|
withPluginManager({
|
|
49
|
-
plugins: [
|
|
49
|
+
plugins: [ProcessManagerPlugin()],
|
|
50
50
|
}),
|
|
51
51
|
],
|
|
52
52
|
parameters: {
|
|
@@ -15,7 +15,7 @@ import React, {
|
|
|
15
15
|
} from 'react';
|
|
16
16
|
|
|
17
17
|
import { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
18
|
-
import { type CellRange, rangeToA1Notation } from '@dxos/compute';
|
|
18
|
+
import { type CellRange, rangeToA1Notation } from '@dxos/compute-hyperformula';
|
|
19
19
|
import { Obj } from '@dxos/echo';
|
|
20
20
|
import { defaultColSize, defaultRowSize } from '@dxos/lit-grid';
|
|
21
21
|
import { DropdownMenu, Icon, useTranslation } from '@dxos/react-ui';
|
|
@@ -35,13 +35,13 @@ import {
|
|
|
35
35
|
} from '@dxos/react-ui-grid';
|
|
36
36
|
import { composable, composableProps } from '@dxos/ui-theme';
|
|
37
37
|
|
|
38
|
+
import { meta } from '#meta';
|
|
39
|
+
import { SheetOperation } from '#types';
|
|
40
|
+
import { DEFAULT_COLS, DEFAULT_ROWS, SheetCapabilities } from '#types';
|
|
41
|
+
|
|
38
42
|
import { type RangeController, rangeExtension, sheetExtension } from '../../extensions';
|
|
39
43
|
import { useSelectThreadOnCellFocus } from '../../integrations';
|
|
40
|
-
import { meta } from '../../meta';
|
|
41
|
-
import { DEFAULT_COLS, DEFAULT_ROWS, SheetCapabilities } from '../../types';
|
|
42
|
-
import { SheetOperation } from '../../operations';
|
|
43
44
|
import { useSheetContext } from '../SheetRoot';
|
|
44
|
-
|
|
45
45
|
import { colLabelCell, rowLabelCell, useSheetModelDxGridProps } from './util';
|
|
46
46
|
|
|
47
47
|
const inertPosition: DxGridPosition = { plane: 'grid', col: 0, row: 0 };
|
|
@@ -145,7 +145,7 @@ export const SheetContent = composable<HTMLDivElement, SheetContentProps>((props
|
|
|
145
145
|
|
|
146
146
|
const handleAxisResize = useCallback<NonNullable<GridContentProps['onAxisResize']>>(
|
|
147
147
|
({ axis, size, index: numericIndex }) => {
|
|
148
|
-
Obj.
|
|
148
|
+
Obj.update(model.sheet, (sheet) => {
|
|
149
149
|
if (axis === 'row') {
|
|
150
150
|
const rowId = sheet.rows[parseInt(numericIndex)];
|
|
151
151
|
sheet.rowMeta[rowId] ??= {};
|
|
@@ -341,7 +341,7 @@ export const SheetContent = composable<HTMLDivElement, SheetContentProps>((props
|
|
|
341
341
|
useSelectThreadOnCellFocus();
|
|
342
342
|
|
|
343
343
|
return (
|
|
344
|
-
<div ref={forwardedRef} {...composableProps(props, {
|
|
344
|
+
<div ref={forwardedRef} {...composableProps(props, { classNames: 'relative min-h-0' })}>
|
|
345
345
|
<GridCellEditor getCellContent={getCellContent} extensions={extensions} onBlur={handleBlur} />
|
|
346
346
|
<Grid.Content
|
|
347
347
|
className='[--dx-grid-base:var(--base-surface)] [&_.dx-grid]:absolute [&_.dx-grid]:inset-0'
|
|
@@ -379,7 +379,7 @@ export const SheetContent = composable<HTMLDivElement, SheetContentProps>((props
|
|
|
379
379
|
<Icon
|
|
380
380
|
icon={contextMenuAxis === 'col' ? 'ph--columns-plus-left--regular' : 'ph--rows-plus-top--regular'}
|
|
381
381
|
/>
|
|
382
|
-
<span>{t(`add
|
|
382
|
+
<span>{t(`add-${contextMenuAxis}-before.label`)}</span>
|
|
383
383
|
</DropdownMenu.Item>
|
|
384
384
|
<DropdownMenu.Item
|
|
385
385
|
onClick={() => handleAxisMenuAction('insert-after')}
|
|
@@ -388,14 +388,14 @@ export const SheetContent = composable<HTMLDivElement, SheetContentProps>((props
|
|
|
388
388
|
<Icon
|
|
389
389
|
icon={contextMenuAxis === 'col' ? 'ph--columns-plus-right--regular' : 'ph--rows-plus-bottom--regular'}
|
|
390
390
|
/>
|
|
391
|
-
<span>{t(`add
|
|
391
|
+
<span>{t(`add-${contextMenuAxis}-after.label`)}</span>
|
|
392
392
|
</DropdownMenu.Item>
|
|
393
393
|
<DropdownMenu.Item
|
|
394
394
|
onClick={() => handleAxisMenuAction('drop')}
|
|
395
395
|
data-testid={`grid.${contextMenuAxis}.drop`}
|
|
396
396
|
>
|
|
397
397
|
<Icon icon='ph--backspace--regular' />
|
|
398
|
-
<span>{t(`delete
|
|
398
|
+
<span>{t(`delete-${contextMenuAxis}.label`)}</span>
|
|
399
399
|
</DropdownMenu.Item>
|
|
400
400
|
</DropdownMenu.Viewport>
|
|
401
401
|
<DropdownMenu.Arrow />
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { inRange } from '@dxos/compute';
|
|
7
|
+
import { inRange } from '@dxos/compute-hyperformula';
|
|
8
8
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
9
9
|
import { cellClassesForFieldType, parseValue } from '@dxos/react-ui-form';
|
|
10
10
|
import {
|
|
@@ -21,8 +21,9 @@ import {
|
|
|
21
21
|
} from '@dxos/react-ui-grid';
|
|
22
22
|
import { mx } from '@dxos/ui-theme';
|
|
23
23
|
|
|
24
|
+
import { cellClassNameForRange, rangeFromIndex } from '#types';
|
|
25
|
+
|
|
24
26
|
import { type SheetModel } from '../../model';
|
|
25
|
-
import { cellClassNameForRange, rangeFromIndex } from '../../types';
|
|
26
27
|
|
|
27
28
|
const createDxGridColumns = (model: SheetModel): DxGridAxisMeta => {
|
|
28
29
|
return model.sheet.columns.reduce(
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
type CellAddress,
|
|
9
|
+
type CellRange,
|
|
10
|
+
type CompleteCellRange,
|
|
11
|
+
type ComputeGraph,
|
|
12
|
+
} from '@dxos/compute-hyperformula';
|
|
8
13
|
import { raise } from '@dxos/debug';
|
|
9
14
|
import {
|
|
10
15
|
Grid,
|
|
@@ -14,8 +19,9 @@ import {
|
|
|
14
19
|
useGridContext,
|
|
15
20
|
} from '@dxos/react-ui-grid';
|
|
16
21
|
|
|
22
|
+
import { type Sheet } from '#types';
|
|
23
|
+
|
|
17
24
|
import { type SheetModel, useSheetModel } from '../../model';
|
|
18
|
-
import { type Sheet } from '../../types';
|
|
19
25
|
|
|
20
26
|
export type SheetContextValue = {
|
|
21
27
|
id: string;
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { addressToA1Notation, isFormula, rangeToA1Notation } from '@dxos/compute';
|
|
7
|
+
import { addressToA1Notation, isFormula, rangeToA1Notation } from '@dxos/compute-hyperformula';
|
|
8
8
|
import { Icon } from '@dxos/react-ui';
|
|
9
|
-
|
|
10
9
|
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
11
10
|
|
|
12
|
-
import { mapFormulaIndicesToRefs } from '
|
|
11
|
+
import { mapFormulaIndicesToRefs } from '#types';
|
|
12
|
+
|
|
13
13
|
import { useSheetContext } from '../SheetRoot';
|
|
14
14
|
|
|
15
15
|
export type SheetStatusbarProps = {};
|
|
@@ -6,13 +6,12 @@ import { Atom, type Registry, RegistryContext } from '@effect-atom/atom-react';
|
|
|
6
6
|
import React, { useContext, useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
9
|
-
import { type CompleteCellRange } from '@dxos/compute';
|
|
9
|
+
import { type CompleteCellRange } from '@dxos/compute-hyperformula';
|
|
10
10
|
import { type ActionGraphProps, Menu, createGapSeparator, useMenuActions } from '@dxos/react-ui-menu';
|
|
11
11
|
import { composable, composableProps } from '@dxos/ui-theme';
|
|
12
12
|
|
|
13
13
|
import { type SheetModel } from '../../model';
|
|
14
14
|
import { useSheetContext } from '../SheetRoot';
|
|
15
|
-
|
|
16
15
|
import { createAlign, useAlignState } from './align';
|
|
17
16
|
import { createStyle, useStyleState } from './style';
|
|
18
17
|
import { type ToolbarStateAtom, useToolbarState } from './useToolbarState';
|
|
@@ -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 '
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { type AlignKey, type AlignValue, alignKey, rangeFromIndex, rangeToIndex } from '#types';
|
|
19
|
+
|
|
18
20
|
import { type SheetModel } from '../../model';
|
|
19
|
-
import { type AlignKey, type AlignValue, alignKey, rangeFromIndex, rangeToIndex } from '../../types';
|
|
20
21
|
import { useSheetContext } from '../SheetRoot';
|
|
21
|
-
|
|
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,17 +84,17 @@ const createAlignActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
84
84
|
};
|
|
85
85
|
const currentState = registry.get(stateAtom);
|
|
86
86
|
if (index < 0) {
|
|
87
|
-
Obj.
|
|
87
|
+
Obj.update(model.sheet, (obj) => {
|
|
88
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.
|
|
92
|
+
Obj.update(model.sheet, (obj) => {
|
|
93
93
|
obj.ranges?.splice(index, 1);
|
|
94
94
|
});
|
|
95
95
|
registry.set(stateAtom, { ...currentState, [alignKey]: undefined });
|
|
96
96
|
} else {
|
|
97
|
-
Obj.
|
|
97
|
+
Obj.update(model.sheet, (obj) => {
|
|
98
98
|
obj.ranges?.splice(index, 1, nextRangeEntity);
|
|
99
99
|
});
|
|
100
100
|
registry.set(stateAtom, { ...currentState, [alignKey]: nextRangeEntity.value });
|
|
@@ -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
|
},
|
|
@@ -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 '
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '#types';
|
|
19
|
+
|
|
18
20
|
import { type SheetModel } from '../../model';
|
|
19
|
-
import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '../../types';
|
|
20
21
|
import { useSheetContext } from '../SheetRoot';
|
|
21
|
-
|
|
22
22
|
import { type ToolbarState, type ToolbarStateAtom } from './useToolbarState';
|
|
23
23
|
|
|
24
24
|
export type StyleState = Partial<Record<StyleValue, boolean>>;
|
|
@@ -103,13 +103,13 @@ const createStyleActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
103
103
|
) {
|
|
104
104
|
// this value should be unset
|
|
105
105
|
if (index >= 0) {
|
|
106
|
-
Obj.
|
|
106
|
+
Obj.update(model.sheet, (obj) => {
|
|
107
107
|
obj.ranges?.splice(index, 1);
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
registry.set(stateAtom, { ...currentState, [nextRangeEntity.value]: false });
|
|
111
111
|
} else {
|
|
112
|
-
Obj.
|
|
112
|
+
Obj.update(model.sheet, (obj) => {
|
|
113
113
|
obj.ranges?.push(nextRangeEntity);
|
|
114
114
|
});
|
|
115
115
|
registry.set(stateAtom, { ...currentState, [nextRangeEntity.value]: true });
|
|
@@ -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
|
);
|
|
@@ -5,40 +5,41 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import { rangeToA1Notation } from '@dxos/compute';
|
|
9
|
-
import {
|
|
8
|
+
import { rangeToA1Notation } from '@dxos/compute-hyperformula';
|
|
9
|
+
import { useObject } from '@dxos/echo-react';
|
|
10
10
|
import { Input, Message, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { List } from '@dxos/react-ui-list';
|
|
12
12
|
|
|
13
|
-
import { meta } from '
|
|
14
|
-
import { rangeFromIndex } from '
|
|
15
|
-
import { Sheet } from '
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
import { rangeFromIndex } from '#types';
|
|
15
|
+
import { Sheet } from '#types';
|
|
16
16
|
|
|
17
17
|
export type RangeListProps = {
|
|
18
18
|
sheet: Sheet.Sheet;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const RangeList = ({ sheet }: RangeListProps) => {
|
|
21
|
+
export const RangeList = ({ sheet: sheetProp }: RangeListProps) => {
|
|
22
22
|
const { t } = useTranslation(meta.id);
|
|
23
|
+
const [sheet, updateSheet] = useObject(sheetProp);
|
|
23
24
|
// TODO(thure): Implement similar to comments, #8121
|
|
24
25
|
const handleSelectRange = (range: Sheet.Range) => {};
|
|
25
26
|
const handleDeleteRange = useCallback(
|
|
26
27
|
(range: Sheet.Range) => {
|
|
27
28
|
const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
updateSheet((sheet) => {
|
|
30
|
+
sheet.ranges.splice(index, 1);
|
|
30
31
|
});
|
|
31
32
|
},
|
|
32
|
-
[sheet],
|
|
33
|
+
[sheet, updateSheet],
|
|
33
34
|
);
|
|
34
35
|
return (
|
|
35
36
|
<>
|
|
36
37
|
<Input.Root>
|
|
37
|
-
<Input.Label>{t('range
|
|
38
|
+
<Input.Label>{t('range-list.heading')}</Input.Label>
|
|
38
39
|
</Input.Root>
|
|
39
40
|
{sheet.ranges.length < 1 ? (
|
|
40
41
|
<Message.Root>
|
|
41
|
-
<Message.Title>{t('no
|
|
42
|
+
<Message.Title>{t('no-ranges.message')}</Message.Title>
|
|
42
43
|
</Message.Root>
|
|
43
44
|
) : (
|
|
44
45
|
<List.Root<Sheet.Range> items={sheet.ranges} isItem={Schema.is(Sheet.Range)}>
|
|
@@ -47,10 +48,10 @@ export const RangeList = ({ sheet }: RangeListProps) => {
|
|
|
47
48
|
<List.Item key={i} item={range}>
|
|
48
49
|
<List.ItemDragHandle />
|
|
49
50
|
<List.ItemTitle onClick={() => handleSelectRange(range)}>
|
|
50
|
-
{t('range
|
|
51
|
-
position: rangeToA1Notation(rangeFromIndex(
|
|
52
|
-
key: t(`range
|
|
53
|
-
value: t(`range
|
|
51
|
+
{t('range.title', {
|
|
52
|
+
position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),
|
|
53
|
+
key: t(`range-key.${range.key}.label`),
|
|
54
|
+
value: t(`range-value.${range.value}.label`),
|
|
54
55
|
})}
|
|
55
56
|
</List.ItemTitle>
|
|
56
57
|
<List.ItemDeleteButton onClick={() => handleDeleteRange(range)} />
|
|
@@ -8,27 +8,28 @@ import React, { useContext } from 'react';
|
|
|
8
8
|
|
|
9
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 { Operation, OperationHandlerSet } 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 } from '@dxos/react-ui/testing';
|
|
17
16
|
import { AttendableContainer } from '@dxos/react-ui-attention';
|
|
17
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
18
18
|
|
|
19
|
-
import { ComputeGraphContext, useComputeGraph } from '
|
|
20
|
-
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '
|
|
21
|
-
import { translations } from '
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import RangeList from '../RangeList';
|
|
19
|
+
import { ComputeGraphContext, useComputeGraph } from '#components';
|
|
20
|
+
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '#testing';
|
|
21
|
+
import { translations } from '#translations';
|
|
22
|
+
import { SheetOperation } from '#types';
|
|
23
|
+
import { Sheet } from '#types';
|
|
25
24
|
|
|
26
|
-
import
|
|
25
|
+
import RangeList from '../RangeList';
|
|
26
|
+
import { SheetArticle } from './SheetArticle';
|
|
27
27
|
|
|
28
28
|
const meta = {
|
|
29
|
-
title: 'plugins/plugin-sheet/containers/
|
|
30
|
-
component:
|
|
29
|
+
title: 'plugins/plugin-sheet/containers/SheetArticle',
|
|
30
|
+
component: SheetArticle,
|
|
31
31
|
decorators: [
|
|
32
|
+
withTheme(),
|
|
32
33
|
withLayout({ layout: 'fullscreen' }),
|
|
33
34
|
withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
|
|
34
35
|
withComputeGraphDecorator(),
|
|
@@ -53,12 +54,12 @@ const meta = {
|
|
|
53
54
|
layout: 'fullscreen',
|
|
54
55
|
translations,
|
|
55
56
|
},
|
|
56
|
-
} satisfies Meta<typeof
|
|
57
|
+
} satisfies Meta<typeof SheetArticle>;
|
|
57
58
|
|
|
58
59
|
export default meta;
|
|
59
60
|
|
|
60
61
|
export const Default = () => {
|
|
61
|
-
const space =
|
|
62
|
+
const [space] = useSpaces();
|
|
62
63
|
const graph = useComputeGraph(space);
|
|
63
64
|
const { registry } = useContext(ComputeGraphContext) ?? {};
|
|
64
65
|
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
@@ -68,7 +69,7 @@ export const Default = () => {
|
|
|
68
69
|
|
|
69
70
|
return (
|
|
70
71
|
<AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
|
|
71
|
-
<
|
|
72
|
+
<SheetArticle
|
|
72
73
|
role='article'
|
|
73
74
|
space={space}
|
|
74
75
|
subject={sheet}
|
|
@@ -81,7 +82,7 @@ export const Default = () => {
|
|
|
81
82
|
};
|
|
82
83
|
|
|
83
84
|
export const Spec = () => {
|
|
84
|
-
const space =
|
|
85
|
+
const [space] = useSpaces();
|
|
85
86
|
const graph = useComputeGraph(space);
|
|
86
87
|
const { registry } = useContext(ComputeGraphContext) ?? {};
|
|
87
88
|
const sheet = useTestSheet(space, graph, { cells: { A1: { value: 'Ready' } } });
|
|
@@ -91,8 +92,8 @@ export const Spec = () => {
|
|
|
91
92
|
|
|
92
93
|
return (
|
|
93
94
|
<AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
|
|
94
|
-
<div
|
|
95
|
-
<
|
|
95
|
+
<div className='w-full grid grid-cols-[1fr_20rem]'>
|
|
96
|
+
<SheetArticle
|
|
96
97
|
role='article'
|
|
97
98
|
space={space}
|
|
98
99
|
subject={sheet}
|
|
@@ -100,7 +101,7 @@ export const Spec = () => {
|
|
|
100
101
|
registry={registry}
|
|
101
102
|
ignoreAttention
|
|
102
103
|
/>
|
|
103
|
-
<div
|
|
104
|
+
<div data-testid='grid.range-list'>
|
|
104
105
|
<RangeList sheet={sheet} />
|
|
105
106
|
</div>
|
|
106
107
|
</div>
|