@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
|
@@ -3,21 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Atom, type Registry, RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useContext, useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
9
|
-
import { type CompleteCellRange } from '@dxos/compute';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
Menu,
|
|
13
|
-
type MenuRootProps,
|
|
14
|
-
createGapSeparator,
|
|
15
|
-
useMenuActions,
|
|
16
|
-
} from '@dxos/react-ui-menu';
|
|
9
|
+
import { type CompleteCellRange } from '@dxos/compute-hyperformula';
|
|
10
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
11
|
+
import { type ActionGraphProps, Menu, createGapSeparator, useMenuActions } from '@dxos/react-ui-menu';
|
|
17
12
|
|
|
18
13
|
import { type SheetModel } from '../../model';
|
|
19
14
|
import { useSheetContext } from '../SheetRoot';
|
|
20
|
-
|
|
21
15
|
import { createAlign, useAlignState } from './align';
|
|
22
16
|
import { createStyle, useStyleState } from './style';
|
|
23
17
|
import { type ToolbarStateAtom, useToolbarState } from './useToolbarState';
|
|
@@ -59,11 +53,10 @@ const createToolbarActions = ({
|
|
|
59
53
|
});
|
|
60
54
|
};
|
|
61
55
|
|
|
62
|
-
export type SheetToolbarProps = {
|
|
63
|
-
PropsWithChildren<{ id: string } & Partial<MenuRootProps>>;
|
|
56
|
+
export type SheetToolbarProps = {};
|
|
64
57
|
|
|
65
|
-
export const SheetToolbar =
|
|
66
|
-
const { model, cursorFallbackRange } = useSheetContext();
|
|
58
|
+
export const SheetToolbar = composable<HTMLDivElement, SheetToolbarProps>((props, forwardedRef) => {
|
|
59
|
+
const { attendableId, model, cursorFallbackRange } = useSheetContext();
|
|
67
60
|
const stateAtom = useToolbarState({});
|
|
68
61
|
const registry = useContext(RegistryContext);
|
|
69
62
|
useAlignState(stateAtom);
|
|
@@ -72,24 +65,26 @@ export const SheetToolbar = ({ id, ...props }: SheetToolbarProps) => {
|
|
|
72
65
|
const { graph } = useAppGraph();
|
|
73
66
|
const customActions = useMemo(() => {
|
|
74
67
|
return Atom.make((get) => {
|
|
75
|
-
const actions = get(graph.actions(
|
|
68
|
+
const actions = get(graph.actions(attendableId));
|
|
76
69
|
const nodes = actions.filter((action) => action.properties.disposition === 'toolbar');
|
|
77
70
|
return {
|
|
78
71
|
nodes,
|
|
79
72
|
edges: nodes.map((node) => ({ source: 'root', target: node.id, relation: 'child' })),
|
|
80
73
|
};
|
|
81
74
|
});
|
|
82
|
-
}, [graph,
|
|
75
|
+
}, [graph, attendableId]);
|
|
83
76
|
|
|
84
77
|
const actionsCreator = useMemo(
|
|
85
78
|
() => createToolbarActions({ model, stateAtom, registry, cursorFallbackRange, customActions }),
|
|
86
79
|
[model, stateAtom, registry, cursorFallbackRange, customActions],
|
|
87
80
|
);
|
|
88
|
-
const
|
|
81
|
+
const menuActions = useMenuActions(actionsCreator);
|
|
89
82
|
|
|
90
83
|
return (
|
|
91
|
-
<Menu.Root {...
|
|
92
|
-
<Menu.Toolbar />
|
|
84
|
+
<Menu.Root {...menuActions} attendableId={attendableId}>
|
|
85
|
+
<Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />
|
|
93
86
|
</Menu.Root>
|
|
94
87
|
);
|
|
95
|
-
};
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
SheetToolbar.displayName = 'SheetToolbar';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Registry, RegistryContext } from '@effect-atom/atom-react';
|
|
6
6
|
import { useContext, useEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type CompleteCellRange, inRange } from '@dxos/compute';
|
|
8
|
+
import { type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import {
|
|
11
11
|
type ActionGraphProps,
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
createMenuItemGroup,
|
|
15
15
|
} from '@dxos/react-ui-menu';
|
|
16
16
|
|
|
17
|
-
import { meta } from '
|
|
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,53 +5,53 @@
|
|
|
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
|
-
import { ghostHover } from '@dxos/ui-theme';
|
|
13
12
|
|
|
14
|
-
import { meta } from '
|
|
15
|
-
import { rangeFromIndex } from '
|
|
16
|
-
import { Sheet } from '
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
import { rangeFromIndex } from '#types';
|
|
15
|
+
import { Sheet } from '#types';
|
|
17
16
|
|
|
18
17
|
export type RangeListProps = {
|
|
19
18
|
sheet: Sheet.Sheet;
|
|
20
19
|
};
|
|
21
20
|
|
|
22
|
-
export const RangeList = ({ sheet }: RangeListProps) => {
|
|
21
|
+
export const RangeList = ({ sheet: sheetProp }: RangeListProps) => {
|
|
23
22
|
const { t } = useTranslation(meta.id);
|
|
23
|
+
const [sheet, updateSheet] = useObject(sheetProp);
|
|
24
24
|
// TODO(thure): Implement similar to comments, #8121
|
|
25
25
|
const handleSelectRange = (range: Sheet.Range) => {};
|
|
26
26
|
const handleDeleteRange = useCallback(
|
|
27
27
|
(range: Sheet.Range) => {
|
|
28
28
|
const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
updateSheet((sheet) => {
|
|
30
|
+
sheet.ranges.splice(index, 1);
|
|
31
31
|
});
|
|
32
32
|
},
|
|
33
|
-
[sheet],
|
|
33
|
+
[sheet, updateSheet],
|
|
34
34
|
);
|
|
35
35
|
return (
|
|
36
36
|
<>
|
|
37
37
|
<Input.Root>
|
|
38
|
-
<Input.Label>{t('range
|
|
38
|
+
<Input.Label>{t('range-list.heading')}</Input.Label>
|
|
39
39
|
</Input.Root>
|
|
40
40
|
{sheet.ranges.length < 1 ? (
|
|
41
41
|
<Message.Root>
|
|
42
|
-
<Message.Title>{t('no
|
|
42
|
+
<Message.Title>{t('no-ranges.message')}</Message.Title>
|
|
43
43
|
</Message.Root>
|
|
44
44
|
) : (
|
|
45
45
|
<List.Root<Sheet.Range> items={sheet.ranges} isItem={Schema.is(Sheet.Range)}>
|
|
46
46
|
{({ items: ranges }) =>
|
|
47
47
|
ranges.map((range, i) => (
|
|
48
|
-
<List.Item key={i} item={range}
|
|
48
|
+
<List.Item key={i} item={range}>
|
|
49
49
|
<List.ItemDragHandle />
|
|
50
50
|
<List.ItemTitle onClick={() => handleSelectRange(range)}>
|
|
51
|
-
{t('range
|
|
52
|
-
position: rangeToA1Notation(rangeFromIndex(
|
|
53
|
-
key: t(`range
|
|
54
|
-
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`),
|
|
55
55
|
})}
|
|
56
56
|
</List.ItemTitle>
|
|
57
57
|
<List.ItemDeleteButton onClick={() => handleDeleteRange(range)} />
|
|
@@ -8,25 +8,26 @@ 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 { OperationResolver } from '@dxos/operation';
|
|
13
13
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
14
|
-
import {
|
|
14
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
15
15
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
16
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
16
|
import { AttendableContainer } from '@dxos/react-ui-attention';
|
|
17
|
+
import { withLayout, 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
|
|
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';
|
|
24
24
|
|
|
25
|
-
import
|
|
25
|
+
import RangeList from '../RangeList';
|
|
26
|
+
import { SheetArticle } from './SheetArticle';
|
|
26
27
|
|
|
27
28
|
const meta = {
|
|
28
|
-
title: 'plugins/plugin-sheet/containers/
|
|
29
|
-
component:
|
|
29
|
+
title: 'plugins/plugin-sheet/containers/SheetArticle',
|
|
30
|
+
component: SheetArticle,
|
|
30
31
|
decorators: [
|
|
31
32
|
withTheme(),
|
|
32
33
|
withLayout({ layout: 'fullscreen' }),
|
|
@@ -35,16 +36,17 @@ const meta = {
|
|
|
35
36
|
withPluginManager({
|
|
36
37
|
plugins: [...corePlugins()],
|
|
37
38
|
capabilities: [
|
|
38
|
-
Capability.contributes(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
Capability.contributes(
|
|
40
|
+
Capabilities.OperationHandler,
|
|
41
|
+
OperationHandlerSet.make(
|
|
42
|
+
Operation.withHandler(SheetOperation.DropAxis, ({ model, axis, axisIndex }) =>
|
|
42
43
|
Effect.sync(() => {
|
|
43
44
|
model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
44
45
|
return { axis, axisIndex, index: 0, axisMeta: null, values: [] };
|
|
45
46
|
}),
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
),
|
|
48
|
+
),
|
|
49
|
+
),
|
|
48
50
|
],
|
|
49
51
|
}),
|
|
50
52
|
],
|
|
@@ -52,12 +54,12 @@ const meta = {
|
|
|
52
54
|
layout: 'fullscreen',
|
|
53
55
|
translations,
|
|
54
56
|
},
|
|
55
|
-
} satisfies Meta<typeof
|
|
57
|
+
} satisfies Meta<typeof SheetArticle>;
|
|
56
58
|
|
|
57
59
|
export default meta;
|
|
58
60
|
|
|
59
61
|
export const Default = () => {
|
|
60
|
-
const space =
|
|
62
|
+
const [space] = useSpaces();
|
|
61
63
|
const graph = useComputeGraph(space);
|
|
62
64
|
const { registry } = useContext(ComputeGraphContext) ?? {};
|
|
63
65
|
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
@@ -66,14 +68,21 @@ export const Default = () => {
|
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
return (
|
|
69
|
-
<AttendableContainer id={Obj.
|
|
70
|
-
<
|
|
71
|
+
<AttendableContainer id={Obj.getURI(sheet)} classNames='contents'>
|
|
72
|
+
<SheetArticle
|
|
73
|
+
role='article'
|
|
74
|
+
space={space}
|
|
75
|
+
subject={sheet}
|
|
76
|
+
attendableId='test'
|
|
77
|
+
registry={registry}
|
|
78
|
+
ignoreAttention
|
|
79
|
+
/>
|
|
71
80
|
</AttendableContainer>
|
|
72
81
|
);
|
|
73
82
|
};
|
|
74
83
|
|
|
75
84
|
export const Spec = () => {
|
|
76
|
-
const space =
|
|
85
|
+
const [space] = useSpaces();
|
|
77
86
|
const graph = useComputeGraph(space);
|
|
78
87
|
const { registry } = useContext(ComputeGraphContext) ?? {};
|
|
79
88
|
const sheet = useTestSheet(space, graph, { cells: { A1: { value: 'Ready' } } });
|
|
@@ -82,10 +91,17 @@ export const Spec = () => {
|
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
return (
|
|
85
|
-
<AttendableContainer id={Obj.
|
|
86
|
-
<div
|
|
87
|
-
<
|
|
88
|
-
|
|
94
|
+
<AttendableContainer id={Obj.getURI(sheet)} classNames='contents'>
|
|
95
|
+
<div className='w-full grid grid-cols-[1fr_20rem]'>
|
|
96
|
+
<SheetArticle
|
|
97
|
+
role='article'
|
|
98
|
+
space={space}
|
|
99
|
+
subject={sheet}
|
|
100
|
+
attendableId='test'
|
|
101
|
+
registry={registry}
|
|
102
|
+
ignoreAttention
|
|
103
|
+
/>
|
|
104
|
+
<div data-testid='grid.range-list'>
|
|
89
105
|
<RangeList sheet={sheet} />
|
|
90
106
|
</div>
|
|
91
107
|
</div>
|
|
@@ -4,16 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
8
|
-
import { type ComputeGraphRegistry } from '@dxos/compute';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
|
|
10
9
|
import { type Space } from '@dxos/react-client/echo';
|
|
11
10
|
import { Panel } from '@dxos/react-ui';
|
|
12
11
|
|
|
13
|
-
import { ComputeGraphContextProvider, Sheet, useComputeGraph } from '
|
|
14
|
-
import { type Sheet as SheetType } from '
|
|
12
|
+
import { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';
|
|
13
|
+
import { type Sheet as SheetType } from '#types';
|
|
15
14
|
|
|
16
|
-
export type
|
|
15
|
+
export type SheetArticleProps = AppSurface.ObjectArticleProps<
|
|
17
16
|
SheetType.Sheet,
|
|
18
17
|
{
|
|
19
18
|
space: Space;
|
|
@@ -22,28 +21,29 @@ export type SheetContainerProps = SurfaceComponentProps<
|
|
|
22
21
|
}
|
|
23
22
|
>;
|
|
24
23
|
|
|
25
|
-
export const
|
|
24
|
+
export const SheetArticle = ({ registry, ...props }: SheetArticleProps) => (
|
|
26
25
|
<ComputeGraphContextProvider registry={registry}>
|
|
27
|
-
<
|
|
26
|
+
<SheetArticleInner {...props} />
|
|
28
27
|
</ComputeGraphContextProvider>
|
|
29
28
|
);
|
|
30
29
|
|
|
31
|
-
const
|
|
30
|
+
const SheetArticleInner = ({
|
|
32
31
|
role,
|
|
33
32
|
subject: sheet,
|
|
33
|
+
attendableId,
|
|
34
34
|
space,
|
|
35
35
|
ignoreAttention,
|
|
36
|
-
}: Omit<
|
|
36
|
+
}: Omit<SheetArticleProps, 'registry'>) => {
|
|
37
37
|
const graph = useComputeGraph(space);
|
|
38
38
|
if (!graph) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
|
-
<Sheet.Root graph={graph} sheet={sheet} ignoreAttention={ignoreAttention}>
|
|
43
|
+
<Sheet.Root graph={graph} sheet={sheet} attendableId={attendableId!} ignoreAttention={ignoreAttention}>
|
|
44
44
|
<Panel.Root classNames={role === 'section' && 'aspect-aquare'}>
|
|
45
45
|
<Panel.Toolbar asChild>
|
|
46
|
-
<Sheet.Toolbar
|
|
46
|
+
<Sheet.Toolbar />
|
|
47
47
|
</Panel.Toolbar>
|
|
48
48
|
<Panel.Content asChild>
|
|
49
49
|
<Sheet.Content />
|
package/src/containers/index.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
7
|
export const RangeList: ComponentType<any> = lazy(() => import('./RangeList'));
|
|
8
|
-
export const
|
|
8
|
+
export const SheetArticle: ComponentType<any> = lazy(() => import('./SheetArticle'));
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React, { useEffect, useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { ProcessManagerPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { PublicKey } from '@dxos/keys';
|
|
11
|
-
import {
|
|
11
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { useThemeContext } from '@dxos/react-ui';
|
|
14
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
15
14
|
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
15
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
16
16
|
import {
|
|
17
17
|
createBasicExtensions,
|
|
18
18
|
createMarkdownExtensions,
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
} from '@dxos/ui-editor';
|
|
23
23
|
import { isNonNullable } from '@dxos/util';
|
|
24
24
|
|
|
25
|
-
import { Sheet, useComputeGraph } from '
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { Sheet as SheetType } from '../types';
|
|
25
|
+
import { Sheet, useComputeGraph } from '#components';
|
|
26
|
+
import { useTestSheet, withComputeGraphDecorator } from '#testing';
|
|
27
|
+
import { Sheet as SheetType } from '#types';
|
|
29
28
|
|
|
29
|
+
import { useSheetModel } from '../model';
|
|
30
30
|
import { compute, computeGraphFacet } from './compute';
|
|
31
31
|
|
|
32
32
|
const str = (...lines: string[]) => lines.join('\n');
|
|
@@ -45,7 +45,7 @@ const SHEET_NAME = 'Test Sheet';
|
|
|
45
45
|
const DefaultStory = ({ text }: EditorProps) => {
|
|
46
46
|
const id = useMemo(() => PublicKey.random(), []);
|
|
47
47
|
const { themeMode } = useThemeContext();
|
|
48
|
-
const space =
|
|
48
|
+
const [space] = useSpaces();
|
|
49
49
|
const computeGraph = useComputeGraph(space);
|
|
50
50
|
const { parentRef, focusAttributes } = useTextEditor(
|
|
51
51
|
() => ({
|
|
@@ -67,7 +67,7 @@ const DefaultStory = ({ text }: EditorProps) => {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const Grid = () => {
|
|
70
|
-
const space =
|
|
70
|
+
const [space] = useSpaces();
|
|
71
71
|
const graph = useComputeGraph(space);
|
|
72
72
|
const sheet = useTestSheet(space, graph, { name: SHEET_NAME });
|
|
73
73
|
const model = useSheetModel(graph, sheet);
|
|
@@ -88,7 +88,7 @@ const Grid = () => {
|
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
90
|
<div className='flex w-[40rem] overflow-hidden'>
|
|
91
|
-
<Sheet.Root graph={graph} sheet={sheet}>
|
|
91
|
+
<Sheet.Root graph={graph} sheet={sheet} attendableId='test'>
|
|
92
92
|
<Sheet.Content />
|
|
93
93
|
</Sheet.Root>
|
|
94
94
|
</div>
|
|
@@ -115,7 +115,7 @@ const meta = {
|
|
|
115
115
|
createSpace: true,
|
|
116
116
|
}),
|
|
117
117
|
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
118
|
-
withPluginManager({ plugins: [
|
|
118
|
+
withPluginManager({ plugins: [ProcessManagerPlugin()] }),
|
|
119
119
|
withComputeGraphDecorator(),
|
|
120
120
|
],
|
|
121
121
|
parameters: {
|
|
@@ -8,7 +8,7 @@ import { testTree } from '@lezer/generator/test';
|
|
|
8
8
|
import { spreadsheet } from 'codemirror-lang-spreadsheet';
|
|
9
9
|
import { describe, expect, test } from 'vitest';
|
|
10
10
|
|
|
11
|
-
import { defaultFunctions } from '@dxos/compute';
|
|
11
|
+
import { defaultFunctions } from '@dxos/compute-hyperformula';
|
|
12
12
|
|
|
13
13
|
import { sheetExtension } from './sheet-extension';
|
|
14
14
|
|
|
@@ -18,8 +18,8 @@ import { type SyntaxNode } from '@lezer/common';
|
|
|
18
18
|
import { tags } from '@lezer/highlight';
|
|
19
19
|
import { spreadsheet } from 'codemirror-lang-spreadsheet';
|
|
20
20
|
|
|
21
|
-
import { type FunctionDefinition } from '@dxos/compute';
|
|
22
|
-
import { RANGE_NOTATION } from '@dxos/compute';
|
|
21
|
+
import { type FunctionDefinition } from '@dxos/compute-hyperformula';
|
|
22
|
+
import { RANGE_NOTATION } from '@dxos/compute-hyperformula';
|
|
23
23
|
import { singleValueFacet } from '@dxos/ui-editor';
|
|
24
24
|
import { mx } from '@dxos/ui-theme';
|
|
25
25
|
|
|
@@ -170,7 +170,7 @@ export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions)
|
|
|
170
170
|
tooltipClass: () =>
|
|
171
171
|
mx(
|
|
172
172
|
'!-left-[1px] !top-[33px] !-m-0 border border-h-0! [&>ul]:!min-w-[198px]',
|
|
173
|
-
'[&>ul>li[aria-selected]]:!bg-accent-
|
|
173
|
+
'[&>ul>li[aria-selected]]:!bg-accent-bg',
|
|
174
174
|
'border-separator',
|
|
175
175
|
),
|
|
176
176
|
}),
|