@dxos/react-ui-form 0.8.3-staging.0fa589b → 0.8.4-main.28f8d3d

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 (77) hide show
  1. package/dist/lib/browser/index.mjs +222 -209
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +222 -209
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +1 -1
  8. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +1 -1
  9. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +4 -4
  10. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  11. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +3 -3
  12. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  13. package/dist/types/src/components/Form/ArrayField.d.ts.map +1 -1
  14. package/dist/types/src/components/Form/Defaults.d.ts.map +1 -1
  15. package/dist/types/src/components/Form/Form.d.ts +2 -2
  16. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  17. package/dist/types/src/components/Form/Form.stories.d.ts +1 -1
  18. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/Form/FormActions.d.ts.map +1 -1
  20. package/dist/types/src/components/Form/FormContent.d.ts +1 -1
  21. package/dist/types/src/components/Form/FormContent.d.ts.map +1 -1
  22. package/dist/types/src/components/Form/FormContext.d.ts +1 -1
  23. package/dist/types/src/components/Form/FormContext.d.ts.map +1 -1
  24. package/dist/types/src/components/Form/RefField.d.ts +1 -1
  25. package/dist/types/src/components/Form/RefField.d.ts.map +1 -1
  26. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +1 -1
  27. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +1 -1
  28. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Form/factory.d.ts.map +1 -1
  30. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +2 -2
  31. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  32. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +4 -4
  33. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  34. package/dist/types/src/components/deprecated/Form.d.ts +3 -3
  35. package/dist/types/src/components/deprecated/Form.d.ts.map +1 -1
  36. package/dist/types/src/components/deprecated/Form.stories.d.ts +1 -1
  37. package/dist/types/src/components/deprecated/Form.stories.d.ts.map +1 -1
  38. package/dist/types/src/hooks/useForm.d.ts +1 -1
  39. package/dist/types/src/hooks/useForm.d.ts.map +1 -1
  40. package/dist/types/src/index.d.ts +1 -1
  41. package/dist/types/src/index.d.ts.map +1 -1
  42. package/dist/types/src/translations.d.ts +57 -57
  43. package/dist/types/src/translations.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +31 -32
  46. package/src/components/ControlSection/ControlSection.stories.tsx +3 -2
  47. package/src/components/FieldEditor/FieldEditor.stories.tsx +17 -14
  48. package/src/components/FieldEditor/FieldEditor.test.tsx +14 -13
  49. package/src/components/FieldEditor/FieldEditor.tsx +11 -11
  50. package/src/components/Form/ArrayField.tsx +8 -7
  51. package/src/components/Form/Defaults.tsx +2 -1
  52. package/src/components/Form/Form.stories.tsx +5 -4
  53. package/src/components/Form/Form.tsx +4 -3
  54. package/src/components/Form/FormActions.tsx +2 -1
  55. package/src/components/Form/FormContent.tsx +6 -5
  56. package/src/components/Form/FormContext.tsx +5 -5
  57. package/src/components/Form/RefField.tsx +7 -6
  58. package/src/components/Form/custom/GeoPointInput.tsx +2 -2
  59. package/src/components/Form/custom/SelectOptionsInput.stories.tsx +5 -4
  60. package/src/components/Form/custom/SelectOptionsInput.tsx +28 -29
  61. package/src/components/Form/factory.tsx +1 -1
  62. package/src/components/ViewEditor/ViewEditor.stories.tsx +21 -14
  63. package/src/components/ViewEditor/ViewEditor.test.tsx +41 -38
  64. package/src/components/ViewEditor/ViewEditor.tsx +81 -81
  65. package/src/components/deprecated/Form.stories.tsx +8 -7
  66. package/src/components/deprecated/Form.tsx +6 -6
  67. package/src/components/testing.tsx +1 -1
  68. package/src/hooks/useForm.ts +5 -3
  69. package/src/hooks/useRefQueryLookupHandler.ts +1 -1
  70. package/src/index.ts +1 -1
  71. package/src/translations.ts +7 -4
  72. package/dist/lib/node/index.cjs +0 -2416
  73. package/dist/lib/node/index.cjs.map +0 -7
  74. package/dist/lib/node/meta.json +0 -1
  75. package/dist/types/src/components/ViewEditor/Test.stories.d.ts +0 -10
  76. package/dist/types/src/components/ViewEditor/Test.stories.d.ts.map +0 -1
  77. package/src/components/ViewEditor/Test.stories.tsx +0 -45
@@ -1,6 +1,6 @@
1
- // packages/ui/react-ui-form/src/translations.ts
1
+ // src/translations.ts
2
2
  var translationKey = "react-ui-form";
3
- var translations_default = [
3
+ var translations = [
4
4
  {
5
5
  "en-US": {
6
6
  [translationKey]: {
@@ -18,6 +18,7 @@ var translations_default = [
18
18
  "field limit reached": "Maximum number of fields reached",
19
19
  "boolean input true value": "Yes",
20
20
  "boolean input false value": "No",
21
+ "delete field label": "Delete field",
21
22
  // TODO(burdon): Factor out?
22
23
  "button cancel": "Cancel",
23
24
  "button save": "Save",
@@ -60,14 +61,14 @@ var translations_default = [
60
61
  "select option delete": "Delete",
61
62
  "select option add": "Add option",
62
63
  // System schema message.
63
- "system schema title": "System Schema",
64
- "system schema description": "This is a system schema and cannot be modified."
64
+ "system schema title": "System record type",
65
+ "system schema description": "This is a system record type and cannot be modified."
65
66
  }
66
67
  }
67
68
  }
68
69
  ];
69
70
 
70
- // packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx
71
+ // src/components/deprecated/FormInput.tsx
71
72
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
72
73
  import React from "react";
73
74
  import { Input } from "@dxos/react-ui";
@@ -119,7 +120,7 @@ var DeprecatedFormInput = ({ label, description, secondary, children }) => {
119
120
  }
120
121
  };
121
122
 
122
- // packages/ui/react-ui-form/src/components/ControlSection/ControlSection.tsx
123
+ // src/components/ControlSection/ControlSection.tsx
123
124
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
124
125
  import React2 from "react";
125
126
  import { Button, Input as Input2, toLocalizedString, useTranslation } from "@dxos/react-ui";
@@ -250,7 +251,7 @@ var ControlFrameItem = ({ title, description, children }) => {
250
251
  }
251
252
  };
252
253
 
253
- // packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx
254
+ // src/components/FieldEditor/FieldEditor.tsx
254
255
  import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
255
256
  import React14, { useCallback as useCallback9, useEffect as useEffect8, useMemo as useMemo7, useState as useState5 } from "react";
256
257
  import { FormatEnum as FormatEnum5, FormatEnums, formatToType } from "@dxos/echo-schema";
@@ -258,14 +259,14 @@ import { log as log3 } from "@dxos/log";
258
259
  import { useTranslation as useTranslation8 } from "@dxos/react-ui";
259
260
  import { getFormatSchema, getSchemaProperties as getSchemaProperties3, sortProperties } from "@dxos/schema";
260
261
 
261
- // packages/ui/react-ui-form/src/components/Form/custom/GeoPointInput.tsx
262
+ // src/components/Form/custom/GeoPointInput.tsx
262
263
  import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
263
- import React4, { useCallback, useState, useEffect, useMemo } from "react";
264
+ import React4, { useCallback, useEffect, useMemo, useState } from "react";
264
265
  import { GeoLocation } from "@dxos/echo-schema";
265
266
  import { Input as Input4, useTranslation as useTranslation2 } from "@dxos/react-ui";
266
267
  import { safeParseFloat } from "@dxos/util";
267
268
 
268
- // packages/ui/react-ui-form/src/components/Form/Input.tsx
269
+ // src/components/Form/Input.tsx
269
270
  import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
270
271
  import React3 from "react";
271
272
  import { Icon, Input as Input3, Tooltip } from "@dxos/react-ui";
@@ -295,7 +296,7 @@ var InputHeader = ({ error, label, readonly }) => {
295
296
  }
296
297
  };
297
298
 
298
- // packages/ui/react-ui-form/src/components/Form/custom/GeoPointInput.tsx
299
+ // src/components/Form/custom/GeoPointInput.tsx
299
300
  var GeoPointInput = ({ type, label, disabled, getStatus, getValue: getValue3, onValueChange, onBlur }) => {
300
301
  var _effect = _useSignals4();
301
302
  try {
@@ -372,14 +373,14 @@ var GeoPointInput = ({ type, label, disabled, getStatus, getValue: getValue3, on
372
373
  }
373
374
  };
374
375
 
375
- // packages/ui/react-ui-form/src/components/Form/custom/SelectOptionsInput.tsx
376
+ // src/components/Form/custom/SelectOptionsInput.tsx
376
377
  import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
377
- import React5, { useCallback as useCallback2, useEffect as useEffect2, useState as useState2, useRef } from "react";
378
+ import React5, { useCallback as useCallback2, useEffect as useEffect2, useRef, useState as useState2 } from "react";
378
379
  import { PublicKey } from "@dxos/keys";
379
- import { Icon as Icon2, IconButton, Input as Input5, Tag, Toolbar, useTranslation as useTranslation3 } from "@dxos/react-ui";
380
+ import { IconButton, Input as Input5, Tag, useTranslation as useTranslation3 } from "@dxos/react-ui";
380
381
  import { List } from "@dxos/react-ui-list";
381
382
  import { HuePicker } from "@dxos/react-ui-pickers";
382
- import { hues, mx as mx4 } from "@dxos/react-ui-theme";
383
+ import { hues, subtleHover } from "@dxos/react-ui-theme";
383
384
  var SelectOptionInput = ({ type, label, disabled, getStatus, getValue: getValue3, onValueChange }) => {
384
385
  var _effect = _useSignals5();
385
386
  try {
@@ -499,7 +500,8 @@ var SelectOptionInput = ({ type, label, disabled, getStatus, getValue: getValue3
499
500
  }, options && /* @__PURE__ */ React5.createElement(List.Root, {
500
501
  items: options,
501
502
  isItem: (item) => true,
502
- onMove: handleMove
503
+ onMove: disabled ? void 0 : handleMove,
504
+ readonly: disabled
503
505
  }, ({ items }) => /* @__PURE__ */ React5.createElement("div", {
504
506
  role: "list",
505
507
  className: "w-full overflow-auto"
@@ -508,25 +510,36 @@ var SelectOptionInput = ({ type, label, disabled, getStatus, getValue: getValue3
508
510
  }, /* @__PURE__ */ React5.createElement(List.Item, {
509
511
  role: "button",
510
512
  item,
511
- classNames: mx4("p-1 plb-2", "flex flex-col", "cursor-pointer", "hover:bg-hoverOverlay"),
513
+ classNames: [
514
+ subtleHover,
515
+ "flex flex-col cursor-pointer rounded-sm"
516
+ ],
512
517
  "aria-expanded": selected === item.id
513
518
  }, /* @__PURE__ */ React5.createElement("div", {
514
519
  className: "flex items-center"
515
- }, /* @__PURE__ */ React5.createElement(List.ItemDragHandle, null), /* @__PURE__ */ React5.createElement(List.ItemTitle, {
520
+ }, /* @__PURE__ */ React5.createElement(List.ItemDragHandle, {
521
+ disabled
522
+ }), /* @__PURE__ */ React5.createElement(List.ItemTitle, {
516
523
  onClick: () => handleClick(item.id),
517
524
  classNames: "flex-1"
518
525
  }, /* @__PURE__ */ React5.createElement(Tag, {
519
526
  palette: item.color
520
- }, item.title || "\u200B")), /* @__PURE__ */ React5.createElement(Icon2, {
527
+ }, item.title || "\u200B")), /* @__PURE__ */ React5.createElement(IconButton, {
528
+ iconOnly: true,
529
+ variant: "ghost",
530
+ label: t(selected === item.id ? "collapse label" : "expand label", {
531
+ ns: "os"
532
+ }),
521
533
  icon: selected === item.id ? "ph--caret-down--regular" : "ph--caret-right--regular",
522
534
  onClick: () => handleClick(item.id)
523
535
  })), selected === item.id && /* @__PURE__ */ React5.createElement("div", {
524
- className: "mis-4 mbs-2 flex flex-col gap-1"
536
+ className: "pli-cardSpacingInline plb-cardSpacingBlock flex flex-col gap-1 density-fine"
525
537
  }, /* @__PURE__ */ React5.createElement(Input5.Label, {
526
538
  classNames: "text-xs"
527
539
  }, t("select option label")), /* @__PURE__ */ React5.createElement("div", {
528
- className: "flex flex-row items-center gap-1"
540
+ className: "grid grid-cols-[1fr_min-content_min-content] gap-1"
529
541
  }, /* @__PURE__ */ React5.createElement(Input5.TextInput, {
542
+ disabled,
530
543
  placeholder: t("select option label placeholder"),
531
544
  ref: selected === item.id ? inputRef : void 0,
532
545
  value: item.title,
@@ -534,40 +547,34 @@ var SelectOptionInput = ({ type, label, disabled, getStatus, getValue: getValue3
534
547
  onKeyDown: handleKeyDown,
535
548
  classNames: "flex-1",
536
549
  "data-no-submit": true
537
- }), /* @__PURE__ */ React5.createElement(Toolbar.Root, {
538
- classNames: "p-0 m-0 !is-auto"
539
- }, /* @__PURE__ */ React5.createElement(HuePicker, {
550
+ }), /* @__PURE__ */ React5.createElement(HuePicker, {
551
+ disabled,
540
552
  value: item.color,
541
- onChange: handleColorChange(item.id),
542
- rootVariant: "toolbar-button"
543
- })), /* @__PURE__ */ React5.createElement(IconButton, {
553
+ onChange: handleColorChange(item.id)
554
+ }), /* @__PURE__ */ React5.createElement(IconButton, {
555
+ disabled,
544
556
  icon: "ph--trash--fill",
545
557
  iconOnly: true,
546
558
  label: t("select option delete"),
547
559
  onClick: () => handleDelete(item.id)
548
- })))))), /* @__PURE__ */ React5.createElement("div", {
549
- role: "listitem"
550
- }, /* @__PURE__ */ React5.createElement("div", {
551
- role: "button",
552
- className: mx4("p-1 plb-2", "flex flex-col", "cursor-pointer", "hover:bg-hoverOverlay"),
553
- onClick: handleAdd
554
- }, /* @__PURE__ */ React5.createElement("div", {
555
- className: "flex items-center gap-1"
556
- }, /* @__PURE__ */ React5.createElement(Icon2, {
557
- icon: "ph--plus--regular"
558
- }), /* @__PURE__ */ React5.createElement("span", {
559
- className: "text-sm"
560
- }, t("select option add")))))))));
560
+ })))))), /* @__PURE__ */ React5.createElement(IconButton, {
561
+ variant: "ghost",
562
+ icon: "ph--plus--regular",
563
+ label: t("select option add"),
564
+ onClick: handleAdd,
565
+ disabled,
566
+ classNames: "is-full"
567
+ })))));
561
568
  } finally {
562
569
  _effect.f();
563
570
  }
564
571
  };
565
572
 
566
- // packages/ui/react-ui-form/src/components/Form/custom/TupleInput.tsx
573
+ // src/components/Form/custom/TupleInput.tsx
567
574
  import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
568
575
  import React6 from "react";
569
576
  import { Input as Input6 } from "@dxos/react-ui";
570
- import { mx as mx5 } from "@dxos/react-ui-theme";
577
+ import { mx as mx4 } from "@dxos/react-ui-theme";
571
578
  import { safeParseFloat as safeParseFloat2 } from "@dxos/util";
572
579
  var gridCols = [
573
580
  "grid-cols-1",
@@ -586,7 +593,7 @@ var TupleInput = ({ binding, type, label, disabled, getStatus, getValue: getValu
586
593
  error,
587
594
  label
588
595
  }), /* @__PURE__ */ React6.createElement("div", {
589
- className: mx5("grid gap-2", gridCols[binding.length - 1])
596
+ className: mx4("grid gap-2", gridCols[binding.length - 1])
590
597
  }, binding.map((prop) => /* @__PURE__ */ React6.createElement(Input6.TextInput, {
591
598
  key: prop,
592
599
  type: "number",
@@ -603,7 +610,7 @@ var TupleInput = ({ binding, type, label, disabled, getStatus, getValue: getValu
603
610
  }
604
611
  };
605
612
 
606
- // packages/ui/react-ui-form/src/components/Form/Defaults.tsx
613
+ // src/components/Form/Defaults.tsx
607
614
  import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
608
615
  import React7, { useCallback as useCallback3, useEffect as useEffect3, useRef as useRef2 } from "react";
609
616
  import { Input as Input7, Select, useTranslation as useTranslation4 } from "@dxos/react-ui";
@@ -745,26 +752,26 @@ var MarkdownInput = ({ type, label, inputOnly, disabled, placeholder, getStatus,
745
752
  }
746
753
  };
747
754
 
748
- // packages/ui/react-ui-form/src/components/Form/Form.tsx
755
+ // src/components/Form/Form.tsx
749
756
  import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
750
757
  import React13, { useEffect as useEffect7, useMemo as useMemo6, useRef as useRef3 } from "react";
751
758
  import { cardDialogOverflow, cardSpacing as cardSpacing2 } from "@dxos/react-ui-stack";
752
759
 
753
- // packages/ui/react-ui-form/src/components/Form/FormActions.tsx
760
+ // src/components/Form/FormActions.tsx
754
761
  import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
755
762
  import React9 from "react";
756
763
  import { IconButton as IconButton2, useTranslation as useTranslation5 } from "@dxos/react-ui";
757
764
  import { cardSpacing } from "@dxos/react-ui-stack";
758
- import { mx as mx6 } from "@dxos/react-ui-theme";
765
+ import { mx as mx5 } from "@dxos/react-ui-theme";
759
766
 
760
- // packages/ui/react-ui-form/src/components/Form/FormContext.tsx
767
+ // src/components/Form/FormContext.tsx
761
768
  import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
762
- import React8, { createContext, useContext, useEffect as useEffect6, useMemo as useMemo3, useCallback as useCallback6 } from "react";
769
+ import React8, { createContext, useCallback as useCallback6, useContext, useEffect as useEffect6, useMemo as useMemo3 } from "react";
763
770
  import { raise } from "@dxos/debug";
764
771
  import { getValue as getValue2 } from "@dxos/echo-schema";
765
772
  import { createJsonPath as createJsonPath2 } from "@dxos/effect";
766
773
 
767
- // packages/ui/react-ui-form/src/hooks/useForm.ts
774
+ // src/hooks/useForm.ts
768
775
  import { SchemaAST } from "effect";
769
776
  import { useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo2, useState as useState3 } from "react";
770
777
  import { getValue, setValue } from "@dxos/echo-schema";
@@ -772,11 +779,11 @@ import { createJsonPath, fromEffectValidationPath } from "@dxos/effect";
772
779
  import { invariant } from "@dxos/invariant";
773
780
  import { log } from "@dxos/log";
774
781
  import { validateSchema } from "@dxos/schema";
775
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/hooks/useForm.ts";
782
+ var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui-form/src/hooks/useForm.ts";
776
783
  var useForm = ({ schema, initialValues, onValuesChanged, onValidate, onValid, onSave }) => {
777
784
  invariant(SchemaAST.isTypeLiteral(schema.ast), void 0, {
778
785
  F: __dxlog_file,
779
- L: 93,
786
+ L: 95,
780
787
  S: void 0,
781
788
  A: [
782
789
  "SchemaAST.isTypeLiteral(schema.ast)",
@@ -880,7 +887,7 @@ var useForm = ({ schema, initialValues, onValuesChanged, onValidate, onValid, on
880
887
  } catch (err) {
881
888
  log.catch(err, void 0, {
882
889
  F: __dxlog_file,
883
- L: 213,
890
+ L: 215,
884
891
  S: void 0,
885
892
  C: (f, a) => f(...a)
886
893
  });
@@ -951,7 +958,7 @@ var useForm = ({ schema, initialValues, onValuesChanged, onValidate, onValid, on
951
958
  var createKeySet = (obj, value) => {
952
959
  invariant(obj, void 0, {
953
960
  F: __dxlog_file,
954
- L: 275,
961
+ L: 277,
955
962
  S: void 0,
956
963
  A: [
957
964
  "obj",
@@ -973,7 +980,7 @@ var flatMap = (errors) => {
973
980
  }, {});
974
981
  };
975
982
 
976
- // packages/ui/react-ui-form/src/hooks/useRefQueryLookupHandler.ts
983
+ // src/hooks/useRefQueryLookupHandler.ts
977
984
  import { useCallback as useCallback5 } from "react";
978
985
  import { getObjectDXN } from "@dxos/echo-schema";
979
986
  import { Filter } from "@dxos/react-client/echo";
@@ -1001,10 +1008,10 @@ var useRefQueryLookupHandler = ({ space }) => {
1001
1008
  ]);
1002
1009
  };
1003
1010
 
1004
- // packages/ui/react-ui-form/src/hooks/useQueryRefOptions.ts
1011
+ // src/hooks/useQueryRefOptions.ts
1005
1012
  import { useEffect as useEffect5, useState as useState4 } from "react";
1006
1013
  import { log as log2 } from "@dxos/log";
1007
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/hooks/useQueryRefOptions.ts";
1014
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/hooks/useQueryRefOptions.ts";
1008
1015
  var useQueryRefOptions = ({ refTypeInfo, onQueryRefOptions }) => {
1009
1016
  const [options, setOptions] = useState4([]);
1010
1017
  const [loading, setLoading] = useState4(false);
@@ -1047,7 +1054,7 @@ var useQueryRefOptions = ({ refTypeInfo, onQueryRefOptions }) => {
1047
1054
  };
1048
1055
  };
1049
1056
 
1050
- // packages/ui/react-ui-form/src/components/Form/FormContext.tsx
1057
+ // src/components/Form/FormContext.tsx
1051
1058
  var FormContext = /* @__PURE__ */ createContext(void 0);
1052
1059
  var useFormContext = () => {
1053
1060
  return useContext(FormContext) ?? raise(new Error("Missing FormContext"));
@@ -1120,7 +1127,7 @@ var FormProvider = ({ children, formRef, autoSave, ...formOptions }) => {
1120
1127
  }
1121
1128
  };
1122
1129
 
1123
- // packages/ui/react-ui-form/src/components/Form/FormActions.tsx
1130
+ // src/components/Form/FormActions.tsx
1124
1131
  var FormActions = ({ readonly, onCancel, outerSpacing = true }) => {
1125
1132
  var _effect = _useSignals9();
1126
1133
  try {
@@ -1128,7 +1135,7 @@ var FormActions = ({ readonly, onCancel, outerSpacing = true }) => {
1128
1135
  const { canSave, handleSave } = useFormContext();
1129
1136
  return /* @__PURE__ */ React9.createElement("div", {
1130
1137
  role: "none",
1131
- className: mx6(outerSpacing === "scroll-fields" ? "pli-cardSpacingInline mbe-cardSpacingBlock" : outerSpacing ? cardSpacing : "mbs-cardSpacingBlock", "flex [&_button]:grow gap-1 first:mbs-0")
1138
+ className: mx5(outerSpacing === "scroll-fields" ? "pli-cardSpacingInline mbe-cardSpacingBlock" : outerSpacing ? cardSpacing : "mbs-cardSpacingBlock", "flex [&_button]:grow gap-1 first:mbs-0")
1132
1139
  }, onCancel && !readonly && /* @__PURE__ */ React9.createElement(IconButton2, {
1133
1140
  "data-testid": "cancel-button",
1134
1141
  icon: "ph--x--regular",
@@ -1147,27 +1154,17 @@ var FormActions = ({ readonly, onCancel, outerSpacing = true }) => {
1147
1154
  }
1148
1155
  };
1149
1156
 
1150
- // packages/ui/react-ui-form/src/components/Form/FormContent.tsx
1157
+ // src/components/Form/FormContent.tsx
1151
1158
  import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
1152
1159
  import { Schema, SchemaAST as SchemaAST4, pipe as pipe2 } from "effect";
1153
1160
  import { capitalize as capitalize2 } from "effect/String";
1154
1161
  import React12, { forwardRef, useMemo as useMemo5 } from "react";
1155
1162
  import { createJsonPath as createJsonPath3, findNode as findNode3, getDiscriminatedType as getDiscriminatedType2, isDiscriminatedUnion as isDiscriminatedUnion2 } from "@dxos/effect";
1156
- import { mx as mx8 } from "@dxos/react-ui-theme";
1163
+ import { mx as mx7 } from "@dxos/react-ui-theme";
1157
1164
  import { getSchemaProperties as getSchemaProperties2 } from "@dxos/schema";
1158
1165
  import { isNotFalsy } from "@dxos/util";
1159
1166
 
1160
- // packages/ui/react-ui-form/src/components/Form/ArrayField.tsx
1161
- import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
1162
- import { SchemaAST as SchemaAST3, pipe } from "effect";
1163
- import { capitalize } from "effect/String";
1164
- import React10, { Fragment, useCallback as useCallback7 } from "react";
1165
- import { findNode as findNode2, getDiscriminatedType, isDiscriminatedUnion, SimpleType } from "@dxos/effect";
1166
- import { invariant as invariant2 } from "@dxos/invariant";
1167
- import { IconButton as IconButton3, useTranslation as useTranslation6 } from "@dxos/react-ui";
1168
- import { getSchemaProperties } from "@dxos/schema";
1169
-
1170
- // packages/ui/react-ui-form/src/util/field.ts
1167
+ // src/util/field.ts
1171
1168
  import { FormatEnum, GeoLocation as GeoLocation2, TypeEnum } from "@dxos/echo-schema";
1172
1169
  var parseValue = ({ type, format, value }) => {
1173
1170
  if (value === void 0 || value === null || value === "") {
@@ -1299,7 +1296,7 @@ var pathNotUniqueError = (path) => ({
1299
1296
  message: `'${path}' is already present`
1300
1297
  });
1301
1298
 
1302
- // packages/ui/react-ui-form/src/util/formatting.ts
1299
+ // src/util/formatting.ts
1303
1300
  import { format as formatDate } from "date-fns/format";
1304
1301
  import { FormatEnum as FormatEnum2, GeoLocation as GeoLocation3, TypeEnum as TypeEnum2 } from "@dxos/echo-schema";
1305
1302
  var formatForDisplay = ({ type, format, value, locale = void 0 }) => {
@@ -1437,11 +1434,11 @@ var formatForEditing = ({ type, format, value, locale = void 0 }) => {
1437
1434
  }
1438
1435
  };
1439
1436
 
1440
- // packages/ui/react-ui-form/src/util/refs.ts
1437
+ // src/util/refs.ts
1441
1438
  import { FormatEnum as FormatEnum3, ReferenceAnnotationId } from "@dxos/echo-schema";
1442
1439
  import { findAnnotation } from "@dxos/effect";
1443
1440
 
1444
- // packages/ui/react-ui-form/src/util/schema.ts
1441
+ // src/util/schema.ts
1445
1442
  import { SchemaAST as SchemaAST2 } from "effect";
1446
1443
  import { findNode } from "@dxos/effect";
1447
1444
  var findArrayElementType = (ast) => {
@@ -1450,7 +1447,7 @@ var findArrayElementType = (ast) => {
1450
1447
  return elementType;
1451
1448
  };
1452
1449
 
1453
- // packages/ui/react-ui-form/src/util/refs.ts
1450
+ // src/util/refs.ts
1454
1451
  var getRefProps = (property) => {
1455
1452
  const { ast, format, array } = property;
1456
1453
  if (format === FormatEnum3.Ref) {
@@ -1474,8 +1471,16 @@ var getRefProps = (property) => {
1474
1471
  return void 0;
1475
1472
  };
1476
1473
 
1477
- // packages/ui/react-ui-form/src/components/Form/ArrayField.tsx
1478
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/Form/ArrayField.tsx";
1474
+ // src/components/Form/ArrayField.tsx
1475
+ import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
1476
+ import { SchemaAST as SchemaAST3, pipe } from "effect";
1477
+ import { capitalize } from "effect/String";
1478
+ import React10, { Fragment, useCallback as useCallback7 } from "react";
1479
+ import { SimpleType, findNode as findNode2, getDiscriminatedType, isDiscriminatedUnion } from "@dxos/effect";
1480
+ import { invariant as invariant2 } from "@dxos/invariant";
1481
+ import { IconButton as IconButton3, useTranslation as useTranslation6 } from "@dxos/react-ui";
1482
+ import { getSchemaProperties } from "@dxos/schema";
1483
+ var __dxlog_file3 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/components/Form/ArrayField.tsx";
1479
1484
  var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponent }) => {
1480
1485
  var _effect = _useSignals10();
1481
1486
  try {
@@ -1484,7 +1489,7 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
1484
1489
  const values = useFormValues(path ?? []) ?? [];
1485
1490
  invariant2(Array.isArray(values), `Values at path ${path?.join(".")} must be an array.`, {
1486
1491
  F: __dxlog_file3,
1487
- L: 36,
1492
+ L: 37,
1488
1493
  S: void 0,
1489
1494
  A: [
1490
1495
  "Array.isArray(values)",
@@ -1561,7 +1566,7 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
1561
1566
  classNames: "self-center"
1562
1567
  }));
1563
1568
  })), !readonly && /* @__PURE__ */ React10.createElement(IconButton3, {
1564
- classNames: "is-full mlb-1 flex",
1569
+ classNames: "is-full mlb-cardSpacingBlock flex",
1565
1570
  icon: "ph--plus--regular",
1566
1571
  label: t("add field"),
1567
1572
  onClick: handleAdd
@@ -1571,16 +1576,35 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
1571
1576
  }
1572
1577
  };
1573
1578
 
1574
- // packages/ui/react-ui-form/src/components/Form/RefField.tsx
1579
+ // src/components/Form/factory.tsx
1580
+ import { FormatEnum as FormatEnum4 } from "@dxos/echo-schema";
1581
+ var getInputComponent = (type, format) => {
1582
+ switch (format) {
1583
+ case FormatEnum4.GeoPoint:
1584
+ return GeoPointInput;
1585
+ case FormatEnum4.Markdown:
1586
+ return MarkdownInput;
1587
+ }
1588
+ switch (type) {
1589
+ case "string":
1590
+ return TextInput;
1591
+ case "number":
1592
+ return NumberInput;
1593
+ case "boolean":
1594
+ return BooleanInput;
1595
+ }
1596
+ };
1597
+
1598
+ // src/components/Form/RefField.tsx
1575
1599
  import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
1576
1600
  import React11, { useCallback as useCallback8, useMemo as useMemo4 } from "react";
1577
- import { Expando, getTypeAnnotation, Ref, ReferenceAnnotationId as ReferenceAnnotationId2 } from "@dxos/echo-schema";
1601
+ import { Expando, Ref, ReferenceAnnotationId as ReferenceAnnotationId2, getTypeAnnotation } from "@dxos/echo-schema";
1578
1602
  import { findAnnotation as findAnnotation2 } from "@dxos/effect";
1579
1603
  import { DXN } from "@dxos/keys";
1580
1604
  import { DxRefTag } from "@dxos/lit-ui/react";
1581
1605
  import { Input as Input8, useTranslation as useTranslation7 } from "@dxos/react-ui";
1582
1606
  import { TagPicker } from "@dxos/react-ui-tag-picker";
1583
- import { descriptionText, mx as mx7 } from "@dxos/react-ui-theme";
1607
+ import { descriptionText, mx as mx6 } from "@dxos/react-ui-theme";
1584
1608
  import { isNonNullable as isNonNullable2 } from "@dxos/util";
1585
1609
  var RefField = ({ type, label, disabled, placeholder, inputOnly, array, ast, getValue: getValue3, onBlur, onQueryRefOptions, onValueChange, ...restInputProps }) => {
1586
1610
  var _effect = _useSignals11();
@@ -1679,7 +1703,7 @@ var RefField = ({ type, label, disabled, placeholder, inputOnly, array, ast, get
1679
1703
  }), /* @__PURE__ */ React11.createElement("div", {
1680
1704
  "data-no-submit": true
1681
1705
  }, disabled ? items.length < 1 ? /* @__PURE__ */ React11.createElement("p", {
1682
- className: mx7(descriptionText, "mbe-2")
1706
+ className: mx6(descriptionText, "mbe-2")
1683
1707
  }, t("empty readonly ref field label")) : items.map((item) => /* @__PURE__ */ React11.createElement(DxRefTag, {
1684
1708
  key: item.id,
1685
1709
  refid: item.id,
@@ -1694,7 +1718,7 @@ var RefField = ({ type, label, disabled, placeholder, inputOnly, array, ast, get
1694
1718
  onBlur: (event) => onBlur(event),
1695
1719
  onUpdate: handleUpdate,
1696
1720
  onSearch: handleSearch,
1697
- classNames: "rounded-sm bg-inputSurface p-1.5"
1721
+ classNames: "bg-inputSurface p-1.5 rounded-sm"
1698
1722
  })), inputOnly && /* @__PURE__ */ React11.createElement(Input8.DescriptionAndValidation, null, error));
1699
1723
  } finally {
1700
1724
  _effect.f();
@@ -1738,26 +1762,7 @@ var RefFieldFallback = ({ type, label, disabled, placeholder, inputOnly, getValu
1738
1762
  }
1739
1763
  };
1740
1764
 
1741
- // packages/ui/react-ui-form/src/components/Form/factory.tsx
1742
- import { FormatEnum as FormatEnum4 } from "@dxos/echo-schema";
1743
- var getInputComponent = (type, format) => {
1744
- switch (format) {
1745
- case FormatEnum4.GeoPoint:
1746
- return GeoPointInput;
1747
- case FormatEnum4.Markdown:
1748
- return MarkdownInput;
1749
- }
1750
- switch (type) {
1751
- case "string":
1752
- return TextInput;
1753
- case "number":
1754
- return NumberInput;
1755
- case "boolean":
1756
- return BooleanInput;
1757
- }
1758
- };
1759
-
1760
- // packages/ui/react-ui-form/src/components/Form/FormContent.tsx
1765
+ // src/components/Form/FormContent.tsx
1761
1766
  var FormField = ({ property, path, readonly, inline, onQueryRefOptions, lookupComponent, Custom }) => {
1762
1767
  var _effect = _useSignals12();
1763
1768
  try {
@@ -1855,7 +1860,7 @@ var FormField = ({ property, path, readonly, inline, onQueryRefOptions, lookupCo
1855
1860
  const typeLiteral = baseNode ? getDiscriminatedType2(baseNode, inputProps.getValue()) : findNode3(ast, SchemaAST4.isTypeLiteral);
1856
1861
  if (typeLiteral) {
1857
1862
  return /* @__PURE__ */ React12.createElement(React12.Fragment, null, !inline && /* @__PURE__ */ React12.createElement("h3", {
1858
- className: mx8("text-lg mlb-inputSpacingBlock first:mbs-0")
1863
+ className: mx7("text-lg mlb-inputSpacingBlock first:mbs-0")
1859
1864
  }, label), /* @__PURE__ */ React12.createElement(FormFields, {
1860
1865
  schema: Schema.make(typeLiteral),
1861
1866
  path,
@@ -1887,7 +1892,7 @@ var FormFields = /* @__PURE__ */ forwardRef(({ classNames, testId, schema, path,
1887
1892
  ]);
1888
1893
  return /* @__PURE__ */ React12.createElement("div", {
1889
1894
  role: "form",
1890
- className: mx8("is-full", classNames),
1895
+ className: mx7("is-full", classNames),
1891
1896
  ref: forwardRef2
1892
1897
  }, properties.map((property) => {
1893
1898
  return /* @__PURE__ */ React12.createElement(FormField, {
@@ -1908,7 +1913,7 @@ var FormFields = /* @__PURE__ */ forwardRef(({ classNames, testId, schema, path,
1908
1913
  }
1909
1914
  });
1910
1915
 
1911
- // packages/ui/react-ui-form/src/components/Form/Form.tsx
1916
+ // src/components/Form/Form.tsx
1912
1917
  var Form = ({ classNames, testId, values: initialValues, autoFocus, readonly, autoSave, outerSpacing = true, onCancel, schema, onValuesChanged, onValidate, onSave, ...props }) => {
1913
1918
  var _effect = _useSignals13();
1914
1919
  try {
@@ -1950,7 +1955,7 @@ var Form = ({ classNames, testId, values: initialValues, autoFocus, readonly, au
1950
1955
  ],
1951
1956
  readonly,
1952
1957
  schema
1953
- }), (onCancel || onSave) && !autoSave && /* @__PURE__ */ React13.createElement(FormActions, {
1958
+ }), (onCancel || onSave) && !autoSave && !readonly && /* @__PURE__ */ React13.createElement(FormActions, {
1954
1959
  readonly,
1955
1960
  onCancel,
1956
1961
  outerSpacing
@@ -1960,9 +1965,9 @@ var Form = ({ classNames, testId, values: initialValues, autoFocus, readonly, au
1960
1965
  }
1961
1966
  };
1962
1967
 
1963
- // packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx
1964
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx";
1965
- var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerSpacing }) => {
1968
+ // src/components/FieldEditor/FieldEditor.tsx
1969
+ var __dxlog_file4 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx";
1970
+ var FieldEditor = ({ readonly, projection, field, registry, onSave, onCancel, outerSpacing }) => {
1966
1971
  var _effect = _useSignals14();
1967
1972
  try {
1968
1973
  const { t } = useTranslation8(translationKey);
@@ -2036,7 +2041,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerS
2036
2041
  props.referenceSchema
2037
2042
  ]);
2038
2043
  const handleValidate = useCallback9(({ property }) => {
2039
- if (property && view.fields.find((f) => f.path === property && f.path !== field.path)) {
2044
+ if (property && projection.fields.find((f) => f.path === property && f.path !== field.path)) {
2040
2045
  return [
2041
2046
  {
2042
2047
  path: "property",
@@ -2045,7 +2050,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerS
2045
2050
  ];
2046
2051
  }
2047
2052
  }, [
2048
- view.fields,
2053
+ projection.fields,
2049
2054
  field
2050
2055
  ]);
2051
2056
  const handleSave = useCallback9((props2) => {
@@ -2097,7 +2102,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerS
2097
2102
  props
2098
2103
  }, {
2099
2104
  F: __dxlog_file4,
2100
- L: 183,
2105
+ L: 182,
2101
2106
  S: void 0,
2102
2107
  C: (f, a) => f(...a)
2103
2108
  });
@@ -2106,6 +2111,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerS
2106
2111
  return /* @__PURE__ */ React14.createElement(Form, {
2107
2112
  key: field.id,
2108
2113
  autoFocus: true,
2114
+ readonly,
2109
2115
  values: props,
2110
2116
  schema: fieldSchema,
2111
2117
  filter: propIsNotType,
@@ -2125,7 +2131,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel, outerS
2125
2131
  }
2126
2132
  };
2127
2133
 
2128
- // packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx
2134
+ // src/components/ViewEditor/ViewEditor.tsx
2129
2135
  import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
2130
2136
  import { Schema as Schema2 } from "effect";
2131
2137
  import React15, { useCallback as useCallback10, useMemo as useMemo8, useState as useState6 } from "react";
@@ -2134,16 +2140,14 @@ import { invariant as invariant3 } from "@dxos/invariant";
2134
2140
  import { Callout, IconButton as IconButton4, useTranslation as useTranslation9 } from "@dxos/react-ui";
2135
2141
  import { List as List2 } from "@dxos/react-ui-list";
2136
2142
  import { cardSpacing as cardSpacing3 } from "@dxos/react-ui-stack";
2137
- import { ghostHover, inputTextLabel, mx as mx9 } from "@dxos/react-ui-theme";
2138
- import { FieldSchema, ViewProjection, VIEW_FIELD_LIMIT } from "@dxos/schema";
2139
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx";
2140
- var grid = "grid grid-cols-[32px_1fr_32px_32px] min-bs-[2.5rem]";
2143
+ import { inputTextLabel, mx as mx8, subtleHover as subtleHover2 } from "@dxos/react-ui-theme";
2144
+ import { FieldSchema, ProjectionModel, VIEW_FIELD_LIMIT } from "@dxos/schema";
2145
+ var __dxlog_file5 = "/__w/dxos/dxos/packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx";
2146
+ var listGrid = "grid grid-cols-[min-content_1fr_min-content_min-content_min-content]";
2147
+ var listItemGrid = "grid grid-cols-subgrid col-span-5";
2141
2148
  var ViewMetaSchema = Schema2.Struct({
2142
- name: Schema2.String.annotations({
2143
- title: "View"
2144
- }),
2145
2149
  typename: Format.URL.annotations({
2146
- title: "Typename"
2150
+ title: "Record type"
2147
2151
  })
2148
2152
  }).pipe(Schema2.mutable);
2149
2153
  var ViewEditor = ({ classNames, schema, view, registry, readonly: _readonly, showHeading = false, onTypenameChanged, onDelete, outerSpacing = true }) => {
@@ -2152,52 +2156,48 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly: _readonly, sho
2152
2156
  const { t } = useTranslation9(translationKey);
2153
2157
  const projection = useMemo8(() => {
2154
2158
  const jsonSchema = schema instanceof EchoSchema ? schema.jsonSchema : toJsonSchema(schema);
2155
- return new ViewProjection(jsonSchema, view);
2159
+ return new ProjectionModel(jsonSchema, view.projection);
2156
2160
  }, [
2157
2161
  schema,
2158
- view
2162
+ view.projection
2159
2163
  ]);
2160
- const [field, setField] = useState6();
2164
+ const [expandedField, setExpandedField] = useState6();
2161
2165
  const readonly = _readonly || !isMutable(schema);
2162
2166
  const viewValues = useMemo8(() => {
2163
2167
  return {
2164
- name: view.name,
2165
2168
  // TODO(burdon): Need to warn user of possible consequences of editing.
2166
2169
  // TODO(burdon): Settings should have domain name owned by user.
2167
2170
  typename: view.query.typename
2168
2171
  };
2169
2172
  }, [
2170
- view
2173
+ view.query.typename
2171
2174
  ]);
2172
- const handleSelect = useCallback10((field2) => {
2173
- if (readonly) {
2174
- return;
2175
- }
2176
- setField((f) => f === field2 ? void 0 : field2);
2175
+ const handleToggleField = useCallback10((field) => {
2176
+ setExpandedField((prevExpandedFieldId) => prevExpandedFieldId === field.id ? void 0 : field.id);
2177
2177
  }, [
2178
2178
  readonly
2179
2179
  ]);
2180
2180
  const handleAdd = useCallback10(() => {
2181
2181
  invariant3(!readonly, void 0, {
2182
2182
  F: __dxlog_file5,
2183
- L: 92,
2183
+ L: 86,
2184
2184
  S: void 0,
2185
2185
  A: [
2186
2186
  "!readonly",
2187
2187
  ""
2188
2188
  ]
2189
2189
  });
2190
- const field2 = projection.createFieldProjection();
2191
- setField(field2);
2190
+ const field = projection.createFieldProjection();
2191
+ setExpandedField(field.id);
2192
2192
  }, [
2193
2193
  schema,
2194
- view,
2194
+ projection,
2195
2195
  readonly
2196
2196
  ]);
2197
- const handleUpdate = useCallback10(({ name, typename }) => {
2197
+ const handleUpdate = useCallback10(({ typename }) => {
2198
2198
  invariant3(!readonly, void 0, {
2199
2199
  F: __dxlog_file5,
2200
- L: 99,
2200
+ L: 93,
2201
2201
  S: void 0,
2202
2202
  A: [
2203
2203
  "!readonly",
@@ -2205,43 +2205,38 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly: _readonly, sho
2205
2205
  ]
2206
2206
  });
2207
2207
  requestAnimationFrame(() => {
2208
- if (view.name !== name) {
2209
- view.name = name;
2210
- }
2211
2208
  if (view.query.typename !== typename && !readonly) {
2212
2209
  onTypenameChanged?.(typename);
2213
2210
  }
2214
2211
  });
2215
2212
  }, [
2216
- schema,
2217
- view,
2213
+ view.query.typename,
2218
2214
  onTypenameChanged,
2219
2215
  readonly
2220
2216
  ]);
2221
2217
  const handleDelete = useCallback10((fieldId) => {
2222
2218
  invariant3(!readonly, void 0, {
2223
2219
  F: __dxlog_file5,
2224
- L: 115,
2220
+ L: 105,
2225
2221
  S: void 0,
2226
2222
  A: [
2227
2223
  "!readonly",
2228
2224
  ""
2229
2225
  ]
2230
2226
  });
2231
- if (fieldId === field?.id) {
2232
- setField(void 0);
2227
+ if (fieldId === expandedField) {
2228
+ setExpandedField(void 0);
2233
2229
  }
2234
2230
  onDelete?.(fieldId);
2235
2231
  }, [
2236
- schema,
2237
- field,
2232
+ expandedField,
2238
2233
  onDelete,
2239
2234
  readonly
2240
2235
  ]);
2241
2236
  const handleMove = useCallback10((fromIndex, toIndex) => {
2242
2237
  invariant3(!readonly, void 0, {
2243
2238
  F: __dxlog_file5,
2244
- L: 127,
2239
+ L: 117,
2245
2240
  S: void 0,
2246
2241
  A: [
2247
2242
  "!readonly",
@@ -2249,39 +2244,39 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly: _readonly, sho
2249
2244
  ]
2250
2245
  });
2251
2246
  const fields = [
2252
- ...view.fields
2247
+ ...view.projection.fields
2253
2248
  ];
2254
2249
  const [moved] = fields.splice(fromIndex, 1);
2255
2250
  fields.splice(toIndex, 0, moved);
2256
- view.fields = fields;
2251
+ view.projection.fields = fields;
2257
2252
  }, [
2258
- schema,
2259
- view.fields,
2253
+ view.projection.fields,
2260
2254
  readonly
2261
2255
  ]);
2262
- const handleClose = useCallback10(() => setField(void 0), []);
2256
+ const handleClose = useCallback10(() => setExpandedField(void 0), []);
2263
2257
  const hiddenProperties = projection.getHiddenProperties();
2264
2258
  const handleHide = useCallback10((fieldId) => {
2265
- setField(void 0);
2259
+ setExpandedField(void 0);
2266
2260
  projection.hideFieldProjection(fieldId);
2267
2261
  }, [
2268
2262
  projection
2269
2263
  ]);
2270
2264
  const handleShow = useCallback10((property) => {
2271
- setField(void 0);
2265
+ setExpandedField(void 0);
2272
2266
  projection.showFieldProjection(property);
2273
2267
  }, [
2274
2268
  projection
2275
2269
  ]);
2276
2270
  return /* @__PURE__ */ React15.createElement("div", {
2277
2271
  role: "none",
2278
- className: mx9(classNames)
2279
- }, readonly && /* @__PURE__ */ React15.createElement("div", {
2280
- role: "none",
2281
- className: mx9("is-full", outerSpacing && "plb-cardSpacingBlock pli-cardSpacingInline")
2282
- }, /* @__PURE__ */ React15.createElement(Callout.Root, {
2283
- valence: "info"
2284
- }, /* @__PURE__ */ React15.createElement(Callout.Title, null, t("system schema description")))), /* @__PURE__ */ React15.createElement(Form, {
2272
+ className: mx8(classNames)
2273
+ }, readonly && /* @__PURE__ */ React15.createElement(Callout.Root, {
2274
+ valence: "info",
2275
+ classNames: [
2276
+ "is-full mlb-cardSpacingBlock",
2277
+ outerSpacing && "mli-cardSpacingInline"
2278
+ ]
2279
+ }, /* @__PURE__ */ React15.createElement(Callout.Title, null, t("system schema description"))), /* @__PURE__ */ React15.createElement(Form, {
2285
2280
  autoSave: true,
2286
2281
  schema: ViewMetaSchema,
2287
2282
  values: viewValues,
@@ -2291,64 +2286,82 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly: _readonly, sho
2291
2286
  }), /* @__PURE__ */ React15.createElement("div", {
2292
2287
  role: "none",
2293
2288
  className: outerSpacing ? cardSpacing3 : "mlb-cardSpacingBlock"
2294
- }, /* @__PURE__ */ React15.createElement("label", {
2295
- className: mx9(inputTextLabel)
2289
+ }, /* @__PURE__ */ React15.createElement("h2", {
2290
+ className: mx8(inputTextLabel)
2296
2291
  }, t("fields label")), /* @__PURE__ */ React15.createElement(List2.Root, {
2297
- items: view.fields,
2292
+ items: view.projection.fields,
2298
2293
  isItem: Schema2.is(FieldSchema),
2299
- getId: (field2) => field2.id,
2300
- readonly,
2301
- onMove: readonly ? void 0 : handleMove
2302
- }, ({ items: fields }) => /* @__PURE__ */ React15.createElement(React15.Fragment, null, showHeading && /* @__PURE__ */ React15.createElement("div", {
2303
- role: "heading",
2304
- className: grid
2305
- }, /* @__PURE__ */ React15.createElement("div", null), /* @__PURE__ */ React15.createElement("div", {
2306
- className: "flex items-center text-sm"
2307
- }, t("field path label"))), /* @__PURE__ */ React15.createElement("div", {
2294
+ getId: (field) => field.id,
2295
+ onMove: readonly ? void 0 : handleMove,
2296
+ readonly
2297
+ }, ({ items: fields }) => /* @__PURE__ */ React15.createElement(React15.Fragment, null, showHeading && /* @__PURE__ */ React15.createElement("h3", {
2298
+ className: "text-sm"
2299
+ }, t("field path label")), /* @__PURE__ */ React15.createElement("div", {
2308
2300
  role: "list",
2309
- className: "flex flex-col is-full"
2310
- }, fields?.map((field2) => /* @__PURE__ */ React15.createElement(List2.Item, {
2311
- key: field2.id,
2312
- item: field2,
2313
- classNames: mx9(grid, ghostHover, "overflow-hidden", !readonly && "cursor-pointer")
2314
- }, /* @__PURE__ */ React15.createElement(List2.ItemDragHandle, null), /* @__PURE__ */ React15.createElement(List2.ItemTitle, {
2315
- onClick: () => handleSelect(field2)
2316
- }, field2.path), /* @__PURE__ */ React15.createElement(List2.ItemButton, {
2301
+ className: listGrid
2302
+ }, fields?.map((field) => /* @__PURE__ */ React15.createElement(List2.Item, {
2303
+ key: field.id,
2304
+ item: field,
2305
+ classNames: listItemGrid,
2306
+ "aria-expanded": expandedField === field.id
2307
+ }, /* @__PURE__ */ React15.createElement("div", {
2308
+ role: "none",
2309
+ className: mx8(subtleHover2, listItemGrid, "rounded-sm cursor-pointer min-bs-10")
2310
+ }, /* @__PURE__ */ React15.createElement(List2.ItemDragHandle, {
2311
+ disabled: readonly
2312
+ }), /* @__PURE__ */ React15.createElement(List2.ItemTitle, {
2313
+ onClick: () => handleToggleField(field)
2314
+ }, field.path), /* @__PURE__ */ React15.createElement(List2.ItemButton, {
2315
+ label: t("hide field label"),
2317
2316
  "data-testid": "hide-field-button",
2318
2317
  icon: "ph--eye-slash--regular",
2318
+ autoHide: false,
2319
2319
  // TDOO(burdon): Is this the correct test?
2320
- disabled: view.fields.length <= 1,
2321
- onClick: () => handleHide(field2.id)
2322
- }), !readonly && /* @__PURE__ */ React15.createElement(List2.ItemDeleteButton, {
2323
- disabled: view.fields.length <= 1,
2324
- onClick: () => handleDelete(field2.id)
2325
- })))))), hiddenProperties.length > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("label", {
2326
- className: mx9(inputTextLabel)
2320
+ disabled: readonly || view.projection.fields.length <= 1,
2321
+ onClick: () => handleHide(field.id)
2322
+ }), /* @__PURE__ */ React15.createElement(List2.ItemDeleteButton, {
2323
+ label: t("delete field label"),
2324
+ autoHide: false,
2325
+ disabled: readonly || view.projection.fields.length <= 1,
2326
+ onClick: () => handleDelete(field.id),
2327
+ "data-testid": "field.delete"
2328
+ }), /* @__PURE__ */ React15.createElement(IconButton4, {
2329
+ iconOnly: true,
2330
+ variant: "ghost",
2331
+ label: t("toggle expand label", {
2332
+ ns: "os"
2333
+ }),
2334
+ icon: expandedField === field.id ? "ph--caret-down--regular" : "ph--caret-right--regular",
2335
+ onClick: () => handleToggleField(field)
2336
+ })), expandedField === field.id && /* @__PURE__ */ React15.createElement("div", {
2337
+ role: "none",
2338
+ className: "col-span-5"
2339
+ }, /* @__PURE__ */ React15.createElement(FieldEditor, {
2340
+ readonly,
2341
+ projection,
2342
+ field,
2343
+ registry,
2344
+ onSave: handleClose
2345
+ }))))))), hiddenProperties.length > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("h2", {
2346
+ className: mx8(inputTextLabel)
2327
2347
  }, t("hidden fields label")), /* @__PURE__ */ React15.createElement(List2.Root, {
2328
2348
  items: hiddenProperties,
2329
2349
  isItem: (item) => typeof item === "string",
2330
2350
  getId: (property) => property
2331
2351
  }, ({ items: properties }) => /* @__PURE__ */ React15.createElement("div", {
2332
2352
  role: "list",
2333
- className: "flex flex-col is-full"
2353
+ className: "grid grid-cols-[1fr_min-content]"
2334
2354
  }, properties?.map((property) => /* @__PURE__ */ React15.createElement(List2.Item, {
2335
2355
  key: property,
2336
2356
  item: property,
2337
- classNames: mx9(grid, ghostHover, !readonly && "cursor-pointer")
2338
- }, /* @__PURE__ */ React15.createElement(List2.ItemDragHandle, {
2339
- disabled: true
2340
- }), /* @__PURE__ */ React15.createElement(List2.ItemTitle, null, property), /* @__PURE__ */ React15.createElement(List2.ItemButton, {
2357
+ classNames: mx8("grid grid-cols-subgrid col-span-2 rounded-sm", subtleHover2)
2358
+ }, /* @__PURE__ */ React15.createElement(List2.ItemTitle, null, property), /* @__PURE__ */ React15.createElement(List2.ItemButton, {
2359
+ label: t("show field label"),
2360
+ disabled: readonly,
2341
2361
  icon: "ph--eye--regular",
2342
2362
  onClick: () => handleShow(property),
2343
2363
  "data-testid": "show-field-button"
2344
- }))))))), field && /* @__PURE__ */ React15.createElement(FieldEditor, {
2345
- key: field.id,
2346
- view,
2347
- projection,
2348
- field,
2349
- registry,
2350
- onSave: handleClose
2351
- }), !readonly && !field && /* @__PURE__ */ React15.createElement("div", {
2364
+ }))))))), !readonly && !expandedField && /* @__PURE__ */ React15.createElement("div", {
2352
2365
  role: "none",
2353
2366
  className: outerSpacing ? cardSpacing3 : "mlb-cardSpacingBlock"
2354
2367
  }, /* @__PURE__ */ React15.createElement(IconButton4, {
@@ -2356,8 +2369,8 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly: _readonly, sho
2356
2369
  label: t("button add property"),
2357
2370
  onClick: readonly ? void 0 : handleAdd,
2358
2371
  // TODO(burdon): Show field limit in ux (not tooltip).
2359
- disabled: view.fields.length >= VIEW_FIELD_LIMIT,
2360
- classNames: "flex is-full"
2372
+ disabled: view.projection.fields.length >= VIEW_FIELD_LIMIT,
2373
+ classNames: "is-full"
2361
2374
  })));
2362
2375
  } finally {
2363
2376
  _effect.f();
@@ -2396,7 +2409,7 @@ export {
2396
2409
  getRefProps,
2397
2410
  parseValue,
2398
2411
  pathNotUniqueError,
2399
- translations_default as translations,
2412
+ translations,
2400
2413
  useForm,
2401
2414
  useFormContext,
2402
2415
  useFormValues,