@dxos/plugin-sheet 0.6.12-main.c974201 → 0.6.12-main.f9d0246
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-V4GCCZTX.mjs → SheetContainer-VISF3VUB.mjs} +6 -6
- package/dist/lib/browser/{SheetContainer-V4GCCZTX.mjs.map → SheetContainer-VISF3VUB.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-T3NJFTD4.mjs → chunk-WZMOZKQZ.mjs} +2 -2
- package/dist/lib/browser/{chunk-T3NJFTD4.mjs.map → chunk-WZMOZKQZ.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-6ZMQVB4Z.mjs → chunk-Z2XOOC2R.mjs} +81 -62
- package/dist/lib/browser/chunk-Z2XOOC2R.mjs.map +7 -0
- package/dist/lib/browser/{chunk-U2JHW3L6.mjs → chunk-ZLJ2GRE2.mjs} +173 -42
- package/dist/lib/browser/chunk-ZLJ2GRE2.mjs.map +7 -0
- package/dist/lib/browser/{graph-T27BOBOV.mjs → graph-4XFKIHRL.mjs} +4 -4
- package/dist/lib/browser/index.mjs +15 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{SheetContainer-3ZY7MPWJ.cjs → SheetContainer-2MEALQWW.cjs} +14 -14
- package/dist/lib/node/{SheetContainer-3ZY7MPWJ.cjs.map → SheetContainer-2MEALQWW.cjs.map} +3 -3
- package/dist/lib/node/{chunk-OTTD7FBK.cjs → chunk-6DQABRGJ.cjs} +192 -60
- package/dist/lib/node/chunk-6DQABRGJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-Q3HBHPRL.cjs → chunk-AOP42UAA.cjs} +5 -5
- package/dist/lib/node/{chunk-Q3HBHPRL.cjs.map → chunk-AOP42UAA.cjs.map} +3 -3
- package/dist/lib/node/{chunk-DD6FIXWC.cjs → chunk-P5QYYEHQ.cjs} +86 -67
- package/dist/lib/node/chunk-P5QYYEHQ.cjs.map +7 -0
- package/dist/lib/node/{graph-SPKGX7W4.cjs → graph-2LRDUXBZ.cjs} +14 -14
- package/dist/lib/node/graph-2LRDUXBZ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +25 -24
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +8 -8
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{SheetContainer-PXSJX6XK.mjs → SheetContainer-RPSUSXWS.mjs} +6 -6
- package/dist/lib/node-esm/{SheetContainer-PXSJX6XK.mjs.map → SheetContainer-RPSUSXWS.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-D6KU5MI7.mjs → chunk-4MM7THJW.mjs} +81 -62
- package/dist/lib/node-esm/chunk-4MM7THJW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7HVSOTGA.mjs → chunk-5RLTCIE2.mjs} +173 -42
- package/dist/lib/node-esm/chunk-5RLTCIE2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BMNA27EX.mjs → chunk-RR2AO4SM.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-BMNA27EX.mjs.map → chunk-RR2AO4SM.mjs.map} +3 -3
- package/dist/lib/node-esm/{graph-U67IO4UC.mjs → graph-WG5EKOMO.mjs} +4 -4
- package/dist/lib/node-esm/index.mjs +15 -13
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts +3 -3
- 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/GridSheet/util.d.ts +3 -2
- package/dist/types/src/components/GridSheet/util.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/sheet-context.d.ts +3 -3
- package/dist/types/src/components/Sheet/sheet-context.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer.d.ts +1 -1
- package/dist/types/src/components/index.d.ts +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 +5 -1
- 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/graph/async-function.d.ts +7 -1
- package/dist/types/src/graph/async-function.d.ts.map +1 -1
- package/dist/types/src/graph/compute-graph.d.ts +12 -9
- 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/edge-function.d.ts.map +1 -1
- package/dist/types/src/graph/{custom-function.d.ts → testing/custom-function.d.ts} +3 -1
- package/dist/types/src/graph/testing/custom-function.d.ts.map +1 -0
- package/dist/types/src/graph/testing/index.d.ts +2 -0
- package/dist/types/src/graph/testing/index.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/model/sheet-model.d.ts +3 -3
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- 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 +4 -3
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/SheetPlugin.tsx +9 -7
- package/src/components/CellEditor/CellEditor.stories.tsx +1 -1
- package/src/components/GridSheet/GridSheet.stories.tsx +5 -4
- package/src/components/GridSheet/GridSheet.tsx +6 -6
- package/src/components/GridSheet/util.ts +46 -27
- package/src/components/Sheet/Sheet.stories.tsx +21 -20
- package/src/components/Sheet/sheet-context.tsx +4 -4
- package/src/components/SheetContainer.tsx +2 -2
- package/src/defs/types.ts +1 -0
- package/src/defs/util.ts +19 -3
- package/src/extensions/compute.stories.tsx +18 -16
- package/src/extensions/compute.ts +72 -39
- package/src/graph/async-function.ts +13 -6
- package/src/graph/compute-graph.stories.tsx +4 -3
- package/src/graph/compute-graph.test.ts +127 -0
- package/src/graph/compute-graph.ts +64 -41
- package/src/graph/compute-node.ts +16 -5
- package/src/graph/edge-function.ts +1 -2
- package/src/graph/{custom-function.ts → testing/custom-function.ts} +10 -2
- package/src/graph/testing/index.ts +5 -0
- package/src/hooks/hooks.stories.tsx +3 -3
- package/src/hooks/useComputeGraph.ts +2 -1
- package/src/hooks/useSheetModel.ts +4 -7
- package/src/model/sheet-model.ts +44 -29
- package/src/testing/testing.tsx +17 -15
- package/src/types.ts +3 -3
- package/dist/lib/browser/chunk-6ZMQVB4Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-U2JHW3L6.mjs.map +0 -7
- package/dist/lib/node/chunk-DD6FIXWC.cjs.map +0 -7
- package/dist/lib/node/chunk-OTTD7FBK.cjs.map +0 -7
- package/dist/lib/node/graph-SPKGX7W4.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-7HVSOTGA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D6KU5MI7.mjs.map +0 -7
- 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.map +0 -1
- package/src/graph/compute-graph.browser.test.ts +0 -104
- /package/dist/lib/browser/{graph-T27BOBOV.mjs.map → graph-4XFKIHRL.mjs.map} +0 -0
- /package/dist/lib/node-esm/{graph-U67IO4UC.mjs.map → graph-WG5EKOMO.mjs.map} +0 -0
|
@@ -16,25 +16,26 @@ export type ComputeGraphOptions = {
|
|
|
16
16
|
plugins?: ComputeGraphPlugin[];
|
|
17
17
|
} & Partial<FunctionContextOptions> & Partial<ConfigParams>;
|
|
18
18
|
export declare const defaultOptions: ComputeGraphOptions;
|
|
19
|
+
export declare const defaultPlugins: ComputeGraphPlugin[];
|
|
19
20
|
export declare const createSheetName: (id: string) => string;
|
|
20
21
|
export declare const getSheetId: (name: string) => string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* NOTE: Async imports to decouple hyperformula deps.
|
|
23
|
-
*/
|
|
24
|
-
export declare const createComputeGraphRegistry: (options?: Partial<FunctionContextOptions>) => ComputeGraphRegistry;
|
|
25
22
|
/**
|
|
26
23
|
* Manages a collection of ComputeGraph instances for each space.
|
|
27
24
|
*
|
|
28
25
|
* [ComputePlugin] => [ComputeGraphRegistry] => [ComputeGraph(Space)] => [ComputeNode(Object)]
|
|
26
|
+
*
|
|
27
|
+
* NOTE: The ComputeGraphRegistry manages the hierarchy of resources via its root Context.
|
|
29
28
|
*/
|
|
30
29
|
export declare class ComputeGraphRegistry extends Resource {
|
|
30
|
+
private readonly _graphs;
|
|
31
31
|
private readonly _options;
|
|
32
|
-
|
|
33
|
-
constructor(_options?: ComputeGraphOptions);
|
|
32
|
+
constructor(options?: ComputeGraphOptions);
|
|
34
33
|
getGraph(spaceId: SpaceId): ComputeGraph | undefined;
|
|
35
34
|
getOrCreateGraph(space: Space): Promise<ComputeGraph>;
|
|
36
35
|
createGraph(space: Space): Promise<ComputeGraph>;
|
|
36
|
+
protected _close(): Promise<void>;
|
|
37
37
|
}
|
|
38
|
+
export type ComputeGraphEvent = 'functionsUpdated';
|
|
38
39
|
/**
|
|
39
40
|
* Per-space compute and dependency graph.
|
|
40
41
|
* Consists of multiple ComputeNode (corresponding to a HyperFormula sheet).
|
|
@@ -48,11 +49,12 @@ export declare class ComputeGraph extends Resource {
|
|
|
48
49
|
readonly id: string;
|
|
49
50
|
private readonly _nodes;
|
|
50
51
|
private _functions;
|
|
52
|
+
readonly update: Event<{
|
|
53
|
+
type: ComputeGraphEvent;
|
|
54
|
+
}>;
|
|
51
55
|
readonly context: FunctionContext;
|
|
52
|
-
readonly update: Event<void>;
|
|
53
56
|
constructor(_hf: HyperFormula, _space?: Space | undefined, _options?: Partial<FunctionContextOptions> | undefined);
|
|
54
57
|
get hf(): HyperFormula;
|
|
55
|
-
refresh(): void;
|
|
56
58
|
getFunctions({ standard, echo }?: {
|
|
57
59
|
standard?: boolean;
|
|
58
60
|
echo?: boolean;
|
|
@@ -60,7 +62,7 @@ export declare class ComputeGraph extends Resource {
|
|
|
60
62
|
/**
|
|
61
63
|
* Get or create cell representing a sheet.
|
|
62
64
|
*/
|
|
63
|
-
getOrCreateNode(name: string): ComputeNode
|
|
65
|
+
getOrCreateNode(name: string): Promise<ComputeNode>;
|
|
64
66
|
/**
|
|
65
67
|
* Map bound value to custom function invocation.
|
|
66
68
|
* E.g., "HELLO(...args)" => "EDGE("HELLO", ...args)".
|
|
@@ -77,5 +79,6 @@ export declare class ComputeGraph extends Resource {
|
|
|
77
79
|
*/
|
|
78
80
|
mapFunctionBindingFromId(formula: string): string;
|
|
79
81
|
protected _open(): Promise<void>;
|
|
82
|
+
protected _close(): Promise<void>;
|
|
80
83
|
}
|
|
81
84
|
//# sourceMappingURL=compute-graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-graph.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+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CAAC,OAAO,EAAE,MAAM;cAgBf,KAAK;cAaL,MAAM;CAKhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-graph.stories.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAsC,MAAM,OAAO,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"compute-graph.stories.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAsC,MAAM,OAAO,CAAC;;;;mBAmF1C,GAAG;;AAPpB,wBAQE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-graph.test.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
|
+
import { type Listeners } from 'hyperformula/typings/Emitter';
|
|
2
|
+
import { type ExportedCellChange } from 'hyperformula/typings/Exporter';
|
|
1
3
|
import { Event } from '@dxos/async';
|
|
2
4
|
import { Resource } from '@dxos/context';
|
|
3
5
|
import { type ComputeGraph } from './compute-graph';
|
|
4
6
|
import { type CellAddress } from '../defs';
|
|
5
7
|
import { type CellScalarValue } from '../types';
|
|
8
|
+
export type ComputeNodeEvent = {
|
|
9
|
+
type: keyof Listeners;
|
|
10
|
+
change?: ExportedCellChange;
|
|
11
|
+
};
|
|
6
12
|
/**
|
|
7
13
|
* Individual "sheet" (typically corresponds to an ECHO object).
|
|
8
14
|
*/
|
|
9
15
|
export declare class ComputeNode extends Resource {
|
|
10
16
|
private readonly _graph;
|
|
11
17
|
readonly sheetId: number;
|
|
12
|
-
readonly update: Event<
|
|
18
|
+
readonly update: Event<ComputeNodeEvent>;
|
|
13
19
|
constructor(_graph: ComputeGraph, sheetId: number);
|
|
14
20
|
get graph(): ComputeGraph;
|
|
15
|
-
|
|
21
|
+
clear(): void;
|
|
16
22
|
getValue(cell: CellAddress): CellScalarValue;
|
|
17
23
|
setValue(cell: CellAddress, value: CellScalarValue): void;
|
|
24
|
+
protected _open(): Promise<void>;
|
|
18
25
|
}
|
|
19
26
|
//# sourceMappingURL=compute-node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-node.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AAEH,qBAAa,WAAY,SAAQ,QAAQ;
|
|
1
|
+
{"version":3,"file":"compute-node.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF;;GAEG;AAEH,qBAAa,WAAY,SAAQ,QAAQ;IAIrC,OAAO,CAAC,QAAQ,CAAC,MAAM;aACP,OAAO,EAAE,MAAM;IAJjC,SAAgB,MAAM,0BAAiC;gBAGpC,MAAM,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM;IAKjC,IAAI,KAAK,iBAER;IAED,KAAK;IAIL,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe;IAS5C,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe;cAMzB,KAAK;CAI/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-function.d.ts","sourceRoot":"","sources":["../../../../src/graph/edge-function.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAShE,OAAO,EAAsB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI3E;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,mBAAmB;IACzD,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;CA0ChD;
|
|
1
|
+
{"version":3,"file":"edge-function.d.ts","sourceRoot":"","sources":["../../../../src/graph/edge-function.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAShE,OAAO,EAAsB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI3E;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,mBAAmB;IACzD,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;CA0ChD;AAuBD,eAAO,MAAM,8BAA8B;;;;;;;CAO1C,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';
|
|
2
2
|
import { type ProcedureAst } from 'hyperformula/typings/parser';
|
|
3
|
-
import { FunctionPluginAsync } from '
|
|
3
|
+
import { FunctionPluginAsync } from '../async-function';
|
|
4
|
+
import { type ComputeGraphPlugin } from '../compute-graph';
|
|
4
5
|
/**
|
|
5
6
|
* https://hyperformula.handsontable.com/guide/custom-functions.html#add-a-simple-custom-function
|
|
6
7
|
*/
|
|
@@ -18,4 +19,5 @@ export declare const CustomPluginTranslations: {
|
|
|
18
19
|
CRYPTO: string;
|
|
19
20
|
};
|
|
20
21
|
};
|
|
22
|
+
export declare const testPlugins: ComputeGraphPlugin[];
|
|
21
23
|
//# sourceMappingURL=custom-function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-function.d.ts","sourceRoot":"","sources":["../../../../../src/graph/testing/custom-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,EAAsB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG3D;;GAEG;AACH,qBAAa,YAAa,SAAQ,mBAAmB;IACnD,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;IAQ/C,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;CAelD;AAgBD,eAAO,MAAM,wBAAwB;;;;;;;;;CASpC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,kBAAkB,EAK3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/graph/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComputeGraph.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useComputeGraph.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAIrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,eAAe,WAAY,KAAK,KAAG,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"useComputeGraph.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useComputeGraph.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAIrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,eAAe,WAAY,KAAK,KAAG,YAAY,GAAG,SAI9D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComputeGraph } from '../graph';
|
|
2
2
|
import { SheetModel } from '../model';
|
|
3
3
|
import { type SheetType } from '../types';
|
|
4
4
|
export type UseSheetModelOptions = {
|
|
5
5
|
readonly?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const useSheetModel: (
|
|
7
|
+
export declare const useSheetModel: (graph?: ComputeGraph, sheet?: SheetType, { readonly }?: UseSheetModelOptions) => SheetModel | undefined;
|
|
8
8
|
//# sourceMappingURL=useSheetModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSheetModel.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useSheetModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSheetModel.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,aAAa,WAChB,YAAY,UACZ,SAAS,iBACH,oBAAoB,KACjC,UAAU,GAAG,SAqBf,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type SimpleDate, type SimpleDateTime } from 'hyperformula/typings/DateT
|
|
|
2
2
|
import { Event } from '@dxos/async';
|
|
3
3
|
import { Resource } from '@dxos/context';
|
|
4
4
|
import { type CellAddress, type CellRange } from '../defs';
|
|
5
|
-
import { type ComputeGraph } from '../graph';
|
|
5
|
+
import { type ComputeGraph, type ComputeNodeEvent } from '../graph';
|
|
6
6
|
import { type CellScalarValue, type CellValue, type SheetType, ValueTypeEnum } from '../types';
|
|
7
7
|
export type SheetModelOptions = {
|
|
8
8
|
readonly?: boolean;
|
|
@@ -17,8 +17,8 @@ export declare class SheetModel extends Resource {
|
|
|
17
17
|
private readonly _sheet;
|
|
18
18
|
private readonly _options;
|
|
19
19
|
readonly id: string;
|
|
20
|
-
readonly update: Event<
|
|
21
|
-
private
|
|
20
|
+
readonly update: Event<ComputeNodeEvent>;
|
|
21
|
+
private _node?;
|
|
22
22
|
constructor(_graph: ComputeGraph, _sheet: SheetType, _options?: SheetModelOptions);
|
|
23
23
|
get graph(): ComputeGraph;
|
|
24
24
|
get sheet(): SheetType;
|
|
@@ -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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AE,MAAM,GAAG,UAAU;CAIhC"}
|
|
@@ -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"}
|
|
@@ -47,7 +47,7 @@ export declare const RowColumnMeta: S.Struct<{
|
|
|
47
47
|
size: S.optional<typeof S.Number>;
|
|
48
48
|
}>;
|
|
49
49
|
declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
50
|
-
|
|
50
|
+
name?: string | undefined;
|
|
51
51
|
cells: {
|
|
52
52
|
[x: string]: {
|
|
53
53
|
value: any;
|
|
@@ -109,7 +109,7 @@ declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
|
109
109
|
} & {
|
|
110
110
|
id: string;
|
|
111
111
|
}, S.Struct.Encoded<{
|
|
112
|
-
|
|
112
|
+
name: S.optional<typeof S.String>;
|
|
113
113
|
cells: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
114
114
|
value: typeof S.Any;
|
|
115
115
|
}>>>>;
|
|
@@ -168,7 +168,8 @@ export type SheetSize = {
|
|
|
168
168
|
columns: number;
|
|
169
169
|
};
|
|
170
170
|
export type CreateSheetOptions = {
|
|
171
|
-
|
|
171
|
+
name?: string;
|
|
172
|
+
cells?: Record<string, CellValue>;
|
|
172
173
|
} & Partial<SheetSize>;
|
|
173
174
|
export {};
|
|
174
175
|
//# 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,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,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/plugin-sheet",
|
|
3
|
-
"version": "0.6.12-main.
|
|
3
|
+
"version": "0.6.12-main.f9d0246",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -78,29 +78,29 @@
|
|
|
78
78
|
"re-resizable": "^6.9.17",
|
|
79
79
|
"react-markdown": "^8.0.5",
|
|
80
80
|
"react-resize-detector": "^11.0.1",
|
|
81
|
-
"@dxos/app-framework": "0.6.12-main.
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/context": "0.6.12-main.
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/keys": "0.6.12-main.
|
|
90
|
-
"@dxos/log": "0.6.12-main.
|
|
91
|
-
"@dxos/plugin-attention": "0.6.12-main.
|
|
92
|
-
"@dxos/plugin-
|
|
93
|
-
"@dxos/plugin-
|
|
94
|
-
"@dxos/plugin-markdown": "0.6.12-main.
|
|
95
|
-
"@dxos/plugin-
|
|
96
|
-
"@dxos/plugin-
|
|
97
|
-
"@dxos/react-client": "0.6.12-main.
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/react-
|
|
100
|
-
"@dxos/react-
|
|
101
|
-
"@dxos/react-ui-
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/util": "0.6.12-main.
|
|
81
|
+
"@dxos/app-framework": "0.6.12-main.f9d0246",
|
|
82
|
+
"@dxos/client": "0.6.12-main.f9d0246",
|
|
83
|
+
"@dxos/context": "0.6.12-main.f9d0246",
|
|
84
|
+
"@dxos/async": "0.6.12-main.f9d0246",
|
|
85
|
+
"@dxos/crypto": "0.6.12-main.f9d0246",
|
|
86
|
+
"@dxos/debug": "0.6.12-main.f9d0246",
|
|
87
|
+
"@dxos/invariant": "0.6.12-main.f9d0246",
|
|
88
|
+
"@dxos/echo-schema": "0.6.12-main.f9d0246",
|
|
89
|
+
"@dxos/keys": "0.6.12-main.f9d0246",
|
|
90
|
+
"@dxos/log": "0.6.12-main.f9d0246",
|
|
91
|
+
"@dxos/plugin-attention": "0.6.12-main.f9d0246",
|
|
92
|
+
"@dxos/plugin-client": "0.6.12-main.f9d0246",
|
|
93
|
+
"@dxos/plugin-graph": "0.6.12-main.f9d0246",
|
|
94
|
+
"@dxos/plugin-markdown": "0.6.12-main.f9d0246",
|
|
95
|
+
"@dxos/plugin-space": "0.6.12-main.f9d0246",
|
|
96
|
+
"@dxos/plugin-script": "0.6.12-main.f9d0246",
|
|
97
|
+
"@dxos/react-client": "0.6.12-main.f9d0246",
|
|
98
|
+
"@dxos/plugin-stack": "0.6.12-main.f9d0246",
|
|
99
|
+
"@dxos/react-ui-attention": "0.6.12-main.f9d0246",
|
|
100
|
+
"@dxos/react-hooks": "0.6.12-main.f9d0246",
|
|
101
|
+
"@dxos/react-ui-editor": "0.6.12-main.f9d0246",
|
|
102
|
+
"@dxos/react-ui-grid": "0.6.12-main.f9d0246",
|
|
103
|
+
"@dxos/util": "0.6.12-main.f9d0246"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@lezer/generator": "^1.7.1",
|
|
@@ -113,20 +113,20 @@
|
|
|
113
113
|
"react": "~18.2.0",
|
|
114
114
|
"react-dom": "~18.2.0",
|
|
115
115
|
"vite": "5.4.7",
|
|
116
|
-
"@dxos/
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/react-ui": "0.6.12-main.
|
|
119
|
-
"@dxos/react-ui-
|
|
120
|
-
"@dxos/react-ui-
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/
|
|
116
|
+
"@dxos/random": "0.6.12-main.f9d0246",
|
|
117
|
+
"@dxos/echo-generator": "0.6.12-main.f9d0246",
|
|
118
|
+
"@dxos/react-ui": "0.6.12-main.f9d0246",
|
|
119
|
+
"@dxos/react-ui-types": "0.6.12-main.f9d0246",
|
|
120
|
+
"@dxos/react-ui-theme": "0.6.12-main.f9d0246",
|
|
121
|
+
"@dxos/storybook-utils": "0.6.12-main.f9d0246",
|
|
122
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.12-main.f9d0246"
|
|
123
123
|
},
|
|
124
124
|
"optionalDependencies": {
|
|
125
125
|
"@phosphor-icons/react": "^2.1.5",
|
|
126
126
|
"react": "~18.2.0",
|
|
127
127
|
"react-dom": "~18.2.0",
|
|
128
|
-
"@dxos/react-ui
|
|
129
|
-
"@dxos/react-ui": "0.6.12-main.
|
|
128
|
+
"@dxos/react-ui": "0.6.12-main.f9d0246",
|
|
129
|
+
"@dxos/react-ui-theme": "0.6.12-main.f9d0246"
|
|
130
130
|
},
|
|
131
131
|
"publishConfig": {
|
|
132
132
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import { getSpace, isEchoObject } from '@dxos/react-client/echo';
|
|
|
16
16
|
import { ComputeGraphContextProvider, SheetContainer } from './components';
|
|
17
17
|
import { compareIndexPositions, createSheet } from './defs';
|
|
18
18
|
import { type ComputeGraphRegistry } from './graph';
|
|
19
|
+
import { useComputeGraph } from './hooks';
|
|
19
20
|
import meta, { SHEET_PLUGIN } from './meta';
|
|
20
21
|
import translations from './translations';
|
|
21
22
|
import { SheetAction, SheetType, type SheetPluginProvides } from './types';
|
|
@@ -36,8 +37,8 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
// Async import removes direct dependency on hyperformula.
|
|
39
|
-
const {
|
|
40
|
-
graphRegistry =
|
|
40
|
+
const { ComputeGraphRegistry } = await import('./graph');
|
|
41
|
+
graphRegistry = new ComputeGraphRegistry({ remoteFunctionUrl });
|
|
41
42
|
},
|
|
42
43
|
provides: {
|
|
43
44
|
context: ({ children }) => {
|
|
@@ -47,7 +48,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
47
48
|
metadata: {
|
|
48
49
|
records: {
|
|
49
50
|
[SheetType.typename]: {
|
|
50
|
-
label: (object: any) => (object instanceof SheetType ? object.
|
|
51
|
+
label: (object: any) => (object instanceof SheetType ? object.name : undefined),
|
|
51
52
|
placeholder: ['sheet title placeholder', { ns: SHEET_PLUGIN }],
|
|
52
53
|
icon: 'ph--grid-nine--regular',
|
|
53
54
|
},
|
|
@@ -108,7 +109,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
108
109
|
},
|
|
109
110
|
},
|
|
110
111
|
markdown: {
|
|
111
|
-
// TODO(burdon):
|
|
112
|
+
// TODO(burdon): Facet to get current space/compute graph.
|
|
112
113
|
extensions: ({ document }) => {
|
|
113
114
|
return undefined;
|
|
114
115
|
// return [
|
|
@@ -138,12 +139,13 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
138
139
|
},
|
|
139
140
|
surface: {
|
|
140
141
|
component: ({ data, role }) => {
|
|
141
|
-
const space = isEchoObject(data.object)
|
|
142
|
-
|
|
142
|
+
const space = isEchoObject(data.object) ? getSpace(data.object) : undefined;
|
|
143
|
+
const graph = useComputeGraph(space);
|
|
144
|
+
if (graph && data.object instanceof SheetType) {
|
|
143
145
|
switch (role) {
|
|
144
146
|
case 'article':
|
|
145
147
|
case 'section': {
|
|
146
|
-
return <SheetContainer sheet={data.object}
|
|
148
|
+
return <SheetContainer graph={graph} sheet={data.object} role={role} />;
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
}
|
|
@@ -10,14 +10,15 @@ 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';
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
title: 'plugin-sheet/GridSheet',
|
|
17
18
|
component: GridSheet,
|
|
18
19
|
decorators: [
|
|
19
|
-
withClientProvider({ createSpace: true }),
|
|
20
|
-
|
|
20
|
+
withClientProvider({ types: [SheetType], createSpace: true }),
|
|
21
|
+
withComputeGraphDecorator(),
|
|
21
22
|
withTheme,
|
|
22
23
|
withLayout({ fullscreen: true, tooltips: true }),
|
|
23
24
|
],
|
|
@@ -31,5 +32,5 @@ export const Basic = () => {
|
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
return <GridSheet
|
|
35
|
+
return <GridSheet graph={graph} sheet={sheet} />;
|
|
35
36
|
};
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo, useRef } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Space } from '@dxos/client/echo';
|
|
8
7
|
import {
|
|
9
8
|
type DxGridElement,
|
|
10
9
|
Grid,
|
|
@@ -15,6 +14,7 @@ import {
|
|
|
15
14
|
|
|
16
15
|
import { dxGridCellIndexToSheetCellAddress, useSheetModelDxGridProps } from './util';
|
|
17
16
|
import { rangeToA1Notation, type CellRange } from '../../defs';
|
|
17
|
+
import { type ComputeGraph } from '../../graph';
|
|
18
18
|
import { useFormattingModel, useSheetModel, type UseSheetModelOptions } from '../../hooks';
|
|
19
19
|
import { type SheetModel, type FormattingModel } from '../../model';
|
|
20
20
|
import { type SheetType } from '../../types';
|
|
@@ -108,7 +108,7 @@ const GridSheetImpl = ({
|
|
|
108
108
|
[editing],
|
|
109
109
|
);
|
|
110
110
|
|
|
111
|
-
const {
|
|
111
|
+
const { columns, rows } = useSheetModelDxGridProps(dxGrid, model, formatting);
|
|
112
112
|
|
|
113
113
|
const extension = useMemo(
|
|
114
114
|
() => [
|
|
@@ -123,7 +123,7 @@ const GridSheetImpl = ({
|
|
|
123
123
|
<>
|
|
124
124
|
<GridSheetCellEditor model={model} extension={extension} />
|
|
125
125
|
<Grid.Content
|
|
126
|
-
|
|
126
|
+
initialCells={{}}
|
|
127
127
|
columns={columns}
|
|
128
128
|
rows={rows}
|
|
129
129
|
onAxisResize={handleAxisResize}
|
|
@@ -136,10 +136,10 @@ const GridSheetImpl = ({
|
|
|
136
136
|
);
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
export type GridSheetProps = {
|
|
139
|
+
export type GridSheetProps = { graph?: ComputeGraph; sheet?: SheetType } & UseSheetModelOptions;
|
|
140
140
|
|
|
141
|
-
export const GridSheet = ({
|
|
142
|
-
const model = useSheetModel(
|
|
141
|
+
export const GridSheet = ({ graph, sheet, ...options }: GridSheetProps) => {
|
|
142
|
+
const model = useSheetModel(graph, sheet, options);
|
|
143
143
|
const formatting = useFormattingModel(model);
|
|
144
144
|
if (!model || !formatting) {
|
|
145
145
|
return null;
|