@dxos/plugin-sheet 0.8.1 → 0.8.2-main.2f9c567

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.
Files changed (75) hide show
  1. package/dist/lib/browser/{SheetContainer-B3A5443Z.mjs → SheetContainer-N74FX62K.mjs} +5 -5
  2. package/dist/lib/browser/{SheetContainer-B3A5443Z.mjs.map → SheetContainer-N74FX62K.mjs.map} +3 -3
  3. package/dist/lib/browser/{chunk-ZOKEQL2K.mjs → chunk-N2FOQHUH.mjs} +51 -50
  4. package/dist/lib/browser/chunk-N2FOQHUH.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-CHMPICA6.mjs → chunk-SY25UNYZ.mjs} +7 -8
  6. package/dist/lib/browser/chunk-SY25UNYZ.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +6 -6
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/{intent-resolver-6OUEM3IG.mjs → intent-resolver-DN7JXDAV.mjs} +2 -2
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/{react-surface-ECKBP3UZ.mjs → react-surface-XUJZGNUH.mjs} +3 -3
  12. package/dist/lib/browser/{thread-76MK2FMV.mjs → thread-WU64QL2A.mjs} +2 -2
  13. package/dist/lib/browser/types/index.mjs +1 -1
  14. package/dist/lib/node/{SheetContainer-LGRD3TTQ.cjs → SheetContainer-MERCQUPB.cjs} +32 -32
  15. package/dist/lib/node/{SheetContainer-LGRD3TTQ.cjs.map → SheetContainer-MERCQUPB.cjs.map} +3 -3
  16. package/dist/lib/node/{chunk-AEH3L5QZ.cjs → chunk-62JKBCGO.cjs} +19 -20
  17. package/dist/lib/node/chunk-62JKBCGO.cjs.map +7 -0
  18. package/dist/lib/node/{chunk-D4MOMCEU.cjs → chunk-HLSQVT3C.cjs} +66 -65
  19. package/dist/lib/node/chunk-HLSQVT3C.cjs.map +7 -0
  20. package/dist/lib/node/index.cjs +10 -10
  21. package/dist/lib/node/index.cjs.map +3 -3
  22. package/dist/lib/node/{intent-resolver-ICHNDL6F.cjs → intent-resolver-OPF56TAL.cjs} +9 -9
  23. package/dist/lib/node/meta.json +1 -1
  24. package/dist/lib/node/{react-surface-6PBWE75L.cjs → react-surface-GSS7VQ2D.cjs} +11 -11
  25. package/dist/lib/node/{thread-WP43BC4N.cjs → thread-E7YPGR5T.cjs} +7 -7
  26. package/dist/lib/node/types/index.cjs +29 -29
  27. package/dist/lib/node/types/index.cjs.map +1 -1
  28. package/dist/lib/node-esm/{SheetContainer-4FNTLG5R.mjs → SheetContainer-XFQTSA3I.mjs} +5 -5
  29. package/dist/lib/node-esm/{SheetContainer-4FNTLG5R.mjs.map → SheetContainer-XFQTSA3I.mjs.map} +3 -3
  30. package/dist/lib/node-esm/{chunk-6NB67Y6X.mjs → chunk-LYZV4Q4C.mjs} +51 -50
  31. package/dist/lib/node-esm/chunk-LYZV4Q4C.mjs.map +7 -0
  32. package/dist/lib/node-esm/{chunk-WQHYR4WD.mjs → chunk-RRIPYVEN.mjs} +7 -8
  33. package/dist/lib/node-esm/chunk-RRIPYVEN.mjs.map +7 -0
  34. package/dist/lib/node-esm/index.mjs +6 -6
  35. package/dist/lib/node-esm/index.mjs.map +3 -3
  36. package/dist/lib/node-esm/{intent-resolver-2JNQCFCI.mjs → intent-resolver-7AN5CN4R.mjs} +2 -2
  37. package/dist/lib/node-esm/meta.json +1 -1
  38. package/dist/lib/node-esm/{react-surface-UM2Y3ZWZ.mjs → react-surface-XUFWQE5B.mjs} +3 -3
  39. package/dist/lib/node-esm/{thread-4NCPE5FK.mjs → thread-ULESW6IX.mjs} +2 -2
  40. package/dist/lib/node-esm/types/index.mjs +1 -1
  41. package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -1
  42. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +1 -1
  43. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
  44. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
  45. package/dist/types/src/types/schema.d.ts +363 -144
  46. package/dist/types/src/types/schema.d.ts.map +1 -1
  47. package/dist/types/src/types/types.d.ts +36 -36
  48. package/dist/types/src/types/types.d.ts.map +1 -1
  49. package/package.json +47 -47
  50. package/src/components/ComputeGraph/compute-graph.stories.tsx +3 -3
  51. package/src/components/GridSheet/SheetCellEditor.stories.tsx +2 -2
  52. package/src/components/RangeList/RangeList.tsx +2 -2
  53. package/src/components/SheetToolbar/useToolbarState.ts +2 -2
  54. package/src/integrations/thread-ranges.ts +2 -3
  55. package/src/model/sheet-model.test.ts +1 -1
  56. package/src/sanity.test.ts +3 -3
  57. package/src/serializer.ts +2 -2
  58. package/src/types/schema.ts +21 -19
  59. package/src/types/types.ts +25 -25
  60. package/src/types/util.ts +2 -2
  61. package/dist/lib/browser/chunk-CHMPICA6.mjs.map +0 -7
  62. package/dist/lib/browser/chunk-ZOKEQL2K.mjs.map +0 -7
  63. package/dist/lib/node/chunk-AEH3L5QZ.cjs.map +0 -7
  64. package/dist/lib/node/chunk-D4MOMCEU.cjs.map +0 -7
  65. package/dist/lib/node-esm/chunk-6NB67Y6X.mjs.map +0 -7
  66. package/dist/lib/node-esm/chunk-WQHYR4WD.mjs.map +0 -7
  67. /package/dist/lib/browser/{intent-resolver-6OUEM3IG.mjs.map → intent-resolver-DN7JXDAV.mjs.map} +0 -0
  68. /package/dist/lib/browser/{react-surface-ECKBP3UZ.mjs.map → react-surface-XUJZGNUH.mjs.map} +0 -0
  69. /package/dist/lib/browser/{thread-76MK2FMV.mjs.map → thread-WU64QL2A.mjs.map} +0 -0
  70. /package/dist/lib/node/{intent-resolver-ICHNDL6F.cjs.map → intent-resolver-OPF56TAL.cjs.map} +0 -0
  71. /package/dist/lib/node/{react-surface-6PBWE75L.cjs.map → react-surface-GSS7VQ2D.cjs.map} +0 -0
  72. /package/dist/lib/node/{thread-WP43BC4N.cjs.map → thread-E7YPGR5T.cjs.map} +0 -0
  73. /package/dist/lib/node-esm/{intent-resolver-2JNQCFCI.mjs.map → intent-resolver-7AN5CN4R.mjs.map} +0 -0
  74. /package/dist/lib/node-esm/{react-surface-UM2Y3ZWZ.mjs.map → react-surface-XUFWQE5B.mjs.map} +0 -0
  75. /package/dist/lib/node-esm/{thread-4NCPE5FK.mjs.map → thread-ULESW6IX.mjs.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { S } from '@dxos/echo-schema';
1
+ import { Schema } from 'effect';
2
2
  import { type CellValue, SheetType } from './schema';
3
3
  import { SheetModel } from '../model';
4
4
  export type SheetSize = {
@@ -10,59 +10,59 @@ export type CreateSheetOptions = {
10
10
  cells?: Record<string, CellValue>;
11
11
  } & Partial<SheetSize>;
12
12
  export declare namespace SheetAction {
13
- const Create_base: S.TaggedClass<Create, "dxos.org/plugin/sheet/action/create", {
14
- readonly _tag: S.tag<"dxos.org/plugin/sheet/action/create">;
13
+ const Create_base: Schema.TaggedClass<Create, "dxos.org/plugin/sheet/action/create", {
14
+ readonly _tag: Schema.tag<"dxos.org/plugin/sheet/action/create">;
15
15
  } & {
16
- input: S.Struct<{
17
- name: S.optional<typeof S.String>;
16
+ input: Schema.Struct<{
17
+ name: Schema.optional<typeof Schema.String>;
18
18
  }>;
19
- output: S.Struct<{
19
+ output: Schema.Struct<{
20
20
  object: typeof SheetType;
21
21
  }>;
22
22
  }>;
23
23
  export class Create extends Create_base {
24
24
  }
25
- const InsertAxis_base: S.TaggedClass<InsertAxis, "dxos.org/plugin/sheet/action/axis-insert", {
26
- readonly _tag: S.tag<"dxos.org/plugin/sheet/action/axis-insert">;
25
+ const InsertAxis_base: Schema.TaggedClass<InsertAxis, "dxos.org/plugin/sheet/action/axis-insert", {
26
+ readonly _tag: Schema.tag<"dxos.org/plugin/sheet/action/axis-insert">;
27
27
  } & {
28
- input: S.Struct<{
29
- model: S.Schema<SheetModel>;
30
- axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
31
- index: typeof S.Number;
32
- count: S.optional<typeof S.Number>;
28
+ input: Schema.Struct<{
29
+ model: Schema.Schema<SheetModel>;
30
+ axis: Schema.Union<[Schema.Literal<["row"]>, Schema.Literal<["col"]>]>;
31
+ index: typeof Schema.Number;
32
+ count: Schema.optional<typeof Schema.Number>;
33
33
  }>;
34
- output: typeof S.Void;
34
+ output: typeof Schema.Void;
35
35
  }>;
36
36
  export class InsertAxis extends InsertAxis_base {
37
37
  }
38
- export const RestoreAxis: S.Struct<{
39
- axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
40
- axisIndex: typeof S.String;
41
- index: typeof S.Number;
42
- axisMeta: S.Struct<{
43
- size: S.optional<typeof S.Number>;
38
+ export const RestoreAxis: Schema.Struct<{
39
+ axis: Schema.Union<[Schema.Literal<["row"]>, Schema.Literal<["col"]>]>;
40
+ axisIndex: typeof Schema.String;
41
+ index: typeof Schema.Number;
42
+ axisMeta: Schema.Struct<{
43
+ size: Schema.optional<typeof Schema.Number>;
44
44
  }>;
45
- values: S.Array$<typeof S.Any>;
45
+ values: Schema.Array$<typeof Schema.Any>;
46
46
  }>;
47
- export type RestoreAxis = S.Schema.Type<typeof RestoreAxis>;
48
- const DropAxis_base: S.TaggedClass<DropAxis, "dxos.org/plugin/sheet/action/axis-drop", {
49
- readonly _tag: S.tag<"dxos.org/plugin/sheet/action/axis-drop">;
47
+ export type RestoreAxis = Schema.Schema.Type<typeof RestoreAxis>;
48
+ const DropAxis_base: Schema.TaggedClass<DropAxis, "dxos.org/plugin/sheet/action/axis-drop", {
49
+ readonly _tag: Schema.tag<"dxos.org/plugin/sheet/action/axis-drop">;
50
50
  } & {
51
- input: S.Struct<{
52
- model: S.Schema<SheetModel>;
53
- axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
54
- axisIndex: typeof S.String;
55
- deletionData: S.optional<S.Struct<{
56
- axis: S.Union<[S.Literal<["row"]>, S.Literal<["col"]>]>;
57
- axisIndex: typeof S.String;
58
- index: typeof S.Number;
59
- axisMeta: S.Struct<{
60
- size: S.optional<typeof S.Number>;
51
+ input: Schema.Struct<{
52
+ model: Schema.Schema<SheetModel>;
53
+ axis: Schema.Union<[Schema.Literal<["row"]>, Schema.Literal<["col"]>]>;
54
+ axisIndex: typeof Schema.String;
55
+ deletionData: Schema.optional<Schema.Struct<{
56
+ axis: Schema.Union<[Schema.Literal<["row"]>, Schema.Literal<["col"]>]>;
57
+ axisIndex: typeof Schema.String;
58
+ index: typeof Schema.Number;
59
+ axisMeta: Schema.Struct<{
60
+ size: Schema.optional<typeof Schema.Number>;
61
61
  }>;
62
- values: S.Array$<typeof S.Any>;
62
+ values: Schema.Array$<typeof Schema.Any>;
63
63
  }>>;
64
64
  }>;
65
- output: typeof S.Void;
65
+ output: typeof Schema.Void;
66
66
  }>;
67
67
  export class DropAxis extends DropAxis_base {
68
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,KAAK,SAAS,EAAiB,SAAS,EAAE,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;;;;;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
+ {"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,EAAiB,SAAS,EAAE,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.1",
3
+ "version": "0.8.2-main.2f9c567",
4
4
  "description": "Braneframe sketch plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -49,43 +49,44 @@
49
49
  "@radix-ui/react-context": "1.1.1",
50
50
  "codemirror-lang-spreadsheet": "^1.3.0",
51
51
  "date-fns": "^3.3.1",
52
+ "effect": "^3.13.3",
52
53
  "lodash.defaultsdeep": "^4.6.1",
53
54
  "re-resizable": "^6.9.17",
54
55
  "react-markdown": "^8.0.5",
55
56
  "react-resize-detector": "^11.0.1",
56
- "@dxos/app-framework": "0.8.1",
57
- "@dxos/async": "0.8.1",
58
- "@dxos/client": "0.8.1",
59
- "@dxos/compute": "0.8.1",
60
- "@dxos/crypto": "0.8.1",
61
- "@dxos/echo-schema": "0.8.1",
62
- "@dxos/debug": "0.8.1",
63
- "@dxos/context": "0.8.1",
64
- "@dxos/functions": "0.8.1",
65
- "@dxos/invariant": "0.8.1",
66
- "@dxos/keys": "0.8.1",
67
- "@dxos/plugin-attention": "0.8.1",
68
- "@dxos/plugin-deck": "0.8.1",
69
- "@dxos/live-object": "0.8.1",
70
- "@dxos/log": "0.8.1",
71
- "@dxos/plugin-client": "0.8.1",
72
- "@dxos/plugin-graph": "0.8.1",
73
- "@dxos/plugin-script": "0.8.1",
74
- "@dxos/plugin-markdown": "0.8.1",
75
- "@dxos/plugin-space": "0.8.1",
76
- "@dxos/plugin-stack": "0.8.1",
77
- "@dxos/plugin-thread": "0.8.1",
78
- "@dxos/react-client": "0.8.1",
79
- "@dxos/react-ui-attention": "0.8.1",
80
- "@dxos/react-ui-editor": "0.8.1",
81
- "@dxos/react-hooks": "0.8.1",
82
- "@dxos/react-ui-form": "0.8.1",
83
- "@dxos/react-ui-grid": "0.8.1",
84
- "@dxos/react-ui-list": "0.8.1",
85
- "@dxos/react-ui-stack": "0.8.1",
86
- "@dxos/schema": "0.8.1",
87
- "@dxos/util": "0.8.1",
88
- "@dxos/react-ui-menu": "0.8.1"
57
+ "@dxos/async": "0.8.2-main.2f9c567",
58
+ "@dxos/compute": "0.8.2-main.2f9c567",
59
+ "@dxos/client": "0.8.2-main.2f9c567",
60
+ "@dxos/context": "0.8.2-main.2f9c567",
61
+ "@dxos/echo-schema": "0.8.2-main.2f9c567",
62
+ "@dxos/crypto": "0.8.2-main.2f9c567",
63
+ "@dxos/debug": "0.8.2-main.2f9c567",
64
+ "@dxos/invariant": "0.8.2-main.2f9c567",
65
+ "@dxos/functions": "0.8.2-main.2f9c567",
66
+ "@dxos/app-framework": "0.8.2-main.2f9c567",
67
+ "@dxos/live-object": "0.8.2-main.2f9c567",
68
+ "@dxos/keys": "0.8.2-main.2f9c567",
69
+ "@dxos/log": "0.8.2-main.2f9c567",
70
+ "@dxos/plugin-client": "0.8.2-main.2f9c567",
71
+ "@dxos/plugin-attention": "0.8.2-main.2f9c567",
72
+ "@dxos/plugin-deck": "0.8.2-main.2f9c567",
73
+ "@dxos/plugin-graph": "0.8.2-main.2f9c567",
74
+ "@dxos/plugin-script": "0.8.2-main.2f9c567",
75
+ "@dxos/plugin-space": "0.8.2-main.2f9c567",
76
+ "@dxos/plugin-markdown": "0.8.2-main.2f9c567",
77
+ "@dxos/plugin-stack": "0.8.2-main.2f9c567",
78
+ "@dxos/plugin-thread": "0.8.2-main.2f9c567",
79
+ "@dxos/react-hooks": "0.8.2-main.2f9c567",
80
+ "@dxos/react-ui-attention": "0.8.2-main.2f9c567",
81
+ "@dxos/react-client": "0.8.2-main.2f9c567",
82
+ "@dxos/react-ui-editor": "0.8.2-main.2f9c567",
83
+ "@dxos/react-ui-form": "0.8.2-main.2f9c567",
84
+ "@dxos/react-ui-grid": "0.8.2-main.2f9c567",
85
+ "@dxos/react-ui-menu": "0.8.2-main.2f9c567",
86
+ "@dxos/react-ui-stack": "0.8.2-main.2f9c567",
87
+ "@dxos/util": "0.8.2-main.2f9c567",
88
+ "@dxos/schema": "0.8.2-main.2f9c567",
89
+ "@dxos/react-ui-list": "0.8.2-main.2f9c567"
89
90
  },
90
91
  "devDependencies": {
91
92
  "@lezer/generator": "^1.7.1",
@@ -94,26 +95,25 @@
94
95
  "@types/react": "~18.2.0",
95
96
  "@types/react-dom": "~18.2.0",
96
97
  "@types/react-window": "^1.8.8",
97
- "effect": "3.13.3",
98
98
  "react": "~18.2.0",
99
99
  "react-dom": "~18.2.0",
100
100
  "vite": "5.4.7",
101
- "@dxos/echo-generator": "0.8.1",
102
- "@dxos/random": "0.8.1",
103
- "@dxos/lit-grid": "0.8.1",
104
- "@dxos/react-ui-syntax-highlighter": "0.8.1",
105
- "@dxos/react-ui": "0.8.1",
106
- "@dxos/react-ui-types": "0.8.1",
107
- "@dxos/react-ui-theme": "0.8.1",
108
- "@dxos/storybook-utils": "0.8.1",
109
- "@dxos/test-utils": "0.8.1"
101
+ "@dxos/echo-generator": "0.8.2-main.2f9c567",
102
+ "@dxos/lit-grid": "0.8.2-main.2f9c567",
103
+ "@dxos/random": "0.8.2-main.2f9c567",
104
+ "@dxos/react-ui": "0.8.2-main.2f9c567",
105
+ "@dxos/react-ui-syntax-highlighter": "0.8.2-main.2f9c567",
106
+ "@dxos/react-ui-theme": "0.8.2-main.2f9c567",
107
+ "@dxos/react-ui-types": "0.8.2-main.2f9c567",
108
+ "@dxos/test-utils": "0.8.2-main.2f9c567",
109
+ "@dxos/storybook-utils": "0.8.2-main.2f9c567"
110
110
  },
111
111
  "peerDependencies": {
112
- "effect": "3.13.3",
112
+ "effect": "^3.13.3",
113
113
  "react": "~18.2.0",
114
114
  "react-dom": "~18.2.0",
115
- "@dxos/react-ui": "0.8.1",
116
- "@dxos/react-ui-theme": "0.8.1"
115
+ "@dxos/react-ui-theme": "0.8.2-main.2f9c567",
116
+ "@dxos/react-ui": "0.8.2-main.2f9c567"
117
117
  },
118
118
  "publishConfig": {
119
119
  "access": "public"
@@ -8,8 +8,8 @@ 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 { FunctionType } from '@dxos/functions/types';
12
- import { create, useSpace, Filter } from '@dxos/react-client/echo';
11
+ import { FunctionType } from '@dxos/functions';
12
+ import { live, useSpace, Filter } from '@dxos/react-client/echo';
13
13
  import { withClientProvider } from '@dxos/react-client/testing';
14
14
  import { Toolbar, Button, Input } from '@dxos/react-ui';
15
15
  import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
@@ -44,7 +44,7 @@ const Story = () => {
44
44
  setResult({ functions: { standard: f1.length, echo: f2.length } });
45
45
  });
46
46
 
47
- space.db.add(create(FunctionType, { name: 'test', version: '0.0.1', binding: FUNCTION_NAME }));
47
+ space.db.add(live(FunctionType, { name: 'test', version: '0.0.1', binding: FUNCTION_NAME }));
48
48
  }
49
49
  }, [space, graph]);
50
50
 
@@ -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, type ReactiveEchoObject } from '@dxos/client/echo';
11
+ import { createDocAccessor, type AnyLiveObject } 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<ReactiveEchoObject<SheetType>>();
35
+ const [object, setObject] = useState<AnyLiveObject<SheetType>>();
36
36
  useEffect(() => {
37
37
  setTimeout(async () => {
38
38
  const client = new Client({ types: [SheetType] });
@@ -2,10 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  import React, { useCallback } from 'react';
6
7
 
7
8
  import { rangeToA1Notation } from '@dxos/compute';
8
- import { S } from '@dxos/echo-schema';
9
9
  import { useTranslation } from '@dxos/react-ui';
10
10
  import { List } from '@dxos/react-ui-list';
11
11
  import { ghostHover } from '@dxos/react-ui-theme';
@@ -32,7 +32,7 @@ export const RangeList = ({ sheet }: RangeListProps) => {
32
32
  return (
33
33
  <>
34
34
  <h2 className='p-2 text-sm font-semibold'>{t('range list heading')}</h2>
35
- <List.Root<Range> items={sheet.ranges} isItem={S.is(Range)}>
35
+ <List.Root<Range> items={sheet.ranges} isItem={Schema.is(Range)}>
36
36
  {({ items: ranges }) =>
37
37
  ranges.map((range, i) => (
38
38
  <List.Item key={i} item={range} classNames={['p-2', ghostHover]}>
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { useMemo } from 'react';
6
6
 
7
- import { create } from '@dxos/live-object';
7
+ import { live } from '@dxos/live-object';
8
8
 
9
9
  import { type AlignState } from './align';
10
10
  import { type CommentState } from './comment';
@@ -13,5 +13,5 @@ import { type StyleState } from './style';
13
13
  export type ToolbarState = Partial<StyleState & AlignState & CommentState>;
14
14
 
15
15
  export const useToolbarState = (initialState: ToolbarState = {}) => {
16
- return useMemo(() => create<ToolbarState>(initialState), []);
16
+ return useMemo(() => live<ToolbarState>(initialState), []);
17
17
  };
@@ -2,7 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { pipe } from 'effect';
5
+ import { Schema, pipe } from 'effect';
6
6
  import { useCallback, useEffect, useMemo } from 'react';
7
7
 
8
8
  import {
@@ -15,7 +15,6 @@ 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 { S } from '@dxos/echo-schema';
19
18
  import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
20
19
  import { ThreadAction } from '@dxos/plugin-thread/types';
21
20
  import { fullyQualifiedId } from '@dxos/react-client/echo';
@@ -55,7 +54,7 @@ export const useUpdateFocusedCellOnThreadSelection = (grid: DxGridElement | null
55
54
  subject: string;
56
55
  options: { cursor: string; ref: GridContentProps['activeRefs'] };
57
56
  } => {
58
- if (!S.is(LayoutAction.ScrollIntoView.fields.input)(data)) {
57
+ if (!Schema.is(LayoutAction.ScrollIntoView.fields.input)(data)) {
59
58
  return false;
60
59
  }
61
60
 
@@ -7,7 +7,7 @@ import { afterEach, beforeEach, describe, expect, onTestFinished, test } from 'v
7
7
  import { Trigger } from '@dxos/async';
8
8
  import { type CellScalarValue, addressFromA1Notation, isFormula } from '@dxos/compute';
9
9
  import { TestBuilder, testFunctionPlugins } from '@dxos/compute/testing';
10
- import { FunctionType } from '@dxos/functions/types';
10
+ import { FunctionType } from '@dxos/functions';
11
11
  import { log } from '@dxos/log';
12
12
 
13
13
  import { SheetModel } from './sheet-model';
@@ -11,8 +11,8 @@ import { describe, test, expect } from 'vitest';
11
11
  // - throws "process.nextTick is not a function" (if browser)
12
12
 
13
13
  import { Client } from '@dxos/client';
14
- import { create } from '@dxos/client/echo';
15
- import { FunctionType } from '@dxos/functions/types';
14
+ import { live } from '@dxos/client/echo';
15
+ import { FunctionType } from '@dxos/functions';
16
16
 
17
17
  // TODO(burdon): Fix test infrastructure:
18
18
  // - Need docs? esp. needed for config. need pristine example package?
@@ -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(create(FunctionType, { name: 'test', version: '0.0.1', binding: 'HELLO' }));
37
+ const fn = space.db.add(live(FunctionType, { name: 'test', version: '0.0.1', binding: 'HELLO' }));
38
38
  expect(fn).to.exist;
39
39
  });
40
40
  });
package/src/serializer.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { type TypedObjectSerializer } from '@dxos/plugin-space/types';
6
- import { create, getObjectCore } from '@dxos/react-client/echo';
6
+ import { live, getObjectCore } from '@dxos/react-client/echo';
7
7
 
8
8
  import { SheetType } from './types';
9
9
 
@@ -15,7 +15,7 @@ export const serializer: TypedObjectSerializer<SheetType> = {
15
15
 
16
16
  deserialize: async ({ content, newId }) => {
17
17
  const { id, ...parsed } = JSON.parse(content);
18
- const sheet = create(SheetType, parsed);
18
+ const sheet = live(SheetType, parsed);
19
19
 
20
20
  if (!newId) {
21
21
  const core = getObjectCore(sheet);
@@ -2,55 +2,57 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Ref, S, TypedObject } from '@dxos/echo-schema';
5
+ import { Schema } from 'effect';
6
+
7
+ import { Ref, TypedObject } from '@dxos/echo-schema';
6
8
  import { ThreadType } from '@dxos/plugin-space/types';
7
9
 
8
- export const CellValue = S.Struct({
10
+ export const CellValue = Schema.Struct({
9
11
  // TODO(burdon): How to store dates (datetime, date, time), percentages, etc.
10
12
  // Consider import/export; natural access for other plugins. Special handling for currency (precision).
11
13
  // TODO(burdon): Automerge (long string) or short string or number.
12
- value: S.Any,
14
+ value: Schema.Any,
13
15
  });
14
16
 
15
- export type CellValue = S.Schema.Type<typeof CellValue>;
17
+ export type CellValue = Schema.Schema.Type<typeof CellValue>;
16
18
 
17
19
  // TODO(burdon): IMPORTANT: Reconcile with Field definition.
18
- export const Range = S.Struct({
19
- range: S.String,
20
- key: S.String,
21
- value: S.String,
20
+ export const Range = Schema.Struct({
21
+ range: Schema.String,
22
+ key: Schema.String,
23
+ value: Schema.String,
22
24
  });
23
25
 
24
- export type Range = S.Schema.Type<typeof Range>;
26
+ export type Range = Schema.Schema.Type<typeof Range>;
25
27
 
26
28
  // TODO(burdon): Visibility, locked, frozen, etc.
27
- export const RowColumnMeta = S.Struct({
28
- size: S.optional(S.Number),
29
+ export const RowColumnMeta = Schema.Struct({
30
+ size: Schema.optional(Schema.Number),
29
31
  });
30
32
 
31
33
  // TODO(burdon): Reconcile col/column (across packages).
32
34
  // TODO(burdon): Index to all updates when rows/columns are inserted/deleted.
33
35
  export class SheetType extends TypedObject({ typename: 'dxos.org/type/Sheet', version: '0.1.0' })({
34
- name: S.optional(S.String),
36
+ name: Schema.optional(Schema.String),
35
37
 
36
38
  // Sparse map of cells referenced by index.
37
- cells: S.mutable(S.Record({ key: S.String, value: S.mutable(CellValue) })),
39
+ cells: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(CellValue) })),
38
40
 
39
41
  // Ordered row indices.
40
- rows: S.mutable(S.Array(S.String)),
42
+ rows: Schema.mutable(Schema.Array(Schema.String)),
41
43
 
42
44
  // Ordered column indices.
43
- columns: S.mutable(S.Array(S.String)),
45
+ columns: Schema.mutable(Schema.Array(Schema.String)),
44
46
 
45
47
  // Row metadata referenced by index.
46
- rowMeta: S.mutable(S.Record({ key: S.String, value: S.mutable(RowColumnMeta) })),
48
+ rowMeta: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(RowColumnMeta) })),
47
49
 
48
50
  // Column metadata referenced by index.
49
- columnMeta: S.mutable(S.Record({ key: S.String, value: S.mutable(RowColumnMeta) })),
51
+ columnMeta: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(RowColumnMeta) })),
50
52
 
51
53
  // Cell formatting referenced by indexed range.
52
- ranges: S.mutable(S.Array(Range)),
54
+ ranges: Schema.mutable(Schema.Array(Range)),
53
55
 
54
56
  // Threads associated with the sheet
55
- threads: S.optional(S.mutable(S.Array(Ref(ThreadType)))),
57
+ threads: Schema.optional(Schema.mutable(Schema.Array(Ref(ThreadType)))),
56
58
  }) {}
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { S } from '@dxos/echo-schema';
5
+ import { Schema } from 'effect';
6
6
 
7
7
  import { type CellValue, RowColumnMeta, SheetType } from './schema';
8
8
  import { SHEET_PLUGIN } from '../meta';
@@ -21,47 +21,47 @@ export type CreateSheetOptions = {
21
21
  export namespace SheetAction {
22
22
  const SHEET_ACTION = `${SHEET_PLUGIN}/action`;
23
23
 
24
- export class Create extends S.TaggedClass<Create>()(`${SHEET_ACTION}/create`, {
25
- input: S.Struct({
26
- name: S.optional(S.String),
24
+ export class Create extends Schema.TaggedClass<Create>()(`${SHEET_ACTION}/create`, {
25
+ input: Schema.Struct({
26
+ name: Schema.optional(Schema.String),
27
27
  }),
28
- output: S.Struct({
28
+ output: Schema.Struct({
29
29
  object: SheetType,
30
30
  }),
31
31
  }) {}
32
32
 
33
33
  // TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.
34
- const Axis = S.Union(S.Literal('row'), S.Literal('col'));
34
+ const Axis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));
35
35
 
36
- export class InsertAxis extends S.TaggedClass<InsertAxis>()(`${SHEET_ACTION}/axis-insert`, {
37
- input: S.Struct({
38
- // TODO(wittjosiah): S.instanceOf(SheetModel) throws when running tests.
39
- model: S.Any.pipe(S.filter((model) => model instanceof SheetModel)) as S.Schema<SheetModel>,
36
+ export class InsertAxis extends Schema.TaggedClass<InsertAxis>()(`${SHEET_ACTION}/axis-insert`, {
37
+ input: Schema.Struct({
38
+ // TODO(wittjosiah): Schema.instanceOf(SheetModel) throws when running tests.
39
+ model: Schema.Any.pipe(Schema.filter((model) => model instanceof SheetModel)) as Schema.Schema<SheetModel>,
40
40
  axis: Axis,
41
- index: S.Number,
42
- count: S.optional(S.Number),
41
+ index: Schema.Number,
42
+ count: Schema.optional(Schema.Number),
43
43
  }),
44
- output: S.Void,
44
+ output: Schema.Void,
45
45
  }) {}
46
46
 
47
- export const RestoreAxis = S.Struct({
47
+ export const RestoreAxis = Schema.Struct({
48
48
  axis: Axis,
49
- axisIndex: S.String,
50
- index: S.Number,
49
+ axisIndex: Schema.String,
50
+ index: Schema.Number,
51
51
  axisMeta: RowColumnMeta,
52
- values: S.Array(S.Any),
52
+ values: Schema.Array(Schema.Any),
53
53
  });
54
54
 
55
- export type RestoreAxis = S.Schema.Type<typeof RestoreAxis>;
55
+ export type RestoreAxis = Schema.Schema.Type<typeof RestoreAxis>;
56
56
 
57
- export class DropAxis extends S.TaggedClass<DropAxis>()(`${SHEET_ACTION}/axis-drop`, {
58
- input: S.Struct({
59
- // TODO(wittjosiah): S.instanceOf(SheetModel) throws when running tests.
60
- model: S.Any.pipe(S.filter((model) => model instanceof SheetModel)) as S.Schema<SheetModel>,
57
+ export class DropAxis extends Schema.TaggedClass<DropAxis>()(`${SHEET_ACTION}/axis-drop`, {
58
+ input: Schema.Struct({
59
+ // TODO(wittjosiah): Schema.instanceOf(SheetModel) throws when running tests.
60
+ model: Schema.Any.pipe(Schema.filter((model) => model instanceof SheetModel)) as Schema.Schema<SheetModel>,
61
61
  axis: Axis,
62
- axisIndex: S.String,
63
- deletionData: S.optional(RestoreAxis),
62
+ axisIndex: Schema.String,
63
+ deletionData: Schema.optional(RestoreAxis),
64
64
  }),
65
- output: S.Void,
65
+ output: Schema.Void,
66
66
  }) {}
67
67
  }
package/src/types/util.ts CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  } from '@dxos/compute';
13
13
  import { randomBytes } from '@dxos/crypto';
14
14
  import { invariant } from '@dxos/invariant';
15
- import { create } from '@dxos/live-object';
15
+ import { live } from '@dxos/live-object';
16
16
 
17
17
  import { type CreateSheetOptions, type SheetSize, SheetType } from '../types';
18
18
 
@@ -68,7 +68,7 @@ export const initialize = (
68
68
  };
69
69
 
70
70
  export const createSheet = ({ name, cells, ...size }: CreateSheetOptions = {}): SheetType => {
71
- const sheet = create(SheetType, {
71
+ const sheet = live(SheetType, {
72
72
  name,
73
73
  cells: {},
74
74
  rows: [],