@dxos/react-ui-table 0.8.2-main.12df754 → 0.8.2-main.30e4dbb

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 (76) hide show
  1. package/dist/lib/browser/chunk-UGGYKLOH.mjs +28 -0
  2. package/dist/lib/browser/chunk-UGGYKLOH.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +89 -124
  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-2QLLIPZK.cjs} +13 -11
  8. package/dist/lib/node/chunk-2QLLIPZK.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +149 -184
  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-N2RRVR7F.mjs} +11 -9
  15. package/dist/lib/node-esm/chunk-N2RRVR7F.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +89 -124
  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 +0 -2
  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.map +1 -1
  27. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  28. package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  30. package/dist/types/src/components/TableCellEditor/extension.d.ts.map +1 -1
  31. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -2
  32. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  33. package/dist/types/src/components/testing.d.ts +39 -39
  34. package/dist/types/src/components/testing.d.ts.map +1 -1
  35. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  36. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  37. package/dist/types/src/model/selection-model.d.ts.map +1 -1
  38. package/dist/types/src/model/table-model.d.ts.map +1 -1
  39. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  40. package/dist/types/src/types/table.d.ts +43 -43
  41. package/dist/types/src/types/table.d.ts.map +1 -1
  42. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  43. package/dist/types/src/util/signals.d.ts.map +1 -1
  44. package/dist/types/src/util/table-buttons.d.ts +0 -14
  45. package/dist/types/src/util/table-buttons.d.ts.map +1 -1
  46. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  47. package/dist/types/src/util/table.d.ts +2 -2
  48. package/dist/types/src/util/table.d.ts.map +1 -1
  49. package/dist/types/src/util/tag.d.ts +11 -0
  50. package/dist/types/src/util/tag.d.ts.map +1 -0
  51. package/dist/types/tsconfig.tsbuildinfo +1 -1
  52. package/package.json +35 -33
  53. package/src/components/Table/CreateRefPanel.tsx +3 -3
  54. package/src/components/Table/DynamicTable.stories.tsx +1 -1
  55. package/src/components/Table/DynamicTable.tsx +0 -2
  56. package/src/components/Table/Table.stories.tsx +6 -7
  57. package/src/components/Table/Table.tsx +18 -24
  58. package/src/components/Table/relations.stories.tsx +34 -24
  59. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +1 -1
  60. package/src/components/TableToolbar/TableToolbar.tsx +10 -11
  61. package/src/components/testing.ts +7 -6
  62. package/src/model/table-model.test.ts +4 -3
  63. package/src/model/table-model.ts +17 -0
  64. package/src/model/table-presentation.test.ts +4 -3
  65. package/src/model/table-presentation.ts +3 -5
  66. package/src/types/table.ts +16 -8
  67. package/src/util/table-buttons.ts +0 -23
  68. package/src/util/table.ts +8 -12
  69. package/src/util/tag.ts +33 -0
  70. package/dist/lib/browser/chunk-YWNRUF4J.mjs +0 -26
  71. package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +0 -7
  72. package/dist/lib/node/chunk-TGG6OZ54.cjs.map +0 -7
  73. package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +0 -7
  74. package/dist/types/src/components/Table/RefPanel.d.ts +0 -9
  75. package/dist/types/src/components/Table/RefPanel.d.ts.map +0 -1
  76. package/src/components/Table/RefPanel.tsx +0 -52
@@ -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,CAAC,IAAI,WAAW,GAAG,MAAM;CAMnD,CAAC;AAEX,KAAK,UAAU,GACX;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC;AA2HlE,eAAO,MAAM,YAAY;;;;wCA/FA,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;gCAShE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC;;;;;uCAMjD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BAUrE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,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AQ,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,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;AAW3C,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,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.12df754",
3
+ "version": "0.8.2-main.30e4dbb",
4
4
  "description": "A table component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -51,31 +51,33 @@
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.12df754",
56
- "@dxos/debug": "0.8.2-main.12df754",
57
- "@dxos/echo-schema": "0.8.2-main.12df754",
58
- "@dxos/keys": "0.8.2-main.12df754",
59
- "@dxos/effect": "0.8.2-main.12df754",
60
- "@dxos/lit-grid": "0.8.2-main.12df754",
61
- "@dxos/invariant": "0.8.2-main.12df754",
62
- "@dxos/live-object": "0.8.2-main.12df754",
63
- "@dxos/plugin-search": "0.8.2-main.12df754",
64
- "@dxos/log": "0.8.2-main.12df754",
65
- "@dxos/plugin-space": "0.8.2-main.12df754",
66
- "@dxos/react-client": "0.8.2-main.12df754",
67
- "@dxos/react-ui-editor": "0.8.2-main.12df754",
68
- "@dxos/react-ui-attention": "0.8.2-main.12df754",
69
- "@dxos/react-ui-grid": "0.8.2-main.12df754",
70
- "@dxos/react-ui-menu": "0.8.2-main.12df754",
71
- "@dxos/react-ui-form": "0.8.2-main.12df754",
72
- "@dxos/react-ui-stack": "0.8.2-main.12df754",
73
- "@dxos/react-ui-searchlist": "0.8.2-main.12df754",
74
- "@dxos/react-ui-types": "0.8.2-main.12df754",
75
- "@dxos/react-ui-tag-picker": "0.8.2-main.12df754",
76
- "@dxos/schema": "0.8.2-main.12df754",
77
- "@dxos/react-ui-syntax-highlighter": "0.8.2-main.12df754",
78
- "@dxos/util": "0.8.2-main.12df754"
56
+ "@dxos/context": "0.8.2-main.30e4dbb",
57
+ "@dxos/debug": "0.8.2-main.30e4dbb",
58
+ "@dxos/echo": "0.8.2-main.30e4dbb",
59
+ "@dxos/effect": "0.8.2-main.30e4dbb",
60
+ "@dxos/echo-schema": "0.8.2-main.30e4dbb",
61
+ "@dxos/invariant": "0.8.2-main.30e4dbb",
62
+ "@dxos/keys": "0.8.2-main.30e4dbb",
63
+ "@dxos/lit-grid": "0.8.2-main.30e4dbb",
64
+ "@dxos/live-object": "0.8.2-main.30e4dbb",
65
+ "@dxos/log": "0.8.2-main.30e4dbb",
66
+ "@dxos/plugin-search": "0.8.2-main.30e4dbb",
67
+ "@dxos/plugin-space": "0.8.2-main.30e4dbb",
68
+ "@dxos/react-client": "0.8.2-main.30e4dbb",
69
+ "@dxos/react-ui-attention": "0.8.2-main.30e4dbb",
70
+ "@dxos/react-ui-editor": "0.8.2-main.30e4dbb",
71
+ "@dxos/react-ui-grid": "0.8.2-main.30e4dbb",
72
+ "@dxos/react-ui-menu": "0.8.2-main.30e4dbb",
73
+ "@dxos/react-ui-form": "0.8.2-main.30e4dbb",
74
+ "@dxos/react-ui-searchlist": "0.8.2-main.30e4dbb",
75
+ "@dxos/react-ui-stack": "0.8.2-main.30e4dbb",
76
+ "@dxos/react-ui-syntax-highlighter": "0.8.2-main.30e4dbb",
77
+ "@dxos/schema": "0.8.2-main.30e4dbb",
78
+ "@dxos/util": "0.8.2-main.30e4dbb",
79
+ "@dxos/react-ui-types": "0.8.2-main.30e4dbb",
80
+ "@dxos/react-ui-tag-picker": "0.8.2-main.30e4dbb"
79
81
  },
80
82
  "devDependencies": {
81
83
  "@phosphor-icons/react": "^2.1.5",
@@ -86,19 +88,19 @@
86
88
  "react": "~18.2.0",
87
89
  "react-dom": "~18.2.0",
88
90
  "vite": "5.4.7",
89
- "@dxos/random": "0.8.2-main.12df754",
90
- "@dxos/echo-signals": "0.8.2-main.12df754",
91
- "@dxos/react-ui": "0.8.2-main.12df754",
92
- "@dxos/react-ui-theme": "0.8.2-main.12df754",
93
- "@dxos/storybook-utils": "0.8.2-main.12df754",
94
- "@dxos/test-utils": "0.8.2-main.12df754"
91
+ "@dxos/echo-signals": "0.8.2-main.30e4dbb",
92
+ "@dxos/random": "0.8.2-main.30e4dbb",
93
+ "@dxos/react-ui": "0.8.2-main.30e4dbb",
94
+ "@dxos/react-ui-theme": "0.8.2-main.30e4dbb",
95
+ "@dxos/storybook-utils": "0.8.2-main.30e4dbb",
96
+ "@dxos/test-utils": "0.8.2-main.30e4dbb"
95
97
  },
96
98
  "peerDependencies": {
97
99
  "@phosphor-icons/react": "^2.1.5",
98
100
  "react": "~18.2.0",
99
101
  "react-dom": "~18.2.0",
100
- "@dxos/react-ui": "0.8.2-main.12df754",
101
- "@dxos/react-ui-theme": "0.8.2-main.12df754"
102
+ "@dxos/react-ui": "0.8.2-main.30e4dbb",
103
+ "@dxos/react-ui-theme": "0.8.2-main.30e4dbb"
102
104
  },
103
105
  "publishConfig": {
104
106
  "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;
@@ -27,8 +27,6 @@ type DynamicTableProps = ThemedClassName<{
27
27
 
28
28
  /**
29
29
  * Properties define both the schema and display characteristics of the table columns.
30
- *
31
- * @deprecated Use Table.
32
30
  */
33
31
  // TODO(burdon): Instead of creating component variants, create helpers/hooks that normalize the props.
34
32
  // TODO(burdon): Warning: Cannot update a component (`DynamicTable`) while rendering a different component (`DynamicTable`).
@@ -28,8 +28,7 @@ import { TableType } from '../../types';
28
28
  import { initializeTable } from '../../util';
29
29
  import { TableToolbar } from '../TableToolbar';
30
30
 
31
- // NOTE(ZaymonFC): We rely on this seed being 0 in the smoke tests.
32
- faker.seed(0);
31
+ faker.seed(0); // NOTE(ZaymonFC): Required for smoke tests.
33
32
 
34
33
  /**
35
34
  * Custom hook to create and manage a test table model for storybook demonstrations.
@@ -233,8 +232,8 @@ const meta: Meta<StoryProps> = {
233
232
  });
234
233
  },
235
234
  }),
235
+ withLayout({ fullscreen: true }),
236
236
  withTheme,
237
- withLayout({ fullscreen: true, tooltips: true }),
238
237
  ],
239
238
  };
240
239
 
@@ -247,7 +246,7 @@ export const StaticSchema: StoryObj = {
247
246
  parameters: { translations },
248
247
  decorators: [
249
248
  withClientProvider({
250
- types: [TableType, ViewType, Testing.Contact, Testing.Org],
249
+ types: [TableType, ViewType, Testing.Contact, Testing.Organization],
251
250
  createIdentity: true,
252
251
  createSpace: true,
253
252
  onSpaceCreated: async ({ client, space }) => {
@@ -257,12 +256,12 @@ export const StaticSchema: StoryObj = {
257
256
  const factory = createObjectFactory(space.db, faker as any);
258
257
  await factory([
259
258
  { type: Testing.Contact, count: 10 },
260
- { type: Testing.Org, count: 1 },
259
+ { type: Testing.Organization, count: 1 },
261
260
  ]);
262
261
  },
263
262
  }),
263
+ withLayout({ fullscreen: true }),
264
264
  withTheme,
265
- withLayout({ fullscreen: true, tooltips: true }),
266
265
  ],
267
266
  };
268
267
 
@@ -317,7 +316,7 @@ export const Tags: Meta<StoryProps> = {
317
316
  });
318
317
  },
319
318
  }),
319
+ withLayout({ fullscreen: true }),
320
320
  withTheme,
321
- withLayout({ fullscreen: true, tooltips: true }),
322
321
  ],
323
322
  };
@@ -19,27 +19,29 @@ import { invariant } from '@dxos/invariant';
19
19
  import { Filter } from '@dxos/react-client/echo';
20
20
  import { useTranslation } from '@dxos/react-ui';
21
21
  import { useAttention } from '@dxos/react-ui-attention';
22
- import { closestCell, type DxGridElement, type DxGridPosition, type GridContentProps, Grid } from '@dxos/react-ui-grid';
22
+ import {
23
+ closestCell,
24
+ type DxGridElement,
25
+ type DxGridPosition,
26
+ type GridContentProps,
27
+ Grid,
28
+ type DxGridPlane,
29
+ type DxGridPlaneRange,
30
+ gridSeparatorInlineEnd,
31
+ gridSeparatorBlockEnd,
32
+ } from '@dxos/react-ui-grid';
23
33
  import { mx } from '@dxos/react-ui-theme';
24
34
  import { isNotFalsy, safeParseInt } from '@dxos/util';
25
35
 
26
36
  import { ColumnActionsMenu } from './ColumnActionsMenu';
27
37
  import { ColumnSettings } from './ColumnSettings';
28
38
  import { CreateRefPanel } from './CreateRefPanel';
29
- import { RefPanel } from './RefPanel';
30
39
  import { RowActionsMenu } from './RowActionsMenu';
31
40
  import { ModalController, type TableModel, type TablePresentation } from '../../model';
32
41
  import { translationKey } from '../../translations';
33
42
  import { tableButtons, tableControls } from '../../util';
34
43
  import { createOption, TableCellEditor, type TableCellEditorProps } from '../TableCellEditor';
35
44
 
36
- // NOTE(Zan): These fragments add border to inline-end and block-end of the grid using pseudo-elements.
37
- // These are offset by 1px to avoid double borders in planks.
38
- const inlineEndLine =
39
- '[&>.dx-grid]:relative [&>.dx-grid]:after:absolute [&>.dx-grid]:after:inset-block-0 [&>.dx-grid]:after:-inline-end-px [&>.dx-grid]:after:is-px [&>.dx-grid]:after:bg-separator';
40
- const blockEndLine =
41
- '[&>.dx-grid]:before:absolute [&>.dx-grid]:before:inset-inline-0 [&>.dx-grid]:before:-block-end-px [&>.dx-grid]:before:bs-px [&>.dx-grid]:before:bg-separator';
42
-
43
45
  //
44
46
  // Table.Root
45
47
  //
@@ -98,20 +100,17 @@ const TableMain = forwardRef<TableController, TableMainProps>(
98
100
  };
99
101
  }, [model]);
100
102
 
101
- // TODO(burdon): Replace useEffect below.
102
- // const getCells = useCallback<GridContentProps['getCells']>(
103
- // (range: DxGridRange, plane: DxGridPlane) => presentation?.getCells(range, plane) ?? {},
104
- // [presentation],
105
- // );
103
+ const getCells = useCallback<NonNullable<GridContentProps['getCells']>>(
104
+ (range: DxGridPlaneRange, plane: DxGridPlane) => presentation?.getCells(range, plane) ?? {},
105
+ [presentation],
106
+ );
106
107
 
107
108
  useEffect(() => {
108
109
  if (!presentation || !dxGrid) {
109
110
  return;
110
111
  }
111
-
112
- // TODO(burdon): Pass to Grid.Content?
113
- dxGrid.getCells = (range, plane) => presentation.getCells(range, plane);
114
- }, [presentation, dxGrid]);
112
+ dxGrid.getCells = getCells;
113
+ }, [presentation, dxGrid, getCells]);
115
114
 
116
115
  /**
117
116
  * Provides an external controller that can be called to repaint the table.
@@ -181,10 +180,6 @@ const TableMain = forwardRef<TableController, TableMainProps>(
181
180
  modals.showColumnCreator();
182
181
  break;
183
182
  }
184
- case 'referencedCell': {
185
- modals.showReferencePanel(data.targetId, data.schemaId);
186
- break;
187
- }
188
183
  case 'sort': {
189
184
  model?.sorting?.toggleSort(data.fieldId);
190
185
  break;
@@ -356,7 +351,7 @@ const TableMain = forwardRef<TableController, TableMainProps>(
356
351
  onQuery={handleQuery}
357
352
  />
358
353
  <Grid.Content
359
- className={mx('[--dx-grid-base:var(--surface-bg)]', inlineEndLine, blockEndLine)}
354
+ className={mx('[--dx-grid-base:var(--surface-bg)]', gridSeparatorInlineEnd, gridSeparatorBlockEnd)}
360
355
  frozen={frozen}
361
356
  // getCells={getCells}
362
357
  columns={model.columnMeta.value}
@@ -373,7 +368,6 @@ const TableMain = forwardRef<TableController, TableMainProps>(
373
368
  <ColumnActionsMenu model={model} modals={modals} />
374
369
  <ColumnSettings model={model} modals={modals} onNewColumn={handleNewColumn} />
375
370
  <CreateRefPanel model={model} modals={modals} />
376
- <RefPanel model={model} modals={modals} />
377
371
  </Grid.Root>
378
372
  );
379
373
  },
@@ -5,20 +5,21 @@
5
5
  import '@dxos-theme';
6
6
 
7
7
  import { type StoryObj, type Meta } from '@storybook/react';
8
+ import { SchemaAST } from 'effect';
8
9
  import React, { useEffect, useMemo } from 'react';
9
10
 
10
- import { AST, type BaseObject, ImmutableSchema, type BaseSchema, type HasId } from '@dxos/echo-schema';
11
+ import { type BaseObject, ImmutableSchema, type BaseSchema, type HasId } from '@dxos/echo-schema';
11
12
  import { getAnnotation } from '@dxos/effect';
12
13
  import { faker } from '@dxos/random';
13
- import { live, makeRef, type Live } from '@dxos/react-client/echo';
14
- import { withClientProvider } from '@dxos/react-client/testing';
15
- import { createView, ViewProjection, ViewType } from '@dxos/schema';
16
- import { createGenerator, Testing, type ValueGenerator } from '@dxos/schema/testing';
14
+ import { live, makeRef } from '@dxos/react-client/echo';
15
+ import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
16
+ import { DataType, createView, ViewProjection, ViewType } from '@dxos/schema';
17
+ import { createAsyncGenerator, type ValueGenerator } from '@dxos/schema/testing';
17
18
  import { withLayout, withTheme } from '@dxos/storybook-utils';
18
19
 
19
20
  import { Table } from './Table';
20
21
  import { useTableModel } from '../../hooks';
21
- import { TablePresentation, type TableRow } from '../../model';
22
+ import { type TableFeatures, TablePresentation, type TableRow } from '../../model';
22
23
  import translations from '../../translations';
23
24
  import { TableType } from '../../types';
24
25
 
@@ -30,10 +31,12 @@ const generator: ValueGenerator = faker as any;
30
31
  // TODO(burdon): Reconcile schemas types and utils (see API PR).
31
32
  // TODO(burdon): Base type for T (with id); see ECHO API PR?
32
33
  const useTestModel = <T extends BaseObject & HasId>(schema: BaseSchema<T>, count: number) => {
34
+ const { space } = useClientProvider();
35
+
33
36
  const table = useMemo(() => {
34
- // const { typename } = pipe(schema.ast, AST.getAnnotation<TypeAnnotation>(TypeAnnotationId), Option.getOrThrow);
37
+ // const { typename } = pipe(schema.ast, SchemaAST.getAnnotation<TypeAnnotation>(TypeAnnotationId), Option.getOrThrow);
35
38
  const typename = schema.typename;
36
- const name = getAnnotation<string>(AST.TitleAnnotationId)(schema.ast) ?? typename;
39
+ const name = getAnnotation<string>(SchemaAST.TitleAnnotationId)(schema.ast) ?? typename;
37
40
  const view = createView({ name, typename, jsonSchema: schema.jsonSchema });
38
41
  return live(TableType, { view: makeRef(view) });
39
42
  }, [schema]);
@@ -47,16 +50,24 @@ const useTestModel = <T extends BaseObject & HasId>(schema: BaseSchema<T>, count
47
50
  return new ViewProjection(schema.jsonSchema, table.view.target);
48
51
  }, [schema, table]);
49
52
 
50
- const model = useTableModel<TableRow>({ table, projection, rows: [] });
53
+ const features = useMemo<TableFeatures>(
54
+ () => ({ schemaEditable: false, dataEditable: true, selection: { enabled: false } }),
55
+ [],
56
+ );
57
+
58
+ const model = useTableModel<TableRow>({ table, projection, rows: [], features });
51
59
  useEffect(() => {
52
- if (!model) {
60
+ if (!model || !space) {
53
61
  return;
54
62
  }
55
63
 
56
- const objectGenerator = createGenerator(generator, schema, { optional: true });
57
- const objects: Live<T>[] = Array.from({ length: count }).map(() => objectGenerator.createObject());
58
- model.setRows(objects);
59
- }, [model]);
64
+ const objectGenerator = createAsyncGenerator(generator, schema, { optional: true, db: space?.db });
65
+ void objectGenerator.createObjects(count).then((objects) => {
66
+ model.setRows(objects);
67
+ });
68
+ }, [model, space]);
69
+
70
+ console.log(projection?.getFieldProjections());
60
71
 
61
72
  const presentation = useMemo(() => {
62
73
  if (!model) {
@@ -71,21 +82,20 @@ const useTestModel = <T extends BaseObject & HasId>(schema: BaseSchema<T>, count
71
82
 
72
83
  const DefaultStory = () => {
73
84
  // TODO(burdon): Remove need for ImmutableSchema wrapper at API-level.
74
- const orgSchema = useMemo(() => new ImmutableSchema(Testing.Org), []);
75
- const { model: orgModel, presentation: orgPresentation } = useTestModel<Testing.Org>(orgSchema, 50);
85
+ const orgSchema = useMemo(() => new ImmutableSchema(DataType.Organization), []);
86
+ const { model: orgModel, presentation: orgPresentation } = useTestModel<DataType.Organization>(orgSchema, 50);
76
87
 
77
88
  // TODO(burdon): Generate links with references.
78
- const contactSchema = useMemo(() => new ImmutableSchema(Testing.Contact), []);
79
- const { model: contactModel, presentation: contactPresentation } = useTestModel<Testing.Contact>(contactSchema, 50);
89
+ const contactSchema = useMemo(() => new ImmutableSchema(DataType.Person), []);
90
+ const { model: contactModel, presentation: contactPresentation } = useTestModel<DataType.Person>(contactSchema, 50);
80
91
 
81
- // TODO(burdon): Scrolling isn't working.
82
92
  return (
83
- <div className='grow grid grid-cols-2 divide-x divide-separator'>
93
+ <div className='is-full bs-full grid grid-cols-2 divide-x divide-separator'>
84
94
  <Table.Root>
85
- <Table.Main model={orgModel} presentation={orgPresentation} />
95
+ <Table.Main model={orgModel} presentation={orgPresentation} ignoreAttention />
86
96
  </Table.Root>
87
97
  <Table.Root>
88
- <Table.Main model={contactModel} presentation={contactPresentation} />
98
+ <Table.Main model={contactModel} presentation={contactPresentation} ignoreAttention />
89
99
  </Table.Root>
90
100
  </div>
91
101
  );
@@ -97,12 +107,12 @@ const meta: Meta<typeof DefaultStory> = {
97
107
  parameters: { translations },
98
108
  decorators: [
99
109
  withClientProvider({
100
- types: [TableType, ViewType, Testing.Org, Testing.Contact],
110
+ types: [TableType, ViewType, DataType.Organization, DataType.Person],
101
111
  createIdentity: true,
102
112
  createSpace: true,
103
113
  }),
104
114
  withTheme,
105
- withLayout({ fullscreen: true, tooltips: true }),
115
+ withLayout({ fullscreen: true }),
106
116
  ],
107
117
  };
108
118
 
@@ -107,7 +107,7 @@ const meta: Meta<StoryProps> = {
107
107
  },
108
108
  }),
109
109
  withTheme,
110
- withLayout({ tooltips: true }),
110
+ withLayout(),
111
111
  ],
112
112
  };
113
113
 
@@ -10,7 +10,6 @@ import {
10
10
  createGapSeparator,
11
11
  createMenuAction,
12
12
  type MenuAction,
13
- type MenuActionHandler,
14
13
  MenuProvider,
15
14
  ToolbarMenu,
16
15
  useMenuActions,
@@ -27,18 +26,18 @@ export type TableToolbarActionType = 'add-row' | 'comment' | 'save-view';
27
26
  type TableToolbarState = Partial<{ viewDirty: boolean }>;
28
27
 
29
28
  export type TableToolbarProps = ThemedClassName<
30
- TableToolbarState & { onAction?: MenuActionHandler<TableToolbarAction>; attendableId?: string }
29
+ TableToolbarState & { onAction: (action: TableToolbarAction) => void; attendableId?: string }
31
30
  >;
32
31
 
33
- const createTableToolbarActions = (state: TableToolbarState) => {
34
- const add = createMenuAction<TableToolbarActionProperties>('add-row', {
35
- type: 'add-row',
32
+ const createTableToolbarActions = (state: TableToolbarState, onAction: (action: TableToolbarAction) => void) => {
33
+ const add = createMenuAction<TableToolbarActionProperties>('add-row', () => onAction(add), {
34
+ type: 'add-row' as const,
36
35
  icon: 'ph--plus--regular',
37
36
  label: ['add row', { ns: translationKey }],
38
37
  testId: 'table.toolbar.add-row',
39
38
  });
40
- const save = createMenuAction<TableToolbarActionProperties>('save-view', {
41
- type: 'save-view',
39
+ const save = createMenuAction<TableToolbarActionProperties>('save-view', () => onAction(save), {
40
+ type: 'save-view' as const,
42
41
  icon: 'ph--floppy-disk--regular',
43
42
  label: ['save view label', { ns: translationKey }],
44
43
  testId: 'table.toolbar.save-view',
@@ -46,8 +45,8 @@ const createTableToolbarActions = (state: TableToolbarState) => {
46
45
  hidden: !state.viewDirty,
47
46
  });
48
47
  const gap = createGapSeparator();
49
- const comment = createMenuAction('comment', {
50
- type: 'comment',
48
+ const comment = createMenuAction('comment', () => onAction(comment), {
49
+ type: 'comment' as const,
51
50
  icon: 'ph--chat-text--regular',
52
51
  label: ['create comment', { ns: translationKey }],
53
52
  testId: 'table.toolbar.comment',
@@ -61,11 +60,11 @@ const createTableToolbarActions = (state: TableToolbarState) => {
61
60
 
62
61
  export const TableToolbar = ({ classNames, viewDirty, attendableId, onAction }: TableToolbarProps) => {
63
62
  const state = useMemo(() => live<TableToolbarState>({ viewDirty }), []);
64
- const actionsCreator = useCallback(() => createTableToolbarActions(state), [state]);
63
+ const actionsCreator = useCallback(() => createTableToolbarActions(state, onAction), [state, onAction]);
65
64
  const menu = useMenuActions(actionsCreator);
66
65
 
67
66
  return (
68
- <MenuProvider {...menu} attendableId={attendableId} onAction={onAction as MenuActionHandler}>
67
+ <MenuProvider {...menu} attendableId={attendableId}>
69
68
  <ToolbarMenu classNames={classNames} />
70
69
  </MenuProvider>
71
70
  );
@@ -2,9 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  import { useEffect } from 'react';
6
7
 
7
- import { setValue, toJsonSchema, S, TypeEnum, TypedObject, FormatEnum } from '@dxos/echo-schema';
8
+ import { setValue, toJsonSchema, TypeEnum, TypedObject, FormatEnum, ObjectId } from '@dxos/echo-schema';
8
9
  import { faker } from '@dxos/random';
9
10
  import { live, makeRef } from '@dxos/react-client/echo';
10
11
  import { createView, type ViewProjection } from '@dxos/schema';
@@ -12,11 +13,11 @@ import { createView, type ViewProjection } from '@dxos/schema';
12
13
  import { TableType } from '../types';
13
14
 
14
15
  export const TestSchema = TypedObject({ typename: 'example.com/type/Test', version: '0.1.0' })({
15
- id: S.String,
16
- name: S.optional(S.String),
17
- age: S.optional(S.Number),
18
- active: S.optional(S.Boolean),
19
- netWorth: S.optional(S.Number),
16
+ id: ObjectId,
17
+ name: Schema.optional(Schema.String),
18
+ age: Schema.optional(Schema.Number),
19
+ active: Schema.optional(Schema.Boolean),
20
+ netWorth: Schema.optional(Schema.Number),
20
21
  });
21
22
 
22
23
  export const createTable = (schema = TestSchema) => {
@@ -3,9 +3,10 @@
3
3
  //
4
4
 
5
5
  import { computed } from '@preact/signals-core';
6
+ import { Schema } from 'effect';
6
7
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
7
8
 
8
- import { S, TypedObject } from '@dxos/echo-schema';
9
+ import { TypedObject } from '@dxos/echo-schema';
9
10
  import { updateCounter } from '@dxos/echo-schema/testing';
10
11
  import { registerSignalsRuntime } from '@dxos/echo-signals';
11
12
  import { createEchoSchema } from '@dxos/live-object/testing';
@@ -99,8 +100,8 @@ describe('TableModel', () => {
99
100
  });
100
101
 
101
102
  class Test extends TypedObject({ typename: 'example.com/type/Test', version: '0.1.0' })({
102
- title: S.String,
103
- completed: S.Boolean,
103
+ title: Schema.String,
104
+ completed: Schema.Boolean,
104
105
  }) {}
105
106
 
106
107
  const createTableModel = (props: Partial<TableModelProps> = {}): TableModel => {