@dxos/plugin-sheet 0.6.12-main.15a606f → 0.6.12-main.2d19bf1
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-NDNIS44E.mjs +265 -0
- package/dist/lib/browser/SheetContainer-NDNIS44E.mjs.map +7 -0
- package/dist/lib/browser/chunk-AQSGDA4X.mjs +1614 -0
- package/dist/lib/browser/chunk-AQSGDA4X.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QILRZNE5.mjs → chunk-D3QTX46O.mjs} +4 -5
- package/dist/lib/browser/chunk-D3QTX46O.mjs.map +7 -0
- package/dist/lib/browser/{chunk-T3NJFTD4.mjs → chunk-GKI67SEF.mjs} +20 -26
- package/dist/lib/browser/chunk-GKI67SEF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6ZMQVB4Z.mjs → chunk-GSV5QNLD.mjs} +220 -177
- package/dist/lib/browser/chunk-GSV5QNLD.mjs.map +7 -0
- package/dist/lib/browser/graph-M4IQ76QX.mjs +33 -0
- package/dist/lib/browser/index.mjs +41 -22
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types.mjs +4 -8
- package/dist/lib/node/SheetContainer-YSQGJD7K.cjs +276 -0
- package/dist/lib/node/SheetContainer-YSQGJD7K.cjs.map +7 -0
- package/dist/lib/node/{chunk-DD6FIXWC.cjs → chunk-5XPK2V4A.cjs} +222 -175
- package/dist/lib/node/chunk-5XPK2V4A.cjs.map +7 -0
- package/dist/lib/node/chunk-6F43RV45.cjs +1610 -0
- package/dist/lib/node/chunk-6F43RV45.cjs.map +7 -0
- package/dist/lib/node/{chunk-Q3HBHPRL.cjs → chunk-ER3PM7GD.cjs} +26 -34
- package/dist/lib/node/chunk-ER3PM7GD.cjs.map +7 -0
- package/dist/lib/node/{chunk-BNARJ5GM.cjs → chunk-QIFIGEKV.cjs} +6 -7
- package/dist/lib/node/chunk-QIFIGEKV.cjs.map +7 -0
- package/dist/lib/node/graph-Q3N2X26H.cjs +55 -0
- package/dist/lib/node/graph-Q3N2X26H.cjs.map +7 -0
- package/dist/lib/node/index.cjs +61 -44
- package/dist/lib/node/index.cjs.map +3 -3
- 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 +8 -12
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/SheetContainer-M7WRMZDU.mjs +266 -0
- package/dist/lib/node-esm/SheetContainer-M7WRMZDU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-D6KU5MI7.mjs → chunk-5WPZCXNS.mjs} +220 -177
- package/dist/lib/node-esm/chunk-5WPZCXNS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ELTFPX5B.mjs +1615 -0
- package/dist/lib/node-esm/chunk-ELTFPX5B.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IU2L277A.mjs → chunk-VCYJWE3O.mjs} +4 -5
- package/dist/lib/node-esm/chunk-VCYJWE3O.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BMNA27EX.mjs → chunk-ZVLLQ2PJ.mjs} +20 -26
- package/dist/lib/node-esm/chunk-ZVLLQ2PJ.mjs.map +7 -0
- package/dist/lib/node-esm/graph-SMPUMOV2.mjs +34 -0
- package/dist/lib/node-esm/index.mjs +41 -22
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -1
- package/dist/lib/node-esm/types.mjs +4 -8
- package/dist/types/src/SheetPlugin.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 +1 -8
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -1
- package/dist/types/src/components/{CellEditor/CellEditor.stories.d.ts → GridSheet/SheetCellEditor.stories.d.ts} +2 -2
- 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 +13 -3
- package/dist/types/src/components/GridSheet/util.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +6 -0
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -0
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +11 -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 +27 -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 +31 -17
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +1 -1
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/defs/types.d.ts.map +1 -1
- package/dist/types/src/defs/util.d.ts +1 -1
- package/dist/types/src/defs/util.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.d.ts +3 -2
- package/dist/types/src/extensions/compute.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- 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 +1 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -1
- package/dist/types/src/graph/compute-graph-registry.d.ts +34 -0
- package/dist/types/src/graph/compute-graph-registry.d.ts.map +1 -0
- package/dist/types/src/graph/compute-graph.d.ts +17 -34
- package/dist/types/src/graph/compute-graph.d.ts.map +1 -1
- package/dist/types/src/graph/compute-graph.stories.d.ts.map +1 -1
- package/dist/types/src/graph/compute-graph.test.d.ts +2 -0
- package/dist/types/src/graph/compute-graph.test.d.ts.map +1 -0
- package/dist/types/src/graph/compute-node.d.ts +9 -2
- package/dist/types/src/graph/compute-node.d.ts.map +1 -1
- package/dist/types/src/graph/{async-function.d.ts → functions/async-function.d.ts} +13 -4
- package/dist/types/src/graph/functions/async-function.d.ts.map +1 -0
- package/dist/types/src/graph/functions/edge-function.d.ts +21 -0
- package/dist/types/src/graph/functions/edge-function.d.ts.map +1 -0
- package/dist/types/src/graph/functions/function-defs.d.ts.map +1 -0
- package/dist/types/src/graph/functions/index.d.ts +4 -0
- package/dist/types/src/graph/functions/index.d.ts.map +1 -0
- package/dist/types/src/graph/index.d.ts +2 -1
- package/dist/types/src/graph/index.d.ts.map +1 -1
- package/dist/types/src/graph/testing/index.d.ts +3 -0
- package/dist/types/src/graph/testing/index.d.ts.map +1 -0
- package/dist/types/src/graph/testing/test-builder.d.ts +15 -0
- package/dist/types/src/graph/testing/test-builder.d.ts.map +1 -0
- package/dist/types/src/graph/testing/test-plugin.d.ts +36 -0
- package/dist/types/src/graph/testing/test-plugin.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/threads.d.ts +8 -0
- package/dist/types/src/hooks/threads.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeGraph.d.ts.map +1 -1
- package/dist/types/src/hooks/useSheetModel.d.ts +2 -2
- package/dist/types/src/hooks/useSheetModel.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -6
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/{components/Sheet → model}/decorations.d.ts +1 -0
- package/dist/types/src/model/decorations.d.ts.map +1 -0
- package/dist/types/src/model/formatting-model.d.ts +3 -0
- package/dist/types/src/model/formatting-model.d.ts.map +1 -1
- package/dist/types/src/model/index.d.ts +1 -0
- package/dist/types/src/model/index.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +6 -5
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- 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/testing/testing.d.ts +4 -5
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +17 -31
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +42 -41
- package/src/SheetPlugin.tsx +22 -17
- package/src/components/FunctionEditor/FunctionEditor.tsx +45 -0
- package/src/components/FunctionEditor/index.ts +5 -0
- package/src/components/GridSheet/GridSheet.stories.tsx +11 -5
- package/src/components/GridSheet/GridSheet.tsx +78 -70
- package/src/components/{CellEditor/CellEditor.stories.tsx → GridSheet/SheetCellEditor.stories.tsx} +4 -5
- package/src/components/{Sheet → GridSheet}/index.ts +1 -1
- package/src/components/GridSheet/util.ts +94 -39
- package/src/components/SheetContainer/SheetContainer.stories.tsx +40 -0
- package/src/components/SheetContainer/SheetContainer.tsx +52 -0
- package/src/components/SheetContainer/index.ts +7 -0
- package/src/components/{Sheet/sheet-context.tsx → SheetContext/SheetContext.tsx} +48 -28
- package/src/components/SheetContext/index.ts +5 -0
- package/src/components/Toolbar/Toolbar.tsx +127 -86
- package/src/components/index.ts +2 -1
- package/src/defs/types.ts +1 -0
- package/src/defs/util.ts +20 -4
- package/src/extensions/compute.stories.tsx +23 -23
- package/src/extensions/compute.ts +91 -42
- package/src/{components/CellEditor → extensions/editor}/extension.test.ts +0 -1
- package/src/{components/CellEditor → extensions/editor}/extension.ts +4 -3
- package/src/{components/CellEditor → extensions/editor}/index.ts +0 -1
- package/src/extensions/index.ts +1 -0
- package/src/graph/compute-graph-registry.ts +90 -0
- package/src/graph/compute-graph.stories.tsx +4 -3
- package/src/graph/compute-graph.test.ts +87 -0
- package/src/graph/compute-graph.ts +73 -121
- package/src/graph/compute-node.ts +17 -5
- package/src/graph/{async-function.ts → functions/async-function.ts} +23 -15
- package/src/graph/{edge-function.ts → functions/edge-function.ts} +14 -13
- package/src/graph/functions/index.ts +7 -0
- package/src/graph/hyperformula.test.ts +1 -2
- package/src/graph/index.ts +2 -1
- package/src/graph/testing/index.ts +6 -0
- package/src/graph/testing/test-builder.ts +54 -0
- package/src/graph/{custom-function.ts → testing/test-plugin.ts} +43 -9
- package/src/hooks/hooks.stories.tsx +3 -3
- package/src/hooks/index.ts +1 -0
- package/src/{components/Sheet/threads.tsx → hooks/threads.ts} +26 -84
- package/src/hooks/useComputeGraph.ts +9 -1
- package/src/hooks/useSheetModel.ts +4 -7
- package/src/{meta.tsx → meta.ts} +3 -3
- package/src/{components/Sheet → model}/decorations.ts +2 -0
- package/src/model/formatting-model.ts +12 -9
- package/src/model/index.ts +1 -0
- package/src/model/sheet-model.test.ts +57 -0
- package/src/model/sheet-model.ts +60 -41
- package/src/testing/testing.tsx +17 -15
- package/src/types.ts +12 -38
- package/dist/lib/browser/SheetContainer-V4GCCZTX.mjs +0 -261
- package/dist/lib/browser/SheetContainer-V4GCCZTX.mjs.map +0 -7
- package/dist/lib/browser/chunk-6ZMQVB4Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-QILRZNE5.mjs.map +0 -7
- package/dist/lib/browser/chunk-T3NJFTD4.mjs.map +0 -7
- package/dist/lib/browser/chunk-U2JHW3L6.mjs +0 -2552
- package/dist/lib/browser/chunk-U2JHW3L6.mjs.map +0 -7
- package/dist/lib/browser/graph-T27BOBOV.mjs +0 -21
- package/dist/lib/node/SheetContainer-3ZY7MPWJ.cjs +0 -279
- package/dist/lib/node/SheetContainer-3ZY7MPWJ.cjs.map +0 -7
- package/dist/lib/node/chunk-BNARJ5GM.cjs.map +0 -7
- package/dist/lib/node/chunk-DD6FIXWC.cjs.map +0 -7
- package/dist/lib/node/chunk-OTTD7FBK.cjs +0 -2536
- package/dist/lib/node/chunk-OTTD7FBK.cjs.map +0 -7
- package/dist/lib/node/chunk-Q3HBHPRL.cjs.map +0 -7
- package/dist/lib/node/graph-SPKGX7W4.cjs +0 -43
- package/dist/lib/node/graph-SPKGX7W4.cjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-PXSJX6XK.mjs +0 -262
- package/dist/lib/node-esm/SheetContainer-PXSJX6XK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7HVSOTGA.mjs +0 -2553
- package/dist/lib/node-esm/chunk-7HVSOTGA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BMNA27EX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D6KU5MI7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IU2L277A.mjs.map +0 -7
- package/dist/lib/node-esm/graph-U67IO4UC.mjs +0 -22
- package/dist/types/src/components/CellEditor/CellEditor.d.ts +0 -34
- 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.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/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 -53
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/decorations.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 -26
- package/dist/types/src/components/Sheet/sheet-context.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/threads.d.ts +0 -2
- package/dist/types/src/components/Sheet/threads.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 -8
- 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/graph/async-function.d.ts.map +0 -1
- package/dist/types/src/graph/compute-graph.browser.test.d.ts +0 -2
- package/dist/types/src/graph/compute-graph.browser.test.d.ts.map +0 -1
- package/dist/types/src/graph/custom-function.d.ts +0 -21
- package/dist/types/src/graph/custom-function.d.ts.map +0 -1
- package/dist/types/src/graph/edge-function.d.ts +0 -20
- package/dist/types/src/graph/edge-function.d.ts.map +0 -1
- package/dist/types/src/graph/function-defs.d.ts.map +0 -1
- package/src/components/CellEditor/CellEditor.tsx +0 -163
- package/src/components/Sheet/Sheet.stories.tsx +0 -250
- package/src/components/Sheet/Sheet.tsx +0 -1199
- package/src/components/Sheet/grid.ts +0 -191
- package/src/components/Sheet/nav.ts +0 -157
- package/src/components/Sheet/util.ts +0 -56
- package/src/components/SheetContainer.tsx +0 -88
- package/src/components/Toolbar/common.tsx +0 -72
- package/src/graph/compute-graph.browser.test.ts +0 -104
- /package/dist/lib/browser/{graph-T27BOBOV.mjs.map → graph-M4IQ76QX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{graph-U67IO4UC.mjs.map → graph-SMPUMOV2.mjs.map} +0 -0
- /package/dist/types/src/{components/CellEditor → extensions/editor}/extension.d.ts +0 -0
- /package/dist/types/src/{components/CellEditor → extensions/editor}/extension.test.d.ts +0 -0
- /package/dist/types/src/graph/{function-defs.d.ts → functions/function-defs.d.ts} +0 -0
- /package/src/graph/{function-defs.ts → functions/function-defs.ts} +0 -0
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export declare const SHEET_PLUGIN = "dxos.org/plugin/sheet";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
id: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
homePage?: string;
|
|
8
|
-
tags?: string[];
|
|
9
|
-
icon?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
icon: string;
|
|
10
7
|
};
|
|
11
8
|
export default _default;
|
|
12
9
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,0BAA0B,CAAC;;;;;;;AAEpD,wBAKuB"}
|
|
@@ -21,4 +21,5 @@ export declare const createDecorations: () => {
|
|
|
21
21
|
readonly getDecorationsForCell: (cellIndex: string) => Decoration[] | undefined;
|
|
22
22
|
readonly getAllDecorations: () => Decoration[];
|
|
23
23
|
};
|
|
24
|
+
export type Decorations = ReturnType<typeof createDecorations>;
|
|
24
25
|
//# sourceMappingURL=decorations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorations.d.ts","sourceRoot":"","sources":["../../../../src/model/decorations.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IACrE;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,iBAAiB;wCAMM,MAAM,aAAa,UAAU;2CAI1B,MAAM,SAAS,MAAM;gDAShB,MAAM,KAAG,UAAU,EAAE,GAAG,SAAS;sCAI7C,UAAU,EAAE;CAgB3C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting-model.d.ts","sourceRoot":"","sources":["../../../../src/model/formatting-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"formatting-model.d.ts","sourceRoot":"","sources":["../../../../src/model/formatting-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,KAAK,WAAW,EAAW,MAAM,SAAS,CAAC;AAGpD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU;CA0F7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/model/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/model/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type SimpleDate, type SimpleDateTime } from 'hyperformula/typings/DateTimeHelper';
|
|
2
2
|
import { Event } from '@dxos/async';
|
|
3
3
|
import { Resource } from '@dxos/context';
|
|
4
|
+
import { FieldValueType } from '@dxos/schema';
|
|
4
5
|
import { type CellAddress, type CellRange } from '../defs';
|
|
5
|
-
import { type ComputeGraph } from '../graph';
|
|
6
|
-
import { type CellScalarValue, type CellValue, type SheetType
|
|
6
|
+
import { type ComputeGraph, type ComputeNodeEvent } from '../graph';
|
|
7
|
+
import { type CellScalarValue, type CellValue, type SheetType } from '../types';
|
|
7
8
|
export type SheetModelOptions = {
|
|
8
9
|
readonly?: boolean;
|
|
9
10
|
};
|
|
@@ -17,8 +18,8 @@ export declare class SheetModel extends Resource {
|
|
|
17
18
|
private readonly _sheet;
|
|
18
19
|
private readonly _options;
|
|
19
20
|
readonly id: string;
|
|
20
|
-
readonly update: Event<
|
|
21
|
-
private
|
|
21
|
+
readonly update: Event<ComputeNodeEvent>;
|
|
22
|
+
private _node?;
|
|
22
23
|
constructor(_graph: ComputeGraph, _sheet: SheetType, _options?: SheetModelOptions);
|
|
23
24
|
get graph(): ComputeGraph;
|
|
24
25
|
get sheet(): SheetType;
|
|
@@ -74,7 +75,7 @@ export declare class SheetModel extends Resource {
|
|
|
74
75
|
/**
|
|
75
76
|
* Get value type.
|
|
76
77
|
*/
|
|
77
|
-
getValueType(cell: CellAddress):
|
|
78
|
+
getValueType(cell: CellAddress): FieldValueType;
|
|
78
79
|
/**
|
|
79
80
|
* Sets the value, updating the sheet and engine.
|
|
80
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet-model.d.ts","sourceRoot":"","sources":["../../../../src/model/sheet-model.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE3F,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet-model.d.ts","sourceRoot":"","sources":["../../../../src/model/sheet-model.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE3F,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAoB,KAAK,YAAY,EAAmB,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACvG,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AA6BhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AAEH,qBAAa,UAAW,SAAQ,QAAQ;IASpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MA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Ac;IAKtB,OAAO,CAAC,YAAY;IAQpB;;OAEG;IACH,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAOhD;;OAEG;IACH,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAWhD;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK9B,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc;IAKvC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAK/B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;CAIhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-model.test.d.ts","sourceRoot":"","sources":["../../../../src/model/sheet-model.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Decorator } from '@storybook/react';
|
|
2
2
|
import { type Space } from '@dxos/react-client/echo';
|
|
3
|
-
import { type ComputeGraph } from '../graph';
|
|
3
|
+
import { type ComputeGraph, type ComputeGraphOptions } from '../graph';
|
|
4
4
|
import { type CellValue, type CreateSheetOptions } from '../types';
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const createCells: () => Record<string, CellValue>;
|
|
5
|
+
export declare const createTestCells: () => Record<string, CellValue>;
|
|
7
6
|
export declare const useTestSheet: (space?: Space, graph?: ComputeGraph, options?: CreateSheetOptions) => import("../types").SheetType | undefined;
|
|
8
|
-
export declare const
|
|
7
|
+
export declare const withComputeGraphDecorator: (options?: ComputeGraphOptions) => Decorator;
|
|
9
8
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/testing/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/testing/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKrD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInE,eAAO,MAAM,eAAe,QAAO,MAAM,CAAC,MAAM,EAAE,SAAS,CA0BzD,CAAC;AAEH,eAAO,MAAM,YAAY,WAAY,KAAK,UAAU,YAAY,YAAY,kBAAkB,6CAW7F,CAAC;AAEF,eAAO,MAAM,yBAAyB,aACzB,mBAAmB,KAAG,SAQhC,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { type SchemaProvides } from '@dxos/plugin-client';
|
|
|
4
4
|
import { type MarkdownExtensionProvides } from '@dxos/plugin-markdown';
|
|
5
5
|
import { type SpaceInitProvides } from '@dxos/plugin-space';
|
|
6
6
|
import { type StackProvides } from '@dxos/plugin-stack';
|
|
7
|
+
import { FieldValueType } from '@dxos/schema';
|
|
7
8
|
export declare enum SheetAction {
|
|
8
9
|
CREATE = "dxos.org/plugin/sheet/action/create"
|
|
9
10
|
}
|
|
@@ -19,25 +20,9 @@ export declare const CellValue: S.Struct<{
|
|
|
19
20
|
value: typeof S.Any;
|
|
20
21
|
}>;
|
|
21
22
|
export type CellValue = S.Schema.Type<typeof CellValue>;
|
|
22
|
-
/**
|
|
23
|
-
* https://www.tutorialsteacher.com/typescript/typescript-number
|
|
24
|
-
*/
|
|
25
|
-
export declare enum ValueTypeEnum {
|
|
26
|
-
Null = 0,
|
|
27
|
-
Number = 1,
|
|
28
|
-
Boolean = 2,
|
|
29
|
-
String = 3,
|
|
30
|
-
Percent = 10,
|
|
31
|
-
Currency = 11,
|
|
32
|
-
DateTime = 20,
|
|
33
|
-
Date = 21,
|
|
34
|
-
Time = 22,
|
|
35
|
-
URL = 30,
|
|
36
|
-
DID = 31
|
|
37
|
-
}
|
|
38
|
-
export declare const ValueType: S.Enums<typeof ValueTypeEnum>;
|
|
39
23
|
export declare const Formatting: S.Struct<{
|
|
40
|
-
|
|
24
|
+
range: typeof S.String;
|
|
25
|
+
type: S.optional<S.Enums<typeof FieldValueType>>;
|
|
41
26
|
format: S.optional<typeof S.String>;
|
|
42
27
|
precision: S.optional<typeof S.Number>;
|
|
43
28
|
classNames: S.optional<S.Array$<typeof S.String>>;
|
|
@@ -47,7 +32,7 @@ export declare const RowColumnMeta: S.Struct<{
|
|
|
47
32
|
size: S.optional<typeof S.Number>;
|
|
48
33
|
}>;
|
|
49
34
|
declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
50
|
-
|
|
35
|
+
name?: string | undefined;
|
|
51
36
|
cells: {
|
|
52
37
|
[x: string]: {
|
|
53
38
|
value: any;
|
|
@@ -66,13 +51,12 @@ declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
|
66
51
|
};
|
|
67
52
|
};
|
|
68
53
|
formatting: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
54
|
+
readonly range: string;
|
|
55
|
+
readonly type?: FieldValueType | undefined;
|
|
56
|
+
readonly format?: string | undefined;
|
|
57
|
+
readonly precision?: number | undefined;
|
|
58
|
+
readonly classNames?: readonly string[] | undefined;
|
|
59
|
+
}[];
|
|
76
60
|
threads?: import("@dxos/echo-schema").Ref<{
|
|
77
61
|
name?: string | undefined;
|
|
78
62
|
anchor?: string | undefined;
|
|
@@ -109,7 +93,7 @@ declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
|
109
93
|
} & {
|
|
110
94
|
id: string;
|
|
111
95
|
}, S.Struct.Encoded<{
|
|
112
|
-
|
|
96
|
+
name: S.optional<typeof S.String>;
|
|
113
97
|
cells: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
114
98
|
value: typeof S.Any;
|
|
115
99
|
}>>>>;
|
|
@@ -121,12 +105,13 @@ declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
|
121
105
|
columnMeta: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
122
106
|
size: S.optional<typeof S.Number>;
|
|
123
107
|
}>>>>;
|
|
124
|
-
formatting: S.mutable<S.
|
|
125
|
-
|
|
108
|
+
formatting: S.mutable<S.Array$<S.Struct<{
|
|
109
|
+
range: typeof S.String;
|
|
110
|
+
type: S.optional<S.Enums<typeof FieldValueType>>;
|
|
126
111
|
format: S.optional<typeof S.String>;
|
|
127
112
|
precision: S.optional<typeof S.Number>;
|
|
128
113
|
classNames: S.optional<S.Array$<typeof S.String>>;
|
|
129
|
-
}
|
|
114
|
+
}>>>;
|
|
130
115
|
threads: S.optional<S.mutable<S.Array$<ref<{
|
|
131
116
|
name?: string | undefined;
|
|
132
117
|
anchor?: string | undefined;
|
|
@@ -168,7 +153,8 @@ export type SheetSize = {
|
|
|
168
153
|
columns: number;
|
|
169
154
|
};
|
|
170
155
|
export type CreateSheetOptions = {
|
|
171
|
-
|
|
156
|
+
name?: string;
|
|
157
|
+
cells?: Record<string, CellValue>;
|
|
172
158
|
} & Partial<SheetSize>;
|
|
173
159
|
export {};
|
|
174
160
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,yBAA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plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -57,54 +57,56 @@
|
|
|
57
57
|
"src"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@codemirror/autocomplete": "^6.18.
|
|
61
|
-
"@codemirror/language": "^6.10.
|
|
60
|
+
"@codemirror/autocomplete": "^6.18.1",
|
|
61
|
+
"@codemirror/language": "^6.10.3",
|
|
62
62
|
"@codemirror/state": "^6.4.1",
|
|
63
|
-
"@codemirror/view": "^6.
|
|
63
|
+
"@codemirror/view": "^6.34.1",
|
|
64
64
|
"@dnd-kit/core": "^6.0.5",
|
|
65
65
|
"@dnd-kit/modifiers": "^6.0.0",
|
|
66
66
|
"@dnd-kit/sortable": "^7.0.1",
|
|
67
67
|
"@dnd-kit/utilities": "^3.2.0",
|
|
68
|
-
"@
|
|
69
|
-
"@lezer/
|
|
68
|
+
"@effect/schema": "^0.75.1",
|
|
69
|
+
"@lezer/common": "^1.2.2",
|
|
70
|
+
"@lezer/highlight": "^1.2.1",
|
|
70
71
|
"@lezer/lezer": "^1.1.2",
|
|
71
72
|
"@lezer/lr": "^1.4.2",
|
|
72
73
|
"@preact/signals-core": "^1.6.0",
|
|
73
74
|
"@radix-ui/react-context": "^1.0.0",
|
|
74
75
|
"@tanstack/react-virtual": "^3.9.0",
|
|
75
76
|
"codemirror-lang-spreadsheet": "^1.3.0",
|
|
77
|
+
"date-fns": "^3.3.1",
|
|
76
78
|
"hyperformula": "^2.7.1",
|
|
77
79
|
"lodash.defaultsdeep": "^4.6.1",
|
|
78
80
|
"re-resizable": "^6.9.17",
|
|
79
81
|
"react-markdown": "^8.0.5",
|
|
80
82
|
"react-resize-detector": "^11.0.1",
|
|
81
|
-
"@dxos/app-framework": "0.6.12-main.
|
|
82
|
-
"@dxos/async": "0.6.12-main.
|
|
83
|
-
"@dxos/client": "0.6.12-main.
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/debug": "0.6.12-main.
|
|
87
|
-
"@dxos/echo-schema": "0.6.12-main.
|
|
88
|
-
"@dxos/invariant": "0.6.12-main.
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/plugin-attention": "0.6.12-main.
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/plugin-client": "0.6.12-main.
|
|
93
|
-
"@dxos/plugin-graph": "0.6.12-main.
|
|
94
|
-
"@dxos/plugin-markdown": "0.6.12-main.
|
|
95
|
-
"@dxos/plugin-script": "0.6.12-main.
|
|
96
|
-
"@dxos/plugin-space": "0.6.12-main.
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/react-
|
|
100
|
-
"@dxos/react-ui-attention": "0.6.12-main.
|
|
101
|
-
"@dxos/react-ui-editor": "0.6.12-main.
|
|
102
|
-
"@dxos/react-ui-grid": "0.6.12-main.
|
|
103
|
-
"@dxos/util": "0.6.12-main.
|
|
83
|
+
"@dxos/app-framework": "0.6.12-main.2d19bf1",
|
|
84
|
+
"@dxos/async": "0.6.12-main.2d19bf1",
|
|
85
|
+
"@dxos/client": "0.6.12-main.2d19bf1",
|
|
86
|
+
"@dxos/context": "0.6.12-main.2d19bf1",
|
|
87
|
+
"@dxos/crypto": "0.6.12-main.2d19bf1",
|
|
88
|
+
"@dxos/debug": "0.6.12-main.2d19bf1",
|
|
89
|
+
"@dxos/echo-schema": "0.6.12-main.2d19bf1",
|
|
90
|
+
"@dxos/invariant": "0.6.12-main.2d19bf1",
|
|
91
|
+
"@dxos/log": "0.6.12-main.2d19bf1",
|
|
92
|
+
"@dxos/plugin-attention": "0.6.12-main.2d19bf1",
|
|
93
|
+
"@dxos/keys": "0.6.12-main.2d19bf1",
|
|
94
|
+
"@dxos/plugin-client": "0.6.12-main.2d19bf1",
|
|
95
|
+
"@dxos/plugin-graph": "0.6.12-main.2d19bf1",
|
|
96
|
+
"@dxos/plugin-markdown": "0.6.12-main.2d19bf1",
|
|
97
|
+
"@dxos/plugin-script": "0.6.12-main.2d19bf1",
|
|
98
|
+
"@dxos/plugin-space": "0.6.12-main.2d19bf1",
|
|
99
|
+
"@dxos/plugin-stack": "0.6.12-main.2d19bf1",
|
|
100
|
+
"@dxos/react-hooks": "0.6.12-main.2d19bf1",
|
|
101
|
+
"@dxos/react-client": "0.6.12-main.2d19bf1",
|
|
102
|
+
"@dxos/react-ui-attention": "0.6.12-main.2d19bf1",
|
|
103
|
+
"@dxos/react-ui-editor": "0.6.12-main.2d19bf1",
|
|
104
|
+
"@dxos/react-ui-grid": "0.6.12-main.2d19bf1",
|
|
105
|
+
"@dxos/util": "0.6.12-main.2d19bf1",
|
|
106
|
+
"@dxos/schema": "0.6.12-main.2d19bf1"
|
|
104
107
|
},
|
|
105
108
|
"devDependencies": {
|
|
106
109
|
"@lezer/generator": "^1.7.1",
|
|
107
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
108
110
|
"@tldraw/indices": "^2.0.0-alpha.14",
|
|
109
111
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
110
112
|
"@types/react": "~18.2.0",
|
|
@@ -113,20 +115,19 @@
|
|
|
113
115
|
"react": "~18.2.0",
|
|
114
116
|
"react-dom": "~18.2.0",
|
|
115
117
|
"vite": "5.4.7",
|
|
116
|
-
"@dxos/echo-generator": "0.6.12-main.
|
|
117
|
-
"@dxos/random": "0.6.12-main.
|
|
118
|
-
"@dxos/react-ui": "0.6.12-main.
|
|
119
|
-
"@dxos/react-ui-
|
|
120
|
-
"@dxos/react-ui-types": "0.6.12-main.
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/
|
|
118
|
+
"@dxos/echo-generator": "0.6.12-main.2d19bf1",
|
|
119
|
+
"@dxos/random": "0.6.12-main.2d19bf1",
|
|
120
|
+
"@dxos/react-ui": "0.6.12-main.2d19bf1",
|
|
121
|
+
"@dxos/react-ui-theme": "0.6.12-main.2d19bf1",
|
|
122
|
+
"@dxos/react-ui-types": "0.6.12-main.2d19bf1",
|
|
123
|
+
"@dxos/storybook-utils": "0.6.12-main.2d19bf1",
|
|
124
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.12-main.2d19bf1"
|
|
123
125
|
},
|
|
124
|
-
"
|
|
125
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
126
|
+
"peerDependencies": {
|
|
126
127
|
"react": "~18.2.0",
|
|
127
128
|
"react-dom": "~18.2.0",
|
|
128
|
-
"@dxos/react-ui": "0.6.12-main.
|
|
129
|
-
"@dxos/react-ui-theme": "0.6.12-main.
|
|
129
|
+
"@dxos/react-ui": "0.6.12-main.2d19bf1",
|
|
130
|
+
"@dxos/react-ui-theme": "0.6.12-main.2d19bf1"
|
|
130
131
|
},
|
|
131
132
|
"publishConfig": {
|
|
132
133
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { GridNine } from '@phosphor-icons/react';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
|
|
8
7
|
import { NavigationAction, parseIntentPlugin, resolvePlugin, type PluginDefinition } from '@dxos/app-framework';
|
|
@@ -12,16 +11,19 @@ import { createExtension, isActionGroup, type ActionGroup } from '@dxos/plugin-g
|
|
|
12
11
|
import { FunctionType } from '@dxos/plugin-script/types';
|
|
13
12
|
import { SpaceAction } from '@dxos/plugin-space';
|
|
14
13
|
import { getSpace, isEchoObject } from '@dxos/react-client/echo';
|
|
14
|
+
import { Icon } from '@dxos/react-ui';
|
|
15
15
|
|
|
16
16
|
import { ComputeGraphContextProvider, SheetContainer } from './components';
|
|
17
17
|
import { compareIndexPositions, createSheet } from './defs';
|
|
18
|
+
import { computeGraphFacet } from './extensions';
|
|
18
19
|
import { type ComputeGraphRegistry } from './graph';
|
|
20
|
+
import { useComputeGraph } from './hooks';
|
|
19
21
|
import meta, { SHEET_PLUGIN } from './meta';
|
|
20
22
|
import translations from './translations';
|
|
21
23
|
import { SheetAction, SheetType, type SheetPluginProvides } from './types';
|
|
22
24
|
|
|
23
25
|
export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
24
|
-
let
|
|
26
|
+
let computeGraphRegistry: ComputeGraphRegistry | undefined;
|
|
25
27
|
|
|
26
28
|
return {
|
|
27
29
|
meta,
|
|
@@ -36,18 +38,18 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
// Async import removes direct dependency on hyperformula.
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
+
const { ComputeGraphRegistry } = await import('./graph');
|
|
42
|
+
computeGraphRegistry = new ComputeGraphRegistry({ remoteFunctionUrl });
|
|
41
43
|
},
|
|
42
44
|
provides: {
|
|
43
45
|
context: ({ children }) => {
|
|
44
|
-
invariant(
|
|
45
|
-
return <ComputeGraphContextProvider registry={
|
|
46
|
+
invariant(computeGraphRegistry);
|
|
47
|
+
return <ComputeGraphContextProvider registry={computeGraphRegistry}>{children}</ComputeGraphContextProvider>;
|
|
46
48
|
},
|
|
47
49
|
metadata: {
|
|
48
50
|
records: {
|
|
49
51
|
[SheetType.typename]: {
|
|
50
|
-
label: (object: any) => (object instanceof SheetType ? object.
|
|
52
|
+
label: (object: any) => (object instanceof SheetType ? object.name : undefined),
|
|
51
53
|
placeholder: ['sheet title placeholder', { ns: SHEET_PLUGIN }],
|
|
52
54
|
icon: 'ph--grid-nine--regular',
|
|
53
55
|
},
|
|
@@ -108,12 +110,13 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
108
110
|
},
|
|
109
111
|
},
|
|
110
112
|
markdown: {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
extensions: ({ document: doc }) => {
|
|
114
|
+
invariant(computeGraphRegistry);
|
|
115
|
+
const space = getSpace(doc);
|
|
116
|
+
if (space) {
|
|
117
|
+
const computeGraph = computeGraphRegistry.getOrCreateGraph(space);
|
|
118
|
+
return computeGraphFacet.of(computeGraph);
|
|
119
|
+
}
|
|
117
120
|
},
|
|
118
121
|
},
|
|
119
122
|
stack: {
|
|
@@ -123,7 +126,8 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
123
126
|
testId: 'sheetPlugin.createSection',
|
|
124
127
|
type: ['plugin name', { ns: SHEET_PLUGIN }],
|
|
125
128
|
label: ['create sheet section label', { ns: SHEET_PLUGIN }],
|
|
126
|
-
|
|
129
|
+
// TODO(thure): Refactor to use strings
|
|
130
|
+
icon: (props: any) => <Icon icon='ph--grid-nine--regular' {...props} />,
|
|
127
131
|
intent: {
|
|
128
132
|
plugin: SHEET_PLUGIN,
|
|
129
133
|
action: SheetAction.CREATE,
|
|
@@ -138,12 +142,13 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
138
142
|
},
|
|
139
143
|
surface: {
|
|
140
144
|
component: ({ data, role }) => {
|
|
141
|
-
const space = isEchoObject(data.object)
|
|
142
|
-
|
|
145
|
+
const space = isEchoObject(data.object) ? getSpace(data.object) : undefined;
|
|
146
|
+
const graph = useComputeGraph(space);
|
|
147
|
+
if (graph && data.object instanceof SheetType) {
|
|
143
148
|
switch (role) {
|
|
144
149
|
case 'article':
|
|
145
150
|
case 'section': {
|
|
146
|
-
return <SheetContainer sheet={data.object}
|
|
151
|
+
return <SheetContainer graph={graph} sheet={data.object} role={role} />;
|
|
147
152
|
}
|
|
148
153
|
}
|
|
149
154
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Icon } from '@dxos/react-ui';
|
|
8
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
9
|
+
|
|
10
|
+
import { addressToA1Notation, rangeToA1Notation } from '../../defs';
|
|
11
|
+
import { useSheetContext } from '../SheetContext';
|
|
12
|
+
|
|
13
|
+
export const FunctionEditor = () => {
|
|
14
|
+
const { model, cursor, range } = useSheetContext();
|
|
15
|
+
|
|
16
|
+
let value;
|
|
17
|
+
let isFormula = false;
|
|
18
|
+
if (cursor) {
|
|
19
|
+
value = model.getCellValue(cursor);
|
|
20
|
+
if (typeof value === 'string' && value.charAt(0) === '=') {
|
|
21
|
+
value = model.graph.mapFunctionBindingFromId(model.mapFormulaIndicesToRefs(value));
|
|
22
|
+
isFormula = true;
|
|
23
|
+
} else if (value != null) {
|
|
24
|
+
value = String(value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
className={mx(
|
|
31
|
+
'flex shrink-0 justify-between items-center px-4 py-1 text-sm border-bs !border-separator attention-surface',
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
<div className='flex gap-4 items-center'>
|
|
35
|
+
<div className='flex w-16 items-center font-mono'>
|
|
36
|
+
{(range && rangeToA1Notation(range)) || (cursor && addressToA1Notation(cursor))}
|
|
37
|
+
</div>
|
|
38
|
+
<div className='flex gap-2 items-center'>
|
|
39
|
+
<Icon icon='ph--function--regular' classNames={['text-greenText', isFormula ? 'visible' : 'invisible']} />
|
|
40
|
+
<span className='font-mono'>{value}</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -10,14 +10,16 @@ import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
|
10
10
|
|
|
11
11
|
import { GridSheet } from './GridSheet';
|
|
12
12
|
import { useComputeGraph } from '../../hooks';
|
|
13
|
-
import { useTestSheet,
|
|
13
|
+
import { useTestSheet, withComputeGraphDecorator } from '../../testing';
|
|
14
|
+
import { SheetType } from '../../types';
|
|
15
|
+
import { SheetProvider } from '../SheetContext';
|
|
14
16
|
|
|
15
17
|
export default {
|
|
16
18
|
title: 'plugin-sheet/GridSheet',
|
|
17
19
|
component: GridSheet,
|
|
18
20
|
decorators: [
|
|
19
|
-
withClientProvider({ createSpace: true }),
|
|
20
|
-
|
|
21
|
+
withClientProvider({ types: [SheetType], createSpace: true }),
|
|
22
|
+
withComputeGraphDecorator(),
|
|
21
23
|
withTheme,
|
|
22
24
|
withLayout({ fullscreen: true, tooltips: true }),
|
|
23
25
|
],
|
|
@@ -27,9 +29,13 @@ export const Basic = () => {
|
|
|
27
29
|
const space = useSpace();
|
|
28
30
|
const graph = useComputeGraph(space);
|
|
29
31
|
const sheet = useTestSheet(space, graph);
|
|
30
|
-
if (!sheet || !
|
|
32
|
+
if (!sheet || !graph) {
|
|
31
33
|
return null;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
return
|
|
36
|
+
return (
|
|
37
|
+
<SheetProvider graph={graph} sheet={sheet}>
|
|
38
|
+
<GridSheet />
|
|
39
|
+
</SheetProvider>
|
|
40
|
+
);
|
|
35
41
|
};
|