@dxos/plugin-sheet 0.6.12-main.ed7cda7 → 0.6.12-staging.0b4bb48
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/{chunk-U2JHW3L6.mjs → SheetContainer-U4H5D34A.mjs} +240 -1020
- package/dist/lib/browser/SheetContainer-U4H5D34A.mjs.map +7 -0
- package/dist/lib/browser/chunk-APHOLYUB.mjs +175 -0
- package/dist/lib/browser/chunk-APHOLYUB.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-D6KU5MI7.mjs → browser/chunk-D5AGLXJP.mjs} +670 -360
- package/dist/lib/browser/chunk-D5AGLXJP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-T3NJFTD4.mjs → chunk-FUAGSXA4.mjs} +15 -8
- package/dist/lib/browser/chunk-FUAGSXA4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QILRZNE5.mjs → chunk-JRL5LGCE.mjs} +5 -2
- package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +7 -0
- package/dist/lib/browser/chunk-NU4PBN33.mjs +8 -0
- package/dist/lib/browser/chunk-NU4PBN33.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +56 -68
- 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/testing.mjs +92 -0
- package/dist/lib/browser/testing.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +6 -4
- package/dist/lib/node/{chunk-OTTD7FBK.cjs → SheetContainer-AXQV3ZT5.cjs} +279 -1050
- package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs.map +7 -0
- package/dist/lib/node/{chunk-DD6FIXWC.cjs → chunk-5KKJ4NPP.cjs} +667 -360
- package/dist/lib/node/chunk-5KKJ4NPP.cjs.map +7 -0
- package/dist/lib/node/{chunk-BNARJ5GM.cjs → chunk-BJ6ZD7MN.cjs} +18 -5
- package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +7 -0
- package/dist/lib/node/chunk-CN3RPESU.cjs +202 -0
- package/dist/lib/node/chunk-CN3RPESU.cjs.map +7 -0
- package/dist/lib/node/{chunk-Q3HBHPRL.cjs → chunk-DSYKOI4E.cjs} +20 -12
- package/dist/lib/node/chunk-DSYKOI4E.cjs.map +7 -0
- package/dist/lib/node/chunk-PYXHNAAK.cjs +40 -0
- package/dist/lib/node/chunk-PYXHNAAK.cjs.map +7 -0
- package/dist/lib/node/index.cjs +64 -83
- 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/testing.cjs +111 -0
- package/dist/lib/node/testing.cjs.map +7 -0
- package/dist/lib/node/types.cjs +12 -10
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/CellEditor.d.ts +3 -23
- package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts +2 -2
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/extension.d.ts +1 -1
- package/dist/types/src/components/CellEditor/extension.d.ts.map +1 -1
- package/dist/types/src/{graph → components/ComputeGraph}/async-function.d.ts +1 -1
- package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +1 -0
- package/dist/types/src/{graph/custom-function.d.ts → components/ComputeGraph/custom.d.ts} +1 -1
- package/dist/types/src/components/ComputeGraph/custom.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts +12 -0
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +2 -0
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/graph.d.ts +26 -0
- package/dist/types/src/components/ComputeGraph/graph.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/index.d.ts +3 -1
- package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts +6 -5
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/formatting.d.ts +14 -0
- package/dist/types/src/components/Sheet/formatting.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/grid.d.ts +2 -2
- package/dist/types/src/components/Sheet/grid.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/nav.d.ts +3 -3
- package/dist/types/src/components/Sheet/nav.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/sheet-context.d.ts +5 -6
- package/dist/types/src/components/Sheet/sheet-context.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer.d.ts +3 -2
- package/dist/types/src/components/SheetContainer.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +3 -19
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +13 -18
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/{graph/function-defs.d.ts → model/functions.d.ts} +1 -1
- package/dist/types/src/model/functions.d.ts.map +1 -0
- package/dist/types/src/model/index.d.ts +3 -2
- package/dist/types/src/model/index.d.ts.map +1 -1
- package/dist/types/src/model/model.browser.test.d.ts +2 -0
- package/dist/types/src/model/model.browser.test.d.ts.map +1 -0
- package/dist/types/src/model/{sheet-model.d.ts → model.d.ts} +64 -9
- package/dist/types/src/model/model.d.ts.map +1 -0
- package/dist/types/src/{defs → model}/types.d.ts +3 -8
- package/dist/types/src/model/types.d.ts.map +1 -0
- package/dist/types/src/model/types.test.d.ts.map +1 -0
- package/dist/types/src/model/util.d.ts +15 -0
- package/dist/types/src/model/util.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +9 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +12 -17
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +3 -83
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +41 -48
- package/src/SheetPlugin.tsx +70 -43
- package/src/components/CellEditor/CellEditor.stories.tsx +3 -4
- package/src/components/CellEditor/CellEditor.tsx +9 -59
- package/src/components/CellEditor/extension.test.ts +5 -4
- package/src/components/CellEditor/extension.ts +3 -1
- package/src/{graph → components/ComputeGraph}/async-function.ts +1 -3
- package/src/{graph/custom-function.ts → components/ComputeGraph/custom.ts} +6 -2
- package/src/{graph → components/ComputeGraph}/edge-function.ts +1 -2
- package/src/components/ComputeGraph/graph-context.tsx +50 -0
- package/src/components/ComputeGraph/graph.browser.test.ts +50 -0
- package/src/components/ComputeGraph/graph.ts +62 -0
- package/src/components/ComputeGraph/index.ts +3 -1
- package/src/components/Sheet/Sheet.stories.tsx +82 -45
- package/src/components/Sheet/Sheet.tsx +18 -57
- package/src/{model/formatting-model.ts → components/Sheet/formatting.ts} +13 -20
- package/src/components/Sheet/grid.ts +3 -3
- package/src/components/Sheet/nav.ts +19 -19
- package/src/components/Sheet/sheet-context.tsx +78 -16
- package/src/components/SheetContainer.tsx +19 -73
- package/src/components/Toolbar/Toolbar.tsx +12 -53
- package/src/components/index.ts +0 -1
- package/src/meta.tsx +5 -1
- package/src/model/index.ts +3 -2
- package/src/model/model.browser.test.ts +100 -0
- package/src/model/model.ts +550 -0
- package/src/{defs → model}/types.test.ts +9 -8
- package/src/{defs → model}/types.ts +14 -23
- package/src/model/util.ts +36 -0
- package/src/testing.ts +50 -0
- package/src/translations.ts +1 -6
- package/src/types.ts +5 -30
- 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 +0 -2923
- 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.map +0 -7
- package/dist/lib/browser/graph-T27BOBOV.mjs +0 -21
- package/dist/lib/browser/graph-T27BOBOV.mjs.map +0 -7
- 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.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 +0 -76
- 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 +0 -17
- package/dist/lib/node-esm/chunk-IU2L277A.mjs.map +0 -7
- package/dist/lib/node-esm/graph-U67IO4UC.mjs +0 -22
- package/dist/lib/node-esm/graph-U67IO4UC.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -261
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -21
- package/dist/lib/node-esm/types.mjs.map +0 -7
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +0 -11
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts +0 -10
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +0 -9
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/util.d.ts +0 -7
- package/dist/types/src/components/GridSheet/util.d.ts.map +0 -1
- package/dist/types/src/components/Sheet/decorations.d.ts +0 -24
- package/dist/types/src/components/Sheet/decorations.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/defs/index.d.ts +0 -3
- package/dist/types/src/defs/index.d.ts.map +0 -1
- package/dist/types/src/defs/types.d.ts.map +0 -1
- package/dist/types/src/defs/types.test.d.ts.map +0 -1
- package/dist/types/src/defs/util.d.ts +0 -43
- package/dist/types/src/defs/util.d.ts.map +0 -1
- package/dist/types/src/extensions/compute.d.ts +0 -5
- package/dist/types/src/extensions/compute.d.ts.map +0 -1
- package/dist/types/src/extensions/compute.stories.d.ts +0 -26
- package/dist/types/src/extensions/compute.stories.d.ts.map +0 -1
- package/dist/types/src/extensions/index.d.ts +0 -2
- package/dist/types/src/extensions/index.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/compute-graph.d.ts +0 -81
- package/dist/types/src/graph/compute-graph.d.ts.map +0 -1
- package/dist/types/src/graph/compute-graph.stories.d.ts +0 -10
- package/dist/types/src/graph/compute-graph.stories.d.ts.map +0 -1
- package/dist/types/src/graph/compute-node.d.ts +0 -19
- package/dist/types/src/graph/compute-node.d.ts.map +0 -1
- package/dist/types/src/graph/custom-function.d.ts.map +0 -1
- 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/dist/types/src/graph/hyperformula.test.d.ts +0 -2
- package/dist/types/src/graph/hyperformula.test.d.ts.map +0 -1
- package/dist/types/src/graph/index.d.ts +0 -4
- package/dist/types/src/graph/index.d.ts.map +0 -1
- package/dist/types/src/graph/util.d.ts +0 -2
- package/dist/types/src/graph/util.d.ts.map +0 -1
- package/dist/types/src/hooks/hooks.stories.d.ts +0 -11
- package/dist/types/src/hooks/hooks.stories.d.ts.map +0 -1
- package/dist/types/src/hooks/index.d.ts +0 -4
- package/dist/types/src/hooks/index.d.ts.map +0 -1
- package/dist/types/src/hooks/useComputeGraph.d.ts +0 -7
- package/dist/types/src/hooks/useComputeGraph.d.ts.map +0 -1
- package/dist/types/src/hooks/useFormattingModel.d.ts +0 -3
- package/dist/types/src/hooks/useFormattingModel.d.ts.map +0 -1
- package/dist/types/src/hooks/useSheetModel.d.ts +0 -8
- package/dist/types/src/hooks/useSheetModel.d.ts.map +0 -1
- package/dist/types/src/model/formatting-model.d.ts +0 -16
- package/dist/types/src/model/formatting-model.d.ts.map +0 -1
- package/dist/types/src/model/sheet-model.d.ts.map +0 -1
- package/dist/types/src/sanity.test.d.ts +0 -2
- package/dist/types/src/sanity.test.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/testing.d.ts +0 -9
- package/dist/types/src/testing/testing.d.ts.map +0 -1
- package/dist/vendor/hyperformula.mjs +0 -37145
- package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +0 -20
- package/src/components/GridSheet/GridSheet.stories.tsx +0 -35
- package/src/components/GridSheet/GridSheet.tsx +0 -153
- package/src/components/GridSheet/util.ts +0 -108
- package/src/components/Sheet/decorations.ts +0 -62
- package/src/components/Sheet/threads.tsx +0 -205
- package/src/defs/index.ts +0 -6
- package/src/defs/util.ts +0 -135
- package/src/extensions/compute.stories.tsx +0 -151
- package/src/extensions/compute.ts +0 -98
- package/src/extensions/index.ts +0 -5
- package/src/graph/compute-graph.browser.test.ts +0 -104
- package/src/graph/compute-graph.stories.tsx +0 -92
- package/src/graph/compute-graph.ts +0 -290
- package/src/graph/compute-node.ts +0 -51
- package/src/graph/hyperformula.test.ts +0 -15
- package/src/graph/index.ts +0 -7
- package/src/graph/util.ts +0 -8
- package/src/hooks/hooks.stories.tsx +0 -50
- package/src/hooks/index.ts +0 -7
- package/src/hooks/useComputeGraph.ts +0 -20
- package/src/hooks/useFormattingModel.ts +0 -11
- package/src/hooks/useSheetModel.ts +0 -43
- package/src/model/sheet-model.ts +0 -399
- package/src/sanity.test.ts +0 -40
- package/src/testing/index.ts +0 -5
- package/src/testing/testing.tsx +0 -66
- /package/dist/types/src/{graph → components/ComputeGraph}/edge-function.d.ts +0 -0
- /package/dist/types/src/{defs → model}/types.test.d.ts +0 -0
- /package/src/{graph/function-defs.ts → model/functions.ts} +0 -0
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
export declare const DEFAULT_ROWS = 50;
|
|
2
|
-
export declare const DEFAULT_COLUMNS = 26;
|
|
3
|
-
export declare const MAX_ROWS = 500;
|
|
4
1
|
export declare const MAX_COLUMNS: number;
|
|
5
2
|
export type CellAddress = {
|
|
6
|
-
|
|
3
|
+
column: number;
|
|
7
4
|
row: number;
|
|
8
5
|
};
|
|
9
6
|
export type CellRange = {
|
|
10
7
|
from: CellAddress;
|
|
11
8
|
to?: CellAddress;
|
|
12
9
|
};
|
|
13
|
-
export type CellIndex = string;
|
|
14
|
-
export type CellContentValue = number | string | boolean | null;
|
|
15
10
|
export declare const posEquals: (a: CellAddress | undefined, b: CellAddress | undefined) => boolean;
|
|
16
|
-
export declare const columnLetter: (
|
|
17
|
-
export declare const addressToA1Notation: ({
|
|
11
|
+
export declare const columnLetter: (column: number) => string;
|
|
12
|
+
export declare const addressToA1Notation: ({ column, row }: CellAddress) => string;
|
|
18
13
|
export declare const addressFromA1Notation: (ref: string) => CellAddress;
|
|
19
14
|
export declare const rangeToA1Notation: (range: CellRange) => string;
|
|
20
15
|
export declare const rangeFromA1Notation: (ref: string) => CellRange;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/model/types.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,QAAU,CAAC;AAEnC,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhE,eAAO,MAAM,SAAS,MAAO,WAAW,GAAG,SAAS,KAAK,WAAW,GAAG,SAAS,YAE/E,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MAM7C,CAAC;AAEF,eAAO,MAAM,mBAAmB,oBAAqB,WAAW,KAAG,MAElE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAS,MAAM,KAAG,WAOnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,SAAS,WAIjD,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,SAGjD,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,SAAS,GAAG,SAAS,QAAQ,WAAW,KAAG,OAuBzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../../src/model/types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class ApiError extends Error {
|
|
2
|
+
}
|
|
3
|
+
export declare class ReadonlyException extends ApiError {
|
|
4
|
+
}
|
|
5
|
+
export declare class RangeException extends ApiError {
|
|
6
|
+
constructor(n: number);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* With a string length of 8, the chance of a collision is 0.02% for a sheet with 10,000 strings.
|
|
10
|
+
*/
|
|
11
|
+
export declare const createIndex: (length?: number) => string;
|
|
12
|
+
export declare const createIndices: (length: number) => string[];
|
|
13
|
+
export declare const pickOne: <T>(values: T[]) => T;
|
|
14
|
+
export declare const pickSome: <T>(values: T[], n?: number) => T[];
|
|
15
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/model/util.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAS,SAAQ,KAAK;CAAG;AACtC,qBAAa,iBAAkB,SAAQ,QAAQ;CAAG;AAClD,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,CAAC,EAAE,MAAM;CAGtB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,uBAAiB,MAKxC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAM,EAAqD,CAAC;AAG3G,eAAO,MAAM,OAAO,GAAI,CAAC,UAAU,CAAC,EAAE,KAAG,CAAsD,CAAC;AAChG,eAAO,MAAM,QAAQ,GAAI,CAAC,UAAU,CAAC,EAAE,iBAAU,CAAC,EAMjD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComputeGraph } from './components';
|
|
2
|
+
import { type CellValue } from './types';
|
|
3
|
+
export declare const testSheetName = "test";
|
|
4
|
+
export declare const createCells: () => Record<string, CellValue>;
|
|
5
|
+
export declare const createTestSheet: ({ name, graph, }?: {
|
|
6
|
+
name?: string;
|
|
7
|
+
graph?: ComputeGraph;
|
|
8
|
+
}) => Promise<import("./types").SheetType>;
|
|
9
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,cAAc,CAAC;AAErE,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,eAAO,MAAM,WAAW,QAAO,MAAM,CAAC,MAAM,EAAE,SAAS,CA0BrD,CAAC;AAEH,eAAO,MAAM,eAAe,sBAGzB;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAE,yCAQzC,CAAC"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly 'selection overlaps existing comment label': "Selected cell already has a comment";
|
|
13
|
-
readonly 'comment label': "Add comment";
|
|
14
|
-
readonly 'comment ranges not supported label': "Commenting on ranges is not yet supported";
|
|
15
|
-
readonly 'no cursor label': "Select a cell to comment";
|
|
16
|
-
readonly 'open comment for sheet cell': "View comments for cell";
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'en-US': {
|
|
3
|
+
"dxos.org/plugin/sheet": {
|
|
4
|
+
'plugin name': string;
|
|
5
|
+
'sheet title placeholder': string;
|
|
6
|
+
'create sheet label': string;
|
|
7
|
+
'create sheet section label': string;
|
|
8
|
+
'cell placeholder': string;
|
|
9
|
+
'toolbar left label': string;
|
|
10
|
+
'toolbar left center': string;
|
|
11
|
+
'toolbar left right': string;
|
|
17
12
|
};
|
|
18
13
|
};
|
|
19
|
-
}];
|
|
14
|
+
}[];
|
|
20
15
|
export default _default;
|
|
21
16
|
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAMA,wBAeE"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import type { GraphBuilderProvides, IntentResolverProvides, MetadataRecordsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
|
|
2
|
-
import {
|
|
2
|
+
import { S } from '@dxos/echo-schema';
|
|
3
3
|
import { type SchemaProvides } from '@dxos/plugin-client';
|
|
4
|
-
import { type MarkdownExtensionProvides } from '@dxos/plugin-markdown';
|
|
5
|
-
import { type SpaceInitProvides } from '@dxos/plugin-space';
|
|
6
4
|
import { type StackProvides } from '@dxos/plugin-stack';
|
|
7
5
|
export declare enum SheetAction {
|
|
8
6
|
CREATE = "dxos.org/plugin/sheet/action/create"
|
|
9
7
|
}
|
|
10
|
-
type
|
|
11
|
-
thread: {
|
|
12
|
-
predicate: (obj: any) => obj is T;
|
|
13
|
-
createSort: (obj: T) => (anchorA: string | undefined, anchorB: string | undefined) => number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export type SheetPluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & MarkdownExtensionProvides & MetadataRecordsProvides & TranslationsProvides & SchemaProvides & SpaceInitProvides & StackProvides & ThreadProvides<SheetType>;
|
|
8
|
+
export type SheetPluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & MetadataRecordsProvides & TranslationsProvides & SchemaProvides & StackProvides;
|
|
17
9
|
export type CellScalarValue = number | string | boolean | null;
|
|
18
10
|
export declare const CellValue: S.Struct<{
|
|
19
11
|
value: typeof S.Any;
|
|
@@ -73,39 +65,6 @@ declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
|
73
65
|
classNames?: readonly string[] | undefined;
|
|
74
66
|
};
|
|
75
67
|
};
|
|
76
|
-
threads?: import("@dxos/echo-schema").Ref<{
|
|
77
|
-
name?: string | undefined;
|
|
78
|
-
anchor?: string | undefined;
|
|
79
|
-
status?: "active" | "staged" | "resolved" | undefined;
|
|
80
|
-
messages: import("@dxos/echo-schema").Ref<{
|
|
81
|
-
text: string;
|
|
82
|
-
timestamp: string;
|
|
83
|
-
state?: import("@dxos/plugin-space").MessageState | undefined;
|
|
84
|
-
sender: {
|
|
85
|
-
name?: string | undefined;
|
|
86
|
-
contact?: import("@dxos/echo-schema").Ref<{
|
|
87
|
-
name?: string | undefined;
|
|
88
|
-
identifiers: {
|
|
89
|
-
readonly value: string;
|
|
90
|
-
readonly type: string;
|
|
91
|
-
}[];
|
|
92
|
-
} & {
|
|
93
|
-
id: string;
|
|
94
|
-
}>;
|
|
95
|
-
identityKey?: string | undefined;
|
|
96
|
-
email?: string | undefined;
|
|
97
|
-
};
|
|
98
|
-
parts?: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>[] | undefined;
|
|
99
|
-
properties?: {
|
|
100
|
-
[x: string]: any;
|
|
101
|
-
} | undefined;
|
|
102
|
-
context?: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>;
|
|
103
|
-
} & {
|
|
104
|
-
id: string;
|
|
105
|
-
}>[];
|
|
106
|
-
} & {
|
|
107
|
-
id: string;
|
|
108
|
-
}>[] | undefined;
|
|
109
68
|
} & {
|
|
110
69
|
id: string;
|
|
111
70
|
}, S.Struct.Encoded<{
|
|
@@ -127,48 +86,9 @@ declare const SheetType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
|
127
86
|
precision: S.optional<typeof S.Number>;
|
|
128
87
|
classNames: S.optional<S.Array$<typeof S.String>>;
|
|
129
88
|
}>>>>;
|
|
130
|
-
threads: S.optional<S.mutable<S.Array$<ref<{
|
|
131
|
-
name?: string | undefined;
|
|
132
|
-
anchor?: string | undefined;
|
|
133
|
-
status?: "active" | "staged" | "resolved" | undefined;
|
|
134
|
-
messages: import("@dxos/echo-schema").Ref<{
|
|
135
|
-
text: string;
|
|
136
|
-
timestamp: string;
|
|
137
|
-
state?: import("@dxos/plugin-space").MessageState | undefined;
|
|
138
|
-
sender: {
|
|
139
|
-
name?: string | undefined;
|
|
140
|
-
contact?: import("@dxos/echo-schema").Ref<{
|
|
141
|
-
name?: string | undefined;
|
|
142
|
-
identifiers: {
|
|
143
|
-
readonly value: string;
|
|
144
|
-
readonly type: string;
|
|
145
|
-
}[];
|
|
146
|
-
} & {
|
|
147
|
-
id: string;
|
|
148
|
-
}>;
|
|
149
|
-
identityKey?: string | undefined;
|
|
150
|
-
email?: string | undefined;
|
|
151
|
-
};
|
|
152
|
-
parts?: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>[] | undefined;
|
|
153
|
-
properties?: {
|
|
154
|
-
[x: string]: any;
|
|
155
|
-
} | undefined;
|
|
156
|
-
context?: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>;
|
|
157
|
-
} & {
|
|
158
|
-
id: string;
|
|
159
|
-
}>[];
|
|
160
|
-
} & {
|
|
161
|
-
id: string;
|
|
162
|
-
}>>>>;
|
|
163
89
|
}>>;
|
|
164
90
|
export declare class SheetType extends SheetType_base {
|
|
165
91
|
}
|
|
166
|
-
export
|
|
167
|
-
rows: number;
|
|
168
|
-
columns: number;
|
|
169
|
-
};
|
|
170
|
-
export type CreateSheetOptions = {
|
|
171
|
-
title?: string;
|
|
172
|
-
} & Partial<SheetSize>;
|
|
92
|
+
export declare const createSheet: (title?: string) => SheetType;
|
|
173
93
|
export {};
|
|
174
94
|
//# 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,
|
|
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,EAAU,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMxD,oBAAY,WAAW;IACrB,MAAM,wCAA2B;CAClC;AAED,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAC/C,sBAAsB,GACtB,oBAAoB,GACpB,uBAAuB,GACvB,oBAAoB,GACpB,cAAc,GACd,aAAa,CAAC;AAEhB,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE/D,eAAO,MAAM,SAAS;;EAMpB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAExD;;GAEG;AAEH,oBAAY,aAAa;IACvB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,OAAO,IAAI;IACX,MAAM,IAAI;IAGV,OAAO,KAAK;IACZ,QAAQ,KAAK;IAGb,QAAQ,KAAK;IACb,IAAI,KAAK;IACT,IAAI,KAAK;IAIT,GAAG,KAAK;IACR,GAAG,KAAK;CACT;AAED,eAAO,MAAM,SAAS,+BAAyB,CAAC;AAEhD,eAAO,MAAM,UAAU;;;;;EAKrB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAG1D,eAAO,MAAM,aAAa;;EAExB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKH,qBAAa,SAAU,SAAQ,cAoB7B;CAAG;AAGL,eAAO,MAAM,WAAW,WAAY,MAAM,KAAG,SACgE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.6.12-
|
|
3
|
+
"version": "0.6.12-staging.0b4bb48",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
|
-
"imports": {
|
|
10
|
-
"#hyperformula": {
|
|
11
|
-
"types": "hyperformula",
|
|
12
|
-
"default": "./dist/vendor/hyperformula.mjs"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
9
|
"exports": {
|
|
16
10
|
".": {
|
|
17
11
|
"browser": "./dist/lib/browser/index.mjs",
|
|
18
12
|
"node": {
|
|
19
|
-
"
|
|
20
|
-
"default": "./dist/lib/node-esm/index.mjs"
|
|
13
|
+
"default": "./dist/lib/node/index.cjs"
|
|
21
14
|
},
|
|
22
15
|
"types": "./dist/types/src/index.d.ts"
|
|
23
16
|
},
|
|
24
17
|
"./meta": {
|
|
25
18
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
26
19
|
"node": {
|
|
27
|
-
"
|
|
28
|
-
"default": "./dist/lib/node-esm/meta.mjs"
|
|
20
|
+
"default": "./dist/lib/node/meta.cjs"
|
|
29
21
|
},
|
|
30
22
|
"types": "./dist/types/src/meta.d.ts"
|
|
31
23
|
},
|
|
24
|
+
"./testing": {
|
|
25
|
+
"browser": "./dist/lib/browser/testing.mjs",
|
|
26
|
+
"node": {
|
|
27
|
+
"default": "./dist/lib/node/testing.cjs"
|
|
28
|
+
},
|
|
29
|
+
"types": "./dist/types/src/testing.d.ts"
|
|
30
|
+
},
|
|
32
31
|
"./types": {
|
|
33
32
|
"browser": "./dist/lib/browser/types.mjs",
|
|
34
33
|
"node": {
|
|
35
|
-
"
|
|
36
|
-
"default": "./dist/lib/node-esm/types.mjs"
|
|
34
|
+
"default": "./dist/lib/node/types.cjs"
|
|
37
35
|
},
|
|
38
36
|
"types": "./dist/types/src/types.d.ts"
|
|
39
37
|
}
|
|
@@ -78,29 +76,25 @@
|
|
|
78
76
|
"re-resizable": "^6.9.17",
|
|
79
77
|
"react-markdown": "^8.0.5",
|
|
80
78
|
"react-resize-detector": "^11.0.1",
|
|
81
|
-
"@dxos/app-framework": "0.6.12-
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/invariant": "0.6.12-
|
|
89
|
-
"@dxos/log": "0.6.12-
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/plugin-
|
|
93
|
-
"@dxos/plugin-script": "0.6.12-
|
|
94
|
-
"@dxos/plugin-
|
|
95
|
-
"@dxos/plugin-
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/react-
|
|
98
|
-
"@dxos/react-
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/react-ui-grid": "0.6.12-main.ed7cda7",
|
|
101
|
-
"@dxos/react-ui-attention": "0.6.12-main.ed7cda7",
|
|
102
|
-
"@dxos/util": "0.6.12-main.ed7cda7",
|
|
103
|
-
"@dxos/react-ui-editor": "0.6.12-main.ed7cda7"
|
|
79
|
+
"@dxos/app-framework": "0.6.12-staging.0b4bb48",
|
|
80
|
+
"@dxos/client": "0.6.12-staging.0b4bb48",
|
|
81
|
+
"@dxos/context": "0.6.12-staging.0b4bb48",
|
|
82
|
+
"@dxos/async": "0.6.12-staging.0b4bb48",
|
|
83
|
+
"@dxos/crypto": "0.6.12-staging.0b4bb48",
|
|
84
|
+
"@dxos/debug": "0.6.12-staging.0b4bb48",
|
|
85
|
+
"@dxos/echo-schema": "0.6.12-staging.0b4bb48",
|
|
86
|
+
"@dxos/invariant": "0.6.12-staging.0b4bb48",
|
|
87
|
+
"@dxos/log": "0.6.12-staging.0b4bb48",
|
|
88
|
+
"@dxos/plugin-client": "0.6.12-staging.0b4bb48",
|
|
89
|
+
"@dxos/keys": "0.6.12-staging.0b4bb48",
|
|
90
|
+
"@dxos/plugin-graph": "0.6.12-staging.0b4bb48",
|
|
91
|
+
"@dxos/plugin-script": "0.6.12-staging.0b4bb48",
|
|
92
|
+
"@dxos/plugin-space": "0.6.12-staging.0b4bb48",
|
|
93
|
+
"@dxos/plugin-stack": "0.6.12-staging.0b4bb48",
|
|
94
|
+
"@dxos/react-client": "0.6.12-staging.0b4bb48",
|
|
95
|
+
"@dxos/react-ui-editor": "0.6.12-staging.0b4bb48",
|
|
96
|
+
"@dxos/react-ui-attention": "0.6.12-staging.0b4bb48",
|
|
97
|
+
"@dxos/util": "0.6.12-staging.0b4bb48"
|
|
104
98
|
},
|
|
105
99
|
"devDependencies": {
|
|
106
100
|
"@lezer/generator": "^1.7.1",
|
|
@@ -112,21 +106,20 @@
|
|
|
112
106
|
"@types/react-window": "^1.8.8",
|
|
113
107
|
"react": "~18.2.0",
|
|
114
108
|
"react-dom": "~18.2.0",
|
|
115
|
-
"vite": "5.4
|
|
116
|
-
"@dxos/
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/react-ui
|
|
119
|
-
"@dxos/react-ui-
|
|
120
|
-
"@dxos/react-ui": "0.6.12-
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/storybook-utils": "0.6.12-main.ed7cda7"
|
|
109
|
+
"vite": "^5.3.4",
|
|
110
|
+
"@dxos/echo-generator": "0.6.12-staging.0b4bb48",
|
|
111
|
+
"@dxos/random": "0.6.12-staging.0b4bb48",
|
|
112
|
+
"@dxos/react-ui": "0.6.12-staging.0b4bb48",
|
|
113
|
+
"@dxos/react-ui-types": "0.6.12-staging.0b4bb48",
|
|
114
|
+
"@dxos/react-ui-theme": "0.6.12-staging.0b4bb48",
|
|
115
|
+
"@dxos/storybook-utils": "0.6.12-staging.0b4bb48"
|
|
123
116
|
},
|
|
124
117
|
"optionalDependencies": {
|
|
125
118
|
"@phosphor-icons/react": "^2.1.5",
|
|
126
|
-
"react": "
|
|
127
|
-
"react-dom": "
|
|
128
|
-
"@dxos/react-ui": "0.6.12-
|
|
129
|
-
"@dxos/react-ui-theme": "0.6.12-
|
|
119
|
+
"react": "^18.0.0",
|
|
120
|
+
"react-dom": "^18.0.0",
|
|
121
|
+
"@dxos/react-ui": "0.6.12-staging.0b4bb48",
|
|
122
|
+
"@dxos/react-ui-theme": "0.6.12-staging.0b4bb48"
|
|
130
123
|
},
|
|
131
124
|
"publishConfig": {
|
|
132
125
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -2,69 +2,84 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { GridNine } from '@phosphor-icons/react';
|
|
5
|
+
import { type IconProps, GridNine } from '@phosphor-icons/react';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
NavigationAction,
|
|
10
|
+
parseIntentPlugin,
|
|
11
|
+
resolvePlugin,
|
|
12
|
+
type PluginDefinition,
|
|
13
|
+
type LayoutCoordinate,
|
|
14
|
+
} from '@dxos/app-framework';
|
|
15
|
+
import { create } from '@dxos/echo-schema';
|
|
10
16
|
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
11
|
-
import { createExtension, isActionGroup
|
|
17
|
+
import { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';
|
|
12
18
|
import { FunctionType } from '@dxos/plugin-script/types';
|
|
13
19
|
import { SpaceAction } from '@dxos/plugin-space';
|
|
14
20
|
import { getSpace, isEchoObject } from '@dxos/react-client/echo';
|
|
15
21
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
import {
|
|
23
|
+
createComputeGraph,
|
|
24
|
+
CustomPlugin,
|
|
25
|
+
CustomPluginTranslations,
|
|
26
|
+
SheetContainer,
|
|
27
|
+
type ComputeGraph,
|
|
28
|
+
} from './components';
|
|
29
|
+
// TODO(wittjosiah): Refactor. These are not exported from ./components due to depending on ECHO.
|
|
30
|
+
import { EdgeFunctionPlugin, EdgeFunctionPluginTranslations } from './components/ComputeGraph/edge-function';
|
|
31
|
+
import { ComputeGraphContextProvider } from './components/ComputeGraph/graph-context';
|
|
19
32
|
import meta, { SHEET_PLUGIN } from './meta';
|
|
33
|
+
import { SheetModel } from './model';
|
|
20
34
|
import translations from './translations';
|
|
21
|
-
import {
|
|
35
|
+
import { createSheet, SheetAction, type SheetPluginProvides, SheetType } from './types';
|
|
22
36
|
|
|
23
37
|
export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
24
|
-
let
|
|
38
|
+
let remoteFunctionUrl: string | undefined;
|
|
39
|
+
|
|
40
|
+
const graphs = create<Record<string, ComputeGraph>>({});
|
|
41
|
+
const setGraph = (key: string, graph: ComputeGraph) => {
|
|
42
|
+
graphs[key] = graph;
|
|
43
|
+
};
|
|
25
44
|
|
|
26
45
|
return {
|
|
27
46
|
meta,
|
|
28
47
|
ready: async (plugins) => {
|
|
29
48
|
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
30
|
-
|
|
31
|
-
|
|
49
|
+
if (!client) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
if (client.config.values.runtime?.services?.edge?.url) {
|
|
33
54
|
const url = new URL('/functions', client.config.values.runtime?.services?.edge?.url);
|
|
34
55
|
url.protocol = 'https';
|
|
35
56
|
remoteFunctionUrl = url.toString();
|
|
36
57
|
}
|
|
37
|
-
|
|
38
|
-
// Async import removes direct dependency on hyperformula.
|
|
39
|
-
const { createComputeGraphRegistry } = await import('./graph');
|
|
40
|
-
graphRegistry = createComputeGraphRegistry({ remoteFunctionUrl });
|
|
41
58
|
},
|
|
42
59
|
provides: {
|
|
43
60
|
context: ({ children }) => {
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
return (
|
|
62
|
+
<ComputeGraphContextProvider graphs={graphs} setGraph={setGraph}>
|
|
63
|
+
{children}
|
|
64
|
+
</ComputeGraphContextProvider>
|
|
65
|
+
);
|
|
46
66
|
},
|
|
47
67
|
metadata: {
|
|
48
68
|
records: {
|
|
49
69
|
[SheetType.typename]: {
|
|
50
70
|
label: (object: any) => (object instanceof SheetType ? object.title : undefined),
|
|
51
71
|
placeholder: ['sheet title placeholder', { ns: SHEET_PLUGIN }],
|
|
52
|
-
icon:
|
|
72
|
+
icon: (props: IconProps) => <GridNine {...props} />,
|
|
73
|
+
iconSymbol: 'ph--grid-nine--regular',
|
|
53
74
|
},
|
|
54
75
|
},
|
|
55
76
|
},
|
|
56
77
|
translations,
|
|
57
78
|
echo: {
|
|
58
79
|
// TODO(wittjosiah): Factor out to common package/plugin.
|
|
59
|
-
//
|
|
80
|
+
// FunctionType is currently registered here in case script plugin isn't enabled.
|
|
60
81
|
schema: [SheetType, FunctionType],
|
|
61
82
|
},
|
|
62
|
-
space: {
|
|
63
|
-
onSpaceCreate: {
|
|
64
|
-
label: ['create sheet label', { ns: SHEET_PLUGIN }],
|
|
65
|
-
action: SheetAction.CREATE,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
83
|
graph: {
|
|
69
84
|
builder: (plugins) => {
|
|
70
85
|
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
@@ -98,7 +113,8 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
98
113
|
},
|
|
99
114
|
properties: {
|
|
100
115
|
label: ['create sheet label', { ns: SHEET_PLUGIN }],
|
|
101
|
-
icon:
|
|
116
|
+
icon: (props: IconProps) => <GridNine {...props} />,
|
|
117
|
+
iconSymbol: 'ph--grid-nine--regular',
|
|
102
118
|
testId: 'sheetPlugin.createObject',
|
|
103
119
|
},
|
|
104
120
|
},
|
|
@@ -107,15 +123,6 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
107
123
|
});
|
|
108
124
|
},
|
|
109
125
|
},
|
|
110
|
-
markdown: {
|
|
111
|
-
// TODO(burdon): Construct compute node.
|
|
112
|
-
extensions: ({ document }) => {
|
|
113
|
-
return undefined;
|
|
114
|
-
// return [
|
|
115
|
-
// compute(document)
|
|
116
|
-
// ];
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
126
|
stack: {
|
|
120
127
|
creators: [
|
|
121
128
|
{
|
|
@@ -131,19 +138,23 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
131
138
|
},
|
|
132
139
|
],
|
|
133
140
|
},
|
|
134
|
-
thread: {
|
|
135
|
-
predicate: (data) => data instanceof SheetType,
|
|
136
|
-
createSort: (sheet) => (indexA, indexB) =>
|
|
137
|
-
!indexA || !indexB ? 0 : compareIndexPositions(sheet, indexA, indexB),
|
|
138
|
-
},
|
|
139
141
|
surface: {
|
|
140
|
-
component: ({ data, role }) => {
|
|
142
|
+
component: ({ data, role = 'never' }) => {
|
|
143
|
+
// TODO(burdon): Standardize wrapper (with room for toolbar).
|
|
141
144
|
const space = isEchoObject(data.object) && getSpace(data.object);
|
|
142
145
|
if (space && data.object instanceof SheetType) {
|
|
143
146
|
switch (role) {
|
|
144
147
|
case 'article':
|
|
145
148
|
case 'section': {
|
|
146
|
-
return
|
|
149
|
+
return (
|
|
150
|
+
<SheetContainer
|
|
151
|
+
sheet={data.object}
|
|
152
|
+
space={space}
|
|
153
|
+
role={role}
|
|
154
|
+
coordinate={data.coordinate as LayoutCoordinate}
|
|
155
|
+
remoteFunctionUrl={remoteFunctionUrl}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
147
158
|
}
|
|
148
159
|
}
|
|
149
160
|
}
|
|
@@ -155,7 +166,23 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
155
166
|
resolver: async (intent) => {
|
|
156
167
|
switch (intent.action) {
|
|
157
168
|
case SheetAction.CREATE: {
|
|
158
|
-
|
|
169
|
+
const space = intent.data?.space;
|
|
170
|
+
const sheet = createSheet();
|
|
171
|
+
const graph =
|
|
172
|
+
graphs[space.id] ??
|
|
173
|
+
createComputeGraph(
|
|
174
|
+
[
|
|
175
|
+
{ plugin: EdgeFunctionPlugin, translations: EdgeFunctionPluginTranslations },
|
|
176
|
+
// TODO(wittjosiah): Remove. Needed for current test sheet generated data.
|
|
177
|
+
{ plugin: CustomPlugin, translations: CustomPluginTranslations },
|
|
178
|
+
],
|
|
179
|
+
space,
|
|
180
|
+
{ remoteFunctionUrl },
|
|
181
|
+
);
|
|
182
|
+
const model = new SheetModel(graph, sheet);
|
|
183
|
+
await model.initialize();
|
|
184
|
+
await model.destroy();
|
|
185
|
+
return { data: sheet };
|
|
159
186
|
}
|
|
160
187
|
}
|
|
161
188
|
},
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
+
import { HyperFormula } from 'hyperformula';
|
|
7
8
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
8
9
|
|
|
9
10
|
import { Client } from '@dxos/client';
|
|
@@ -11,12 +12,10 @@ import { createDocAccessor, type EchoReactiveObject } from '@dxos/client/echo';
|
|
|
11
12
|
import { automerge } from '@dxos/react-ui-editor';
|
|
12
13
|
import { withTheme } from '@dxos/storybook-utils';
|
|
13
14
|
|
|
14
|
-
import { HyperFormula } from '#hyperformula';
|
|
15
15
|
import { CellEditor, type CellEditorProps } from './CellEditor';
|
|
16
16
|
import { sheetExtension } from './extension';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { SheetType } from '../../types';
|
|
17
|
+
import { defaultFunctions } from '../../model';
|
|
18
|
+
import { createSheet, SheetType } from '../../types';
|
|
20
19
|
|
|
21
20
|
export default {
|
|
22
21
|
title: 'plugin-sheet/CellEditor',
|