@nivaro/react 0.3.36 → 0.3.38

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 (102) hide show
  1. package/dist/components/slots/CommentsSlot.js +44 -36
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +9 -1
  5. package/dist/shared/components/AgentBadge.js +26 -0
  6. package/dist/shared/components/AgentQuestionsCard.js +198 -0
  7. package/dist/shared/components/ItemEditForm.js +3329 -3263
  8. package/dist/shared/components/McpConnectionScope.js +480 -0
  9. package/dist/shared/components/MyWorkView.js +223 -208
  10. package/dist/shared/components/RecordReadView.js +620 -575
  11. package/dist/shared/components/chat/ChatPanel.js +683 -671
  12. package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
  13. package/dist/shared/components/imports/ImportConsole.js +106 -104
  14. package/dist/shared/components/imports/RunDetailSheet.js +34 -32
  15. package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
  16. package/dist/shared/components/item-edit/FormTour.js +279 -0
  17. package/dist/shared/components/item-edit/GroupSection.js +377 -360
  18. package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
  19. package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
  20. package/dist/shared/components/item-edit/form-density.js +36 -0
  21. package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
  22. package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
  23. package/dist/shared/components/layout-editor/AddPanel.js +349 -192
  24. package/dist/shared/components/layout-editor/DesignNode.js +126 -112
  25. package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
  26. package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
  27. package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
  28. package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
  29. package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
  30. package/dist/shared/components/layout-editor/add-target.js +54 -43
  31. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
  32. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
  33. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
  34. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
  35. package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
  36. package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
  37. package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
  38. package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
  39. package/dist/shared/components/layout-editor/dnd/node.js +115 -105
  40. package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
  41. package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
  42. package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
  43. package/dist/shared/components/layout-editor/even-row.js +86 -0
  44. package/dist/shared/components/layout-editor/field-list.js +99 -0
  45. package/dist/shared/components/layout-editor/format-painter.js +102 -0
  46. package/dist/shared/components/layout-editor/grid-guides.js +15 -13
  47. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
  48. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
  49. package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
  50. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
  51. package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
  52. package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
  53. package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
  54. package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
  55. package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
  56. package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
  57. package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
  58. package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
  59. package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
  60. package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
  61. package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
  62. package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
  63. package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
  64. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
  65. package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
  66. package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
  67. package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
  68. package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
  69. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  70. package/dist/shared/components/layout-editor/pin.js +37 -19
  71. package/dist/shared/components/layout-editor/place-clip.js +257 -0
  72. package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
  73. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
  74. package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
  75. package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
  76. package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
  77. package/dist/shared/components/layout-editor/removed-log.js +151 -0
  78. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
  79. package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
  80. package/dist/shared/components/layout-editor/revert-element.js +140 -0
  81. package/dist/shared/components/layout-editor/section-structure.js +193 -170
  82. package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
  83. package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
  84. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
  85. package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
  86. package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
  87. package/dist/shared/components/layout-editor/shortcuts.js +21 -16
  88. package/dist/shared/components/layout-editor/structure-ops.js +221 -195
  89. package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
  90. package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
  91. package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
  92. package/dist/shared/components/panels/CommentPanel.js +47 -45
  93. package/dist/shared/components/panels/RevisionsPanel.js +66 -64
  94. package/dist/shared/components/panels/TaskPanel.js +395 -332
  95. package/dist/shared/components/profile/AgentsPanel.js +196 -147
  96. package/dist/shared/components/profile/ConnectionRollback.js +329 -0
  97. package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
  98. package/dist/shared/lib/entry-config.js +22 -22
  99. package/dist/shared/lib/form-usage-beacon.js +91 -55
  100. package/dist/shared/lib/layout-lint.js +530 -284
  101. package/dist/shared/lib/layout-resolve.js +58 -44
  102. package/package.json +1 -1
@@ -1,39 +1,41 @@
1
- import { jsx as t, jsxs as a, Fragment as k } from "react/jsx-runtime";
2
- import { MousePointerClick as Q } from "lucide-react";
3
- import { useMemo as Y, useState as Z, useId as ee } from "react";
4
- import { HEADER_GROUP_KEY as O, CANVAS_SLOT_KEYS as te, UNGROUPED_KEY as le } from "../../../lib/layout-ops.js";
5
- import { isDisplayFormulaField as ne } from "../../../lib/placement-behaviour.js";
6
- import { cn as ie, titleCase as h } from "../../../lib/utils.js";
7
- import { TipLayer as re } from "../../TipLayer.js";
8
- import { ArrangeButton as oe } from "../ArrangeButton.js";
9
- import { AutoArrangeButton as ae } from "../AutoArrange.js";
10
- import { useLayoutDesign as de, targetKey as se } from "../design-context.js";
11
- import { PlacementPresets as ce } from "../entry/PlacementPresets.js";
12
- import { FIELD_HOLDERS as ue } from "../field-zones.js";
13
- import { PanelHeader as E, PanelBody as F, PanelTabs as me, tabId as fe, tabPanelId as pe } from "../panel-frame.js";
14
- import { tintCard as be } from "../panel-style.js";
15
- import { slotName as z } from "../slot-names.js";
16
- import { useLayoutBundle as he } from "../useLayoutDraft.js";
17
- import { AdvancedTab as ye } from "./AdvancedTab.js";
18
- import { DisplayFormulaSettings as ke } from "./BehaviourSettings.js";
19
- import { Breadcrumb as I } from "./Breadcrumb.js";
20
- import { useCollectionMeta as R, useGlobalWriter as xe, useFieldCtxValue as _e, FieldCtxContext as ve } from "./field-context.js";
21
- import { GridTab as ge } from "./GridTab.js";
22
- import { GroupInspector as Ne } from "./GroupInspector.js";
23
- import { HeaderItemInspector as Te } from "./HeaderItemInspector.js";
24
- import { HelpVideoSetting as $, NoteSetting as V } from "./HelpTab.js";
25
- import { InspectorEnvContext as W, useInspectorEnv as L, ScopeLegend as H, GlobalWriterContext as Pe } from "./kit.js";
26
- import { LookTab as Se } from "./LookTab.js";
27
- import { isDefaultForm as Ie, layoutTypeOf as Ee, findPlacement as w, SUBTITLE_FIELD as A, overrideGroupOps as Fe, overridePlacementOps as Le, describeField as q, asObject as G, NUMERIC_TYPES as Ce } from "./model.js";
28
- import { OverrideNotice as Ke } from "./OverrideNotice.js";
29
- import { PickerTab as Me } from "./PickerTab.js";
30
- import { RulesTab as De } from "./RulesTab.js";
31
- import { SlotInspector as Ge } from "./SlotInspector.js";
32
- import { SubtitleInspector as Oe } from "./SubtitleInspector.js";
33
- import { useInspectorTabRequest as Re } from "./tab-request.js";
34
- import { WidgetInspector as He } from "./WidgetInspector.js";
35
- const Ae = /^__widget_\d+__$/, Be = /^__ext_[a-z][a-z0-9-]{1,60}__$/, J = (e) => te.includes(e) || e === "__owners__" || e === "__pdf__" || Be.test(e);
36
- function X(e) {
1
+ import { jsx as t, jsxs as d, Fragment as x } from "react/jsx-runtime";
2
+ import { MousePointerClick as ne } from "lucide-react";
3
+ import { useMemo as q, useState as ie, useId as re } from "react";
4
+ import { HEADER_GROUP_KEY as B, CANVAS_SLOT_KEYS as oe, UNGROUPED_KEY as de } from "../../../lib/layout-ops.js";
5
+ import { isDisplayFormulaField as ae } from "../../../lib/placement-behaviour.js";
6
+ import { cn as se, titleCase as k } from "../../../lib/utils.js";
7
+ import { TipLayer as ce } from "../../TipLayer.js";
8
+ import { ArrangeButton as ue } from "../ArrangeButton.js";
9
+ import { AutoArrangeButton as me } from "../AutoArrange.js";
10
+ import { useLayoutDesign as fe, targetKey as z } from "../design-context.js";
11
+ import { PlacementPresets as pe } from "../entry/PlacementPresets.js";
12
+ import { FIELD_HOLDERS as be } from "../field-zones.js";
13
+ import { RevertInline as J } from "../PlaceTools.js";
14
+ import { PanelHeader as F, PanelBody as C, PanelTabs as he, tabId as ye, tabPanelId as ke } from "../panel-frame.js";
15
+ import { tintCard as ve } from "../panel-style.js";
16
+ import { useLinkedTarget as xe, LinkedSectionNotice as $ } from "../reuse/linked-sections.js";
17
+ import { slotName as X } from "../slot-names.js";
18
+ import { useLayoutBundle as _e } from "../useLayoutDraft.js";
19
+ import { AdvancedTab as ge } from "./AdvancedTab.js";
20
+ import { DisplayFormulaSettings as Ne } from "./BehaviourSettings.js";
21
+ import { Breadcrumb as L } from "./Breadcrumb.js";
22
+ import { useCollectionMeta as W, useGlobalWriter as Pe, useFieldCtxValue as Te, FieldCtxContext as Se } from "./field-context.js";
23
+ import { GridTab as Ie } from "./GridTab.js";
24
+ import { GroupInspector as Ee } from "./GroupInspector.js";
25
+ import { HeaderItemInspector as Le } from "./HeaderItemInspector.js";
26
+ import { HelpVideoSetting as Z, NoteSetting as Q } from "./HelpTab.js";
27
+ import { InspectorEnvContext as D, useInspectorEnv as K, PinZone as w, ScopeLegend as j, GlobalWriterContext as Fe } from "./kit.js";
28
+ import { LookTab as Ce } from "./LookTab.js";
29
+ import { isDefaultForm as Ke, layoutTypeOf as Me, findPlacement as V, SUBTITLE_FIELD as U, overrideGroupOps as Oe, overridePlacementOps as Re, describeField as ee, asObject as A, NUMERIC_TYPES as De } from "./model.js";
30
+ import { OverrideNotice as Ge } from "./OverrideNotice.js";
31
+ import { PickerTab as He } from "./PickerTab.js";
32
+ import { RulesTab as Ae } from "./RulesTab.js";
33
+ import { SlotInspector as Be } from "./SlotInspector.js";
34
+ import { SubtitleInspector as We } from "./SubtitleInspector.js";
35
+ import { useInspectorTabRequest as we } from "./tab-request.js";
36
+ import { WidgetInspector as je } from "./WidgetInspector.js";
37
+ const Ue = /^__widget_\d+__$/, Ye = /^__ext_[a-z][a-z0-9-]{1,60}__$/, te = (e) => oe.includes(e) || e === "__owners__" || e === "__pdf__" || Ye.test(e);
38
+ function le(e) {
37
39
  switch (e.kind) {
38
40
  case "field":
39
41
  case "slot":
@@ -41,120 +43,147 @@ function X(e) {
41
43
  case "header":
42
44
  return {
43
45
  field: e.field,
44
- group_key: e.field === A ? null : O
46
+ group_key: e.field === U ? null : B
45
47
  };
46
48
  default:
47
49
  return null;
48
50
  }
49
51
  }
50
- function Ft(e) {
51
- const { bundle: l, target: n, apply: i, collection: d } = e, o = de(), m = Y(
52
+ function Dt(e) {
53
+ const { bundle: l, target: n, apply: i, collection: a } = e, o = fe(), f = q(
52
54
  () => ({
53
55
  bundle: l,
54
56
  apply: i,
55
57
  flush: e.flush ?? (() => {
56
58
  }),
57
- collection: d,
58
- layoutType: Ee(l.layout),
59
- defaultForm: Ie(l.layout),
59
+ collection: a,
60
+ layoutType: Me(l.layout),
61
+ defaultForm: Ke(l.layout),
60
62
  select: e.onSelect
61
63
  }),
62
- [l, i, e.flush, d, e.onSelect]
63
- ), s = n ? X(n) : null, r = s ? w(l, s.field, s.group_key) : null, x = (n == null ? void 0 : n.kind) === "group" ? l.groups.find((b) => b.key === n.key) ?? null : null, _ = !!n && (n.kind === "group" ? !x : !r && !J((s == null ? void 0 : s.field) ?? "") && (s == null ? void 0 : s.field) !== A), g = l.layout.parent_layout_id != null ? Number(l.layout.parent_layout_id) : null, C = e.inheritedFrom ?? (n ? (o == null ? void 0 : o.inheritedFrom(n)) ?? null : null), { data: c } = he(g), f = _ && c && s ? w(c, s.field, s.group_key) : null, p = _ && c && (n == null ? void 0 : n.kind) === "group" ? c.groups.find((b) => b.key === n.key) ?? null : null, N = _ && (!!f || !!p || !!C);
64
+ [l, i, e.flush, a, e.onSelect]
65
+ ), s = n ? le(n) : null, r = s ? V(l, s.field, s.group_key) : null, p = (n == null ? void 0 : n.kind) === "group" ? l.groups.find((m) => m.key === n.key) ?? null : null, v = !!n && (n.kind === "group" ? !p : !r && !te((s == null ? void 0 : s.field) ?? "") && (s == null ? void 0 : s.field) !== U), g = l.layout.parent_layout_id != null ? Number(l.layout.parent_layout_id) : null, M = e.inheritedFrom ?? (n ? (o == null ? void 0 : o.inheritedFrom(n)) ?? null : null), { data: c } = _e(g), b = v && c && s ? V(c, s.field, s.group_key) : null, h = v && c && (n == null ? void 0 : n.kind) === "group" ? c.groups.find((m) => m.key === n.key) ?? null : null, N = v && (!!b || !!h || !!M), u = xe(v ? null : n);
64
66
  if (!n)
65
- return /* @__PURE__ */ t(D, { children: /* @__PURE__ */ a("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 px-8 pb-16 text-center", children: [
66
- /* @__PURE__ */ t(Q, { className: "h-5 w-5 text-slate-400" }),
67
+ return /* @__PURE__ */ t(R, { children: /* @__PURE__ */ d("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 px-8 pb-16 text-center", children: [
68
+ /* @__PURE__ */ t(ne, { className: "h-5 w-5 text-slate-400" }),
67
69
  /* @__PURE__ */ t("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: "Select a field, section or panel on the form to change it." })
68
70
  ] }) });
69
71
  if (N) {
70
- const b = c != null && c.layout.name ? String(c.layout.name) : C ?? "the parent form", K = { ...m, bundle: c ?? l, apply: () => {
71
- } }, M = () => {
72
+ const m = c != null && c.layout.name ? String(c.layout.name) : M ?? "the parent form", _ = { ...f, bundle: c ?? l, apply: () => {
73
+ } }, O = () => {
72
74
  if (!c) return;
73
- const y = p ? Fe(l, c, p) : f ? Le(l, c, f) : [];
74
- y.length && i(y, { label: `Override ${P(n)} on this form` });
75
- }, v = /* @__PURE__ */ a("div", { "data-setting": "inspector.inherited_override", className: ie(be, "space-y-2.5 p-3"), children: [
76
- /* @__PURE__ */ a("p", { className: "text-[12px] leading-snug text-slate-700 dark:text-foreground", children: [
75
+ const S = h ? Oe(l, c, h) : b ? Re(l, c, b) : [];
76
+ S.length && i(S, { label: `Override ${I(n)} on this form` });
77
+ }, y = /* @__PURE__ */ d("div", { "data-setting": "inspector.inherited_override", className: se(ve, "space-y-2.5 p-3"), children: [
78
+ /* @__PURE__ */ d("p", { className: "text-[12px] leading-snug text-slate-700 dark:text-foreground", children: [
77
79
  "This comes from ",
78
- /* @__PURE__ */ t("span", { className: "font-medium", children: b }),
80
+ /* @__PURE__ */ t("span", { className: "font-medium", children: m }),
79
81
  ". Change it there for every form built on it, or override it on this form only."
80
82
  ] }),
81
- /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: [
83
+ /* @__PURE__ */ d("div", { className: "flex flex-wrap gap-2", children: [
82
84
  /* @__PURE__ */ t(
83
85
  "button",
84
86
  {
85
87
  type: "button",
86
88
  "data-override-here": "",
87
- disabled: !c || !f && !p,
88
- onClick: M,
89
+ disabled: !c || !b && !h,
90
+ onClick: O,
89
91
  className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white transition-colors hover:bg-[#00b8e0] disabled:opacity-40",
90
92
  children: "Override here"
91
93
  }
92
94
  ),
93
- g != null && e.openLayout && /* @__PURE__ */ a(
95
+ g != null && e.openLayout && /* @__PURE__ */ d(
94
96
  "button",
95
97
  {
96
98
  type: "button",
97
99
  "data-edit-in-parent": "",
98
100
  onClick: () => {
99
- var y;
100
- return (y = e.openLayout) == null ? void 0 : y.call(e, g);
101
+ var S;
102
+ return (S = e.openLayout) == null ? void 0 : S.call(e, g);
101
103
  },
102
104
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 transition-colors hover:bg-slate-50 dark:border-border dark:bg-background dark:text-foreground dark:hover:bg-muted",
103
105
  children: [
104
106
  "Edit in ",
105
- b
107
+ m
106
108
  ]
107
109
  }
108
110
  )
109
111
  ] })
110
112
  ] });
111
- return /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(W.Provider, { value: K, children: p ? /* @__PURE__ */ t(j, { group: p, notice: v, readOnly: !0 }) : f ? /* @__PURE__ */ t(U, { target: n, row: f, notice: v, readOnly: !0 }) : /* @__PURE__ */ a(k, { children: [
112
- /* @__PURE__ */ t(E, { title: P(n) }),
113
- /* @__PURE__ */ t(F, { children: v })
113
+ return /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(D.Provider, { value: _, children: h ? /* @__PURE__ */ t(G, { group: h, notice: y, readOnly: !0 }) : b ? /* @__PURE__ */ t(H, { target: n, row: b, notice: y, readOnly: !0 }) : /* @__PURE__ */ d(x, { children: [
114
+ /* @__PURE__ */ t(F, { title: I(n) }),
115
+ /* @__PURE__ */ t(C, { children: y })
114
116
  ] }) }) });
115
117
  }
116
- const u = _ ? null : /* @__PURE__ */ t(
117
- Ke,
118
+ if (u && !u.editing) {
119
+ const m = /* @__PURE__ */ t($, { link: u.link }), _ = { ...f, apply: () => {
120
+ } };
121
+ return /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(D.Provider, { value: _, children: p ? /* @__PURE__ */ t(G, { group: p, notice: m, readOnly: !0 }, p.key) : /* @__PURE__ */ t(
122
+ H,
123
+ {
124
+ target: n,
125
+ row: r,
126
+ notice: m,
127
+ readOnly: !0
128
+ },
129
+ z(n)
130
+ ) }) });
131
+ }
132
+ const P = u ? /* @__PURE__ */ t($, { link: u.link }) : null, T = v ? null : /* @__PURE__ */ t(
133
+ Ge,
118
134
  {
119
135
  bundle: l,
120
136
  parent: c,
121
137
  target: n,
122
- title: P(n),
138
+ title: I(n),
123
139
  apply: i
124
140
  }
125
141
  );
126
- return /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(W.Provider, { value: m, children: n.kind === "group" ? x && /* @__PURE__ */ t(j, { group: x, notice: u }, x.key) : _ ? /* @__PURE__ */ a(k, { children: [
127
- /* @__PURE__ */ t(E, { title: P(n) }),
128
- /* @__PURE__ */ t(F, { children: /* @__PURE__ */ a("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: [
129
- P(n),
142
+ return /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(D.Provider, { value: f, children: n.kind === "group" ? p && /* @__PURE__ */ t(
143
+ G,
144
+ {
145
+ group: p,
146
+ notice: /* @__PURE__ */ d(x, { children: [
147
+ P,
148
+ T
149
+ ] })
150
+ },
151
+ p.key
152
+ ) : v ? /* @__PURE__ */ d(x, { children: [
153
+ /* @__PURE__ */ t(F, { title: I(n) }),
154
+ /* @__PURE__ */ t(C, { children: /* @__PURE__ */ d("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: [
155
+ I(n),
130
156
  " is not on this form any more."
131
157
  ] }) })
132
158
  ] }) : /* @__PURE__ */ t(
133
- U,
159
+ H,
134
160
  {
135
161
  target: n,
136
162
  row: r,
137
- notice: u
163
+ notice: /* @__PURE__ */ d(x, { children: [
164
+ P,
165
+ T
166
+ ] })
138
167
  },
139
- se(n)
168
+ z(n)
140
169
  ) }) });
141
170
  }
142
- function P(e) {
143
- return e.kind === "group" ? h(e.key) : e.field.startsWith("__") ? z(e.field) : h(e.field.split(".").pop() ?? e.field);
171
+ function I(e) {
172
+ return e.kind === "group" ? k(e.key) : e.field.startsWith("__") ? X(e.field) : k(e.field.split(".").pop() ?? e.field);
144
173
  }
145
- function D({ children: e }) {
146
- return /* @__PURE__ */ a("div", { "data-inspector": "", className: "flex h-full min-h-0 min-w-0 flex-col text-[12px]", children: [
147
- /* @__PURE__ */ t(re, {}),
174
+ function R({ children: e }) {
175
+ return /* @__PURE__ */ d("div", { "data-inspector": "", className: "flex h-full min-h-0 min-w-0 flex-col text-[12px]", children: [
176
+ /* @__PURE__ */ t(ce, {}),
148
177
  e
149
178
  ] });
150
179
  }
151
- function We(e, l) {
152
- if (!l || l === le) return null;
153
- if (l === O) return "Header strip";
180
+ function ze(e, l) {
181
+ if (!l || l === de) return null;
182
+ if (l === B) return "Header strip";
154
183
  const n = e.groups.find((i) => i.key === l);
155
- return n ? n.label || h(n.key) : h(l);
184
+ return n ? n.label || k(n.key) : k(l);
156
185
  }
157
- function we(e) {
186
+ function $e(e) {
158
187
  if (e.isPath) return "shows a linked value";
159
188
  if (e.computedType) return "calculated";
160
189
  if (e.relKind === "M2O") return "picks one record";
@@ -162,7 +191,7 @@ function we(e) {
162
191
  if (e.relKind === "O2M")
163
192
  return e.iface === "inline-table" ? "table of related rows" : "related rows";
164
193
  if (e.relKind) return "related records";
165
- if (Ce.has(e.type)) return "number";
194
+ if (De.has(e.type)) return "number";
166
195
  switch (e.type) {
167
196
  case "boolean":
168
197
  return "yes or no";
@@ -185,79 +214,80 @@ function we(e) {
185
214
  return e.type;
186
215
  }
187
216
  }
188
- function B({ words: e, k: l, setting: n }) {
189
- return /* @__PURE__ */ a("span", { "data-setting": n, children: [
190
- e && /* @__PURE__ */ a(k, { children: [
217
+ function Y({ words: e, k: l, setting: n }) {
218
+ return /* @__PURE__ */ d("span", { "data-setting": n, children: [
219
+ e && /* @__PURE__ */ d(x, { children: [
191
220
  e,
192
221
  " · "
193
222
  ] }),
194
223
  /* @__PURE__ */ t("span", { className: "font-mono text-[11px]", children: l })
195
224
  ] });
196
225
  }
197
- function je(e, l) {
226
+ function Ve(e, l) {
198
227
  const n = l.parent_key ? e.groups.find((i) => i.key === l.parent_key) ?? null : null;
199
228
  return l.type === "tab" ? (n == null ? void 0 : n.tab_mode) === "steps" ? "Step" : "Tab" : l.type === "container" ? l.tab_mode === "steps" ? "Steps holder" : "Tabs holder" : l.type === "content" ? "Text block" : l.type === "metadata" ? "Record info" : "Section";
200
229
  }
201
- function j({
230
+ function G({
202
231
  group: e,
203
232
  notice: l,
204
233
  readOnly: n = !1
205
234
  }) {
206
- const i = L(), d = /* @__PURE__ */ t(Ne, { group: e, readOnly: n });
207
- return /* @__PURE__ */ a(k, { children: [
235
+ const i = K(), a = /* @__PURE__ */ t(Ee, { group: e, readOnly: n });
236
+ return /* @__PURE__ */ d(x, { children: [
208
237
  /* @__PURE__ */ t(
209
- E,
238
+ F,
210
239
  {
211
240
  eyebrow: /* @__PURE__ */ t(
212
- I,
241
+ L,
213
242
  {
214
- kind: je(i.bundle, e),
243
+ kind: Ve(i.bundle, e),
215
244
  target: { kind: "group", key: e.key }
216
245
  }
217
246
  ),
218
- title: e.label || h(e.key),
219
- sub: /* @__PURE__ */ t(B, { k: e.key, setting: "group.key" })
247
+ title: e.label || k(e.key),
248
+ sub: /* @__PURE__ */ t(Y, { k: e.key, setting: "group.key" })
220
249
  }
221
250
  ),
222
- /* @__PURE__ */ a(F, { children: [
251
+ /* @__PURE__ */ d(C, { children: [
223
252
  l,
224
253
  n ? (
225
254
  // Inputs sit in a disabled fieldset and writes go nowhere.
226
- /* @__PURE__ */ t("div", { "data-inherited-view": "", className: "opacity-70", children: d })
227
- ) : /* @__PURE__ */ a(k, { children: [
228
- /* @__PURE__ */ t(H, {}),
229
- /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: [
230
- /* @__PURE__ */ t(oe, { targets: [{ kind: "group", key: e.key }] }),
231
- ue.has(e.type) && i.layoutType !== "table" && i.layoutType !== "file" && /* @__PURE__ */ t(
232
- ae,
255
+ /* @__PURE__ */ t("div", { "data-inherited-view": "", className: "opacity-70", children: a })
256
+ ) : /* @__PURE__ */ d(w, { children: [
257
+ /* @__PURE__ */ t(j, {}),
258
+ /* @__PURE__ */ d("div", { className: "flex flex-wrap gap-2", children: [
259
+ /* @__PURE__ */ t(ue, { targets: [{ kind: "group", key: e.key }] }),
260
+ /* @__PURE__ */ t(J, { target: { kind: "group", key: e.key }, bundle: i.bundle }),
261
+ be.has(e.type) && i.layoutType !== "table" && i.layoutType !== "file" && /* @__PURE__ */ t(
262
+ me,
233
263
  {
234
264
  bundle: i.bundle,
235
265
  apply: i.apply,
236
266
  zone: e.key,
237
- zoneLabel: e.label || h(e.key)
267
+ zoneLabel: e.label || k(e.key)
238
268
  }
239
269
  )
240
270
  ] }),
241
- d,
242
- /* @__PURE__ */ a(
271
+ a,
272
+ /* @__PURE__ */ d(
243
273
  "div",
244
274
  {
245
275
  "data-group-help": "",
246
276
  className: "mt-5 space-y-5 border-t border-slate-100 pt-5 dark:border-border/60",
247
277
  children: [
248
278
  /* @__PURE__ */ t(
249
- $,
279
+ Z,
250
280
  {
251
281
  kind: "section",
252
282
  name: e.key,
253
- label: e.label || h(e.key)
283
+ label: e.label || k(e.key)
254
284
  }
255
285
  ),
256
286
  /* @__PURE__ */ t(
257
- V,
287
+ Q,
258
288
  {
259
289
  target: { kind: "group", key: e.key },
260
- name: e.label || h(e.key)
290
+ name: e.label || k(e.key)
261
291
  }
262
292
  )
263
293
  ]
@@ -267,161 +297,162 @@ function j({
267
297
  ] })
268
298
  ] });
269
299
  }
270
- function S({
300
+ function E({
271
301
  eyebrow: e,
272
302
  title: l,
273
303
  sub: n,
274
304
  notice: i,
275
- readOnly: d,
305
+ readOnly: a,
276
306
  children: o
277
307
  }) {
278
- return /* @__PURE__ */ a(k, { children: [
279
- /* @__PURE__ */ t(E, { eyebrow: e, title: l, sub: n }),
280
- /* @__PURE__ */ a(F, { children: [
308
+ return /* @__PURE__ */ d(x, { children: [
309
+ /* @__PURE__ */ t(F, { eyebrow: e, title: l, sub: n }),
310
+ /* @__PURE__ */ d(C, { children: [
281
311
  i,
282
- d ? /* @__PURE__ */ t("div", { "data-inherited-view": "", className: "opacity-70", children: /* @__PURE__ */ t("fieldset", { disabled: !0, className: "min-w-0", children: o }) }) : /* @__PURE__ */ a(k, { children: [
283
- /* @__PURE__ */ t(H, {}),
312
+ a ? /* @__PURE__ */ t("div", { "data-inherited-view": "", className: "opacity-70", children: /* @__PURE__ */ t("fieldset", { disabled: !0, className: "min-w-0", children: o }) }) : /* @__PURE__ */ d(w, { children: [
313
+ /* @__PURE__ */ t(j, {}),
284
314
  o
285
315
  ] })
286
316
  ] })
287
317
  ] });
288
318
  }
289
- function U({
319
+ function H({
290
320
  target: e,
291
321
  row: l,
292
322
  notice: n,
293
323
  readOnly: i = !1
294
324
  }) {
295
325
  var r;
296
- const d = L(), o = e.kind === "group" ? "" : e.field, m = (l == null ? void 0 : l.group_key) ?? (e.kind === "group" ? null : ((r = X(e)) == null ? void 0 : r.group_key) ?? null), s = We(d.bundle, m);
297
- return o === A ? /* @__PURE__ */ t(S, { eyebrow: "Header", title: "Subtitle", notice: n, readOnly: i, children: /* @__PURE__ */ t(Oe, {}) }) : l && (Ae.test(o) || l.widget_id != null) ? /* @__PURE__ */ t(
298
- S,
326
+ const a = K(), o = e.kind === "group" ? "" : e.field, f = (l == null ? void 0 : l.group_key) ?? (e.kind === "group" ? null : ((r = le(e)) == null ? void 0 : r.group_key) ?? null), s = ze(a.bundle, f);
327
+ return o === U ? /* @__PURE__ */ t(E, { eyebrow: "Header", title: "Subtitle", notice: n, readOnly: i, children: /* @__PURE__ */ t(We, {}) }) : l && (Ue.test(o) || l.widget_id != null) ? /* @__PURE__ */ t(
328
+ E,
299
329
  {
300
- eyebrow: /* @__PURE__ */ t(I, { kind: "Widget", target: e, where: s }),
330
+ eyebrow: /* @__PURE__ */ t(L, { kind: "Widget", target: e, where: s }),
301
331
  title: l.label_override || "Widget",
302
332
  notice: n,
303
333
  readOnly: i,
304
- children: /* @__PURE__ */ t(He, { row: l })
334
+ children: /* @__PURE__ */ t(je, { row: l })
305
335
  }
306
- ) : J(o) ? /* @__PURE__ */ t(
307
- S,
336
+ ) : te(o) ? /* @__PURE__ */ t(
337
+ E,
308
338
  {
309
- eyebrow: /* @__PURE__ */ t(I, { kind: "Panel", target: e, where: s }),
310
- title: z(o),
339
+ eyebrow: /* @__PURE__ */ t(L, { kind: "Panel", target: e, where: s }),
340
+ title: X(o),
311
341
  notice: n,
312
342
  readOnly: i,
313
- children: /* @__PURE__ */ t(Ge, { field: o, groupKey: m, row: l })
343
+ children: /* @__PURE__ */ t(Be, { field: o, groupKey: f, row: l })
314
344
  }
315
- ) : l ? e.kind === "header" || l.group_key === O ? /* @__PURE__ */ t(ze, { row: l, notice: n, readOnly: i }) : ne(o) ? /* @__PURE__ */ t(
316
- S,
345
+ ) : l ? e.kind === "header" || l.group_key === B ? /* @__PURE__ */ t(Xe, { row: l, notice: n, readOnly: i }) : ae(o) ? /* @__PURE__ */ t(
346
+ E,
317
347
  {
318
- eyebrow: /* @__PURE__ */ t(I, { kind: "Formula", target: e, where: s }),
319
- title: Ue(l),
348
+ eyebrow: /* @__PURE__ */ t(L, { kind: "Formula", target: e, where: s }),
349
+ title: qe(l),
320
350
  notice: n,
321
351
  readOnly: i,
322
- children: /* @__PURE__ */ t(Ye, { row: l })
352
+ children: /* @__PURE__ */ t(Je, { row: l })
323
353
  }
324
- ) : /* @__PURE__ */ t(Ve, { target: e, row: l, where: s, notice: n, readOnly: i }) : null;
354
+ ) : /* @__PURE__ */ t(Qe, { target: e, row: l, where: s, notice: n, readOnly: i }) : null;
325
355
  }
326
- function Ue(e) {
327
- const l = G(e.overrides);
356
+ function qe(e) {
357
+ const l = A(e.overrides);
328
358
  return typeof l.label == "string" && l.label.trim() ? l.label : "Formula";
329
359
  }
330
- function Ye({ row: e }) {
331
- const l = L(), { data: n } = R(l.collection), i = Y(() => ((n == null ? void 0 : n.fields) ?? []).map((d) => d.field), [n == null ? void 0 : n.fields]);
332
- return /* @__PURE__ */ t(ke, { row: e, fields: i });
360
+ function Je({ row: e }) {
361
+ const l = K(), { data: n } = W(l.collection), i = q(() => ((n == null ? void 0 : n.fields) ?? []).map((a) => a.field), [n == null ? void 0 : n.fields]);
362
+ return /* @__PURE__ */ t(Ne, { row: e, fields: i });
333
363
  }
334
- function ze({
364
+ function Xe({
335
365
  row: e,
336
366
  notice: l,
337
367
  readOnly: n
338
368
  }) {
339
- const i = L(), { data: d } = R(i.collection), o = q(e.field, (d == null ? void 0 : d.fields) ?? [], (d == null ? void 0 : d.relations) ?? [], null).label;
369
+ const i = K(), { data: a } = W(i.collection), o = ee(e.field, (a == null ? void 0 : a.fields) ?? [], (a == null ? void 0 : a.relations) ?? [], null).label;
340
370
  return /* @__PURE__ */ t(
341
- S,
371
+ E,
342
372
  {
343
373
  eyebrow: "Header strip",
344
374
  title: e.label_override || o,
345
- sub: /* @__PURE__ */ t(B, { k: e.field }),
375
+ sub: /* @__PURE__ */ t(Y, { k: e.field }),
346
376
  notice: l,
347
377
  readOnly: n,
348
- children: /* @__PURE__ */ t(Te, { row: e, label: o })
378
+ children: /* @__PURE__ */ t(Le, { row: e, label: o })
349
379
  }
350
380
  );
351
381
  }
352
- const $e = { fields: [], relations: [], label: "" };
353
- function Ve({
382
+ const Ze = { fields: [], relations: [], label: "" };
383
+ function Qe({
354
384
  target: e,
355
385
  row: l,
356
386
  where: n,
357
387
  notice: i,
358
- readOnly: d
388
+ readOnly: a
359
389
  }) {
360
- var K, M, v, y;
361
- const o = L(), { data: m } = R(o.collection), s = m ?? $e, r = q(l.field, s.fields, s.relations, l), x = xe({
390
+ var T, m, _, O;
391
+ const o = K(), { data: f } = W(o.collection), s = f ?? Ze, r = ee(l.field, s.fields, s.relations, l), p = Pe({
362
392
  collection: o.collection,
363
- collectionLabel: s.label || h(o.collection),
393
+ collectionLabel: s.label || k(o.collection),
364
394
  field: l.field,
365
395
  fieldLabel: r.label,
366
396
  stored: {
367
- options: G((K = r.global) == null ? void 0 : K.options),
368
- dependency_config: G((M = r.global) == null ? void 0 : M.dependency_config),
397
+ options: A((T = r.global) == null ? void 0 : T.options),
398
+ dependency_config: A((m = r.global) == null ? void 0 : m.dependency_config),
369
399
  columns: {
370
- deprecated: !!((v = r.global) != null && v.deprecated_at),
371
- deprecation_note: ((y = r.global) == null ? void 0 : y.deprecation_note) || null
400
+ deprecated: !!((_ = r.global) != null && _.deprecated_at),
401
+ deprecation_note: ((O = r.global) == null ? void 0 : O.deprecation_note) || null
372
402
  }
373
403
  }
374
- }), _ = _e({ env: o, row: l, meta: s, writer: x, readOnly: d }), g = r.relKind === "M2O" || r.relKind === "M2M" || r.isPath || r.iface === "relation-path" || r.iface === "file-image" || r.iface === "files-m2m", C = r.relKind === "O2M" && (r.iface === "inline-grid" || r.iface === "inline-table"), c = [
404
+ }), v = Te({ env: o, row: l, meta: s, writer: p, readOnly: a }), g = r.relKind === "M2O" || r.relKind === "M2M" || r.isPath || r.iface === "relation-path" || r.iface === "file-image" || r.iface === "files-m2m", M = r.relKind === "O2M" && (r.iface === "inline-grid" || r.iface === "inline-table"), c = [
375
405
  { key: "look", label: "Look" },
376
406
  { key: "rules", label: "Rules" },
377
407
  ...g ? [{ key: "picker", label: "Picker" }] : [],
378
- ...C ? [{ key: "grid", label: r.iface === "inline-table" ? "Table" : "Grid" }] : [],
408
+ ...M ? [{ key: "grid", label: r.iface === "inline-table" ? "Table" : "Grid" }] : [],
379
409
  { key: "help", label: "Help" },
380
410
  { key: "advanced", label: "Advanced" }
381
- ], [f, p] = Z("look");
382
- Re(l.field, (T) => p(T));
383
- const N = ee(), u = c.some((T) => T.key === f) ? f : "look", b = /* @__PURE__ */ t("fieldset", { disabled: d, className: "min-w-0", children: m ? u === "look" ? /* @__PURE__ */ t(Se, {}) : u === "rules" ? /* @__PURE__ */ t(De, {}) : u === "picker" ? /* @__PURE__ */ t(Me, {}) : u === "grid" ? /* @__PURE__ */ t(ge, {}) : u === "help" ? /* @__PURE__ */ a("div", { "data-help-tab": "", className: "space-y-5", children: [
411
+ ], [b, h] = ie("look");
412
+ we(l.field, (y) => h(y));
413
+ const N = re(), u = c.some((y) => y.key === b) ? b : "look", P = /* @__PURE__ */ t("fieldset", { disabled: a, className: "min-w-0", children: f ? u === "look" ? /* @__PURE__ */ t(Ce, {}) : u === "rules" ? /* @__PURE__ */ t(Ae, {}) : u === "picker" ? /* @__PURE__ */ t(He, {}) : u === "grid" ? /* @__PURE__ */ t(Ie, {}) : u === "help" ? /* @__PURE__ */ d("div", { "data-help-tab": "", className: "space-y-5", children: [
384
414
  /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "Help text and the placeholder are on the Look tab." }),
385
- /* @__PURE__ */ t($, { kind: "field", name: l.field, label: r.label }),
415
+ /* @__PURE__ */ t(Z, { kind: "field", name: l.field, label: r.label }),
386
416
  /* @__PURE__ */ t(
387
- V,
417
+ Q,
388
418
  {
389
419
  target: { kind: "field", field: l.field, group_key: l.group_key },
390
420
  name: r.label
391
421
  }
392
422
  )
393
- ] }) : /* @__PURE__ */ t(ye, {}) : /* @__PURE__ */ t("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: "Loading the field…" }) });
394
- return /* @__PURE__ */ t(ve.Provider, { value: _, children: /* @__PURE__ */ a(Pe.Provider, { value: x, children: [
423
+ ] }) : /* @__PURE__ */ t(ge, {}) : /* @__PURE__ */ t("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: "Loading the field…" }) });
424
+ return /* @__PURE__ */ t(Se.Provider, { value: v, children: /* @__PURE__ */ d(Fe.Provider, { value: p, children: [
395
425
  /* @__PURE__ */ t(
396
- E,
426
+ F,
397
427
  {
398
- eyebrow: /* @__PURE__ */ t(I, { kind: "Field", target: e, where: n }),
428
+ eyebrow: /* @__PURE__ */ t(L, { kind: "Field", target: e, where: n }),
399
429
  title: r.label,
400
- sub: /* @__PURE__ */ t(B, { words: m ? we(r) : void 0, k: l.field }),
430
+ sub: /* @__PURE__ */ t(Y, { words: f ? $e(r) : void 0, k: l.field }),
401
431
  children: /* @__PURE__ */ t(
402
- me,
432
+ he,
403
433
  {
404
434
  idBase: N,
405
435
  label: `Settings of ${r.label}`,
406
436
  tabs: c,
407
437
  active: u,
408
- onChange: (T) => {
409
- o.flush(), p(T);
438
+ onChange: (y) => {
439
+ o.flush(), h(y);
410
440
  }
411
441
  }
412
442
  )
413
443
  }
414
444
  ),
415
- /* @__PURE__ */ a(
416
- F,
445
+ /* @__PURE__ */ d(
446
+ C,
417
447
  {
418
- tabpanel: { id: pe(N), labelledBy: fe(N, u) },
448
+ tabpanel: { id: ke(N), labelledBy: ye(N, u) },
419
449
  children: [
420
450
  i,
421
- d ? /* @__PURE__ */ t("div", { "data-inherited-view": "", className: "opacity-70", children: b }) : /* @__PURE__ */ a(k, { children: [
422
- /* @__PURE__ */ t(ce, { bundle: o.bundle, rows: [l], apply: o.apply }),
423
- /* @__PURE__ */ t(H, { field: !0 }),
424
- b
451
+ a ? /* @__PURE__ */ t("div", { "data-inherited-view": "", className: "opacity-70", children: P }) : /* @__PURE__ */ d(w, { children: [
452
+ /* @__PURE__ */ t("div", { className: "mb-3 empty:hidden", children: /* @__PURE__ */ t(J, { target: e, bundle: o.bundle }) }),
453
+ /* @__PURE__ */ t(pe, { bundle: o.bundle, rows: [l], apply: o.apply }),
454
+ /* @__PURE__ */ t(j, { field: !0 }),
455
+ P
425
456
  ] })
426
457
  ]
427
458
  },
@@ -430,5 +461,5 @@ function Ve({
430
461
  ] }) });
431
462
  }
432
463
  export {
433
- Ft as Inspector
464
+ Dt as Inspector
434
465
  };