@dxos/react-ui-table 0.8.2-main.f081794 → 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 (91) 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 +323 -174
  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 +302 -156
  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 +323 -174
  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-buttons.d.ts +0 -14
  56. package/dist/types/src/util/table-buttons.d.ts.map +1 -1
  57. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  58. package/dist/types/src/util/table.d.ts +2 -2
  59. package/dist/types/src/util/table.d.ts.map +1 -1
  60. package/dist/types/src/util/tag.d.ts +11 -0
  61. package/dist/types/src/util/tag.d.ts.map +1 -0
  62. package/dist/types/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +34 -33
  64. package/src/components/Table/CreateRefPanel.tsx +3 -3
  65. package/src/components/Table/DynamicTable.stories.tsx +2 -2
  66. package/src/components/Table/DynamicTable.tsx +4 -5
  67. package/src/components/Table/Table.stories.tsx +66 -20
  68. package/src/components/Table/Table.tsx +25 -28
  69. package/src/components/Table/relations.stories.tsx +37 -30
  70. package/src/components/TableCellEditor/FormCellEditor.tsx +94 -0
  71. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +8 -7
  72. package/src/components/TableCellEditor/TableCellEditor.tsx +45 -4
  73. package/src/components/TableToolbar/TableToolbar.tsx +10 -11
  74. package/src/components/testing.ts +7 -6
  75. package/src/model/table-model.test.ts +4 -3
  76. package/src/model/table-model.ts +17 -0
  77. package/src/model/table-presentation.test.ts +4 -3
  78. package/src/model/table-presentation.ts +54 -10
  79. package/src/types/table.ts +15 -7
  80. package/src/util/dynamic-table.ts +7 -4
  81. package/src/util/index.ts +1 -0
  82. package/src/util/schema.ts +36 -0
  83. package/src/util/table-buttons.ts +0 -23
  84. package/src/util/table.ts +12 -15
  85. package/src/util/tag.ts +33 -0
  86. package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +0 -7
  87. package/dist/lib/node/chunk-TGG6OZ54.cjs.map +0 -7
  88. package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +0 -7
  89. package/dist/types/src/components/Table/RefPanel.d.ts +0 -9
  90. package/dist/types/src/components/Table/RefPanel.d.ts.map +0 -1
  91. package/src/components/Table/RefPanel.tsx +0 -52
@@ -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;IA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AC3B,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"}
@@ -8,10 +8,6 @@ type ButtonData = {
8
8
  } | {
9
9
  type: 'newColumn';
10
10
  disabled?: boolean;
11
- } | {
12
- type: 'referencedCell';
13
- schemaId: string;
14
- targetId: string;
15
11
  } | {
16
12
  type: 'rowMenu';
17
13
  rowIndex: number;
@@ -41,16 +37,6 @@ export declare const tableButtons: {
41
37
  type: "columnSettings";
42
38
  }>;
43
39
  };
44
- readonly referencedCell: {
45
- readonly attr: string;
46
- readonly icon: "ph--link-simple-horizontal--regular";
47
- readonly render: ({ targetId, schemaId }: Omit<Extract<ButtonData, {
48
- type: "referencedCell";
49
- }>, "type">) => string;
50
- readonly getData: (el: HTMLElement) => Extract<ButtonData, {
51
- type: "referencedCell";
52
- }>;
53
- };
54
40
  readonly rowMenu: {
55
41
  readonly attr: string;
56
42
  readonly icon: "ph--dots-three--regular";
@@ -1 +1 @@
1
- {"version":3,"file":"table-buttons.d.ts","sourceRoot":"","sources":["../../../../src/util/table-buttons.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAEjG,eAAO,MAAM,kBAAkB,EAAE;KAAG,CAA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,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,CA8CtD,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"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Regex pattern for matching tags in the format [Label](id)
3
+ */
4
+ export declare const TAG_PATTERN_REGEX: RegExp;
5
+ /**
6
+ * Extracts tag IDs from a string in the format [Label](id)
7
+ * @param value The string to extract IDs from
8
+ * @returns Array of extracted IDs or undefined if no matches or value is not a string
9
+ */
10
+ export declare const extractTagIds: (value: unknown) => string[] | undefined;
11
+ //# sourceMappingURL=tag.d.ts.map
@@ -0,0 +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,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.f081794",
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/context": "0.8.2-main.f081794",
56
- "@dxos/echo-schema": "0.8.2-main.f081794",
57
- "@dxos/effect": "0.8.2-main.f081794",
58
- "@dxos/keys": "0.8.2-main.f081794",
59
- "@dxos/lit-grid": "0.8.2-main.f081794",
60
- "@dxos/invariant": "0.8.2-main.f081794",
61
- "@dxos/live-object": "0.8.2-main.f081794",
62
- "@dxos/log": "0.8.2-main.f081794",
63
- "@dxos/plugin-search": "0.8.2-main.f081794",
64
- "@dxos/plugin-space": "0.8.2-main.f081794",
65
- "@dxos/react-client": "0.8.2-main.f081794",
66
- "@dxos/debug": "0.8.2-main.f081794",
67
- "@dxos/react-ui-form": "0.8.2-main.f081794",
68
- "@dxos/react-ui-attention": "0.8.2-main.f081794",
69
- "@dxos/react-ui-editor": "0.8.2-main.f081794",
70
- "@dxos/react-ui-grid": "0.8.2-main.f081794",
71
- "@dxos/react-ui-searchlist": "0.8.2-main.f081794",
72
- "@dxos/react-ui-stack": "0.8.2-main.f081794",
73
- "@dxos/react-ui-syntax-highlighter": "0.8.2-main.f081794",
74
- "@dxos/react-ui-menu": "0.8.2-main.f081794",
75
- "@dxos/react-ui-tag-picker": "0.8.2-main.f081794",
76
- "@dxos/react-ui-types": "0.8.2-main.f081794",
77
- "@dxos/schema": "0.8.2-main.f081794",
78
- "@dxos/util": "0.8.2-main.f081794"
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.f081794",
90
- "@dxos/random": "0.8.2-main.f081794",
91
- "@dxos/react-ui-theme": "0.8.2-main.f081794",
92
- "@dxos/storybook-utils": "0.8.2-main.f081794",
93
- "@dxos/test-utils": "0.8.2-main.f081794",
94
- "@dxos/react-ui": "0.8.2-main.f081794"
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.f081794",
101
- "@dxos/react-ui-theme": "0.8.2-main.f081794"
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
 
@@ -247,22 +253,62 @@ export const StaticSchema: StoryObj = {
247
253
  parameters: { translations },
248
254
  decorators: [
249
255
  withClientProvider({
250
- types: [TableType, ViewType, Testing.Contact, Testing.Org],
256
+ types: [TableType, ViewType, Testing.Contact, Testing.Organization],
257
+ createIdentity: true,
258
+ createSpace: true,
259
+ onSpaceCreated: async ({ client, space }) => {
260
+ const table = space.db.add(live(TableType, {}));
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],
251
296
  createIdentity: true,
252
297
  createSpace: true,
253
298
  onSpaceCreated: async ({ client, space }) => {
254
299
  const table = space.db.add(live(TableType, {}));
255
- await initializeTable({ client, space, table, typename: Testing.Contact.typename });
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.Org, 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
  };