@dxos/plugin-sheet 0.8.4-main.f9ba587 → 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-7HQX4NQP.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 +2 -2
- 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 +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 -36
- 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 +133 -97
- 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 -28
- package/src/capabilities/state.ts +29 -0
- package/src/capabilities/undo-mappings.ts +30 -0
- package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +2 -2
- package/src/components/ComputeGraph/compute-graph.stories.tsx +38 -29
- 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} +100 -69
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +23 -16
- 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 +20 -14
- package/src/components/SheetToolbar/SheetToolbar.tsx +62 -56
- package/src/components/SheetToolbar/align.ts +50 -24
- 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 +50 -36
- package/src/extensions/compute.ts +4 -5
- 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 +22 -63
- package/src/meta.ts +22 -8
- package/src/model/sheet-model.test.ts +35 -6
- package/src/model/sheet-model.ts +89 -57
- 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-manager.ts +1 -1
- package/src/playwright/sheet.spec.ts +5 -4
- package/src/plugin.ts +11 -0
- package/src/sanity.test.ts +10 -4
- 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 -34
- 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 -51
- package/src/types/util.ts +18 -45
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/SheetContainer-6IWQKRJC.mjs +0 -351
- package/dist/lib/browser/SheetContainer-6IWQKRJC.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-VHURGBOY.mjs +0 -24
- package/dist/lib/browser/anchor-sort-VHURGBOY.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-7HQX4NQP.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-SI4X5GUR.mjs +0 -892
- package/dist/lib/browser/chunk-SI4X5GUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-ULWNSP4B.mjs +0 -847
- package/dist/lib/browser/chunk-ULWNSP4B.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-VG7VP7IV.mjs +0 -30
- package/dist/lib/browser/compute-graph-registry-VG7VP7IV.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -153
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WOJGZMSV.mjs +0 -56
- package/dist/lib/browser/intent-resolver-WOJGZMSV.mjs.map +0 -7
- package/dist/lib/browser/markdown-VXMIPUQC.mjs +0 -26
- package/dist/lib/browser/markdown-VXMIPUQC.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-DAHMBIQW.mjs +0 -53
- package/dist/lib/browser/react-surface-DAHMBIQW.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-SW55KKOT.mjs +0 -352
- package/dist/lib/node-esm/SheetContainer-SW55KKOT.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-CTJGOPET.mjs +0 -25
- package/dist/lib/node-esm/anchor-sort-CTJGOPET.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-6SK5LJ5S.mjs +0 -16
- package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CADTJFAS.mjs +0 -893
- package/dist/lib/node-esm/chunk-CADTJFAS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q6UYC4G5.mjs +0 -236
- package/dist/lib/node-esm/chunk-Q6UYC4G5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VEGX32AT.mjs +0 -848
- package/dist/lib/node-esm/chunk-VEGX32AT.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-3K3Q2A5T.mjs +0 -31
- package/dist/lib/node-esm/compute-graph-registry-3K3Q2A5T.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -154
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-PZRXBNIJ.mjs +0 -57
- package/dist/lib/node-esm/intent-resolver-PZRXBNIJ.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-4VPQJZNZ.mjs +0 -27
- package/dist/lib/node-esm/markdown-4VPQJZNZ.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-Z7TVWQ4V.mjs +0 -54
- package/dist/lib/node-esm/react-surface-Z7TVWQ4V.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 -22
- package/src/components/GridSheet/GridSheet.stories.tsx +0 -53
- 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 -89
- 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
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/PLUGIN.mdl
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: org.dxos.plugin.sheet
|
|
3
|
+
name: SheetPlugin
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Spreadsheet plugin for `DXOS` Composer — a full-featured grid backed by ECHO for local-first, real-time collaborative data entry, formula evaluation, and structured data display.
|
|
8
|
+
|
|
9
|
+
## Extensions
|
|
10
|
+
|
|
11
|
+
The following extension dialects are used in this document.
|
|
12
|
+
Each extension is defined in the Appendix or resolved via its URI.
|
|
13
|
+
|
|
14
|
+
| Term | URI |
|
|
15
|
+
|-------------|--------------------------------|
|
|
16
|
+
| `type` | `org.dxos.mdl.type@1.0` |
|
|
17
|
+
| `feat` | `org.dxos.mdl.feat@1.0` |
|
|
18
|
+
| `test` | `org.dxos.mdl.test@1.0` |
|
|
19
|
+
| `component` | `org.dxos.mdl.component@1.0` |
|
|
20
|
+
| `op` | `org.dxos.mdl.op@1.0` |
|
|
21
|
+
|
|
22
|
+
## Types
|
|
23
|
+
|
|
24
|
+
```mdl
|
|
25
|
+
type CellValue
|
|
26
|
+
fields:
|
|
27
|
+
value: any # scalar: string | number | boolean | formula string
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```mdl
|
|
31
|
+
type RowColumnMeta
|
|
32
|
+
fields:
|
|
33
|
+
size?: number # pixel width/height; absent means default
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```mdl
|
|
37
|
+
type Range
|
|
38
|
+
fields:
|
|
39
|
+
range: string # A1-notation range (e.g. "A1:C3")
|
|
40
|
+
key: string # formatting key: alignment | comment | style
|
|
41
|
+
value: string # formatting value (e.g. "center", "highlight")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```mdl
|
|
45
|
+
type Axis
|
|
46
|
+
literals: row | col
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```mdl
|
|
50
|
+
type Sheet
|
|
51
|
+
typename: org.dxos.type.sheet
|
|
52
|
+
fields:
|
|
53
|
+
name?: string
|
|
54
|
+
cells: Map<string, CellValue> # sparse map keyed by internal cell index
|
|
55
|
+
rows: string[] # ordered row indices
|
|
56
|
+
columns: string[] # ordered column indices
|
|
57
|
+
rowMeta: Map<string, RowColumnMeta>
|
|
58
|
+
columnMeta: Map<string, RowColumnMeta>
|
|
59
|
+
ranges: Range[] # range-based formatting annotations
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Components
|
|
63
|
+
|
|
64
|
+
```mdl
|
|
65
|
+
component SheetArticle
|
|
66
|
+
desc: Primary spreadsheet view rendered inside an article or section role surface.
|
|
67
|
+
props:
|
|
68
|
+
subject: Sheet
|
|
69
|
+
attendableId: string
|
|
70
|
+
space: Space
|
|
71
|
+
registry: ComputeGraphRegistry
|
|
72
|
+
state:
|
|
73
|
+
selected?: CellAddress
|
|
74
|
+
activeRefs?: GridContentProps['activeRefs']
|
|
75
|
+
slots:
|
|
76
|
+
toolbar?: ReactNode
|
|
77
|
+
actions:
|
|
78
|
+
selectCell(address: CellAddress)
|
|
79
|
+
editCell(address: CellAddress, value: any)
|
|
80
|
+
insertRow(index: number)
|
|
81
|
+
insertColumn(index: number)
|
|
82
|
+
dropRow(axisIndex: string)
|
|
83
|
+
dropColumn(axisIndex: string)
|
|
84
|
+
layout: |
|
|
85
|
+
┌───────────────────────────────────┐
|
|
86
|
+
│ [toolbar slot] │
|
|
87
|
+
├───┬───┬───┬───┬───────────────────┤
|
|
88
|
+
│ │ A │ B │ C │ … column header │
|
|
89
|
+
├───┼───┼───┼───┤ │
|
|
90
|
+
│ 1 │ │ │ │ cell grid │
|
|
91
|
+
├───┼───┼───┼───┤ │
|
|
92
|
+
│ 2 │ │ │ │ │
|
|
93
|
+
│ … │ │ │ │ │
|
|
94
|
+
└───┴───┴───┴───┴───────────────────┘
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```mdl
|
|
98
|
+
component RangeList
|
|
99
|
+
desc: Object-properties panel listing named ranges and formatting annotations on a Sheet.
|
|
100
|
+
props:
|
|
101
|
+
sheet: Sheet
|
|
102
|
+
state:
|
|
103
|
+
selected?: Range
|
|
104
|
+
actions:
|
|
105
|
+
addRange(range: Range)
|
|
106
|
+
removeRange(range: Range)
|
|
107
|
+
updateRange(range: Range)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Operations
|
|
111
|
+
|
|
112
|
+
```mdl
|
|
113
|
+
op insertAxis
|
|
114
|
+
desc: Inserts one or more rows or columns at the given index in the sheet model.
|
|
115
|
+
input:
|
|
116
|
+
model: SheetModel
|
|
117
|
+
axis: Axis
|
|
118
|
+
index: number
|
|
119
|
+
count?: number # defaults to 1
|
|
120
|
+
output: void
|
|
121
|
+
effects: [echo:write]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
```mdl
|
|
125
|
+
op dropAxis
|
|
126
|
+
desc: Removes a row or column by axis index, returning data needed to restore it (undo).
|
|
127
|
+
input:
|
|
128
|
+
model: SheetModel
|
|
129
|
+
axis: Axis
|
|
130
|
+
axisIndex: string
|
|
131
|
+
output: DropAxisOutput # axis, axisIndex, index, axisMeta, values
|
|
132
|
+
effects: [echo:write]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```mdl
|
|
136
|
+
op restoreAxis
|
|
137
|
+
desc: Restores a previously dropped row or column (undo of dropAxis).
|
|
138
|
+
input:
|
|
139
|
+
model: SheetModel
|
|
140
|
+
axis: Axis
|
|
141
|
+
axisIndex: string # original axis index to restore
|
|
142
|
+
index: number # original position
|
|
143
|
+
axisMeta: RowColumnMeta
|
|
144
|
+
values: any[] # cell values to re-insert
|
|
145
|
+
output: void
|
|
146
|
+
effects: [echo:write]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```mdl
|
|
150
|
+
op scrollToAnchor
|
|
151
|
+
desc: Programmatically scrolls and highlights a cell range in an active grid instance.
|
|
152
|
+
input:
|
|
153
|
+
subject: string # attendable ID of the target sheet
|
|
154
|
+
cursor: string # A1-notation cell or range
|
|
155
|
+
ref?: any # active refs for highlight overlay
|
|
156
|
+
output: void
|
|
157
|
+
effects: [ui:scroll]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Features
|
|
161
|
+
|
|
162
|
+
```mdl
|
|
163
|
+
feat F-1: Sheet Object
|
|
164
|
+
|
|
165
|
+
req F-1.1: A Sheet is an ECHO object with typename org.dxos.type.sheet persisted in the user's space.
|
|
166
|
+
req F-1.2: Cells are stored in a sparse map keyed by internal row/column indices.
|
|
167
|
+
req F-1.3: Row and column order is maintained via ordered index arrays; insertion/deletion preserves existing cell references.
|
|
168
|
+
req F-1.4: Range-based formatting annotations are stored as a flat array on the Sheet object.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
```mdl
|
|
172
|
+
feat F-2: Formula Evaluation
|
|
173
|
+
|
|
174
|
+
req F-2.1: Formulas are prefixed with "=" and evaluated by the HyperFormula engine via the ComputeGraph.
|
|
175
|
+
req F-2.2: Over 400 built-in functions are available (arithmetic, statistical, text, date/time, financial, logical).
|
|
176
|
+
req F-2.3:
|
|
177
|
+
when: a cell value changes
|
|
178
|
+
then: all dependent formula cells are recomputed reactively
|
|
179
|
+
req F-2.4: Cell references in stored formulas are translated to internal indices; A1-notation is converted on read/write.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```mdl
|
|
183
|
+
feat F-3: Row and Column Management
|
|
184
|
+
|
|
185
|
+
req F-3.1:
|
|
186
|
+
when: op:insertAxis is called
|
|
187
|
+
then: a new row or column is inserted at the specified index; existing cells shift accordingly
|
|
188
|
+
|
|
189
|
+
req F-3.2:
|
|
190
|
+
when: op:dropAxis is called
|
|
191
|
+
then: the row or column is removed and undo data returned; op:restoreAxis reverses the operation
|
|
192
|
+
|
|
193
|
+
req F-3.3: Row and column sizes are persisted in rowMeta/columnMeta; absent size means default grid size.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
```mdl
|
|
197
|
+
feat F-4: Cell Formatting
|
|
198
|
+
|
|
199
|
+
req F-4.1: Ranges support alignment values: start | center | end.
|
|
200
|
+
req F-4.2: Ranges support comment annotations displayed as a visual overlay on the cell.
|
|
201
|
+
req F-4.3: Ranges support style values: highlight | softwrap.
|
|
202
|
+
req F-4.4: RangeList in the object-properties surface allows users to view and manage range annotations.
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
```mdl
|
|
206
|
+
feat F-5: Collaborative Editing
|
|
207
|
+
|
|
208
|
+
req F-5.1: All cell edits are written through ECHO and replicated to peers in real time.
|
|
209
|
+
req F-5.2:
|
|
210
|
+
when: a peer writes a cell value
|
|
211
|
+
then: the local grid re-renders with the updated value without full reload
|
|
212
|
+
|
|
213
|
+
req F-5.3: ComputeGraphRegistry manages per-space HyperFormula instances so all peers share the same formula graph.
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
```mdl
|
|
217
|
+
feat F-6: Markdown Integration
|
|
218
|
+
|
|
219
|
+
req F-6.1: SheetPlugin contributes a CodeMirror extension to plugin-markdown via MarkdownCapabilities.ExtensionProvider.
|
|
220
|
+
req F-6.2:
|
|
221
|
+
when: the extension is active in a document that belongs to a space
|
|
222
|
+
then: formula references inside Markdown fenced code blocks resolve against the space's ComputeGraph
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
```mdl
|
|
226
|
+
feat F-7: Anchor Navigation
|
|
227
|
+
|
|
228
|
+
req F-7.1:
|
|
229
|
+
when: op:scrollToAnchor is invoked with a sheet attendable ID and cursor
|
|
230
|
+
then: the corresponding SheetArticle scrolls to the target cell and applies the active-ref highlight
|
|
231
|
+
|
|
232
|
+
req F-7.2: AnchorSort contributes a sort comparator so sheet anchors appear in canonical order in navigation menus.
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Acceptance
|
|
236
|
+
|
|
237
|
+
```mdl
|
|
238
|
+
test T-1: Create sheet and enter a value
|
|
239
|
+
given: a new Sheet is created in a space
|
|
240
|
+
when: user types "42" into cell A1
|
|
241
|
+
then:
|
|
242
|
+
- Sheet.cells contains an entry for the A1 index with value 42
|
|
243
|
+
- grid displays "42" in the A1 cell
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
```mdl
|
|
247
|
+
test T-2: Formula evaluation
|
|
248
|
+
given: A1 = 10, A2 = 20
|
|
249
|
+
when: user enters "=A1+A2" in A3
|
|
250
|
+
then:
|
|
251
|
+
- A3 displays 30
|
|
252
|
+
- changing A1 to 15 causes A3 to update to 35
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
```mdl
|
|
256
|
+
test T-3: Insert and drop row
|
|
257
|
+
given: a Sheet with values in rows 1 and 2
|
|
258
|
+
when: op:insertAxis runs with axis=row, index=1
|
|
259
|
+
then:
|
|
260
|
+
- a blank row is inserted between existing rows 1 and 2
|
|
261
|
+
- existing cell references remain valid
|
|
262
|
+
|
|
263
|
+
when: op:dropAxis runs on the inserted row
|
|
264
|
+
then:
|
|
265
|
+
- the row is removed
|
|
266
|
+
- op:restoreAxis re-inserts the row with its original values
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```mdl
|
|
270
|
+
test T-4: Range formatting
|
|
271
|
+
given: a Sheet open in SheetArticle
|
|
272
|
+
when: user applies "highlight" style to range B2:C4
|
|
273
|
+
then:
|
|
274
|
+
- Sheet.ranges contains an entry with range="B2:C4", key="style", value="highlight"
|
|
275
|
+
- cells in B2:C4 render with the highlight background class
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
```mdl
|
|
279
|
+
test T-5: Real-time collaboration
|
|
280
|
+
given: two peers have the same Sheet open
|
|
281
|
+
when: peer A sets cell D5 to "hello"
|
|
282
|
+
then:
|
|
283
|
+
- peer B's grid displays "hello" in D5 without reload
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
```mdl
|
|
287
|
+
test T-6: Scroll to anchor
|
|
288
|
+
given: a SheetArticle is mounted with attendableId "sheet-1"
|
|
289
|
+
when: op:scrollToAnchor runs with subject="sheet-1", cursor="E10"
|
|
290
|
+
then:
|
|
291
|
+
- the grid scrolls so that E10 is visible
|
|
292
|
+
- E10 is highlighted via activeRefs
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Appendix: Extension Definitions
|
|
298
|
+
|
|
299
|
+
```mdl
|
|
300
|
+
ext type
|
|
301
|
+
uri: org.dxos.mdl.type@1.0
|
|
302
|
+
desc: A named data structure with typed fields and optional literals.
|
|
303
|
+
fields:
|
|
304
|
+
desc?: Prose
|
|
305
|
+
fields?: FieldMap
|
|
306
|
+
literals?: UnionList
|
|
307
|
+
extends?: TypeRef[]
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
```mdl
|
|
311
|
+
ext feat
|
|
312
|
+
uri: org.dxos.mdl.feat@1.0
|
|
313
|
+
desc: A named feature grouping one or more requirements.
|
|
314
|
+
fields:
|
|
315
|
+
desc?: Prose
|
|
316
|
+
req: RequirementList
|
|
317
|
+
nesting: self
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
```mdl
|
|
321
|
+
ext test
|
|
322
|
+
uri: org.dxos.mdl.test@1.0
|
|
323
|
+
desc: An acceptance scenario expressed as given / when / then steps.
|
|
324
|
+
fields:
|
|
325
|
+
given?: Step | Step[]
|
|
326
|
+
when?: Step | Step[]
|
|
327
|
+
then: Step | Step[]
|
|
328
|
+
tags?: TagList
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
```mdl
|
|
332
|
+
ext component
|
|
333
|
+
uri: org.dxos.mdl.component@1.0
|
|
334
|
+
desc: A UI component with props, internal state, slots, actions, and events.
|
|
335
|
+
fields:
|
|
336
|
+
desc?: Prose
|
|
337
|
+
props?: FieldMap
|
|
338
|
+
state?: FieldMap
|
|
339
|
+
slots?: FieldMap
|
|
340
|
+
actions?: ActionMap
|
|
341
|
+
emits?: EventMap
|
|
342
|
+
layout?: CodeBlock
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
```mdl
|
|
346
|
+
ext op
|
|
347
|
+
uri: org.dxos.mdl.op@1.0
|
|
348
|
+
desc: |
|
|
349
|
+
A named operation with typed inputs, outputs, and declared errors.
|
|
350
|
+
Pure ops have no effects or requires. Effectful ops declare both.
|
|
351
|
+
fields:
|
|
352
|
+
desc?: Prose
|
|
353
|
+
input?: FieldMap
|
|
354
|
+
output?: TypeExpr
|
|
355
|
+
errors?: ErrorMap
|
|
356
|
+
effects?: EffectList
|
|
357
|
+
requires?: ServiceList
|
|
358
|
+
note?: Prose
|
|
359
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/RangeList/RangeList.tsx
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import React, { useCallback } from "react";
|
|
6
|
+
import { rangeToA1Notation } from "@dxos/compute-hyperformula";
|
|
7
|
+
import { useObject } from "@dxos/echo-react";
|
|
8
|
+
import { Input, Message, useTranslation } from "@dxos/react-ui";
|
|
9
|
+
import { List } from "@dxos/react-ui-list";
|
|
10
|
+
import { meta } from "#meta";
|
|
11
|
+
import { rangeFromIndex } from "#types";
|
|
12
|
+
import { Sheet } from "#types";
|
|
13
|
+
var RangeList = ({ sheet: sheetProp }) => {
|
|
14
|
+
const { t } = useTranslation(meta.id);
|
|
15
|
+
const [sheet, updateSheet] = useObject(sheetProp);
|
|
16
|
+
const handleSelectRange = (range) => {
|
|
17
|
+
};
|
|
18
|
+
const handleDeleteRange = useCallback((range) => {
|
|
19
|
+
const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);
|
|
20
|
+
updateSheet((sheet2) => {
|
|
21
|
+
sheet2.ranges.splice(index, 1);
|
|
22
|
+
});
|
|
23
|
+
}, [
|
|
24
|
+
sheet,
|
|
25
|
+
updateSheet
|
|
26
|
+
]);
|
|
27
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Label, null, t("range-list.heading"))), sheet.ranges.length < 1 ? /* @__PURE__ */ React.createElement(Message.Root, null, /* @__PURE__ */ React.createElement(Message.Title, null, t("no-ranges.message"))) : /* @__PURE__ */ React.createElement(List.Root, {
|
|
28
|
+
items: sheet.ranges,
|
|
29
|
+
isItem: Schema.is(Sheet.Range)
|
|
30
|
+
}, ({ items: ranges }) => ranges.map((range, i) => /* @__PURE__ */ React.createElement(List.Item, {
|
|
31
|
+
key: i,
|
|
32
|
+
item: range
|
|
33
|
+
}, /* @__PURE__ */ React.createElement(List.ItemDragHandle, null), /* @__PURE__ */ React.createElement(List.ItemTitle, {
|
|
34
|
+
onClick: () => handleSelectRange(range)
|
|
35
|
+
}, t("range.title", {
|
|
36
|
+
position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),
|
|
37
|
+
key: t(`range-key.${range.key}.label`),
|
|
38
|
+
value: t(`range-value.${range.value}.label`)
|
|
39
|
+
})), /* @__PURE__ */ React.createElement(List.ItemDeleteButton, {
|
|
40
|
+
onClick: () => handleDeleteRange(range)
|
|
41
|
+
})))));
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
RangeList as default
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=RangeList-HYB5S6KQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/RangeList/RangeList.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport React, { useCallback } from 'react';\n\nimport { rangeToA1Notation } from '@dxos/compute-hyperformula';\nimport { useObject } from '@dxos/echo-react';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { List } from '@dxos/react-ui-list';\n\nimport { meta } from '#meta';\nimport { rangeFromIndex } from '#types';\nimport { Sheet } from '#types';\n\nexport type RangeListProps = {\n sheet: Sheet.Sheet;\n};\n\nexport const RangeList = ({ sheet: sheetProp }: RangeListProps) => {\n const { t } = useTranslation(meta.id);\n const [sheet, updateSheet] = useObject(sheetProp);\n // TODO(thure): Implement similar to comments, #8121\n const handleSelectRange = (range: Sheet.Range) => {};\n const handleDeleteRange = useCallback(\n (range: Sheet.Range) => {\n const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);\n updateSheet((sheet) => {\n sheet.ranges.splice(index, 1);\n });\n },\n [sheet, updateSheet],\n );\n return (\n <>\n <Input.Root>\n <Input.Label>{t('range-list.heading')}</Input.Label>\n </Input.Root>\n {sheet.ranges.length < 1 ? (\n <Message.Root>\n <Message.Title>{t('no-ranges.message')}</Message.Title>\n </Message.Root>\n ) : (\n <List.Root<Sheet.Range> items={sheet.ranges} isItem={Schema.is(Sheet.Range)}>\n {({ items: ranges }) =>\n ranges.map((range, i) => (\n <List.Item key={i} item={range}>\n <List.ItemDragHandle />\n <List.ItemTitle onClick={() => handleSelectRange(range)}>\n {t('range.title', {\n position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),\n key: t(`range-key.${range.key}.label`),\n value: t(`range-value.${range.value}.label`),\n })}\n </List.ItemTitle>\n <List.ItemDeleteButton onClick={() => handleDeleteRange(range)} />\n </List.Item>\n ))\n }\n </List.Root>\n )}\n </>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAC1B,SAASC,OAAOC,SAASC,sBAAsB;AAC/C,SAASC,YAAY;AAErB,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,aAAa;AAMf,IAAMC,YAAY,CAAC,EAAEC,OAAOC,UAAS,MAAkB;AAC5D,QAAM,EAAEC,EAAC,IAAKR,eAAeE,KAAKO,EAAE;AACpC,QAAM,CAACH,OAAOI,WAAAA,IAAeb,UAAUU,SAAAA;AAEvC,QAAMI,oBAAoB,CAACC,UAAAA;EAAwB;AACnD,QAAMC,oBAAoBlB,YACxB,CAACiB,UAAAA;AACC,UAAME,QAAQR,MAAMS,OAAOC,UAAU,CAACC,eAAeA,eAAeL,KAAAA;AACpEF,gBAAY,CAACJ,WAAAA;AACXA,MAAAA,OAAMS,OAAOG,OAAOJ,OAAO,CAAA;IAC7B,CAAA;EACF,GACA;IAACR;IAAOI;GAAY;AAEtB,SACE,sBAAA,cAAA,MAAA,UAAA,MACE,sBAAA,cAACZ,MAAMqB,MAAI,MACT,sBAAA,cAACrB,MAAMsB,OAAK,MAAEZ,EAAE,oBAAA,CAAA,CAAA,GAEjBF,MAAMS,OAAOM,SAAS,IACrB,sBAAA,cAACtB,QAAQoB,MAAI,MACX,sBAAA,cAACpB,QAAQuB,OAAK,MAAEd,EAAE,mBAAA,CAAA,CAAA,IAGpB,sBAAA,cAACP,KAAKkB,MAAI;IAAcI,OAAOjB,MAAMS;IAAQS,QAAeC,UAAGrB,MAAMsB,KAAK;KACvE,CAAC,EAAEH,OAAOR,OAAM,MACfA,OAAOY,IAAI,CAACf,OAAOgB,MACjB,sBAAA,cAAC3B,KAAK4B,MAAI;IAACC,KAAKF;IAAGG,MAAMnB;KACvB,sBAAA,cAACX,KAAK+B,gBAAc,IAAA,GACpB,sBAAA,cAAC/B,KAAKgC,WAAS;IAACC,SAAS,MAAMvB,kBAAkBC,KAAAA;KAC9CJ,EAAE,eAAe;IAChB2B,UAAUvC,kBAAkBO,eAAeI,WAAWK,MAAMA,KAAK,CAAA;IACjEkB,KAAKtB,EAAE,aAAaI,MAAMkB,GAAG,QAAQ;IACrCM,OAAO5B,EAAE,eAAeI,MAAMwB,KAAK,QAAQ;EAC7C,CAAA,CAAA,GAEF,sBAAA,cAACnC,KAAKoC,kBAAgB;IAACH,SAAS,MAAMrB,kBAAkBD,KAAAA;;AAQxE;",
|
|
6
|
+
"names": ["Schema", "React", "useCallback", "rangeToA1Notation", "useObject", "Input", "Message", "useTranslation", "List", "meta", "rangeFromIndex", "Sheet", "RangeList", "sheet", "sheetProp", "t", "id", "updateSheet", "handleSelectRange", "range", "handleDeleteRange", "index", "ranges", "findIndex", "sheetRange", "splice", "Root", "Label", "length", "Title", "items", "isItem", "is", "Range", "map", "i", "Item", "key", "item", "ItemDragHandle", "ItemTitle", "onClick", "position", "value", "ItemDeleteButton"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/SheetArticle/SheetArticle.tsx
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Panel } from "@dxos/react-ui";
|
|
6
|
+
import { ComputeGraphContextProvider, Sheet, useComputeGraph } from "#components";
|
|
7
|
+
var SheetArticle = ({ registry, ...props }) => /* @__PURE__ */ React.createElement(ComputeGraphContextProvider, {
|
|
8
|
+
registry
|
|
9
|
+
}, /* @__PURE__ */ React.createElement(SheetArticleInner, props));
|
|
10
|
+
var SheetArticleInner = ({ role, subject: sheet, attendableId, space, ignoreAttention }) => {
|
|
11
|
+
const graph = useComputeGraph(space);
|
|
12
|
+
if (!graph) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ React.createElement(Sheet.Root, {
|
|
16
|
+
graph,
|
|
17
|
+
sheet,
|
|
18
|
+
attendableId,
|
|
19
|
+
ignoreAttention
|
|
20
|
+
}, /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
21
|
+
classNames: role === "section" && "aspect-aquare"
|
|
22
|
+
}, /* @__PURE__ */ React.createElement(Panel.Toolbar, {
|
|
23
|
+
asChild: true
|
|
24
|
+
}, /* @__PURE__ */ React.createElement(Sheet.Toolbar, null)), /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
25
|
+
asChild: true
|
|
26
|
+
}, /* @__PURE__ */ React.createElement(Sheet.Content, null)), /* @__PURE__ */ React.createElement(Panel.Statusbar, {
|
|
27
|
+
asChild: true
|
|
28
|
+
}, /* @__PURE__ */ React.createElement(Sheet.Statusbar, null))));
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
SheetArticle as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=SheetArticle-5AJRM3V3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/SheetArticle/SheetArticle.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';\nimport { type Space } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\n\nimport { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';\nimport { type Sheet as SheetType } from '#types';\n\nexport type SheetArticleProps = AppSurface.ObjectArticleProps<\n SheetType.Sheet,\n {\n space: Space;\n registry: ComputeGraphRegistry;\n ignoreAttention?: boolean;\n }\n>;\n\nexport const SheetArticle = ({ registry, ...props }: SheetArticleProps) => (\n <ComputeGraphContextProvider registry={registry}>\n <SheetArticleInner {...props} />\n </ComputeGraphContextProvider>\n);\n\nconst SheetArticleInner = ({\n role,\n subject: sheet,\n attendableId,\n space,\n ignoreAttention,\n}: Omit<SheetArticleProps, 'registry'>) => {\n const graph = useComputeGraph(space);\n if (!graph) {\n return null;\n }\n\n return (\n <Sheet.Root graph={graph} sheet={sheet} attendableId={attendableId!} ignoreAttention={ignoreAttention}>\n <Panel.Root classNames={role === 'section' && 'aspect-aquare'}>\n <Panel.Toolbar asChild>\n <Sheet.Toolbar />\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Sheet.Content />\n </Panel.Content>\n <Panel.Statusbar asChild>\n <Sheet.Statusbar />\n </Panel.Statusbar>\n </Panel.Root>\n </Sheet.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,OAAOA,WAAW;AAKlB,SAASC,aAAa;AAEtB,SAASC,6BAA6BC,OAAOC,uBAAuB;AAY7D,IAAMC,eAAe,CAAC,EAAEC,UAAU,GAAGC,MAAAA,MAC1C,sBAAA,cAACL,6BAAAA;EAA4BI;GAC3B,sBAAA,cAACE,mBAAsBD,KAAAA,CAAAA;AAI3B,IAAMC,oBAAoB,CAAC,EACzBC,MACAC,SAASC,OACTC,cACAC,OACAC,gBAAe,MACqB;AACpC,QAAMC,QAAQX,gBAAgBS,KAAAA;AAC9B,MAAI,CAACE,OAAO;AACV,WAAO;EACT;AAEA,SACE,sBAAA,cAACZ,MAAMa,MAAI;IAACD;IAAcJ;IAAcC;IAA6BE;KACnE,sBAAA,cAACb,MAAMe,MAAI;IAACC,YAAYR,SAAS,aAAa;KAC5C,sBAAA,cAACR,MAAMiB,SAAO;IAACC,SAAAA;KACb,sBAAA,cAAChB,MAAMe,SAAO,IAAA,CAAA,GAEhB,sBAAA,cAACjB,MAAMmB,SAAO;IAACD,SAAAA;KACb,sBAAA,cAAChB,MAAMiB,SAAO,IAAA,CAAA,GAEhB,sBAAA,cAACnB,MAAMoB,WAAS;IAACF,SAAAA;KACf,sBAAA,cAAChB,MAAMkB,WAAS,IAAA,CAAA,CAAA,CAAA;AAK1B;",
|
|
6
|
+
"names": ["React", "Panel", "ComputeGraphContextProvider", "Sheet", "useComputeGraph", "SheetArticle", "registry", "props", "SheetArticleInner", "role", "subject", "sheet", "attendableId", "space", "ignoreAttention", "graph", "Root", "classNames", "Toolbar", "asChild", "Content", "Statusbar"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/SheetPlugin.tsx
|
|
4
|
+
import { ActivationEvent, ActivationEvents, Plugin } from "@dxos/app-framework";
|
|
5
|
+
import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
+
import { ClientEvents } from "@dxos/plugin-client";
|
|
7
|
+
import { MarkdownEvents } from "@dxos/plugin-markdown";
|
|
8
|
+
import { AnchorSort, AppGraphBuilder, NavigationResolver, CommentConfig, ComputeGraphRegistry, CreateObject, Markdown, OperationHandler, UndoMappings, ReactSurface, SheetState } from "#capabilities";
|
|
9
|
+
import { meta } from "#meta";
|
|
10
|
+
import { translations } from "#translations";
|
|
11
|
+
import { Sheet } from "#types";
|
|
12
|
+
|
|
13
|
+
// raw-loader:/__w/dxos/dxos/packages/plugins/plugin-sheet/PLUGIN.mdl?raw
|
|
14
|
+
var PLUGIN_default = '---\nid: org.dxos.plugin.sheet\nname: SheetPlugin\nversion: 0.1.0\n---\n\nSpreadsheet plugin for `DXOS` Composer \u2014 a full-featured grid backed by ECHO for local-first, real-time collaborative data entry, formula evaluation, and structured data display.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype CellValue\n fields:\n value: any # scalar: string | number | boolean | formula string\n```\n\n```mdl\ntype RowColumnMeta\n fields:\n size?: number # pixel width/height; absent means default\n```\n\n```mdl\ntype Range\n fields:\n range: string # A1-notation range (e.g. "A1:C3")\n key: string # formatting key: alignment | comment | style\n value: string # formatting value (e.g. "center", "highlight")\n```\n\n```mdl\ntype Axis\n literals: row | col\n```\n\n```mdl\ntype Sheet\n typename: org.dxos.type.sheet\n fields:\n name?: string\n cells: Map<string, CellValue> # sparse map keyed by internal cell index\n rows: string[] # ordered row indices\n columns: string[] # ordered column indices\n rowMeta: Map<string, RowColumnMeta>\n columnMeta: Map<string, RowColumnMeta>\n ranges: Range[] # range-based formatting annotations\n```\n\n## Components\n\n```mdl\ncomponent SheetArticle\n desc: Primary spreadsheet view rendered inside an article or section role surface.\n props:\n subject: Sheet\n attendableId: string\n space: Space\n registry: ComputeGraphRegistry\n state:\n selected?: CellAddress\n activeRefs?: GridContentProps[\'activeRefs\']\n slots:\n toolbar?: ReactNode\n actions:\n selectCell(address: CellAddress)\n editCell(address: CellAddress, value: any)\n insertRow(index: number)\n insertColumn(index: number)\n dropRow(axisIndex: string)\n dropColumn(axisIndex: string)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 \u2502 A \u2502 B \u2502 C \u2502 \u2026 column header \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 1 \u2502 \u2502 \u2502 \u2502 cell grid \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 2 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2502 \u2026 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent RangeList\n desc: Object-properties panel listing named ranges and formatting annotations on a Sheet.\n props:\n sheet: Sheet\n state:\n selected?: Range\n actions:\n addRange(range: Range)\n removeRange(range: Range)\n updateRange(range: Range)\n```\n\n## Operations\n\n```mdl\nop insertAxis\n desc: Inserts one or more rows or columns at the given index in the sheet model.\n input:\n model: SheetModel\n axis: Axis\n index: number\n count?: number # defaults to 1\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop dropAxis\n desc: Removes a row or column by axis index, returning data needed to restore it (undo).\n input:\n model: SheetModel\n axis: Axis\n axisIndex: string\n output: DropAxisOutput # axis, axisIndex, index, axisMeta, values\n effects: [echo:write]\n```\n\n```mdl\nop restoreAxis\n desc: Restores a previously dropped row or column (undo of dropAxis).\n input:\n model: SheetModel\n axis: Axis\n axisIndex: string # original axis index to restore\n index: number # original position\n axisMeta: RowColumnMeta\n values: any[] # cell values to re-insert\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop scrollToAnchor\n desc: Programmatically scrolls and highlights a cell range in an active grid instance.\n input:\n subject: string # attendable ID of the target sheet\n cursor: string # A1-notation cell or range\n ref?: any # active refs for highlight overlay\n output: void\n effects: [ui:scroll]\n```\n\n## Features\n\n```mdl\nfeat F-1: Sheet Object\n\n req F-1.1: A Sheet is an ECHO object with typename org.dxos.type.sheet persisted in the user\'s space.\n req F-1.2: Cells are stored in a sparse map keyed by internal row/column indices.\n req F-1.3: Row and column order is maintained via ordered index arrays; insertion/deletion preserves existing cell references.\n req F-1.4: Range-based formatting annotations are stored as a flat array on the Sheet object.\n```\n\n```mdl\nfeat F-2: Formula Evaluation\n\n req F-2.1: Formulas are prefixed with "=" and evaluated by the HyperFormula engine via the ComputeGraph.\n req F-2.2: Over 400 built-in functions are available (arithmetic, statistical, text, date/time, financial, logical).\n req F-2.3:\n when: a cell value changes\n then: all dependent formula cells are recomputed reactively\n req F-2.4: Cell references in stored formulas are translated to internal indices; A1-notation is converted on read/write.\n```\n\n```mdl\nfeat F-3: Row and Column Management\n\n req F-3.1:\n when: op:insertAxis is called\n then: a new row or column is inserted at the specified index; existing cells shift accordingly\n\n req F-3.2:\n when: op:dropAxis is called\n then: the row or column is removed and undo data returned; op:restoreAxis reverses the operation\n\n req F-3.3: Row and column sizes are persisted in rowMeta/columnMeta; absent size means default grid size.\n```\n\n```mdl\nfeat F-4: Cell Formatting\n\n req F-4.1: Ranges support alignment values: start | center | end.\n req F-4.2: Ranges support comment annotations displayed as a visual overlay on the cell.\n req F-4.3: Ranges support style values: highlight | softwrap.\n req F-4.4: RangeList in the object-properties surface allows users to view and manage range annotations.\n```\n\n```mdl\nfeat F-5: Collaborative Editing\n\n req F-5.1: All cell edits are written through ECHO and replicated to peers in real time.\n req F-5.2:\n when: a peer writes a cell value\n then: the local grid re-renders with the updated value without full reload\n\n req F-5.3: ComputeGraphRegistry manages per-space HyperFormula instances so all peers share the same formula graph.\n```\n\n```mdl\nfeat F-6: Markdown Integration\n\n req F-6.1: SheetPlugin contributes a CodeMirror extension to plugin-markdown via MarkdownCapabilities.ExtensionProvider.\n req F-6.2:\n when: the extension is active in a document that belongs to a space\n then: formula references inside Markdown fenced code blocks resolve against the space\'s ComputeGraph\n```\n\n```mdl\nfeat F-7: Anchor Navigation\n\n req F-7.1:\n when: op:scrollToAnchor is invoked with a sheet attendable ID and cursor\n then: the corresponding SheetArticle scrolls to the target cell and applies the active-ref highlight\n\n req F-7.2: AnchorSort contributes a sort comparator so sheet anchors appear in canonical order in navigation menus.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create sheet and enter a value\n given: a new Sheet is created in a space\n when: user types "42" into cell A1\n then:\n - Sheet.cells contains an entry for the A1 index with value 42\n - grid displays "42" in the A1 cell\n```\n\n```mdl\ntest T-2: Formula evaluation\n given: A1 = 10, A2 = 20\n when: user enters "=A1+A2" in A3\n then:\n - A3 displays 30\n - changing A1 to 15 causes A3 to update to 35\n```\n\n```mdl\ntest T-3: Insert and drop row\n given: a Sheet with values in rows 1 and 2\n when: op:insertAxis runs with axis=row, index=1\n then:\n - a blank row is inserted between existing rows 1 and 2\n - existing cell references remain valid\n\n when: op:dropAxis runs on the inserted row\n then:\n - the row is removed\n - op:restoreAxis re-inserts the row with its original values\n```\n\n```mdl\ntest T-4: Range formatting\n given: a Sheet open in SheetArticle\n when: user applies "highlight" style to range B2:C4\n then:\n - Sheet.ranges contains an entry with range="B2:C4", key="style", value="highlight"\n - cells in B2:C4 render with the highlight background class\n```\n\n```mdl\ntest T-5: Real-time collaboration\n given: two peers have the same Sheet open\n when: peer A sets cell D5 to "hello"\n then:\n - peer B\'s grid displays "hello" in D5 without reload\n```\n\n```mdl\ntest T-6: Scroll to anchor\n given: a SheetArticle is mounted with attendableId "sheet-1"\n when: op:scrollToAnchor runs with subject="sheet-1", cursor="E10"\n then:\n - the grid scrolls so that E10 is visible\n - E10 is highlighted via activeRefs\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n';
|
|
15
|
+
|
|
16
|
+
// src/SheetPlugin.tsx
|
|
17
|
+
var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
|
|
18
|
+
activate: AppGraphBuilder
|
|
19
|
+
}), AppPlugin.addNavigationResolverModule({
|
|
20
|
+
activate: NavigationResolver
|
|
21
|
+
}), AppPlugin.addCommentConfigModule({
|
|
22
|
+
activate: CommentConfig
|
|
23
|
+
}), AppPlugin.addCreateObjectModule({
|
|
24
|
+
activate: CreateObject
|
|
25
|
+
}), AppPlugin.addOperationHandlerModule({
|
|
26
|
+
activate: OperationHandler
|
|
27
|
+
}), AppPlugin.addUndoMappingsModule({
|
|
28
|
+
activate: UndoMappings
|
|
29
|
+
}), AppPlugin.addSchemaModule({
|
|
30
|
+
schema: [
|
|
31
|
+
Sheet.Sheet
|
|
32
|
+
]
|
|
33
|
+
}), AppPlugin.addSurfaceModule({
|
|
34
|
+
activate: ReactSurface
|
|
35
|
+
}), AppPlugin.addTranslationsModule({
|
|
36
|
+
translations
|
|
37
|
+
}), Plugin.addModule({
|
|
38
|
+
activatesOn: AppActivationEvents.SetupSettings,
|
|
39
|
+
activate: SheetState
|
|
40
|
+
}), Plugin.addModule({
|
|
41
|
+
activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, ActivationEvents.ProcessManagerReady),
|
|
42
|
+
activate: ComputeGraphRegistry
|
|
43
|
+
}), Plugin.addModule({
|
|
44
|
+
activatesOn: MarkdownEvents.SetupExtensions,
|
|
45
|
+
activate: Markdown
|
|
46
|
+
}), Plugin.addModule({
|
|
47
|
+
// TODO(wittjosiah): More relevant event?
|
|
48
|
+
activatesOn: AppActivationEvents.AppGraphReady,
|
|
49
|
+
activate: AnchorSort
|
|
50
|
+
}), AppPlugin.addPluginAssetModule({
|
|
51
|
+
asset: {
|
|
52
|
+
pluginId: meta.id,
|
|
53
|
+
path: "PLUGIN.mdl",
|
|
54
|
+
content: PLUGIN_default,
|
|
55
|
+
mimeType: "application/x-mdl"
|
|
56
|
+
}
|
|
57
|
+
}), Plugin.make);
|
|
58
|
+
var SheetPlugin_default = SheetPlugin;
|
|
59
|
+
export {
|
|
60
|
+
SheetPlugin,
|
|
61
|
+
SheetPlugin_default as default
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=SheetPlugin.mjs.map
|