@dxos/react-ui-table 0.8.4-main.67995b8 → 0.8.4-main.70d3990

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 (143) hide show
  1. package/dist/lib/browser/chunk-5XWSB3JP.mjs +71 -0
  2. package/dist/lib/browser/chunk-5XWSB3JP.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-5XLSHLOG.mjs → chunk-KNC7XYT6.mjs} +573 -541
  4. package/dist/lib/browser/chunk-KNC7XYT6.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +625 -698
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/testing/index.mjs +16 -24
  9. package/dist/lib/browser/testing/index.mjs.map +3 -3
  10. package/dist/lib/browser/types/index.mjs +3 -3
  11. package/dist/lib/node-esm/{chunk-Y66YLSTC.mjs → chunk-CWSGS3Y2.mjs} +573 -541
  12. package/dist/lib/node-esm/chunk-CWSGS3Y2.mjs.map +7 -0
  13. package/dist/lib/node-esm/chunk-MKTMOY46.mjs +72 -0
  14. package/dist/lib/node-esm/chunk-MKTMOY46.mjs.map +7 -0
  15. package/dist/lib/node-esm/index.mjs +625 -698
  16. package/dist/lib/node-esm/index.mjs.map +4 -4
  17. package/dist/lib/node-esm/meta.json +1 -1
  18. package/dist/lib/node-esm/testing/index.mjs +16 -24
  19. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  20. package/dist/lib/node-esm/types/index.mjs +3 -3
  21. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +1 -1
  22. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
  23. package/dist/types/src/components/Table/ColumnSettings.d.ts +1 -1
  24. package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
  25. package/dist/types/src/components/Table/DynamicTable.d.ts +2 -2
  26. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
  27. package/dist/types/src/components/Table/DynamicTable.stories.d.ts +51 -3
  28. package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Table/Relations.stories.d.ts +108 -0
  30. package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -0
  31. package/dist/types/src/components/Table/RowActionsMenu.d.ts +1 -1
  32. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  33. package/dist/types/src/components/Table/Table.d.ts +8 -4
  34. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  35. package/dist/types/src/components/Table/Table.stories.d.ts +105 -4
  36. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
  38. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +12 -6
  39. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
  40. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +12 -17
  41. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  42. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +39 -4
  43. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  44. package/dist/types/src/components/TableCellEditor/index.d.ts +1 -0
  45. package/dist/types/src/components/TableCellEditor/index.d.ts.map +1 -1
  46. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -2
  47. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  48. package/dist/types/src/components/testing.d.ts +3 -5
  49. package/dist/types/src/components/testing.d.ts.map +1 -1
  50. package/dist/types/src/hooks/index.d.ts +2 -1
  51. package/dist/types/src/hooks/index.d.ts.map +1 -1
  52. package/dist/types/src/hooks/useAddRow.d.ts +3 -2
  53. package/dist/types/src/hooks/useAddRow.d.ts.map +1 -1
  54. package/dist/types/src/hooks/useProjectionModel.d.ts +5 -0
  55. package/dist/types/src/hooks/useProjectionModel.d.ts.map +1 -0
  56. package/dist/types/src/hooks/useTableModel.d.ts +5 -6
  57. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  58. package/dist/types/src/model/modal-controller.d.ts +0 -7
  59. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  60. package/dist/types/src/model/selection-model.d.ts.map +1 -1
  61. package/dist/types/src/model/table-model.d.ts +14 -14
  62. package/dist/types/src/model/table-model.d.ts.map +1 -1
  63. package/dist/types/src/model/table-presentation.d.ts +2 -1
  64. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  65. package/dist/types/src/model/table-sorting.d.ts +9 -6
  66. package/dist/types/src/model/table-sorting.d.ts.map +1 -1
  67. package/dist/types/src/playwright/TableManager.d.ts +1 -1
  68. package/dist/types/src/playwright/TableManager.d.ts.map +1 -1
  69. package/dist/types/src/testing/useTestTableModel.d.ts +21 -34
  70. package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
  71. package/dist/types/src/translations.d.ts +2 -2
  72. package/dist/types/src/types/Table.d.ts +28 -0
  73. package/dist/types/src/types/Table.d.ts.map +1 -0
  74. package/dist/types/src/types/index.d.ts +1 -1
  75. package/dist/types/src/types/index.d.ts.map +1 -1
  76. package/dist/types/src/util/dynamic-table.d.ts +9 -9
  77. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  78. package/dist/types/src/util/index.d.ts +0 -1
  79. package/dist/types/src/util/index.d.ts.map +1 -1
  80. package/dist/types/src/util/schema.d.ts +1 -1
  81. package/dist/types/src/util/schema.d.ts.map +1 -1
  82. package/dist/types/src/util/table-buttons.d.ts.map +1 -1
  83. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  84. package/dist/types/tsconfig.tsbuildinfo +1 -1
  85. package/package.json +61 -59
  86. package/src/components/Table/ColumnActionsMenu.tsx +1 -1
  87. package/src/components/Table/ColumnSettings.tsx +1 -1
  88. package/src/components/Table/DynamicTable.stories.tsx +21 -17
  89. package/src/components/Table/DynamicTable.tsx +19 -13
  90. package/src/components/Table/Relations.stories.tsx +237 -0
  91. package/src/components/Table/RowActionsMenu.tsx +23 -15
  92. package/src/components/Table/Table.stories.tsx +103 -86
  93. package/src/components/Table/Table.tsx +140 -115
  94. package/src/components/TableCellEditor/CellValidationMessage.tsx +1 -1
  95. package/src/components/TableCellEditor/FormCellEditor.tsx +153 -42
  96. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +28 -66
  97. package/src/components/TableCellEditor/TableCellEditor.tsx +75 -225
  98. package/src/components/TableCellEditor/index.ts +1 -0
  99. package/src/components/TableToolbar/TableToolbar.tsx +34 -24
  100. package/src/components/testing.ts +4 -4
  101. package/src/hooks/index.ts +2 -1
  102. package/src/hooks/useAddRow.ts +7 -5
  103. package/src/hooks/useProjectionModel.ts +19 -0
  104. package/src/hooks/useTableModel.ts +12 -14
  105. package/src/model/modal-controller.ts +1 -29
  106. package/src/model/selection-model.ts +3 -2
  107. package/src/model/table-model.test.ts +21 -12
  108. package/src/model/table-model.ts +62 -56
  109. package/src/model/table-presentation.test.ts +25 -23
  110. package/src/model/table-presentation.ts +82 -41
  111. package/src/model/table-sorting.ts +32 -14
  112. package/src/playwright/TableManager.ts +3 -3
  113. package/src/playwright/smoke.spec.ts +132 -38
  114. package/src/testing/useTestTableModel.ts +34 -22
  115. package/src/translations.ts +2 -2
  116. package/src/types/Table.ts +89 -0
  117. package/src/types/index.ts +1 -1
  118. package/src/util/dynamic-table.ts +20 -24
  119. package/src/util/index.ts +0 -1
  120. package/src/util/schema.ts +4 -4
  121. package/src/util/table-buttons.ts +4 -3
  122. package/src/util/table-controls.ts +4 -1
  123. package/dist/lib/browser/chunk-5XLSHLOG.mjs.map +0 -7
  124. package/dist/lib/browser/chunk-L2LSB6KV.mjs +0 -18
  125. package/dist/lib/browser/chunk-L2LSB6KV.mjs.map +0 -7
  126. package/dist/lib/node-esm/chunk-NXZ4CJYX.mjs +0 -20
  127. package/dist/lib/node-esm/chunk-NXZ4CJYX.mjs.map +0 -7
  128. package/dist/lib/node-esm/chunk-Y66YLSTC.mjs.map +0 -7
  129. package/dist/types/src/components/Table/CreateRefPanel.d.ts +0 -9
  130. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +0 -1
  131. package/dist/types/src/components/Table/relations.stories.d.ts +0 -9
  132. package/dist/types/src/components/Table/relations.stories.d.ts.map +0 -1
  133. package/dist/types/src/components/TableCellEditor/extension.d.ts +0 -13
  134. package/dist/types/src/components/TableCellEditor/extension.d.ts.map +0 -1
  135. package/dist/types/src/types/schema.d.ts +0 -8
  136. package/dist/types/src/types/schema.d.ts.map +0 -1
  137. package/dist/types/src/util/table.d.ts +0 -11
  138. package/dist/types/src/util/table.d.ts.map +0 -1
  139. package/src/components/Table/CreateRefPanel.tsx +0 -86
  140. package/src/components/Table/relations.stories.tsx +0 -116
  141. package/src/components/TableCellEditor/extension.ts +0 -61
  142. package/src/types/schema.ts +0 -16
  143. package/src/util/table.ts +0 -49
@@ -2,45 +2,37 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type StoryObj, type Meta } from '@storybook/react-vite';
8
- import { Schema } from 'effect';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Schema from 'effect/Schema';
9
7
  import React, { useCallback } from 'react';
10
8
 
11
- import { Obj, Type } from '@dxos/echo';
12
- import {
13
- FormatEnum,
14
- EchoObject,
15
- GeneratorAnnotation,
16
- FormatAnnotation,
17
- PropertyMetaAnnotationId,
18
- } from '@dxos/echo-schema';
9
+ import { Annotation, Format, Obj, type QueryAST, Type } from '@dxos/echo';
10
+ import { PropertyMetaAnnotationId } from '@dxos/echo/internal';
19
11
  import { invariant } from '@dxos/invariant';
20
12
  import { faker } from '@dxos/random';
21
13
  import { PublicKey } from '@dxos/react-client';
22
- import { live, type Space } from '@dxos/react-client/echo';
14
+ import { type Space } from '@dxos/react-client/echo';
23
15
  import { withClientProvider } from '@dxos/react-client/testing';
24
- import { ViewEditor } from '@dxos/react-ui-form';
16
+ import { withTheme } from '@dxos/react-ui/testing';
17
+ import { ViewEditor, translations as formTranslations } from '@dxos/react-ui-form';
25
18
  import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
26
- import { getSchemaFromPropertyDefinitions, DataType } from '@dxos/schema';
27
- import { Testing, createObjectFactory } from '@dxos/schema/testing';
28
- import { withLayout, withTheme } from '@dxos/storybook-utils';
19
+ import { View, getSchemaFromPropertyDefinitions, getTypenameFromQuery } from '@dxos/schema';
20
+ import { TestSchema, createObjectFactory } from '@dxos/schema/testing';
29
21
 
30
- import { Table } from './Table';
31
22
  import { useTestTableModel } from '../../testing';
32
23
  import { translations } from '../../translations';
33
- import { TableView } from '../../types';
34
- import { createTable } from '../../util';
24
+ import { Table } from '../../types';
35
25
  import { TableToolbar } from '../TableToolbar';
36
26
 
37
- const TestSchema = Schema.Struct({
27
+ import { Table as TableComponent } from './Table';
28
+
29
+ const Example = Schema.Struct({
38
30
  // TODO(wittjosiah): Should be title. Currently name to work with default label.
39
31
  name: Schema.optional(Schema.String).annotations({ title: 'Title' }),
40
32
  urgent: Schema.optional(Schema.Boolean).annotations({ title: 'Urgent' }),
41
33
  status: Schema.optional(
42
34
  Schema.Literal('todo', 'in-progress', 'done')
43
- .pipe(FormatAnnotation.set(FormatEnum.SingleSelect))
35
+ .pipe(Format.FormatAnnotation.set(Format.TypeFormat.SingleSelect))
44
36
  .annotations({
45
37
  title: 'Status',
46
38
  [PropertyMetaAnnotationId]: {
@@ -55,11 +47,14 @@ const TestSchema = Schema.Struct({
55
47
  }),
56
48
  ),
57
49
  description: Schema.optional(Schema.String).annotations({ title: 'Description' }),
58
- parent: Schema.optional(Schema.suspend((): Type.Ref<TestSchema> => Type.Ref(TestSchema))).annotations({
50
+ parent: Schema.optional(Schema.suspend((): Type.Ref<Example> => Type.Ref(Example))).annotations({
59
51
  title: 'Parent',
60
52
  }),
61
- }).pipe(Type.Obj({ typename: `example.com/type/${PublicKey.random().truncate()}`, version: '0.1.0' }));
62
- interface TestSchema extends Schema.Schema.Type<typeof TestSchema> {}
53
+ }).pipe(
54
+ Type.Obj({ typename: `example.com/type/${PublicKey.random().truncate()}`, version: '0.1.0' }),
55
+ Annotation.LabelAnnotation.set(['name']),
56
+ );
57
+ interface Example extends Schema.Schema.Type<typeof Example> {}
63
58
 
64
59
  const StoryViewEditor = ({
65
60
  view,
@@ -67,18 +62,18 @@ const StoryViewEditor = ({
67
62
  space,
68
63
  handleDeleteColumn,
69
64
  }: {
70
- view?: DataType.View;
65
+ view?: View.View;
71
66
  schema?: Schema.Schema.AnyNoContext;
72
67
  space?: Space;
73
68
  handleDeleteColumn: (fieldId: string) => void;
74
69
  }) => {
75
- const handleTypenameChanged = useCallback(
76
- (typename: string) => {
70
+ const handleQueryChanged = useCallback(
71
+ (newQuery: QueryAST.Query) => {
77
72
  invariant(schema);
78
73
  invariant(Type.isMutable(schema));
79
- schema.updateTypename(typename);
74
+ schema.updateTypename(getTypenameFromQuery(newQuery));
80
75
  invariant(view);
81
- view.query.typename = typename;
76
+ view.query.ast = newQuery;
82
77
  },
83
78
  [schema, view],
84
79
  );
@@ -92,7 +87,7 @@ const StoryViewEditor = ({
92
87
  registry={space?.db.schemaRegistry}
93
88
  schema={schema}
94
89
  view={view}
95
- onTypenameChanged={handleTypenameChanged}
90
+ onQueryChanged={handleQueryChanged}
96
91
  onDelete={handleDeleteColumn}
97
92
  />
98
93
  );
@@ -106,7 +101,7 @@ const DefaultStory = () => {
106
101
  const {
107
102
  space,
108
103
  schema,
109
- view,
104
+ table,
110
105
  tableRef,
111
106
  model,
112
107
  presentation,
@@ -116,7 +111,7 @@ const DefaultStory = () => {
116
111
  handleDeleteColumn,
117
112
  } = useTestTableModel();
118
113
 
119
- if (!schema || !view) {
114
+ if (!schema || !table?.view.target) {
120
115
  return <div />;
121
116
  }
122
117
 
@@ -124,8 +119,8 @@ const DefaultStory = () => {
124
119
  <div className='grow grid grid-cols-[1fr_350px]'>
125
120
  <div className='grid grid-rows-[min-content_1fr] min-bs-0 overflow-hidden'>
126
121
  <TableToolbar classNames='border-be border-subduedSeparator' onAdd={handleInsertRow} onSave={handleSaveView} />
127
- <Table.Root>
128
- <Table.Main
122
+ <TableComponent.Root>
123
+ <TableComponent.Main
129
124
  ref={tableRef}
130
125
  model={model}
131
126
  presentation={presentation}
@@ -133,12 +128,17 @@ const DefaultStory = () => {
133
128
  client={client}
134
129
  ignoreAttention
135
130
  />
136
- </Table.Root>
131
+ </TableComponent.Root>
137
132
  </div>
138
- <div className='flex flex-col h-full border-l border-separator overflow-y-auto'>
139
- <StoryViewEditor view={view} schema={schema} space={space} handleDeleteColumn={handleDeleteColumn} />
140
- <SyntaxHighlighter language='json' className='w-full text-xs'>
141
- {JSON.stringify({ view, schema }, null, 2)}
133
+ <div className='flex flex-col bs-full border-l border-separator overflow-y-auto'>
134
+ <StoryViewEditor
135
+ view={table.view.target}
136
+ schema={schema}
137
+ space={space}
138
+ handleDeleteColumn={handleDeleteColumn}
139
+ />
140
+ <SyntaxHighlighter language='json' className='text-xs'>
141
+ {JSON.stringify({ view: table.view.target, schema }, null, 2)}
142
142
  </SyntaxHighlighter>
143
143
  </div>
144
144
  </div>
@@ -153,27 +153,25 @@ type StoryProps = { rows?: number };
153
153
 
154
154
  // TODO(burdon): Need super simple story.
155
155
 
156
- const meta: Meta<StoryProps> = {
156
+ const meta = {
157
157
  title: 'ui/react-ui-table/Table',
158
158
  render: DefaultStory,
159
- parameters: {
160
- translations,
161
- layout: 'fullscreen',
162
- controls: {
163
- disable: true,
164
- },
165
- },
166
159
  decorators: [
167
160
  withTheme,
168
- withLayout({ fullscreen: true }),
169
161
  withClientProvider({
170
- types: [DataType.View, TableView],
162
+ types: [View.View, Table.Table],
171
163
  createIdentity: true,
172
164
  createSpace: true,
173
- onSpaceCreated: async ({ client, space }) => {
174
- const [schema] = await space.db.schemaRegistry.register([TestSchema]);
175
- const { view } = await createTable({ client, space, typename: schema.typename });
176
- space.db.add(view);
165
+ onCreateSpace: async ({ client, space }) => {
166
+ const [schema] = await space.db.schemaRegistry.register([Example]);
167
+ const { view, jsonSchema } = await View.makeFromSpace({ client, space, typename: schema.typename });
168
+ const table = Table.make({ view, jsonSchema });
169
+ view.projection.fields = [
170
+ view.projection.fields.find((field: any) => field.path === 'name')!,
171
+ ...view.projection.fields.filter((field: any) => field.path !== 'name'),
172
+ ];
173
+
174
+ space.db.add(table);
177
175
 
178
176
  Array.from({ length: 10 }).map(() => {
179
177
  return space.db.add(
@@ -187,38 +185,49 @@ const meta: Meta<StoryProps> = {
187
185
  },
188
186
  }),
189
187
  ],
190
- };
188
+ parameters: {
189
+ layout: 'fullscreen',
190
+ controls: {
191
+ disable: true,
192
+ },
193
+ translations: [...translations, ...formTranslations],
194
+ },
195
+ } satisfies Meta<typeof TableComponent>;
191
196
 
192
197
  export default meta;
193
198
 
194
- export const Default = {};
199
+ type Story = StoryObj<typeof meta>;
200
+
201
+ export const Default: Story = {};
195
202
 
196
203
  export const StaticSchema: StoryObj = {
197
204
  render: DefaultStory,
198
- parameters: { translations },
199
205
  decorators: [
200
206
  withClientProvider({
201
- types: [DataType.View, TableView, Testing.Contact, Testing.Organization],
207
+ types: [View.View, Table.Table],
202
208
  createIdentity: true,
203
209
  createSpace: true,
204
- onSpaceCreated: async ({ client, space }) => {
205
- const { view } = await createTable({ client, space, typename: Testing.Contact.typename });
206
- space.db.add(view);
210
+ onCreateSpace: async ({ client, space }) => {
211
+ const { view, jsonSchema } = await View.makeFromSpace({ client, space, typename: TestSchema.Person.typename });
212
+ const table = Table.make({ view, jsonSchema });
213
+ space.db.add(table);
207
214
 
208
215
  const factory = createObjectFactory(space.db, faker as any);
209
216
  await factory([
210
- { type: Testing.Contact, count: 10 },
211
- // { type: Testing.Organization, count: 1 },
217
+ { type: TestSchema.Person, count: 10 },
218
+ // { type: TestSchema.Organization, count: 1 },
212
219
  ]);
213
220
  },
214
221
  }),
215
- withLayout({ fullscreen: true }),
216
- withTheme,
217
222
  ],
223
+ parameters: {
224
+ layout: 'fullscreen',
225
+ translations: [...translations, ...formTranslations],
226
+ },
218
227
  };
219
228
 
220
229
  const ContactWithArrayOfEmails = Schema.Struct({
221
- name: Schema.String.pipe(GeneratorAnnotation.set('person.fullName')),
230
+ name: Schema.String.pipe(Annotation.GeneratorAnnotation.set('person.fullName')),
222
231
  emails: Schema.optional(
223
232
  Schema.Array(
224
233
  Schema.Struct({
@@ -228,7 +237,7 @@ const ContactWithArrayOfEmails = Schema.Struct({
228
237
  ),
229
238
  ),
230
239
  }).pipe(
231
- EchoObject({
240
+ Type.Obj({
232
241
  typename: 'dxos.org/type/ContactWithArrayOfEmails',
233
242
  version: '0.1.0',
234
243
  }),
@@ -236,39 +245,44 @@ const ContactWithArrayOfEmails = Schema.Struct({
236
245
 
237
246
  export const ArrayOfObjects: StoryObj = {
238
247
  render: DefaultStory,
239
- parameters: { translations },
240
248
  decorators: [
241
249
  withClientProvider({
242
- types: [DataType.View, TableView, Testing.Contact, Testing.Organization, ContactWithArrayOfEmails],
250
+ types: [View.View, Table.Table, TestSchema.Person, TestSchema.Organization, ContactWithArrayOfEmails],
243
251
  createIdentity: true,
244
252
  createSpace: true,
245
- onSpaceCreated: async ({ client, space }) => {
246
- const { view } = await createTable({ client, space, typename: ContactWithArrayOfEmails.typename });
247
- space.db.add(view);
253
+ onCreateSpace: async ({ client, space }) => {
254
+ const { view, jsonSchema } = await View.makeFromSpace({
255
+ client,
256
+ space,
257
+ typename: ContactWithArrayOfEmails.typename,
258
+ });
259
+ const table = Table.make({ view, jsonSchema });
260
+ space.db.add(table);
248
261
 
249
262
  const factory = createObjectFactory(space.db, faker as any);
250
263
  await factory([
251
- // { type: Testing.Contact, count: 10 },
252
- // { type: Testing.Organization, count: 1 },
264
+ // { type: TestSchema.Person, count: 10 },
265
+ // { type: TestSchema.Organization, count: 1 },
253
266
  { type: ContactWithArrayOfEmails, count: 10 },
254
267
  ]);
255
268
  },
256
269
  }),
257
- withLayout({ fullscreen: true }),
258
- withTheme,
259
270
  ],
271
+ parameters: {
272
+ layout: 'fullscreen',
273
+ translations,
274
+ },
260
275
  };
261
276
 
262
277
  export const Tags: Meta<StoryProps> = {
263
278
  title: 'ui/react-ui-table/Table',
264
279
  render: DefaultStory,
265
- parameters: { translations },
266
280
  decorators: [
267
281
  withClientProvider({
268
- types: [DataType.View, TableView],
282
+ types: [View.View, Table.Table],
269
283
  createIdentity: true,
270
284
  createSpace: true,
271
- onSpaceCreated: async ({ client, space }) => {
285
+ onCreateSpace: async ({ client, space }) => {
272
286
  // Configure schema.
273
287
  const typename = 'example.com/SingleSelect';
274
288
  const selectOptions = [
@@ -284,25 +298,26 @@ export const Tags: Meta<StoryProps> = {
284
298
  const schema = getSchemaFromPropertyDefinitions(typename, [
285
299
  {
286
300
  name: 'single',
287
- format: FormatEnum.SingleSelect,
301
+ format: Format.TypeFormat.SingleSelect,
288
302
  config: { options: selectOptions },
289
303
  },
290
304
  {
291
305
  name: 'multiple',
292
- format: FormatEnum.MultiSelect,
306
+ format: Format.TypeFormat.MultiSelect,
293
307
  config: { options: selectOptions },
294
308
  },
295
309
  ]);
296
310
  const [storedSchema] = await space.db.schemaRegistry.register([schema]);
297
311
 
298
312
  // Initialize table.
299
- const { view } = await createTable({ client, space, typename });
300
- space.db.add(view);
313
+ const { view, jsonSchema } = await View.makeFromSpace({ client, space, typename });
314
+ const table = Table.make({ view, jsonSchema });
315
+ space.db.add(table);
301
316
 
302
317
  // Populate.
303
318
  Array.from({ length: 10 }).map(() => {
304
319
  return space.db.add(
305
- live(storedSchema, {
320
+ Obj.make(storedSchema, {
306
321
  single: faker.helpers.arrayElement([...selectOptionIds, undefined]),
307
322
  multiple: faker.helpers.randomSubset(selectOptionIds),
308
323
  }),
@@ -310,7 +325,9 @@ export const Tags: Meta<StoryProps> = {
310
325
  });
311
326
  },
312
327
  }),
313
- withLayout({ fullscreen: true }),
314
- withTheme,
315
328
  ],
329
+ parameters: {
330
+ layout: 'fullscreen',
331
+ translations,
332
+ },
316
333
  };