@nivaro/react 0.3.35 → 0.3.37

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 (106) 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 +13 -4
  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 -572
  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 +11 -10
  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 +80 -63
  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 +146 -131
  25. package/dist/shared/components/layout-editor/EditorCanvas.js +25 -17
  26. package/dist/shared/components/layout-editor/EditorTopBar.js +268 -206
  27. package/dist/shared/components/layout-editor/LayoutEditor.js +810 -731
  28. package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
  29. package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
  30. package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
  31. package/dist/shared/components/layout-editor/add-target.js +54 -43
  32. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
  33. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
  34. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
  35. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +379 -185
  36. package/dist/shared/components/layout-editor/dnd/TrashZone.js +96 -0
  37. package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
  38. package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
  39. package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
  40. package/dist/shared/components/layout-editor/dnd/node.js +115 -105
  41. package/dist/shared/components/layout-editor/dnd/rail-drop.js +4 -4
  42. package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
  43. package/dist/shared/components/layout-editor/dnd/trash-drop.js +58 -0
  44. package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
  45. package/dist/shared/components/layout-editor/even-row.js +86 -0
  46. package/dist/shared/components/layout-editor/field-list.js +99 -0
  47. package/dist/shared/components/layout-editor/format-painter.js +102 -0
  48. package/dist/shared/components/layout-editor/grid-guides.js +15 -13
  49. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
  50. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
  51. package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
  52. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
  53. package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
  54. package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
  55. package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
  56. package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
  57. package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
  58. package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
  59. package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
  60. package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
  61. package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
  62. package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
  63. package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
  64. package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
  65. package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
  66. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
  67. package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
  68. package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
  69. package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
  70. package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
  71. package/dist/shared/components/layout-editor/panel-frame.js +1 -1
  72. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  73. package/dist/shared/components/layout-editor/personal-default-marks.js +40 -0
  74. package/dist/shared/components/layout-editor/pin.js +37 -19
  75. package/dist/shared/components/layout-editor/place-clip.js +257 -0
  76. package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
  77. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +149 -118
  78. package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
  79. package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
  80. package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
  81. package/dist/shared/components/layout-editor/removed-log.js +151 -0
  82. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
  83. package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
  84. package/dist/shared/components/layout-editor/revert-element.js +140 -0
  85. package/dist/shared/components/layout-editor/section-structure.js +193 -170
  86. package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
  87. package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
  88. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
  89. package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
  90. package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
  91. package/dist/shared/components/layout-editor/shortcuts.js +21 -16
  92. package/dist/shared/components/layout-editor/structure-ops.js +221 -195
  93. package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
  94. package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
  95. package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
  96. package/dist/shared/components/panels/CommentPanel.js +47 -45
  97. package/dist/shared/components/panels/RevisionsPanel.js +66 -64
  98. package/dist/shared/components/panels/TaskPanel.js +395 -332
  99. package/dist/shared/components/profile/AgentsPanel.js +196 -147
  100. package/dist/shared/components/profile/ConnectionRollback.js +329 -0
  101. package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
  102. package/dist/shared/lib/entry-config.js +22 -22
  103. package/dist/shared/lib/form-usage-beacon.js +91 -55
  104. package/dist/shared/lib/layout-lint.js +530 -284
  105. package/dist/shared/lib/layout-resolve.js +58 -44
  106. package/package.json +1 -1
@@ -1,43 +1,45 @@
1
1
  import { jsxs as d, jsx as t, Fragment as J } from "react/jsx-runtime";
2
2
  import { useQuery as R } from "@tanstack/react-query";
3
- import { Globe2 as j, ChevronRight as _, ChevronDown as $, Check as G, X as U } from "lucide-react";
4
- import { useContext as h, createContext as P, useState as g, useRef as I, useEffect as E } from "react";
5
- import { useNivaroClient as K } from "../../../context.js";
6
- import { get as M } from "../../../lib/commands.js";
7
- import { cn as m } from "../../../lib/utils.js";
8
- import { Command as V, CommandInput as Q, CommandList as W, CommandEmpty as X, CommandGroup as Y, CommandItem as z } from "../../ui/command.js";
9
- import { Popover as H, PopoverTrigger as Z, PopoverContent as ee } from "../../ui/popover.js";
10
- import { SimpleSelect as te } from "../../ui/SimpleSelect.js";
11
- import { Switch as ne } from "../../ui/switch.js";
12
- import { useFocusBuffer as x } from "../focus-buffer.js";
13
- import { labelText as ae, effectText as q, segOption as re, segTrack as le, inputBase as v, groupTitle as L } from "../panel-style.js";
14
- const N = P(null);
15
- function se() {
16
- const e = h(N);
3
+ import { Globe2 as $, Star as U, ChevronRight as _, ChevronDown as G, Check as K, X as M } from "lucide-react";
4
+ import { useContext as b, useEffect as P, createContext as E, useState as v, useCallback as V, useMemo as Z, useRef as F } from "react";
5
+ import { createPortal as Q } from "react-dom";
6
+ import { useNivaroClient as W } from "../../../context.js";
7
+ import { get as X } from "../../../lib/commands.js";
8
+ import { cn as p } from "../../../lib/utils.js";
9
+ import { Command as Y, CommandInput as H, CommandList as z, CommandEmpty as ee, CommandGroup as te, CommandItem as ne } from "../../ui/command.js";
10
+ import { Popover as re, PopoverTrigger as ae, PopoverContent as se } from "../../ui/popover.js";
11
+ import { SimpleSelect as oe } from "../../ui/SimpleSelect.js";
12
+ import { Switch as le } from "../../ui/switch.js";
13
+ import { useFocusBuffer as k } from "../focus-buffer.js";
14
+ import { usePinnedSettings as ie, togglePinnedSetting as ce } from "../nav/view-prefs.js";
15
+ import { labelText as de, effectText as q, segOption as ue, segTrack as me, inputBase as C, groupTitle as T } from "../panel-style.js";
16
+ const w = E(null);
17
+ function pe() {
18
+ const e = b(w);
17
19
  if (!e) throw new Error("Inspector parts render inside <Inspector>");
18
20
  return e;
19
21
  }
20
- const C = P(null);
21
- function Oe(e, o) {
22
+ const I = E(null);
23
+ function qe(e, o) {
22
24
  var n;
23
- const i = h(C), l = (n = i == null ? void 0 : i.pending) == null ? void 0 : n.values;
24
- return l && e in l ? l[e] : o;
25
+ const l = b(I), r = (n = l == null ? void 0 : l.pending) == null ? void 0 : n.values;
26
+ return r && e in r ? r[e] : o;
25
27
  }
26
- function oe() {
27
- const e = h(C), o = K(), i = e == null ? void 0 : e.pending, { data: l, isLoading: n } = R({
28
+ function fe() {
29
+ const e = b(I), o = W(), l = e == null ? void 0 : e.pending, { data: r, isLoading: n } = R({
28
30
  queryKey: ["layout-editor", "field-impact", e == null ? void 0 : e.collection, e == null ? void 0 : e.field],
29
31
  queryFn: () => o.request(
30
- M(`/data-model/${e == null ? void 0 : e.collection}/fields/${encodeURIComponent((e == null ? void 0 : e.field) ?? "")}/impact`)
31
- ).then((s) => s.data ?? []),
32
- enabled: !!i && !!e,
32
+ X(`/data-model/${e == null ? void 0 : e.collection}/fields/${encodeURIComponent((e == null ? void 0 : e.field) ?? "")}/impact`)
33
+ ).then((i) => i.data ?? []),
34
+ enabled: !!l && !!e,
33
35
  staleTime: 6e4
34
36
  });
35
- if (!e || !i) return null;
37
+ if (!e || !l) return null;
36
38
  const a = [
37
- ...new Set((l ?? []).filter((s) => s.source === "layout").map((s) => s.label))
39
+ ...new Set((r ?? []).filter((i) => i.source === "layout").map((i) => i.label))
38
40
  ], c = [
39
- ...new Set((l ?? []).filter((s) => s.source !== "layout").map((s) => s.label))
40
- ], r = a.slice(0, 8);
41
+ ...new Set((r ?? []).filter((i) => i.source !== "layout").map((i) => i.label))
42
+ ], s = a.slice(0, 8);
41
43
  return /* @__PURE__ */ d(
42
44
  "div",
43
45
  {
@@ -50,18 +52,18 @@ function oe() {
50
52
  e.fieldLabel,
51
53
  " on every form that shows it, not just this one."
52
54
  ] }),
53
- i.labels.length > 1 && /* @__PURE__ */ t("ul", { "data-global-changes": "", className: "list-disc space-y-0.5 pl-4 text-[11px]", children: i.labels.map((s) => /* @__PURE__ */ t("li", { children: s }, s)) }),
55
+ l.labels.length > 1 && /* @__PURE__ */ t("ul", { "data-global-changes": "", className: "list-disc space-y-0.5 pl-4 text-[11px]", children: l.labels.map((i) => /* @__PURE__ */ t("li", { children: i }, i)) }),
54
56
  n ? /* @__PURE__ */ d("p", { className: "text-[11px] opacity-80", children: [
55
57
  "Finding where ",
56
58
  e.fieldLabel,
57
59
  " is used…"
58
60
  ] }) : /* @__PURE__ */ d("div", { className: "space-y-1 text-[11px]", children: [
59
- r.length > 0 && /* @__PURE__ */ d("p", { children: [
61
+ s.length > 0 && /* @__PURE__ */ d("p", { children: [
60
62
  "Forms of ",
61
63
  e.collectionLabel,
62
64
  ": ",
63
- r.join(", "),
64
- a.length > r.length && ` and ${a.length - r.length} more`
65
+ s.join(", "),
66
+ a.length > s.length && ` and ${a.length - s.length} more`
65
67
  ] }),
66
68
  /* @__PURE__ */ d("p", { children: [
67
69
  "Also the ",
@@ -103,7 +105,7 @@ function oe() {
103
105
  }
104
106
  );
105
107
  }
106
- function ie({ scope: e }) {
108
+ function he({ scope: e }) {
107
109
  return e === "field" ? /* @__PURE__ */ d(
108
110
  "span",
109
111
  {
@@ -111,89 +113,143 @@ function ie({ scope: e }) {
111
113
  "data-tip": "Saved on the field itself: every form that shows this field changes",
112
114
  className: "inline-flex shrink-0 items-center gap-1 text-[11px] font-medium text-amber-700 dark:text-amber-300",
113
115
  children: [
114
- /* @__PURE__ */ t(j, { className: "h-3 w-3" }),
116
+ /* @__PURE__ */ t($, { className: "h-3 w-3" }),
115
117
  "Every form"
116
118
  ]
117
119
  }
118
120
  ) : /* @__PURE__ */ t("span", { "data-scope": "form", className: "sr-only", children: "This form only" });
119
121
  }
120
- function Te({ field: e }) {
122
+ function Ae({ field: e }) {
121
123
  return /* @__PURE__ */ t("p", { "data-scope-legend": "", className: q, children: e ? /* @__PURE__ */ d(J, { children: [
122
124
  "Changes here apply to this form only, except settings marked",
123
125
  " ",
124
126
  /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-1 whitespace-nowrap font-medium text-amber-700 dark:text-amber-300", children: [
125
- /* @__PURE__ */ t(j, { className: "h-3 w-3" }),
127
+ /* @__PURE__ */ t($, { className: "h-3 w-3" }),
126
128
  "Every form"
127
129
  ] }),
128
130
  "."
129
131
  ] }) : "Changes here apply to this form only." });
130
132
  }
131
- const ce = "Enforced on the default form only";
132
- function de({ className: e }) {
133
- return se().defaultForm ? null : /* @__PURE__ */ t(
133
+ const be = "Enforced on the default form only";
134
+ function ge({ className: e }) {
135
+ return pe().defaultForm ? null : /* @__PURE__ */ t(
134
136
  "p",
135
137
  {
136
138
  "data-setting": "inspector.enforcement_note",
137
139
  "data-enforcement": "",
138
- className: m("text-[12px] leading-snug text-amber-700 dark:text-amber-300", e),
140
+ className: p("text-[12px] leading-snug text-amber-700 dark:text-amber-300", e),
139
141
  "data-tip": "The server applies this from the active grouped layout. On this form it only works in the browser.",
140
- children: ce
142
+ children: be
141
143
  }
142
144
  );
143
145
  }
144
- function ue({
146
+ function xe({
145
147
  k: e,
146
148
  label: o,
147
- effect: i,
148
- scope: l = "form",
149
+ effect: l,
150
+ scope: r = "form",
149
151
  enforced: n,
150
152
  inline: a,
151
153
  confirmAt: c,
152
- children: r,
153
- className: s
154
+ children: s,
155
+ className: i
154
156
  }) {
155
- var p;
156
- const u = h(C);
157
- return /* @__PURE__ */ d("div", { "data-setting": e, "data-setting-row": "", className: m("space-y-1.5", s), children: [
158
- /* @__PURE__ */ d("div", { className: "flex min-h-5 items-center justify-between gap-3", children: [
159
- /* @__PURE__ */ d("span", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5", children: [
160
- /* @__PURE__ */ t("span", { className: ae, children: o }),
161
- /* @__PURE__ */ t(ie, { scope: l })
162
- ] }),
163
- a && /* @__PURE__ */ t("span", { className: "flex shrink-0 items-center", children: r })
164
- ] }),
165
- !a && r,
166
- /* @__PURE__ */ t("p", { "data-effect": "", className: q, children: i }),
167
- n && /* @__PURE__ */ t(de, {}),
168
- l === "field" && ((p = u == null ? void 0 : u.pending) == null ? void 0 : p.key) === (c ?? e) && /* @__PURE__ */ t(oe, {})
157
+ var y;
158
+ const u = b(I), m = b(A), g = ie(), N = m ? g.indexOf(e) : -1, h = N >= 0, x = m == null ? void 0 : m.register;
159
+ P(() => h && x ? x() : void 0, [h, x]);
160
+ const f = /* @__PURE__ */ d(
161
+ "div",
162
+ {
163
+ "data-setting": e,
164
+ "data-setting-row": "",
165
+ "data-setting-pinned": h ? "" : void 0,
166
+ style: h ? { order: N } : void 0,
167
+ className: p("group/setting relative space-y-1.5", i),
168
+ children: [
169
+ /* @__PURE__ */ d("div", { className: "flex min-h-5 items-center justify-between gap-3", children: [
170
+ /* @__PURE__ */ d("span", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5", children: [
171
+ /* @__PURE__ */ t("span", { className: de, children: o }),
172
+ /* @__PURE__ */ t(he, { scope: r })
173
+ ] }),
174
+ a && /* @__PURE__ */ t("span", { className: "flex shrink-0 items-center", children: s })
175
+ ] }),
176
+ !a && s,
177
+ /* @__PURE__ */ t("p", { "data-effect": "", className: q, children: l }),
178
+ n && /* @__PURE__ */ t(ge, {}),
179
+ r === "field" && ((y = u == null ? void 0 : u.pending) == null ? void 0 : y.key) === (c ?? e) && /* @__PURE__ */ t(fe, {}),
180
+ m && /* @__PURE__ */ t(ve, { k: e, label: o, pinned: h })
181
+ ]
182
+ }
183
+ );
184
+ return h && (m != null && m.el) ? Q(f, m.el) : f;
185
+ }
186
+ const A = E(null);
187
+ function ve({ k: e, label: o, pinned: l }) {
188
+ const r = typeof o == "string" ? o : "this setting";
189
+ return /* @__PURE__ */ t(
190
+ "button",
191
+ {
192
+ type: "button",
193
+ "data-setting-pin": e,
194
+ "aria-pressed": l,
195
+ "aria-label": l ? `Unpin ${r}` : `Pin ${r} to the top of this tab`,
196
+ "data-tip": l ? "Unpin" : "Pin to the top of this tab",
197
+ onClick: () => ce(e),
198
+ className: p(
199
+ "absolute -left-[15px] top-0 inline-flex h-5 w-3.5 items-center justify-center rounded-sm text-slate-400 transition-colors hover:text-amber-500 focus-visible:visible focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-muted-foreground dark:hover:text-amber-300",
200
+ l ? "visible text-amber-500 dark:text-amber-300" : "invisible group-hover/setting:visible"
201
+ ),
202
+ children: /* @__PURE__ */ t(U, { className: p("h-3 w-3", l && "fill-current") })
203
+ }
204
+ );
205
+ }
206
+ function Be({ children: e }) {
207
+ const [o, l] = v(null), [r, n] = v(0), a = V(() => (n((s) => s + 1), () => n((s) => s - 1)), []), c = Z(() => ({ el: o, register: a }), [o, a]);
208
+ return /* @__PURE__ */ d(A.Provider, { value: c, children: [
209
+ /* @__PURE__ */ d(
210
+ "div",
211
+ {
212
+ "data-pinned-settings": r,
213
+ hidden: r === 0,
214
+ className: "space-y-3 border-b border-slate-100 pb-5 dark:border-border/60",
215
+ children: [
216
+ /* @__PURE__ */ d("h3", { className: p(T, "flex items-center gap-1.5"), children: [
217
+ /* @__PURE__ */ t(U, { className: "h-3 w-3 fill-current text-amber-500 dark:text-amber-300" }),
218
+ "Pinned"
219
+ ] }),
220
+ /* @__PURE__ */ t("div", { ref: l, className: "flex flex-col gap-5" })
221
+ ]
222
+ }
223
+ ),
224
+ e
169
225
  ] });
170
226
  }
171
- function Ie({
227
+ function De({
172
228
  k: e,
173
229
  label: o,
174
- effect: i,
175
- scope: l,
230
+ effect: l,
231
+ scope: r,
176
232
  enforced: n,
177
233
  checked: a,
178
234
  onChange: c,
179
- disabled: r,
180
- confirmAt: s
235
+ disabled: s,
236
+ confirmAt: i
181
237
  }) {
182
238
  return /* @__PURE__ */ t(
183
- ue,
239
+ xe,
184
240
  {
185
241
  k: e,
186
242
  label: o,
187
- effect: i,
188
- scope: l,
243
+ effect: l,
244
+ scope: r,
189
245
  enforced: n,
190
- confirmAt: s,
246
+ confirmAt: i,
191
247
  inline: !0,
192
248
  children: /* @__PURE__ */ t(
193
- ne,
249
+ le,
194
250
  {
195
251
  checked: a,
196
- disabled: r,
252
+ disabled: s,
197
253
  onCheckedChange: c,
198
254
  "aria-label": typeof o == "string" ? o : void 0,
199
255
  className: "h-[18px] w-8 border-0 data-[state=checked]:bg-nvr-cyan data-[state=unchecked]:bg-slate-300 dark:data-[state=unchecked]:bg-slate-600 [&>span]:mx-0.5 [&>span]:h-3.5 [&>span]:w-3.5 [&>span]:bg-white [&>span]:shadow-sm [&>span]:data-[state=checked]:translate-x-3.5"
@@ -202,186 +258,186 @@ function Ie({
202
258
  }
203
259
  );
204
260
  }
205
- const A = v;
206
- function me({
261
+ const B = C;
262
+ function Ne({
207
263
  value: e,
208
264
  onChange: o,
209
- placeholder: i,
210
- mono: l,
265
+ placeholder: l,
266
+ mono: r,
211
267
  disabled: n,
212
268
  type: a = "text",
213
269
  ariaLabel: c
214
270
  }) {
215
- const r = h(N), s = x(e, () => r == null ? void 0 : r.flush());
271
+ const s = b(w), i = k(e, () => s == null ? void 0 : s.flush());
216
272
  return /* @__PURE__ */ t(
217
273
  "input",
218
274
  {
219
275
  type: a,
220
- value: s.value,
276
+ value: i.value,
221
277
  disabled: n,
222
278
  "aria-label": c,
223
- placeholder: i,
279
+ placeholder: l,
224
280
  onChange: (u) => {
225
- s.set(u.target.value), o(u.target.value);
281
+ i.set(u.target.value), o(u.target.value);
226
282
  },
227
283
  onKeyDown: (u) => {
228
- u.key === "Enter" && (r == null || r.flush());
284
+ u.key === "Enter" && (s == null || s.flush());
229
285
  },
230
- ...s.props,
231
- className: m(A, l && "font-mono")
286
+ ...i.props,
287
+ className: p(B, r && "font-mono")
232
288
  }
233
289
  );
234
290
  }
235
- function Ee({
291
+ function Je({
236
292
  value: e,
237
293
  onChange: o,
238
- ariaLabel: i,
239
- rows: l = 4,
294
+ ariaLabel: l,
295
+ rows: r = 4,
240
296
  mono: n
241
297
  }) {
242
- const a = h(N), c = x(e, () => a == null ? void 0 : a.flush());
298
+ const a = b(w), c = k(e, () => a == null ? void 0 : a.flush());
243
299
  return /* @__PURE__ */ t(
244
300
  "textarea",
245
301
  {
246
- "aria-label": i,
247
- rows: l,
302
+ "aria-label": l,
303
+ rows: r,
248
304
  value: c.value,
249
- onChange: (r) => {
250
- c.set(r.target.value), o(r.target.value);
305
+ onChange: (s) => {
306
+ c.set(s.target.value), o(s.target.value);
251
307
  },
252
308
  ...c.props,
253
- className: m(v, "h-auto py-1.5 leading-snug", n && "font-mono text-[12px]")
309
+ className: p(C, "h-auto py-1.5 leading-snug", n && "font-mono text-[12px]")
254
310
  }
255
311
  );
256
312
  }
257
- function Le({
313
+ function Re({
258
314
  value: e,
259
315
  children: o,
260
- className: i
316
+ className: l
261
317
  }) {
262
- const l = h(N), n = x(e, () => l == null ? void 0 : l.flush());
318
+ const r = b(w), n = k(e, () => r == null ? void 0 : r.flush());
263
319
  return /* @__PURE__ */ t(
264
320
  "div",
265
321
  {
266
- className: i,
322
+ className: l,
267
323
  ...n.props,
268
324
  onKeyDownCapture: (a) => {
269
- a.key === "Enter" && a.target.tagName === "INPUT" && (l == null || l.flush());
325
+ a.key === "Enter" && a.target.tagName === "INPUT" && (r == null || r.flush());
270
326
  },
271
327
  children: o(n.value, (a) => (n.set(a), a))
272
328
  }
273
329
  );
274
330
  }
275
- function Fe({
331
+ function _e({
276
332
  value: e,
277
333
  onCommit: o,
278
- placeholder: i,
279
- mono: l,
334
+ placeholder: l,
335
+ mono: r,
280
336
  ariaLabel: n
281
337
  }) {
282
- const a = x(e);
338
+ const a = k(e);
283
339
  return /* @__PURE__ */ t(
284
340
  "input",
285
341
  {
286
342
  value: a.value,
287
343
  "aria-label": n,
288
- placeholder: i,
344
+ placeholder: l,
289
345
  onChange: (c) => {
290
346
  a.set(c.target.value), o(c.target.value);
291
347
  },
292
348
  ...a.props,
293
- className: m(A, l && "font-mono")
349
+ className: p(B, r && "font-mono")
294
350
  }
295
351
  );
296
352
  }
297
- function je({
353
+ function Ge({
298
354
  value: e,
299
355
  options: o,
300
- onChange: i,
301
- disabled: l
356
+ onChange: l,
357
+ disabled: r
302
358
  }) {
303
- return /* @__PURE__ */ t("div", { className: le(o.length), children: o.map((n) => /* @__PURE__ */ t(
359
+ return /* @__PURE__ */ t("div", { className: me(o.length), children: o.map((n) => /* @__PURE__ */ t(
304
360
  "button",
305
361
  {
306
362
  type: "button",
307
363
  "aria-pressed": n.value === e,
308
- disabled: l,
364
+ disabled: r,
309
365
  "data-tip": n.tip,
310
- onClick: () => i(n.value),
311
- className: re(n.value === e),
366
+ onClick: () => l(n.value),
367
+ className: ue(n.value === e),
312
368
  children: n.label
313
369
  },
314
370
  n.value
315
371
  )) });
316
372
  }
317
- function F({
373
+ function j({
318
374
  value: e,
319
375
  options: o,
320
- onChange: i,
321
- ariaLabel: l,
376
+ onChange: l,
377
+ ariaLabel: r,
322
378
  disabled: n,
323
379
  unknownLabel: a = (c) => c
324
380
  }) {
325
- const c = e && !o.some((r) => r.value === e) ? [...o, { value: e, label: a(e) }] : o;
381
+ const c = e && !o.some((s) => s.value === e) ? [...o, { value: e, label: a(e) }] : o;
326
382
  return /* @__PURE__ */ t(
327
- te,
383
+ oe,
328
384
  {
329
385
  value: e,
330
- onChange: i,
386
+ onChange: l,
331
387
  options: c,
332
- ariaLabel: l,
388
+ ariaLabel: r,
333
389
  disabled: n,
334
- className: m(v, "focus:ring-0 focus:ring-offset-0")
390
+ className: p(C, "focus:ring-0 focus:ring-offset-0")
335
391
  }
336
392
  );
337
393
  }
338
- function Pe({
394
+ function Ke({
339
395
  value: e,
340
396
  onCommit: o,
341
- placeholder: i,
342
- rows: l = 4,
397
+ placeholder: l,
398
+ rows: r = 4,
343
399
  validate: n,
344
400
  ariaLabel: a
345
401
  }) {
346
- const c = e == null ? "" : JSON.stringify(e, null, 2), [r, s] = g(c), [u, p] = g(null), b = I(!1);
347
- E(() => {
348
- b.current || (s(c), p(null));
402
+ const c = e == null ? "" : JSON.stringify(e, null, 2), [s, i] = v(c), [u, m] = v(null), g = F(!1);
403
+ P(() => {
404
+ g.current || (i(c), m(null));
349
405
  }, [c]);
350
- const w = (f) => {
351
- const O = f.trim();
352
- if (!O) return e != null ? { send: void 0 } : { error: null };
406
+ const N = (f) => {
407
+ const y = f.trim();
408
+ if (!y) return e != null ? { send: void 0 } : { error: null };
353
409
  try {
354
- const y = JSON.parse(O), T = (n == null ? void 0 : n(y)) ?? null;
355
- return T ? { error: T } : JSON.stringify(y) !== JSON.stringify(e) ? { send: y } : { error: null };
410
+ const S = JSON.parse(y), L = (n == null ? void 0 : n(S)) ?? null;
411
+ return L ? { error: L } : JSON.stringify(S) !== JSON.stringify(e) ? { send: S } : { error: null };
356
412
  } catch {
357
413
  return { error: "Not valid JSON — nothing saved" };
358
414
  }
359
- }, D = () => {
360
- const f = w(r);
361
- "send" in f ? (p(null), o(f.send)) : p(f.error);
362
- }, S = I(() => {
415
+ }, h = () => {
416
+ const f = N(s);
417
+ "send" in f ? (m(null), o(f.send)) : m(f.error);
418
+ }, x = F(() => {
363
419
  });
364
- return S.current = () => {
365
- if (!b.current) return;
366
- const f = w(r);
420
+ return x.current = () => {
421
+ if (!g.current) return;
422
+ const f = N(s);
367
423
  "send" in f && o(f.send);
368
- }, E(() => () => S.current(), []), /* @__PURE__ */ d("div", { className: "space-y-1", children: [
424
+ }, P(() => () => x.current(), []), /* @__PURE__ */ d("div", { className: "space-y-1", children: [
369
425
  /* @__PURE__ */ t(
370
426
  "textarea",
371
427
  {
372
- value: r,
373
- rows: l,
428
+ value: s,
429
+ rows: r,
374
430
  "aria-label": a,
375
431
  spellCheck: !1,
376
- placeholder: i,
377
- onChange: (f) => s(f.target.value),
432
+ placeholder: l,
433
+ onChange: (f) => i(f.target.value),
378
434
  onFocus: () => {
379
- b.current = !0;
435
+ g.current = !0;
380
436
  },
381
437
  onBlur: () => {
382
- b.current = !1, D();
438
+ g.current = !1, h();
383
439
  },
384
- className: m(
440
+ className: p(
385
441
  "w-full rounded-md border bg-white px-2.5 py-1.5 font-mono text-[12px] leading-snug text-foreground placeholder:text-slate-400 focus:outline-none dark:bg-background",
386
442
  u ? "border-red-400 dark:border-red-500" : "border-slate-200 focus:border-nvr-cyan dark:border-border"
387
443
  )
@@ -390,39 +446,39 @@ function Pe({
390
446
  u && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-600 dark:text-red-400", children: u })
391
447
  ] });
392
448
  }
393
- function qe({
449
+ function Me({
394
450
  title: e,
395
451
  children: o,
396
- className: i,
397
- collapsible: l,
452
+ className: l,
453
+ collapsible: r,
398
454
  defaultOpen: n = !1
399
455
  }) {
400
- const [a, c] = g(!l || n);
456
+ const [a, c] = v(!r || n);
401
457
  return /* @__PURE__ */ d(
402
458
  "section",
403
459
  {
404
- className: m(
460
+ className: p(
405
461
  "space-y-4 border-t border-slate-100 pt-5 dark:border-border/60",
406
- l && !a && "space-y-0",
407
- i
462
+ r && !a && "space-y-0",
463
+ l
408
464
  ),
409
465
  children: [
410
- l ? /* @__PURE__ */ d(
466
+ r ? /* @__PURE__ */ d(
411
467
  "button",
412
468
  {
413
469
  type: "button",
414
470
  "aria-expanded": a,
415
471
  "data-section-toggle": "",
416
- onClick: () => c((r) => !r),
417
- className: m(
418
- L,
472
+ onClick: () => c((s) => !s),
473
+ className: p(
474
+ T,
419
475
  "-mx-1 flex w-[calc(100%+0.5rem)] items-center gap-1.5 rounded px-1 text-left hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:hover:bg-muted/60"
420
476
  ),
421
477
  children: [
422
478
  /* @__PURE__ */ t(
423
479
  _,
424
480
  {
425
- className: m(
481
+ className: p(
426
482
  "h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150",
427
483
  a && "rotate-90"
428
484
  )
@@ -431,111 +487,111 @@ function qe({
431
487
  e
432
488
  ]
433
489
  }
434
- ) : /* @__PURE__ */ t("h3", { className: L, children: e }),
490
+ ) : /* @__PURE__ */ t("h3", { className: T, children: e }),
435
491
  /* @__PURE__ */ t("div", { hidden: !a, className: "space-y-5", children: o })
436
492
  ]
437
493
  }
438
494
  );
439
495
  }
440
- function Ae({
496
+ function Ve({
441
497
  value: e,
442
498
  options: o,
443
- onChange: i,
444
- placeholder: l = "None selected",
499
+ onChange: l,
500
+ placeholder: r = "None selected",
445
501
  ariaLabel: n
446
502
  }) {
447
- const [a, c] = g(!1), r = (s) => {
503
+ const [a, c] = v(!1), s = (i) => {
448
504
  var u;
449
- return ((u = o.find((p) => p.value === s)) == null ? void 0 : u.label) ?? s;
505
+ return ((u = o.find((m) => m.value === i)) == null ? void 0 : u.label) ?? i;
450
506
  };
451
- return /* @__PURE__ */ d(H, { open: a, onOpenChange: c, children: [
452
- /* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ d(
507
+ return /* @__PURE__ */ d(re, { open: a, onOpenChange: c, children: [
508
+ /* @__PURE__ */ t(ae, { asChild: !0, children: /* @__PURE__ */ d(
453
509
  "button",
454
510
  {
455
511
  type: "button",
456
512
  "aria-label": n,
457
- className: m(
458
- v,
513
+ className: p(
514
+ C,
459
515
  "flex items-center justify-between text-left hover:border-slate-300"
460
516
  ),
461
517
  children: [
462
- /* @__PURE__ */ t("span", { className: m("truncate", !e.length && "text-slate-400"), children: e.length ? e.map(r).join(", ") : l }),
463
- /* @__PURE__ */ t($, { className: "ml-1 h-3.5 w-3.5 shrink-0 text-slate-400" })
518
+ /* @__PURE__ */ t("span", { className: p("truncate", !e.length && "text-slate-400"), children: e.length ? e.map(s).join(", ") : r }),
519
+ /* @__PURE__ */ t(G, { className: "ml-1 h-3.5 w-3.5 shrink-0 text-slate-400" })
464
520
  ]
465
521
  }
466
522
  ) }),
467
- /* @__PURE__ */ t(ee, { className: "w-64 p-0", align: "start", children: /* @__PURE__ */ d(V, { children: [
468
- /* @__PURE__ */ t(Q, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
469
- /* @__PURE__ */ d(W, { className: "max-h-[240px]", children: [
470
- /* @__PURE__ */ t(X, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No fields" }),
471
- /* @__PURE__ */ t(Y, { children: o.map((s) => {
472
- const u = e.includes(s.value);
523
+ /* @__PURE__ */ t(se, { className: "w-64 p-0", align: "start", children: /* @__PURE__ */ d(Y, { children: [
524
+ /* @__PURE__ */ t(H, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
525
+ /* @__PURE__ */ d(z, { className: "max-h-[240px]", children: [
526
+ /* @__PURE__ */ t(ee, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No fields" }),
527
+ /* @__PURE__ */ t(te, { children: o.map((i) => {
528
+ const u = e.includes(i.value);
473
529
  return /* @__PURE__ */ d(
474
- z,
530
+ ne,
475
531
  {
476
- value: `${s.label} ${s.value}`,
477
- onSelect: () => i(u ? e.filter((p) => p !== s.value) : [...e, s.value]),
532
+ value: `${i.label} ${i.value}`,
533
+ onSelect: () => l(u ? e.filter((m) => m !== i.value) : [...e, i.value]),
478
534
  className: "flex items-center gap-2 text-[12px]",
479
535
  children: [
480
536
  /* @__PURE__ */ t(
481
- G,
537
+ K,
482
538
  {
483
- className: m("h-3 w-3 shrink-0", u ? "opacity-100" : "opacity-0")
539
+ className: p("h-3 w-3 shrink-0", u ? "opacity-100" : "opacity-0")
484
540
  }
485
541
  ),
486
- /* @__PURE__ */ t("span", { className: "flex-1 truncate", children: s.label }),
487
- /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[11px] text-slate-400", children: s.hint ?? s.value })
542
+ /* @__PURE__ */ t("span", { className: "flex-1 truncate", children: i.label }),
543
+ /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[11px] text-slate-400", children: i.hint ?? i.value })
488
544
  ]
489
545
  },
490
- s.value
546
+ i.value
491
547
  );
492
548
  }) })
493
549
  ] })
494
550
  ] }) })
495
551
  ] });
496
552
  }
497
- const k = [
553
+ const O = [
498
554
  { value: "eq", label: "is" },
499
555
  { value: "neq", label: "is not" },
500
556
  { value: "nnull", label: "is set" }
501
557
  ];
502
- function Be({
558
+ function Ze({
503
559
  value: e,
504
560
  fields: o,
505
- onChange: i
561
+ onChange: l
506
562
  }) {
507
- const l = (n, a) => i(e.map((c, r) => r === n ? { ...c, ...a } : c));
563
+ const r = (n, a) => l(e.map((c, s) => s === n ? { ...c, ...a } : c));
508
564
  return /* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
509
565
  e.map((n, a) => {
510
- const c = k.some((r) => r.value === n.op) ? k : [...k, { value: n.op, label: n.op }];
566
+ const c = O.some((s) => s.value === n.op) ? O : [...O, { value: n.op, label: n.op }];
511
567
  return (
512
568
  // biome-ignore lint/suspicious/noArrayIndexKey: conditions are positional
513
569
  /* @__PURE__ */ d("div", { className: "flex items-center gap-1", "data-condition-row": "", children: [
514
570
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-[3]", children: /* @__PURE__ */ t(
515
- F,
571
+ j,
516
572
  {
517
573
  value: n.field,
518
574
  ariaLabel: "Field",
519
575
  options: [{ value: "", label: "Field…" }, ...o],
520
- onChange: (r) => l(a, { field: r })
576
+ onChange: (s) => r(a, { field: s })
521
577
  }
522
578
  ) }),
523
579
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-[2]", children: /* @__PURE__ */ t(
524
- F,
580
+ j,
525
581
  {
526
582
  value: n.op,
527
583
  ariaLabel: "Condition",
528
584
  options: c,
529
- onChange: (r) => l(a, r === "nnull" ? { op: r, value: void 0 } : { op: r })
585
+ onChange: (s) => r(a, s === "nnull" ? { op: s, value: void 0 } : { op: s })
530
586
  }
531
587
  ) }),
532
588
  n.op !== "nnull" && n.op !== "null" && /* @__PURE__ */ t("div", { className: "min-w-0 flex-[2]", children: /* @__PURE__ */ t(
533
- me,
589
+ Ne,
534
590
  {
535
591
  value: n.value == null ? "" : String(n.value),
536
592
  ariaLabel: "Value",
537
593
  placeholder: "value",
538
- onChange: (r) => l(a, { value: r })
594
+ onChange: (s) => r(a, { value: s })
539
595
  }
540
596
  ) }),
541
597
  /* @__PURE__ */ t(
@@ -544,9 +600,9 @@ function Be({
544
600
  type: "button",
545
601
  "aria-label": "Remove condition",
546
602
  "data-tip": "Remove condition",
547
- onClick: () => i(e.filter((r, s) => s !== a)),
603
+ onClick: () => l(e.filter((s, i) => i !== a)),
548
604
  className: "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded text-slate-500 transition-colors hover:bg-slate-100 hover:text-red-600 dark:hover:bg-muted dark:hover:text-red-400",
549
- children: /* @__PURE__ */ t(U, { className: "h-3.5 w-3.5" })
605
+ children: /* @__PURE__ */ t(M, { className: "h-3.5 w-3.5" })
550
606
  }
551
607
  )
552
608
  ] }, a)
@@ -556,41 +612,42 @@ function Be({
556
612
  "button",
557
613
  {
558
614
  type: "button",
559
- onClick: () => i([...e, { field: "", op: "eq", value: "" }]),
560
- className: B,
615
+ onClick: () => l([...e, { field: "", op: "eq", value: "" }]),
616
+ className: D,
561
617
  children: "+ Add condition"
562
618
  }
563
619
  )
564
620
  ] });
565
621
  }
566
- const B = "text-[12px] font-medium text-sky-700 hover:underline dark:text-nvr-cyan";
567
- function De({ onClick: e, children: o }) {
568
- return /* @__PURE__ */ t("button", { type: "button", onClick: e, className: B, children: o });
622
+ const D = "text-[12px] font-medium text-sky-700 hover:underline dark:text-nvr-cyan";
623
+ function Qe({ onClick: e, children: o }) {
624
+ return /* @__PURE__ */ t("button", { type: "button", onClick: e, className: D, children: o });
569
625
  }
570
626
  export {
571
- De as AddButton,
572
- Le as Buffered,
573
- k as CONDITION_OPS,
574
- F as Choice,
575
- Be as ConditionBuilder,
576
- ce as DEFAULT_FORM_ONLY,
577
- Fe as DraftInput,
578
- de as EnforcementNote,
579
- Ae as FieldMultiPicker,
580
- oe as GlobalConfirm,
581
- C as GlobalWriterContext,
582
- N as InspectorEnvContext,
583
- Pe as JsonInput,
584
- Te as ScopeLegend,
585
- ie as ScopeTag,
586
- qe as Section,
587
- je as Segmented,
588
- ue as Setting,
589
- Ee as TextArea,
590
- me as TextInput,
591
- Ie as Toggle,
592
- B as addLinkCls,
593
- A as inputCls,
594
- Oe as useGlobalValue,
595
- se as useInspectorEnv
627
+ Qe as AddButton,
628
+ Re as Buffered,
629
+ O as CONDITION_OPS,
630
+ j as Choice,
631
+ Ze as ConditionBuilder,
632
+ be as DEFAULT_FORM_ONLY,
633
+ _e as DraftInput,
634
+ ge as EnforcementNote,
635
+ Ve as FieldMultiPicker,
636
+ fe as GlobalConfirm,
637
+ I as GlobalWriterContext,
638
+ w as InspectorEnvContext,
639
+ Ke as JsonInput,
640
+ Be as PinZone,
641
+ Ae as ScopeLegend,
642
+ he as ScopeTag,
643
+ Me as Section,
644
+ Ge as Segmented,
645
+ xe as Setting,
646
+ Je as TextArea,
647
+ Ne as TextInput,
648
+ De as Toggle,
649
+ D as addLinkCls,
650
+ B as inputCls,
651
+ qe as useGlobalValue,
652
+ pe as useInspectorEnv
596
653
  };