@dxos/react-ui-table 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0

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 (82) hide show
  1. package/dist/lib/browser/{chunk-YWNRUF4J.mjs → chunk-PFFO5LYM.mjs} +7 -6
  2. package/dist/lib/browser/chunk-PFFO5LYM.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +290 -105
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +1 -1
  7. package/dist/lib/node/{chunk-TGG6OZ54.cjs → chunk-VREQOYRW.cjs} +9 -8
  8. package/dist/lib/node/chunk-VREQOYRW.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +263 -81
  10. package/dist/lib/node/index.cjs.map +4 -4
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/types/index.cjs +3 -3
  13. package/dist/lib/node/types/index.cjs.map +1 -1
  14. package/dist/lib/node-esm/{chunk-KKLP54L3.mjs → chunk-34JG3SDI.mjs} +7 -6
  15. package/dist/lib/node-esm/chunk-34JG3SDI.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +290 -105
  17. package/dist/lib/node-esm/index.mjs.map +4 -4
  18. package/dist/lib/node-esm/meta.json +1 -1
  19. package/dist/lib/node-esm/types/index.mjs +1 -1
  20. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
  21. package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
  22. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
  23. package/dist/types/src/components/Table/DynamicTable.d.ts +3 -4
  24. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
  25. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  26. package/dist/types/src/components/Table/Table.d.ts +2 -0
  27. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  28. package/dist/types/src/components/Table/Table.stories.d.ts +1 -0
  29. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  30. package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -1
  31. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +13 -0
  32. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -0
  33. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +3 -0
  34. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  35. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  36. package/dist/types/src/components/TableCellEditor/extension.d.ts.map +1 -1
  37. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -2
  38. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  39. package/dist/types/src/components/testing.d.ts +39 -39
  40. package/dist/types/src/components/testing.d.ts.map +1 -1
  41. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  42. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  43. package/dist/types/src/model/selection-model.d.ts.map +1 -1
  44. package/dist/types/src/model/table-model.d.ts.map +1 -1
  45. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  46. package/dist/types/src/types/table.d.ts +44 -43
  47. package/dist/types/src/types/table.d.ts.map +1 -1
  48. package/dist/types/src/util/dynamic-table.d.ts +4 -3
  49. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  50. package/dist/types/src/util/index.d.ts +1 -0
  51. package/dist/types/src/util/index.d.ts.map +1 -1
  52. package/dist/types/src/util/schema.d.ts +12 -0
  53. package/dist/types/src/util/schema.d.ts.map +1 -0
  54. package/dist/types/src/util/signals.d.ts.map +1 -1
  55. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  56. package/dist/types/src/util/table.d.ts +2 -2
  57. package/dist/types/src/util/table.d.ts.map +1 -1
  58. package/dist/types/src/util/tag.d.ts.map +1 -1
  59. package/dist/types/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +34 -33
  61. package/src/components/Table/CreateRefPanel.tsx +3 -3
  62. package/src/components/Table/DynamicTable.stories.tsx +2 -2
  63. package/src/components/Table/DynamicTable.tsx +4 -5
  64. package/src/components/Table/Table.stories.tsx +65 -19
  65. package/src/components/Table/Table.tsx +8 -5
  66. package/src/components/Table/relations.stories.tsx +16 -18
  67. package/src/components/TableCellEditor/FormCellEditor.tsx +94 -0
  68. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +8 -7
  69. package/src/components/TableCellEditor/TableCellEditor.tsx +45 -4
  70. package/src/components/TableToolbar/TableToolbar.tsx +10 -11
  71. package/src/components/testing.ts +7 -6
  72. package/src/model/table-model.test.ts +4 -3
  73. package/src/model/table-presentation.test.ts +4 -3
  74. package/src/model/table-presentation.ts +52 -6
  75. package/src/types/table.ts +15 -7
  76. package/src/util/dynamic-table.ts +7 -4
  77. package/src/util/index.ts +1 -0
  78. package/src/util/schema.ts +36 -0
  79. package/src/util/table.ts +11 -10
  80. package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +0 -7
  81. package/dist/lib/node/chunk-TGG6OZ54.cjs.map +0 -7
  82. package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +0 -7
@@ -1,54 +1,55 @@
1
- import { Expando, S } from '@dxos/echo-schema';
2
- export declare const TableSchema: S.Struct<{
1
+ import { Schema } from 'effect';
2
+ import { Expando } from '@dxos/echo-schema';
3
+ export declare const TableSchema: Schema.Struct<{
3
4
  id: import("@dxos/echo-schema").ObjectIdClass;
4
- name: S.optional<typeof S.String>;
5
- view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
6
- name: S.SchemaClass<string, string, never>;
7
- query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
8
- schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
9
- fields: S.mutable<S.Array$<S.mutable<S.Struct<{
10
- id: typeof S.String;
11
- path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
12
- visible: S.optional<typeof S.Boolean>;
13
- size: S.optional<typeof S.Number>;
14
- referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
5
+ name: Schema.optional<typeof Schema.String>;
6
+ view: Schema.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
7
+ name: Schema.SchemaClass<string, string, never>;
8
+ query: Schema.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
9
+ schema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
10
+ fields: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
11
+ id: typeof Schema.String;
12
+ path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
13
+ visible: Schema.optional<typeof Schema.Boolean>;
14
+ size: Schema.optional<typeof Schema.Number>;
15
+ referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
15
16
  }>>>>;
16
- hiddenFields: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
17
- id: typeof S.String;
18
- path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
19
- visible: S.optional<typeof S.Boolean>;
20
- size: S.optional<typeof S.Number>;
21
- referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
17
+ hiddenFields: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
18
+ id: typeof Schema.String;
19
+ path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
20
+ visible: Schema.optional<typeof Schema.Boolean>;
21
+ size: Schema.optional<typeof Schema.Number>;
22
+ referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
22
23
  }>>>>>;
23
- metadata: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
24
+ metadata: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
24
25
  }, import("@dxos/echo-schema").TypedObjectOptions>>>;
25
- threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
26
+ threads: Schema.optional<Schema.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
26
27
  }>;
27
- export declare const TableType: import("@dxos/echo-schema").EchoObjectSchema<S.Struct<{
28
+ export declare const TableType: import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
28
29
  id: import("@dxos/echo-schema").ObjectIdClass;
29
- name: S.optional<typeof S.String>;
30
- view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
31
- name: S.SchemaClass<string, string, never>;
32
- query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
33
- schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
34
- fields: S.mutable<S.Array$<S.mutable<S.Struct<{
35
- id: typeof S.String;
36
- path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
37
- visible: S.optional<typeof S.Boolean>;
38
- size: S.optional<typeof S.Number>;
39
- referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
30
+ name: Schema.optional<typeof Schema.String>;
31
+ view: Schema.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
32
+ name: Schema.SchemaClass<string, string, never>;
33
+ query: Schema.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
34
+ schema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
35
+ fields: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
36
+ id: typeof Schema.String;
37
+ path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
38
+ visible: Schema.optional<typeof Schema.Boolean>;
39
+ size: Schema.optional<typeof Schema.Number>;
40
+ referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
40
41
  }>>>>;
41
- hiddenFields: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
42
- id: typeof S.String;
43
- path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
44
- visible: S.optional<typeof S.Boolean>;
45
- size: S.optional<typeof S.Number>;
46
- referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
42
+ hiddenFields: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
43
+ id: typeof Schema.String;
44
+ path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
45
+ visible: Schema.optional<typeof Schema.Boolean>;
46
+ size: Schema.optional<typeof Schema.Number>;
47
+ referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
47
48
  }>>>>>;
48
- metadata: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
49
+ metadata: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
49
50
  }, import("@dxos/echo-schema").TypedObjectOptions>>>;
50
- threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
51
- }>>;
52
- export interface TableType extends S.Schema.Type<typeof TableType> {
51
+ threads: Schema.optional<Schema.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
52
+ }>, {}>;
53
+ export interface TableType extends Schema.Schema.Type<typeof TableType> {
53
54
  }
54
55
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/types/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAc,OAAO,EAAoC,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAI7F,eAAO,MAAM,WAAW;;;;cAYI,EAAG,WAAW;eAC8K,EAAG,MAAM;gBAAmI,EAAG,QAAQ,CAAC,EAAE,MAAM;gBAAgJ,EAAG,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;uBAAqB,EAAG,MAAM;kBAAe,EAAG,MAAM;qBAA6C,EAAG,QAAQ,QAAO,EAAG,OAAO;kBAAgB,EAAG,QAAQ,QAAO,EAAG,MAAM;2BAAyB,EAAG,QAAQ,CAAC,EAAE,MAAM;;sBAAyQ,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;uBAAqB,EAAG,MAAM;kBAAe,EAAG,MAAM;qBAA6C,EAAG,QAAQ,QAAO,EAAG,OAAO;kBAAgB,EAAG,QAAQ,QAAO,EAAG,MAAM;2BAAyB,EAAG,QAAQ,CAAC,EAAE,MAAM;;kBAAgH,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,QAAO,EAAG,MAAM,SAAQ,EAAG,GAAG;;;EAJj8C,CAAC;AAEH,eAAO,MAAM,SAAS;;;;cACM,EAAG,WAAW;eAC8K,EAAG,MAAM;gBAAmI,EAAG,QAAQ,CAAC,EAAE,MAAM;gBAAgJ,EAAG,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;uBAAqB,EAAG,MAAM;kBAAe,EAAG,MAAM;qBAA6C,EAAG,QAAQ,QAAO,EAAG,OAAO;kBAAgB,EAAG,QAAQ,QAAO,EAAG,MAAM;2BAAyB,EAAG,QAAQ,CAAC,EAAE,MAAM;;sBAAyQ,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;uBAAqB,EAAG,MAAM;kBAAe,EAAG,MAAM;qBAA6C,EAAG,QAAQ,QAAO,EAAG,OAAO;kBAAgB,EAAG,QAAQ,QAAO,EAAG,MAAM;2BAAyB,EAAG,QAAQ,CAAC,EAAE,MAAM;;kBAAgH,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,QAAO,EAAG,MAAM,SAAQ,EAAG,GAAG;;;GAFv1C,CAAC;AAC7G,MAAM,WAAW,SAAU,SAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/types/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAoC,OAAO,EAAc,MAAM,mBAAmB,CAAC;AAG1F,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAStB,CAAC;AAGH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;OAKrB,CAAC;AACF,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG"}
@@ -1,4 +1,5 @@
1
- import type { BaseSchema, JsonSchemaType, SortDirectionType } from '@dxos/echo-schema';
1
+ import { type Schema } from 'effect';
2
+ import type { JsonSchemaType, SortDirectionType } from '@dxos/echo-schema';
2
3
  import { ViewProjection, type SchemaPropertyDefinition } from '@dxos/schema';
3
4
  import { TableType } from '../types';
4
5
  type PropertyDisplayProps = {
@@ -10,11 +11,11 @@ export type TablePropertyDefinition = SchemaPropertyDefinition & Partial<Propert
10
11
  /**
11
12
  * @deprecated
12
13
  */
13
- export declare const getBaseSchems: ({ typename, properties, jsonSchema, schema, }: {
14
+ export declare const getBaseSchema: ({ typename, properties, jsonSchema, schema, }: {
14
15
  typename?: string;
15
16
  properties?: TablePropertyDefinition[];
16
17
  jsonSchema?: JsonSchemaType;
17
- schema?: BaseSchema;
18
+ schema?: Schema.Schema.AnyNoContext;
18
19
  }) => {
19
20
  typename: string;
20
21
  jsonSchema: JsonSchemaType;
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../../../../src/util/dynamic-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvF,OAAO,EAGL,cAAc,EAEd,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE/F;;GAEG;AAEH,eAAO,MAAM,aAAa,kDAKvB;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,KAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAWjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,0CAI1B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACxC,KAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAkBjD,CAAC"}
1
+ {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../../../../src/util/dynamic-table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAGL,cAAc,EAEd,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE/F;;GAEG;AAEH,eAAO,MAAM,aAAa,GAAI,+CAK3B;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;CACrC,KAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAWjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,uCAI9B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACxC,KAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAkBjD,CAAC"}
@@ -3,4 +3,5 @@ export * from './signals';
3
3
  export * from './table';
4
4
  export * from './table-buttons';
5
5
  export * from './table-controls';
6
+ export * from './schema';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Schema } from 'effect';
2
+ /**
3
+ * Creates a narrowed schema from an original schema that only includes
4
+ * the specified paths. This allows form components to only display
5
+ * and edit/validate specific fields rather than the entire object.
6
+ *
7
+ * @param schema The original schema to narrow
8
+ * @param paths Array of field paths to extract
9
+ * @returns A narrowed Schema instance containing only the properties at the specified paths
10
+ */
11
+ export declare const narrowSchema: <S extends Schema.Schema.AnyNoContext>(schema: S, paths: string[]) => Schema.Schema<unknown, unknown> | undefined;
12
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/util/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,EAC/D,QAAQ,CAAC,EACT,OAAO,MAAM,EAAE,KACd,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAgBpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../../../src/util/signals.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,CAAC,MAAU,CAAC"}
1
+ {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../../../src/util/signals.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,OAAO,CAAC,MAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/G,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAE3G,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAwBX,eAAO,MAAM,aAAa,6CAKvB,mBAAmB,KAAG,MAQxB,CAAC;AAEF,eAAO,MAAM,WAAW,8CAA+D,iBAAiB,KAAG,MAQ1G,CAAC;AAEF,eAAO,MAAM,aAAa;;;oEApBvB,mBAAmB,KAAG,MAAM;+BAwBb,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,UAAU,CAAA;SAAE,CAAC;;;;qEAda,iBAAiB,KAAG,MAAM;+BAuB/F,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,QAAQ,CAAA;SAAE,CAAC;;CAM9D,CAAC"}
1
+ {"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/G,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAE3G,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAwBX,eAAO,MAAM,aAAa,GAAI,0CAK3B,mBAAmB,KAAG,MAQxB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,2CAA2D,iBAAiB,KAAG,MAQ1G,CAAC;AAEF,eAAO,MAAM,aAAa;;;oEApBvB,mBAAmB,KAAG,MAAM;+BAwBb,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,UAAU,CAAA;SAAE,CAAC;;;;qEAda,iBAAiB,KAAG,MAAM;+BAuB/F,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,QAAQ,CAAA;SAAE,CAAC;;CAM9D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { S } from '@dxos/echo-schema';
1
+ import { Schema } from 'effect';
2
2
  import { type Client } from '@dxos/react-client';
3
3
  import { type Space } from '@dxos/react-client/echo';
4
4
  import { type TableType } from '../types';
@@ -9,6 +9,6 @@ type InitialiseTableProps = {
9
9
  typename?: string;
10
10
  initialRow?: boolean;
11
11
  };
12
- export declare const initializeTable: ({ client, space, table, typename, initialRow, }: InitialiseTableProps) => Promise<S.Schema.AnyNoContext>;
12
+ export declare const initializeTable: ({ client, space, table, typename, initialRow, }: InitialiseTableProps) => Promise<Schema.Schema.AnyNoContext>;
13
13
  export {};
14
14
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAOL,CAAC,EAGF,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGpE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,oDAMzB,oBAAoB,KAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CA0CtD,CAAC"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAa,MAAM,QAAQ,CAAC;AAY3C,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAQ,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,iDAMnC,oBAAoB,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CA0C3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/util/tag.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAA6B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,MAAM,EAAE,GAAG,SAgBzD,CAAC"}
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/util/tag.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAA6B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,MAAM,EAAE,GAAG,SAgBzD,CAAC"}
@@ -1 +1 @@
1
- {"version":"5.7.3"}
1
+ {"version":"5.8.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-table",
3
- "version": "0.8.2-main.f11618f",
3
+ "version": "0.8.2-main.fbd8ed0",
4
4
  "description": "A table component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -51,31 +51,32 @@
51
51
  "@radix-ui/react-slot": "1.1.2",
52
52
  "@radix-ui/react-use-controllable-state": "1.1.0",
53
53
  "date-fns": "^3.3.1",
54
+ "effect": "3.14.21",
54
55
  "lodash.orderby": "^4.6.0",
55
- "@dxos/debug": "0.8.2-main.f11618f",
56
- "@dxos/echo-schema": "0.8.2-main.f11618f",
57
- "@dxos/invariant": "0.8.2-main.f11618f",
58
- "@dxos/effect": "0.8.2-main.f11618f",
59
- "@dxos/keys": "0.8.2-main.f11618f",
60
- "@dxos/lit-grid": "0.8.2-main.f11618f",
61
- "@dxos/context": "0.8.2-main.f11618f",
62
- "@dxos/live-object": "0.8.2-main.f11618f",
63
- "@dxos/plugin-space": "0.8.2-main.f11618f",
64
- "@dxos/plugin-search": "0.8.2-main.f11618f",
65
- "@dxos/react-client": "0.8.2-main.f11618f",
66
- "@dxos/log": "0.8.2-main.f11618f",
67
- "@dxos/react-ui-attention": "0.8.2-main.f11618f",
68
- "@dxos/react-ui-editor": "0.8.2-main.f11618f",
69
- "@dxos/react-ui-form": "0.8.2-main.f11618f",
70
- "@dxos/react-ui-menu": "0.8.2-main.f11618f",
71
- "@dxos/react-ui-syntax-highlighter": "0.8.2-main.f11618f",
72
- "@dxos/react-ui-searchlist": "0.8.2-main.f11618f",
73
- "@dxos/react-ui-grid": "0.8.2-main.f11618f",
74
- "@dxos/react-ui-stack": "0.8.2-main.f11618f",
75
- "@dxos/react-ui-tag-picker": "0.8.2-main.f11618f",
76
- "@dxos/react-ui-types": "0.8.2-main.f11618f",
77
- "@dxos/schema": "0.8.2-main.f11618f",
78
- "@dxos/util": "0.8.2-main.f11618f"
56
+ "@dxos/debug": "0.8.2-main.fbd8ed0",
57
+ "@dxos/context": "0.8.2-main.fbd8ed0",
58
+ "@dxos/invariant": "0.8.2-main.fbd8ed0",
59
+ "@dxos/echo-schema": "0.8.2-main.fbd8ed0",
60
+ "@dxos/keys": "0.8.2-main.fbd8ed0",
61
+ "@dxos/effect": "0.8.2-main.fbd8ed0",
62
+ "@dxos/lit-grid": "0.8.2-main.fbd8ed0",
63
+ "@dxos/live-object": "0.8.2-main.fbd8ed0",
64
+ "@dxos/log": "0.8.2-main.fbd8ed0",
65
+ "@dxos/plugin-search": "0.8.2-main.fbd8ed0",
66
+ "@dxos/plugin-space": "0.8.2-main.fbd8ed0",
67
+ "@dxos/react-client": "0.8.2-main.fbd8ed0",
68
+ "@dxos/react-ui-attention": "0.8.2-main.fbd8ed0",
69
+ "@dxos/react-ui-editor": "0.8.2-main.fbd8ed0",
70
+ "@dxos/react-ui-form": "0.8.2-main.fbd8ed0",
71
+ "@dxos/react-ui-menu": "0.8.2-main.fbd8ed0",
72
+ "@dxos/react-ui-grid": "0.8.2-main.fbd8ed0",
73
+ "@dxos/react-ui-searchlist": "0.8.2-main.fbd8ed0",
74
+ "@dxos/react-ui-syntax-highlighter": "0.8.2-main.fbd8ed0",
75
+ "@dxos/react-ui-tag-picker": "0.8.2-main.fbd8ed0",
76
+ "@dxos/react-ui-types": "0.8.2-main.fbd8ed0",
77
+ "@dxos/react-ui-stack": "0.8.2-main.fbd8ed0",
78
+ "@dxos/schema": "0.8.2-main.fbd8ed0",
79
+ "@dxos/util": "0.8.2-main.fbd8ed0"
79
80
  },
80
81
  "devDependencies": {
81
82
  "@phosphor-icons/react": "^2.1.5",
@@ -86,19 +87,19 @@
86
87
  "react": "~18.2.0",
87
88
  "react-dom": "~18.2.0",
88
89
  "vite": "5.4.7",
89
- "@dxos/echo-signals": "0.8.2-main.f11618f",
90
- "@dxos/random": "0.8.2-main.f11618f",
91
- "@dxos/react-ui": "0.8.2-main.f11618f",
92
- "@dxos/react-ui-theme": "0.8.2-main.f11618f",
93
- "@dxos/storybook-utils": "0.8.2-main.f11618f",
94
- "@dxos/test-utils": "0.8.2-main.f11618f"
90
+ "@dxos/random": "0.8.2-main.fbd8ed0",
91
+ "@dxos/echo-signals": "0.8.2-main.fbd8ed0",
92
+ "@dxos/react-ui": "0.8.2-main.fbd8ed0",
93
+ "@dxos/react-ui-theme": "0.8.2-main.fbd8ed0",
94
+ "@dxos/test-utils": "0.8.2-main.fbd8ed0",
95
+ "@dxos/storybook-utils": "0.8.2-main.fbd8ed0"
95
96
  },
96
97
  "peerDependencies": {
97
98
  "@phosphor-icons/react": "^2.1.5",
98
99
  "react": "~18.2.0",
99
100
  "react-dom": "~18.2.0",
100
- "@dxos/react-ui": "0.8.2-main.f11618f",
101
- "@dxos/react-ui-theme": "0.8.2-main.f11618f"
101
+ "@dxos/react-ui": "0.8.2-main.fbd8ed0",
102
+ "@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
102
103
  },
103
104
  "publishConfig": {
104
105
  "access": "public"
@@ -2,9 +2,9 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  import React, { useCallback, useMemo } from 'react';
6
7
 
7
- import { S } from '@dxos/echo-schema';
8
8
  import { live } from '@dxos/react-client/echo';
9
9
  import { Popover } from '@dxos/react-ui';
10
10
  import { Form } from '@dxos/react-ui-form';
@@ -20,14 +20,14 @@ export const CreateRefPanel = ({ model, modals, __gridScope }: GridScopedProps<C
20
20
  const space = model?.space;
21
21
  const state = modals.state.value;
22
22
 
23
- const schema = useMemo<S.Schema<any> | undefined>(() => {
23
+ const schema = useMemo<Schema.Schema<any> | undefined>(() => {
24
24
  if (!space || state?.type !== 'createRefPanel') {
25
25
  return;
26
26
  }
27
27
 
28
28
  const [schema] = space.db.schemaRegistry.query({ typename: state.typename }).runSync();
29
29
  if (schema) {
30
- const omit = S.omit<any, any, ['id']>('id');
30
+ const omit = Schema.omit<any, any, ['id']>('id');
31
31
  return omit(schema);
32
32
  }
33
33
  }, [space, state]);
@@ -59,7 +59,7 @@ const meta: Meta = {
59
59
  title: 'ui/react-ui-table/DynamicTable',
60
60
  component: DynamicTable,
61
61
  parameters: { translations },
62
- decorators: [withTheme, withLayout({ fullscreen: true, tooltips: true })],
62
+ decorators: [withLayout({ fullscreen: true }), withTheme],
63
63
  };
64
64
 
65
65
  export default meta;
@@ -128,7 +128,7 @@ export const WithEchoSchema: StoryObj = {
128
128
  const client = useClient();
129
129
  const { space } = useClientProvider();
130
130
  const schema = useSchema(client, space, Testing.Contact.typename);
131
- const objects = useQuery(space, schema ? Filter.schema(schema) : Filter.nothing());
131
+ const objects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
132
132
  if (!schema) {
133
133
  return <div>Loading schema...</div>;
134
134
  }
@@ -2,23 +2,24 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { type Schema } from 'effect';
5
6
  import React, { useRef, useMemo, useCallback } from 'react';
6
7
 
7
- import { type BaseSchema, type JsonSchemaType } from '@dxos/echo-schema';
8
+ import { type JsonSchemaType } from '@dxos/echo-schema';
8
9
  import { type ThemedClassName, useDefaultValue } from '@dxos/react-ui';
9
10
  import { mx } from '@dxos/react-ui-theme';
10
11
 
11
12
  import { Table, type TableController } from './Table';
12
13
  import { useTableModel } from '../../hooks';
13
14
  import { type TableFeatures, TablePresentation, type TableRowAction } from '../../model';
14
- import { getBaseSchems as getBaseSchema, makeDynamicTable, type TablePropertyDefinition } from '../../util';
15
+ import { getBaseSchema, makeDynamicTable, type TablePropertyDefinition } from '../../util';
15
16
 
16
17
  type DynamicTableProps = ThemedClassName<{
17
18
  name?: string; // TODO(burdon): Remove?
18
19
  rows: any[];
19
20
  properties?: TablePropertyDefinition[];
20
21
  jsonSchema?: JsonSchemaType;
21
- schema?: BaseSchema;
22
+ schema?: Schema.Schema.AnyNoContext;
22
23
  features?: Partial<TableFeatures>;
23
24
  rowActions?: TableRowAction[];
24
25
  onRowClick?: (row: any) => void;
@@ -27,8 +28,6 @@ type DynamicTableProps = ThemedClassName<{
27
28
 
28
29
  /**
29
30
  * Properties define both the schema and display characteristics of the table columns.
30
- *
31
- * @deprecated Use Table.
32
31
  */
33
32
  // TODO(burdon): Instead of creating component variants, create helpers/hooks that normalize the props.
34
33
  // TODO(burdon): Warning: Cannot update a component (`DynamicTable`) while rendering a different component (`DynamicTable`).
@@ -5,9 +5,17 @@
5
5
  import '@dxos-theme';
6
6
 
7
7
  import { type StoryObj, type Meta } from '@storybook/react';
8
+ import { Schema } from 'effect';
8
9
  import React, { useCallback, useMemo, useRef } from 'react';
9
10
 
10
- import { FormatEnum, ImmutableSchema } from '@dxos/echo-schema';
11
+ import {
12
+ assertEchoSchema,
13
+ FormatEnum,
14
+ isMutable,
15
+ toJsonSchema,
16
+ EchoObject,
17
+ GeneratorAnnotationId,
18
+ } from '@dxos/echo-schema';
11
19
  import { invariant } from '@dxos/invariant';
12
20
  import { useGlobalFilteredObjects } from '@dxos/plugin-search';
13
21
  import { faker } from '@dxos/random';
@@ -28,8 +36,7 @@ import { TableType } from '../../types';
28
36
  import { initializeTable } from '../../util';
29
37
  import { TableToolbar } from '../TableToolbar';
30
38
 
31
- // NOTE(ZaymonFC): We rely on this seed being 0 in the smoke tests.
32
- faker.seed(0);
39
+ faker.seed(0); // NOTE(ZaymonFC): Required for smoke tests.
33
40
 
34
41
  /**
35
42
  * Custom hook to create and manage a test table model for storybook demonstrations.
@@ -39,14 +46,14 @@ const useTestTableModel = () => {
39
46
  const client = useClient();
40
47
  const { space } = useClientProvider();
41
48
 
42
- const filter = useMemo(() => Filter.schema(TableType), []);
49
+ const filter = useMemo(() => Filter.type(TableType), []);
43
50
  const tables = useQuery(space, filter);
44
51
  const table = useMemo(() => tables.at(0), [tables]);
45
52
  const schema = useSchema(client, space, table?.view?.target?.query.typename);
46
53
 
47
54
  const projection = useMemo(() => {
48
55
  if (schema && table?.view?.target) {
49
- return new ViewProjection(schema.jsonSchema, table.view.target);
56
+ return new ViewProjection(toJsonSchema(schema), table.view.target);
50
57
  }
51
58
  }, [schema, table?.view?.target]);
52
59
 
@@ -54,12 +61,12 @@ const useTestTableModel = () => {
54
61
  () => ({
55
62
  selection: { enabled: true, mode: 'multiple' as const },
56
63
  dataEditable: true,
57
- schemaEditable: !(schema instanceof ImmutableSchema),
64
+ schemaEditable: schema && isMutable(schema),
58
65
  }),
59
66
  [schema],
60
67
  );
61
68
 
62
- const objects = useQuery(space, schema ? Filter.schema(schema) : Filter.nothing());
69
+ const objects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
63
70
  const filteredObjects = useGlobalFilteredObjects(objects);
64
71
 
65
72
  const tableRef = useRef<TableController>(null);
@@ -151,11 +158,10 @@ const StoryViewEditor = () => {
151
158
 
152
159
  const handleTypenameChanged = useCallback(
153
160
  (typename: string) => {
154
- if (table?.view?.target) {
155
- invariant(schema);
156
- schema.mutable.updateTypename(typename);
157
- table.view.target.query.typename = typename;
158
- }
161
+ invariant(schema);
162
+ invariant(table?.view?.target);
163
+ assertEchoSchema(schema).updateTypename(typename);
164
+ table.view.target.query.typename = typename;
159
165
  },
160
166
  [schema, table?.view?.target],
161
167
  );
@@ -191,7 +197,7 @@ const DefaultStory = () => {
191
197
  <div className='grid grid-rows-[min-content_1fr] min-bs-0 overflow-hidden'>
192
198
  <TableToolbar classNames='border-be border-separator' onAction={handleToolbarAction} />
193
199
  <Table.Root>
194
- <Table.Main ref={tableRef} model={model} presentation={presentation} ignoreAttention />
200
+ <Table.Main ref={tableRef} model={model} presentation={presentation} schema={schema} ignoreAttention />
195
201
  </Table.Root>
196
202
  </div>
197
203
  <div className='flex flex-col h-full border-l border-separator overflow-y-auto'>
@@ -233,8 +239,8 @@ const meta: Meta<StoryProps> = {
233
239
  });
234
240
  },
235
241
  }),
242
+ withLayout({ fullscreen: true }),
236
243
  withTheme,
237
- withLayout({ fullscreen: true, tooltips: true }),
238
244
  ],
239
245
  };
240
246
 
@@ -252,17 +258,57 @@ export const StaticSchema: StoryObj = {
252
258
  createSpace: true,
253
259
  onSpaceCreated: async ({ client, space }) => {
254
260
  const table = space.db.add(live(TableType, {}));
255
- await initializeTable({ client, space, table, typename: Testing.Contact.typename });
261
+ await initializeTable({ client, space, table, typename: Testing.Organization.typename });
262
+
263
+ const factory = createObjectFactory(space.db, faker as any);
264
+ await factory([
265
+ // { type: Testing.Contact, count: 10 },
266
+ // { type: Testing.Organization, count: 1 },
267
+ { type: ContactWithArrayOfEmails, count: 10 },
268
+ ]);
269
+ },
270
+ }),
271
+ withLayout({ fullscreen: true }),
272
+ withTheme,
273
+ ],
274
+ };
275
+
276
+ const ContactWithArrayOfEmails = Schema.Struct({
277
+ name: Schema.String.annotations({
278
+ [GeneratorAnnotationId]: 'person.fullName',
279
+ }),
280
+ emails: Schema.optional(
281
+ Schema.Array(
282
+ Schema.Struct({
283
+ value: Schema.String,
284
+ label: Schema.String.pipe(Schema.optional),
285
+ }),
286
+ ),
287
+ ),
288
+ }).pipe(EchoObject({ typename: 'dxos.org/type/ContactWithArrayOfEmails', version: '0.1.0' }));
289
+
290
+ export const ArrayOfObjects: StoryObj = {
291
+ render: DefaultStory,
292
+ parameters: { translations },
293
+ decorators: [
294
+ withClientProvider({
295
+ types: [TableType, ViewType, Testing.Contact, Testing.Organization, ContactWithArrayOfEmails],
296
+ createIdentity: true,
297
+ createSpace: true,
298
+ onSpaceCreated: async ({ client, space }) => {
299
+ const table = space.db.add(live(TableType, {}));
300
+ await initializeTable({ client, space, table, typename: ContactWithArrayOfEmails.typename });
256
301
 
257
302
  const factory = createObjectFactory(space.db, faker as any);
258
303
  await factory([
259
- { type: Testing.Contact, count: 10 },
260
- { type: Testing.Organization, count: 1 },
304
+ // { type: Testing.Contact, count: 10 },
305
+ // { type: Testing.Organization, count: 1 },
306
+ { type: ContactWithArrayOfEmails, count: 10 },
261
307
  ]);
262
308
  },
263
309
  }),
310
+ withLayout({ fullscreen: true }),
264
311
  withTheme,
265
- withLayout({ fullscreen: true, tooltips: true }),
266
312
  ],
267
313
  };
268
314
 
@@ -317,7 +363,7 @@ export const Tags: Meta<StoryProps> = {
317
363
  });
318
364
  },
319
365
  }),
366
+ withLayout({ fullscreen: true }),
320
367
  withTheme,
321
- withLayout({ fullscreen: true, tooltips: true }),
322
368
  ],
323
369
  };
@@ -2,6 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { type Schema } from 'effect/Schema';
5
6
  import React, {
6
7
  type MouseEvent,
7
8
  type PropsWithChildren,
@@ -40,7 +41,7 @@ import { RowActionsMenu } from './RowActionsMenu';
40
41
  import { ModalController, type TableModel, type TablePresentation } from '../../model';
41
42
  import { translationKey } from '../../translations';
42
43
  import { tableButtons, tableControls } from '../../util';
43
- import { createOption, TableCellEditor, type TableCellEditorProps } from '../TableCellEditor';
44
+ import { createOption, TableValueEditor, type TableCellEditorProps } from '../TableCellEditor';
44
45
 
45
46
  //
46
47
  // Table.Root
@@ -75,13 +76,14 @@ export type TableController = {
75
76
  export type TableMainProps = {
76
77
  model?: TableModel;
77
78
  presentation?: TablePresentation;
79
+ schema?: Schema.AnyNoContext;
78
80
  // TODO(burdon): Rename since attention isn't a useful concept here? Standardize across other components. Pass property into useAttention.
79
81
  ignoreAttention?: boolean;
80
82
  onRowClick?: (row: any) => void;
81
83
  };
82
84
 
83
85
  const TableMain = forwardRef<TableController, TableMainProps>(
84
- ({ model, presentation, ignoreAttention, onRowClick }, forwardedRef) => {
86
+ ({ model, presentation, ignoreAttention, schema, onRowClick }, forwardedRef) => {
85
87
  const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);
86
88
  const { hasAttention } = useAttention(model?.id ?? 'table');
87
89
  const { t } = useTranslation(translationKey);
@@ -307,7 +309,7 @@ const TableMain = forwardRef<TableController, TableMainProps>(
307
309
  invariant(space);
308
310
  const schema = space.db.schemaRegistry.getSchema(props.referenceSchema);
309
311
  if (schema) {
310
- const { objects } = await space.db.query(Filter.schema(schema)).run();
312
+ const { objects } = await space.db.query(Filter.type(schema)).run();
311
313
  const options = objects
312
314
  .map((obj) => {
313
315
  const value = getValue(obj, field.referencePath!);
@@ -343,15 +345,16 @@ const TableMain = forwardRef<TableController, TableMainProps>(
343
345
 
344
346
  return (
345
347
  <Grid.Root id={model.id ?? 'table-grid'}>
346
- <TableCellEditor
348
+ <TableValueEditor
347
349
  model={model}
348
350
  modals={modals}
351
+ schema={schema}
349
352
  onEnter={handleEnter}
350
353
  onFocus={handleFocus}
351
354
  onQuery={handleQuery}
352
355
  />
353
356
  <Grid.Content
354
- className={mx('[--dx-grid-base:var(--surface-bg)]', gridSeparatorInlineEnd, gridSeparatorBlockEnd)}
357
+ className={mx('[--dx-grid-base:var(--baseSurface)]', gridSeparatorInlineEnd, gridSeparatorBlockEnd)}
355
358
  frozen={frozen}
356
359
  // getCells={getCells}
357
360
  columns={model.columnMeta.value}