@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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
|
|
9
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
+
import { Panel } from '@dxos/react-ui';
|
|
11
|
+
|
|
12
|
+
import { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';
|
|
13
|
+
import { type Sheet as SheetType } from '#types';
|
|
14
|
+
|
|
15
|
+
export type SheetContainerProps = AppSurface.ObjectArticleProps<
|
|
16
|
+
SheetType.Sheet,
|
|
17
|
+
{
|
|
18
|
+
space: Space;
|
|
19
|
+
registry: ComputeGraphRegistry;
|
|
20
|
+
ignoreAttention?: boolean;
|
|
21
|
+
}
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export const SheetContainer = ({ registry, ...props }: SheetContainerProps) => (
|
|
25
|
+
<ComputeGraphContextProvider registry={registry}>
|
|
26
|
+
<SheetContainerInner {...props} />
|
|
27
|
+
</ComputeGraphContextProvider>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const SheetContainerInner = ({
|
|
31
|
+
role,
|
|
32
|
+
subject: sheet,
|
|
33
|
+
attendableId,
|
|
34
|
+
space,
|
|
35
|
+
ignoreAttention,
|
|
36
|
+
}: Omit<SheetContainerProps, 'registry'>) => {
|
|
37
|
+
const graph = useComputeGraph(space);
|
|
38
|
+
if (!graph) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Sheet.Root graph={graph} sheet={sheet} attendableId={attendableId!} ignoreAttention={ignoreAttention}>
|
|
44
|
+
<Panel.Root classNames={role === 'section' && 'aspect-aquare'}>
|
|
45
|
+
<Panel.Toolbar asChild>
|
|
46
|
+
<Sheet.Toolbar />
|
|
47
|
+
</Panel.Toolbar>
|
|
48
|
+
<Panel.Content asChild>
|
|
49
|
+
<Sheet.Content />
|
|
50
|
+
</Panel.Content>
|
|
51
|
+
<Panel.Statusbar asChild>
|
|
52
|
+
<Sheet.Statusbar />
|
|
53
|
+
</Panel.Statusbar>
|
|
54
|
+
</Panel.Root>
|
|
55
|
+
</Sheet.Root>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const RangeList: ComponentType<any> = lazy(() => import('./RangeList'));
|
|
8
|
+
export const SheetContainer: ComponentType<any> = lazy(() => import('./SheetContainer'));
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
// Copyright 2023 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, { useEffect, useMemo } from 'react';
|
|
9
7
|
|
|
8
|
+
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { PublicKey } from '@dxos/keys';
|
|
11
|
-
import {
|
|
11
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { useThemeContext } from '@dxos/react-ui';
|
|
14
|
+
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
15
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
16
|
import {
|
|
15
17
|
createBasicExtensions,
|
|
16
18
|
createMarkdownExtensions,
|
|
17
19
|
createThemeExtensions,
|
|
18
20
|
decorateMarkdown,
|
|
19
21
|
documentId,
|
|
20
|
-
|
|
21
|
-
} from '@dxos/react-ui-editor';
|
|
22
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
22
|
+
} from '@dxos/ui-editor';
|
|
23
23
|
import { isNonNullable } from '@dxos/util';
|
|
24
24
|
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { SheetType } from '../types';
|
|
25
|
+
import { Sheet, useComputeGraph } from '#components';
|
|
26
|
+
import { useTestSheet, withComputeGraphDecorator } from '#testing';
|
|
27
|
+
import { Sheet as SheetType } from '#types';
|
|
29
28
|
|
|
29
|
+
import { useSheetModel } from '../model';
|
|
30
30
|
import { compute, computeGraphFacet } from './compute';
|
|
31
31
|
|
|
32
32
|
const str = (...lines: string[]) => lines.join('\n');
|
|
@@ -42,10 +42,10 @@ type EditorProps = {
|
|
|
42
42
|
|
|
43
43
|
const SHEET_NAME = 'Test Sheet';
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const DefaultStory = ({ text }: EditorProps) => {
|
|
46
46
|
const id = useMemo(() => PublicKey.random(), []);
|
|
47
47
|
const { themeMode } = useThemeContext();
|
|
48
|
-
const space =
|
|
48
|
+
const [space] = useSpaces();
|
|
49
49
|
const computeGraph = useComputeGraph(space);
|
|
50
50
|
const { parentRef, focusAttributes } = useTextEditor(
|
|
51
51
|
() => ({
|
|
@@ -67,13 +67,18 @@ const EditorStory = ({ text }: EditorProps) => {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const Grid = () => {
|
|
70
|
-
const space =
|
|
70
|
+
const [space] = useSpaces();
|
|
71
71
|
const graph = useComputeGraph(space);
|
|
72
72
|
const sheet = useTestSheet(space, graph, { name: SHEET_NAME });
|
|
73
73
|
const model = useSheetModel(graph, sheet);
|
|
74
74
|
useEffect(() => {
|
|
75
75
|
if (model) {
|
|
76
|
-
model.setValues({
|
|
76
|
+
model.setValues({
|
|
77
|
+
A1: { value: 100 },
|
|
78
|
+
A2: { value: 200 },
|
|
79
|
+
A3: { value: 300 },
|
|
80
|
+
A5: { value: '=SUM(A1:A3)' },
|
|
81
|
+
});
|
|
77
82
|
}
|
|
78
83
|
}, [model]);
|
|
79
84
|
|
|
@@ -83,9 +88,9 @@ const Grid = () => {
|
|
|
83
88
|
|
|
84
89
|
return (
|
|
85
90
|
<div className='flex w-[40rem] overflow-hidden'>
|
|
86
|
-
<
|
|
87
|
-
<
|
|
88
|
-
</
|
|
91
|
+
<Sheet.Root graph={graph} sheet={sheet} attendableId='test'>
|
|
92
|
+
<Sheet.Content />
|
|
93
|
+
</Sheet.Root>
|
|
89
94
|
</div>
|
|
90
95
|
);
|
|
91
96
|
};
|
|
@@ -93,28 +98,36 @@ const Grid = () => {
|
|
|
93
98
|
const GraphStory = (props: EditorProps) => {
|
|
94
99
|
return (
|
|
95
100
|
<div className='grid grid-rows-2'>
|
|
96
|
-
<
|
|
101
|
+
<DefaultStory {...props} />
|
|
97
102
|
<Grid />
|
|
98
103
|
</div>
|
|
99
104
|
);
|
|
100
105
|
};
|
|
101
106
|
|
|
102
107
|
const meta = {
|
|
103
|
-
title: 'plugins/plugin-sheet/extensions',
|
|
108
|
+
title: 'plugins/plugin-sheet/extensions/compute',
|
|
104
109
|
decorators: [
|
|
105
|
-
|
|
110
|
+
withTheme(),
|
|
111
|
+
withLayout({ layout: 'fullscreen' }),
|
|
112
|
+
withClientProvider({
|
|
113
|
+
types: [SheetType.Sheet],
|
|
114
|
+
createIdentity: true,
|
|
115
|
+
createSpace: true,
|
|
116
|
+
}),
|
|
117
|
+
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
118
|
+
withPluginManager({ plugins: [OperationPlugin(), RuntimePlugin()] }),
|
|
106
119
|
withComputeGraphDecorator(),
|
|
107
|
-
withTheme,
|
|
108
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
109
120
|
],
|
|
110
|
-
parameters: {
|
|
121
|
+
parameters: {
|
|
122
|
+
layout: 'fullscreen',
|
|
123
|
+
},
|
|
111
124
|
} satisfies Meta;
|
|
112
125
|
|
|
113
126
|
export default meta;
|
|
114
127
|
|
|
115
128
|
// TODO(burdon): Inline formulae.
|
|
116
|
-
export const Default: StoryObj<typeof
|
|
117
|
-
render:
|
|
129
|
+
export const Default: StoryObj<typeof DefaultStory> = {
|
|
130
|
+
render: DefaultStory,
|
|
118
131
|
args: {
|
|
119
132
|
text: str(
|
|
120
133
|
//
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
type ComputeGraph,
|
|
22
22
|
type ComputeNode,
|
|
23
23
|
createSheetName,
|
|
24
|
-
} from '@dxos/compute';
|
|
24
|
+
} from '@dxos/compute-hyperformula';
|
|
25
25
|
import { invariant } from '@dxos/invariant';
|
|
26
|
-
import { documentId, singleValueFacet } from '@dxos/
|
|
26
|
+
import { documentId, singleValueFacet } from '@dxos/ui-editor';
|
|
27
27
|
|
|
28
28
|
const LANGUAGE_TAG = 'dx';
|
|
29
29
|
|
|
@@ -8,7 +8,7 @@ import { testTree } from '@lezer/generator/test';
|
|
|
8
8
|
import { spreadsheet } from 'codemirror-lang-spreadsheet';
|
|
9
9
|
import { describe, expect, test } from 'vitest';
|
|
10
10
|
|
|
11
|
-
import { defaultFunctions } from '@dxos/compute';
|
|
11
|
+
import { defaultFunctions } from '@dxos/compute-hyperformula';
|
|
12
12
|
|
|
13
13
|
import { sheetExtension } from './sheet-extension';
|
|
14
14
|
|
|
@@ -18,10 +18,10 @@ import { type SyntaxNode } from '@lezer/common';
|
|
|
18
18
|
import { tags } from '@lezer/highlight';
|
|
19
19
|
import { spreadsheet } from 'codemirror-lang-spreadsheet';
|
|
20
20
|
|
|
21
|
-
import { type FunctionDefinition } from '@dxos/compute';
|
|
22
|
-
import { RANGE_NOTATION } from '@dxos/compute';
|
|
23
|
-
import { singleValueFacet } from '@dxos/
|
|
24
|
-
import { mx } from '@dxos/
|
|
21
|
+
import { type FunctionDefinition } from '@dxos/compute-hyperformula';
|
|
22
|
+
import { RANGE_NOTATION } from '@dxos/compute-hyperformula';
|
|
23
|
+
import { singleValueFacet } from '@dxos/ui-editor';
|
|
24
|
+
import { mx } from '@dxos/ui-theme';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* https://codemirror.net/examples/styling
|
|
@@ -33,30 +33,30 @@ const highlightStyles = HighlightStyle.define([
|
|
|
33
33
|
// Function.
|
|
34
34
|
{
|
|
35
35
|
tag: tags.name,
|
|
36
|
-
class: 'text-
|
|
36
|
+
class: 'text-accent-text',
|
|
37
37
|
},
|
|
38
38
|
// Range.
|
|
39
39
|
{
|
|
40
40
|
tag: tags.tagName,
|
|
41
|
-
class: 'text-
|
|
41
|
+
class: 'text-pink-text',
|
|
42
42
|
},
|
|
43
43
|
// Values.
|
|
44
44
|
{
|
|
45
45
|
tag: tags.number,
|
|
46
|
-
class: 'text-
|
|
46
|
+
class: 'text-teal-text',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
tag: tags.bool,
|
|
50
|
-
class: 'text-
|
|
50
|
+
class: 'text-teal-text',
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
tag: tags.string,
|
|
54
|
-
class: 'text-
|
|
54
|
+
class: 'text-teal-text',
|
|
55
55
|
},
|
|
56
56
|
// Error.
|
|
57
57
|
{
|
|
58
58
|
tag: tags.invalid,
|
|
59
|
-
class: 'text-
|
|
59
|
+
class: 'text-un-accent',
|
|
60
60
|
},
|
|
61
61
|
]);
|
|
62
62
|
|
|
@@ -75,7 +75,10 @@ export type SheetExtensionOptions = {
|
|
|
75
75
|
* https://hyperformula.handsontable.com/guide/key-concepts.html#grammar
|
|
76
76
|
*/
|
|
77
77
|
export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions): Extension => {
|
|
78
|
-
const { extension, language } = spreadsheet({
|
|
78
|
+
const { extension, language } = spreadsheet({
|
|
79
|
+
idiom: 'en-US',
|
|
80
|
+
decimalSeparator: '.',
|
|
81
|
+
});
|
|
79
82
|
|
|
80
83
|
const createCompletion = (name: string) => {
|
|
81
84
|
const { section = 'Custom', description, syntax } = functions.find((value) => value.name === name) ?? {};
|
|
@@ -94,7 +97,7 @@ export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions)
|
|
|
94
97
|
|
|
95
98
|
const title = document.createElement('h2');
|
|
96
99
|
title.innerText = name;
|
|
97
|
-
title.className = 'text-lg font-mono text-
|
|
100
|
+
title.className = 'text-lg font-mono text-accent-text';
|
|
98
101
|
root.appendChild(title);
|
|
99
102
|
|
|
100
103
|
if (description) {
|
|
@@ -107,7 +110,7 @@ export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions)
|
|
|
107
110
|
if (syntax) {
|
|
108
111
|
const detail = document.createElement('pre');
|
|
109
112
|
detail.innerText = syntax;
|
|
110
|
-
detail.className = 'whitespace-pre-wrap text-
|
|
113
|
+
detail.className = 'whitespace-pre-wrap text-green-text';
|
|
111
114
|
root.appendChild(detail);
|
|
112
115
|
}
|
|
113
116
|
|
|
@@ -166,8 +169,8 @@ export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions)
|
|
|
166
169
|
icons: false,
|
|
167
170
|
tooltipClass: () =>
|
|
168
171
|
mx(
|
|
169
|
-
'!-left-[1px] !top-[33px] !-m-0 border
|
|
170
|
-
'[&>ul>li[aria-selected]]:!bg-
|
|
172
|
+
'!-left-[1px] !top-[33px] !-m-0 border border-h-0! [&>ul]:!min-w-[198px]',
|
|
173
|
+
'[&>ul>li[aria-selected]]:!bg-accent-surface',
|
|
171
174
|
'border-separator',
|
|
172
175
|
),
|
|
173
176
|
}),
|
package/src/index.ts
CHANGED
|
@@ -2,28 +2,19 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema, pipe } from 'effect';
|
|
6
5
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
chain,
|
|
11
|
-
createIntent,
|
|
12
|
-
createResolver,
|
|
13
|
-
useIntentDispatcher,
|
|
14
|
-
useIntentResolver,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
16
9
|
import { debounce } from '@dxos/async';
|
|
17
|
-
import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute';
|
|
10
|
+
import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
|
|
18
11
|
import { Obj, Relation } from '@dxos/echo';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { AnchoredTo } from '@dxos/schema';
|
|
12
|
+
import { ThreadOperation } from '@dxos/plugin-thread';
|
|
13
|
+
import { Filter, Query, useQuery } from '@dxos/react-client/echo';
|
|
14
|
+
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
15
|
+
import { AnchoredTo, Thread } from '@dxos/types';
|
|
24
16
|
|
|
25
|
-
import { useSheetContext } from '
|
|
26
|
-
import { SHEET_PLUGIN } from '../meta';
|
|
17
|
+
import { useSheetContext } from '#components';
|
|
27
18
|
|
|
28
19
|
export const completeCellRangeToThreadCursor = (range: CompleteCellRange): string => {
|
|
29
20
|
return `${range.from.col},${range.from.row},${range.to.col},${range.to.row}`;
|
|
@@ -42,45 +33,12 @@ export const parseThreadAnchorAsCellRange = (cursor: string): CompleteCellRange
|
|
|
42
33
|
}
|
|
43
34
|
};
|
|
44
35
|
|
|
45
|
-
export const useUpdateFocusedCellOnThreadSelection = (grid: DxGridElement | null) => {
|
|
46
|
-
const { model, setActiveRefs } = useSheetContext();
|
|
47
|
-
const scrollIntoViewResolver = useMemo(
|
|
48
|
-
() =>
|
|
49
|
-
createResolver({
|
|
50
|
-
intent: LayoutAction.ScrollIntoView,
|
|
51
|
-
position: 'hoist',
|
|
52
|
-
filter: (
|
|
53
|
-
data,
|
|
54
|
-
): data is {
|
|
55
|
-
part: 'current';
|
|
56
|
-
subject: string;
|
|
57
|
-
options: { cursor: string; ref: GridContentProps['activeRefs'] };
|
|
58
|
-
} => {
|
|
59
|
-
if (!Schema.is(LayoutAction.ScrollIntoView.fields.input)(data)) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return data.subject === fullyQualifiedId(model.sheet) && !!data.options?.cursor;
|
|
64
|
-
},
|
|
65
|
-
resolve: ({ options: { cursor, ref } }) => {
|
|
66
|
-
setActiveRefs(ref);
|
|
67
|
-
// TODO(Zan): Everywhere we refer to the cursor in a thread context should change to `anchor`.
|
|
68
|
-
const range = parseThreadAnchorAsCellRange(cursor!);
|
|
69
|
-
range && grid?.setFocus({ ...range.to, plane: 'grid' }, true);
|
|
70
|
-
},
|
|
71
|
-
}),
|
|
72
|
-
[model.sheet, setActiveRefs],
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
useIntentResolver(SHEET_PLUGIN, scrollIntoViewResolver);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
36
|
export const useSelectThreadOnCellFocus = () => {
|
|
79
37
|
const { model, cursor } = useSheetContext();
|
|
80
|
-
const {
|
|
38
|
+
const { invokePromise } = useOperationInvoker();
|
|
81
39
|
|
|
82
|
-
const
|
|
83
|
-
const anchors = useQuery(
|
|
40
|
+
const db = Obj.getDatabase(model.sheet);
|
|
41
|
+
const anchors = useQuery(db, Query.select(Filter.id(model.sheet.id)).targetOf(AnchoredTo.AnchoredTo));
|
|
84
42
|
|
|
85
43
|
const selectClosestThread = useCallback(
|
|
86
44
|
(cellAddress: CellAddress) => {
|
|
@@ -90,7 +48,7 @@ export const useSelectThreadOnCellFocus = () => {
|
|
|
90
48
|
|
|
91
49
|
const closestThread = anchors.find((anchor) => {
|
|
92
50
|
const source = Relation.getSource(anchor);
|
|
93
|
-
if (anchor.anchor && Obj.instanceOf(
|
|
51
|
+
if (anchor.anchor && Obj.instanceOf(Thread.Thread, source)) {
|
|
94
52
|
const range = parseThreadAnchorAsCellRange(anchor.anchor);
|
|
95
53
|
return range ? inRange(range, cellAddress) : false;
|
|
96
54
|
} else {
|
|
@@ -99,15 +57,15 @@ export const useSelectThreadOnCellFocus = () => {
|
|
|
99
57
|
});
|
|
100
58
|
|
|
101
59
|
if (closestThread) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
60
|
+
void (async () => {
|
|
61
|
+
await invokePromise(ThreadOperation.Select, { current: Relation.getDXN(closestThread).toString() });
|
|
62
|
+
await invokePromise(LayoutOperation.UpdateCompanion, {
|
|
63
|
+
subject: linkedSegment('comments'),
|
|
64
|
+
});
|
|
65
|
+
})();
|
|
108
66
|
}
|
|
109
67
|
},
|
|
110
|
-
[
|
|
68
|
+
[invokePromise, anchors],
|
|
111
69
|
);
|
|
112
70
|
|
|
113
71
|
const debounced = useMemo(() => {
|
package/src/meta.ts
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
export const meta: PluginMeta = {
|
|
10
|
-
id: SHEET_PLUGIN,
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.sheet',
|
|
11
10
|
name: 'Sheet',
|
|
12
|
-
description:
|
|
13
|
-
|
|
11
|
+
description: trim`
|
|
12
|
+
Full-featured spreadsheet application with over 400 built-in formulas for calculations and data analysis.
|
|
13
|
+
Create custom JavaScript functions and integrate with AI agents for advanced automation.
|
|
14
|
+
`,
|
|
14
15
|
icon: 'ph--grid-nine--regular',
|
|
16
|
+
iconHue: 'indigo',
|
|
15
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-sheet',
|
|
16
18
|
screenshots: ['https://dxos.network/plugin-details-sheet-dark.png'],
|
|
17
19
|
};
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import { afterEach, beforeEach, describe, expect, onTestFinished, test } from 'vitest';
|
|
6
6
|
|
|
7
7
|
import { Trigger } from '@dxos/async';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { type CellScalarValue, addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
|
|
10
|
+
import { TestBuilder, testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { Sheet, mapFormulaIndicesToRefs, mapFormulaRefsToIndices } from '#types';
|
|
14
14
|
|
|
15
15
|
import { SheetModel } from './sheet-model';
|
|
16
16
|
import { createTestGrid } from './testing';
|
|
@@ -18,7 +18,7 @@ import { createTestGrid } from './testing';
|
|
|
18
18
|
describe('SheetModel', () => {
|
|
19
19
|
let testBuilder: TestBuilder;
|
|
20
20
|
beforeEach(async () => {
|
|
21
|
-
testBuilder = new TestBuilder({ types: [
|
|
21
|
+
testBuilder = new TestBuilder({ types: [Operation.PersistentOperation], plugins: testFunctionPlugins });
|
|
22
22
|
await testBuilder.open();
|
|
23
23
|
});
|
|
24
24
|
afterEach(async () => {
|
|
@@ -31,7 +31,7 @@ describe('SheetModel', () => {
|
|
|
31
31
|
await graph.open();
|
|
32
32
|
|
|
33
33
|
// TODO(burdon): Create via factory.
|
|
34
|
-
const sheet =
|
|
34
|
+
const sheet = Sheet.make({ rows: 5, columns: 5 });
|
|
35
35
|
const model = new SheetModel(graph, sheet);
|
|
36
36
|
await model.open();
|
|
37
37
|
testBuilder.ctx.onDispose(() => model.close());
|