@dxos/react-ui-table 0.8.4-main.fcfe5033a5 → 0.8.4-staging.60fe92afc8

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 (115) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/browser/{chunk-F7Y374KL.mjs → chunk-4KOQTPFC.mjs} +62 -111
  3. package/dist/lib/browser/chunk-4KOQTPFC.mjs.map +7 -0
  4. package/dist/lib/browser/{chunk-BF54SSNL.mjs → chunk-62PYOJPY.mjs} +13 -16
  5. package/dist/lib/browser/chunk-62PYOJPY.mjs.map +7 -0
  6. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  7. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  8. package/dist/lib/browser/index.mjs +57 -131
  9. package/dist/lib/browser/index.mjs.map +4 -4
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/testing/index.mjs +9 -8
  12. package/dist/lib/browser/testing/index.mjs.map +3 -3
  13. package/dist/lib/browser/translations.mjs +36 -0
  14. package/dist/lib/browser/translations.mjs.map +7 -0
  15. package/dist/lib/browser/types/index.mjs +2 -1
  16. package/dist/lib/node-esm/{chunk-SIRDIPHZ.mjs → chunk-7LMOZUTS.mjs} +13 -16
  17. package/dist/lib/node-esm/chunk-7LMOZUTS.mjs.map +7 -0
  18. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  19. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  20. package/dist/lib/node-esm/{chunk-CCJ4LOVM.mjs → chunk-KOSV2J5N.mjs} +62 -111
  21. package/dist/lib/node-esm/chunk-KOSV2J5N.mjs.map +7 -0
  22. package/dist/lib/node-esm/index.mjs +57 -131
  23. package/dist/lib/node-esm/index.mjs.map +4 -4
  24. package/dist/lib/node-esm/meta.json +1 -1
  25. package/dist/lib/node-esm/testing/index.mjs +9 -8
  26. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  27. package/dist/lib/node-esm/translations.mjs +37 -0
  28. package/dist/lib/node-esm/translations.mjs.map +7 -0
  29. package/dist/lib/node-esm/types/index.mjs +2 -1
  30. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
  31. package/dist/types/src/components/Table/ColumnSettings.d.ts +2 -2
  32. package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
  33. package/dist/types/src/components/Table/DynamicTable.d.ts +3 -4
  34. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
  35. package/dist/types/src/components/Table/DynamicTable.stories.d.ts +21 -20
  36. package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/Table/Relations.stories.d.ts +87 -81
  38. package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -1
  39. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  40. package/dist/types/src/components/Table/Table.d.ts +2 -2
  41. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  42. package/dist/types/src/components/Table/Table.stories.d.ts +88 -81
  43. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  44. package/dist/types/src/components/Table/TableContent.d.ts +2 -1
  45. package/dist/types/src/components/Table/TableContent.d.ts.map +1 -1
  46. package/dist/types/src/components/Table/TableToolbar.d.ts +1 -1
  47. package/dist/types/src/components/Table/TableToolbar.d.ts.map +1 -1
  48. package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
  49. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +1 -2
  50. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
  51. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  52. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +19 -19
  53. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  54. package/dist/types/src/components/testing.d.ts.map +1 -1
  55. package/dist/types/src/hooks/useAddRow.d.ts.map +1 -1
  56. package/dist/types/src/hooks/useProjectionModel.d.ts.map +1 -1
  57. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  58. package/dist/types/src/index.d.ts +0 -2
  59. package/dist/types/src/index.d.ts.map +1 -1
  60. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  61. package/dist/types/src/model/selection-model.d.ts +1 -1
  62. package/dist/types/src/model/selection-model.d.ts.map +1 -1
  63. package/dist/types/src/model/table-model.d.ts +7 -7
  64. package/dist/types/src/model/table-model.d.ts.map +1 -1
  65. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  66. package/dist/types/src/playwright/TableManager.d.ts.map +1 -1
  67. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -1
  68. package/dist/types/src/testing/useTestTableModel.d.ts +1 -1
  69. package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
  70. package/dist/types/src/translations.d.ts +19 -19
  71. package/dist/types/src/translations.d.ts.map +1 -1
  72. package/dist/types/src/types/Table.d.ts +12 -6
  73. package/dist/types/src/types/Table.d.ts.map +1 -1
  74. package/dist/types/src/util/dynamic-table.d.ts +6 -6
  75. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  76. package/dist/types/src/util/query-ast.d.ts.map +1 -1
  77. package/dist/types/src/util/schema.d.ts.map +1 -1
  78. package/dist/types/src/util/signals.d.ts.map +1 -1
  79. package/dist/types/src/util/sort.d.ts.map +1 -1
  80. package/dist/types/src/util/table-buttons.d.ts +20 -20
  81. package/dist/types/src/util/table-buttons.d.ts.map +1 -1
  82. package/dist/types/src/util/table-controls.d.ts +4 -4
  83. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  84. package/dist/types/src/util/tag.d.ts.map +1 -1
  85. package/dist/types/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +53 -63
  87. package/src/components/Table/ColumnActionsMenu.tsx +2 -1
  88. package/src/components/Table/ColumnSettings.tsx +2 -2
  89. package/src/components/Table/DynamicTable.stories.tsx +9 -8
  90. package/src/components/Table/DynamicTable.tsx +11 -12
  91. package/src/components/Table/Relations.stories.tsx +46 -9
  92. package/src/components/Table/RowActionsMenu.tsx +3 -2
  93. package/src/components/Table/Table.stories.tsx +86 -33
  94. package/src/components/Table/TableContent.tsx +9 -4
  95. package/src/components/Table/TableToolbar.tsx +2 -2
  96. package/src/components/TableCellEditor/CellValidationMessage.tsx +1 -2
  97. package/src/components/TableCellEditor/FormCellEditor.tsx +8 -7
  98. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +7 -4
  99. package/src/components/TableCellEditor/TableCellEditor.tsx +8 -6
  100. package/src/components/testing.ts +7 -12
  101. package/src/hooks/useProjectionModel.ts +5 -6
  102. package/src/hooks/useTableModel.ts +1 -1
  103. package/src/index.ts +0 -4
  104. package/src/model/table-model.test.ts +4 -9
  105. package/src/model/table-model.ts +43 -36
  106. package/src/model/table-presentation.test.ts +4 -9
  107. package/src/model/table-presentation.ts +15 -15
  108. package/src/testing/useTestTableModel.ts +6 -7
  109. package/src/types/Table.ts +16 -15
  110. package/src/util/dynamic-table.test.ts +13 -20
  111. package/src/util/dynamic-table.ts +19 -18
  112. package/dist/lib/browser/chunk-BF54SSNL.mjs.map +0 -7
  113. package/dist/lib/browser/chunk-F7Y374KL.mjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-CCJ4LOVM.mjs.map +0 -7
  115. package/dist/lib/node-esm/chunk-SIRDIPHZ.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-table",
3
- "version": "0.8.4-main.fcfe5033a5",
3
+ "version": "0.8.4-staging.60fe92afc8",
4
4
  "description": "A table component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -8,17 +8,14 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/dxos/dxos"
10
10
  },
11
- "license": "MIT",
11
+ "license": "FSL-1.1-Apache-2.0",
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": false,
14
14
  "type": "module",
15
+ "imports": {
16
+ "#translations": "./src/translations.ts"
17
+ },
15
18
  "exports": {
16
- "./deprecated": {
17
- "source": "./src/deprecated/index.ts",
18
- "types": "./dist/types/src/deprecated/index.d.ts",
19
- "browser": "./dist/lib/browser/deprecated/index.mjs",
20
- "node": "./dist/lib/node-esm/deprecated/index.mjs"
21
- },
22
19
  ".": {
23
20
  "source": "./src/index.ts",
24
21
  "types": "./dist/types/src/index.d.ts",
@@ -31,6 +28,12 @@
31
28
  "browser": "./dist/lib/browser/testing/index.mjs",
32
29
  "node": "./dist/lib/node-esm/testing/index.mjs"
33
30
  },
31
+ "./translations": {
32
+ "source": "./src/translations.ts",
33
+ "types": "./dist/types/src/translations.d.ts",
34
+ "browser": "./dist/lib/browser/translations.mjs",
35
+ "node": "./dist/lib/node-esm/translations.mjs"
36
+ },
34
37
  "./types": {
35
38
  "source": "./src/types/index.ts",
36
39
  "types": "./dist/types/src/types/index.d.ts",
@@ -39,27 +42,14 @@
39
42
  }
40
43
  },
41
44
  "types": "dist/types/src/index.d.ts",
42
- "typesVersions": {
43
- "*": {
44
- "deprecated": [
45
- "dist/types/src/deprecated/index.d.ts"
46
- ],
47
- "testing": [
48
- "dist/types/src/testing/index.d.ts"
49
- ],
50
- "types": [
51
- "dist/types/src/types/index.d.ts"
52
- ]
53
- }
54
- },
55
45
  "files": [
56
46
  "dist",
57
47
  "src"
58
48
  ],
59
49
  "dependencies": {
60
- "@codemirror/autocomplete": "^6.19.0",
61
- "@codemirror/state": "^6.5.2",
62
- "@codemirror/view": "^6.38.4",
50
+ "@codemirror/autocomplete": "^6.20.2",
51
+ "@codemirror/state": "^6.6.0",
52
+ "@codemirror/view": "^6.43.0",
63
53
  "@effect-atom/atom-react": "^0.5.0",
64
54
  "@fluentui/react-tabster": "9.26.11",
65
55
  "@radix-ui/react-context": "1.1.1",
@@ -68,58 +58,58 @@
68
58
  "@radix-ui/react-use-controllable-state": "1.1.0",
69
59
  "date-fns": "^3.6.0",
70
60
  "lodash.orderby": "^4.6.0",
71
- "@dxos/context": "0.8.4-main.fcfe5033a5",
72
- "@dxos/effect": "0.8.4-main.fcfe5033a5",
73
- "@dxos/async": "0.8.4-main.fcfe5033a5",
74
- "@dxos/debug": "0.8.4-main.fcfe5033a5",
75
- "@dxos/echo-atom": "0.8.4-main.fcfe5033a5",
76
- "@dxos/keys": "0.8.4-main.fcfe5033a5",
77
- "@dxos/lit-grid": "0.8.4-main.fcfe5033a5",
78
- "@dxos/invariant": "0.8.4-main.fcfe5033a5",
79
- "@dxos/log": "0.8.4-main.fcfe5033a5",
80
- "@dxos/random": "0.8.4-main.fcfe5033a5",
81
- "@dxos/echo": "0.8.4-main.fcfe5033a5",
82
- "@dxos/react-client": "0.8.4-main.fcfe5033a5",
83
- "@dxos/react-ui-attention": "0.8.4-main.fcfe5033a5",
84
- "@dxos/react-ui-components": "0.8.4-main.fcfe5033a5",
85
- "@dxos/react-ui-editor": "0.8.4-main.fcfe5033a5",
86
- "@dxos/react-ui-form": "0.8.4-main.fcfe5033a5",
87
- "@dxos/react-ui-search": "0.8.4-main.fcfe5033a5",
88
- "@dxos/react-ui-grid": "0.8.4-main.fcfe5033a5",
89
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.fcfe5033a5",
90
- "@dxos/react-ui-menu": "0.8.4-main.fcfe5033a5",
91
- "@dxos/schema": "0.8.4-main.fcfe5033a5",
92
- "@dxos/types": "0.8.4-main.fcfe5033a5",
93
- "@dxos/react-ui-stack": "0.8.4-main.fcfe5033a5",
94
- "@dxos/ui-types": "0.8.4-main.fcfe5033a5",
95
- "@dxos/util": "0.8.4-main.fcfe5033a5"
61
+ "@dxos/async": "0.8.4-staging.60fe92afc8",
62
+ "@dxos/context": "0.8.4-staging.60fe92afc8",
63
+ "@dxos/echo": "0.8.4-staging.60fe92afc8",
64
+ "@dxos/debug": "0.8.4-staging.60fe92afc8",
65
+ "@dxos/invariant": "0.8.4-staging.60fe92afc8",
66
+ "@dxos/effect": "0.8.4-staging.60fe92afc8",
67
+ "@dxos/keys": "0.8.4-staging.60fe92afc8",
68
+ "@dxos/random": "0.8.4-staging.60fe92afc8",
69
+ "@dxos/react-client": "0.8.4-staging.60fe92afc8",
70
+ "@dxos/log": "0.8.4-staging.60fe92afc8",
71
+ "@dxos/react-ui-attention": "0.8.4-staging.60fe92afc8",
72
+ "@dxos/react-ui-editor": "0.8.4-staging.60fe92afc8",
73
+ "@dxos/react-ui-form": "0.8.4-staging.60fe92afc8",
74
+ "@dxos/react-ui-components": "0.8.4-staging.60fe92afc8",
75
+ "@dxos/react-ui-list": "0.8.4-staging.60fe92afc8",
76
+ "@dxos/lit-grid": "0.8.4-staging.60fe92afc8",
77
+ "@dxos/react-ui-grid": "0.8.4-staging.60fe92afc8",
78
+ "@dxos/react-ui-search": "0.8.4-staging.60fe92afc8",
79
+ "@dxos/react-ui-menu": "0.8.4-staging.60fe92afc8",
80
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-staging.60fe92afc8",
81
+ "@dxos/types": "0.8.4-staging.60fe92afc8",
82
+ "@dxos/schema": "0.8.4-staging.60fe92afc8",
83
+ "@dxos/ui-types": "0.8.4-staging.60fe92afc8",
84
+ "@dxos/util": "0.8.4-staging.60fe92afc8",
85
+ "@dxos/react-ui-stack": "0.8.4-staging.60fe92afc8"
96
86
  },
97
87
  "devDependencies": {
98
- "@effect/platform": "0.94.4",
88
+ "@effect/platform": "0.96.1",
99
89
  "@types/lodash.orderby": "^4.6.9",
100
90
  "@types/react": "~19.2.7",
101
91
  "@types/react-dom": "~19.2.3",
102
- "effect": "3.20.0",
92
+ "effect": "3.21.3",
103
93
  "fast-check": "^3.19.0",
104
94
  "react": "~19.2.3",
105
95
  "react-dom": "~19.2.3",
106
- "vite": "^7.1.11",
107
- "@dxos/lit-ui": "0.8.4-main.fcfe5033a5",
108
- "@dxos/react-client": "0.8.4-main.fcfe5033a5",
109
- "@dxos/random": "0.8.4-main.fcfe5033a5",
110
- "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
111
- "@dxos/storybook-utils": "0.8.4-main.fcfe5033a5",
112
- "@dxos/ui-theme": "0.8.4-main.fcfe5033a5",
113
- "@dxos/test-utils": "0.8.4-main.fcfe5033a5"
96
+ "vite": "^8.0.16",
97
+ "@dxos/lit-ui": "0.8.4-staging.60fe92afc8",
98
+ "@dxos/random": "0.8.4-staging.60fe92afc8",
99
+ "@dxos/react-client": "0.8.4-staging.60fe92afc8",
100
+ "@dxos/react-ui": "0.8.4-staging.60fe92afc8",
101
+ "@dxos/storybook-utils": "0.8.4-staging.60fe92afc8",
102
+ "@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
103
+ "@dxos/test-utils": "0.8.4-staging.60fe92afc8"
114
104
  },
115
105
  "peerDependencies": {
116
106
  "@effect-atom/atom-react": "^0.5.0",
117
- "@effect/platform": "0.94.4",
118
- "effect": "3.20.0",
107
+ "@effect/platform": "0.96.1",
108
+ "effect": "3.21.3",
119
109
  "react": "~19.2.3",
120
110
  "react-dom": "~19.2.3",
121
- "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
122
- "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
111
+ "@dxos/react-ui": "0.8.4-staging.60fe92afc8",
112
+ "@dxos/ui-theme": "0.8.4-staging.60fe92afc8"
123
113
  },
124
114
  "publishConfig": {
125
115
  "access": "public"
@@ -7,8 +7,9 @@ import React from 'react';
7
7
 
8
8
  import { DropdownMenu, useTranslation } from '@dxos/react-ui';
9
9
 
10
+ import { translationKey } from '#translations';
11
+
10
12
  import { type ModalController, type TableModel } from '../../model';
11
- import { translationKey } from '../../translations';
12
13
 
13
14
  export type ColumnActionsMenuProps = {
14
15
  model: TableModel;
@@ -5,14 +5,14 @@
5
5
  import { useAtomValue } from '@effect-atom/atom-react';
6
6
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
7
7
 
8
- import { type SchemaRegistry, type View } from '@dxos/echo';
8
+ import { type Registry, type View } from '@dxos/echo';
9
9
  import { Popover } from '@dxos/react-ui';
10
10
  import { FieldEditor } from '@dxos/react-ui-form';
11
11
 
12
12
  import { type ModalController, type TableModel } from '../../model';
13
13
 
14
14
  type ColumnSettingsProps = {
15
- registry?: SchemaRegistry.SchemaRegistry;
15
+ registry?: Registry.Registry;
16
16
  model?: TableModel;
17
17
  modals: ModalController;
18
18
  onNewColumn: () => void;
@@ -6,18 +6,19 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import type * as Types from 'effect/Types';
7
7
  import React, { useMemo, useState } from 'react';
8
8
 
9
- import { type JsonSchema, Obj } from '@dxos/echo';
10
- import { Format } from '@dxos/echo/internal';
9
+ import { Filter, type JsonSchema, Obj, Type } from '@dxos/echo';
10
+ import { Format } from '@dxos/echo/Format';
11
11
  import { random } from '@dxos/random';
12
- import { Filter, useQuery, useSchema } from '@dxos/react-client/echo';
12
+ import { useQuery, useType } from '@dxos/react-client/echo';
13
13
  import { useClientStory, withClientProvider } from '@dxos/react-client/testing';
14
14
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
15
  import { type SchemaPropertyDefinition } from '@dxos/schema';
16
16
  import { TestSchema } from '@dxos/schema/testing';
17
17
  import { withRegistry } from '@dxos/storybook-utils';
18
18
 
19
+ import { translations } from '#translations';
20
+
19
21
  import { type TableFeatures } from '../../model';
20
- import { translations } from '../../translations';
21
22
  import { DynamicTable } from './DynamicTable';
22
23
 
23
24
  random.seed(0);
@@ -131,13 +132,13 @@ export const WithJsonSchema: StoryObj = {
131
132
  export const WithEchoSchema: StoryObj = {
132
133
  render: () => {
133
134
  const { space } = useClientStory();
134
- const schema = useSchema(space?.db, TestSchema.Person.typename);
135
- const objects = useQuery(space?.db, schema ? Filter.type(schema) : Filter.nothing());
136
- if (!schema) {
135
+ const type = useType(space?.db, Type.getURI(TestSchema.Person));
136
+ const objects = useQuery(space?.db, type ? Filter.type(type) : Filter.nothing());
137
+ if (!type) {
137
138
  return <div>Loading schema...</div>;
138
139
  }
139
140
 
140
- return <DynamicTable schema={schema} rows={objects} />;
141
+ return <DynamicTable type={type} rows={objects} />;
141
142
  },
142
143
  decorators: [
143
144
  withClientProvider({
@@ -6,8 +6,7 @@ import { RegistryContext } from '@effect-atom/atom-react';
6
6
  import type * as Types from 'effect/Types';
7
7
  import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
8
8
 
9
- import { type Type } from '@dxos/echo';
10
- import { type JsonSchema } from '@dxos/echo';
9
+ import { type JsonSchema, type Type } from '@dxos/echo';
11
10
  import { type ThemedClassName, useDefaultValue } from '@dxos/react-ui';
12
11
  import { type ProjectionModel } from '@dxos/schema';
13
12
  import { mx } from '@dxos/ui-theme';
@@ -19,7 +18,7 @@ import { type TablePropertyDefinition, getBaseSchema, makeDynamicTable } from '.
19
18
  import { Table, type TableController } from './Table';
20
19
 
21
20
  export type DynamicTableProps<T extends Type.AnyEntity = Type.AnyEntity> = ThemedClassName<{
22
- schema?: T;
21
+ type?: T;
23
22
  name?: string; // TODO(burdon): Remove?
24
23
  rows: any[];
25
24
  properties?: TablePropertyDefinition[];
@@ -37,8 +36,8 @@ export type DynamicTableProps<T extends Type.AnyEntity = Type.AnyEntity> = Theme
37
36
  // TODO(burdon): Warning: Cannot update a component (`DynamicTable`) while rendering a different component (`DynamicTable`).
38
37
  export const DynamicTable = <T extends Type.AnyEntity = Type.AnyEntity>({
39
38
  classNames,
40
- schema,
41
- name = 'com.example.dynamic-table', // Remove default or make random; this will lead to type collisions.
39
+ type: typeProp,
40
+ name = 'com.example.dynamicTable', // Remove default or make random; this will lead to type collisions.
42
41
  rows,
43
42
  properties,
44
43
  jsonSchema: jsonSchemaProp,
@@ -51,14 +50,14 @@ export const DynamicTable = <T extends Type.AnyEntity = Type.AnyEntity>({
51
50
  const [dynamicTable, setDynamicTable] = useState<{ object: TableType.Table; projection: ProjectionModel }>();
52
51
 
53
52
  // TODO(burdon): Remove variance from the props (should be normalized externally; possibly via hooks).
54
- const { jsonSchema } = useMemo(
55
- () => getBaseSchema({ typename: name, properties, jsonSchema: jsonSchemaProp, schema }),
56
- [name, properties, jsonSchemaProp, schema],
53
+ const { type } = useMemo(
54
+ () => getBaseSchema({ typename: name, properties, jsonSchema: jsonSchemaProp, type: typeProp }),
55
+ [name, properties, jsonSchemaProp, typeProp],
57
56
  );
58
57
 
59
58
  useEffect(() => {
60
- setDynamicTable(makeDynamicTable({ registry, jsonSchema, properties }));
61
- }, [registry, jsonSchema, properties]);
59
+ setDynamicTable(makeDynamicTable({ registry, type, properties }));
60
+ }, [registry, type, properties]);
62
61
 
63
62
  const tableRef = useRef<TableController>(null);
64
63
  const handleCellUpdate = useCallback((cell: any) => {
@@ -96,8 +95,8 @@ export const DynamicTable = <T extends Type.AnyEntity = Type.AnyEntity>({
96
95
  }, [registry, model]);
97
96
 
98
97
  return (
99
- <div role='none' className={mx('dx-expander grid', classNames)}>
100
- <div role='none' className='grid min-h-0 overflow-hidden'>
98
+ <div className={mx('dx-expander grid', classNames)}>
99
+ <div className='grid min-h-0 overflow-hidden'>
101
100
  <Table.Root ref={tableRef}>
102
101
  <Table.Content model={model} presentation={presentation} ignoreAttention onRowClick={onRowClick} />
103
102
  </Table.Root>
@@ -7,14 +7,13 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
7
7
  import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
8
8
  import { expect, userEvent, waitFor, within } from 'storybook/test';
9
9
 
10
- import { Obj, Type } from '@dxos/echo';
11
- import { View } from '@dxos/echo';
10
+ import { Obj, Type, View } from '@dxos/echo';
12
11
  import { invariant } from '@dxos/invariant';
13
12
  import { type DxGrid } from '@dxos/lit-grid';
14
13
  import { random } from '@dxos/random';
15
14
  import { useClientStory, withClientProvider } from '@dxos/react-client/testing';
16
15
  import { useAsyncEffect } from '@dxos/react-ui';
17
- import { translations as formTranslations } from '@dxos/react-ui-form';
16
+ import { translations as formTranslations } from '@dxos/react-ui-form/translations';
18
17
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
19
18
  import { ViewModel } from '@dxos/schema';
20
19
  import { type ValueGenerator, createAsyncGenerator } from '@dxos/schema/testing';
@@ -22,9 +21,10 @@ import { withRegistry } from '@dxos/storybook-utils';
22
21
  import { Organization, Person } from '@dxos/types';
23
22
  import '@dxos/lit-ui/dx-tag-picker.pcss';
24
23
 
24
+ import { translations } from '#translations';
25
+
25
26
  import { useProjectionModel, useTableModel } from '../../hooks';
26
27
  import { type TableFeatures, TablePresentation, type TableRow } from '../../model';
27
- import { translations } from '../../translations';
28
28
  import { Table } from '../../types';
29
29
  import { Table as TableComponent } from './Table';
30
30
 
@@ -66,7 +66,9 @@ const useTestModel = <S extends Type.AnyObj>(schema: S, count: number) => {
66
66
 
67
67
  const objectGenerator = createAsyncGenerator(generator, schema, { db: space?.db, force: true });
68
68
  void objectGenerator.createObjects(count).then((objects) => {
69
- model.setRows(objects);
69
+ // TODO(wittjosiah): Remove cast. Type.InstanceType is now strict (no index signature),
70
+ // so it isn't assignable to TableRow (Record<JsonProp, any>); reconcile the row model type.
71
+ model.setRows(objects as unknown as TableRow[]);
70
72
  });
71
73
  }, [model, space]);
72
74
 
@@ -88,7 +90,7 @@ const DefaultStory = () => {
88
90
 
89
91
  const handleCreate = useCallback(
90
92
  (schema: Type.AnyEntity, values: any) => {
91
- invariant(Type.isObjectSchema(schema));
93
+ invariant(Type.isObject(schema));
92
94
  invariant(space);
93
95
  return space.db.add(Obj.make(schema, values));
94
96
  },
@@ -147,6 +149,18 @@ export default meta;
147
149
  type Story = StoryObj<typeof meta>;
148
150
 
149
151
  export const Default: Story = {
152
+ // The play function exercises a deep timing race in dx-grid + React render
153
+ // pipeline (cell focus → keydown → `dispatchEditRequest` → `setEditing` →
154
+ // `FormCellEditor` `useEffect` → `Popover` mount). On chromium browser
155
+ // tests the combobox sometimes fails to render in time; local pass rate
156
+ // ~25%, which makes pure CI re-run lottery a poor fit. Excluding from
157
+ // automated test runs (the story still renders in Storybook for visual
158
+ // review and the production code path is covered by
159
+ // `playwright/smoke.spec.ts`). Re-enable once the underlying race is
160
+ // fixed — likely needs `dispatchEditRequest` to be synchronous from
161
+ // keydown and `FormCellEditor` to render the popover off `contextEditing`
162
+ // directly instead of mirroring it through local state.
163
+ tags: ['!test'],
150
164
  play: async ({ canvasElement }) => {
151
165
  const canvas = within(canvasElement);
152
166
  const body = within(document.body);
@@ -158,19 +172,42 @@ export const Default: Story = {
158
172
  // Focus on the second table (Person/contacts table)
159
173
  await expect(secondGrid).toBeVisible();
160
174
 
175
+ // Wait for both grids' data generators to finish populating before
176
+ // interacting. `findByTestId` returns as soon as the cell DOM exists,
177
+ // but dx-grid's internal cell registry (used by `cellReadonly` and the
178
+ // edit-request dispatcher) is filled in lazily. If `keydown` lands
179
+ // before the registry has the row, `dispatchEditRequest` short-circuits
180
+ // and the combobox never opens — that's the "Unable to find combobox"
181
+ // flake. Wait for the first row of each grid to render non-empty
182
+ // content (a reliable proxy for "registry populated") BEFORE scrolling
183
+ // — once we scroll the second grid to column 4, dx-grid virtualizes
184
+ // columns 0-3 out of the DOM, so `grid.0.0` becomes unreachable.
185
+ await waitFor(
186
+ async () => {
187
+ const firstOrgCell = within(firstGrid).getByTestId('grid.0.0');
188
+ const orgText = (firstOrgCell.querySelector('.dx-grid__cell__content') as HTMLElement | null)?.textContent;
189
+ await expect(orgText).toBeTruthy();
190
+ const firstContactCell = within(secondGrid).getByTestId('grid.0.0');
191
+ const contactText = (firstContactCell.querySelector('.dx-grid__cell__content') as HTMLElement | null)
192
+ ?.textContent;
193
+ await expect(contactText).toBeTruthy();
194
+ },
195
+ { timeout: 10_000 },
196
+ );
197
+
161
198
  // Scroll to the relations column (column 4) - this mimics the scrollToColumn call
162
199
  (secondGrid.closest('dx-grid') as DxGrid).scrollToColumn(4);
163
200
 
164
- // Find and click the target cell (first row, relations column)
201
+ // Find the target cell (first row, relations column).
165
202
  const targetCell = await within(secondGrid).findByTestId('grid.4.0', undefined, { timeout: 10_000 });
166
203
  await expect(targetCell).toBeVisible();
167
204
 
168
- // Click to focus the cell
205
+ // Click to focus the cell.
169
206
  await userEvent.click(targetCell as HTMLElement);
170
207
  await expect(targetCell).toHaveFocus();
171
208
  await userEvent.keyboard('{Enter}');
172
209
 
173
- // Look for the combobox that should appear in edit mode
210
+ // Look for the combobox that should appear in edit mode.
174
211
  const combobox = await body.findByRole('combobox', undefined, { timeout: 5000 });
175
212
  await userEvent.click(combobox);
176
213
 
@@ -7,8 +7,9 @@ import React from 'react';
7
7
 
8
8
  import { DropdownMenu, toLocalizedString, useTranslation } from '@dxos/react-ui';
9
9
 
10
+ import { translationKey } from '#translations';
11
+
10
12
  import { type ModalController, type TableModel } from '../../model';
11
- import { translationKey } from '../../translations';
12
13
 
13
14
  type RowActionsMenuProps = { model: TableModel; modals: ModalController };
14
15
 
@@ -47,7 +48,7 @@ export const RowActionsMenu = ({ model, modals }: RowActionsMenuProps) => {
47
48
  {/* Default actions */}
48
49
  {model.features.dataEditable !== false && (
49
50
  <DropdownMenu.Item data-testid='row-menu-delete' onClick={() => model.deleteRow(state.rowIndex)}>
50
- {t(hasSelection ? 'bulk delete row label' : 'delete row label')}
51
+ {t(hasSelection ? 'bulk-delete-row.label' : 'delete-row.label')}
51
52
  </DropdownMenu.Item>
52
53
  )}
53
54
  </DropdownMenu.Viewport>