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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/lib/browser/{chunk-YWNRUF4J.mjs → chunk-PFFO5LYM.mjs} +7 -6
  2. package/dist/lib/browser/chunk-PFFO5LYM.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +290 -105
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +1 -1
  7. package/dist/lib/node/{chunk-TGG6OZ54.cjs → chunk-VREQOYRW.cjs} +9 -8
  8. package/dist/lib/node/chunk-VREQOYRW.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +263 -81
  10. package/dist/lib/node/index.cjs.map +4 -4
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/types/index.cjs +3 -3
  13. package/dist/lib/node/types/index.cjs.map +1 -1
  14. package/dist/lib/node-esm/{chunk-KKLP54L3.mjs → chunk-34JG3SDI.mjs} +7 -6
  15. package/dist/lib/node-esm/chunk-34JG3SDI.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +290 -105
  17. package/dist/lib/node-esm/index.mjs.map +4 -4
  18. package/dist/lib/node-esm/meta.json +1 -1
  19. package/dist/lib/node-esm/types/index.mjs +1 -1
  20. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
  21. package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
  22. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
  23. package/dist/types/src/components/Table/DynamicTable.d.ts +3 -4
  24. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
  25. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  26. package/dist/types/src/components/Table/Table.d.ts +2 -0
  27. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  28. package/dist/types/src/components/Table/Table.stories.d.ts +1 -0
  29. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  30. package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -1
  31. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +13 -0
  32. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -0
  33. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +3 -0
  34. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  35. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  36. package/dist/types/src/components/TableCellEditor/extension.d.ts.map +1 -1
  37. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -2
  38. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  39. package/dist/types/src/components/testing.d.ts +39 -39
  40. package/dist/types/src/components/testing.d.ts.map +1 -1
  41. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  42. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  43. package/dist/types/src/model/selection-model.d.ts.map +1 -1
  44. package/dist/types/src/model/table-model.d.ts.map +1 -1
  45. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  46. package/dist/types/src/types/table.d.ts +44 -43
  47. package/dist/types/src/types/table.d.ts.map +1 -1
  48. package/dist/types/src/util/dynamic-table.d.ts +4 -3
  49. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  50. package/dist/types/src/util/index.d.ts +1 -0
  51. package/dist/types/src/util/index.d.ts.map +1 -1
  52. package/dist/types/src/util/schema.d.ts +12 -0
  53. package/dist/types/src/util/schema.d.ts.map +1 -0
  54. package/dist/types/src/util/signals.d.ts.map +1 -1
  55. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  56. package/dist/types/src/util/table.d.ts +2 -2
  57. package/dist/types/src/util/table.d.ts.map +1 -1
  58. package/dist/types/src/util/tag.d.ts.map +1 -1
  59. package/dist/types/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +34 -33
  61. package/src/components/Table/CreateRefPanel.tsx +3 -3
  62. package/src/components/Table/DynamicTable.stories.tsx +2 -2
  63. package/src/components/Table/DynamicTable.tsx +4 -5
  64. package/src/components/Table/Table.stories.tsx +65 -19
  65. package/src/components/Table/Table.tsx +8 -5
  66. package/src/components/Table/relations.stories.tsx +16 -18
  67. package/src/components/TableCellEditor/FormCellEditor.tsx +94 -0
  68. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +8 -7
  69. package/src/components/TableCellEditor/TableCellEditor.tsx +45 -4
  70. package/src/components/TableToolbar/TableToolbar.tsx +10 -11
  71. package/src/components/testing.ts +7 -6
  72. package/src/model/table-model.test.ts +4 -3
  73. package/src/model/table-presentation.test.ts +4 -3
  74. package/src/model/table-presentation.ts +52 -6
  75. package/src/types/table.ts +15 -7
  76. package/src/util/dynamic-table.ts +7 -4
  77. package/src/util/index.ts +1 -0
  78. package/src/util/schema.ts +36 -0
  79. package/src/util/table.ts +11 -10
  80. package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +0 -7
  81. package/dist/lib/node/chunk-TGG6OZ54.cjs.map +0 -7
  82. package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +0 -7
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  TableSchema,
4
4
  TableType
5
- } from "./chunk-KKLP54L3.mjs";
5
+ } from "./chunk-34JG3SDI.mjs";
6
6
 
7
7
  // packages/ui/react-ui-table/src/translations.ts
8
8
  var translationKey = "table";
@@ -37,9 +37,9 @@ var translations_default = [
37
37
  ];
38
38
 
39
39
  // packages/ui/react-ui-table/src/components/Table/Table.tsx
40
- import React6, { forwardRef, useCallback as useCallback4, useImperativeHandle, useState as useState2, useMemo as useMemo4, useEffect as useEffect2 } from "react";
40
+ import React7, { forwardRef, useCallback as useCallback5, useImperativeHandle, useState as useState2, useMemo as useMemo5, useEffect as useEffect3 } from "react";
41
41
  import { getValue as getValue4 } from "@dxos/echo-schema";
42
- import { invariant as invariant3 } from "@dxos/invariant";
42
+ import { invariant as invariant4 } from "@dxos/invariant";
43
43
  import { Filter } from "@dxos/react-client/echo";
44
44
  import { useTranslation as useTranslation3 } from "@dxos/react-ui";
45
45
  import { useAttention } from "@dxos/react-ui-attention";
@@ -151,8 +151,8 @@ var ColumnSettings = ({ model, modals, onNewColumn }) => {
151
151
  };
152
152
 
153
153
  // packages/ui/react-ui-table/src/components/Table/CreateRefPanel.tsx
154
+ import { Schema } from "effect";
154
155
  import React3, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
155
- import { S } from "@dxos/echo-schema";
156
156
  import { live } from "@dxos/react-client/echo";
157
157
  import { Popover } from "@dxos/react-ui";
158
158
  import { Form } from "@dxos/react-ui-form";
@@ -169,7 +169,7 @@ var CreateRefPanel = ({ model, modals, __gridScope }) => {
169
169
  typename: state.typename
170
170
  }).runSync();
171
171
  if (schema2) {
172
- const omit = S.omit("id");
172
+ const omit = Schema.omit("id");
173
173
  return omit(schema2);
174
174
  }
175
175
  }, [
@@ -258,7 +258,7 @@ import { computed as computed3, effect as effect2, signal as signal3 } from "@pr
258
258
  import { Resource as Resource2 } from "@dxos/context";
259
259
  import { FormatEnum as FormatEnum3, getValue as getValue2, setValue } from "@dxos/echo-schema";
260
260
  import { invariant } from "@dxos/invariant";
261
- import { isLiveObject, makeRef as makeRef3 } from "@dxos/live-object";
261
+ import { isLiveObject, makeRef as makeRef2 } from "@dxos/live-object";
262
262
  import { formatForEditing, parseValue } from "@dxos/react-ui-form";
263
263
 
264
264
  // packages/ui/react-ui-table/src/model/selection-model.ts
@@ -266,9 +266,10 @@ import { computed, effect, signal } from "@preact/signals-core";
266
266
  import { Resource } from "@dxos/context";
267
267
 
268
268
  // packages/ui/react-ui-table/src/util/dynamic-table.ts
269
+ import { getTypename, toJsonSchema } from "@dxos/echo-schema";
269
270
  import { live as live2, makeRef } from "@dxos/live-object";
270
271
  import { createView, getSchemaFromPropertyDefinitions, ViewProjection } from "@dxos/schema";
271
- var getBaseSchems = ({ typename, properties, jsonSchema, schema }) => {
272
+ var getBaseSchema = ({ typename, properties, jsonSchema, schema }) => {
272
273
  if (typename && properties) {
273
274
  const schema2 = getSchemaFromPropertyDefinitions(typename, properties);
274
275
  return {
@@ -277,8 +278,8 @@ var getBaseSchems = ({ typename, properties, jsonSchema, schema }) => {
277
278
  };
278
279
  } else if (schema) {
279
280
  return {
280
- typename: schema.typename,
281
- jsonSchema: schema.jsonSchema
281
+ typename: getTypename(schema),
282
+ jsonSchema: toJsonSchema(schema)
282
283
  };
283
284
  } else if (typename && jsonSchema) {
284
285
  return {
@@ -345,9 +346,10 @@ var setProperties = (view, projection, properties) => {
345
346
  var touch = (value) => value;
346
347
 
347
348
  // packages/ui/react-ui-table/src/util/table.ts
348
- import { AST, Format, FormatEnum, S as S2, TypedObject, TypeEnum } from "@dxos/echo-schema";
349
+ import { Schema as Schema2, SchemaAST } from "effect";
350
+ import { Format, FormatEnum, Ref, TypedObject, TypeEnum } from "@dxos/echo-schema";
349
351
  import { PublicKey } from "@dxos/react-client";
350
- import { live as live3, makeRef as makeRef2 } from "@dxos/react-client/echo";
352
+ import { live as live3 } from "@dxos/react-client/echo";
351
353
  import { createFieldId, createView as createView2, getSchemaProperties, ViewProjection as ViewProjection2 } from "@dxos/schema";
352
354
  var initializeTable = async ({ client, space, table, typename, initialRow = true }) => {
353
355
  if (typename) {
@@ -356,7 +358,7 @@ var initializeTable = async ({ client, space, table, typename, initialRow = true
356
358
  throw new Error(`Schema not found: ${typename}`);
357
359
  }
358
360
  const fields = getSchemaProperties(schema.ast).map((prop) => prop.name);
359
- table.view = makeRef2(createView2({
361
+ table.view = Ref.make(createView2({
360
362
  // TODO(ZaymonFC): Don't hardcode name?
361
363
  name: "View",
362
364
  typename: schema.typename,
@@ -369,7 +371,7 @@ var initializeTable = async ({ client, space, table, typename, initialRow = true
369
371
  ContactSchema
370
372
  ]);
371
373
  const fields = ContactFields;
372
- table.view = makeRef2(createView2({
374
+ table.view = Ref.make(createView2({
373
375
  name: "View",
374
376
  typename: schema.typename,
375
377
  jsonSchema: schema.jsonSchema,
@@ -386,13 +388,13 @@ var ContactSchema = TypedObject({
386
388
  typename: `example.com/type/${PublicKey.random().truncate()}`,
387
389
  version: "0.1.0"
388
390
  })({
389
- name: S2.optional(S2.String).annotations({
390
- [AST.TitleAnnotationId]: "Name"
391
+ name: Schema2.optional(Schema2.String).annotations({
392
+ [SchemaAST.TitleAnnotationId]: "Name"
391
393
  }),
392
- active: S2.optional(S2.Boolean),
393
- email: S2.optional(Format.Email),
394
- salary: S2.optional(Format.Currency()).annotations({
395
- [AST.TitleAnnotationId]: "Salary"
394
+ active: Schema2.optional(Schema2.Boolean),
395
+ email: Schema2.optional(Format.Email),
396
+ salary: Schema2.optional(Format.Currency()).annotations({
397
+ [SchemaAST.TitleAnnotationId]: "Salary"
396
398
  })
397
399
  });
398
400
  var ContactFields = [
@@ -583,6 +585,21 @@ var tableControls = {
583
585
  }
584
586
  };
585
587
 
588
+ // packages/ui/react-ui-table/src/util/schema.ts
589
+ import { Schema as Schema3 } from "effect";
590
+ import { isTypeLiteral, TypeLiteral } from "effect/SchemaAST";
591
+ var narrowSchema = (schema, paths) => {
592
+ const ast = schema?.ast;
593
+ if (isTypeLiteral(ast)) {
594
+ const propertySignatures = ast.propertySignatures.filter((signature) => paths.includes(signature.name.toString()));
595
+ if (propertySignatures.length > 0) {
596
+ const narrowType = new TypeLiteral(propertySignatures, []);
597
+ return Schema3.make(narrowType);
598
+ }
599
+ }
600
+ return void 0;
601
+ };
602
+
586
603
  // packages/ui/react-ui-table/src/model/selection-model.ts
587
604
  var SelectionModel = class extends Resource {
588
605
  constructor(_rows, _selectionMode, _onSelectionChanged) {
@@ -951,7 +968,7 @@ var TableModel = class extends Resource2 {
951
968
  switch (props.format) {
952
969
  case FormatEnum3.Ref: {
953
970
  if (isLiveObject(value)) {
954
- setValue(this._rows.value[rowIdx], field.path, makeRef3(value));
971
+ setValue(this._rows.value[rowIdx], field.path, makeRef2(value));
955
972
  }
956
973
  break;
957
974
  }
@@ -1275,7 +1292,8 @@ var ModalController = class {
1275
1292
 
1276
1293
  // packages/ui/react-ui-table/src/model/table-presentation.ts
1277
1294
  import { signal as signal5 } from "@preact/signals-core";
1278
- import { FormatEnum as FormatEnum4, getDXN, getValue as getValue3 } from "@dxos/echo-schema";
1295
+ import { isNotNullable } from "effect/Predicate";
1296
+ import { FormatEnum as FormatEnum4, getDXN, getValue as getValue3, TypeEnum as TypeEnum3 } from "@dxos/echo-schema";
1279
1297
  import { cellClassesForFieldType, formatForDisplay as formatForDisplay2 } from "@dxos/react-ui-form";
1280
1298
  import { toPlaneCellIndex } from "@dxos/react-ui-grid";
1281
1299
  import { mx } from "@dxos/react-ui-theme";
@@ -1337,6 +1355,9 @@ var TablePresentation = class {
1337
1355
  if (value == null) {
1338
1356
  return "";
1339
1357
  }
1358
+ if (props.type === "array") {
1359
+ return "";
1360
+ }
1340
1361
  switch (props.format) {
1341
1362
  case FormatEnum4.Boolean:
1342
1363
  case FormatEnum4.SingleSelect:
@@ -1374,6 +1395,33 @@ var TablePresentation = class {
1374
1395
  if (classes.length > 0) {
1375
1396
  cell.className = mx(classes.flat());
1376
1397
  }
1398
+ if (props.type === TypeEnum3.Array) {
1399
+ const targetArray = getValue3(obj, field.path);
1400
+ if (targetArray && Array.isArray(targetArray)) {
1401
+ const getLabel = (value) => {
1402
+ if (!value) {
1403
+ return void 0;
1404
+ }
1405
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1406
+ return String(value);
1407
+ }
1408
+ if (Array.isArray(value)) {
1409
+ return "Array";
1410
+ }
1411
+ if (typeof value === "object" && value.name) {
1412
+ return value.name;
1413
+ }
1414
+ if (typeof value === "object" && value.value) {
1415
+ return `${value.value}`;
1416
+ }
1417
+ return "Object";
1418
+ };
1419
+ const tags = targetArray.map(getLabel).filter(isNotNullable).map((title) => {
1420
+ return `<span class="dx-tag rounded-xl" data-hue="neutral">${title}</span>`;
1421
+ }).join("");
1422
+ cell.accessoryHtml = `<div role='none' class="flex flex-row gap-1 overflow-x-auto">${tags}</div>`;
1423
+ }
1424
+ }
1377
1425
  if (props.format === FormatEnum4.Ref && props.referenceSchema) {
1378
1426
  const targetObj = getValue3(obj, field.path)?.target;
1379
1427
  if (targetObj) {
@@ -1412,7 +1460,7 @@ var TablePresentation = class {
1412
1460
  return null;
1413
1461
  }).filter(Boolean).join(" ");
1414
1462
  if (tags) {
1415
- cell.accessoryHtml = tags;
1463
+ cell.accessoryHtml = `<div role='none' class="flex flex-row gap-1">${tags}</div>`;
1416
1464
  }
1417
1465
  }
1418
1466
  }
@@ -1457,7 +1505,7 @@ var TablePresentation = class {
1457
1505
  fieldId: field.id
1458
1506
  })}
1459
1507
  `,
1460
- className: "!bg-gridHeader"
1508
+ className: "!bg-toolbarSurface"
1461
1509
  };
1462
1510
  }
1463
1511
  return cells;
@@ -1508,7 +1556,7 @@ var TablePresentation = class {
1508
1556
  col: 0,
1509
1557
  row: 0
1510
1558
  })]: {
1511
- className: "!bg-gridHeader",
1559
+ className: "!bg-toolbarSurface",
1512
1560
  readonly: true,
1513
1561
  value: ""
1514
1562
  }
@@ -1524,7 +1572,7 @@ var TablePresentation = class {
1524
1572
  header: true,
1525
1573
  checked: this.model.selection.allRowsSeleted.value
1526
1574
  }),
1527
- className: "!bg-gridHeader",
1575
+ className: "!bg-toolbarSurface",
1528
1576
  readonly: true,
1529
1577
  value: ""
1530
1578
  }
@@ -1539,7 +1587,7 @@ var TablePresentation = class {
1539
1587
  accessoryHtml: this.model.features.schemaEditable ? tableButtons.addColumn.render({
1540
1588
  disabled: (this.model.view?.fields?.length ?? 0) >= VIEW_FIELD_LIMIT
1541
1589
  }) : void 0,
1542
- className: "!bg-gridHeader",
1590
+ className: "!bg-toolbarSurface",
1543
1591
  readonly: true,
1544
1592
  value: ""
1545
1593
  }
@@ -1570,14 +1618,109 @@ var cellClassesForRowSelection = (selected, selectionMode) => {
1570
1618
  };
1571
1619
 
1572
1620
  // packages/ui/react-ui-table/src/components/TableCellEditor/TableCellEditor.tsx
1573
- import React5, { useCallback as useCallback3, useMemo as useMemo3, useRef } from "react";
1574
- import { FormatEnum as FormatEnum5 } from "@dxos/echo-schema";
1575
- import { invariant as invariant2 } from "@dxos/invariant";
1621
+ import React6, { useCallback as useCallback4, useMemo as useMemo4, useRef as useRef2 } from "react";
1622
+ import { FormatEnum as FormatEnum5, TypeEnum as TypeEnum4 } from "@dxos/echo-schema";
1623
+ import { invariant as invariant3 } from "@dxos/invariant";
1576
1624
  import { useThemeContext } from "@dxos/react-ui";
1577
1625
  import { createMarkdownExtensions } from "@dxos/react-ui-editor";
1578
- import { cellQuery, editorKeys, parseCellIndex, useGridContext as useGridContext2, GridCellEditor } from "@dxos/react-ui-grid";
1626
+ import { cellQuery, editorKeys, parseCellIndex as parseCellIndex2, useGridContext as useGridContext3, GridCellEditor } from "@dxos/react-ui-grid";
1579
1627
  import { tagPickerExtension, createLinks } from "@dxos/react-ui-tag-picker";
1580
1628
 
1629
+ // packages/ui/react-ui-table/src/components/TableCellEditor/FormCellEditor.tsx
1630
+ import React5, { useCallback as useCallback3, useEffect as useEffect2, useMemo as useMemo3, useRef } from "react";
1631
+ import { getSnapshot } from "@dxos/echo-schema";
1632
+ import { invariant as invariant2 } from "@dxos/invariant";
1633
+ import { Popover as Popover2 } from "@dxos/react-ui";
1634
+ import { Form as Form2 } from "@dxos/react-ui-form";
1635
+ import { parseCellIndex, useGridContext as useGridContext2 } from "@dxos/react-ui-grid";
1636
+ import { getDeep, setDeep } from "@dxos/util";
1637
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/TableCellEditor/FormCellEditor.tsx";
1638
+ var FormCellEditor = ({ fieldProjection, model, schema, __gridScope }) => {
1639
+ const { editing, setEditing } = useGridContext2("ArrayEditor", __gridScope);
1640
+ const cellRef = useRef(null);
1641
+ useEffect2(() => {
1642
+ if (editing && editing.cellElement) {
1643
+ cellRef.current = editing.cellElement;
1644
+ }
1645
+ }, [
1646
+ editing?.cellElement
1647
+ ]);
1648
+ const narrowedSchema = useMemo3(() => {
1649
+ if (!schema) {
1650
+ return void 0;
1651
+ }
1652
+ return narrowSchema(schema, [
1653
+ fieldProjection.field.path
1654
+ ]);
1655
+ }, [
1656
+ JSON.stringify(schema),
1657
+ fieldProjection.field.path
1658
+ ]);
1659
+ const originalRow = useMemo3(() => {
1660
+ if (model && editing) {
1661
+ const cell = parseCellIndex(editing.index);
1662
+ const row = model.getRowAt(cell.row);
1663
+ invariant2(row, void 0, {
1664
+ F: __dxlog_file3,
1665
+ L: 47,
1666
+ S: void 0,
1667
+ A: [
1668
+ "row",
1669
+ ""
1670
+ ]
1671
+ });
1672
+ return row;
1673
+ }
1674
+ return void 0;
1675
+ }, [
1676
+ model,
1677
+ editing
1678
+ ]);
1679
+ const formValues = useMemo3(() => {
1680
+ if (originalRow) {
1681
+ return getSnapshot(originalRow);
1682
+ }
1683
+ }, [
1684
+ originalRow
1685
+ ]);
1686
+ const handleSave = useCallback3((values) => {
1687
+ const path = fieldProjection.field.path;
1688
+ const value = getDeep(values, [
1689
+ path
1690
+ ]);
1691
+ setDeep(originalRow, [
1692
+ path
1693
+ ], value);
1694
+ setEditing(null);
1695
+ }, [
1696
+ fieldProjection.field.path,
1697
+ originalRow
1698
+ ]);
1699
+ const handleOpenChange = useCallback3((nextOpen) => {
1700
+ if (nextOpen === false) {
1701
+ setEditing(null);
1702
+ }
1703
+ }, [
1704
+ setEditing
1705
+ ]);
1706
+ if (!editing) {
1707
+ return null;
1708
+ }
1709
+ return /* @__PURE__ */ React5.createElement(Popover2.Root, {
1710
+ open: editing !== null,
1711
+ onOpenChange: handleOpenChange
1712
+ }, /* @__PURE__ */ React5.createElement(Popover2.VirtualTrigger, {
1713
+ virtualRef: cellRef
1714
+ }), /* @__PURE__ */ React5.createElement(Popover2.Content, {
1715
+ tabIndex: -1,
1716
+ classNames: "popover-consistent-width"
1717
+ }, /* @__PURE__ */ React5.createElement(Popover2.Arrow, null), /* @__PURE__ */ React5.createElement(Form2, {
1718
+ values: formValues,
1719
+ schema: narrowedSchema,
1720
+ onSave: handleSave
1721
+ })));
1722
+ };
1723
+
1581
1724
  // packages/ui/react-ui-table/src/components/TableCellEditor/extension.ts
1582
1725
  import { autocompletion, pickedCompletion } from "@codemirror/autocomplete";
1583
1726
  import { EditorView } from "@codemirror/view";
@@ -1618,27 +1761,67 @@ var completion = ({ debug, onQuery, onMatch }) => {
1618
1761
  };
1619
1762
 
1620
1763
  // packages/ui/react-ui-table/src/components/TableCellEditor/TableCellEditor.tsx
1621
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/TableCellEditor/TableCellEditor.tsx";
1764
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/TableCellEditor/TableCellEditor.tsx";
1622
1765
  var newValue = Symbol.for("newValue");
1623
1766
  var createOption = (text) => ({
1624
1767
  [newValue]: true,
1625
1768
  text
1626
1769
  });
1627
1770
  var isCreateOption = (data) => typeof data === "object" && data[newValue];
1771
+ var TableValueEditor = ({ model, modals, schema, onEnter, onFocus, onQuery, __gridScope }) => {
1772
+ const { editing } = useGridContext3("TableValueEditor", __gridScope);
1773
+ const fieldProjection = useMemo4(() => {
1774
+ if (!model || !editing) {
1775
+ return;
1776
+ }
1777
+ const { col } = parseCellIndex2(editing.index);
1778
+ const field = model.projection.view.fields[col];
1779
+ const fieldProjection2 = model.projection.getFieldProjection(field.id);
1780
+ invariant3(fieldProjection2, void 0, {
1781
+ F: __dxlog_file4,
1782
+ L: 73,
1783
+ S: void 0,
1784
+ A: [
1785
+ "fieldProjection",
1786
+ ""
1787
+ ]
1788
+ });
1789
+ return fieldProjection2;
1790
+ }, [
1791
+ model,
1792
+ editing
1793
+ ]);
1794
+ if (fieldProjection?.props.type === TypeEnum4.Array) {
1795
+ return /* @__PURE__ */ React6.createElement(FormCellEditor, {
1796
+ fieldProjection,
1797
+ model,
1798
+ schema,
1799
+ __gridScope
1800
+ });
1801
+ }
1802
+ return /* @__PURE__ */ React6.createElement(TableCellEditor, {
1803
+ model,
1804
+ modals,
1805
+ onEnter,
1806
+ onFocus,
1807
+ onQuery,
1808
+ __gridScope
1809
+ });
1810
+ };
1628
1811
  var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }) => {
1629
- const { id: gridId, editing, setEditing } = useGridContext2("TableCellEditor", __gridScope);
1630
- const suppressNextBlur = useRef(false);
1812
+ const { id: gridId, editing, setEditing } = useGridContext3("TableCellEditor", __gridScope);
1813
+ const suppressNextBlur = useRef2(false);
1631
1814
  const { themeMode } = useThemeContext();
1632
- const fieldProjection = useMemo3(() => {
1815
+ const fieldProjection = useMemo4(() => {
1633
1816
  if (!model || !editing) {
1634
1817
  return;
1635
1818
  }
1636
- const { col } = parseCellIndex(editing.index);
1819
+ const { col } = parseCellIndex2(editing.index);
1637
1820
  const field = model.projection.view.fields[col];
1638
1821
  const fieldProjection2 = model.projection.getFieldProjection(field.id);
1639
- invariant2(fieldProjection2, void 0, {
1640
- F: __dxlog_file3,
1641
- L: 71,
1822
+ invariant3(fieldProjection2, void 0, {
1823
+ F: __dxlog_file4,
1824
+ L: 114,
1642
1825
  S: void 0,
1643
1826
  A: [
1644
1827
  "fieldProjection",
@@ -1650,11 +1833,11 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
1650
1833
  model,
1651
1834
  editing
1652
1835
  ]);
1653
- const handleEnter = useCallback3((value) => {
1836
+ const handleEnter = useCallback4((value) => {
1654
1837
  if (!model || !editing) {
1655
1838
  return;
1656
1839
  }
1657
- const cell = parseCellIndex(editing.index);
1840
+ const cell = parseCellIndex2(editing.index);
1658
1841
  model.setCellData(cell, value);
1659
1842
  onEnter?.(cell);
1660
1843
  onFocus?.();
@@ -1666,7 +1849,7 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
1666
1849
  onFocus,
1667
1850
  setEditing
1668
1851
  ]);
1669
- const handleBlur = useCallback3((value) => {
1852
+ const handleBlur = useCallback4((value) => {
1670
1853
  if (!model || !editing) {
1671
1854
  return;
1672
1855
  }
@@ -1674,7 +1857,7 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
1674
1857
  suppressNextBlur.current = false;
1675
1858
  return;
1676
1859
  }
1677
- const cell = parseCellIndex(editing.index);
1860
+ const cell = parseCellIndex2(editing.index);
1678
1861
  if (value !== void 0) {
1679
1862
  model.setCellData(cell, value);
1680
1863
  }
@@ -1682,11 +1865,11 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
1682
1865
  model,
1683
1866
  editing
1684
1867
  ]);
1685
- const handleClose = useCallback3((value, event) => {
1868
+ const handleClose = useCallback4((value, event) => {
1686
1869
  if (!model || !editing || !fieldProjection) {
1687
1870
  return;
1688
1871
  }
1689
- const cell = parseCellIndex(editing.index);
1872
+ const cell = parseCellIndex2(editing.index);
1690
1873
  onEnter?.(cell);
1691
1874
  if (event && onFocus) {
1692
1875
  onFocus(determineNavigationAxis(event), determineNavigationDelta(event));
@@ -1698,7 +1881,7 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
1698
1881
  onEnter,
1699
1882
  fieldProjection
1700
1883
  ]);
1701
- const extension = useMemo3(() => {
1884
+ const extension = useMemo4(() => {
1702
1885
  if (!fieldProjection) {
1703
1886
  return [];
1704
1887
  }
@@ -1779,9 +1962,9 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
1779
1962
  handleClose,
1780
1963
  themeMode
1781
1964
  ]);
1782
- const getCellContent = useCallback3(() => {
1965
+ const getCellContent = useCallback4(() => {
1783
1966
  if (model && editing) {
1784
- const cell = parseCellIndex(editing.index);
1967
+ const cell = parseCellIndex2(editing.index);
1785
1968
  const { col } = cell;
1786
1969
  const field = model.projection.view.fields[col];
1787
1970
  const fieldProjection2 = model.projection.getFieldProjection(field.id);
@@ -1825,7 +2008,7 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
1825
2008
  model,
1826
2009
  editing
1827
2010
  ]);
1828
- return /* @__PURE__ */ React5.createElement(GridCellEditor, {
2011
+ return /* @__PURE__ */ React6.createElement(GridCellEditor, {
1829
2012
  extension,
1830
2013
  getCellContent,
1831
2014
  onBlur: handleBlur
@@ -1857,19 +2040,19 @@ var determineNavigationDelta = ({ key, shift }) => {
1857
2040
  };
1858
2041
 
1859
2042
  // packages/ui/react-ui-table/src/components/Table/Table.tsx
1860
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/Table/Table.tsx";
2043
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/Table/Table.tsx";
1861
2044
  var TableRoot = ({ children, role }) => {
1862
- return /* @__PURE__ */ React6.createElement("div", {
2045
+ return /* @__PURE__ */ React7.createElement("div", {
1863
2046
  role: "none",
1864
2047
  className: mx2("relative !border-separator", role === "section" ? "attention-surface overflow-hidden [&_.dx-grid]:max-is-[--dx-grid-content-inline-size]" : "flex flex-col [&_.dx-grid]:grow [&_.dx-grid]:max-is-[--dx-grid-content-inline-size] [&_.dx-grid]:bs-0 [&_.dx-grid]:max-bs-[--dx-grid-content-block-size]")
1865
2048
  }, children);
1866
2049
  };
1867
- var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttention, onRowClick }, forwardedRef) => {
2050
+ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttention, schema, onRowClick }, forwardedRef) => {
1868
2051
  const [dxGrid, setDxGrid] = useState2(null);
1869
2052
  const { hasAttention } = useAttention(model?.id ?? "table");
1870
2053
  const { t } = useTranslation3(translationKey);
1871
- const modals = useMemo4(() => new ModalController(), []);
1872
- const frozen = useMemo4(() => {
2054
+ const modals = useMemo5(() => new ModalController(), []);
2055
+ const frozen = useMemo5(() => {
1873
2056
  const noActionColumn = model?.features.dataEditable === false && model?.features.schemaEditable === false && model.rowActions.length === 0;
1874
2057
  return {
1875
2058
  frozenRowsStart: 1,
@@ -1879,10 +2062,10 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
1879
2062
  }, [
1880
2063
  model
1881
2064
  ]);
1882
- const getCells = useCallback4((range, plane) => presentation?.getCells(range, plane) ?? {}, [
2065
+ const getCells = useCallback5((range, plane) => presentation?.getCells(range, plane) ?? {}, [
1883
2066
  presentation
1884
2067
  ]);
1885
- useEffect2(() => {
2068
+ useEffect3(() => {
1886
2069
  if (!presentation || !dxGrid) {
1887
2070
  return;
1888
2071
  }
@@ -1910,7 +2093,7 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
1910
2093
  presentation,
1911
2094
  dxGrid
1912
2095
  ]);
1913
- const handleGridClick = useCallback4((event) => {
2096
+ const handleGridClick = useCallback5((event) => {
1914
2097
  const rowIndex = safeParseInt(event.target.ariaRowIndex ?? "");
1915
2098
  if (rowIndex != null) {
1916
2099
  if (onRowClick) {
@@ -1985,14 +2168,14 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
1985
2168
  model,
1986
2169
  modals
1987
2170
  ]);
1988
- const handleFocus = useCallback4((increment, delta) => {
2171
+ const handleFocus = useCallback5((increment, delta) => {
1989
2172
  if (dxGrid) {
1990
2173
  dxGrid.refocus(increment, delta);
1991
2174
  }
1992
2175
  }, [
1993
2176
  dxGrid
1994
2177
  ]);
1995
- const handleEnter = useCallback4((cell) => {
2178
+ const handleEnter = useCallback5((cell) => {
1996
2179
  if (!model?.features.dataEditable) {
1997
2180
  return;
1998
2181
  }
@@ -2009,7 +2192,7 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
2009
2192
  model,
2010
2193
  dxGrid
2011
2194
  ]);
2012
- const handleKeyDown = useCallback4((event) => {
2195
+ const handleKeyDown = useCallback5((event) => {
2013
2196
  if (!model?.features.dataEditable) {
2014
2197
  return;
2015
2198
  }
@@ -2027,7 +2210,7 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
2027
2210
  }, [
2028
2211
  model
2029
2212
  ]);
2030
- const handleAxisResize = useCallback4((event) => {
2213
+ const handleAxisResize = useCallback5((event) => {
2031
2214
  if (event.axis === "col") {
2032
2215
  const columnIndex = parseInt(event.index, 10);
2033
2216
  model?.setColumnWidth(columnIndex, event.size);
@@ -2035,7 +2218,7 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
2035
2218
  }, [
2036
2219
  model
2037
2220
  ]);
2038
- const handleWheel = useCallback4((event) => {
2221
+ const handleWheel = useCallback5((event) => {
2039
2222
  if (!ignoreAttention && !hasAttention) {
2040
2223
  event.stopPropagation();
2041
2224
  }
@@ -2043,7 +2226,7 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
2043
2226
  hasAttention,
2044
2227
  ignoreAttention
2045
2228
  ]);
2046
- const handleNewColumn = useCallback4(() => {
2229
+ const handleNewColumn = useCallback5(() => {
2047
2230
  const columns = model?.getColumnCount();
2048
2231
  if (dxGrid && columns) {
2049
2232
  dxGrid.scrollToColumn(columns - 1);
@@ -2052,21 +2235,21 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
2052
2235
  model,
2053
2236
  dxGrid
2054
2237
  ]);
2055
- const handleQuery = useCallback4(async ({ field, props }, text) => {
2238
+ const handleQuery = useCallback5(async ({ field, props }, text) => {
2056
2239
  if (model && props.referenceSchema && field.referencePath) {
2057
2240
  const space = model.space;
2058
- invariant3(space, void 0, {
2059
- F: __dxlog_file4,
2060
- L: 307,
2241
+ invariant4(space, void 0, {
2242
+ F: __dxlog_file5,
2243
+ L: 309,
2061
2244
  S: void 0,
2062
2245
  A: [
2063
2246
  "space",
2064
2247
  ""
2065
2248
  ]
2066
2249
  });
2067
- const schema = space.db.schemaRegistry.getSchema(props.referenceSchema);
2068
- if (schema) {
2069
- const { objects } = await space.db.query(Filter.schema(schema)).run();
2250
+ const schema2 = space.db.schemaRegistry.getSchema(props.referenceSchema);
2251
+ if (schema2) {
2252
+ const { objects } = await space.db.query(Filter.type(schema2)).run();
2070
2253
  const options = objects.map((obj) => {
2071
2254
  const value = getValue4(obj, field.referencePath);
2072
2255
  if (!value || typeof value !== "string") {
@@ -2094,21 +2277,22 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
2094
2277
  t
2095
2278
  ]);
2096
2279
  if (!model || !modals) {
2097
- return /* @__PURE__ */ React6.createElement("span", {
2280
+ return /* @__PURE__ */ React7.createElement("span", {
2098
2281
  role: "none",
2099
2282
  className: "attention-surface"
2100
2283
  });
2101
2284
  }
2102
- return /* @__PURE__ */ React6.createElement(Grid.Root, {
2285
+ return /* @__PURE__ */ React7.createElement(Grid.Root, {
2103
2286
  id: model.id ?? "table-grid"
2104
- }, /* @__PURE__ */ React6.createElement(TableCellEditor, {
2287
+ }, /* @__PURE__ */ React7.createElement(TableValueEditor, {
2105
2288
  model,
2106
2289
  modals,
2290
+ schema,
2107
2291
  onEnter: handleEnter,
2108
2292
  onFocus: handleFocus,
2109
2293
  onQuery: handleQuery
2110
- }), /* @__PURE__ */ React6.createElement(Grid.Content, {
2111
- className: mx2("[--dx-grid-base:var(--surface-bg)]", gridSeparatorInlineEnd, gridSeparatorBlockEnd),
2294
+ }), /* @__PURE__ */ React7.createElement(Grid.Content, {
2295
+ className: mx2("[--dx-grid-base:var(--baseSurface)]", gridSeparatorInlineEnd, gridSeparatorBlockEnd),
2112
2296
  frozen,
2113
2297
  // getCells={getCells}
2114
2298
  columns: model.columnMeta.value,
@@ -2120,17 +2304,17 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
2120
2304
  onKeyDown: handleKeyDown,
2121
2305
  onWheelCapture: handleWheel,
2122
2306
  ref: setDxGrid
2123
- }), /* @__PURE__ */ React6.createElement(RowActionsMenu, {
2307
+ }), /* @__PURE__ */ React7.createElement(RowActionsMenu, {
2124
2308
  model,
2125
2309
  modals
2126
- }), /* @__PURE__ */ React6.createElement(ColumnActionsMenu, {
2310
+ }), /* @__PURE__ */ React7.createElement(ColumnActionsMenu, {
2127
2311
  model,
2128
2312
  modals
2129
- }), /* @__PURE__ */ React6.createElement(ColumnSettings, {
2313
+ }), /* @__PURE__ */ React7.createElement(ColumnSettings, {
2130
2314
  model,
2131
2315
  modals,
2132
2316
  onNewColumn: handleNewColumn
2133
- }), /* @__PURE__ */ React6.createElement(CreateRefPanel, {
2317
+ }), /* @__PURE__ */ React7.createElement(CreateRefPanel, {
2134
2318
  model,
2135
2319
  modals
2136
2320
  }));
@@ -2141,19 +2325,19 @@ var Table = {
2141
2325
  };
2142
2326
 
2143
2327
  // packages/ui/react-ui-table/src/components/Table/DynamicTable.tsx
2144
- import React7, { useRef as useRef2, useMemo as useMemo5, useCallback as useCallback5 } from "react";
2328
+ import React8, { useRef as useRef3, useMemo as useMemo6, useCallback as useCallback6 } from "react";
2145
2329
  import { useDefaultValue } from "@dxos/react-ui";
2146
2330
  import { mx as mx3 } from "@dxos/react-ui-theme";
2147
2331
 
2148
2332
  // packages/ui/react-ui-table/src/hooks/useTableModel.ts
2149
2333
  import { effect as effect3 } from "@preact/signals-core";
2150
- import { useEffect as useEffect3, useState as useState3 } from "react";
2334
+ import { useEffect as useEffect4, useState as useState3 } from "react";
2151
2335
  import { fullyQualifiedId, getSpace } from "@dxos/react-client/echo";
2152
2336
  import { useSelectionActions } from "@dxos/react-ui-attention";
2153
2337
  import { isNonNullable } from "@dxos/util";
2154
2338
  var useTableModel = ({ table, projection, rows, rowActions, features, onSelectionChanged, onRowAction, ...props }) => {
2155
2339
  const [model, setModel] = useState3();
2156
- useEffect3(() => {
2340
+ useEffect4(() => {
2157
2341
  if (!table || !projection) {
2158
2342
  return;
2159
2343
  }
@@ -2183,7 +2367,7 @@ var useTableModel = ({ table, projection, rows, rowActions, features, onSelectio
2183
2367
  features,
2184
2368
  rowActions
2185
2369
  ]);
2186
- useEffect3(() => {
2370
+ useEffect4(() => {
2187
2371
  if (rows) {
2188
2372
  model?.setRows(rows);
2189
2373
  }
@@ -2195,7 +2379,7 @@ var useTableModel = ({ table, projection, rows, rowActions, features, onSelectio
2195
2379
  table?.id,
2196
2380
  table?.view?.target?.query.typename
2197
2381
  ].filter(isNonNullable));
2198
- useEffect3(() => {
2382
+ useEffect4(() => {
2199
2383
  if (!model) {
2200
2384
  return;
2201
2385
  }
@@ -2219,8 +2403,8 @@ var useTableModel = ({ table, projection, rows, rowActions, features, onSelectio
2219
2403
 
2220
2404
  // packages/ui/react-ui-table/src/components/Table/DynamicTable.tsx
2221
2405
  var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, properties, jsonSchema, schema, rowActions, onRowClick, onRowAction, ...props }) => {
2222
- const { table, projection } = useMemo5(() => {
2223
- const props2 = getBaseSchems({
2406
+ const { table, projection } = useMemo6(() => {
2407
+ const props2 = getBaseSchema({
2224
2408
  typename: name,
2225
2409
  properties,
2226
2410
  jsonSchema,
@@ -2236,11 +2420,11 @@ var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, prop
2236
2420
  schema,
2237
2421
  jsonSchema
2238
2422
  ]);
2239
- const tableRef = useRef2(null);
2240
- const handleCellUpdate = useCallback5((cell) => {
2423
+ const tableRef = useRef3(null);
2424
+ const handleCellUpdate = useCallback6((cell) => {
2241
2425
  tableRef.current?.update?.(cell);
2242
2426
  }, []);
2243
- const handleRowOrderChange = useCallback5(() => {
2427
+ const handleRowOrderChange = useCallback6(() => {
2244
2428
  tableRef.current?.update?.();
2245
2429
  }, []);
2246
2430
  const features = useDefaultValue(props.features, () => ({
@@ -2259,20 +2443,20 @@ var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, prop
2259
2443
  onRowOrderChange: handleRowOrderChange,
2260
2444
  onRowAction
2261
2445
  });
2262
- const presentation = useMemo5(() => {
2446
+ const presentation = useMemo6(() => {
2263
2447
  if (model) {
2264
2448
  return new TablePresentation(model);
2265
2449
  }
2266
2450
  }, [
2267
2451
  model
2268
2452
  ]);
2269
- return /* @__PURE__ */ React7.createElement("div", {
2453
+ return /* @__PURE__ */ React8.createElement("div", {
2270
2454
  role: "none",
2271
2455
  className: mx3("is-full bs-full grow grid", classNames)
2272
- }, /* @__PURE__ */ React7.createElement("div", {
2456
+ }, /* @__PURE__ */ React8.createElement("div", {
2273
2457
  role: "none",
2274
2458
  className: "grid min-bs-0 overflow-hidden"
2275
- }, /* @__PURE__ */ React7.createElement(Table.Root, null, /* @__PURE__ */ React7.createElement(Table.Main, {
2459
+ }, /* @__PURE__ */ React8.createElement(Table.Root, null, /* @__PURE__ */ React8.createElement(Table.Main, {
2276
2460
  ref: tableRef,
2277
2461
  model,
2278
2462
  presentation,
@@ -2282,11 +2466,11 @@ var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, prop
2282
2466
  };
2283
2467
 
2284
2468
  // packages/ui/react-ui-table/src/components/TableToolbar/TableToolbar.tsx
2285
- import React8, { useCallback as useCallback6, useMemo as useMemo6 } from "react";
2469
+ import React9, { useCallback as useCallback7, useMemo as useMemo7 } from "react";
2286
2470
  import { live as live4 } from "@dxos/live-object";
2287
2471
  import { createGapSeparator, createMenuAction, MenuProvider, ToolbarMenu, useMenuActions } from "@dxos/react-ui-menu";
2288
- var createTableToolbarActions = (state) => {
2289
- const add = createMenuAction("add-row", {
2472
+ var createTableToolbarActions = (state, onAction) => {
2473
+ const add = createMenuAction("add-row", () => onAction(add), {
2290
2474
  type: "add-row",
2291
2475
  icon: "ph--plus--regular",
2292
2476
  label: [
@@ -2297,7 +2481,7 @@ var createTableToolbarActions = (state) => {
2297
2481
  ],
2298
2482
  testId: "table.toolbar.add-row"
2299
2483
  });
2300
- const save = createMenuAction("save-view", {
2484
+ const save = createMenuAction("save-view", () => onAction(save), {
2301
2485
  type: "save-view",
2302
2486
  icon: "ph--floppy-disk--regular",
2303
2487
  label: [
@@ -2311,7 +2495,7 @@ var createTableToolbarActions = (state) => {
2311
2495
  hidden: !state.viewDirty
2312
2496
  });
2313
2497
  const gap = createGapSeparator();
2314
- const comment = createMenuAction("comment", {
2498
+ const comment = createMenuAction("comment", () => onAction(comment), {
2315
2499
  type: "comment",
2316
2500
  icon: "ph--chat-text--regular",
2317
2501
  label: [
@@ -2337,18 +2521,18 @@ var createTableToolbarActions = (state) => {
2337
2521
  };
2338
2522
  };
2339
2523
  var TableToolbar = ({ classNames, viewDirty, attendableId, onAction }) => {
2340
- const state = useMemo6(() => live4({
2524
+ const state = useMemo7(() => live4({
2341
2525
  viewDirty
2342
2526
  }), []);
2343
- const actionsCreator = useCallback6(() => createTableToolbarActions(state), [
2344
- state
2527
+ const actionsCreator = useCallback7(() => createTableToolbarActions(state, onAction), [
2528
+ state,
2529
+ onAction
2345
2530
  ]);
2346
2531
  const menu = useMenuActions(actionsCreator);
2347
- return /* @__PURE__ */ React8.createElement(MenuProvider, {
2532
+ return /* @__PURE__ */ React9.createElement(MenuProvider, {
2348
2533
  ...menu,
2349
- attendableId,
2350
- onAction
2351
- }, /* @__PURE__ */ React8.createElement(ToolbarMenu, {
2534
+ attendableId
2535
+ }, /* @__PURE__ */ React9.createElement(ToolbarMenu, {
2352
2536
  classNames
2353
2537
  }));
2354
2538
  };
@@ -2366,9 +2550,10 @@ export {
2366
2550
  TableToolbar,
2367
2551
  TableType,
2368
2552
  cellClassesForRowSelection,
2369
- getBaseSchems,
2553
+ getBaseSchema,
2370
2554
  initializeTable,
2371
2555
  makeDynamicTable,
2556
+ narrowSchema,
2372
2557
  tableButtons,
2373
2558
  tableControls,
2374
2559
  touch,