@dxos/plugin-sheet 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8
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/neutral/RangeList-HYB5S6KQ.mjs +46 -0
- package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +7 -0
- package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs +33 -0
- package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +7 -0
- package/dist/lib/neutral/SheetPlugin.mjs +63 -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/neutral/anchor-sort-2POWTKTD.mjs +22 -0
- package/dist/lib/neutral/anchor-sort-2POWTKTD.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs +67 -0
- package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +29 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BGR7FVNF.mjs +8 -0
- package/dist/lib/neutral/chunk-BGR7FVNF.mjs.map +7 -0
- package/dist/lib/{browser/chunk-VTTKAHAY.mjs → neutral/chunk-ERHMBRSU.mjs} +16 -16
- package/dist/lib/neutral/chunk-ERHMBRSU.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-HEN74ZWI.mjs +83 -0
- package/dist/lib/neutral/chunk-HEN74ZWI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-KUWATEHB.mjs +374 -0
- package/dist/lib/neutral/chunk-KUWATEHB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-S2UNH6VD.mjs +10 -0
- package/dist/lib/neutral/chunk-S2UNH6VD.mjs.map +7 -0
- package/dist/lib/neutral/comment-config-WGXXX5FG.mjs +22 -0
- package/dist/lib/neutral/comment-config-WGXXX5FG.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1552 -0
- 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-TDQQ24IB.mjs +31 -0
- package/dist/lib/neutral/create-object-TDQQ24IB.mjs.map +7 -0
- package/dist/lib/neutral/drop-axis-WSWFOLQN.mjs +23 -0
- package/dist/lib/neutral/drop-axis-WSWFOLQN.mjs.map +7 -0
- package/dist/lib/{node-esm/types → neutral}/index.mjs +22 -13
- package/dist/lib/neutral/insert-axis-6UQJTIWC.mjs +16 -0
- package/dist/lib/neutral/insert-axis-6UQJTIWC.mjs.map +7 -0
- package/dist/lib/neutral/markdown-extension-HTJDICGT.mjs +28 -0
- package/dist/lib/neutral/markdown-extension-HTJDICGT.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/navigation-resolver-FXEZYO7G.mjs +14 -0
- package/dist/lib/neutral/navigation-resolver-FXEZYO7G.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs +13 -0
- package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-4H3PC4WG.mjs +44 -0
- package/dist/lib/neutral/react-surface-4H3PC4WG.mjs.map +7 -0
- package/dist/lib/neutral/restore-axis-AMMVTPS3.mjs +16 -0
- package/dist/lib/neutral/restore-axis-AMMVTPS3.mjs.map +7 -0
- package/dist/lib/neutral/scroll-to-anchor-FK2CXCQR.mjs +33 -0
- package/dist/lib/neutral/scroll-to-anchor-FK2CXCQR.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/{browser → neutral}/types/index.mjs +8 -12
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs +31 -0
- package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs.map +7 -0
- package/dist/types/src/SheetPlugin.d.ts +3 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/SheetPlugin.node.d.ts +4 -0
- package/dist/types/src/SheetPlugin.node.d.ts.map +1 -0
- package/dist/types/src/SheetPlugin.test.d.ts +2 -0
- package/dist/types/src/SheetPlugin.test.d.ts.map +1 -0
- package/dist/types/src/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 +4 -4
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/comment-config.d.ts +6 -0
- package/dist/types/src/capabilities/comment-config.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry.d.ts +9 -2
- package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +19 -11
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown-extension.d.ts +5 -0
- package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/navigation-resolver.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 +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +6 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +1 -1
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts +9 -4
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts +17 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/index.d.ts +2 -0
- package/dist/types/src/components/Sheet/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts +16 -0
- package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts +6 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +93 -0
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/index.d.ts +2 -0
- package/dist/types/src/components/SheetContent/index.d.ts.map +1 -0
- package/dist/types/src/components/{GridSheet → SheetContent}/util.d.ts +1 -1
- package/dist/types/src/components/SheetContent/util.d.ts.map +1 -0
- package/dist/types/src/components/{SheetContext/SheetContext.d.ts → SheetRoot/SheetRoot.d.ts} +9 -7
- package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -0
- package/dist/types/src/components/SheetRoot/index.d.ts +2 -0
- package/dist/types/src/components/SheetRoot/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +6 -0
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -0
- package/dist/types/src/components/SheetStatusbar/index.d.ts +2 -0
- package/dist/types/src/components/SheetStatusbar/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +5 -6
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +92 -4
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/align.d.ts +14 -21
- package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/style.d.ts +14 -20
- package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +14 -1
- package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/RangeList/RangeList.d.ts +7 -0
- package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -0
- package/dist/types/src/containers/RangeList/index.d.ts +2 -0
- package/dist/types/src/containers/RangeList/index.d.ts.map +1 -0
- package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts +12 -0
- package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts.map +1 -0
- package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts +92 -0
- package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SheetArticle/index.d.ts +2 -0
- package/dist/types/src/containers/SheetArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/compute.d.ts +2 -2
- package/dist/types/src/extensions/compute.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.stories.d.ts +10 -13
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/editor/index.d.ts +1 -1
- package/dist/types/src/extensions/editor/index.d.ts.map +1 -1
- package/dist/types/src/extensions/editor/{extension.d.ts → sheet-extension.d.ts} +2 -2
- package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -0
- package/dist/types/src/extensions/editor/sheet-extension.test.d.ts +2 -0
- package/dist/types/src/extensions/editor/sheet-extension.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts +1 -3
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +31 -7
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/model/testing.d.ts +2 -2
- package/dist/types/src/model/testing.d.ts.map +1 -1
- package/dist/types/src/model/useSheetModel.d.ts +3 -3
- 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/paths.d.ts +3 -0
- package/dist/types/src/paths.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 +3 -3
- package/dist/types/src/serializer.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +2 -2
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +28 -4
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +74 -38
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Sheet.d.ts +75 -0
- package/dist/types/src/types/Sheet.d.ts.map +1 -0
- package/dist/types/src/types/SheetCapabilities.d.ts +16 -0
- package/dist/types/src/types/SheetCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/SheetOperation.d.ts +45 -0
- package/dist/types/src/types/SheetOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/sheet-range-types.d.ts +2 -2
- package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3 -78
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/types/util.d.ts +11 -11
- package/dist/types/src/types/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +132 -98
- package/src/SheetPlugin.node.ts +21 -0
- package/src/SheetPlugin.test.ts +30 -0
- package/src/SheetPlugin.tsx +55 -68
- package/src/SheetPlugin.workerd.ts +18 -0
- package/src/capabilities/anchor-sort.ts +20 -15
- package/src/capabilities/app-graph-builder.ts +63 -0
- package/src/capabilities/comment-config.ts +28 -0
- package/src/capabilities/compute-graph-registry.ts +34 -20
- package/src/capabilities/create-object.ts +33 -0
- package/src/capabilities/index.ts +22 -8
- package/src/capabilities/markdown-extension.ts +31 -0
- package/src/capabilities/navigation-resolver.ts +16 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +38 -29
- 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 +35 -27
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/SheetContent/SheetCellEditor.stories.tsx +95 -0
- package/src/components/SheetContent/SheetContent.stories.tsx +60 -0
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +88 -58
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +17 -10
- package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +55 -42
- package/src/components/{GridSheet → SheetRoot}/index.ts +1 -1
- package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx} +20 -7
- package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +19 -14
- package/src/components/SheetToolbar/SheetToolbar.tsx +61 -56
- package/src/components/SheetToolbar/align.ts +50 -25
- package/src/components/SheetToolbar/style.ts +52 -22
- package/src/components/SheetToolbar/useToolbarState.ts +22 -5
- package/src/components/index.ts +1 -7
- package/src/containers/RangeList/RangeList.tsx +65 -0
- package/src/containers/RangeList/index.ts +5 -0
- package/src/containers/SheetArticle/SheetArticle.stories.tsx +110 -0
- package/src/containers/SheetArticle/SheetArticle.tsx +57 -0
- package/src/containers/SheetArticle/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/extensions/compute.stories.tsx +49 -36
- package/src/extensions/compute.ts +3 -4
- package/src/extensions/editor/index.ts +1 -1
- package/src/extensions/editor/{extension.test.ts → sheet-extension.test.ts} +2 -2
- package/src/extensions/editor/{extension.ts → sheet-extension.ts} +18 -15
- package/src/index.ts +3 -2
- package/src/integrations/thread-ranges.ts +20 -62
- package/src/meta.ts +22 -8
- package/src/model/sheet-model.test.ts +34 -6
- package/src/model/sheet-model.ts +84 -52
- package/src/model/testing.ts +5 -5
- package/src/model/useSheetModel.ts +4 -3
- 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/paths.ts +11 -0
- package/src/playwright/playwright.config.ts +1 -1
- package/src/playwright/sheet.spec.ts +4 -3
- package/src/plugin.ts +11 -0
- package/src/sanity.test.ts +9 -3
- package/src/serializer.ts +4 -12
- package/src/testing/data.ts +2 -2
- package/src/testing/testing.tsx +13 -7
- package/src/translations.ts +43 -36
- package/src/types/Sheet.ts +97 -0
- package/src/types/SheetCapabilities.ts +26 -0
- package/src/types/SheetOperation.ts +84 -0
- package/src/types/index.ts +4 -1
- package/src/types/sheet-range-types.ts +5 -5
- package/src/types/types.ts +6 -52
- package/src/types/util.ts +15 -42
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/SheetContainer-JZNFXBW3.mjs +0 -351
- package/dist/lib/browser/SheetContainer-JZNFXBW3.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-VRX3YZKT.mjs +0 -24
- package/dist/lib/browser/anchor-sort-VRX3YZKT.mjs.map +0 -7
- package/dist/lib/browser/chunk-6AKBCBL4.mjs +0 -18
- package/dist/lib/browser/chunk-6AKBCBL4.mjs.map +0 -7
- package/dist/lib/browser/chunk-BVTHIA5U.mjs +0 -847
- package/dist/lib/browser/chunk-BVTHIA5U.mjs.map +0 -7
- package/dist/lib/browser/chunk-ELAASQ5H.mjs +0 -899
- package/dist/lib/browser/chunk-ELAASQ5H.mjs.map +0 -7
- package/dist/lib/browser/chunk-KJWZUQVA.mjs +0 -15
- package/dist/lib/browser/chunk-KJWZUQVA.mjs.map +0 -7
- package/dist/lib/browser/chunk-VTTKAHAY.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-6YJHXORG.mjs +0 -30
- package/dist/lib/browser/compute-graph-registry-6YJHXORG.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -155
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-SSLPTP5O.mjs +0 -56
- package/dist/lib/browser/intent-resolver-SSLPTP5O.mjs.map +0 -7
- package/dist/lib/browser/markdown-3VPZYNGU.mjs +0 -26
- package/dist/lib/browser/markdown-3VPZYNGU.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-Y7KTPJW2.mjs +0 -53
- package/dist/lib/browser/react-surface-Y7KTPJW2.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-GOIBAE2P.mjs +0 -352
- package/dist/lib/node-esm/SheetContainer-GOIBAE2P.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-YM2UBIKL.mjs +0 -25
- package/dist/lib/node-esm/anchor-sort-YM2UBIKL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3K5VNYOF.mjs +0 -20
- package/dist/lib/node-esm/chunk-3K5VNYOF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4L5CIB7E.mjs +0 -900
- package/dist/lib/node-esm/chunk-4L5CIB7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-56HYMW55.mjs +0 -848
- package/dist/lib/node-esm/chunk-56HYMW55.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs +0 -16
- package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FXRXBHWM.mjs +0 -236
- package/dist/lib/node-esm/chunk-FXRXBHWM.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-ET5KJNLV.mjs +0 -31
- package/dist/lib/node-esm/compute-graph-registry-ET5KJNLV.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -156
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-5P6DBGK2.mjs +0 -57
- package/dist/lib/node-esm/intent-resolver-5P6DBGK2.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-SFDGQWYE.mjs +0 -27
- package/dist/lib/node-esm/markdown-SFDGQWYE.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-6Z5FAOBH.mjs +0 -54
- package/dist/lib/node-esm/react-surface-6Z5FAOBH.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown.d.ts +0 -6
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +0 -3
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +0 -1
- package/dist/types/src/components/FunctionEditor/index.d.ts +0 -2
- package/dist/types/src/components/FunctionEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts +0 -3
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +0 -7
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts +0 -25
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/index.d.ts +0 -2
- package/dist/types/src/components/GridSheet/index.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/util.d.ts.map +0 -1
- package/dist/types/src/components/RangeList/RangeList.d.ts +0 -7
- package/dist/types/src/components/RangeList/RangeList.d.ts.map +0 -1
- package/dist/types/src/components/RangeList/index.d.ts +0 -2
- package/dist/types/src/components/RangeList/index.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +0 -11
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +0 -8
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer/index.d.ts +0 -3
- package/dist/types/src/components/SheetContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +0 -1
- package/dist/types/src/components/SheetContext/index.d.ts +0 -2
- package/dist/types/src/components/SheetContext/index.d.ts.map +0 -1
- package/dist/types/src/extensions/editor/extension.d.ts.map +0 -1
- package/dist/types/src/extensions/editor/extension.test.d.ts +0 -2
- package/dist/types/src/extensions/editor/extension.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -37
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -38
- package/src/capabilities/markdown.ts +0 -23
- package/src/components/GridSheet/GridSheet.stories.tsx +0 -54
- package/src/components/GridSheet/SheetCellEditor.stories.tsx +0 -93
- package/src/components/RangeList/RangeList.tsx +0 -60
- package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -90
- package/src/components/SheetContainer/SheetContainer.tsx +0 -36
- package/src/components/SheetContainer/index.ts +0 -7
- package/src/components/SheetContext/index.ts +0 -5
- package/src/types/schema.ts +0 -61
- /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
|
@@ -2,27 +2,41 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation, ServiceResolver } from '@dxos/compute';
|
|
9
|
+
import { type SpaceId } from '@dxos/keys';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
return protocol === 'https:' || protocol === 'wss:';
|
|
12
|
-
};
|
|
11
|
+
import { SheetCapabilities } from '#types';
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Builds the per-space compute graph registry by adapting the shared
|
|
15
|
+
* {@link Capabilities.ProcessManagerRuntime} into a
|
|
16
|
+
* {@link FunctionsRuntimeProvider} that resolves {@link Operation.Service}
|
|
17
|
+
* from the space's service layer.
|
|
18
|
+
*/
|
|
19
|
+
export default Capability.makeModule(
|
|
20
|
+
Effect.fnUntraced(function* () {
|
|
21
|
+
const processManagerRuntime = yield* Capability.get(Capabilities.ProcessManagerRuntime);
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
// Async import removes direct dependency on hyperformula.
|
|
24
|
+
const { defaultPlugins, ComputeGraphRegistry } = yield* Effect.tryPromise(
|
|
25
|
+
() => import('@dxos/compute-hyperformula'),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const computeGraphRegistry = new ComputeGraphRegistry({
|
|
29
|
+
plugins: defaultPlugins,
|
|
30
|
+
computeRuntime: {
|
|
31
|
+
getRuntime: (spaceId: SpaceId) => ({
|
|
32
|
+
runPromise: <A, E>(effect: Effect.Effect<A, E, Operation.Service>) =>
|
|
33
|
+
processManagerRuntime.runPromise(
|
|
34
|
+
effect.pipe(Effect.provide(ServiceResolver.provide({ space: spaceId }, Operation.Service))),
|
|
35
|
+
),
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return Capability.contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
12
|
+
|
|
13
|
+
import { Sheet } from '#types';
|
|
14
|
+
|
|
15
|
+
import { getSheetsPath } from '../paths';
|
|
16
|
+
|
|
17
|
+
export default Capability.makeModule(
|
|
18
|
+
Effect.fnUntraced(function* () {
|
|
19
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
20
|
+
id: Type.getTypename(Sheet.Sheet),
|
|
21
|
+
createObject: (props, options) =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const object = Sheet.make(props);
|
|
24
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
25
|
+
object,
|
|
26
|
+
target: options.target,
|
|
27
|
+
hidden: true,
|
|
28
|
+
targetNodeId: options.targetNodeId ?? getSheetsPath(options.db.spaceId),
|
|
29
|
+
});
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
@@ -2,12 +2,26 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
7
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
8
|
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
+
export const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));
|
|
11
|
+
export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
|
|
12
|
+
// The contributed capability type references Operation types from @dxos/compute, so the lazy
|
|
13
|
+
// wrapper needs an explicit annotation to keep the inferred type portable (TS2883).
|
|
14
|
+
export const CommentConfig: Capability.LazyCapability<
|
|
15
|
+
void,
|
|
16
|
+
Capability.Capability<typeof AppCapabilities.CommentConfig>
|
|
17
|
+
> = Capability.lazy('CommentConfig', () => import('./comment-config'));
|
|
18
|
+
export const ComputeGraphRegistry = Capability.lazy('ComputeGraphRegistry', () => import('./compute-graph-registry'));
|
|
19
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
20
|
+
export const Markdown = Capability.lazy('MarkdownExtension', () => import('./markdown-extension'));
|
|
21
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
22
|
+
'OperationHandler',
|
|
23
|
+
() => import('./operation-handler'),
|
|
24
|
+
);
|
|
25
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
26
|
+
export const SheetState = Capability.lazy('SheetState', () => import('./state'));
|
|
27
|
+
export const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { getSpace } from '@dxos/client/echo';
|
|
9
|
+
import { MarkdownCapabilities } from '@dxos/plugin-markdown/types';
|
|
10
|
+
|
|
11
|
+
import { SheetCapabilities } from '#types';
|
|
12
|
+
|
|
13
|
+
import { computeGraphFacet } from '../extensions';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(
|
|
16
|
+
Effect.fnUntraced(function* () {
|
|
17
|
+
// Get context for lazy capability access in callbacks.
|
|
18
|
+
const capabilities = yield* Capability.Service;
|
|
19
|
+
|
|
20
|
+
return Capability.contributes(MarkdownCapabilities.ExtensionProvider, [
|
|
21
|
+
({ document: doc }) => {
|
|
22
|
+
const computeGraphRegistry = capabilities.get(SheetCapabilities.ComputeGraphRegistry);
|
|
23
|
+
const space = getSpace(doc);
|
|
24
|
+
if (space) {
|
|
25
|
+
const computeGraph = computeGraphRegistry.getOrCreateGraph(space);
|
|
26
|
+
return computeGraphFacet.of(computeGraph);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, createTypeSectionPathResolver } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { Sheet } from '#types';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(AppCapabilities.NavigationPathResolver, createTypeSectionPathResolver(Sheet.Sheet));
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { SheetOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, SheetOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -2,39 +2,48 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities,
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useCapability } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
11
|
import { Obj } from '@dxos/echo';
|
|
9
12
|
import { getSpace } from '@dxos/react-client/echo';
|
|
10
13
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { SheetType } from '../types';
|
|
14
|
+
import { RangeList, SheetArticle } from '#containers';
|
|
15
|
+
import { Sheet, SheetCapabilities } from '#types';
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
export default Capability.makeModule(() =>
|
|
18
|
+
Effect.succeed(
|
|
19
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
20
|
+
Surface.create({
|
|
21
|
+
id: 'sheet',
|
|
22
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
23
|
+
role: ['article', 'section'],
|
|
24
|
+
filter: (data): data is { attendableId: string; subject: Sheet.Sheet } =>
|
|
25
|
+
typeof data.attendableId === 'string' &&
|
|
26
|
+
Obj.instanceOf(Sheet.Sheet, data.subject) &&
|
|
27
|
+
!!Obj.getDatabase(data.subject),
|
|
28
|
+
component: ({ data, role }) => {
|
|
29
|
+
const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
16
30
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
role: 'object-settings',
|
|
37
|
-
filter: (data): data is { subject: SheetType } => Obj.instanceOf(SheetType, data.subject),
|
|
38
|
-
component: ({ data }) => <RangeList sheet={data.subject} />,
|
|
39
|
-
}),
|
|
40
|
-
]);
|
|
31
|
+
return (
|
|
32
|
+
<SheetArticle
|
|
33
|
+
role={role}
|
|
34
|
+
subject={data.subject}
|
|
35
|
+
attendableId={data.attendableId}
|
|
36
|
+
space={getSpace(data.subject)!}
|
|
37
|
+
registry={computeGraphRegistry}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
Surface.create({
|
|
43
|
+
id: 'objectProperties',
|
|
44
|
+
filter: AppSurface.object(AppSurface.ObjectProperties, Sheet.Sheet),
|
|
45
|
+
component: ({ data }) => <RangeList sheet={data.subject} />,
|
|
46
|
+
}),
|
|
47
|
+
]),
|
|
48
|
+
),
|
|
49
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { SheetCapabilities } from '#types';
|
|
10
|
+
|
|
11
|
+
const createGridRegistry = (): SheetCapabilities.GridRegistry => {
|
|
12
|
+
const grids = new Map<string, SheetCapabilities.GridEntry>();
|
|
13
|
+
return {
|
|
14
|
+
register: (attendableId, grid, setActiveRefs) => {
|
|
15
|
+
grids.set(attendableId, { grid, setActiveRefs });
|
|
16
|
+
},
|
|
17
|
+
unregister: (attendableId) => {
|
|
18
|
+
grids.delete(attendableId);
|
|
19
|
+
},
|
|
20
|
+
get: (attendableId) => grids.get(attendableId),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Capability.makeModule(
|
|
25
|
+
Effect.fnUntraced(function* () {
|
|
26
|
+
const gridInstances = createGridRegistry();
|
|
27
|
+
return Capability.contributes(SheetCapabilities.GridInstances, gridInstances);
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability, UndoMapping } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { SheetOperation } from '#types';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule(() =>
|
|
13
|
+
Effect.succeed(
|
|
14
|
+
Capability.contributes(Capabilities.UndoMapping, [
|
|
15
|
+
UndoMapping.make({
|
|
16
|
+
operation: SheetOperation.DropAxis,
|
|
17
|
+
inverse: SheetOperation.RestoreAxis,
|
|
18
|
+
deriveContext: (input, output) => ({
|
|
19
|
+
model: input.model,
|
|
20
|
+
axis: output.axis,
|
|
21
|
+
axisIndex: output.axisIndex,
|
|
22
|
+
index: output.index,
|
|
23
|
+
axisMeta: output.axisMeta,
|
|
24
|
+
values: output.values,
|
|
25
|
+
}),
|
|
26
|
+
message: ['axis-dropped.label', { ns: meta.id }],
|
|
27
|
+
}),
|
|
28
|
+
]),
|
|
29
|
+
),
|
|
30
|
+
);
|
|
@@ -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';
|
|
@@ -2,38 +2,36 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useRef, useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
|
|
11
10
|
import { Filter, Obj } from '@dxos/echo';
|
|
12
|
-
import {
|
|
13
|
-
import { useSpace } from '@dxos/react-client/echo';
|
|
11
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
14
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
13
|
import { Button, Input, Toolbar } from '@dxos/react-ui';
|
|
16
|
-
import {
|
|
17
|
-
import { withTheme } from '@dxos/
|
|
14
|
+
import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
15
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
18
16
|
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { SheetType, createSheet } from '../../types';
|
|
17
|
+
import { withComputeGraphDecorator } from '#testing';
|
|
18
|
+
import { Sheet } from '#types';
|
|
22
19
|
|
|
20
|
+
import { useSheetModel } from '../../model';
|
|
23
21
|
import { useComputeGraph } from './ComputeGraphContextProvider';
|
|
24
22
|
|
|
25
23
|
const FUNCTION_NAME = 'TEST';
|
|
26
24
|
|
|
27
|
-
const
|
|
28
|
-
const space =
|
|
25
|
+
const DefaultStory = () => {
|
|
26
|
+
const [space] = useSpaces();
|
|
29
27
|
const graph = useComputeGraph(space);
|
|
30
|
-
const [sheet, setSheet] = useState<
|
|
28
|
+
const [sheet, setSheet] = useState<Sheet.Sheet>();
|
|
31
29
|
const [text, setText] = useState(`${FUNCTION_NAME}(100)`);
|
|
32
30
|
const [result, setResult] = useState<any>();
|
|
33
31
|
const model = useSheetModel(graph, sheet);
|
|
34
32
|
useEffect(() => {
|
|
35
33
|
if (space) {
|
|
36
|
-
const sheet = space.db.add(
|
|
34
|
+
const sheet = space.db.add(Sheet.make());
|
|
37
35
|
setSheet(sheet);
|
|
38
36
|
}
|
|
39
37
|
}, [space]);
|
|
@@ -46,14 +44,20 @@ const Story = () => {
|
|
|
46
44
|
setResult({ functions: { standard: f1.length, echo: f2.length } });
|
|
47
45
|
});
|
|
48
46
|
|
|
49
|
-
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
|
+
);
|
|
50
54
|
}
|
|
51
55
|
}, [space, graph]);
|
|
52
56
|
|
|
53
57
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
54
58
|
const handleTest = async () => {
|
|
55
59
|
if (space && graph) {
|
|
56
|
-
const
|
|
60
|
+
const objects = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
|
|
57
61
|
const mapped = graph.mapFunctionBindingToId(text);
|
|
58
62
|
const unmapped = graph.mapFunctionBindingFromId(mapped);
|
|
59
63
|
const internal = graph.mapFormulaToNative(text);
|
|
@@ -76,23 +80,27 @@ const Story = () => {
|
|
|
76
80
|
</Input.Root>
|
|
77
81
|
<Button onClick={handleTest}>Test</Button>
|
|
78
82
|
</Toolbar.Root>
|
|
79
|
-
<
|
|
80
|
-
{JSON.stringify({ space: space?.id, graph: graph?.id, sheet: sheet?.id, model: model?.id, result }, null, 2)}
|
|
81
|
-
</SyntaxHighlighter>
|
|
83
|
+
<JsonHighlighter data={{ space: space?.id, graph: graph?.id, sheet: sheet?.id, model: model?.id, result }} />
|
|
82
84
|
</div>
|
|
83
85
|
);
|
|
84
86
|
};
|
|
85
87
|
|
|
86
|
-
export const Default = {};
|
|
88
|
+
export const Default: Story = {};
|
|
87
89
|
|
|
88
|
-
const meta
|
|
89
|
-
title: 'plugins/plugin-sheet/functions',
|
|
90
|
+
const meta = {
|
|
91
|
+
title: 'plugins/plugin-sheet/components/functions',
|
|
92
|
+
render: DefaultStory,
|
|
90
93
|
decorators: [
|
|
91
|
-
|
|
94
|
+
withTheme(),
|
|
95
|
+
withClientProvider({
|
|
96
|
+
types: [Operation.PersistentOperation, Sheet.Sheet],
|
|
97
|
+
createIdentity: true,
|
|
98
|
+
createSpace: true,
|
|
99
|
+
}),
|
|
92
100
|
withComputeGraphDecorator({ plugins: testFunctionPlugins }),
|
|
93
|
-
withTheme,
|
|
94
101
|
],
|
|
95
|
-
|
|
96
|
-
};
|
|
102
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
97
103
|
|
|
98
104
|
export default meta;
|
|
105
|
+
|
|
106
|
+
type Story = StoryObj<typeof meta>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { SheetContent } from '../SheetContent';
|
|
6
|
+
import { SheetRoot } from '../SheetRoot';
|
|
7
|
+
import { SheetStatusbar } from '../SheetStatusbar';
|
|
8
|
+
import { SheetToolbar } from '../SheetToolbar';
|
|
9
|
+
|
|
10
|
+
export { useSheetContext, type SheetContextValue, type SheetRootProps } from '../SheetRoot';
|
|
11
|
+
export { type SheetContentProps } from '../SheetContent';
|
|
12
|
+
export { type SheetToolbarProps } from '../SheetToolbar';
|
|
13
|
+
export { type SheetStatusbarProps } from '../SheetStatusbar';
|
|
14
|
+
|
|
15
|
+
export const Sheet = {
|
|
16
|
+
Root: SheetRoot,
|
|
17
|
+
Toolbar: SheetToolbar,
|
|
18
|
+
Content: SheetContent,
|
|
19
|
+
Statusbar: SheetStatusbar,
|
|
20
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useMemo, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Client } from '@dxos/client';
|
|
9
|
+
import { defaultFunctions } from '@dxos/compute-hyperformula';
|
|
10
|
+
import { getRegisteredFunctionNames } from '@dxos/compute-hyperformula/testing';
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { createDocAccessor } from '@dxos/echo-client';
|
|
13
|
+
import { useAsyncEffect } from '@dxos/react-hooks';
|
|
14
|
+
import { CellEditor, type CellEditorProps } from '@dxos/react-ui-grid';
|
|
15
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
16
|
+
import { automerge } from '@dxos/ui-editor';
|
|
17
|
+
|
|
18
|
+
import { Sheet } from '#types';
|
|
19
|
+
|
|
20
|
+
import { sheetExtension } from '../../extensions';
|
|
21
|
+
|
|
22
|
+
const DefaultStory = ({ value, ...props }: CellEditorProps) => {
|
|
23
|
+
const extensions = useMemo(() => {
|
|
24
|
+
const functionNames = getRegisteredFunctionNames();
|
|
25
|
+
const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
|
|
26
|
+
return [sheetExtension({ functions })];
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
return <CellEditor {...props} value={value} extensions={extensions} />;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const AutomergeStory = ({ value, ...props }: CellEditorProps) => {
|
|
33
|
+
const cell = 'A1';
|
|
34
|
+
const [object, setObject] = useState<Sheet.Sheet>();
|
|
35
|
+
useAsyncEffect(async () => {
|
|
36
|
+
const client = new Client({ types: [Sheet.Sheet] });
|
|
37
|
+
await client.initialize();
|
|
38
|
+
await client.halo.createIdentity();
|
|
39
|
+
const space = await client.spaces.create();
|
|
40
|
+
|
|
41
|
+
const sheet = Sheet.make();
|
|
42
|
+
Obj.update(sheet, (sheet) => {
|
|
43
|
+
sheet.name = 'Test';
|
|
44
|
+
sheet.cells[cell] = { value };
|
|
45
|
+
});
|
|
46
|
+
space.db.add(sheet);
|
|
47
|
+
setObject(sheet);
|
|
48
|
+
}, [value]);
|
|
49
|
+
|
|
50
|
+
const extensions = useMemo(() => {
|
|
51
|
+
if (!object) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const functionNames = getRegisteredFunctionNames();
|
|
56
|
+
const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
|
|
57
|
+
const accessor = createDocAccessor(object, ['cells', cell, 'value']);
|
|
58
|
+
return [automerge(accessor), sheetExtension({ functions })];
|
|
59
|
+
}, [object]);
|
|
60
|
+
|
|
61
|
+
return <CellEditor {...props} value={value} extensions={extensions} />;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const meta = {
|
|
65
|
+
title: 'plugins/plugin-sheet/components/CellEditor',
|
|
66
|
+
|
|
67
|
+
decorators: [withTheme()],
|
|
68
|
+
component: CellEditor,
|
|
69
|
+
render: DefaultStory,
|
|
70
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
71
|
+
|
|
72
|
+
export default meta;
|
|
73
|
+
|
|
74
|
+
type Story = StoryObj<typeof meta>;
|
|
75
|
+
|
|
76
|
+
export const Default: Story = {};
|
|
77
|
+
|
|
78
|
+
export const AutoComplete: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
value: '=SUM',
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Formatting: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
value: '=SUM(A1:A2, 100, TRUE, "100", SUM(A1:A2, B1:B2))',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Automerge: Story = {
|
|
91
|
+
render: AutomergeStory,
|
|
92
|
+
args: {
|
|
93
|
+
value: '=SUM(A1:A2, 100, TRUE, "100", SUM(A1:A2, B1:B2))',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { ProcessManagerPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
|
|
11
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
12
|
+
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
|
+
|
|
15
|
+
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '#testing';
|
|
16
|
+
import { translations } from '#translations';
|
|
17
|
+
import { Sheet } from '#types';
|
|
18
|
+
|
|
19
|
+
import { useComputeGraph } from '../ComputeGraph';
|
|
20
|
+
import { SheetRoot } from '../SheetRoot';
|
|
21
|
+
import { SheetContent } from './SheetContent';
|
|
22
|
+
|
|
23
|
+
export const Basic = () => {
|
|
24
|
+
const [space] = useSpaces();
|
|
25
|
+
const graph = useComputeGraph(space);
|
|
26
|
+
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
27
|
+
if (!sheet || !graph) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<SheetRoot graph={graph} sheet={sheet} attendableId='test' ignoreAttention>
|
|
33
|
+
<div className='grid h-full w-full'>
|
|
34
|
+
<SheetContent />
|
|
35
|
+
</div>
|
|
36
|
+
</SheetRoot>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const meta = {
|
|
41
|
+
title: 'plugins/plugin-sheet/components/SheetContent',
|
|
42
|
+
component: SheetContent,
|
|
43
|
+
decorators: [
|
|
44
|
+
withTheme(),
|
|
45
|
+
withLayout({ layout: 'fullscreen' }),
|
|
46
|
+
withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
|
|
47
|
+
withComputeGraphDecorator({ plugins: testFunctionPlugins }),
|
|
48
|
+
withPluginManager({
|
|
49
|
+
plugins: [ProcessManagerPlugin()],
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
parameters: {
|
|
53
|
+
layout: 'fullscreen',
|
|
54
|
+
translations,
|
|
55
|
+
},
|
|
56
|
+
} satisfies Meta<typeof SheetContent>;
|
|
57
|
+
|
|
58
|
+
export default meta;
|
|
59
|
+
|
|
60
|
+
type Story = StoryObj<typeof meta>;
|