@dxos/plugin-sheet 0.6.13 → 0.6.14-main.1366248
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/browser/SheetContainer-JZEKRM4Z.mjs +297 -0
- package/dist/lib/browser/SheetContainer-JZEKRM4Z.mjs.map +7 -0
- package/dist/lib/browser/chunk-BVUN7SHF.mjs +67 -0
- package/dist/lib/browser/chunk-BVUN7SHF.mjs.map +7 -0
- package/dist/lib/browser/chunk-G2FUL6PK.mjs +1671 -0
- package/dist/lib/browser/chunk-G2FUL6PK.mjs.map +7 -0
- package/dist/lib/browser/chunk-RABELMEQ.mjs +15 -0
- package/dist/lib/browser/chunk-RABELMEQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-D5AGLXJP.mjs → chunk-VMSX6Z4X.mjs} +659 -675
- package/dist/lib/browser/chunk-VMSX6Z4X.mjs.map +7 -0
- package/dist/lib/browser/compute-graph-GGWUX644.mjs +35 -0
- package/dist/lib/browser/compute-graph-GGWUX644.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +168 -67
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types.mjs +6 -12
- package/dist/lib/node/SheetContainer-PJE74VO4.cjs +300 -0
- package/dist/lib/node/SheetContainer-PJE74VO4.cjs.map +7 -0
- package/dist/lib/node/chunk-2ZVZI2KJ.cjs +38 -0
- package/dist/lib/node/chunk-2ZVZI2KJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-DSYKOI4E.cjs → chunk-AWKOWDMI.cjs} +34 -52
- package/dist/lib/node/chunk-AWKOWDMI.cjs.map +7 -0
- package/dist/lib/node/{chunk-5KKJ4NPP.cjs → chunk-O7XR4R7Y.cjs} +678 -674
- package/dist/lib/node/chunk-O7XR4R7Y.cjs.map +7 -0
- package/dist/lib/node/chunk-STZ7S7RF.cjs +1656 -0
- package/dist/lib/node/chunk-STZ7S7RF.cjs.map +7 -0
- package/dist/lib/node/compute-graph-KGWA2QLE.cjs +57 -0
- package/dist/lib/node/compute-graph-KGWA2QLE.cjs.map +7 -0
- package/dist/lib/node/index.cjs +178 -75
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +3 -3
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +9 -15
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/SheetContainer-R73XEXHU.mjs +298 -0
- package/dist/lib/node-esm/SheetContainer-R73XEXHU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BM2Q3FFC.mjs +17 -0
- package/dist/lib/node-esm/chunk-BM2Q3FFC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CR4K75EL.mjs +3220 -0
- package/dist/lib/node-esm/chunk-CR4K75EL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UIBWRHW7.mjs +68 -0
- package/dist/lib/node-esm/chunk-UIBWRHW7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V5N3Y2O5.mjs +1672 -0
- package/dist/lib/node-esm/chunk-V5N3Y2O5.mjs.map +7 -0
- package/dist/lib/node-esm/compute-graph-2SCZT7N5.mjs +36 -0
- package/dist/lib/node-esm/compute-graph-2SCZT7N5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +350 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +10 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +17 -0
- package/dist/lib/node-esm/types.mjs.map +7 -0
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +13 -0
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/index.d.ts +1 -3
- package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +3 -0
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +1 -0
- package/dist/types/src/components/FunctionEditor/index.d.ts +2 -0
- package/dist/types/src/components/FunctionEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/GridSheet/GridSheet.d.ts +3 -0
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -0
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +6 -0
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -0
- package/dist/types/src/components/{CellEditor/CellEditor.stories.d.ts → GridSheet/SheetCellEditor.stories.d.ts} +5 -9
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/GridSheet/index.d.ts +2 -0
- package/dist/types/src/components/GridSheet/index.d.ts.map +1 -0
- package/dist/types/src/components/GridSheet/util.d.ts +15 -0
- package/dist/types/src/components/GridSheet/util.d.ts.map +1 -0
- package/dist/types/src/components/RangeList/RangeList.d.ts +7 -0
- package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -0
- package/dist/types/src/components/RangeList/index.d.ts +2 -0
- package/dist/types/src/components/RangeList/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +9 -0
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -0
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +6 -0
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContainer/index.d.ts +3 -0
- package/dist/types/src/components/SheetContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetContext/SheetContext.d.ts +28 -0
- package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -0
- package/dist/types/src/components/SheetContext/index.d.ts +2 -0
- package/dist/types/src/components/SheetContext/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +36 -9
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +4 -32
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +7 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/compute-graph/compute-graph-registry.d.ts +34 -0
- package/dist/types/src/compute-graph/compute-graph-registry.d.ts.map +1 -0
- package/dist/types/src/compute-graph/compute-graph.d.ts +64 -0
- package/dist/types/src/compute-graph/compute-graph.d.ts.map +1 -0
- package/dist/types/src/compute-graph/compute-graph.stories.d.ts +6 -0
- package/dist/types/src/compute-graph/compute-graph.stories.d.ts.map +1 -0
- package/dist/types/src/compute-graph/compute-graph.test.d.ts +2 -0
- package/dist/types/src/compute-graph/compute-graph.test.d.ts.map +1 -0
- package/dist/types/src/compute-graph/compute-node.d.ts +26 -0
- package/dist/types/src/compute-graph/compute-node.d.ts.map +1 -0
- package/dist/types/src/{components/ComputeGraph → compute-graph/functions}/async-function.d.ts +14 -5
- package/dist/types/src/compute-graph/functions/async-function.d.ts.map +1 -0
- package/dist/types/src/compute-graph/functions/edge-function.d.ts +21 -0
- package/dist/types/src/compute-graph/functions/edge-function.d.ts.map +1 -0
- package/dist/types/src/{model/functions.d.ts → compute-graph/functions/function-defs.d.ts} +1 -1
- package/dist/types/src/compute-graph/functions/function-defs.d.ts.map +1 -0
- package/dist/types/src/compute-graph/functions/index.d.ts +4 -0
- package/dist/types/src/compute-graph/functions/index.d.ts.map +1 -0
- package/dist/types/src/compute-graph/hyperformula.test.d.ts +2 -0
- package/dist/types/src/compute-graph/hyperformula.test.d.ts.map +1 -0
- package/dist/types/src/compute-graph/index.d.ts +5 -0
- package/dist/types/src/compute-graph/index.d.ts.map +1 -0
- package/dist/types/src/compute-graph/testing/index.d.ts +3 -0
- package/dist/types/src/compute-graph/testing/index.d.ts.map +1 -0
- package/dist/types/src/compute-graph/testing/test-builder.d.ts +15 -0
- package/dist/types/src/compute-graph/testing/test-builder.d.ts.map +1 -0
- package/dist/types/src/compute-graph/testing/test-plugin.d.ts +36 -0
- package/dist/types/src/compute-graph/testing/test-plugin.d.ts.map +1 -0
- package/dist/types/src/compute-graph/util.d.ts +2 -0
- package/dist/types/src/compute-graph/util.d.ts.map +1 -0
- package/dist/types/src/defs/index.d.ts +4 -0
- package/dist/types/src/defs/index.d.ts.map +1 -0
- package/dist/types/src/defs/sheet-range-types.d.ts +13 -0
- package/dist/types/src/defs/sheet-range-types.d.ts.map +1 -0
- package/dist/types/src/defs/types.d.ts +28 -0
- package/dist/types/src/defs/types.d.ts.map +1 -0
- package/dist/types/src/defs/types.test.d.ts.map +1 -0
- package/dist/types/src/defs/util.d.ts +39 -0
- package/dist/types/src/defs/util.d.ts.map +1 -0
- package/dist/types/src/extensions/compute.d.ts +6 -0
- package/dist/types/src/extensions/compute.d.ts.map +1 -0
- package/dist/types/src/extensions/compute.stories.d.ts +21 -0
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -0
- package/dist/types/src/extensions/editor/extension.d.ts +39 -0
- package/dist/types/src/extensions/editor/extension.d.ts.map +1 -0
- package/dist/types/src/extensions/editor/extension.test.d.ts.map +1 -0
- package/dist/types/src/extensions/editor/index.d.ts +2 -0
- package/dist/types/src/extensions/editor/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +3 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/integrations/index.d.ts +2 -0
- package/dist/types/src/integrations/index.d.ts.map +1 -0
- package/dist/types/src/integrations/thread-ranges.d.ts +7 -0
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +4 -9
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/index.d.ts +2 -3
- package/dist/types/src/model/index.d.ts.map +1 -1
- package/dist/types/src/model/{model.d.ts → sheet-model.d.ts} +22 -69
- package/dist/types/src/model/sheet-model.d.ts.map +1 -0
- package/dist/types/src/model/sheet-model.test.d.ts +2 -0
- package/dist/types/src/model/sheet-model.test.d.ts.map +1 -0
- package/dist/types/src/model/useSheetModel.d.ts +8 -0
- package/dist/types/src/model/useSheetModel.d.ts.map +1 -0
- package/dist/types/src/sanity.test.d.ts +2 -0
- package/dist/types/src/sanity.test.d.ts.map +1 -0
- package/dist/types/src/serializer.d.ts +4 -0
- package/dist/types/src/serializer.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +8 -0
- package/dist/types/src/testing/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +32 -12
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +132 -43
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/vendor/hyperformula.mjs +37145 -0
- package/package.json +60 -61
- package/src/SheetPlugin.tsx +89 -78
- package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +37 -0
- package/src/components/ComputeGraph/index.ts +1 -3
- package/src/components/FunctionEditor/FunctionEditor.tsx +45 -0
- package/src/components/FunctionEditor/index.ts +5 -0
- package/src/components/GridSheet/GridSheet.stories.tsx +46 -0
- package/src/components/GridSheet/GridSheet.tsx +358 -0
- package/src/components/{CellEditor/CellEditor.stories.tsx → GridSheet/SheetCellEditor.stories.tsx} +18 -15
- package/src/components/GridSheet/index.ts +5 -0
- package/src/components/GridSheet/util.ts +170 -0
- package/src/components/RangeList/RangeList.tsx +53 -0
- package/src/components/RangeList/index.ts +5 -0
- package/src/components/SheetContainer/SheetContainer.stories.tsx +45 -0
- package/src/components/SheetContainer/SheetContainer.tsx +33 -0
- package/src/components/SheetContainer/index.ts +7 -0
- package/src/components/SheetContext/SheetContext.tsx +127 -0
- package/src/components/SheetContext/index.ts +5 -0
- package/src/components/Toolbar/Toolbar.stories.tsx +9 -6
- package/src/components/Toolbar/Toolbar.tsx +265 -111
- package/src/components/index.ts +5 -3
- package/src/compute-graph/compute-graph-registry.ts +90 -0
- package/src/compute-graph/compute-graph.stories.tsx +97 -0
- package/src/compute-graph/compute-graph.test.ts +87 -0
- package/src/compute-graph/compute-graph.ts +260 -0
- package/src/compute-graph/compute-node.ts +62 -0
- package/src/{components/ComputeGraph → compute-graph/functions}/async-function.ts +26 -15
- package/src/{components/ComputeGraph → compute-graph/functions}/edge-function.ts +21 -17
- package/src/compute-graph/functions/index.ts +7 -0
- package/src/compute-graph/hyperformula.test.ts +14 -0
- package/src/compute-graph/index.ts +8 -0
- package/src/compute-graph/testing/index.ts +6 -0
- package/src/compute-graph/testing/test-builder.ts +54 -0
- package/src/{components/ComputeGraph/custom.ts → compute-graph/testing/test-plugin.ts} +44 -14
- package/src/compute-graph/util.ts +8 -0
- package/src/defs/index.ts +7 -0
- package/src/defs/sheet-range-types.ts +49 -0
- package/src/{model → defs}/types.test.ts +8 -9
- package/src/defs/types.ts +86 -0
- package/src/defs/util.ts +136 -0
- package/src/extensions/compute.stories.tsx +155 -0
- package/src/extensions/compute.ts +147 -0
- package/src/{components/CellEditor → extensions/editor}/extension.test.ts +4 -6
- package/src/{components/CellEditor → extensions/editor}/extension.ts +51 -27
- package/src/{components/CellEditor → extensions/editor}/index.ts +0 -1
- package/src/extensions/index.ts +6 -0
- package/src/index.ts +2 -2
- package/src/integrations/index.ts +5 -0
- package/src/integrations/thread-ranges.ts +101 -0
- package/src/meta.ts +15 -0
- package/src/model/index.ts +2 -3
- package/src/model/sheet-model.test.ts +59 -0
- package/src/model/sheet-model.ts +495 -0
- package/src/model/useSheetModel.ts +40 -0
- package/src/sanity.test.ts +40 -0
- package/src/serializer.ts +27 -0
- package/src/{components/Sheet → testing}/index.ts +1 -1
- package/src/testing/testing.tsx +68 -0
- package/src/translations.ts +24 -4
- package/src/types.ts +62 -47
- package/dist/lib/browser/SheetContainer-U4H5D34A.mjs +0 -1772
- package/dist/lib/browser/SheetContainer-U4H5D34A.mjs.map +0 -7
- package/dist/lib/browser/chunk-APHOLYUB.mjs +0 -175
- package/dist/lib/browser/chunk-APHOLYUB.mjs.map +0 -7
- package/dist/lib/browser/chunk-D5AGLXJP.mjs.map +0 -7
- package/dist/lib/browser/chunk-FUAGSXA4.mjs +0 -82
- package/dist/lib/browser/chunk-FUAGSXA4.mjs.map +0 -7
- package/dist/lib/browser/chunk-JRL5LGCE.mjs +0 -18
- package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +0 -7
- package/dist/lib/browser/chunk-NU4PBN33.mjs +0 -8
- package/dist/lib/browser/chunk-NU4PBN33.mjs.map +0 -7
- package/dist/lib/browser/testing.mjs +0 -92
- package/dist/lib/browser/testing.mjs.map +0 -7
- package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs +0 -1765
- package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs.map +0 -7
- package/dist/lib/node/chunk-5KKJ4NPP.cjs.map +0 -7
- package/dist/lib/node/chunk-BJ6ZD7MN.cjs +0 -51
- package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +0 -7
- package/dist/lib/node/chunk-CN3RPESU.cjs +0 -202
- package/dist/lib/node/chunk-CN3RPESU.cjs.map +0 -7
- package/dist/lib/node/chunk-DSYKOI4E.cjs.map +0 -7
- package/dist/lib/node/chunk-PYXHNAAK.cjs +0 -40
- package/dist/lib/node/chunk-PYXHNAAK.cjs.map +0 -7
- package/dist/lib/node/testing.cjs +0 -111
- package/dist/lib/node/testing.cjs.map +0 -7
- package/dist/types/src/components/CellEditor/CellEditor.d.ts +0 -14
- package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +0 -1
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/CellEditor/extension.d.ts +0 -19
- package/dist/types/src/components/CellEditor/extension.d.ts.map +0 -1
- package/dist/types/src/components/CellEditor/extension.test.d.ts.map +0 -1
- package/dist/types/src/components/CellEditor/index.d.ts +0 -3
- package/dist/types/src/components/CellEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/custom.d.ts +0 -21
- package/dist/types/src/components/ComputeGraph/custom.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/edge-function.d.ts +0 -20
- package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts +0 -12
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +0 -2
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +0 -1
- package/dist/types/src/components/ComputeGraph/graph.d.ts +0 -26
- package/dist/types/src/components/ComputeGraph/graph.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts +0 -55
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts +0 -54
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/formatting.d.ts +0 -14
- package/dist/types/src/components/Sheet/formatting.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/grid.d.ts +0 -52
- package/dist/types/src/components/Sheet/grid.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/index.d.ts +0 -2
- package/dist/types/src/components/Sheet/index.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/nav.d.ts +0 -29
- package/dist/types/src/components/Sheet/nav.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/sheet-context.d.ts +0 -25
- package/dist/types/src/components/Sheet/sheet-context.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/util.d.ts +0 -18
- package/dist/types/src/components/Sheet/util.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer.d.ts +0 -9
- package/dist/types/src/components/SheetContainer.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/common.d.ts +0 -20
- package/dist/types/src/components/Toolbar/common.d.ts.map +0 -1
- package/dist/types/src/model/functions.d.ts.map +0 -1
- package/dist/types/src/model/model.browser.test.d.ts +0 -2
- package/dist/types/src/model/model.browser.test.d.ts.map +0 -1
- package/dist/types/src/model/model.d.ts.map +0 -1
- package/dist/types/src/model/types.d.ts +0 -17
- package/dist/types/src/model/types.d.ts.map +0 -1
- package/dist/types/src/model/types.test.d.ts.map +0 -1
- package/dist/types/src/model/util.d.ts +0 -15
- package/dist/types/src/model/util.d.ts.map +0 -1
- package/dist/types/src/testing.d.ts +0 -9
- package/dist/types/src/testing.d.ts.map +0 -1
- package/src/components/CellEditor/CellEditor.tsx +0 -113
- package/src/components/ComputeGraph/graph-context.tsx +0 -50
- package/src/components/ComputeGraph/graph.browser.test.ts +0 -50
- package/src/components/ComputeGraph/graph.ts +0 -62
- package/src/components/Sheet/Sheet.stories.tsx +0 -287
- package/src/components/Sheet/Sheet.tsx +0 -1160
- package/src/components/Sheet/formatting.ts +0 -106
- package/src/components/Sheet/grid.ts +0 -191
- package/src/components/Sheet/nav.ts +0 -157
- package/src/components/Sheet/sheet-context.tsx +0 -150
- package/src/components/Sheet/util.ts +0 -56
- package/src/components/SheetContainer.tsx +0 -34
- package/src/components/Toolbar/common.tsx +0 -72
- package/src/meta.tsx +0 -18
- package/src/model/model.browser.test.ts +0 -100
- package/src/model/model.ts +0 -550
- package/src/model/types.ts +0 -71
- package/src/model/util.ts +0 -36
- package/src/testing.ts +0 -50
- /package/dist/types/src/{model → defs}/types.test.d.ts +0 -0
- /package/dist/types/src/{components/CellEditor → extensions/editor}/extension.test.d.ts +0 -0
- /package/src/{model/functions.ts → compute-graph/functions/function-defs.ts} +0 -0
|
@@ -26,45 +26,310 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
var chunk_O7XR4R7Y_exports = {};
|
|
30
|
+
__export(chunk_O7XR4R7Y_exports, {
|
|
31
|
+
AsyncFunctionPlugin: () => AsyncFunctionPlugin,
|
|
32
|
+
ComputeGraph: () => ComputeGraph,
|
|
33
|
+
ComputeGraphRegistry: () => ComputeGraphRegistry,
|
|
34
|
+
ComputeNode: () => ComputeNode,
|
|
35
|
+
DEFAULT_COLUMNS: () => DEFAULT_COLUMNS,
|
|
36
|
+
DEFAULT_ROWS: () => DEFAULT_ROWS,
|
|
37
|
+
EDGE_FUNCTION_NAME: () => EDGE_FUNCTION_NAME,
|
|
38
|
+
EdgeFunctionPlugin: () => EdgeFunctionPlugin,
|
|
39
|
+
EdgeFunctionPluginTranslations: () => EdgeFunctionPluginTranslations,
|
|
40
|
+
FunctionContext: () => FunctionContext,
|
|
41
|
+
MAX_COLUMNS: () => MAX_COLUMNS,
|
|
42
|
+
MAX_ROWS: () => MAX_ROWS,
|
|
43
|
+
RANGE_NOTATION: () => RANGE_NOTATION,
|
|
44
|
+
ReadonlyException: () => ReadonlyException,
|
|
35
45
|
addressFromA1Notation: () => addressFromA1Notation,
|
|
46
|
+
addressFromIndex: () => addressFromIndex,
|
|
36
47
|
addressToA1Notation: () => addressToA1Notation,
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
addressToIndex: () => addressToIndex,
|
|
49
|
+
alignKey: () => alignKey,
|
|
50
|
+
cellClassNameForRange: () => cellClassNameForRange,
|
|
51
|
+
compareIndexPositions: () => compareIndexPositions,
|
|
52
|
+
createSheet: () => createSheet,
|
|
53
|
+
createSheetName: () => createSheetName,
|
|
54
|
+
defaultFunctionContextOptions: () => defaultFunctionContextOptions,
|
|
39
55
|
defaultFunctions: () => defaultFunctions,
|
|
56
|
+
defaultOptions: () => defaultOptions,
|
|
57
|
+
defaultPlugins: () => defaultPlugins,
|
|
40
58
|
inRange: () => inRange,
|
|
41
|
-
|
|
42
|
-
|
|
59
|
+
initialize: () => initialize,
|
|
60
|
+
insertIndices: () => insertIndices,
|
|
61
|
+
isFormula: () => isFormula,
|
|
62
|
+
parseSheetName: () => parseSheetName,
|
|
63
|
+
rangeFromIndex: () => rangeFromIndex,
|
|
64
|
+
rangeToA1Notation: () => rangeToA1Notation,
|
|
65
|
+
rangeToIndex: () => rangeToIndex,
|
|
66
|
+
styleKey: () => styleKey
|
|
43
67
|
});
|
|
44
|
-
module.exports = __toCommonJS(
|
|
45
|
-
var
|
|
46
|
-
var import_hyperformula = require("hyperformula");
|
|
68
|
+
module.exports = __toCommonJS(chunk_O7XR4R7Y_exports);
|
|
69
|
+
var import_chunk_AWKOWDMI = require("./chunk-AWKOWDMI.cjs");
|
|
47
70
|
var import_async = require("@dxos/async");
|
|
71
|
+
var import_echo = require("@dxos/client/echo");
|
|
72
|
+
var import_echo2 = require("@dxos/client/echo");
|
|
73
|
+
var import_context = require("@dxos/context");
|
|
74
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
75
|
+
var import_invariant = require("@dxos/invariant");
|
|
48
76
|
var import_keys = require("@dxos/keys");
|
|
49
77
|
var import_log = require("@dxos/log");
|
|
50
|
-
var
|
|
51
|
-
var
|
|
78
|
+
var import_types = require("@dxos/plugin-script/types");
|
|
79
|
+
var import_util = require("@dxos/util");
|
|
80
|
+
var import_hyperformula = require("#hyperformula");
|
|
52
81
|
var import_async2 = require("@dxos/async");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var import_async3 = require("@dxos/async");
|
|
56
|
-
var import_context = require("@dxos/context");
|
|
57
|
-
var import_invariant = require("@dxos/invariant");
|
|
58
|
-
var import_keys2 = require("@dxos/keys");
|
|
59
|
-
var import_log3 = require("@dxos/log");
|
|
82
|
+
var import_context2 = require("@dxos/context");
|
|
83
|
+
var import_hyperformula2 = require("#hyperformula");
|
|
60
84
|
var import_invariant2 = require("@dxos/invariant");
|
|
61
85
|
var import_crypto = require("@dxos/crypto");
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var
|
|
86
|
+
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
87
|
+
var import_lodash = __toESM(require("lodash.defaultsdeep"));
|
|
88
|
+
var import_async3 = require("@dxos/async");
|
|
89
|
+
var import_log2 = require("@dxos/log");
|
|
90
|
+
var import_hyperformula3 = require("#hyperformula");
|
|
91
|
+
var import_signals_core = require("@preact/signals-core");
|
|
92
|
+
var import_echo3 = require("@dxos/client/echo");
|
|
93
|
+
var import_log3 = require("@dxos/log");
|
|
94
|
+
var import_edge = require("@dxos/plugin-script/edge");
|
|
95
|
+
var import_types2 = require("@dxos/plugin-script/types");
|
|
96
|
+
var import_util2 = require("@dxos/util");
|
|
97
|
+
var import_hyperformula4 = require("#hyperformula");
|
|
98
|
+
var import_lodash2 = __toESM(require("lodash.defaultsdeep"));
|
|
99
|
+
var import_context3 = require("@dxos/context");
|
|
100
|
+
var import_invariant3 = require("@dxos/invariant");
|
|
101
|
+
var import_log4 = require("@dxos/log");
|
|
102
|
+
var import_hyperformula5 = require("#hyperformula");
|
|
103
|
+
var alignKey = "alignment";
|
|
104
|
+
var commentKey = "comment";
|
|
105
|
+
var styleKey = "style";
|
|
106
|
+
var cellClassNameForRange = ({ key, value }) => {
|
|
107
|
+
switch (key) {
|
|
108
|
+
case alignKey:
|
|
109
|
+
switch (value) {
|
|
110
|
+
case "start":
|
|
111
|
+
return "text-start";
|
|
112
|
+
case "center":
|
|
113
|
+
return "text-center";
|
|
114
|
+
case "end":
|
|
115
|
+
return "text-end";
|
|
116
|
+
default:
|
|
117
|
+
return void 0;
|
|
118
|
+
}
|
|
119
|
+
case commentKey:
|
|
120
|
+
return "bg-gridComment";
|
|
121
|
+
case styleKey:
|
|
122
|
+
switch (value) {
|
|
123
|
+
case "highlight":
|
|
124
|
+
return "!bg-gridHighlight";
|
|
125
|
+
case "softwrap":
|
|
126
|
+
return "!whitespace-normal";
|
|
127
|
+
default:
|
|
128
|
+
return void 0;
|
|
129
|
+
}
|
|
130
|
+
default:
|
|
131
|
+
return void 0;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-sheet/src/defs/types.ts";
|
|
135
|
+
var DEFAULT_ROWS = 50;
|
|
136
|
+
var DEFAULT_COLUMNS = 26;
|
|
137
|
+
var MAX_ROWS = 500;
|
|
138
|
+
var MAX_COLUMNS = 26 * 2;
|
|
139
|
+
var RANGE_NOTATION = /^[A-Z]+[0-9]+(:[A-Z]+[0-9]+)?$/;
|
|
140
|
+
var isFormula = (value) => typeof value === "string" && value.charAt(0) === "=";
|
|
141
|
+
var posEquals = (a, b) => {
|
|
142
|
+
return a?.col === b?.col && a?.row === b?.row;
|
|
143
|
+
};
|
|
144
|
+
var columnLetter = (col) => {
|
|
145
|
+
(0, import_invariant2.invariant)(col < MAX_COLUMNS, `Invalid column: ${col}`, {
|
|
146
|
+
F: __dxlog_file,
|
|
147
|
+
L: 31,
|
|
148
|
+
S: void 0,
|
|
149
|
+
A: [
|
|
150
|
+
"col < MAX_COLUMNS",
|
|
151
|
+
"`Invalid column: ${col}`"
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
return (col >= 26 ? String.fromCharCode("A".charCodeAt(0) + Math.floor(col / 26) - 1) : "") + String.fromCharCode("A".charCodeAt(0) + col % 26);
|
|
155
|
+
};
|
|
156
|
+
var addressToA1Notation = ({ col, row }) => {
|
|
157
|
+
return `${columnLetter(col)}${row + 1}`;
|
|
158
|
+
};
|
|
159
|
+
var addressFromA1Notation = (ref) => {
|
|
160
|
+
const match = ref.match(/([A-Z]+)(\d+)/);
|
|
161
|
+
(0, import_invariant2.invariant)(match, `Invalid notation: ${ref}`, {
|
|
162
|
+
F: __dxlog_file,
|
|
163
|
+
L: 45,
|
|
164
|
+
S: void 0,
|
|
165
|
+
A: [
|
|
166
|
+
"match",
|
|
167
|
+
"`Invalid notation: ${ref}`"
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
return {
|
|
171
|
+
row: parseInt(match[2], 10) - 1,
|
|
172
|
+
col: match[1].split("").reduce((acc, c) => acc * 26 + c.charCodeAt(0) - "A".charCodeAt(0) + 1, 0) - 1
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
var rangeToA1Notation = (range) => {
|
|
176
|
+
return [
|
|
177
|
+
range?.from && addressToA1Notation(range?.from),
|
|
178
|
+
range?.to && addressToA1Notation(range?.to)
|
|
179
|
+
].filter(Boolean).join(":");
|
|
180
|
+
};
|
|
181
|
+
var inRange = (range, cell) => {
|
|
182
|
+
if (!range) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
const { from, to } = range;
|
|
186
|
+
if (from && posEquals(from, cell) || to && posEquals(to, cell)) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (!from || !to) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
const { col: c1, row: r1 } = from;
|
|
193
|
+
const { col: c2, row: r2 } = to;
|
|
194
|
+
const cMin = Math.min(c1, c2);
|
|
195
|
+
const cMax = Math.max(c1, c2);
|
|
196
|
+
const rMin = Math.min(r1, r2);
|
|
197
|
+
const rMax = Math.max(r1, r2);
|
|
198
|
+
const { col, row } = cell;
|
|
199
|
+
return col >= cMin && col <= cMax && row >= rMin && row <= rMax;
|
|
200
|
+
};
|
|
201
|
+
var ApiError = class extends Error {
|
|
202
|
+
};
|
|
203
|
+
var ReadonlyException = class extends ApiError {
|
|
204
|
+
};
|
|
205
|
+
var RangeException = class extends ApiError {
|
|
206
|
+
constructor(n) {
|
|
207
|
+
super();
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
var createIndex = (length = 8) => {
|
|
211
|
+
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
212
|
+
const charactersLength = characters.length;
|
|
213
|
+
const randomBuffer = (0, import_crypto.randomBytes)(length);
|
|
214
|
+
return Array.from(randomBuffer, (byte) => characters[byte % charactersLength]).join("");
|
|
215
|
+
};
|
|
216
|
+
var createIndices = (length) => Array.from({
|
|
217
|
+
length
|
|
218
|
+
}).map(() => createIndex());
|
|
219
|
+
var insertIndices = (indices, i, n, max) => {
|
|
220
|
+
if (i + n > max) {
|
|
221
|
+
throw new RangeException(i + n);
|
|
222
|
+
}
|
|
223
|
+
const idx = createIndices(n);
|
|
224
|
+
indices.splice(i, 0, ...idx);
|
|
225
|
+
return idx;
|
|
226
|
+
};
|
|
227
|
+
var initialize = (sheet, { rows = DEFAULT_ROWS, columns = DEFAULT_COLUMNS } = {}) => {
|
|
228
|
+
if (!sheet.rows.length) {
|
|
229
|
+
insertIndices(sheet.rows, 0, rows, MAX_ROWS);
|
|
230
|
+
}
|
|
231
|
+
if (!sheet.columns.length) {
|
|
232
|
+
insertIndices(sheet.columns, 0, columns, MAX_COLUMNS);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
var createSheet = ({ name, cells, ...size } = {}) => {
|
|
236
|
+
const sheet = (0, import_echo_schema2.create)(import_chunk_AWKOWDMI.SheetType, {
|
|
237
|
+
name,
|
|
238
|
+
cells: {},
|
|
239
|
+
rows: [],
|
|
240
|
+
columns: [],
|
|
241
|
+
rowMeta: {},
|
|
242
|
+
columnMeta: {},
|
|
243
|
+
ranges: [],
|
|
244
|
+
threads: []
|
|
245
|
+
});
|
|
246
|
+
initialize(sheet, size);
|
|
247
|
+
if (cells) {
|
|
248
|
+
Object.entries(cells).forEach(([key, { value }]) => {
|
|
249
|
+
const idx = addressToIndex(sheet, addressFromA1Notation(key));
|
|
250
|
+
sheet.cells[idx] = {
|
|
251
|
+
value
|
|
252
|
+
};
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return sheet;
|
|
256
|
+
};
|
|
257
|
+
var addressToIndex = (sheet, cell) => {
|
|
258
|
+
return `${sheet.columns[cell.col]}@${sheet.rows[cell.row]}`;
|
|
259
|
+
};
|
|
260
|
+
var addressFromIndex = (sheet, idx) => {
|
|
261
|
+
const [column, row] = idx.split("@");
|
|
262
|
+
return {
|
|
263
|
+
col: sheet.columns.indexOf(column),
|
|
264
|
+
row: sheet.rows.indexOf(row)
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
var rangeToIndex = (sheet, range) => {
|
|
268
|
+
return [
|
|
269
|
+
range.from,
|
|
270
|
+
range.to ?? range.from
|
|
271
|
+
].map((cell) => addressToIndex(sheet, cell)).join(":");
|
|
272
|
+
};
|
|
273
|
+
var rangeFromIndex = (sheet, idx) => {
|
|
274
|
+
const [from, to] = idx.split(":").map((index) => addressFromIndex(sheet, index));
|
|
275
|
+
return {
|
|
276
|
+
from,
|
|
277
|
+
to
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
var compareIndexPositions = (sheet, indexA, indexB) => {
|
|
281
|
+
const { row: rowA, col: columnA } = addressFromIndex(sheet, indexA);
|
|
282
|
+
const { row: rowB, col: columnB } = addressFromIndex(sheet, indexB);
|
|
283
|
+
if (rowA !== rowB) {
|
|
284
|
+
return rowA - rowB;
|
|
285
|
+
} else {
|
|
286
|
+
return columnA - columnB;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
var ComputeNode = class extends import_context2.Resource {
|
|
290
|
+
constructor(_graph, sheetId) {
|
|
291
|
+
super();
|
|
292
|
+
this._graph = _graph;
|
|
293
|
+
this.sheetId = sheetId;
|
|
294
|
+
this.update = new import_async2.Event();
|
|
295
|
+
}
|
|
296
|
+
get graph() {
|
|
297
|
+
return this._graph;
|
|
298
|
+
}
|
|
299
|
+
clear() {
|
|
300
|
+
this._graph.hf.clearSheet(this.sheetId);
|
|
301
|
+
}
|
|
302
|
+
getValue(cell) {
|
|
303
|
+
const value = this._graph.hf.getCellValue({
|
|
304
|
+
sheet: this.sheetId,
|
|
305
|
+
row: cell.row,
|
|
306
|
+
col: cell.col
|
|
307
|
+
});
|
|
308
|
+
if (value instanceof import_hyperformula2.DetailedCellError) {
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
return value;
|
|
312
|
+
}
|
|
313
|
+
setValue(cell, value) {
|
|
314
|
+
const mappedValue = isFormula(value) ? this._graph.mapFormulaToNative(value) : value;
|
|
315
|
+
this._graph.hf.setCellContents({
|
|
316
|
+
sheet: this.sheetId,
|
|
317
|
+
row: cell.row,
|
|
318
|
+
col: cell.col
|
|
319
|
+
}, [
|
|
320
|
+
[
|
|
321
|
+
mappedValue
|
|
322
|
+
]
|
|
323
|
+
]);
|
|
324
|
+
}
|
|
325
|
+
// TODO(burdon): Load data into sheet.
|
|
326
|
+
async _open() {
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-sheet/src/compute-graph/functions/async-function.ts";
|
|
65
330
|
var defaultFunctionContextOptions = {
|
|
66
331
|
defaultTtl: 5e3,
|
|
67
|
-
|
|
332
|
+
debounceDelay: 200,
|
|
68
333
|
remoteFunctionUrl: "https://edge.dxos.workers.dev/functions"
|
|
69
334
|
};
|
|
70
335
|
var FunctionContext = class _FunctionContext {
|
|
@@ -75,7 +340,7 @@ var FunctionContext = class _FunctionContext {
|
|
|
75
340
|
...args
|
|
76
341
|
});
|
|
77
342
|
}
|
|
78
|
-
constructor(_hf, _space,
|
|
343
|
+
constructor(_hf, _space, _options) {
|
|
79
344
|
this._hf = _hf;
|
|
80
345
|
this._space = _space;
|
|
81
346
|
this._cache = /* @__PURE__ */ new Map();
|
|
@@ -83,10 +348,16 @@ var FunctionContext = class _FunctionContext {
|
|
|
83
348
|
this._subscriptions = /* @__PURE__ */ new Map();
|
|
84
349
|
this._invocations = {};
|
|
85
350
|
this._options = (0, import_lodash.default)(_options ?? {}, defaultFunctionContextOptions);
|
|
86
|
-
this._onUpdate = (0,
|
|
351
|
+
this._onUpdate = (0, import_async3.debounce)((update) => {
|
|
352
|
+
(0, import_log2.log)("update", update, {
|
|
353
|
+
F: __dxlog_file2,
|
|
354
|
+
L: 86,
|
|
355
|
+
S: this,
|
|
356
|
+
C: (f, a) => f(...a)
|
|
357
|
+
});
|
|
87
358
|
this._hf.resumeEvaluation();
|
|
88
|
-
onUpdate(
|
|
89
|
-
}, this._options.
|
|
359
|
+
this._options.onUpdate?.(update);
|
|
360
|
+
}, this._options.debounceDelay);
|
|
90
361
|
}
|
|
91
362
|
get space() {
|
|
92
363
|
return this._space;
|
|
@@ -135,24 +406,27 @@ var FunctionContext = class _FunctionContext {
|
|
|
135
406
|
cell,
|
|
136
407
|
value: value2
|
|
137
408
|
}, {
|
|
138
|
-
F:
|
|
139
|
-
L:
|
|
409
|
+
F: __dxlog_file2,
|
|
410
|
+
L: 144,
|
|
140
411
|
S: this,
|
|
141
412
|
C: (f, a) => f(...a)
|
|
142
413
|
});
|
|
143
|
-
this._onUpdate(
|
|
414
|
+
this._onUpdate({
|
|
415
|
+
name,
|
|
416
|
+
cell
|
|
417
|
+
});
|
|
144
418
|
} catch (err) {
|
|
145
419
|
import_log2.log.warn("failed", {
|
|
146
420
|
cell,
|
|
147
421
|
err
|
|
148
422
|
}, {
|
|
149
|
-
F:
|
|
150
|
-
L:
|
|
423
|
+
F: __dxlog_file2,
|
|
424
|
+
L: 148,
|
|
151
425
|
S: this,
|
|
152
426
|
C: (f, a) => f(...a)
|
|
153
427
|
});
|
|
154
428
|
this._cache.set(invocationKey, {
|
|
155
|
-
value: new
|
|
429
|
+
value: new import_hyperformula3.CellError(import_hyperformula3.ErrorType.ERROR, "Function failed."),
|
|
156
430
|
ts: Date.now()
|
|
157
431
|
});
|
|
158
432
|
} finally {
|
|
@@ -166,60 +440,147 @@ var FunctionContext = class _FunctionContext {
|
|
|
166
440
|
args,
|
|
167
441
|
cache: value
|
|
168
442
|
}, {
|
|
169
|
-
F:
|
|
170
|
-
L:
|
|
443
|
+
F: __dxlog_file2,
|
|
444
|
+
L: 156,
|
|
171
445
|
S: this,
|
|
172
446
|
C: (f, a) => f(...a)
|
|
173
447
|
});
|
|
174
448
|
return value;
|
|
175
449
|
}
|
|
176
450
|
};
|
|
177
|
-
var
|
|
451
|
+
var AsyncFunctionPlugin = class extends import_hyperformula3.FunctionPlugin {
|
|
178
452
|
get context() {
|
|
179
453
|
return this.config.context;
|
|
180
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Immediately returns cached value then runs the async function.
|
|
457
|
+
*/
|
|
181
458
|
runAsyncFunction(ast, state, cb, options) {
|
|
182
459
|
const { procedureName } = ast;
|
|
183
460
|
const metadata = this.metadata(procedureName);
|
|
184
461
|
return this.runFunction(ast.args, state, metadata, (...args) => {
|
|
185
|
-
return this.context.invokeFunction(procedureName, state, args, cb, options) ??
|
|
462
|
+
return this.context.invokeFunction(procedureName, state, args, cb, options) ?? import_hyperformula3.EmptyValue;
|
|
186
463
|
});
|
|
187
464
|
}
|
|
188
465
|
};
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
466
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-sheet/src/compute-graph/functions/edge-function.ts";
|
|
467
|
+
var EDGE_FUNCTION_NAME = "DX";
|
|
468
|
+
var FUNCTION_TTL = 1e4;
|
|
469
|
+
var EdgeFunctionPlugin = class extends AsyncFunctionPlugin {
|
|
470
|
+
dx(ast, state) {
|
|
471
|
+
const handler = (subscribe = false) => async (binding, ...args) => {
|
|
472
|
+
const space = this.context.space;
|
|
473
|
+
if (!space) {
|
|
474
|
+
return new import_hyperformula4.CellError(import_hyperformula4.ErrorType.REF, "Missing space");
|
|
475
|
+
}
|
|
476
|
+
const { objects: [fn] } = await space.db.query(import_echo3.Filter.schema(import_types2.FunctionType, {
|
|
477
|
+
binding
|
|
478
|
+
})).run();
|
|
479
|
+
if (!fn) {
|
|
480
|
+
import_log3.log.info("Function not found", {
|
|
481
|
+
binding
|
|
482
|
+
}, {
|
|
483
|
+
F: __dxlog_file3,
|
|
484
|
+
L: 41,
|
|
485
|
+
S: this,
|
|
486
|
+
C: (f, a) => f(...a)
|
|
487
|
+
});
|
|
488
|
+
return new import_hyperformula4.CellError(import_hyperformula4.ErrorType.REF, "Function not found");
|
|
489
|
+
}
|
|
490
|
+
if (subscribe) {
|
|
491
|
+
const unsubscribe = (0, import_signals_core.effect)(() => {
|
|
492
|
+
(0, import_log3.log)("function changed", {
|
|
493
|
+
fn
|
|
494
|
+
}, {
|
|
495
|
+
F: __dxlog_file3,
|
|
496
|
+
L: 47,
|
|
497
|
+
S: this,
|
|
498
|
+
C: (f, a) => f(...a)
|
|
499
|
+
});
|
|
500
|
+
const _ = fn?.version;
|
|
501
|
+
this.runAsyncFunction(ast, state, handler(false), {
|
|
502
|
+
ttl: FUNCTION_TTL
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
this.context.createSubscription(ast.procedureName, unsubscribe);
|
|
506
|
+
}
|
|
507
|
+
const path = (0, import_edge.getUserFunctionUrlInMetadata)((0, import_echo3.getMeta)(fn));
|
|
508
|
+
const response = await fetch(`${this.context.remoteFunctionUrl}${path}`, {
|
|
509
|
+
method: "POST",
|
|
510
|
+
headers: {
|
|
511
|
+
"Content-Type": "application/json"
|
|
512
|
+
},
|
|
513
|
+
body: JSON.stringify({
|
|
514
|
+
args: args.filter(import_util2.nonNullable)
|
|
515
|
+
})
|
|
516
|
+
});
|
|
517
|
+
const result = await response.text();
|
|
518
|
+
(0, import_log3.log)("function executed", {
|
|
519
|
+
result
|
|
520
|
+
}, {
|
|
521
|
+
F: __dxlog_file3,
|
|
522
|
+
L: 65,
|
|
523
|
+
S: this,
|
|
524
|
+
C: (f, a) => f(...a)
|
|
525
|
+
});
|
|
526
|
+
return result;
|
|
527
|
+
};
|
|
528
|
+
return this.runAsyncFunction(ast, state, handler(true), {
|
|
529
|
+
ttl: FUNCTION_TTL
|
|
211
530
|
});
|
|
212
531
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
532
|
+
};
|
|
533
|
+
EdgeFunctionPlugin.implementedFunctions = {
|
|
534
|
+
[EDGE_FUNCTION_NAME]: {
|
|
535
|
+
method: "dx",
|
|
536
|
+
parameters: [
|
|
537
|
+
// Binding
|
|
538
|
+
{
|
|
539
|
+
argumentType: import_hyperformula4.FunctionArgumentType.STRING
|
|
540
|
+
},
|
|
541
|
+
// Remote function arguments (currently supporting up to 8).
|
|
542
|
+
{
|
|
543
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
544
|
+
optionalArg: true
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
548
|
+
optionalArg: true
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
552
|
+
optionalArg: true
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
556
|
+
optionalArg: true
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
560
|
+
optionalArg: true
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
564
|
+
optionalArg: true
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
568
|
+
optionalArg: true
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
argumentType: import_hyperformula4.FunctionArgumentType.ANY,
|
|
572
|
+
optionalArg: true
|
|
573
|
+
}
|
|
574
|
+
],
|
|
575
|
+
isVolatile: true
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
var EdgeFunctionPluginTranslations = {
|
|
579
|
+
enGB: {
|
|
580
|
+
[EDGE_FUNCTION_NAME]: "Remote function"
|
|
581
|
+
},
|
|
582
|
+
enUS: {
|
|
583
|
+
[EDGE_FUNCTION_NAME]: "Remote function"
|
|
223
584
|
}
|
|
224
585
|
};
|
|
225
586
|
var defaultFunctions = [
|
|
@@ -2594,666 +2955,309 @@ var defaultFunctions = [
|
|
|
2594
2955
|
section: "Text"
|
|
2595
2956
|
}
|
|
2596
2957
|
];
|
|
2597
|
-
var
|
|
2598
|
-
var
|
|
2599
|
-
var
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
A: [
|
|
2608
|
-
"column < MAX_COLUMNS",
|
|
2609
|
-
"`Invalid column: ${column}`"
|
|
2610
|
-
]
|
|
2611
|
-
});
|
|
2612
|
-
return (column >= 26 ? String.fromCharCode("A".charCodeAt(0) + Math.floor(column / 26) - 1) : "") + String.fromCharCode("A".charCodeAt(0) + column % 26);
|
|
2613
|
-
};
|
|
2614
|
-
var addressToA1Notation = ({ column, row }) => {
|
|
2615
|
-
return `${columnLetter(column)}${row + 1}`;
|
|
2616
|
-
};
|
|
2617
|
-
var addressFromA1Notation = (ref) => {
|
|
2618
|
-
const match = ref.match(/([A-Z]+)(\d+)/);
|
|
2619
|
-
(0, import_invariant2.invariant)(match, `Invalid notation: ${ref}`, {
|
|
2620
|
-
F: __dxlog_file3,
|
|
2621
|
-
L: 30,
|
|
2622
|
-
S: void 0,
|
|
2623
|
-
A: [
|
|
2624
|
-
"match",
|
|
2625
|
-
"`Invalid notation: ${ref}`"
|
|
2626
|
-
]
|
|
2627
|
-
});
|
|
2628
|
-
return {
|
|
2629
|
-
row: parseInt(match[2], 10) - 1,
|
|
2630
|
-
column: match[1].split("").reduce((acc, c) => acc * 26 + c.charCodeAt(0) - "A".charCodeAt(0) + 1, 0) - 1
|
|
2958
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-sheet/src/compute-graph/compute-graph.ts";
|
|
2959
|
+
var UNKNOWN_BINDING = "__UNKNOWN__";
|
|
2960
|
+
var createSheetName = ({ type, id }) => `${type}@${id}`;
|
|
2961
|
+
var parseSheetName = (name) => {
|
|
2962
|
+
const [type, id] = name.split("@");
|
|
2963
|
+
return id ? {
|
|
2964
|
+
type,
|
|
2965
|
+
id
|
|
2966
|
+
} : {
|
|
2967
|
+
id: type
|
|
2631
2968
|
};
|
|
2632
2969
|
};
|
|
2633
|
-
var
|
|
2634
|
-
|
|
2635
|
-
range?.from && addressToA1Notation(range?.from),
|
|
2636
|
-
range?.to && addressToA1Notation(range?.to)
|
|
2637
|
-
].filter(Boolean).join(":");
|
|
2638
|
-
};
|
|
2639
|
-
var inRange = (range, cell) => {
|
|
2640
|
-
if (!range) {
|
|
2641
|
-
return false;
|
|
2642
|
-
}
|
|
2643
|
-
const { from, to } = range;
|
|
2644
|
-
if (from && posEquals(from, cell) || to && posEquals(to, cell)) {
|
|
2645
|
-
return true;
|
|
2646
|
-
}
|
|
2647
|
-
if (!from || !to) {
|
|
2648
|
-
return false;
|
|
2649
|
-
}
|
|
2650
|
-
const { column: c1, row: r1 } = from;
|
|
2651
|
-
const { column: c2, row: r2 } = to;
|
|
2652
|
-
const cMin = Math.min(c1, c2);
|
|
2653
|
-
const cMax = Math.max(c1, c2);
|
|
2654
|
-
const rMin = Math.min(r1, r2);
|
|
2655
|
-
const rMax = Math.max(r1, r2);
|
|
2656
|
-
const { column, row } = cell;
|
|
2657
|
-
return column >= cMin && column <= cMax && row >= rMin && row <= rMax;
|
|
2658
|
-
};
|
|
2659
|
-
var ApiError = class extends Error {
|
|
2660
|
-
};
|
|
2661
|
-
var ReadonlyException = class extends ApiError {
|
|
2662
|
-
};
|
|
2663
|
-
var RangeException = class extends ApiError {
|
|
2664
|
-
constructor(n) {
|
|
2970
|
+
var ComputeGraph = class extends import_context.Resource {
|
|
2971
|
+
constructor(_hf, _space, _options) {
|
|
2665
2972
|
super();
|
|
2666
|
-
|
|
2667
|
-
};
|
|
2668
|
-
var createIndex = (length = 8) => {
|
|
2669
|
-
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
2670
|
-
const charactersLength = characters.length;
|
|
2671
|
-
const randomBuffer = (0, import_crypto.randomBytes)(length);
|
|
2672
|
-
return Array.from(randomBuffer, (byte) => characters[byte % charactersLength]).join("");
|
|
2673
|
-
};
|
|
2674
|
-
var createIndices = (length) => Array.from({
|
|
2675
|
-
length
|
|
2676
|
-
}).map(() => createIndex());
|
|
2677
|
-
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-sheet/src/model/model.ts";
|
|
2678
|
-
var DEFAULT_ROWS = 100;
|
|
2679
|
-
var DEFAULT_COLUMNS = 26;
|
|
2680
|
-
var typeMap = {
|
|
2681
|
-
BOOLEAN: import_chunk_DSYKOI4E.ValueTypeEnum.Boolean,
|
|
2682
|
-
NUMBER_RAW: import_chunk_DSYKOI4E.ValueTypeEnum.Number,
|
|
2683
|
-
NUMBER_PERCENT: import_chunk_DSYKOI4E.ValueTypeEnum.Percent,
|
|
2684
|
-
NUMBER_CURRENCY: import_chunk_DSYKOI4E.ValueTypeEnum.Currency,
|
|
2685
|
-
NUMBER_DATETIME: import_chunk_DSYKOI4E.ValueTypeEnum.DateTime,
|
|
2686
|
-
NUMBER_DATE: import_chunk_DSYKOI4E.ValueTypeEnum.Date,
|
|
2687
|
-
NUMBER_TIME: import_chunk_DSYKOI4E.ValueTypeEnum.Time
|
|
2688
|
-
};
|
|
2689
|
-
var defaultOptions = {
|
|
2690
|
-
rows: 50,
|
|
2691
|
-
columns: 26,
|
|
2692
|
-
mapFormulaBindingFromId: () => (formula) => formula,
|
|
2693
|
-
mapFormulaBindingToId: () => (formula) => formula
|
|
2694
|
-
};
|
|
2695
|
-
var getTopLeft = (range) => {
|
|
2696
|
-
const to = range.to ?? range.from;
|
|
2697
|
-
return {
|
|
2698
|
-
row: Math.min(range.from.row, to.row),
|
|
2699
|
-
column: Math.min(range.from.column, to.column)
|
|
2700
|
-
};
|
|
2701
|
-
};
|
|
2702
|
-
var toSimpleCellAddress = (sheet, cell) => ({
|
|
2703
|
-
sheet,
|
|
2704
|
-
row: cell.row,
|
|
2705
|
-
col: cell.column
|
|
2706
|
-
});
|
|
2707
|
-
var toModelRange = (sheet, range) => ({
|
|
2708
|
-
start: toSimpleCellAddress(sheet, range.from),
|
|
2709
|
-
end: toSimpleCellAddress(sheet, range.to ?? range.from)
|
|
2710
|
-
});
|
|
2711
|
-
var SheetModel = class {
|
|
2712
|
-
constructor(_graph, _sheet, _space, options = {}) {
|
|
2713
|
-
this._graph = _graph;
|
|
2714
|
-
this._sheet = _sheet;
|
|
2973
|
+
this._hf = _hf;
|
|
2715
2974
|
this._space = _space;
|
|
2716
|
-
this.
|
|
2717
|
-
this.
|
|
2718
|
-
this.
|
|
2719
|
-
this.
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
this.
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2975
|
+
this._options = _options;
|
|
2976
|
+
this.id = `graph-${import_keys.PublicKey.random().truncate()}`;
|
|
2977
|
+
this._nodes = /* @__PURE__ */ new Map();
|
|
2978
|
+
this._remoteFunctions = [];
|
|
2979
|
+
this.update = new import_async.Event();
|
|
2980
|
+
const contextOptions = {
|
|
2981
|
+
...this._options,
|
|
2982
|
+
onUpdate: (update) => {
|
|
2983
|
+
this._options?.onUpdate?.(update);
|
|
2984
|
+
this.update.emit({
|
|
2985
|
+
type: "valuesUpdated"
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2728
2988
|
};
|
|
2729
|
-
this.
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2989
|
+
this.context = new FunctionContext(this._hf, this._space, contextOptions);
|
|
2990
|
+
this._hf.updateConfig({
|
|
2991
|
+
context: this.context
|
|
2992
|
+
});
|
|
2993
|
+
const onValuesUpdate = (changes) => {
|
|
2994
|
+
for (const change of changes) {
|
|
2995
|
+
if (change instanceof import_hyperformula.ExportedCellChange) {
|
|
2996
|
+
const { sheet } = change;
|
|
2997
|
+
const node = this._nodes.get(sheet);
|
|
2998
|
+
if (node) {
|
|
2999
|
+
node.update.emit({
|
|
3000
|
+
type: "valuesUpdated",
|
|
3001
|
+
change
|
|
3002
|
+
});
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
2744
3006
|
};
|
|
3007
|
+
this._hf.on("valuesUpdated", onValuesUpdate);
|
|
3008
|
+
this._ctx.onDispose(() => this._hf.off("valuesUpdated", onValuesUpdate));
|
|
2745
3009
|
}
|
|
2746
|
-
get
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
3010
|
+
get hf() {
|
|
3011
|
+
return this._hf;
|
|
3012
|
+
}
|
|
3013
|
+
getFunctions({ standard, echo } = {
|
|
3014
|
+
standard: true,
|
|
3015
|
+
echo: true
|
|
3016
|
+
}) {
|
|
2753
3017
|
return [
|
|
2754
|
-
...
|
|
2755
|
-
|
|
3018
|
+
...standard ? this._hf.getRegisteredFunctionNames().map((name) => defaultFunctions.find((fn) => fn.name === name) ?? {
|
|
3019
|
+
name
|
|
3020
|
+
}) : [],
|
|
3021
|
+
...echo ? this._remoteFunctions.map((fn) => ({
|
|
3022
|
+
name: fn.binding
|
|
3023
|
+
})) : []
|
|
2756
3024
|
];
|
|
2757
3025
|
}
|
|
2758
|
-
get initialized() {
|
|
2759
|
-
return !!this._ctx;
|
|
2760
|
-
}
|
|
2761
3026
|
/**
|
|
2762
|
-
*
|
|
3027
|
+
* Get or create cell representing a sheet.
|
|
2763
3028
|
*/
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
3029
|
+
// TODO(burdon): Async (open node).
|
|
3030
|
+
// The graph should be an extensible factory that plugins extend with model constructors.
|
|
3031
|
+
// This would enable on-the-fly instantiation of new models when then are referenced.
|
|
3032
|
+
// E.g., Cross-object reference would be stored as "ObjectId!A1"
|
|
3033
|
+
// The graph would then load the object and create a ComputeNode (model) of the appropriate type.
|
|
3034
|
+
getOrCreateNode(name) {
|
|
3035
|
+
(0, import_invariant.invariant)(name.length, void 0, {
|
|
2768
3036
|
F: __dxlog_file4,
|
|
2769
|
-
L:
|
|
2770
|
-
S: this,
|
|
2771
|
-
C: (f, a) => f(...a)
|
|
2772
|
-
});
|
|
2773
|
-
(0, import_invariant.invariant)(!this.initialized, "Already initialized.", {
|
|
2774
|
-
F: __dxlog_file4,
|
|
2775
|
-
L: 143,
|
|
3037
|
+
L: 129,
|
|
2776
3038
|
S: this,
|
|
2777
3039
|
A: [
|
|
2778
|
-
"
|
|
2779
|
-
"
|
|
3040
|
+
"name.length",
|
|
3041
|
+
""
|
|
2780
3042
|
]
|
|
2781
3043
|
});
|
|
2782
|
-
this.
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
}
|
|
2792
|
-
this.reset();
|
|
2793
|
-
const unsubscribe = this._graph.update.on(() => this.update.emit());
|
|
2794
|
-
this._ctx.onDispose(unsubscribe);
|
|
2795
|
-
if (this._space) {
|
|
2796
|
-
const { Filter } = await import("@dxos/client/echo");
|
|
2797
|
-
const { FunctionType } = await import("@dxos/plugin-script/types");
|
|
2798
|
-
const query = this._space?.db.query(Filter.schema(FunctionType));
|
|
2799
|
-
const unsubscribe2 = query.subscribe(({ objects }) => {
|
|
2800
|
-
this._functions = objects.filter((fn) => fn.binding);
|
|
2801
|
-
this.update.emit();
|
|
3044
|
+
if (!this._hf.doesSheetExist(name)) {
|
|
3045
|
+
(0, import_log.log)("created node", {
|
|
3046
|
+
space: this._space?.id,
|
|
3047
|
+
sheet: name
|
|
3048
|
+
}, {
|
|
3049
|
+
F: __dxlog_file4,
|
|
3050
|
+
L: 131,
|
|
3051
|
+
S: this,
|
|
3052
|
+
C: (f, a) => f(...a)
|
|
2802
3053
|
});
|
|
2803
|
-
this.
|
|
3054
|
+
this._hf.addSheet(name);
|
|
2804
3055
|
}
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
async destroy() {
|
|
2808
|
-
(0, import_log3.log)("destroy", {
|
|
2809
|
-
id: this.id
|
|
2810
|
-
}, {
|
|
3056
|
+
const sheetId = this._hf.getSheetId(name);
|
|
3057
|
+
(0, import_invariant.invariant)(sheetId !== void 0, void 0, {
|
|
2811
3058
|
F: __dxlog_file4,
|
|
2812
|
-
L:
|
|
3059
|
+
L: 136,
|
|
2813
3060
|
S: this,
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
await this._ctx.dispose();
|
|
2818
|
-
this._ctx = void 0;
|
|
2819
|
-
}
|
|
2820
|
-
}
|
|
2821
|
-
/**
|
|
2822
|
-
* Update engine.
|
|
2823
|
-
* NOTE: This resets the undo history.
|
|
2824
|
-
* @deprecated
|
|
2825
|
-
*/
|
|
2826
|
-
reset() {
|
|
2827
|
-
this._graph.hf.clearSheet(this._sheetId);
|
|
2828
|
-
Object.entries(this._sheet.cells).forEach(([key, { value }]) => {
|
|
2829
|
-
const { column, row } = this.addressFromIndex(key);
|
|
2830
|
-
if (typeof value === "string" && value.charAt(0) === "=") {
|
|
2831
|
-
value = this.mapFormulaBindingToFormula(this.mapFormulaBindingFromId(this.mapFormulaIndicesToRefs(value)));
|
|
2832
|
-
}
|
|
2833
|
-
this._graph.hf.setCellContents({
|
|
2834
|
-
sheet: this._sheetId,
|
|
2835
|
-
row,
|
|
2836
|
-
col: column
|
|
2837
|
-
}, value);
|
|
2838
|
-
});
|
|
2839
|
-
}
|
|
2840
|
-
/**
|
|
2841
|
-
* Recalculate formulas.
|
|
2842
|
-
* NOTE: This resets the undo history.
|
|
2843
|
-
* https://hyperformula.handsontable.com/guide/volatile-functions.html#volatile-actions
|
|
2844
|
-
* @deprecated
|
|
2845
|
-
*/
|
|
2846
|
-
// TODO(burdon): Remove.
|
|
2847
|
-
recalculate() {
|
|
2848
|
-
this._graph.hf.rebuildAndRecalculate();
|
|
2849
|
-
}
|
|
2850
|
-
insertRows(i, n = 1) {
|
|
2851
|
-
this._insertIndices(this._sheet.rows, i, n, DEFAULT_ROWS);
|
|
2852
|
-
this.reset();
|
|
2853
|
-
}
|
|
2854
|
-
insertColumns(i, n = 1) {
|
|
2855
|
-
this._insertIndices(this._sheet.columns, i, n, DEFAULT_COLUMNS);
|
|
2856
|
-
this.reset();
|
|
2857
|
-
}
|
|
2858
|
-
//
|
|
2859
|
-
// Undoable actions.
|
|
2860
|
-
// TODO(burdon): Group undoable methods; consistently update hf/sheet.
|
|
2861
|
-
//
|
|
2862
|
-
/**
|
|
2863
|
-
* Clear range of values.
|
|
2864
|
-
*/
|
|
2865
|
-
clear(range) {
|
|
2866
|
-
const topLeft = getTopLeft(range);
|
|
2867
|
-
const values = this._iterRange(range, () => null);
|
|
2868
|
-
this._graph.hf.setCellContents(toSimpleCellAddress(this._sheetId, topLeft), values);
|
|
2869
|
-
this._iterRange(range, (cell) => {
|
|
2870
|
-
const idx = this.addressToIndex(cell);
|
|
2871
|
-
delete this._sheet.cells[idx];
|
|
2872
|
-
});
|
|
2873
|
-
}
|
|
2874
|
-
cut(range) {
|
|
2875
|
-
this._graph.hf.cut(toModelRange(this._sheetId, range));
|
|
2876
|
-
this._iterRange(range, (cell) => {
|
|
2877
|
-
const idx = this.addressToIndex(cell);
|
|
2878
|
-
delete this._sheet.cells[idx];
|
|
2879
|
-
});
|
|
2880
|
-
}
|
|
2881
|
-
copy(range) {
|
|
2882
|
-
this._graph.hf.copy(toModelRange(this._sheetId, range));
|
|
2883
|
-
}
|
|
2884
|
-
paste(cell) {
|
|
2885
|
-
if (!this._graph.hf.isClipboardEmpty()) {
|
|
2886
|
-
const changes = this._graph.hf.paste(toSimpleCellAddress(this._sheetId, cell));
|
|
2887
|
-
for (const change of changes) {
|
|
2888
|
-
if (change instanceof import_hyperformula3.ExportedCellChange) {
|
|
2889
|
-
const { address, newValue } = change;
|
|
2890
|
-
const idx = this.addressToIndex({
|
|
2891
|
-
row: address.row,
|
|
2892
|
-
column: address.col
|
|
2893
|
-
});
|
|
2894
|
-
this._sheet.cells[idx] = {
|
|
2895
|
-
value: newValue
|
|
2896
|
-
};
|
|
2897
|
-
}
|
|
2898
|
-
}
|
|
2899
|
-
}
|
|
2900
|
-
}
|
|
2901
|
-
// TODO(burdon): Display undo/redo state.
|
|
2902
|
-
undo() {
|
|
2903
|
-
if (this._graph.hf.isThereSomethingToUndo()) {
|
|
2904
|
-
this._graph.hf.undo();
|
|
2905
|
-
this.update.emit();
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
redo() {
|
|
2909
|
-
if (this._graph.hf.isThereSomethingToRedo()) {
|
|
2910
|
-
this._graph.hf.redo();
|
|
2911
|
-
this.update.emit();
|
|
2912
|
-
}
|
|
2913
|
-
}
|
|
2914
|
-
/**
|
|
2915
|
-
* Get value from sheet.
|
|
2916
|
-
*/
|
|
2917
|
-
getCellValue(cell) {
|
|
2918
|
-
const idx = this.addressToIndex(cell);
|
|
2919
|
-
return this._sheet.cells[idx]?.value ?? null;
|
|
2920
|
-
}
|
|
2921
|
-
/**
|
|
2922
|
-
* Get value as a string for editing.
|
|
2923
|
-
*/
|
|
2924
|
-
getCellText(cell) {
|
|
2925
|
-
const value = this.getCellValue(cell);
|
|
2926
|
-
if (value == null) {
|
|
2927
|
-
return void 0;
|
|
2928
|
-
}
|
|
2929
|
-
if (typeof value === "string" && value.charAt(0) === "=") {
|
|
2930
|
-
return this.mapFormulaBindingFromId(this.mapFormulaIndicesToRefs(value));
|
|
2931
|
-
} else {
|
|
2932
|
-
return String(value);
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
/**
|
|
2936
|
-
* Get array of raw values from sheet.
|
|
2937
|
-
*/
|
|
2938
|
-
getCellValues(range) {
|
|
2939
|
-
return this._iterRange(range, (cell) => this.getCellValue(cell));
|
|
2940
|
-
}
|
|
2941
|
-
/**
|
|
2942
|
-
* Gets the regular or computed value from the engine.
|
|
2943
|
-
*/
|
|
2944
|
-
getValue(cell) {
|
|
2945
|
-
const value = this._graph.hf.getCellValue(toSimpleCellAddress(this._sheetId, cell));
|
|
2946
|
-
if (value instanceof import_hyperformula3.DetailedCellError) {
|
|
2947
|
-
return value.toString();
|
|
2948
|
-
}
|
|
2949
|
-
return value;
|
|
2950
|
-
}
|
|
2951
|
-
/**
|
|
2952
|
-
* Get value type.
|
|
2953
|
-
*/
|
|
2954
|
-
getValueType(cell) {
|
|
2955
|
-
const addr = toSimpleCellAddress(this._sheetId, cell);
|
|
2956
|
-
const type = this._graph.hf.getCellValueDetailedType(addr);
|
|
2957
|
-
return typeMap[type];
|
|
2958
|
-
}
|
|
2959
|
-
/**
|
|
2960
|
-
* Sets the value, updating the sheet and engine.
|
|
2961
|
-
*/
|
|
2962
|
-
setValue(cell, value) {
|
|
2963
|
-
if (this._options.readonly) {
|
|
2964
|
-
throw new ReadonlyException();
|
|
2965
|
-
}
|
|
2966
|
-
let refresh = false;
|
|
2967
|
-
if (cell.row >= this._sheet.rows.length) {
|
|
2968
|
-
this._insertIndices(this._sheet.rows, cell.row, 1, DEFAULT_ROWS);
|
|
2969
|
-
refresh = true;
|
|
2970
|
-
}
|
|
2971
|
-
if (cell.column >= this._sheet.columns.length) {
|
|
2972
|
-
this._insertIndices(this._sheet.columns, cell.column, 1, DEFAULT_COLUMNS);
|
|
2973
|
-
refresh = true;
|
|
2974
|
-
}
|
|
2975
|
-
if (refresh) {
|
|
2976
|
-
this.reset();
|
|
2977
|
-
}
|
|
2978
|
-
this._graph.hf.setCellContents({
|
|
2979
|
-
sheet: this._sheetId,
|
|
2980
|
-
row: cell.row,
|
|
2981
|
-
col: cell.column
|
|
2982
|
-
}, [
|
|
2983
|
-
[
|
|
2984
|
-
typeof value === "string" && value.charAt(0) === "=" ? this.mapFormulaBindingToFormula(value) : value
|
|
3061
|
+
A: [
|
|
3062
|
+
"sheetId !== undefined",
|
|
3063
|
+
""
|
|
2985
3064
|
]
|
|
2986
|
-
]);
|
|
2987
|
-
const idx = this.addressToIndex(cell);
|
|
2988
|
-
if (value === void 0 || value === null) {
|
|
2989
|
-
delete this._sheet.cells[idx];
|
|
2990
|
-
} else {
|
|
2991
|
-
if (typeof value === "string" && value.charAt(0) === "=") {
|
|
2992
|
-
value = this.mapFormulaBindingToId(this.mapFormulaRefsToIndices(value));
|
|
2993
|
-
}
|
|
2994
|
-
this._sheet.cells[idx] = {
|
|
2995
|
-
value
|
|
2996
|
-
};
|
|
2997
|
-
}
|
|
2998
|
-
}
|
|
2999
|
-
/**
|
|
3000
|
-
* Sets values from a simple map.
|
|
3001
|
-
*/
|
|
3002
|
-
setValues(values) {
|
|
3003
|
-
Object.entries(values).forEach(([key, { value }]) => {
|
|
3004
|
-
this.setValue(addressFromA1Notation(key), value);
|
|
3005
3065
|
});
|
|
3066
|
+
const node = new ComputeNode(this, sheetId);
|
|
3067
|
+
this._nodes.set(sheetId, node);
|
|
3068
|
+
return node;
|
|
3006
3069
|
}
|
|
3007
3070
|
/**
|
|
3008
|
-
*
|
|
3071
|
+
* Map bound value to custom function invocation.
|
|
3072
|
+
* E.g., "HELLO(...args)" => "DX("HELLO", ...args)".
|
|
3009
3073
|
*/
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
row,
|
|
3026
|
-
column
|
|
3027
|
-
});
|
|
3028
|
-
if (value !== void 0) {
|
|
3029
|
-
rowCells.push(value);
|
|
3074
|
+
mapFormulaToNative(formula) {
|
|
3075
|
+
return formula.replace(/['"]?([ \w]+)['"]?!/, (_match, name) => {
|
|
3076
|
+
if (name) {
|
|
3077
|
+
const objects = this._hf.getSheetNames().map((name2) => {
|
|
3078
|
+
const { type, id } = parseSheetName(name2);
|
|
3079
|
+
return type && id ? this._space?.db.getObjectById(id) : void 0;
|
|
3080
|
+
}).filter(import_util.nonNullable);
|
|
3081
|
+
for (const obj of objects) {
|
|
3082
|
+
if (obj.name === name) {
|
|
3083
|
+
const type = (0, import_echo_schema.getTypename)(obj);
|
|
3084
|
+
return `'${createSheetName({
|
|
3085
|
+
type,
|
|
3086
|
+
id: obj.id
|
|
3087
|
+
})}'!`;
|
|
3088
|
+
}
|
|
3030
3089
|
}
|
|
3031
3090
|
}
|
|
3032
|
-
|
|
3033
|
-
}
|
|
3034
|
-
|
|
3035
|
-
}
|
|
3036
|
-
/**
|
|
3037
|
-
*
|
|
3038
|
-
*/
|
|
3039
|
-
// TODO(burdon): Insert indices into sheet.
|
|
3040
|
-
_insertIndices(indices, i, n, max) {
|
|
3041
|
-
if (i + n > max) {
|
|
3042
|
-
throw new RangeException(i + n);
|
|
3043
|
-
}
|
|
3044
|
-
const idx = createIndices(n);
|
|
3045
|
-
indices.splice(i, 0, ...idx);
|
|
3046
|
-
}
|
|
3047
|
-
// TODO(burdon): Delete index.
|
|
3048
|
-
_deleteIndices(indices, i, n) {
|
|
3049
|
-
throw new Error("Not implemented");
|
|
3050
|
-
}
|
|
3051
|
-
// TODO(burdon): Move. Cannot use fractional without changing. Switch back to using unique IDs?
|
|
3052
|
-
_moveIndices(indices, i, j, n) {
|
|
3053
|
-
throw new Error("Not implemented");
|
|
3054
|
-
}
|
|
3055
|
-
//
|
|
3056
|
-
// Indices.
|
|
3057
|
-
//
|
|
3058
|
-
/**
|
|
3059
|
-
* E.g., "A1" => "x1@y1".
|
|
3060
|
-
*/
|
|
3061
|
-
addressToIndex(cell) {
|
|
3062
|
-
return `${this._sheet.columns[cell.column]}@${this._sheet.rows[cell.row]}`;
|
|
3063
|
-
}
|
|
3064
|
-
/**
|
|
3065
|
-
* E.g., "x1@y1" => "A1".
|
|
3066
|
-
*/
|
|
3067
|
-
addressFromIndex(idx) {
|
|
3068
|
-
const [column, row] = idx.split("@");
|
|
3069
|
-
return {
|
|
3070
|
-
column: this._sheet.columns.indexOf(column),
|
|
3071
|
-
row: this._sheet.rows.indexOf(row)
|
|
3072
|
-
};
|
|
3073
|
-
}
|
|
3074
|
-
/**
|
|
3075
|
-
* E.g., "A1:B2" => "x1@y1:x2@y2".
|
|
3076
|
-
*/
|
|
3077
|
-
rangeToIndex(range) {
|
|
3078
|
-
return [
|
|
3079
|
-
range.from,
|
|
3080
|
-
range.to ?? range.from
|
|
3081
|
-
].map((cell) => this.addressToIndex(cell)).join(":");
|
|
3082
|
-
}
|
|
3083
|
-
/**
|
|
3084
|
-
* E.g., "x1@y1:x2@y2" => "A1:B2".
|
|
3085
|
-
*/
|
|
3086
|
-
rangeFromIndex(idx) {
|
|
3087
|
-
const [from, to] = idx.split(":").map((idx2) => this.addressFromIndex(idx2));
|
|
3088
|
-
return {
|
|
3089
|
-
from,
|
|
3090
|
-
to
|
|
3091
|
-
};
|
|
3092
|
-
}
|
|
3093
|
-
/**
|
|
3094
|
-
* E.g., "HELLO()" => "EDGE("HELLO")".
|
|
3095
|
-
*/
|
|
3096
|
-
mapFormulaBindingToFormula(formula) {
|
|
3097
|
-
return formula.replace(/([a-zA-Z0-9]+)\((.*)\)/g, (match, binding, args) => {
|
|
3098
|
-
const fn = this._functions.find((fn2) => fn2.binding === binding);
|
|
3091
|
+
return `${name}!`;
|
|
3092
|
+
}).replace(/(\w+)\((.*)\)/g, (match, binding, args) => {
|
|
3093
|
+
const fn = this._remoteFunctions.find((fn2) => fn2.binding === binding);
|
|
3099
3094
|
if (!fn) {
|
|
3100
3095
|
return match;
|
|
3101
3096
|
}
|
|
3102
3097
|
if (args.trim() === "") {
|
|
3103
|
-
return
|
|
3098
|
+
return `${EDGE_FUNCTION_NAME}("${binding}")`;
|
|
3099
|
+
} else {
|
|
3100
|
+
return `${EDGE_FUNCTION_NAME}("${binding}", ${args})`;
|
|
3104
3101
|
}
|
|
3105
|
-
return `EDGE("${binding}", ${args})`;
|
|
3106
3102
|
});
|
|
3107
3103
|
}
|
|
3108
3104
|
/**
|
|
3109
|
-
*
|
|
3105
|
+
* Map from binding to fully qualified ECHO ID (to store).
|
|
3106
|
+
* E.g., HELLO() => spaceId:objectId()
|
|
3110
3107
|
*/
|
|
3111
|
-
|
|
3112
|
-
return formula.replace(/
|
|
3113
|
-
if (
|
|
3114
|
-
return
|
|
3108
|
+
mapFunctionBindingToId(formula) {
|
|
3109
|
+
return formula.replace(/(\w+)\((.*)\)/g, (match, binding, args) => {
|
|
3110
|
+
if (binding === EDGE_FUNCTION_NAME || defaultFunctions.find((fn2) => fn2.name === binding)) {
|
|
3111
|
+
return match;
|
|
3112
|
+
}
|
|
3113
|
+
const fn = this._remoteFunctions.find((fn2) => fn2.binding === binding);
|
|
3114
|
+
if (fn) {
|
|
3115
|
+
const id = (0, import_echo.fullyQualifiedId)(fn);
|
|
3116
|
+
return `${id}(${args})`;
|
|
3117
|
+
} else {
|
|
3118
|
+
return match;
|
|
3115
3119
|
}
|
|
3116
|
-
return `${binding}(${args.slice(2)})`;
|
|
3117
|
-
});
|
|
3118
|
-
}
|
|
3119
|
-
/**
|
|
3120
|
-
* Map from binding to fully qualified ECHO ID.
|
|
3121
|
-
*/
|
|
3122
|
-
mapFormulaBindingToId(formula) {
|
|
3123
|
-
return this._options.mapFormulaBindingToId(this._functions)(formula);
|
|
3124
|
-
}
|
|
3125
|
-
/**
|
|
3126
|
-
* Map from fully qualified ECHO ID to binding.
|
|
3127
|
-
*/
|
|
3128
|
-
mapFormulaBindingFromId(formula) {
|
|
3129
|
-
return this._options.mapFormulaBindingFromId(this._functions)(formula);
|
|
3130
|
-
}
|
|
3131
|
-
/**
|
|
3132
|
-
* Map from A1 notation to indices.
|
|
3133
|
-
*/
|
|
3134
|
-
mapFormulaRefsToIndices(formula) {
|
|
3135
|
-
(0, import_invariant.invariant)(formula.charAt(0) === "=", void 0, {
|
|
3136
|
-
F: __dxlog_file4,
|
|
3137
|
-
L: 509,
|
|
3138
|
-
S: this,
|
|
3139
|
-
A: [
|
|
3140
|
-
"formula.charAt(0) === '='",
|
|
3141
|
-
""
|
|
3142
|
-
]
|
|
3143
|
-
});
|
|
3144
|
-
return formula.replace(/([a-zA-Z]+)([0-9]+)/g, (match) => {
|
|
3145
|
-
return this.addressToIndex(addressFromA1Notation(match));
|
|
3146
3120
|
});
|
|
3147
3121
|
}
|
|
3148
3122
|
/**
|
|
3149
|
-
* Map from
|
|
3123
|
+
* Map from fully qualified ECHO ID to binding (from store).
|
|
3124
|
+
* E.g., spaceId:objectId() => HELLO()
|
|
3150
3125
|
*/
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3126
|
+
mapFunctionBindingFromId(formula) {
|
|
3127
|
+
const binding = formula.replace(/(\w+):([a-zA-Z0-9]+)\((.*)\)/g, (match, spaceId, objectId, args) => {
|
|
3128
|
+
const id = `${spaceId}:${objectId}`;
|
|
3129
|
+
if (id.length !== import_echo2.FQ_ID_LENGTH) {
|
|
3130
|
+
return match;
|
|
3131
|
+
}
|
|
3132
|
+
const fn = this._remoteFunctions.find((fn2) => (0, import_echo.fullyQualifiedId)(fn2) === id);
|
|
3133
|
+
if (fn?.binding) {
|
|
3134
|
+
return `${fn.binding}(${args})`;
|
|
3135
|
+
} else {
|
|
3136
|
+
return UNKNOWN_BINDING;
|
|
3137
|
+
}
|
|
3163
3138
|
});
|
|
3139
|
+
if (binding.startsWith(`=${UNKNOWN_BINDING}`)) {
|
|
3140
|
+
return void 0;
|
|
3141
|
+
} else {
|
|
3142
|
+
return binding;
|
|
3143
|
+
}
|
|
3164
3144
|
}
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
}
|
|
3177
|
-
toDateTime(num) {
|
|
3178
|
-
return this._graph.hf.numberToDateTime(num);
|
|
3179
|
-
}
|
|
3180
|
-
toDate(num) {
|
|
3181
|
-
return this._graph.hf.numberToDate(num);
|
|
3145
|
+
async _open() {
|
|
3146
|
+
if (this._space) {
|
|
3147
|
+
const query = this._space.db.query(import_echo.Filter.schema(import_types.FunctionType));
|
|
3148
|
+
const unsubscribe = query.subscribe(({ objects }) => {
|
|
3149
|
+
this._remoteFunctions = objects.filter(({ binding }) => binding);
|
|
3150
|
+
this.update.emit({
|
|
3151
|
+
type: "functionsUpdated"
|
|
3152
|
+
});
|
|
3153
|
+
});
|
|
3154
|
+
this._ctx.onDispose(unsubscribe);
|
|
3155
|
+
}
|
|
3182
3156
|
}
|
|
3183
|
-
|
|
3184
|
-
|
|
3157
|
+
async _close() {
|
|
3158
|
+
for (const node of this._nodes.values()) {
|
|
3159
|
+
await node.close();
|
|
3160
|
+
}
|
|
3185
3161
|
}
|
|
3186
3162
|
};
|
|
3187
|
-
var
|
|
3188
|
-
|
|
3163
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-sheet/src/compute-graph/compute-graph-registry.ts";
|
|
3164
|
+
var defaultOptions = {
|
|
3165
|
+
licenseKey: "gpl-v3"
|
|
3189
3166
|
};
|
|
3190
|
-
var
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
};
|
|
3195
|
-
return this.runAsyncFunction(ast, state, handler);
|
|
3167
|
+
var defaultPlugins = [
|
|
3168
|
+
{
|
|
3169
|
+
plugin: EdgeFunctionPlugin,
|
|
3170
|
+
translations: EdgeFunctionPluginTranslations
|
|
3196
3171
|
}
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
if (!rate) {
|
|
3208
|
-
return NaN;
|
|
3209
|
-
}
|
|
3210
|
-
return parseNumberString(rate);
|
|
3211
|
-
};
|
|
3212
|
-
return this.runAsyncFunction(ast, state, handler, {
|
|
3213
|
-
ttl: 1e4
|
|
3172
|
+
];
|
|
3173
|
+
var ComputeGraphRegistry = class extends import_context3.Resource {
|
|
3174
|
+
constructor(options = {
|
|
3175
|
+
plugins: defaultPlugins
|
|
3176
|
+
}) {
|
|
3177
|
+
super();
|
|
3178
|
+
this._graphs = /* @__PURE__ */ new Map();
|
|
3179
|
+
this._options = (0, import_lodash2.default)({}, options, defaultOptions);
|
|
3180
|
+
this._options.plugins?.forEach(({ plugin, translations }) => {
|
|
3181
|
+
import_hyperformula5.HyperFormula.registerFunctionPlugin(plugin, translations);
|
|
3214
3182
|
});
|
|
3215
3183
|
}
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
}
|
|
3230
|
-
|
|
3231
|
-
|
|
3184
|
+
getGraph(spaceId) {
|
|
3185
|
+
return this._graphs.get(spaceId);
|
|
3186
|
+
}
|
|
3187
|
+
getOrCreateGraph(space) {
|
|
3188
|
+
let graph = this._graphs.get(space.id);
|
|
3189
|
+
if (!graph) {
|
|
3190
|
+
(0, import_log4.log)("create graph", {
|
|
3191
|
+
space: space.id
|
|
3192
|
+
}, {
|
|
3193
|
+
F: __dxlog_file5,
|
|
3194
|
+
L: 69,
|
|
3195
|
+
S: this,
|
|
3196
|
+
C: (f, a) => f(...a)
|
|
3197
|
+
});
|
|
3198
|
+
graph = this.createGraph(space);
|
|
3199
|
+
}
|
|
3200
|
+
return graph;
|
|
3232
3201
|
}
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3202
|
+
createGraph(space) {
|
|
3203
|
+
(0, import_invariant3.invariant)(!this._graphs.has(space.id), `ComputeGraph already exists for space: ${space.id}`, {
|
|
3204
|
+
F: __dxlog_file5,
|
|
3205
|
+
L: 77,
|
|
3206
|
+
S: this,
|
|
3207
|
+
A: [
|
|
3208
|
+
"!this._graphs.has(space.id)",
|
|
3209
|
+
"`ComputeGraph already exists for space: ${space.id}`"
|
|
3210
|
+
]
|
|
3211
|
+
});
|
|
3212
|
+
const hf = import_hyperformula5.HyperFormula.buildEmpty(this._options);
|
|
3213
|
+
const graph = new ComputeGraph(hf, space, this._options);
|
|
3214
|
+
this._graphs.set(space.id, graph);
|
|
3215
|
+
return graph;
|
|
3216
|
+
}
|
|
3217
|
+
async _close() {
|
|
3218
|
+
for (const graph of this._graphs.values()) {
|
|
3219
|
+
await graph.close();
|
|
3220
|
+
}
|
|
3221
|
+
this._graphs.clear();
|
|
3242
3222
|
}
|
|
3243
3223
|
};
|
|
3244
3224
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3245
3225
|
0 && (module.exports = {
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3226
|
+
AsyncFunctionPlugin,
|
|
3227
|
+
ComputeGraph,
|
|
3228
|
+
ComputeGraphRegistry,
|
|
3229
|
+
ComputeNode,
|
|
3230
|
+
DEFAULT_COLUMNS,
|
|
3231
|
+
DEFAULT_ROWS,
|
|
3232
|
+
EDGE_FUNCTION_NAME,
|
|
3233
|
+
EdgeFunctionPlugin,
|
|
3234
|
+
EdgeFunctionPluginTranslations,
|
|
3235
|
+
FunctionContext,
|
|
3236
|
+
MAX_COLUMNS,
|
|
3237
|
+
MAX_ROWS,
|
|
3238
|
+
RANGE_NOTATION,
|
|
3239
|
+
ReadonlyException,
|
|
3250
3240
|
addressFromA1Notation,
|
|
3241
|
+
addressFromIndex,
|
|
3251
3242
|
addressToA1Notation,
|
|
3252
|
-
|
|
3253
|
-
|
|
3243
|
+
addressToIndex,
|
|
3244
|
+
alignKey,
|
|
3245
|
+
cellClassNameForRange,
|
|
3246
|
+
compareIndexPositions,
|
|
3247
|
+
createSheet,
|
|
3248
|
+
createSheetName,
|
|
3249
|
+
defaultFunctionContextOptions,
|
|
3254
3250
|
defaultFunctions,
|
|
3251
|
+
defaultOptions,
|
|
3252
|
+
defaultPlugins,
|
|
3255
3253
|
inRange,
|
|
3256
|
-
|
|
3257
|
-
|
|
3254
|
+
initialize,
|
|
3255
|
+
insertIndices,
|
|
3256
|
+
isFormula,
|
|
3257
|
+
parseSheetName,
|
|
3258
|
+
rangeFromIndex,
|
|
3259
|
+
rangeToA1Notation,
|
|
3260
|
+
rangeToIndex,
|
|
3261
|
+
styleKey
|
|
3258
3262
|
});
|
|
3259
|
-
//# sourceMappingURL=chunk-
|
|
3263
|
+
//# sourceMappingURL=chunk-O7XR4R7Y.cjs.map
|