@dxos/plugin-sheet 0.8.3-main.672df60 → 0.8.3-staging.0fa589b
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-N5RBUMWO.mjs → SheetContainer-BDZXBB5U.mjs} +3 -3
- package/dist/lib/browser/{anchor-sort-CUTFYIT4.mjs → anchor-sort-NYYZLRAA.mjs} +4 -4
- package/dist/lib/browser/anchor-sort-NYYZLRAA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PQXY4IK7.mjs → chunk-5TA43LO4.mjs} +9 -10
- package/dist/lib/browser/chunk-5TA43LO4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5FLX3UGU.mjs → chunk-I7FZ4TWJ.mjs} +29 -29
- package/dist/lib/browser/chunk-I7FZ4TWJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +14 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-UI4DHURQ.mjs → intent-resolver-IBBI6B74.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-RDKCGE6K.mjs → react-surface-UI46P43F.mjs} +6 -6
- package/dist/lib/browser/react-surface-UI46P43F.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{SheetContainer-TPB2ZBQF.cjs → SheetContainer-VWPM3HYJ.cjs} +31 -31
- package/dist/lib/node/{anchor-sort-LTLYUTUP.cjs → anchor-sort-A7NABMJM.cjs} +11 -11
- package/dist/lib/node/anchor-sort-A7NABMJM.cjs.map +7 -0
- package/dist/lib/node/{chunk-76NESQLB.cjs → chunk-N7FSEUIN.cjs} +44 -44
- package/dist/lib/node/chunk-N7FSEUIN.cjs.map +7 -0
- package/dist/lib/node/{chunk-GBCCPMOO.cjs → chunk-ST3WA73J.cjs} +19 -20
- package/dist/lib/node/chunk-ST3WA73J.cjs.map +7 -0
- package/dist/lib/node/index.cjs +18 -12
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-EVLGL7VZ.cjs → intent-resolver-2657YDOU.cjs} +9 -9
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-HFKXE4IS.cjs → react-surface-XQEIRKWU.cjs} +14 -14
- package/dist/lib/node/react-surface-XQEIRKWU.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +29 -29
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{SheetContainer-F5POTD67.mjs → SheetContainer-V632Q4HA.mjs} +3 -3
- package/dist/lib/node-esm/{anchor-sort-3E2VGLO6.mjs → anchor-sort-JTNZOE67.mjs} +4 -4
- package/dist/lib/node-esm/anchor-sort-JTNZOE67.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DIF3IOAB.mjs → chunk-C4IKYVTV.mjs} +29 -29
- package/dist/lib/node-esm/chunk-C4IKYVTV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-THXJQL4R.mjs → chunk-SOC52B67.mjs} +9 -10
- package/dist/lib/node-esm/chunk-SOC52B67.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +14 -8
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-TPOH5JM5.mjs → intent-resolver-M2HNR7PJ.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-2FV5HNNF.mjs → react-surface-OLXO2MVB.mjs} +6 -6
- package/dist/lib/node-esm/react-surface-OLXO2MVB.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
- package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/serializer.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +63 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +3 -21
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +20 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +47 -47
- package/src/SheetPlugin.tsx +1 -1
- package/src/capabilities/anchor-sort.ts +2 -2
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/components/ComputeGraph/compute-graph.stories.tsx +3 -2
- package/src/components/GridSheet/GridSheet.tsx +1 -1
- package/src/components/GridSheet/SheetCellEditor.stories.tsx +2 -2
- package/src/components/RangeList/RangeList.tsx +25 -19
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +1 -2
- package/src/integrations/thread-ranges.ts +2 -3
- package/src/model/sheet-model.ts +7 -4
- package/src/sanity.test.ts +5 -5
- package/src/serializer.ts +3 -2
- package/src/translations.ts +7 -1
- package/src/types/schema.ts +9 -3
- package/src/types/util.ts +2 -2
- package/dist/lib/browser/anchor-sort-CUTFYIT4.mjs.map +0 -7
- package/dist/lib/browser/chunk-5FLX3UGU.mjs.map +0 -7
- package/dist/lib/browser/chunk-PQXY4IK7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-RDKCGE6K.mjs.map +0 -7
- package/dist/lib/node/anchor-sort-LTLYUTUP.cjs.map +0 -7
- package/dist/lib/node/chunk-76NESQLB.cjs.map +0 -7
- package/dist/lib/node/chunk-GBCCPMOO.cjs.map +0 -7
- package/dist/lib/node/react-surface-HFKXE4IS.cjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-3E2VGLO6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DIF3IOAB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-THXJQL4R.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-2FV5HNNF.mjs.map +0 -7
- /package/dist/lib/browser/{SheetContainer-N5RBUMWO.mjs.map → SheetContainer-BDZXBB5U.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-UI4DHURQ.mjs.map → intent-resolver-IBBI6B74.mjs.map} +0 -0
- /package/dist/lib/node/{SheetContainer-TPB2ZBQF.cjs.map → SheetContainer-VWPM3HYJ.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-EVLGL7VZ.cjs.map → intent-resolver-2657YDOU.cjs.map} +0 -0
- /package/dist/lib/node-esm/{SheetContainer-F5POTD67.mjs.map → SheetContainer-V632Q4HA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-TPOH5JM5.mjs.map → intent-resolver-M2HNR7PJ.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet-model.d.ts","sourceRoot":"","sources":["../../../../src/model/sheet-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,YAAY,EAEjB,KAAK,gBAAgB,EAKrB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet-model.d.ts","sourceRoot":"","sources":["../../../../src/model/sheet-model.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../../src/serializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../../src/serializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,UAAU,EAAE,qBAAqB,CAAC,SAAS,CAgBvD,CAAC"}
|
|
@@ -1,9 +1,69 @@
|
|
|
1
|
-
import { SheetType } from './types';
|
|
2
1
|
declare const _default: readonly [{
|
|
3
2
|
readonly 'en-US': {
|
|
4
|
-
readonly [
|
|
3
|
+
readonly [x: string]: {
|
|
5
4
|
readonly 'typename label': "Sheet";
|
|
5
|
+
readonly 'typename label_zero': "Sheets";
|
|
6
|
+
readonly 'typename label_one': "Sheet";
|
|
7
|
+
readonly 'typename label_other': "Sheets";
|
|
6
8
|
readonly 'object name placeholder': "New sheet";
|
|
9
|
+
readonly 'plugin name'?: undefined;
|
|
10
|
+
readonly 'cell placeholder'?: undefined;
|
|
11
|
+
readonly 'range key alignment label'?: undefined;
|
|
12
|
+
readonly 'range key style label'?: undefined;
|
|
13
|
+
readonly 'range value start label'?: undefined;
|
|
14
|
+
readonly 'range value center label'?: undefined;
|
|
15
|
+
readonly 'range value end label'?: undefined;
|
|
16
|
+
readonly 'range value softwrap label'?: undefined;
|
|
17
|
+
readonly 'range value highlight label'?: undefined;
|
|
18
|
+
readonly 'toolbar action label'?: undefined;
|
|
19
|
+
readonly 'selection overlaps existing comment label'?: undefined;
|
|
20
|
+
readonly 'comment label'?: undefined;
|
|
21
|
+
readonly 'comment ranges not supported label'?: undefined;
|
|
22
|
+
readonly 'no cursor label'?: undefined;
|
|
23
|
+
readonly 'open comment for sheet cell'?: undefined;
|
|
24
|
+
readonly 'add col before label'?: undefined;
|
|
25
|
+
readonly 'add col after label'?: undefined;
|
|
26
|
+
readonly 'delete col label'?: undefined;
|
|
27
|
+
readonly 'add row before label'?: undefined;
|
|
28
|
+
readonly 'add row after label'?: undefined;
|
|
29
|
+
readonly 'delete row label'?: undefined;
|
|
30
|
+
readonly 'range list heading'?: undefined;
|
|
31
|
+
readonly 'no ranges message'?: undefined;
|
|
32
|
+
readonly 'range title'?: undefined;
|
|
33
|
+
readonly 'col dropped label'?: undefined;
|
|
34
|
+
readonly 'row dropped label'?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
readonly 'plugin name': "Sheets";
|
|
37
|
+
readonly 'cell placeholder': "Cell value...";
|
|
38
|
+
readonly 'range key alignment label': "Align";
|
|
39
|
+
readonly 'range key style label': "Style";
|
|
40
|
+
readonly 'range value start label': "Align left";
|
|
41
|
+
readonly 'range value center label': "Align center";
|
|
42
|
+
readonly 'range value end label': "Align right";
|
|
43
|
+
readonly 'range value softwrap label': "Wrap text";
|
|
44
|
+
readonly 'range value highlight label': "Highlight";
|
|
45
|
+
readonly 'toolbar action label': "{{value}}";
|
|
46
|
+
readonly 'selection overlaps existing comment label': "Selected cell already has a comment";
|
|
47
|
+
readonly 'comment label': "Add comment";
|
|
48
|
+
readonly 'comment ranges not supported label': "Commenting on ranges is not yet supported";
|
|
49
|
+
readonly 'no cursor label': "Select a cell to comment";
|
|
50
|
+
readonly 'open comment for sheet cell': "View comments for cell";
|
|
51
|
+
readonly 'add col before label': "Add column before";
|
|
52
|
+
readonly 'add col after label': "Add column after";
|
|
53
|
+
readonly 'delete col label': "Delete column";
|
|
54
|
+
readonly 'add row before label': "Add row before";
|
|
55
|
+
readonly 'add row after label': "Add row after";
|
|
56
|
+
readonly 'delete row label': "Delete row";
|
|
57
|
+
readonly 'range list heading': "Ranges";
|
|
58
|
+
readonly 'no ranges message': "No ranges";
|
|
59
|
+
readonly 'range title': "{{position}} — {{value}}";
|
|
60
|
+
readonly 'col dropped label': "Deleted a column";
|
|
61
|
+
readonly 'row dropped label': "Deleted a row";
|
|
62
|
+
readonly 'typename label'?: undefined;
|
|
63
|
+
readonly 'typename label_zero'?: undefined;
|
|
64
|
+
readonly 'typename label_one'?: undefined;
|
|
65
|
+
readonly 'typename label_other'?: undefined;
|
|
66
|
+
readonly 'object name placeholder'?: undefined;
|
|
7
67
|
};
|
|
8
68
|
readonly "dxos.org/plugin/sheet": {
|
|
9
69
|
readonly 'plugin name': "Sheets";
|
|
@@ -28,6 +88,7 @@ declare const _default: readonly [{
|
|
|
28
88
|
readonly 'add row after label': "Add row after";
|
|
29
89
|
readonly 'delete row label': "Delete row";
|
|
30
90
|
readonly 'range list heading': "Ranges";
|
|
91
|
+
readonly 'no ranges message': "No ranges";
|
|
31
92
|
readonly 'range title': "{{position}} — {{value}}";
|
|
32
93
|
readonly 'col dropped label': "Deleted a column";
|
|
33
94
|
readonly 'row dropped label': "Deleted a row";
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,wBAwCW"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
+
import { Type } from '@dxos/echo';
|
|
2
3
|
export declare const CellValue: Schema.Struct<{
|
|
3
4
|
value: typeof Schema.Any;
|
|
4
5
|
}>;
|
|
@@ -12,25 +13,7 @@ export type Range = Schema.Schema.Type<typeof Range>;
|
|
|
12
13
|
export declare const RowColumnMeta: Schema.Struct<{
|
|
13
14
|
size: Schema.optional<typeof Schema.Number>;
|
|
14
15
|
}>;
|
|
15
|
-
declare const
|
|
16
|
-
name: Schema.optional<typeof Schema.String>;
|
|
17
|
-
cells: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
18
|
-
value: typeof Schema.Any;
|
|
19
|
-
}>>>>;
|
|
20
|
-
rows: Schema.mutable<Schema.Array$<typeof Schema.String>>;
|
|
21
|
-
columns: Schema.mutable<Schema.Array$<typeof Schema.String>>;
|
|
22
|
-
rowMeta: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
23
|
-
size: Schema.optional<typeof Schema.Number>;
|
|
24
|
-
}>>>>;
|
|
25
|
-
columnMeta: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
26
|
-
size: Schema.optional<typeof Schema.Number>;
|
|
27
|
-
}>>>>;
|
|
28
|
-
ranges: Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
29
|
-
range: typeof Schema.String;
|
|
30
|
-
key: typeof Schema.String;
|
|
31
|
-
value: typeof Schema.String;
|
|
32
|
-
}>>>;
|
|
33
|
-
}, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
|
|
16
|
+
export declare const SheetType: Type.obj<Schema.Struct<{
|
|
34
17
|
name: Schema.optional<typeof Schema.String>;
|
|
35
18
|
cells: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
36
19
|
value: typeof Schema.Any;
|
|
@@ -49,7 +32,6 @@ declare const SheetType_base: import("@dxos/echo-schema").TypedObjectPrototype<i
|
|
|
49
32
|
value: typeof Schema.String;
|
|
50
33
|
}>>>;
|
|
51
34
|
}>>;
|
|
52
|
-
export
|
|
35
|
+
export interface SheetType extends Schema.Schema.Type<typeof SheetType> {
|
|
53
36
|
}
|
|
54
|
-
export {};
|
|
55
37
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,eAAO,MAAM,SAAS;;EAKpB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAG7D,eAAO,MAAM,KAAK;;;;EAIhB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAGrD,eAAO,MAAM,aAAa;;EAExB,CAAC;AAIH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;GAyBrB,CAAC;AACF,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
-
import { type CellValue
|
|
2
|
+
import { type CellValue } from './schema';
|
|
3
3
|
import { SheetModel } from '../model';
|
|
4
4
|
export type SheetSize = {
|
|
5
5
|
rows: number;
|
|
@@ -17,7 +17,25 @@ export declare namespace SheetAction {
|
|
|
17
17
|
name: Schema.optional<typeof Schema.String>;
|
|
18
18
|
}>;
|
|
19
19
|
output: Schema.Struct<{
|
|
20
|
-
object:
|
|
20
|
+
object: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
21
|
+
name: Schema.optional<typeof Schema.String>;
|
|
22
|
+
cells: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
23
|
+
value: typeof Schema.Any;
|
|
24
|
+
}>>>>;
|
|
25
|
+
rows: Schema.mutable<Schema.Array$<typeof Schema.String>>;
|
|
26
|
+
columns: Schema.mutable<Schema.Array$<typeof Schema.String>>;
|
|
27
|
+
rowMeta: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
28
|
+
size: Schema.optional<typeof Schema.Number>;
|
|
29
|
+
}>>>>;
|
|
30
|
+
columnMeta: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
31
|
+
size: Schema.optional<typeof Schema.Number>;
|
|
32
|
+
}>>>>;
|
|
33
|
+
ranges: Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
34
|
+
range: typeof Schema.String;
|
|
35
|
+
key: typeof Schema.String;
|
|
36
|
+
value: typeof Schema.String;
|
|
37
|
+
}>>>;
|
|
38
|
+
}>>;
|
|
21
39
|
}>;
|
|
22
40
|
}>;
|
|
23
41
|
export class Create extends Create_base {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,SAAS,EAA4B,MAAM,UAAU,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,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;;;;;mBAQgF,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;;;;;;;IAH9G,MAAM,OAAO,UAAW,SAAQ,eAS9B;KAAG;IAEL,MAAM,CAAC,MAAM,WAAW;;;;;;;;MAMtB,CAAC;IAEH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;;;;;mBAKoB,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;IAH9G,MAAM,OAAO,QAAS,SAAQ,aAS5B;KAAG;;CACN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.8.3-
|
|
3
|
+
"version": "0.8.3-staging.0fa589b",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -54,41 +54,41 @@
|
|
|
54
54
|
"re-resizable": "^6.9.17",
|
|
55
55
|
"react-markdown": "^8.0.5",
|
|
56
56
|
"react-resize-detector": "^11.0.1",
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/client": "0.8.3-
|
|
60
|
-
"@dxos/compute": "0.8.3-
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/debug": "0.8.3-
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/echo-schema": "0.8.3-
|
|
66
|
-
"@dxos/functions": "0.8.3-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/live-object": "0.8.3-
|
|
71
|
-
"@dxos/log": "0.8.3-
|
|
72
|
-
"@dxos/plugin-attention": "0.8.3-
|
|
73
|
-
"@dxos/plugin-client": "0.8.3-
|
|
74
|
-
"@dxos/plugin-deck": "0.8.3-
|
|
75
|
-
"@dxos/plugin-
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/plugin-
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/react-hooks": "0.8.3-
|
|
83
|
-
"@dxos/react-ui-
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-
|
|
86
|
-
"@dxos/react-ui-
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/react-ui-
|
|
89
|
-
"@dxos/react-ui-stack": "0.8.3-
|
|
90
|
-
"@dxos/schema": "0.8.3-
|
|
91
|
-
"@dxos/util": "0.8.3-
|
|
57
|
+
"@dxos/async": "0.8.3-staging.0fa589b",
|
|
58
|
+
"@dxos/context": "0.8.3-staging.0fa589b",
|
|
59
|
+
"@dxos/client": "0.8.3-staging.0fa589b",
|
|
60
|
+
"@dxos/compute": "0.8.3-staging.0fa589b",
|
|
61
|
+
"@dxos/crypto": "0.8.3-staging.0fa589b",
|
|
62
|
+
"@dxos/echo": "0.8.3-staging.0fa589b",
|
|
63
|
+
"@dxos/debug": "0.8.3-staging.0fa589b",
|
|
64
|
+
"@dxos/app-framework": "0.8.3-staging.0fa589b",
|
|
65
|
+
"@dxos/echo-schema": "0.8.3-staging.0fa589b",
|
|
66
|
+
"@dxos/functions": "0.8.3-staging.0fa589b",
|
|
67
|
+
"@dxos/invariant": "0.8.3-staging.0fa589b",
|
|
68
|
+
"@dxos/keys": "0.8.3-staging.0fa589b",
|
|
69
|
+
"@dxos/lit-grid": "0.8.3-staging.0fa589b",
|
|
70
|
+
"@dxos/live-object": "0.8.3-staging.0fa589b",
|
|
71
|
+
"@dxos/log": "0.8.3-staging.0fa589b",
|
|
72
|
+
"@dxos/plugin-attention": "0.8.3-staging.0fa589b",
|
|
73
|
+
"@dxos/plugin-client": "0.8.3-staging.0fa589b",
|
|
74
|
+
"@dxos/plugin-deck": "0.8.3-staging.0fa589b",
|
|
75
|
+
"@dxos/plugin-markdown": "0.8.3-staging.0fa589b",
|
|
76
|
+
"@dxos/plugin-script": "0.8.3-staging.0fa589b",
|
|
77
|
+
"@dxos/plugin-graph": "0.8.3-staging.0fa589b",
|
|
78
|
+
"@dxos/plugin-stack": "0.8.3-staging.0fa589b",
|
|
79
|
+
"@dxos/plugin-space": "0.8.3-staging.0fa589b",
|
|
80
|
+
"@dxos/react-client": "0.8.3-staging.0fa589b",
|
|
81
|
+
"@dxos/plugin-thread": "0.8.3-staging.0fa589b",
|
|
82
|
+
"@dxos/react-hooks": "0.8.3-staging.0fa589b",
|
|
83
|
+
"@dxos/react-ui-editor": "0.8.3-staging.0fa589b",
|
|
84
|
+
"@dxos/react-ui-form": "0.8.3-staging.0fa589b",
|
|
85
|
+
"@dxos/react-ui-attention": "0.8.3-staging.0fa589b",
|
|
86
|
+
"@dxos/react-ui-grid": "0.8.3-staging.0fa589b",
|
|
87
|
+
"@dxos/react-ui-menu": "0.8.3-staging.0fa589b",
|
|
88
|
+
"@dxos/react-ui-list": "0.8.3-staging.0fa589b",
|
|
89
|
+
"@dxos/react-ui-stack": "0.8.3-staging.0fa589b",
|
|
90
|
+
"@dxos/schema": "0.8.3-staging.0fa589b",
|
|
91
|
+
"@dxos/util": "0.8.3-staging.0fa589b"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -103,15 +103,15 @@
|
|
|
103
103
|
"react": "~18.2.0",
|
|
104
104
|
"react-dom": "~18.2.0",
|
|
105
105
|
"vite": "5.4.7",
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/react-ui-
|
|
111
|
-
"@dxos/react-ui-
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/
|
|
106
|
+
"@dxos/echo-generator": "0.8.3-staging.0fa589b",
|
|
107
|
+
"@dxos/lit-grid": "0.8.3-staging.0fa589b",
|
|
108
|
+
"@dxos/react-ui": "0.8.3-staging.0fa589b",
|
|
109
|
+
"@dxos/random": "0.8.3-staging.0fa589b",
|
|
110
|
+
"@dxos/react-ui-theme": "0.8.3-staging.0fa589b",
|
|
111
|
+
"@dxos/react-ui-types": "0.8.3-staging.0fa589b",
|
|
112
|
+
"@dxos/storybook-utils": "0.8.3-staging.0fa589b",
|
|
113
|
+
"@dxos/test-utils": "0.8.3-staging.0fa589b",
|
|
114
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.3-staging.0fa589b"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"effect": "^3.13.3",
|
|
120
120
|
"react": "~18.2.0",
|
|
121
121
|
"react-dom": "~18.2.0",
|
|
122
|
-
"@dxos/react-ui": "0.8.3-
|
|
123
|
-
"@dxos/react-ui-theme": "0.8.3-
|
|
122
|
+
"@dxos/react-ui": "0.8.3-staging.0fa589b",
|
|
123
|
+
"@dxos/react-ui-theme": "0.8.3-staging.0fa589b"
|
|
124
124
|
},
|
|
125
125
|
"publishConfig": {
|
|
126
126
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -33,7 +33,7 @@ export const SheetPlugin = () =>
|
|
|
33
33
|
contributes(Capabilities.Metadata, {
|
|
34
34
|
id: SheetType.typename,
|
|
35
35
|
metadata: {
|
|
36
|
-
label: (object:
|
|
36
|
+
label: (object: SheetType) => object.name,
|
|
37
37
|
icon: 'ph--grid-nine--regular',
|
|
38
38
|
serializer,
|
|
39
39
|
comments: 'anchored',
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { Type } from '@dxos/echo';
|
|
7
7
|
import { getTarget } from '@dxos/react-client/echo';
|
|
8
8
|
|
|
9
9
|
import { compareIndexPositions, SheetType } from '../types';
|
|
10
10
|
|
|
11
11
|
export default () =>
|
|
12
12
|
contributes(Capabilities.AnchorSort, {
|
|
13
|
-
key:
|
|
13
|
+
key: Type.getTypename(SheetType)!,
|
|
14
14
|
sort: (anchorA, anchorB) => {
|
|
15
15
|
const sheet = getTarget(anchorA) as SheetType;
|
|
16
16
|
if (sheet !== getTarget(anchorB)) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
9
|
import { getSpace } from '@dxos/react-client/echo';
|
|
10
10
|
|
|
11
11
|
import { SheetCapabilities } from './capabilities';
|
|
@@ -19,7 +19,7 @@ export default () =>
|
|
|
19
19
|
id: `${SHEET_PLUGIN}/sheet`,
|
|
20
20
|
role: ['article', 'section'],
|
|
21
21
|
filter: (data): data is { subject: SheetType } =>
|
|
22
|
-
|
|
22
|
+
Obj.instanceOf(SheetType, data.subject) && !!getSpace(data.subject),
|
|
23
23
|
component: ({ data, role }) => {
|
|
24
24
|
const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
25
25
|
|
|
@@ -33,7 +33,7 @@ export default () =>
|
|
|
33
33
|
createSurface({
|
|
34
34
|
id: `${SHEET_PLUGIN}/object-settings`,
|
|
35
35
|
role: 'object-settings',
|
|
36
|
-
filter: (data): data is { subject: SheetType } =>
|
|
36
|
+
filter: (data): data is { subject: SheetType } => Obj.instanceOf(SheetType, data.subject),
|
|
37
37
|
component: ({ data }) => <RangeList sheet={data.subject} />,
|
|
38
38
|
}),
|
|
39
39
|
]);
|
|
@@ -8,8 +8,9 @@ import { type Meta } from '@storybook/react';
|
|
|
8
8
|
import React, { useEffect, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { testFunctionPlugins } from '@dxos/compute/testing';
|
|
11
|
+
import { Obj, Filter } from '@dxos/echo';
|
|
11
12
|
import { FunctionType } from '@dxos/functions';
|
|
12
|
-
import {
|
|
13
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
13
14
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
14
15
|
import { Toolbar, Button, Input } from '@dxos/react-ui';
|
|
15
16
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
@@ -44,7 +45,7 @@ const Story = () => {
|
|
|
44
45
|
setResult({ functions: { standard: f1.length, echo: f2.length } });
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
space.db.add(
|
|
48
|
+
space.db.add(Obj.make(FunctionType, { name: 'test', version: '0.0.1', binding: FUNCTION_NAME }));
|
|
48
49
|
}
|
|
49
50
|
}, [space, graph]);
|
|
50
51
|
|
|
@@ -327,7 +327,7 @@ export const GridSheet = () => {
|
|
|
327
327
|
onContextMenu={handleContextMenu}
|
|
328
328
|
onClick={handleClick}
|
|
329
329
|
overscroll='trap'
|
|
330
|
-
className='[--dx-grid-base:var(--baseSurface)] [&_.dx-grid]:
|
|
330
|
+
className='[--dx-grid-base:var(--baseSurface)] [&_.dx-grid]:absolute [&_.dx-grid]:inset-0'
|
|
331
331
|
activeRefs={activeRefs}
|
|
332
332
|
ref={setDxGrid}
|
|
333
333
|
/>
|
|
@@ -8,7 +8,7 @@ import { type Meta } from '@storybook/react';
|
|
|
8
8
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { Client } from '@dxos/client';
|
|
11
|
-
import { createDocAccessor
|
|
11
|
+
import { createDocAccessor } from '@dxos/client/echo';
|
|
12
12
|
import { defaultFunctions } from '@dxos/compute';
|
|
13
13
|
import { getRegisteredFunctionNames } from '@dxos/compute/testing';
|
|
14
14
|
import { automerge } from '@dxos/react-ui-editor';
|
|
@@ -32,7 +32,7 @@ const Story = ({ value, ...props }: StoryProps) => {
|
|
|
32
32
|
|
|
33
33
|
const AutomergeStory = ({ value, ...props }: StoryProps) => {
|
|
34
34
|
const cell = 'A1';
|
|
35
|
-
const [object, setObject] = useState<
|
|
35
|
+
const [object, setObject] = useState<SheetType>();
|
|
36
36
|
useEffect(() => {
|
|
37
37
|
setTimeout(async () => {
|
|
38
38
|
const client = new Client({ types: [SheetType] });
|
|
@@ -6,7 +6,7 @@ import { Schema } from 'effect';
|
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
import { rangeToA1Notation } from '@dxos/compute';
|
|
9
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { Callout, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { List } from '@dxos/react-ui-list';
|
|
11
11
|
import { ghostHover } from '@dxos/react-ui-theme';
|
|
12
12
|
|
|
@@ -31,24 +31,30 @@ export const RangeList = ({ sheet }: RangeListProps) => {
|
|
|
31
31
|
);
|
|
32
32
|
return (
|
|
33
33
|
<>
|
|
34
|
-
<h2 className='
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
<h2 className='mbs-cardSpacingBlock mbe-labelSpacingBlock text-sm font-semibold'>{t('range list heading')}</h2>
|
|
35
|
+
{sheet.ranges.length < 1 ? (
|
|
36
|
+
<Callout.Root>
|
|
37
|
+
<Callout.Title>{t('no ranges message')}</Callout.Title>
|
|
38
|
+
</Callout.Root>
|
|
39
|
+
) : (
|
|
40
|
+
<List.Root<Range> items={sheet.ranges} isItem={Schema.is(Range)}>
|
|
41
|
+
{({ items: ranges }) =>
|
|
42
|
+
ranges.map((range, i) => (
|
|
43
|
+
<List.Item key={i} item={range} classNames={['p-2', ghostHover]}>
|
|
44
|
+
<List.ItemDragHandle />
|
|
45
|
+
<List.ItemTitle onClick={() => handleSelectRange(range)}>
|
|
46
|
+
{t('range title', {
|
|
47
|
+
position: rangeToA1Notation(rangeFromIndex(sheet, range.range)),
|
|
48
|
+
key: t(`range key ${range.key} label`),
|
|
49
|
+
value: t(`range value ${range.value} label`),
|
|
50
|
+
})}
|
|
51
|
+
</List.ItemTitle>
|
|
52
|
+
<List.ItemDeleteButton onClick={() => handleDeleteRange(range)} />
|
|
53
|
+
</List.Item>
|
|
54
|
+
))
|
|
55
|
+
}
|
|
56
|
+
</List.Root>
|
|
57
|
+
)}
|
|
52
58
|
</>
|
|
53
59
|
);
|
|
54
60
|
};
|
|
@@ -7,14 +7,13 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta } from '@storybook/react';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import { textBlockWidth } from '@dxos/react-ui-theme';
|
|
11
10
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
11
|
|
|
13
12
|
import { SheetToolbar } from './SheetToolbar';
|
|
14
13
|
import translations from '../../translations';
|
|
15
14
|
|
|
16
15
|
const DefaultStory = () => {
|
|
17
|
-
return <SheetToolbar id='test'
|
|
16
|
+
return <SheetToolbar id='test' />;
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
export const Default = {};
|
|
@@ -15,8 +15,7 @@ import {
|
|
|
15
15
|
} from '@dxos/app-framework';
|
|
16
16
|
import { debounce } from '@dxos/async';
|
|
17
17
|
import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute';
|
|
18
|
-
import { Relation } from '@dxos/echo';
|
|
19
|
-
import { isInstanceOf } from '@dxos/echo-schema';
|
|
18
|
+
import { Obj, Relation } from '@dxos/echo';
|
|
20
19
|
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
21
20
|
import { ThreadAction, ThreadType } from '@dxos/plugin-thread/types';
|
|
22
21
|
import { Filter, fullyQualifiedId, getSpace, Query, useQuery } from '@dxos/react-client/echo';
|
|
@@ -91,7 +90,7 @@ export const useSelectThreadOnCellFocus = () => {
|
|
|
91
90
|
|
|
92
91
|
const closestThread = anchors.find((anchor) => {
|
|
93
92
|
const source = Relation.getSource(anchor);
|
|
94
|
-
if (anchor.anchor &&
|
|
93
|
+
if (anchor.anchor && Obj.instanceOf(ThreadType, source)) {
|
|
95
94
|
const range = parseThreadAnchorAsCellRange(anchor.anchor);
|
|
96
95
|
return range ? inRange(range, cellAddress) : false;
|
|
97
96
|
} else {
|
package/src/model/sheet-model.ts
CHANGED
|
@@ -22,12 +22,15 @@ import {
|
|
|
22
22
|
type SimpleDateTime,
|
|
23
23
|
} from '@dxos/compute';
|
|
24
24
|
import { Resource } from '@dxos/context';
|
|
25
|
-
import {
|
|
25
|
+
import { Obj } from '@dxos/echo';
|
|
26
|
+
import { FormatEnum, TypeEnum } from '@dxos/echo-schema';
|
|
26
27
|
import { invariant } from '@dxos/invariant';
|
|
27
28
|
import { PublicKey } from '@dxos/keys';
|
|
28
29
|
import { log } from '@dxos/log';
|
|
29
30
|
|
|
30
31
|
import {
|
|
32
|
+
MAX_COLS,
|
|
33
|
+
MAX_ROWS,
|
|
31
34
|
ReadonlyException,
|
|
32
35
|
addressFromIndex,
|
|
33
36
|
addressToIndex,
|
|
@@ -35,8 +38,6 @@ import {
|
|
|
35
38
|
insertIndices,
|
|
36
39
|
mapFormulaIndicesToRefs,
|
|
37
40
|
mapFormulaRefsToIndices,
|
|
38
|
-
MAX_ROWS,
|
|
39
|
-
MAX_COLS,
|
|
40
41
|
} from '../types';
|
|
41
42
|
import { type SheetAction, type CellValue, type SheetType } from '../types';
|
|
42
43
|
|
|
@@ -130,7 +131,9 @@ export class SheetModel extends Resource {
|
|
|
130
131
|
});
|
|
131
132
|
|
|
132
133
|
// TODO(burdon): SheetModel should extend ComputeNode and be constructed via the graph.
|
|
133
|
-
this._node = this._graph.getOrCreateNode(
|
|
134
|
+
this._node = this._graph.getOrCreateNode(
|
|
135
|
+
createSheetName({ type: Obj.getTypename(this._sheet)!, id: this._sheet.id }),
|
|
136
|
+
);
|
|
134
137
|
await this._node.open();
|
|
135
138
|
|
|
136
139
|
// Listen for model updates (e.g., async calculations).
|
package/src/sanity.test.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, test, expect } from 'vitest';
|
|
6
6
|
|
|
7
|
+
import { Client } from '@dxos/client';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { FunctionType } from '@dxos/functions';
|
|
10
|
+
|
|
7
11
|
// Part 2.
|
|
8
12
|
// TODO(burdon): Cannot test outside of browser.
|
|
9
13
|
// - Cannot test Hyperformula
|
|
10
14
|
// - throws "Cannot convert undefined or null to object" in vitest (no browser).
|
|
11
15
|
// - throws "process.nextTick is not a function" (if browser)
|
|
12
16
|
|
|
13
|
-
import { Client } from '@dxos/client';
|
|
14
|
-
import { live } from '@dxos/client/echo';
|
|
15
|
-
import { FunctionType } from '@dxos/functions';
|
|
16
|
-
|
|
17
17
|
// TODO(burdon): Fix test infrastructure:
|
|
18
18
|
// - Need docs? esp. needed for config. need pristine example package?
|
|
19
19
|
// - NOTE for non browser tests, import types from x-plugin/types (otherwise will bring in react deps).
|
|
@@ -34,7 +34,7 @@ describe('test', () => {
|
|
|
34
34
|
// - ERROR "process.nextTick is not a function"
|
|
35
35
|
// - ERROR "Identifier 'Buffer' has already been declared" if { nodeExternal: true }
|
|
36
36
|
const space = await client.spaces.create();
|
|
37
|
-
const fn = space.db.add(
|
|
37
|
+
const fn = space.db.add(Obj.make(FunctionType, { name: 'test', version: '0.0.1', binding: 'HELLO' }));
|
|
38
38
|
expect(fn).to.exist;
|
|
39
39
|
});
|
|
40
40
|
});
|
package/src/serializer.ts
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Obj } from '@dxos/echo';
|
|
5
6
|
import { type TypedObjectSerializer } from '@dxos/plugin-space/types';
|
|
6
|
-
import {
|
|
7
|
+
import { getObjectCore } from '@dxos/react-client/echo';
|
|
7
8
|
|
|
8
9
|
import { SheetType } from './types';
|
|
9
10
|
|
|
@@ -14,7 +15,7 @@ export const serializer: TypedObjectSerializer<SheetType> = {
|
|
|
14
15
|
|
|
15
16
|
deserialize: async ({ content, newId }) => {
|
|
16
17
|
const { id, ...parsed } = JSON.parse(content);
|
|
17
|
-
const sheet =
|
|
18
|
+
const sheet = Obj.make(SheetType, parsed);
|
|
18
19
|
|
|
19
20
|
if (!newId) {
|
|
20
21
|
const core = getObjectCore(sheet);
|