@dxos/plugin-sheet 0.7.4 → 0.7.5-main.937ce75
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-KCLT6PEO.mjs → SheetContainer-S4NCLUYL.mjs} +16 -22
- package/dist/lib/browser/SheetContainer-S4NCLUYL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-E5WQ7U7G.mjs → chunk-A374JPWV.mjs} +72 -705
- package/dist/lib/browser/chunk-A374JPWV.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q4XS4YWF.mjs +900 -0
- package/dist/lib/browser/chunk-Q4XS4YWF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +74 -180
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +62 -0
- package/dist/lib/node/{SheetContainer-VVVRYTQG.cjs → SheetContainer-TP4GYXZB.cjs} +41 -43
- package/dist/lib/node/SheetContainer-TP4GYXZB.cjs.map +7 -0
- package/dist/lib/node/{chunk-45YW2DX2.cjs → chunk-FDEQ2PGJ.cjs} +115 -726
- package/dist/lib/node/chunk-FDEQ2PGJ.cjs.map +7 -0
- package/dist/lib/node/chunk-TQOJ7DG2.cjs +935 -0
- package/dist/lib/node/chunk-TQOJ7DG2.cjs.map +7 -0
- package/dist/lib/node/index.cjs +104 -207
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +84 -0
- package/dist/lib/node/types/index.cjs.map +7 -0
- package/dist/lib/node-esm/{SheetContainer-LSBE6Q4X.mjs → SheetContainer-YB3JBVPZ.mjs} +16 -22
- package/dist/lib/node-esm/SheetContainer-YB3JBVPZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NYDNXI7L.mjs → chunk-L5PQHVTX.mjs} +72 -705
- package/dist/lib/node-esm/chunk-L5PQHVTX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NYYIDVR7.mjs +901 -0
- package/dist/lib/node-esm/chunk-NYYIDVR7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +74 -180
- 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/index.mjs +63 -0
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +1 -1
- package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -0
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/util.d.ts.map +1 -1
- package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetContext/SheetContext.d.ts +1 -2
- package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/extensions/compute.d.ts +1 -1
- package/dist/types/src/extensions/compute.d.ts.map +1 -1
- package/dist/types/src/extensions/editor/extension.d.ts +1 -1
- package/dist/types/src/extensions/editor/extension.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +6 -8
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/model/testing.d.ts +1 -1
- package/dist/types/src/model/testing.d.ts.map +1 -1
- package/dist/types/src/model/useSheetModel.d.ts +1 -1
- package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +2 -2
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/{defs → types}/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +105 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/types/sheet-range-types.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +82 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/{defs → types}/util.d.ts +5 -1
- package/dist/types/src/types/util.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +46 -53
- package/src/SheetPlugin.tsx +44 -115
- package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +1 -2
- package/src/{compute-graph → components/ComputeGraph}/compute-graph.stories.tsx +6 -7
- package/src/components/FunctionEditor/FunctionEditor.tsx +2 -1
- package/src/components/GridSheet/GridSheet.tsx +15 -18
- package/src/components/GridSheet/SheetCellEditor.stories.tsx +6 -7
- package/src/components/GridSheet/util.ts +3 -2
- package/src/components/RangeList/RangeList.tsx +2 -1
- package/src/components/SheetContainer/SheetContainer.stories.tsx +11 -12
- package/src/components/SheetContext/SheetContext.tsx +1 -2
- package/src/components/Toolbar/Toolbar.tsx +18 -20
- package/src/extensions/compute.ts +7 -4
- package/src/extensions/editor/extension.test.ts +2 -1
- package/src/extensions/editor/extension.ts +2 -3
- package/src/index.ts +1 -3
- package/src/integrations/thread-ranges.ts +28 -24
- package/src/model/sheet-model.test.ts +4 -10
- package/src/model/sheet-model.ts +30 -22
- package/src/model/testing.ts +3 -2
- package/src/model/useSheetModel.ts +2 -1
- package/src/sanity.test.ts +1 -1
- package/src/testing/testing.tsx +2 -3
- package/src/{defs → types}/index.ts +1 -0
- package/src/types/schema.ts +56 -0
- package/src/types/types.ts +93 -0
- package/src/{defs → types}/util.ts +13 -13
- package/dist/lib/browser/SheetContainer-KCLT6PEO.mjs.map +0 -7
- package/dist/lib/browser/chunk-E5WQ7U7G.mjs.map +0 -7
- package/dist/lib/browser/chunk-F3HE6D3J.mjs +0 -3269
- package/dist/lib/browser/chunk-F3HE6D3J.mjs.map +0 -7
- package/dist/lib/browser/chunk-JXFPOYNA.mjs +0 -67
- package/dist/lib/browser/chunk-JXFPOYNA.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-SNUS7HOH.mjs +0 -35
- package/dist/lib/browser/types.mjs +0 -16
- package/dist/lib/node/SheetContainer-VVVRYTQG.cjs.map +0 -7
- package/dist/lib/node/chunk-45YW2DX2.cjs.map +0 -7
- package/dist/lib/node/chunk-KSEEI5VC.cjs +0 -3323
- package/dist/lib/node/chunk-KSEEI5VC.cjs.map +0 -7
- package/dist/lib/node/chunk-OWH2EUHZ.cjs +0 -90
- package/dist/lib/node/chunk-OWH2EUHZ.cjs.map +0 -7
- package/dist/lib/node/compute-graph-WILPHO4A.cjs +0 -57
- package/dist/lib/node/compute-graph-WILPHO4A.cjs.map +0 -7
- package/dist/lib/node/types.cjs +0 -38
- package/dist/lib/node/types.cjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-LSBE6Q4X.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6JF2AHKO.mjs +0 -3270
- package/dist/lib/node-esm/chunk-6JF2AHKO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BVS2IQRO.mjs +0 -68
- package/dist/lib/node-esm/chunk-BVS2IQRO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NYDNXI7L.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-S6CVN7RS.mjs +0 -36
- package/dist/lib/node-esm/compute-graph-S6CVN7RS.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -17
- package/dist/lib/node-esm/types.mjs.map +0 -7
- package/dist/types/src/compute-graph/compute-graph-registry.d.ts +0 -34
- package/dist/types/src/compute-graph/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/compute-graph/compute-graph.d.ts +0 -64
- package/dist/types/src/compute-graph/compute-graph.d.ts.map +0 -1
- package/dist/types/src/compute-graph/compute-graph.stories.d.ts.map +0 -1
- package/dist/types/src/compute-graph/compute-graph.test.d.ts +0 -2
- package/dist/types/src/compute-graph/compute-graph.test.d.ts.map +0 -1
- package/dist/types/src/compute-graph/compute-node.d.ts +0 -26
- package/dist/types/src/compute-graph/compute-node.d.ts.map +0 -1
- package/dist/types/src/compute-graph/functions/async-function.d.ts +0 -66
- package/dist/types/src/compute-graph/functions/async-function.d.ts.map +0 -1
- package/dist/types/src/compute-graph/functions/edge-function.d.ts +0 -21
- package/dist/types/src/compute-graph/functions/edge-function.d.ts.map +0 -1
- package/dist/types/src/compute-graph/functions/function-defs.d.ts +0 -11
- package/dist/types/src/compute-graph/functions/function-defs.d.ts.map +0 -1
- package/dist/types/src/compute-graph/functions/index.d.ts +0 -4
- package/dist/types/src/compute-graph/functions/index.d.ts.map +0 -1
- package/dist/types/src/compute-graph/hyperformula.test.d.ts +0 -2
- package/dist/types/src/compute-graph/hyperformula.test.d.ts.map +0 -1
- package/dist/types/src/compute-graph/index.d.ts +0 -5
- package/dist/types/src/compute-graph/index.d.ts.map +0 -1
- package/dist/types/src/compute-graph/testing/index.d.ts +0 -3
- package/dist/types/src/compute-graph/testing/index.d.ts.map +0 -1
- package/dist/types/src/compute-graph/testing/test-builder.d.ts +0 -15
- package/dist/types/src/compute-graph/testing/test-builder.d.ts.map +0 -1
- package/dist/types/src/compute-graph/testing/test-plugin.d.ts +0 -36
- package/dist/types/src/compute-graph/testing/test-plugin.d.ts.map +0 -1
- package/dist/types/src/compute-graph/util.d.ts +0 -2
- package/dist/types/src/compute-graph/util.d.ts.map +0 -1
- package/dist/types/src/defs/index.d.ts.map +0 -1
- package/dist/types/src/defs/sheet-range-types.d.ts.map +0 -1
- package/dist/types/src/defs/types.d.ts +0 -26
- package/dist/types/src/defs/types.d.ts.map +0 -1
- package/dist/types/src/defs/types.test.d.ts +0 -2
- package/dist/types/src/defs/types.test.d.ts.map +0 -1
- package/dist/types/src/defs/util.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -182
- package/dist/types/src/types.d.ts.map +0 -1
- package/dist/vendor/hyperformula.mjs +0 -37145
- package/src/compute-graph/compute-graph-registry.ts +0 -90
- package/src/compute-graph/compute-graph.test.ts +0 -87
- package/src/compute-graph/compute-graph.ts +0 -260
- package/src/compute-graph/compute-node.ts +0 -62
- package/src/compute-graph/functions/async-function.ts +0 -179
- package/src/compute-graph/functions/edge-function.ts +0 -102
- package/src/compute-graph/functions/function-defs.ts +0 -2427
- package/src/compute-graph/functions/index.ts +0 -7
- package/src/compute-graph/hyperformula.test.ts +0 -14
- package/src/compute-graph/index.ts +0 -8
- package/src/compute-graph/testing/index.ts +0 -6
- package/src/compute-graph/testing/test-builder.ts +0 -54
- package/src/compute-graph/testing/test-plugin.ts +0 -100
- package/src/compute-graph/util.ts +0 -8
- package/src/defs/types.test.ts +0 -91
- package/src/defs/types.ts +0 -88
- package/src/types.ts +0 -125
- /package/dist/lib/browser/{compute-graph-SNUS7HOH.mjs.map → types/index.mjs.map} +0 -0
- /package/dist/lib/{browser/types.mjs.map → node-esm/types/index.mjs.map} +0 -0
- /package/dist/types/src/{compute-graph → components/ComputeGraph}/compute-graph.stories.d.ts +0 -0
- /package/dist/types/src/{defs → types}/sheet-range-types.d.ts +0 -0
- /package/src/{defs → types}/sheet-range-types.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Decorator } from '@storybook/react';
|
|
2
|
+
import { type ComputeGraph, type ComputeGraphOptions } from '@dxos/compute';
|
|
2
3
|
import { type Space } from '@dxos/react-client/echo';
|
|
3
|
-
import { type ComputeGraph, type ComputeGraphOptions } from '../compute-graph';
|
|
4
4
|
import { type CreateSheetOptions } from '../types';
|
|
5
|
-
export declare const useTestSheet: (space?: Space, graph?: ComputeGraph, options?: CreateSheetOptions) => import("
|
|
5
|
+
export declare const useTestSheet: (space?: Space, graph?: ComputeGraph, options?: CreateSheetOptions) => import("..").SheetType | undefined;
|
|
6
6
|
export declare const withComputeGraphDecorator: (options?: ComputeGraphOptions) => Decorator;
|
|
7
7
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,YAAY,EAAE,KAAK,mBAAmB,EAAwB,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAIrD,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEhE,eAAO,MAAM,YAAY,WAAY,KAAK,UAAU,YAAY,YAAY,kBAAkB,uCAW7F,CAAC;AAEF,eAAO,MAAM,yBAAyB,aACzB,mBAAmB,KAAG,SAQhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { S } from '@dxos/echo-schema';
|
|
2
|
+
export declare const CellValue: S.Struct<{
|
|
3
|
+
value: typeof S.Any;
|
|
4
|
+
}>;
|
|
5
|
+
export type CellValue = S.Schema.Type<typeof CellValue>;
|
|
6
|
+
export declare const Range: S.Struct<{
|
|
7
|
+
range: typeof S.String;
|
|
8
|
+
key: typeof S.String;
|
|
9
|
+
value: typeof S.String;
|
|
10
|
+
}>;
|
|
11
|
+
export type Range = S.Schema.Type<typeof Range>;
|
|
12
|
+
export declare const RowColumnMeta: S.Struct<{
|
|
13
|
+
size: S.optional<typeof S.Number>;
|
|
14
|
+
}>;
|
|
15
|
+
declare const SheetType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
16
|
+
name: S.optional<typeof S.String>;
|
|
17
|
+
cells: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
18
|
+
value: typeof S.Any;
|
|
19
|
+
}>>>>;
|
|
20
|
+
rows: S.mutable<S.Array$<typeof S.String>>;
|
|
21
|
+
columns: S.mutable<S.Array$<typeof S.String>>;
|
|
22
|
+
rowMeta: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
23
|
+
size: S.optional<typeof S.Number>;
|
|
24
|
+
}>>>>;
|
|
25
|
+
columnMeta: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
26
|
+
size: S.optional<typeof S.Number>;
|
|
27
|
+
}>>>>;
|
|
28
|
+
ranges: S.mutable<S.Array$<S.Struct<{
|
|
29
|
+
range: typeof S.String;
|
|
30
|
+
key: typeof S.String;
|
|
31
|
+
value: typeof S.String;
|
|
32
|
+
}>>>;
|
|
33
|
+
threads: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
34
|
+
name: S.optional<typeof S.String>;
|
|
35
|
+
anchor: S.optional<typeof S.String>;
|
|
36
|
+
status: S.optional<S.Union<[S.Literal<["staged"]>, S.Literal<["active"]>, S.Literal<["resolved"]>]>>;
|
|
37
|
+
messages: S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
38
|
+
timestamp: typeof S.String;
|
|
39
|
+
state: S.optional<S.Enums<typeof import("@dxos/plugin-space/types").MessageState>>;
|
|
40
|
+
sender: S.mutable<S.Struct<{
|
|
41
|
+
contact: S.optional<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
42
|
+
name: S.optional<typeof S.String>;
|
|
43
|
+
identifiers: S.mutable<S.Array$<S.Struct<{
|
|
44
|
+
type: typeof S.String;
|
|
45
|
+
value: typeof S.String;
|
|
46
|
+
}>>>;
|
|
47
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
48
|
+
identityKey: S.optional<typeof S.String>;
|
|
49
|
+
email: S.optional<typeof S.String>;
|
|
50
|
+
name: S.optional<typeof S.String>;
|
|
51
|
+
}>>;
|
|
52
|
+
text: typeof S.String;
|
|
53
|
+
parts: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>>>;
|
|
54
|
+
properties: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
55
|
+
context: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>;
|
|
56
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
57
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>>;
|
|
58
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
59
|
+
name: S.optional<typeof S.String>;
|
|
60
|
+
cells: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
61
|
+
value: typeof S.Any;
|
|
62
|
+
}>>>>;
|
|
63
|
+
rows: S.mutable<S.Array$<typeof S.String>>;
|
|
64
|
+
columns: S.mutable<S.Array$<typeof S.String>>;
|
|
65
|
+
rowMeta: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
66
|
+
size: S.optional<typeof S.Number>;
|
|
67
|
+
}>>>>;
|
|
68
|
+
columnMeta: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
69
|
+
size: S.optional<typeof S.Number>;
|
|
70
|
+
}>>>>;
|
|
71
|
+
ranges: S.mutable<S.Array$<S.Struct<{
|
|
72
|
+
range: typeof S.String;
|
|
73
|
+
key: typeof S.String;
|
|
74
|
+
value: typeof S.String;
|
|
75
|
+
}>>>;
|
|
76
|
+
threads: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
77
|
+
name: S.optional<typeof S.String>;
|
|
78
|
+
anchor: S.optional<typeof S.String>;
|
|
79
|
+
status: S.optional<S.Union<[S.Literal<["staged"]>, S.Literal<["active"]>, S.Literal<["resolved"]>]>>;
|
|
80
|
+
messages: S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
81
|
+
timestamp: typeof S.String;
|
|
82
|
+
state: S.optional<S.Enums<typeof import("@dxos/plugin-space/types").MessageState>>;
|
|
83
|
+
sender: S.mutable<S.Struct<{
|
|
84
|
+
contact: S.optional<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
85
|
+
name: S.optional<typeof S.String>;
|
|
86
|
+
identifiers: S.mutable<S.Array$<S.Struct<{
|
|
87
|
+
type: typeof S.String;
|
|
88
|
+
value: typeof S.String;
|
|
89
|
+
}>>>;
|
|
90
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
91
|
+
identityKey: S.optional<typeof S.String>;
|
|
92
|
+
email: S.optional<typeof S.String>;
|
|
93
|
+
name: S.optional<typeof S.String>;
|
|
94
|
+
}>>;
|
|
95
|
+
text: typeof S.String;
|
|
96
|
+
parts: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>>>;
|
|
97
|
+
properties: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
98
|
+
context: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>;
|
|
99
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
100
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>>;
|
|
101
|
+
}>>;
|
|
102
|
+
export declare class SheetType extends SheetType_base {
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAGxD,eAAO,MAAM,SAAS;;EAKpB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAGxD,eAAO,MAAM,KAAK;;;;EAIhB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAGhD,eAAO,MAAM,aAAa;;EAExB,CAAC;;;;;;;;;;;;;;;;;;;;cA4Bi/F,EAAG,QAAQ,QAAO,EAAG,MAAM;gBAAqD,EAAG,QAAQ,QAAO,EAAG,MAAM;gBAAc,EAAG,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,cAAa,EAAG,OAAO,cAAa,EAAG,OAAO;kBAAgC,EAAG,OAAO,CAAC,EAAE,MAAM,QAAQ,mBAAmB,cAAc,6D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
import type { IntentResolverProvides, MetadataRecordsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
|
|
2
|
+
import { S } from '@dxos/echo-schema';
|
|
3
|
+
import { type MarkdownExtensionProvides } from '@dxos/plugin-markdown';
|
|
4
|
+
import { type SchemaProvides } from '@dxos/plugin-space';
|
|
5
|
+
import { type CellValue, SheetType } from './schema';
|
|
6
|
+
import { SheetModel } from '../model';
|
|
7
|
+
type ThreadProvides<T> = {
|
|
8
|
+
thread: {
|
|
9
|
+
predicate: (obj: any) => obj is T;
|
|
10
|
+
createSort: (obj: T) => (anchorA: string | undefined, anchorB: string | undefined) => number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type SheetPluginProvides = SurfaceProvides & IntentResolverProvides & MarkdownExtensionProvides & MetadataRecordsProvides & TranslationsProvides & SchemaProvides & ThreadProvides<SheetType>;
|
|
14
|
+
export type SheetSize = {
|
|
15
|
+
rows: number;
|
|
16
|
+
columns: number;
|
|
17
|
+
};
|
|
18
|
+
export type CreateSheetOptions = {
|
|
19
|
+
name?: string;
|
|
20
|
+
cells?: Record<string, CellValue>;
|
|
21
|
+
} & Partial<SheetSize>;
|
|
22
|
+
export declare namespace SheetAction {
|
|
23
|
+
const Create_base: S.TaggedClass<Create, "dxos.org/plugin/sheet/action/create", {
|
|
24
|
+
readonly _tag: S.tag<"dxos.org/plugin/sheet/action/create">;
|
|
25
|
+
} & {
|
|
26
|
+
input: S.Struct<{
|
|
27
|
+
name: S.optional<typeof S.String>;
|
|
28
|
+
}>;
|
|
29
|
+
output: S.Struct<{
|
|
30
|
+
object: typeof SheetType;
|
|
31
|
+
}>;
|
|
32
|
+
}>;
|
|
33
|
+
export class Create extends Create_base {
|
|
34
|
+
}
|
|
35
|
+
const InsertAxis_base: S.TaggedClass<InsertAxis, "dxos.org/plugin/sheet/action/axis-insert", {
|
|
36
|
+
readonly _tag: S.tag<"dxos.org/plugin/sheet/action/axis-insert">;
|
|
37
|
+
} & {
|
|
38
|
+
input: S.Struct<{
|
|
39
|
+
model: S.Schema<SheetModel>;
|
|
40
|
+
axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
|
|
41
|
+
index: typeof S.Number;
|
|
42
|
+
count: S.optional<typeof S.Number>;
|
|
43
|
+
}>;
|
|
44
|
+
output: typeof S.Void;
|
|
45
|
+
}>;
|
|
46
|
+
export class InsertAxis extends InsertAxis_base {
|
|
47
|
+
}
|
|
48
|
+
export const RestoreAxis: S.Struct<{
|
|
49
|
+
axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
|
|
50
|
+
axisIndex: typeof S.String;
|
|
51
|
+
index: typeof S.Number;
|
|
52
|
+
axisMeta: S.Struct<{
|
|
53
|
+
size: S.optional<typeof S.Number>;
|
|
54
|
+
}>;
|
|
55
|
+
values: S.Array$<typeof S.Any>;
|
|
56
|
+
}>;
|
|
57
|
+
export type RestoreAxis = S.Schema.Type<typeof RestoreAxis>;
|
|
58
|
+
const DropAxis_base: S.TaggedClass<DropAxis, "dxos.org/plugin/sheet/action/axis-drop", {
|
|
59
|
+
readonly _tag: S.tag<"dxos.org/plugin/sheet/action/axis-drop">;
|
|
60
|
+
} & {
|
|
61
|
+
input: S.Struct<{
|
|
62
|
+
model: S.Schema<SheetModel>;
|
|
63
|
+
axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
|
|
64
|
+
axisIndex: typeof S.String;
|
|
65
|
+
deletionData: S.optional<S.Struct<{
|
|
66
|
+
axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
|
|
67
|
+
axisIndex: typeof S.String;
|
|
68
|
+
index: typeof S.Number;
|
|
69
|
+
axisMeta: S.Struct<{
|
|
70
|
+
size: S.optional<typeof S.Number>;
|
|
71
|
+
}>;
|
|
72
|
+
values: S.Array$<typeof S.Any>;
|
|
73
|
+
}>>;
|
|
74
|
+
}>;
|
|
75
|
+
output: typeof S.Void;
|
|
76
|
+
}>;
|
|
77
|
+
export class DropAxis extends DropAxis_base {
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,KAAK,SAAS,EAAiB,SAAS,EAAE,MAAM,UAAU,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,KAAK,cAAc,CAAC,CAAC,IAAI;IACvB,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC;QAClC,UAAU,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,CAAC;KAC9F,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAC/C,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,oBAAoB,GACpB,cAAc,GACd,cAAc,CAAC,SAAS,CAAC,CAAC;AAE5B,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEvB,yBAAiB,WAAW,CAAC;;;;;;;;;;;IAG3B,MAAM,OAAO,MAAO,SAAQ,WAO1B;KAAG;;;;;mBAQsE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;;;;;;;IAH/F,MAAM,OAAO,UAAW,SAAQ,eAS9B;KAAG;IAEL,MAAM,CAAC,MAAM,WAAW;;;;;;;;MAMtB,CAAC;IAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;;;;;mBAKe,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;IAH/F,MAAM,OAAO,QAAS,SAAQ,aAS5B;KAAG;;CACN"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { type CellAddress, type CellRange, type CompleteCellRange } from '
|
|
1
|
+
import { type CellAddress, type CellRange, type CompleteCellRange } from '@dxos/compute';
|
|
2
2
|
import { type CreateSheetOptions, type SheetSize, SheetType } from '../types';
|
|
3
|
+
export declare const MAX_ROWS = 500;
|
|
4
|
+
export declare const MAX_COLS = 676;
|
|
5
|
+
export declare const DEFAULT_ROWS = 50;
|
|
6
|
+
export declare const DEFAULT_COLS = 26;
|
|
3
7
|
export declare class ApiError extends Error {
|
|
4
8
|
}
|
|
5
9
|
export declare class ReadonlyException extends ApiError {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/types/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9E,eAAO,MAAM,QAAQ,MAAM,CAA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
|
+
{"version":"5.7.2"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5-main.937ce75",
|
|
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
9
|
"sideEffects": true,
|
|
10
|
-
"imports": {
|
|
11
|
-
"#hyperformula": {
|
|
12
|
-
"types": "hyperformula",
|
|
13
|
-
"default": "./dist/vendor/hyperformula.mjs"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
10
|
"exports": {
|
|
17
11
|
".": {
|
|
18
12
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -25,9 +19,9 @@
|
|
|
25
19
|
"node": "./dist/lib/node-esm/meta.mjs"
|
|
26
20
|
},
|
|
27
21
|
"./types": {
|
|
28
|
-
"types": "./dist/types/src/types.d.ts",
|
|
29
|
-
"browser": "./dist/lib/browser/types.mjs",
|
|
30
|
-
"node": "./dist/lib/node-esm/types.mjs"
|
|
22
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
23
|
+
"browser": "./dist/lib/browser/types/index.mjs",
|
|
24
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
31
25
|
}
|
|
32
26
|
},
|
|
33
27
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -64,39 +58,41 @@
|
|
|
64
58
|
"@tanstack/react-virtual": "^3.9.0",
|
|
65
59
|
"codemirror-lang-spreadsheet": "^1.3.0",
|
|
66
60
|
"date-fns": "^3.3.1",
|
|
67
|
-
"hyperformula": "^2.7.1",
|
|
68
61
|
"lodash.defaultsdeep": "^4.6.1",
|
|
69
62
|
"re-resizable": "^6.9.17",
|
|
70
63
|
"react-markdown": "^8.0.5",
|
|
71
64
|
"react-resize-detector": "^11.0.1",
|
|
72
|
-
"@dxos/app-framework": "0.7.
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/echo-schema": "0.7.
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/plugin-client": "0.7.
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/plugin-
|
|
87
|
-
"@dxos/plugin-
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/plugin-stack": "0.7.
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/react-client": "0.7.
|
|
93
|
-
"@dxos/react-
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/react-ui-
|
|
96
|
-
"@dxos/react-ui-
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/react-ui-
|
|
65
|
+
"@dxos/app-framework": "0.7.5-main.937ce75",
|
|
66
|
+
"@dxos/async": "0.7.5-main.937ce75",
|
|
67
|
+
"@dxos/client": "0.7.5-main.937ce75",
|
|
68
|
+
"@dxos/compute": "0.7.5-main.937ce75",
|
|
69
|
+
"@dxos/context": "0.7.5-main.937ce75",
|
|
70
|
+
"@dxos/crypto": "0.7.5-main.937ce75",
|
|
71
|
+
"@dxos/debug": "0.7.5-main.937ce75",
|
|
72
|
+
"@dxos/echo-schema": "0.7.5-main.937ce75",
|
|
73
|
+
"@dxos/functions": "0.7.5-main.937ce75",
|
|
74
|
+
"@dxos/invariant": "0.7.5-main.937ce75",
|
|
75
|
+
"@dxos/keys": "0.7.5-main.937ce75",
|
|
76
|
+
"@dxos/live-object": "0.7.5-main.937ce75",
|
|
77
|
+
"@dxos/plugin-client": "0.7.5-main.937ce75",
|
|
78
|
+
"@dxos/plugin-attention": "0.7.5-main.937ce75",
|
|
79
|
+
"@dxos/plugin-graph": "0.7.5-main.937ce75",
|
|
80
|
+
"@dxos/plugin-markdown": "0.7.5-main.937ce75",
|
|
81
|
+
"@dxos/log": "0.7.5-main.937ce75",
|
|
82
|
+
"@dxos/plugin-space": "0.7.5-main.937ce75",
|
|
83
|
+
"@dxos/plugin-stack": "0.7.5-main.937ce75",
|
|
84
|
+
"@dxos/plugin-thread": "0.7.5-main.937ce75",
|
|
85
|
+
"@dxos/react-client": "0.7.5-main.937ce75",
|
|
86
|
+
"@dxos/react-hooks": "0.7.5-main.937ce75",
|
|
87
|
+
"@dxos/plugin-script": "0.7.5-main.937ce75",
|
|
88
|
+
"@dxos/react-ui-attention": "0.7.5-main.937ce75",
|
|
89
|
+
"@dxos/react-ui-editor": "0.7.5-main.937ce75",
|
|
90
|
+
"@dxos/react-ui-form": "0.7.5-main.937ce75",
|
|
91
|
+
"@dxos/react-ui-grid": "0.7.5-main.937ce75",
|
|
92
|
+
"@dxos/react-ui-list": "0.7.5-main.937ce75",
|
|
93
|
+
"@dxos/react-ui-stack": "0.7.5-main.937ce75",
|
|
94
|
+
"@dxos/util": "0.7.5-main.937ce75",
|
|
95
|
+
"@dxos/schema": "0.7.5-main.937ce75"
|
|
100
96
|
},
|
|
101
97
|
"devDependencies": {
|
|
102
98
|
"@lezer/generator": "^1.7.1",
|
|
@@ -108,26 +104,23 @@
|
|
|
108
104
|
"react": "~18.2.0",
|
|
109
105
|
"react-dom": "~18.2.0",
|
|
110
106
|
"vite": "5.4.7",
|
|
111
|
-
"@dxos/echo-generator": "0.7.
|
|
112
|
-
"@dxos/lit-grid": "0.7.
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/react-ui-syntax-highlighter": "0.7.
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/react-ui
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/
|
|
119
|
-
"@dxos/test-utils": "0.7.
|
|
107
|
+
"@dxos/echo-generator": "0.7.5-main.937ce75",
|
|
108
|
+
"@dxos/lit-grid": "0.7.5-main.937ce75",
|
|
109
|
+
"@dxos/random": "0.7.5-main.937ce75",
|
|
110
|
+
"@dxos/react-ui-syntax-highlighter": "0.7.5-main.937ce75",
|
|
111
|
+
"@dxos/react-ui-theme": "0.7.5-main.937ce75",
|
|
112
|
+
"@dxos/react-ui": "0.7.5-main.937ce75",
|
|
113
|
+
"@dxos/react-ui-types": "0.7.5-main.937ce75",
|
|
114
|
+
"@dxos/storybook-utils": "0.7.5-main.937ce75",
|
|
115
|
+
"@dxos/test-utils": "0.7.5-main.937ce75"
|
|
120
116
|
},
|
|
121
117
|
"peerDependencies": {
|
|
122
118
|
"react": "~18.2.0",
|
|
123
119
|
"react-dom": "~18.2.0",
|
|
124
|
-
"@dxos/react-ui": "0.7.
|
|
125
|
-
"@dxos/react-ui-theme": "0.7.
|
|
120
|
+
"@dxos/react-ui": "0.7.5-main.937ce75",
|
|
121
|
+
"@dxos/react-ui-theme": "0.7.5-main.937ce75"
|
|
126
122
|
},
|
|
127
123
|
"publishConfig": {
|
|
128
124
|
"access": "public"
|
|
129
|
-
},
|
|
130
|
-
"scripts": {
|
|
131
|
-
"gen": "lezer-generator ./src/components/CellEditor/parser/formula.grammar --typeScript -o ./src/components/CellEditor/parser/formula.ts"
|
|
132
125
|
}
|
|
133
126
|
}
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -4,30 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { createIntent, createResolver, createSurface, resolvePlugin, type PluginDefinition } from '@dxos/app-framework';
|
|
8
|
+
import { type ComputeGraphRegistry } from '@dxos/compute';
|
|
9
|
+
import { FunctionType } from '@dxos/functions';
|
|
8
10
|
import { invariant } from '@dxos/invariant';
|
|
9
|
-
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
10
|
-
import {
|
|
11
|
-
import { FunctionType } from '@dxos/plugin-script/types';
|
|
12
|
-
import { SpaceAction } from '@dxos/plugin-space';
|
|
13
|
-
import { getSpace, isEchoObject } from '@dxos/react-client/echo';
|
|
14
|
-
import { Icon } from '@dxos/react-ui';
|
|
11
|
+
import { parseClientPlugin } from '@dxos/plugin-client/types';
|
|
12
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
15
13
|
|
|
16
14
|
import { ComputeGraphContextProvider, SheetContainer, SheetObjectSettings } from './components';
|
|
17
|
-
import { type ComputeGraphRegistry } from './compute-graph';
|
|
18
|
-
import { compareIndexPositions, createSheet } from './defs';
|
|
19
15
|
import { computeGraphFacet } from './extensions';
|
|
20
16
|
import meta, { SHEET_PLUGIN } from './meta';
|
|
21
17
|
import { serializer } from './serializer';
|
|
22
18
|
import translations from './translations';
|
|
23
|
-
import { SheetAction, SheetType, type SheetPluginProvides } from './types';
|
|
19
|
+
import { compareIndexPositions, createSheet, SheetAction, SheetType, type SheetPluginProvides } from './types';
|
|
24
20
|
|
|
25
21
|
export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
26
22
|
let computeGraphRegistry: ComputeGraphRegistry | undefined;
|
|
27
23
|
|
|
28
24
|
return {
|
|
29
25
|
meta,
|
|
30
|
-
ready: async (plugins) => {
|
|
26
|
+
ready: async ({ plugins }) => {
|
|
31
27
|
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
32
28
|
invariant(client);
|
|
33
29
|
let remoteFunctionUrl: string | undefined;
|
|
@@ -38,7 +34,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
// Async import removes direct dependency on hyperformula.
|
|
41
|
-
const { defaultPlugins, ComputeGraphRegistry } = await import('
|
|
37
|
+
const { defaultPlugins, ComputeGraphRegistry } = await import('@dxos/compute');
|
|
42
38
|
computeGraphRegistry = new ComputeGraphRegistry({ plugins: defaultPlugins, remoteFunctionUrl });
|
|
43
39
|
},
|
|
44
40
|
provides: {
|
|
@@ -49,7 +45,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
49
45
|
metadata: {
|
|
50
46
|
records: {
|
|
51
47
|
[SheetType.typename]: {
|
|
52
|
-
createObject: SheetAction.
|
|
48
|
+
createObject: (props: { name?: string }) => createIntent(SheetAction.Create, props),
|
|
53
49
|
label: (object: any) => (object instanceof SheetType ? object.name : undefined),
|
|
54
50
|
placeholder: ['sheet title placeholder', { ns: SHEET_PLUGIN }],
|
|
55
51
|
icon: 'ph--grid-nine--regular',
|
|
@@ -64,48 +60,6 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
64
60
|
// FunctionType is currently registered here in case script plugin isn't enabled.
|
|
65
61
|
system: [FunctionType],
|
|
66
62
|
},
|
|
67
|
-
graph: {
|
|
68
|
-
builder: (plugins) => {
|
|
69
|
-
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
70
|
-
const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;
|
|
71
|
-
if (!client || !dispatch) {
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return createExtension({
|
|
76
|
-
id: SheetAction.CREATE,
|
|
77
|
-
filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),
|
|
78
|
-
actions: ({ node }) => {
|
|
79
|
-
const id = node.id.split('/').at(-1);
|
|
80
|
-
const [spaceId, objectId] = id?.split(':') ?? [];
|
|
81
|
-
const space = client.spaces.get().find((space) => space.id === spaceId);
|
|
82
|
-
const object = objectId && space?.db.getObjectById(objectId);
|
|
83
|
-
const target = objectId ? object : space;
|
|
84
|
-
if (!target) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return [
|
|
89
|
-
{
|
|
90
|
-
id: `${SHEET_PLUGIN}/create/${node.id}`,
|
|
91
|
-
data: async () => {
|
|
92
|
-
await dispatch([
|
|
93
|
-
{ plugin: SHEET_PLUGIN, action: SheetAction.CREATE, data: { space } },
|
|
94
|
-
{ action: SpaceAction.ADD_OBJECT, data: { target } },
|
|
95
|
-
{ action: NavigationAction.OPEN },
|
|
96
|
-
]);
|
|
97
|
-
},
|
|
98
|
-
properties: {
|
|
99
|
-
label: ['create sheet label', { ns: SHEET_PLUGIN }],
|
|
100
|
-
icon: 'ph--grid-nine--regular',
|
|
101
|
-
testId: 'sheetPlugin.createObject',
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
];
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
63
|
markdown: {
|
|
110
64
|
extensions: ({ document: doc }) => {
|
|
111
65
|
invariant(computeGraphRegistry);
|
|
@@ -116,75 +70,50 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
|
|
|
116
70
|
}
|
|
117
71
|
},
|
|
118
72
|
},
|
|
119
|
-
stack: {
|
|
120
|
-
creators: [
|
|
121
|
-
{
|
|
122
|
-
id: 'create-stack-section-sheet',
|
|
123
|
-
testId: 'sheetPlugin.createSection',
|
|
124
|
-
type: ['plugin name', { ns: SHEET_PLUGIN }],
|
|
125
|
-
label: ['create sheet section label', { ns: SHEET_PLUGIN }],
|
|
126
|
-
// TODO(thure): Refactor to use strings
|
|
127
|
-
icon: (props: any) => <Icon icon='ph--grid-nine--regular' {...props} />,
|
|
128
|
-
intent: {
|
|
129
|
-
plugin: SHEET_PLUGIN,
|
|
130
|
-
action: SheetAction.CREATE,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
73
|
thread: {
|
|
136
74
|
predicate: (data) => data instanceof SheetType,
|
|
137
75
|
createSort: (sheet) => (indexA, indexB) =>
|
|
138
76
|
!indexA || !indexB ? 0 : compareIndexPositions(sheet, indexA, indexB),
|
|
139
77
|
},
|
|
140
78
|
surface: {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
79
|
+
definitions: () => [
|
|
80
|
+
createSurface({
|
|
81
|
+
id: `${SHEET_PLUGIN}/sheet`,
|
|
82
|
+
role: ['article', 'section'],
|
|
83
|
+
filter: (data): data is { subject: SheetType } =>
|
|
84
|
+
data.subject instanceof SheetType && !!getSpace(data.subject),
|
|
85
|
+
component: ({ data, role }) => (
|
|
86
|
+
<SheetContainer space={getSpace(data.subject)!} sheet={data.subject} role={role} />
|
|
87
|
+
),
|
|
88
|
+
}),
|
|
89
|
+
createSurface({
|
|
90
|
+
id: `${SHEET_PLUGIN}/settings`,
|
|
91
|
+
role: 'complementary--settings',
|
|
92
|
+
filter: (data): data is { subject: SheetType } => data.subject instanceof SheetType,
|
|
93
|
+
component: ({ data }) => <SheetObjectSettings sheet={data.subject} />,
|
|
94
|
+
}),
|
|
95
|
+
],
|
|
159
96
|
},
|
|
160
97
|
intent: {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
message: (translations[0]['en-US'][SHEET_PLUGIN] as any)[`${axis} dropped label`],
|
|
178
|
-
data: { ...undoData, model },
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
} else {
|
|
182
|
-
const { model, ...undoData } = intent.data as SheetAction.DropAxisRestore;
|
|
183
|
-
model[undoData.axis === 'col' ? 'restoreColumn' : 'restoreRow'](undoData);
|
|
184
|
-
}
|
|
98
|
+
resolvers: () => [
|
|
99
|
+
createResolver(SheetAction.Create, ({ name }) => ({ data: { object: createSheet({ name }) } })),
|
|
100
|
+
createResolver(SheetAction.InsertAxis, ({ model, axis, index, count }) => {
|
|
101
|
+
const _indices = model[axis === 'col' ? 'insertColumns' : 'insertRows'](index, count);
|
|
102
|
+
}),
|
|
103
|
+
createResolver(SheetAction.DropAxis, ({ model, axis, axisIndex, deletionData }, undo) => {
|
|
104
|
+
if (!undo) {
|
|
105
|
+
const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
106
|
+
return {
|
|
107
|
+
undoable: {
|
|
108
|
+
message: (translations[0]['en-US'][SHEET_PLUGIN] as any)[`${axis} dropped label`],
|
|
109
|
+
data: { ...undoData, model },
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
} else if (undo && deletionData) {
|
|
113
|
+
model[deletionData.axis === 'col' ? 'restoreColumn' : 'restoreRow'](deletionData);
|
|
185
114
|
}
|
|
186
|
-
}
|
|
187
|
-
|
|
115
|
+
}),
|
|
116
|
+
],
|
|
188
117
|
},
|
|
189
118
|
},
|
|
190
119
|
};
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { createContext, type PropsWithChildren, useContext } from 'react';
|
|
6
6
|
|
|
7
|
+
import { type ComputeGraph, type ComputeGraphRegistry } from '@dxos/compute';
|
|
7
8
|
import { raise } from '@dxos/debug';
|
|
8
9
|
import { type Space } from '@dxos/react-client/echo';
|
|
9
10
|
import { useAsyncState } from '@dxos/react-hooks';
|
|
10
11
|
|
|
11
|
-
import { type ComputeGraph, type ComputeGraphRegistry } from '../../compute-graph';
|
|
12
|
-
|
|
13
12
|
export type ComputeGraphContextType = {
|
|
14
13
|
registry: ComputeGraphRegistry;
|
|
15
14
|
};
|