@dxos/plugin-sheet 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
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/dist/lib/neutral/RangeList-HYB5S6KQ.mjs +46 -0
- package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +7 -0
- package/dist/lib/neutral/SheetContainer-ZOVKGHLT.mjs +33 -0
- package/dist/lib/neutral/SheetContainer-ZOVKGHLT.mjs.map +7 -0
- package/dist/lib/neutral/SheetPlugin.mjs +48 -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/anchor-sort-TTCKGX7V.mjs +22 -0
- package/dist/lib/neutral/anchor-sort-TTCKGX7V.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +25 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4GWJDLTH.mjs +83 -0
- package/dist/lib/neutral/chunk-4GWJDLTH.mjs.map +7 -0
- package/dist/lib/{browser/chunk-SSN4HYJL.mjs → neutral/chunk-4SBAIU6F.mjs} +19 -19
- package/dist/lib/neutral/chunk-4SBAIU6F.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-KC2SMDNF.mjs +373 -0
- package/dist/lib/neutral/chunk-KC2SMDNF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YFHTB6MX.mjs +8 -0
- package/dist/lib/neutral/chunk-YFHTB6MX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZWOQCLH7.mjs +21 -0
- package/dist/lib/neutral/chunk-ZWOQCLH7.mjs.map +7 -0
- package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs +20 -0
- package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1551 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs +20 -0
- package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +11 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-OKQAXJCW.mjs +27 -0
- package/dist/lib/neutral/create-object-OKQAXJCW.mjs.map +7 -0
- package/dist/lib/neutral/drop-axis-G6UOXG54.mjs +23 -0
- package/dist/lib/neutral/drop-axis-G6UOXG54.mjs.map +7 -0
- package/dist/lib/{node-esm/types → neutral}/index.mjs +16 -13
- package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs +16 -0
- package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs.map +7 -0
- package/dist/lib/neutral/markdown-I2AKJYPF.mjs +28 -0
- package/dist/lib/neutral/markdown-I2AKJYPF.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs +13 -0
- package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-ID4JCAFR.mjs +44 -0
- package/dist/lib/neutral/react-surface-ID4JCAFR.mjs.map +7 -0
- package/dist/lib/neutral/restore-axis-44DM6N54.mjs +16 -0
- package/dist/lib/neutral/restore-axis-44DM6N54.mjs.map +7 -0
- package/dist/lib/neutral/scroll-to-anchor-WHX3HJC7.mjs +33 -0
- package/dist/lib/neutral/scroll-to-anchor-WHX3HJC7.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 +55 -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/capabilities/anchor-sort.d.ts +4 -4
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
- package/dist/types/src/capabilities/comment-config.d.ts +12 -0
- package/dist/types/src/capabilities/comment-config.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry.d.ts +3 -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 +23 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +3 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- 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 +0 -1
- 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/{GridSheet → SheetContent}/SheetCellEditor.stories.d.ts +2 -3
- 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 +73 -68
- 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/SheetContainer/SheetContainer.d.ts +12 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts.map +1 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts +92 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SheetContainer/index.d.ts +2 -0
- package/dist/types/src/containers/SheetContainer/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 +1 -1
- package/dist/types/src/extensions/compute.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.stories.d.ts +2 -3
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/editor/sheet-extension.d.ts +1 -1
- package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts +1 -3
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +7 -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/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 +76 -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 +131 -81
- package/src/SheetPlugin.node.ts +21 -0
- package/src/SheetPlugin.test.ts +30 -0
- package/src/SheetPlugin.tsx +46 -68
- package/src/capabilities/anchor-sort.ts +20 -15
- package/src/capabilities/comment-config.ts +24 -0
- package/src/capabilities/compute-graph-registry.ts +21 -20
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +16 -8
- package/src/capabilities/markdown.ts +21 -13
- 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 +23 -22
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.tsx +18 -15
- package/src/components/SheetContent/SheetContent.stories.tsx +60 -0
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +84 -54
- 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} +19 -7
- package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +11 -8
- package/src/components/SheetToolbar/SheetToolbar.tsx +51 -46
- 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/SheetContainer/SheetContainer.stories.tsx +110 -0
- package/src/containers/SheetContainer/SheetContainer.tsx +57 -0
- package/src/containers/SheetContainer/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/extensions/compute.stories.tsx +38 -25
- package/src/extensions/compute.ts +2 -2
- package/src/extensions/editor/sheet-extension.test.ts +1 -1
- package/src/extensions/editor/sheet-extension.ts +18 -15
- package/src/index.ts +2 -2
- package/src/integrations/thread-ranges.ts +19 -61
- package/src/meta.ts +9 -7
- package/src/model/sheet-model.test.ts +6 -6
- package/src/model/sheet-model.ts +82 -50
- 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/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 +5 -3
- package/src/serializer.ts +5 -5
- package/src/testing/data.ts +2 -2
- package/src/testing/testing.tsx +13 -7
- package/src/translations.ts +42 -36
- package/src/types/Sheet.ts +103 -0
- package/src/types/SheetCapabilities.ts +26 -0
- package/src/types/SheetOperation.ts +75 -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 +12 -39
- package/dist/lib/browser/SheetContainer-OUN6AARA.mjs +0 -350
- package/dist/lib/browser/SheetContainer-OUN6AARA.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-7WD2VGXW.mjs +0 -24
- package/dist/lib/browser/anchor-sort-7WD2VGXW.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-KJWZUQVA.mjs +0 -15
- package/dist/lib/browser/chunk-KJWZUQVA.mjs.map +0 -7
- package/dist/lib/browser/chunk-SSN4HYJL.mjs.map +0 -7
- package/dist/lib/browser/chunk-X4EWLDT3.mjs +0 -851
- package/dist/lib/browser/chunk-X4EWLDT3.mjs.map +0 -7
- package/dist/lib/browser/chunk-XSXUU6FO.mjs +0 -906
- package/dist/lib/browser/chunk-XSXUU6FO.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-ROEY4LHM.mjs +0 -56
- package/dist/lib/browser/intent-resolver-ROEY4LHM.mjs.map +0 -7
- package/dist/lib/browser/markdown-VOY636TS.mjs +0 -26
- package/dist/lib/browser/markdown-VOY636TS.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-XCNAVF2M.mjs +0 -53
- package/dist/lib/browser/react-surface-XCNAVF2M.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-NFLLTGNV.mjs +0 -351
- package/dist/lib/node-esm/SheetContainer-NFLLTGNV.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-ACQDUIPU.mjs +0 -25
- package/dist/lib/node-esm/anchor-sort-ACQDUIPU.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-IK4O7FUJ.mjs +0 -236
- package/dist/lib/node-esm/chunk-IK4O7FUJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ODP4L4OV.mjs +0 -907
- package/dist/lib/node-esm/chunk-ODP4L4OV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PYF4ZJXN.mjs +0 -852
- package/dist/lib/node-esm/chunk-PYF4ZJXN.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-HESRI2ML.mjs +0 -57
- package/dist/lib/node-esm/intent-resolver-HESRI2ML.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-P4CLZ24C.mjs +0 -27
- package/dist/lib/node-esm/markdown-P4CLZ24C.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-KE3EEVF4.mjs +0 -54
- package/dist/lib/node-esm/react-surface-KE3EEVF4.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/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 -54
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
- 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 -55
- 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/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/components/GridSheet/GridSheet.stories.tsx +0 -56
- package/src/components/RangeList/RangeList.tsx +0 -60
- package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -92
- 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
|
@@ -8,13 +8,15 @@ import React, {
|
|
|
8
8
|
type MouseEvent,
|
|
9
9
|
type WheelEvent,
|
|
10
10
|
useCallback,
|
|
11
|
+
useEffect,
|
|
11
12
|
useMemo,
|
|
12
13
|
useRef,
|
|
13
14
|
useState,
|
|
14
15
|
} from 'react';
|
|
15
16
|
|
|
16
|
-
import {
|
|
17
|
-
import { type CellRange, rangeToA1Notation } from '@dxos/compute';
|
|
17
|
+
import { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
18
|
+
import { type CellRange, rangeToA1Notation } from '@dxos/compute-hyperformula';
|
|
19
|
+
import { Obj } from '@dxos/echo';
|
|
18
20
|
import { defaultColSize, defaultRowSize } from '@dxos/lit-grid';
|
|
19
21
|
import { DropdownMenu, Icon, useTranslation } from '@dxos/react-ui';
|
|
20
22
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
@@ -31,13 +33,15 @@ import {
|
|
|
31
33
|
editorKeys,
|
|
32
34
|
parseCellIndex,
|
|
33
35
|
} from '@dxos/react-ui-grid';
|
|
36
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
34
37
|
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import { DEFAULT_COLS, DEFAULT_ROWS, SheetAction } from '../../types';
|
|
39
|
-
import { useSheetContext } from '../SheetContext';
|
|
38
|
+
import { meta } from '#meta';
|
|
39
|
+
import { SheetOperation } from '#types';
|
|
40
|
+
import { DEFAULT_COLS, DEFAULT_ROWS, SheetCapabilities } from '#types';
|
|
40
41
|
|
|
42
|
+
import { type RangeController, rangeExtension, sheetExtension } from '../../extensions';
|
|
43
|
+
import { useSelectThreadOnCellFocus } from '../../integrations';
|
|
44
|
+
import { useSheetContext } from '../SheetRoot';
|
|
41
45
|
import { colLabelCell, rowLabelCell, useSheetModelDxGridProps } from './util';
|
|
42
46
|
|
|
43
47
|
const inertPosition: DxGridPosition = { plane: 'grid', col: 0, row: 0 };
|
|
@@ -68,16 +72,30 @@ const sheetRowDefault = {
|
|
|
68
72
|
grid: { size: defaultRowSize, resizeable: true },
|
|
69
73
|
};
|
|
70
74
|
|
|
71
|
-
export
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
export type SheetContentProps = {};
|
|
76
|
+
|
|
77
|
+
export const SheetContent = composable<HTMLDivElement, SheetContentProps>((props, forwardedRef) => {
|
|
78
|
+
const { t } = useTranslation(meta.id);
|
|
79
|
+
const {
|
|
80
|
+
id,
|
|
81
|
+
attendableId,
|
|
82
|
+
model,
|
|
83
|
+
editing,
|
|
84
|
+
setCursor,
|
|
85
|
+
setRange,
|
|
86
|
+
cursor,
|
|
87
|
+
cursorFallbackRange,
|
|
88
|
+
activeRefs,
|
|
89
|
+
setActiveRefs,
|
|
90
|
+
ignoreAttention,
|
|
91
|
+
} = useSheetContext();
|
|
92
|
+
|
|
75
93
|
// NOTE(thure): using `useState` instead of `useRef` works with refs provided by `@lit/react` and gives us
|
|
76
94
|
// a reliable dependency for `useEffect` whereas `useLayoutEffect` does not guarantee the element will be defined.
|
|
77
95
|
const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);
|
|
78
96
|
const [extraplanarFocus, setExtraplanarFocus] = useState<DxGridPosition | null>(null);
|
|
79
|
-
const {
|
|
80
|
-
const rangeController = useRef<RangeController>();
|
|
97
|
+
const { invokePromise } = useOperationInvoker();
|
|
98
|
+
const rangeController = useRef<RangeController>(null);
|
|
81
99
|
const { hasAttention } = useAttention(id);
|
|
82
100
|
|
|
83
101
|
const handleFocus = useCallback(
|
|
@@ -127,15 +145,17 @@ export const GridSheet = () => {
|
|
|
127
145
|
|
|
128
146
|
const handleAxisResize = useCallback<NonNullable<GridContentProps['onAxisResize']>>(
|
|
129
147
|
({ axis, size, index: numericIndex }) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
148
|
+
Obj.update(model.sheet, (sheet) => {
|
|
149
|
+
if (axis === 'row') {
|
|
150
|
+
const rowId = sheet.rows[parseInt(numericIndex)];
|
|
151
|
+
sheet.rowMeta[rowId] ??= {};
|
|
152
|
+
sheet.rowMeta[rowId].size = size;
|
|
153
|
+
} else {
|
|
154
|
+
const columnId = sheet.columns[parseInt(numericIndex)];
|
|
155
|
+
sheet.columnMeta[columnId] ??= {};
|
|
156
|
+
sheet.columnMeta[columnId].size = size;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
139
159
|
},
|
|
140
160
|
[model],
|
|
141
161
|
);
|
|
@@ -172,12 +192,20 @@ export const GridSheet = () => {
|
|
|
172
192
|
case 'frozenRowsStart':
|
|
173
193
|
return dxGrid?.setSelection({
|
|
174
194
|
start: { col: pos.col, row: 0, plane: 'grid' },
|
|
175
|
-
end: {
|
|
195
|
+
end: {
|
|
196
|
+
col: pos.col,
|
|
197
|
+
row: model.sheet.rows.length - 1,
|
|
198
|
+
plane: 'grid',
|
|
199
|
+
},
|
|
176
200
|
});
|
|
177
201
|
case 'frozenColsStart':
|
|
178
202
|
return dxGrid?.setSelection({
|
|
179
203
|
start: { row: pos.row, col: 0, plane: 'grid' },
|
|
180
|
-
end: {
|
|
204
|
+
end: {
|
|
205
|
+
row: pos.row,
|
|
206
|
+
col: model.sheet.columns.length - 1,
|
|
207
|
+
plane: 'grid',
|
|
208
|
+
},
|
|
181
209
|
});
|
|
182
210
|
}
|
|
183
211
|
},
|
|
@@ -257,31 +285,30 @@ export const GridSheet = () => {
|
|
|
257
285
|
switch (operation) {
|
|
258
286
|
case 'insert-before':
|
|
259
287
|
case 'insert-after':
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}),
|
|
266
|
-
);
|
|
288
|
+
return invokePromise(SheetOperation.InsertAxis, {
|
|
289
|
+
model,
|
|
290
|
+
axis: contextMenuAxis,
|
|
291
|
+
index: contextMenuOpen![contextMenuAxis] + (operation === 'insert-before' ? 0 : 1),
|
|
292
|
+
});
|
|
267
293
|
case 'drop':
|
|
268
|
-
return
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}),
|
|
274
|
-
);
|
|
294
|
+
return invokePromise(SheetOperation.DropAxis, {
|
|
295
|
+
model,
|
|
296
|
+
axis: contextMenuAxis,
|
|
297
|
+
axisIndex: model.sheet[contextMenuAxis === 'row' ? 'rows' : 'columns'][contextMenuOpen![contextMenuAxis]],
|
|
298
|
+
});
|
|
275
299
|
}
|
|
276
300
|
},
|
|
277
|
-
[contextMenuAxis, contextMenuOpen, model,
|
|
301
|
+
[contextMenuAxis, contextMenuOpen, model, invokePromise],
|
|
278
302
|
);
|
|
279
303
|
|
|
280
304
|
const { columns, rows } = useSheetModelDxGridProps(dxGrid, model);
|
|
281
305
|
|
|
282
306
|
const extensions = useMemo(
|
|
283
307
|
() => [
|
|
284
|
-
editorKeys({
|
|
308
|
+
editorKeys({
|
|
309
|
+
onClose: handleClose,
|
|
310
|
+
...(editing?.initialContent && { onNav: handleClose }),
|
|
311
|
+
}),
|
|
285
312
|
sheetExtension({ functions: model.graph.getFunctions() }),
|
|
286
313
|
rangeExtension({
|
|
287
314
|
onInit: (fn) => (rangeController.current = fn),
|
|
@@ -303,23 +330,31 @@ export const GridSheet = () => {
|
|
|
303
330
|
[model],
|
|
304
331
|
);
|
|
305
332
|
|
|
306
|
-
|
|
333
|
+
const [gridInstances] = useCapabilities(SheetCapabilities.GridInstances);
|
|
334
|
+
useEffect(() => {
|
|
335
|
+
if (dxGrid && gridInstances) {
|
|
336
|
+
gridInstances.register(attendableId, dxGrid, setActiveRefs);
|
|
337
|
+
return () => gridInstances.unregister(attendableId);
|
|
338
|
+
}
|
|
339
|
+
}, [dxGrid, gridInstances, attendableId, setActiveRefs]);
|
|
340
|
+
|
|
307
341
|
useSelectThreadOnCellFocus();
|
|
308
342
|
|
|
309
343
|
return (
|
|
310
|
-
|
|
311
|
-
<div role='none' className='relative min-bs-0 [&_.cm-editor]:!border-lb [&_.cm-editor]:!border-transparent '>
|
|
344
|
+
<div ref={forwardedRef} {...composableProps(props, { classNames: 'relative min-h-0' })}>
|
|
312
345
|
<GridCellEditor getCellContent={getCellContent} extensions={extensions} onBlur={handleBlur} />
|
|
313
346
|
<Grid.Content
|
|
347
|
+
className='[--dx-grid-base:var(--base-surface)] [&_.dx-grid]:absolute [&_.dx-grid]:inset-0'
|
|
314
348
|
initialCells={initialCells}
|
|
315
349
|
limitColumns={DEFAULT_COLS}
|
|
316
350
|
limitRows={DEFAULT_ROWS}
|
|
317
351
|
columns={columns}
|
|
318
352
|
rows={rows}
|
|
319
|
-
// TODO(burdon): `col` vs. `column`?
|
|
320
353
|
columnDefault={sheetColDefault}
|
|
321
354
|
rowDefault={sheetRowDefault}
|
|
355
|
+
activeRefs={activeRefs}
|
|
322
356
|
frozen={frozen}
|
|
357
|
+
overscroll='trap'
|
|
323
358
|
onAxisResize={handleAxisResize}
|
|
324
359
|
onSelect={handleSelect}
|
|
325
360
|
onFocus={handleFocus}
|
|
@@ -327,9 +362,6 @@ export const GridSheet = () => {
|
|
|
327
362
|
onKeyDown={handleKeyDown}
|
|
328
363
|
onContextMenu={handleContextMenu}
|
|
329
364
|
onClick={handleClick}
|
|
330
|
-
overscroll='trap'
|
|
331
|
-
className='[--dx-grid-base:var(--baseSurface)] [&_.dx-grid]:absolute [&_.dx-grid]:inset-0'
|
|
332
|
-
activeRefs={activeRefs}
|
|
333
365
|
ref={setDxGrid}
|
|
334
366
|
/>
|
|
335
367
|
<DropdownMenu.Root
|
|
@@ -345,27 +377,25 @@ export const GridSheet = () => {
|
|
|
345
377
|
data-testid={`grid.${contextMenuAxis}.insert-before`}
|
|
346
378
|
>
|
|
347
379
|
<Icon
|
|
348
|
-
size={5}
|
|
349
380
|
icon={contextMenuAxis === 'col' ? 'ph--columns-plus-left--regular' : 'ph--rows-plus-top--regular'}
|
|
350
381
|
/>
|
|
351
|
-
<span>{t(`add
|
|
382
|
+
<span>{t(`add-${contextMenuAxis}-before.label`)}</span>
|
|
352
383
|
</DropdownMenu.Item>
|
|
353
384
|
<DropdownMenu.Item
|
|
354
385
|
onClick={() => handleAxisMenuAction('insert-after')}
|
|
355
386
|
data-testid={`grid.${contextMenuAxis}.insert-after`}
|
|
356
387
|
>
|
|
357
388
|
<Icon
|
|
358
|
-
size={5}
|
|
359
389
|
icon={contextMenuAxis === 'col' ? 'ph--columns-plus-right--regular' : 'ph--rows-plus-bottom--regular'}
|
|
360
390
|
/>
|
|
361
|
-
<span>{t(`add
|
|
391
|
+
<span>{t(`add-${contextMenuAxis}-after.label`)}</span>
|
|
362
392
|
</DropdownMenu.Item>
|
|
363
393
|
<DropdownMenu.Item
|
|
364
394
|
onClick={() => handleAxisMenuAction('drop')}
|
|
365
395
|
data-testid={`grid.${contextMenuAxis}.drop`}
|
|
366
396
|
>
|
|
367
|
-
<Icon
|
|
368
|
-
<span>{t(`delete
|
|
397
|
+
<Icon icon='ph--backspace--regular' />
|
|
398
|
+
<span>{t(`delete-${contextMenuAxis}.label`)}</span>
|
|
369
399
|
</DropdownMenu.Item>
|
|
370
400
|
</DropdownMenu.Viewport>
|
|
371
401
|
<DropdownMenu.Arrow />
|
|
@@ -373,4 +403,4 @@ export const GridSheet = () => {
|
|
|
373
403
|
</DropdownMenu.Root>
|
|
374
404
|
</div>
|
|
375
405
|
);
|
|
376
|
-
};
|
|
406
|
+
});
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { inRange } from '@dxos/compute';
|
|
8
|
-
import { createDocAccessor } from '@dxos/
|
|
7
|
+
import { inRange } from '@dxos/compute-hyperformula';
|
|
8
|
+
import { createDocAccessor } from '@dxos/echo-db';
|
|
9
9
|
import { cellClassesForFieldType, parseValue } from '@dxos/react-ui-form';
|
|
10
10
|
import {
|
|
11
11
|
type DxGridAxisMeta,
|
|
@@ -19,16 +19,20 @@ import {
|
|
|
19
19
|
commentedClassName,
|
|
20
20
|
rowToA1Notation,
|
|
21
21
|
} from '@dxos/react-ui-grid';
|
|
22
|
-
import { mx } from '@dxos/
|
|
22
|
+
import { mx } from '@dxos/ui-theme';
|
|
23
|
+
|
|
24
|
+
import { cellClassNameForRange, rangeFromIndex } from '#types';
|
|
23
25
|
|
|
24
26
|
import { type SheetModel } from '../../model';
|
|
25
|
-
import { cellClassNameForRange, rangeFromIndex } from '../../types';
|
|
26
27
|
|
|
27
28
|
const createDxGridColumns = (model: SheetModel): DxGridAxisMeta => {
|
|
28
29
|
return model.sheet.columns.reduce(
|
|
29
30
|
(acc: DxGridAxisMeta, columnId, numericIndex) => {
|
|
30
31
|
if (model.sheet.columnMeta[columnId] && model.sheet.columnMeta[columnId].size) {
|
|
31
|
-
acc.grid[numericIndex] = {
|
|
32
|
+
acc.grid[numericIndex] = {
|
|
33
|
+
size: model.sheet.columnMeta[columnId].size,
|
|
34
|
+
resizeable: true,
|
|
35
|
+
};
|
|
32
36
|
}
|
|
33
37
|
return acc;
|
|
34
38
|
},
|
|
@@ -40,7 +44,10 @@ const createDxGridRows = (model: SheetModel): DxGridAxisMeta => {
|
|
|
40
44
|
return model.sheet.rows.reduce(
|
|
41
45
|
(acc: DxGridAxisMeta, rowId, numericIndex) => {
|
|
42
46
|
if (model.sheet.rowMeta[rowId] && model.sheet.rowMeta[rowId].size) {
|
|
43
|
-
acc.grid[numericIndex] = {
|
|
47
|
+
acc.grid[numericIndex] = {
|
|
48
|
+
size: model.sheet.rowMeta[rowId].size,
|
|
49
|
+
resizeable: true,
|
|
50
|
+
};
|
|
44
51
|
}
|
|
45
52
|
return acc;
|
|
46
53
|
},
|
|
@@ -59,7 +66,7 @@ const projectCellProps = (model: SheetModel, col: number, row: number): DxGridCe
|
|
|
59
66
|
// const range = thread.target?.anchor && parseThreadAnchorAsCellRange(thread.target!.anchor);
|
|
60
67
|
// return thread && range ? inRange(range, address) : false;
|
|
61
68
|
// })
|
|
62
|
-
// .map((thread) =>
|
|
69
|
+
// .map((thread) => Obj.getDXN(thread!).toString())
|
|
63
70
|
// .join(' ');
|
|
64
71
|
|
|
65
72
|
const description = model.getValueDescription(address);
|
|
@@ -90,13 +97,13 @@ const gridCellGetter = (model: SheetModel) => {
|
|
|
90
97
|
|
|
91
98
|
export const rowLabelCell = (row: number) => ({
|
|
92
99
|
value: rowToA1Notation(row),
|
|
93
|
-
className: '!bg-
|
|
100
|
+
className: '!bg-toolbar-surface text-subdued text-end pe-1',
|
|
94
101
|
resizeHandle: 'row',
|
|
95
102
|
});
|
|
96
103
|
|
|
97
104
|
export const colLabelCell = (col: number) => ({
|
|
98
105
|
value: colToA1Notation(col),
|
|
99
|
-
className: '!bg-
|
|
106
|
+
className: '!bg-toolbar-surface text-subdued',
|
|
100
107
|
resizeHandle: 'col',
|
|
101
108
|
});
|
|
102
109
|
|
|
@@ -108,7 +115,7 @@ const cellGetter = (model: SheetModel) => {
|
|
|
108
115
|
return getGridCells(nextBounds);
|
|
109
116
|
case 'fixedStartStart': {
|
|
110
117
|
return {
|
|
111
|
-
'0,0': { className: '!bg-
|
|
118
|
+
'0,0': { className: '!bg-toolbar-surface' },
|
|
112
119
|
};
|
|
113
120
|
}
|
|
114
121
|
case 'frozenColsStart':
|
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import {
|
|
8
|
+
type CellAddress,
|
|
9
|
+
type CellRange,
|
|
10
|
+
type CompleteCellRange,
|
|
11
|
+
type ComputeGraph,
|
|
12
|
+
} from '@dxos/compute-hyperformula';
|
|
13
|
+
import { raise } from '@dxos/debug';
|
|
10
14
|
import {
|
|
11
15
|
Grid,
|
|
12
16
|
type GridContentProps,
|
|
@@ -15,12 +19,13 @@ import {
|
|
|
15
19
|
useGridContext,
|
|
16
20
|
} from '@dxos/react-ui-grid';
|
|
17
21
|
|
|
22
|
+
import { type Sheet } from '#types';
|
|
23
|
+
|
|
18
24
|
import { type SheetModel, useSheetModel } from '../../model';
|
|
19
|
-
import { type SheetType } from '../../types';
|
|
20
25
|
|
|
21
26
|
export type SheetContextValue = {
|
|
22
27
|
id: string;
|
|
23
|
-
|
|
28
|
+
attendableId: string;
|
|
24
29
|
model: SheetModel;
|
|
25
30
|
|
|
26
31
|
// Cursor state.
|
|
@@ -39,29 +44,62 @@ export type SheetContextValue = {
|
|
|
39
44
|
activeRefs: GridContentProps['activeRefs'];
|
|
40
45
|
setActiveRefs: (activeRefs: GridContentProps['activeRefs']) => void;
|
|
41
46
|
|
|
47
|
+
// Flags
|
|
48
|
+
ignoreAttention?: boolean;
|
|
49
|
+
|
|
42
50
|
// Events.
|
|
43
51
|
// TODO(burdon): Generalize.
|
|
44
52
|
onInfo?: () => void;
|
|
45
|
-
|
|
46
|
-
// Flags
|
|
47
|
-
ignoreAttention?: boolean;
|
|
48
53
|
};
|
|
49
54
|
|
|
55
|
+
// TODO(burdon): Use radix context.
|
|
50
56
|
const SheetContext = createContext<SheetContextValue | undefined>(undefined);
|
|
51
57
|
|
|
52
58
|
export const useSheetContext = (): SheetContextValue => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
return useContext(SheetContext) ?? raise(new Error('Missing SheetContext'));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type SheetRootProps = {
|
|
63
|
+
graph: ComputeGraph;
|
|
64
|
+
sheet: Sheet.Sheet;
|
|
65
|
+
attendableId: string;
|
|
66
|
+
readonly?: boolean;
|
|
67
|
+
ignoreAttention?: boolean;
|
|
68
|
+
} & Pick<SheetContextValue, 'onInfo'>;
|
|
69
|
+
|
|
70
|
+
export const SheetRoot = ({
|
|
71
|
+
children,
|
|
72
|
+
graph,
|
|
73
|
+
sheet,
|
|
74
|
+
attendableId,
|
|
75
|
+
readonly,
|
|
76
|
+
ignoreAttention,
|
|
77
|
+
onInfo,
|
|
78
|
+
}: PropsWithChildren<SheetRootProps>) => {
|
|
79
|
+
const model = useSheetModel(graph, sheet, { readonly });
|
|
80
|
+
if (!model) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<Grid.Root id={attendableId}>
|
|
86
|
+
<SheetProviderImpl model={model} attendableId={attendableId} onInfo={onInfo} ignoreAttention={ignoreAttention}>
|
|
87
|
+
{children}
|
|
88
|
+
</SheetProviderImpl>
|
|
89
|
+
</Grid.Root>
|
|
90
|
+
);
|
|
56
91
|
};
|
|
57
92
|
|
|
58
93
|
const SheetProviderImpl = ({
|
|
94
|
+
__gridScope,
|
|
95
|
+
children,
|
|
96
|
+
attendableId,
|
|
97
|
+
ignoreAttention,
|
|
59
98
|
model,
|
|
60
99
|
onInfo,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}: GridScopedProps<PropsWithChildren<Pick<SheetContextValue, 'onInfo' | 'model' | 'ignoreAttention'>>>) => {
|
|
100
|
+
}: GridScopedProps<
|
|
101
|
+
PropsWithChildren<Pick<SheetContextValue, 'attendableId' | 'ignoreAttention' | 'model' | 'onInfo'>>
|
|
102
|
+
>) => {
|
|
65
103
|
const { id, editing, setEditing } = useGridContext('SheetProvider', __gridScope);
|
|
66
104
|
|
|
67
105
|
const [cursor, setCursorInternal] = useState<CellAddress>();
|
|
@@ -92,6 +130,7 @@ const SheetProviderImpl = ({
|
|
|
92
130
|
<SheetContext.Provider
|
|
93
131
|
value={{
|
|
94
132
|
id,
|
|
133
|
+
attendableId,
|
|
95
134
|
model,
|
|
96
135
|
editing,
|
|
97
136
|
setEditing,
|
|
@@ -102,38 +141,12 @@ const SheetProviderImpl = ({
|
|
|
102
141
|
cursorFallbackRange,
|
|
103
142
|
activeRefs,
|
|
104
143
|
setActiveRefs,
|
|
144
|
+
ignoreAttention,
|
|
105
145
|
// TODO(burdon): Change to event.
|
|
106
146
|
onInfo,
|
|
107
|
-
ignoreAttention,
|
|
108
147
|
}}
|
|
109
148
|
>
|
|
110
149
|
{children}
|
|
111
150
|
</SheetContext.Provider>
|
|
112
151
|
);
|
|
113
152
|
};
|
|
114
|
-
|
|
115
|
-
export type SheetProviderProps = {
|
|
116
|
-
graph: ComputeGraph;
|
|
117
|
-
sheet: SheetType;
|
|
118
|
-
readonly?: boolean;
|
|
119
|
-
ignoreAttention?: boolean;
|
|
120
|
-
} & Pick<SheetContextValue, 'onInfo'>;
|
|
121
|
-
|
|
122
|
-
export const SheetProvider = ({
|
|
123
|
-
children,
|
|
124
|
-
graph,
|
|
125
|
-
sheet,
|
|
126
|
-
readonly,
|
|
127
|
-
ignoreAttention,
|
|
128
|
-
onInfo,
|
|
129
|
-
}: PropsWithChildren<SheetProviderProps>) => {
|
|
130
|
-
const model = useSheetModel(graph, sheet, { readonly });
|
|
131
|
-
|
|
132
|
-
return !model ? null : (
|
|
133
|
-
<Grid.Root id={fullyQualifiedId(sheet)}>
|
|
134
|
-
<SheetProviderImpl model={model} onInfo={onInfo} ignoreAttention={ignoreAttention}>
|
|
135
|
-
{children}
|
|
136
|
-
</SheetProviderImpl>
|
|
137
|
-
</Grid.Root>
|
|
138
|
-
);
|
|
139
|
-
};
|
package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx}
RENAMED
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { addressToA1Notation, isFormula, rangeToA1Notation } from '@dxos/compute';
|
|
7
|
+
import { addressToA1Notation, isFormula, rangeToA1Notation } from '@dxos/compute-hyperformula';
|
|
8
8
|
import { Icon } from '@dxos/react-ui';
|
|
9
|
+
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
9
10
|
|
|
10
|
-
import { mapFormulaIndicesToRefs } from '
|
|
11
|
-
import { useSheetContext } from '../SheetContext';
|
|
11
|
+
import { mapFormulaIndicesToRefs } from '#types';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
import { useSheetContext } from '../SheetRoot';
|
|
14
|
+
|
|
15
|
+
export type SheetStatusbarProps = {};
|
|
16
|
+
|
|
17
|
+
export const SheetStatusbar = composable<HTMLDivElement, SheetStatusbarProps>((props, forwardedRef) => {
|
|
18
|
+
const { className, ...rest } = composableProps(props);
|
|
14
19
|
const { model, cursor, range } = useSheetContext();
|
|
15
20
|
|
|
16
21
|
let value;
|
|
@@ -26,16 +31,23 @@ export const FunctionEditor = () => {
|
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
return (
|
|
29
|
-
<div
|
|
34
|
+
<div
|
|
35
|
+
ref={forwardedRef}
|
|
36
|
+
{...rest}
|
|
37
|
+
className={mx(
|
|
38
|
+
'flex shrink-0 justify-between items-center px-4 py-1 text-sm bg-toolbar-surface border-y !border-subdued-separator',
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
>
|
|
30
42
|
<div className='flex gap-4 items-center'>
|
|
31
43
|
<div className='flex w-16 items-center font-mono'>
|
|
32
44
|
{(range && rangeToA1Notation(range)) || (cursor && addressToA1Notation(cursor))}
|
|
33
45
|
</div>
|
|
34
46
|
<div className='flex gap-2 items-center'>
|
|
35
|
-
<Icon icon='ph--function--regular' classNames={['text-
|
|
47
|
+
<Icon icon='ph--function--regular' classNames={['text-green-text', formula ? 'visible' : 'invisible']} />
|
|
36
48
|
<span className='font-mono'>{value}</span>
|
|
37
49
|
</div>
|
|
38
50
|
</div>
|
|
39
51
|
</div>
|
|
40
52
|
);
|
|
41
|
-
};
|
|
53
|
+
});
|
|
@@ -2,27 +2,30 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import { withLayout, withTheme } from '@dxos/
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
|
-
import { translations } from '
|
|
10
|
+
import { translations } from '#translations';
|
|
13
11
|
|
|
14
12
|
import { SheetToolbar } from './SheetToolbar';
|
|
15
13
|
|
|
16
14
|
const DefaultStory = () => {
|
|
17
|
-
|
|
15
|
+
// TODO(wittjosiah): Depends on SheetRoot.
|
|
16
|
+
// return <SheetToolbar id='test' />;
|
|
17
|
+
return <>TODO</>;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const meta = {
|
|
21
|
-
title: 'plugins/plugin-sheet/Toolbar',
|
|
21
|
+
title: 'plugins/plugin-sheet/components/Toolbar',
|
|
22
22
|
component: SheetToolbar as any,
|
|
23
23
|
render: DefaultStory,
|
|
24
|
-
decorators: [withTheme, withLayout()],
|
|
25
|
-
parameters: {
|
|
24
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
25
|
+
parameters: {
|
|
26
|
+
layout: 'fullscreen',
|
|
27
|
+
translations,
|
|
28
|
+
},
|
|
26
29
|
} satisfies Meta<typeof DefaultStory>;
|
|
27
30
|
|
|
28
31
|
export default meta;
|