@bettercms-ai/kit 3.0.0 → 3.0.2

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 (157) hide show
  1. package/dist/brand/logo.js +67 -18
  2. package/dist/brand/logo.js.map +1 -1
  3. package/dist/context.js +8 -3
  4. package/dist/context.js.map +1 -1
  5. package/dist/controls/button.js +451 -134
  6. package/dist/controls/button.js.map +1 -1
  7. package/dist/controls/choice.js +336 -95
  8. package/dist/controls/choice.js.map +1 -1
  9. package/dist/controls/code.js +245 -72
  10. package/dist/controls/code.js.map +1 -1
  11. package/dist/controls/color.js +108 -31
  12. package/dist/controls/color.js.map +1 -1
  13. package/dist/controls/date.js +268 -83
  14. package/dist/controls/date.js.map +1 -1
  15. package/dist/controls/form-picker.js +26 -9
  16. package/dist/controls/form-picker.js.map +1 -1
  17. package/dist/controls/icon.js +341 -100
  18. package/dist/controls/icon.js.map +1 -1
  19. package/dist/controls/json.js +20 -7
  20. package/dist/controls/json.js.map +1 -1
  21. package/dist/controls/link.js +561 -156
  22. package/dist/controls/link.js.map +1 -1
  23. package/dist/controls/location.js +124 -35
  24. package/dist/controls/location.js.map +1 -1
  25. package/dist/controls/media.js +928 -267
  26. package/dist/controls/media.js.map +1 -1
  27. package/dist/controls/number.js +80 -23
  28. package/dist/controls/number.js.map +1 -1
  29. package/dist/controls/reference.js +516 -155
  30. package/dist/controls/reference.js.map +1 -1
  31. package/dist/controls/rich-text/article-shell.js +327 -86
  32. package/dist/controls/rich-text/article-shell.js.map +1 -1
  33. package/dist/controls/rich-text/author.js +78 -21
  34. package/dist/controls/rich-text/author.js.map +1 -1
  35. package/dist/controls/rich-text/blocks.js +1084 -315
  36. package/dist/controls/rich-text/blocks.js.map +1 -1
  37. package/dist/controls/rich-text/button.js +30 -9
  38. package/dist/controls/rich-text/button.js.map +1 -1
  39. package/dist/controls/rich-text/catalog.js +168 -51
  40. package/dist/controls/rich-text/catalog.js.map +1 -1
  41. package/dist/controls/rich-text/columns.js +104 -31
  42. package/dist/controls/rich-text/columns.js.map +1 -1
  43. package/dist/controls/rich-text/component-card.js +790 -209
  44. package/dist/controls/rich-text/component-card.js.map +1 -1
  45. package/dist/controls/rich-text/component-panel.js +102 -40
  46. package/dist/controls/rich-text/component-panel.js.map +1 -1
  47. package/dist/controls/rich-text/control.js +101 -32
  48. package/dist/controls/rich-text/control.js.map +1 -1
  49. package/dist/controls/rich-text/editor.js +423 -121
  50. package/dist/controls/rich-text/editor.js.map +1 -1
  51. package/dist/controls/rich-text/embed.js +184 -51
  52. package/dist/controls/rich-text/embed.js.map +1 -1
  53. package/dist/controls/rich-text/floating.js +171 -42
  54. package/dist/controls/rich-text/floating.js.map +1 -1
  55. package/dist/controls/rich-text/footnote.js +89 -28
  56. package/dist/controls/rich-text/footnote.js.map +1 -1
  57. package/dist/controls/rich-text/gallery.js +88 -27
  58. package/dist/controls/rich-text/gallery.js.map +1 -1
  59. package/dist/controls/rich-text/link-form.js +111 -34
  60. package/dist/controls/rich-text/link-form.js.map +1 -1
  61. package/dist/controls/rich-text/plain.js +8 -3
  62. package/dist/controls/rich-text/plain.js.map +1 -1
  63. package/dist/controls/rich-text/related.js +86 -25
  64. package/dist/controls/rich-text/related.js.map +1 -1
  65. package/dist/controls/rich-text/toc.js +48 -15
  66. package/dist/controls/rich-text/toc.js.map +1 -1
  67. package/dist/controls/rich-text/toolbar.js +408 -107
  68. package/dist/controls/rich-text/toolbar.js.map +1 -1
  69. package/dist/controls/scale.js +169 -52
  70. package/dist/controls/scale.js.map +1 -1
  71. package/dist/controls/slot.js +238 -73
  72. package/dist/controls/slot.js.map +1 -1
  73. package/dist/controls/table/table-editor.js +1766 -500
  74. package/dist/controls/table/table-editor.js.map +1 -1
  75. package/dist/controls/table/table-link.js +119 -38
  76. package/dist/controls/table/table-link.js.map +1 -1
  77. package/dist/controls/table/table.js +26 -9
  78. package/dist/controls/table/table.js.map +1 -1
  79. package/dist/controls/text.js +221 -68
  80. package/dist/controls/text.js.map +1 -1
  81. package/dist/controls/unknown-value.js +79 -22
  82. package/dist/controls/unknown-value.js.map +1 -1
  83. package/dist/engine/array.js +875 -233
  84. package/dist/engine/array.js.map +1 -1
  85. package/dist/engine/bits.js +38 -13
  86. package/dist/engine/bits.js.map +1 -1
  87. package/dist/engine/breadcrumb.js +25 -8
  88. package/dist/engine/breadcrumb.js.map +1 -1
  89. package/dist/engine/expand.js +38 -13
  90. package/dist/engine/expand.js.map +1 -1
  91. package/dist/engine/field-list.js +14 -5
  92. package/dist/engine/field-list.js.map +1 -1
  93. package/dist/engine/field-shell.js +849 -244
  94. package/dist/engine/field-shell.js.map +1 -1
  95. package/dist/engine/frame.js +275 -78
  96. package/dist/engine/frame.js.map +1 -1
  97. package/dist/engine/grouping.js +630 -193
  98. package/dist/engine/grouping.js.map +1 -1
  99. package/dist/engine/item-list.js +187 -50
  100. package/dist/engine/item-list.js.map +1 -1
  101. package/dist/engine/kit-field.js +320 -95
  102. package/dist/engine/kit-field.js.map +1 -1
  103. package/dist/engine/schema-form.js +101 -32
  104. package/dist/engine/schema-form.js.map +1 -1
  105. package/dist/engine/slot.js +146 -45
  106. package/dist/engine/slot.js.map +1 -1
  107. package/dist/index.js +2 -2
  108. package/dist/lib/icons.js +14 -5
  109. package/dist/lib/icons.js.map +1 -1
  110. package/dist/styles.css +5821 -1
  111. package/dist/table/table-view.js +49 -16
  112. package/dist/table/table-view.js.map +1 -1
  113. package/dist/testing/test-form.js +14 -5
  114. package/dist/testing/test-form.js.map +1 -1
  115. package/dist/theme.js +8 -3
  116. package/dist/theme.js.map +1 -1
  117. package/dist/ui/action-tray.js +97 -24
  118. package/dist/ui/action-tray.js.map +1 -1
  119. package/dist/ui/autocomplete.js +135 -38
  120. package/dist/ui/autocomplete.js.map +1 -1
  121. package/dist/ui/button.js +108 -31
  122. package/dist/ui/button.js.map +1 -1
  123. package/dist/ui/choice-switch.js +14 -5
  124. package/dist/ui/choice-switch.js.map +1 -1
  125. package/dist/ui/controls.js +279 -86
  126. package/dist/ui/controls.js.map +1 -1
  127. package/dist/ui/display.js +401 -116
  128. package/dist/ui/display.js.map +1 -1
  129. package/dist/ui/expanded-editor-modal.js +100 -27
  130. package/dist/ui/expanded-editor-modal.js.map +1 -1
  131. package/dist/ui/floating-panel.js +130 -37
  132. package/dist/ui/floating-panel.js.map +1 -1
  133. package/dist/ui/index.js +2 -2
  134. package/dist/ui/input.js +196 -59
  135. package/dist/ui/input.js.map +1 -1
  136. package/dist/ui/mode-bar.js +32 -11
  137. package/dist/ui/mode-bar.js.map +1 -1
  138. package/dist/ui/overlay.js +616 -179
  139. package/dist/ui/overlay.js.map +1 -1
  140. package/dist/ui/path-crumbs.js +374 -113
  141. package/dist/ui/path-crumbs.js.map +1 -1
  142. package/dist/ui/select.js +311 -78
  143. package/dist/ui/select.js.map +1 -1
  144. package/dist/ui/shortcut-hint.d.ts +3 -0
  145. package/dist/ui/shortcut-hint.js +33 -7
  146. package/dist/ui/shortcut-hint.js.map +1 -1
  147. package/dist/ui/spinner.js +20 -7
  148. package/dist/ui/spinner.js.map +1 -1
  149. package/dist/ui/split-button.js +35 -10
  150. package/dist/ui/split-button.js.map +1 -1
  151. package/dist/ui/tab.js +50 -17
  152. package/dist/ui/tab.js.map +1 -1
  153. package/dist/ui/toast.js +107 -30
  154. package/dist/ui/toast.js.map +1 -1
  155. package/dist/ui/tooltip-root.js +24 -7
  156. package/dist/ui/tooltip-root.js.map +1 -1
  157. package/package.json +2 -2
@@ -14,7 +14,7 @@ import { FieldList } from "./field-list.js";
14
14
  import { ItemList, OrderLockSlot, arrayMove, useDragReorder } from "./item-list.js";
15
15
  import { CONTROLS, FallbackControl, useFieldAccess } from "./kit-field.js";
16
16
  import * as React from "react";
17
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ import { Fragment, jsxDEV } from "react/jsx-dev-runtime";
18
18
  import { IconArrowDown, IconArrowUp, IconArrowsDiagonal, IconCheck, IconChevronDown, IconChevronRight, IconCopy, IconDots, IconGripVertical, IconMinus, IconPlus, IconRowInsertBottom, IconRowInsertTop, IconSearch, IconTrash, IconX } from "@tabler/icons-react";
19
19
  import { AnimatePresence, motion } from "framer-motion";
20
20
  //#region src/engine/array.tsx
@@ -38,6 +38,7 @@ import { AnimatePresence, motion } from "framer-motion";
38
38
  * `sortableId` is not ported); toasts come from KitServices (absent → silent); the gallery and reference-chip controls come from
39
39
  * ARRAY_CONTROLS (registered by the controls lane); a host that never registered them edits the raw list (FallbackControl).
40
40
  */
41
+ var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/engine/array.tsx";
41
42
  var RowsHostContext = React.createContext({});
42
43
  /** The frame push for a drill row, or undefined when nothing can draw the frame (the row is then inert). */
43
44
  function useDrill() {
@@ -50,22 +51,34 @@ var ARRAY_CONTROLS = {};
50
51
  var plural = (noun) => noun.endsWith("y") && !/[aeiou]y$/.test(noun) ? `${noun.slice(0, -1)}ies` : noun.endsWith("s") ? noun : `${noun}s`;
51
52
  function ArrayField({ field, path }) {
52
53
  const prim = primitiveItem(field);
53
- if (prim) return /* @__PURE__ */ jsx(PrimitiveArray, {
54
+ if (prim) return /* @__PURE__ */ jsxDEV(PrimitiveArray, {
54
55
  field,
55
56
  item: prim,
56
57
  path
57
- });
58
+ }, void 0, false, {
59
+ fileName: _jsxFileName,
60
+ lineNumber: 75,
61
+ columnNumber: 20
62
+ }, this);
58
63
  const one = oneFieldItem(field);
59
- if (one) return /* @__PURE__ */ jsx(OneFieldArray, {
64
+ if (one) return /* @__PURE__ */ jsxDEV(OneFieldArray, {
60
65
  field,
61
66
  item: one.item,
62
67
  inner: one.inner,
63
68
  path
64
- });
65
- return /* @__PURE__ */ jsx(ObjectArray, {
69
+ }, void 0, false, {
70
+ fileName: _jsxFileName,
71
+ lineNumber: 77,
72
+ columnNumber: 19
73
+ }, this);
74
+ return /* @__PURE__ */ jsxDEV(ObjectArray, {
66
75
  field,
67
76
  path
68
- });
77
+ }, void 0, false, {
78
+ fileName: _jsxFileName,
79
+ lineNumber: 78,
80
+ columnNumber: 10
81
+ }, this);
69
82
  }
70
83
  /** Item types that edit as one line in the item list. */
71
84
  var LIST_KIND = {
@@ -127,27 +140,51 @@ function PrimitiveArray({ field, item, path }) {
127
140
  ]);
128
141
  const Gallery = ARRAY_CONTROLS.gallery;
129
142
  const References = ARRAY_CONTROLS.references;
130
- const control = item.type === "image" ? Gallery ? /* @__PURE__ */ jsx(Gallery, { ...props }) : /* @__PURE__ */ jsx(FallbackControl, { ...props }) : item.type === "reference" ? References ? /* @__PURE__ */ jsx(References, {
143
+ const control = item.type === "image" ? Gallery ? /* @__PURE__ */ jsxDEV(Gallery, { ...props }, void 0, false, {
144
+ fileName: _jsxFileName,
145
+ lineNumber: 131,
146
+ columnNumber: 40
147
+ }, this) : /* @__PURE__ */ jsxDEV(FallbackControl, { ...props }, void 0, false, {
148
+ fileName: _jsxFileName,
149
+ lineNumber: 131,
150
+ columnNumber: 65
151
+ }, this) : item.type === "reference" ? References ? /* @__PURE__ */ jsxDEV(References, {
131
152
  ...props,
132
153
  field: {
133
154
  ...field,
134
155
  reference: item.reference
135
156
  }
136
- }) : /* @__PURE__ */ jsx(FallbackControl, { ...props }) : adapter ? /* @__PURE__ */ jsx(ItemList, {
157
+ }, void 0, false, {
158
+ fileName: _jsxFileName,
159
+ lineNumber: 132,
160
+ columnNumber: 47
161
+ }, this) : /* @__PURE__ */ jsxDEV(FallbackControl, { ...props }, void 0, false, {
162
+ fileName: _jsxFileName,
163
+ lineNumber: 132,
164
+ columnNumber: 123
165
+ }, this) : adapter ? /* @__PURE__ */ jsxDEV(ItemList, {
137
166
  field,
138
167
  path,
139
168
  list,
140
169
  readOnly,
141
170
  adapter,
142
171
  inputId: id
143
- }) : /* @__PURE__ */ jsx(InlineList, {
172
+ }, void 0, false, {
173
+ fileName: _jsxFileName,
174
+ lineNumber: 133,
175
+ columnNumber: 15
176
+ }, this) : /* @__PURE__ */ jsxDEV(InlineList, {
144
177
  field,
145
178
  item,
146
179
  path,
147
180
  list,
148
181
  readOnly
149
- });
150
- return /* @__PURE__ */ jsx(FieldShell, {
182
+ }, void 0, false, {
183
+ fileName: _jsxFileName,
184
+ lineNumber: 134,
185
+ columnNumber: 5
186
+ }, this);
187
+ return /* @__PURE__ */ jsxDEV(FieldShell, {
151
188
  field,
152
189
  path,
153
190
  id,
@@ -155,15 +192,27 @@ function PrimitiveArray({ field, item, path }) {
155
192
  onChange,
156
193
  readOnly,
157
194
  issue: form.visibleIssue(key),
158
- meta: item.type === "reference" ? void 0 : /* @__PURE__ */ jsx("span", {
195
+ meta: item.type === "reference" ? void 0 : /* @__PURE__ */ jsxDEV("span", {
159
196
  className: "text-kit-xs text-kit-fg-3",
160
197
  children: listMeta(list.length, field)
161
- }),
162
- children: /* @__PURE__ */ jsx("div", {
198
+ }, void 0, false, {
199
+ fileName: _jsxFileName,
200
+ lineNumber: 136,
201
+ columnNumber: 181
202
+ }, this),
203
+ children: /* @__PURE__ */ jsxDEV("div", {
163
204
  className: "@container",
164
205
  children: control
165
- })
166
- });
206
+ }, void 0, false, {
207
+ fileName: _jsxFileName,
208
+ lineNumber: 137,
209
+ columnNumber: 7
210
+ }, this)
211
+ }, void 0, false, {
212
+ fileName: _jsxFileName,
213
+ lineNumber: 136,
214
+ columnNumber: 5
215
+ }, this);
167
216
  }
168
217
  function OneFieldArray({ field, item, inner, path }) {
169
218
  const form = useForm();
@@ -193,7 +242,7 @@ function OneFieldArray({ field, item, inner, path }) {
193
242
  React.useEffect(() => {
194
243
  if (!readOnly && list.some((it) => isObj(it) && typeof it._key !== "string")) form.setAt(path, ensureKeys(list));
195
244
  }, [list, readOnly]);
196
- return /* @__PURE__ */ jsx(FieldShell, {
245
+ return /* @__PURE__ */ jsxDEV(FieldShell, {
197
246
  field,
198
247
  path,
199
248
  id,
@@ -201,22 +250,38 @@ function OneFieldArray({ field, item, inner, path }) {
201
250
  onChange: (v) => form.setAt(path, v),
202
251
  readOnly,
203
252
  issue: form.visibleIssue(key),
204
- meta: /* @__PURE__ */ jsx("span", {
253
+ meta: /* @__PURE__ */ jsxDEV("span", {
205
254
  className: "text-kit-xs text-kit-fg-3",
206
255
  children: listMeta(list.length, field)
207
- }),
208
- children: /* @__PURE__ */ jsx("div", {
256
+ }, void 0, false, {
257
+ fileName: _jsxFileName,
258
+ lineNumber: 169,
259
+ columnNumber: 159
260
+ }, this),
261
+ children: /* @__PURE__ */ jsxDEV("div", {
209
262
  className: "@container",
210
- children: /* @__PURE__ */ jsx(ItemList, {
263
+ children: /* @__PURE__ */ jsxDEV(ItemList, {
211
264
  field,
212
265
  path,
213
266
  list,
214
267
  readOnly,
215
268
  adapter,
216
269
  inputId: id
217
- })
218
- })
219
- });
270
+ }, void 0, false, {
271
+ fileName: _jsxFileName,
272
+ lineNumber: 171,
273
+ columnNumber: 9
274
+ }, this)
275
+ }, void 0, false, {
276
+ fileName: _jsxFileName,
277
+ lineNumber: 170,
278
+ columnNumber: 7
279
+ }, this)
280
+ }, void 0, false, {
281
+ fileName: _jsxFileName,
282
+ lineNumber: 169,
283
+ columnNumber: 5
284
+ }, this);
220
285
  }
221
286
  function InlineList({ field, item, path, list, readOnly }) {
222
287
  const form = useForm();
@@ -225,7 +290,7 @@ function InlineList({ field, item, path, list, readOnly }) {
225
290
  const ids = list.map((_, i) => `p${i}`);
226
291
  const sort = useDragReorder(ids, (from, to) => form.setAt(path, arrayMove(list, from, to)), { disabled: readOnly || !!field.orderLocked });
227
292
  const ops = useListOps(field, path, list, (next) => form.setAt(path, next));
228
- const rowControl = (v, i) => /* @__PURE__ */ jsx(Control, {
293
+ const rowControl = (v, i) => /* @__PURE__ */ jsxDEV(Control, {
229
294
  field: {
230
295
  ...item,
231
296
  title: `${item.title} ${i + 1}`
@@ -235,79 +300,139 @@ function InlineList({ field, item, path, list, readOnly }) {
235
300
  id: `${pathKey(path)}-${i}`,
236
301
  path: [...path, i],
237
302
  readOnly
238
- });
239
- return /* @__PURE__ */ jsxs("div", {
303
+ }, void 0, false, {
304
+ fileName: _jsxFileName,
305
+ lineNumber: 186,
306
+ columnNumber: 5
307
+ }, this);
308
+ return /* @__PURE__ */ jsxDEV("div", {
240
309
  className: "flex flex-col gap-1.5",
241
310
  children: [
242
- list.map((v, i) => /* @__PURE__ */ jsxs(InlineRow, {
311
+ list.map((v, i) => /* @__PURE__ */ jsxDEV(InlineRow, {
243
312
  id: ids[i],
244
313
  labelId: `${pathKey(path)}-${i}-label`,
245
314
  sort,
246
315
  readOnly,
247
316
  orderLocked: !!field.orderLocked,
248
317
  onRemove: () => ops.remove(i, `${item.title} ${i + 1}`),
249
- children: [/* @__PURE__ */ jsx("span", {
318
+ children: [/* @__PURE__ */ jsxDEV("span", {
250
319
  id: `${pathKey(path)}-${i}-label`,
251
320
  className: "sr-only",
252
321
  children: `${item.title} ${i + 1}`
253
- }), /* @__PURE__ */ jsx(FieldLabelForContext.Provider, {
322
+ }, void 0, false, {
323
+ fileName: _jsxFileName,
324
+ lineNumber: 196,
325
+ columnNumber: 11
326
+ }, this), /* @__PURE__ */ jsxDEV(FieldLabelForContext.Provider, {
254
327
  value: {
255
328
  htmlFor: `${pathKey(path)}-${i}`,
256
329
  labelId: `${pathKey(path)}-${i}-label`
257
330
  },
258
331
  children: rowControl(v, i)
259
- })]
260
- }, ids[i])),
332
+ }, void 0, false, {
333
+ fileName: _jsxFileName,
334
+ lineNumber: 197,
335
+ columnNumber: 11
336
+ }, this)]
337
+ }, ids[i], true, {
338
+ fileName: _jsxFileName,
339
+ lineNumber: 191,
340
+ columnNumber: 9
341
+ }, this)),
261
342
  sort.a11y,
262
- readOnly ? null : /* @__PURE__ */ jsxs(Button, {
343
+ readOnly ? null : /* @__PURE__ */ jsxDEV(Button, {
263
344
  size: "sm",
264
345
  variant: "ghost",
265
346
  className: "self-start text-kit-fg-2",
266
- leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
347
+ leftIcon: /* @__PURE__ */ jsxDEV(IconPlus, { stroke: 1.5 }, void 0, false, {
348
+ fileName: _jsxFileName,
349
+ lineNumber: 204,
350
+ columnNumber: 90
351
+ }, this),
267
352
  disabled: max != null && list.length >= max,
268
353
  onClick: () => form.setAt(path, [...list, initialFor(item)]),
269
354
  children: ["Add ", itemNoun(field)]
270
- })
355
+ }, void 0, true, {
356
+ fileName: _jsxFileName,
357
+ lineNumber: 204,
358
+ columnNumber: 9
359
+ }, this)
271
360
  ]
272
- });
361
+ }, void 0, true, {
362
+ fileName: _jsxFileName,
363
+ lineNumber: 189,
364
+ columnNumber: 5
365
+ }, this);
273
366
  }
274
367
  function InlineRow({ id, labelId, sort, children, onRemove, readOnly, orderLocked }) {
275
- return /* @__PURE__ */ jsxs("div", {
368
+ return /* @__PURE__ */ jsxDEV("div", {
276
369
  ref: sort.register(id),
277
370
  style: sort.style(id),
278
371
  className: cn("group/il flex items-start gap-1", sort.active === id && "relative z-10"),
279
372
  children: [
280
- readOnly ? null : orderLocked ? /* @__PURE__ */ jsx(OrderLockSlot, { className: "mt-1.5" }) : /* @__PURE__ */ jsx("button", {
373
+ readOnly ? null : orderLocked ? /* @__PURE__ */ jsxDEV(OrderLockSlot, { className: "mt-1.5" }, void 0, false, {
374
+ fileName: _jsxFileName,
375
+ lineNumber: 215,
376
+ columnNumber: 9
377
+ }, this) : /* @__PURE__ */ jsxDEV("button", {
281
378
  type: "button",
282
379
  "aria-label": "Drag to reorder",
283
380
  ...sort.handle(id),
284
381
  className: "mt-1.5 flex h-5 w-4 shrink-0 cursor-grab touch-none items-center justify-center text-kit-fg-4 hover:text-kit-fg-2 active:cursor-grabbing",
285
- children: /* @__PURE__ */ jsx(IconGripVertical, {
382
+ children: /* @__PURE__ */ jsxDEV(IconGripVertical, {
286
383
  className: "size-3.5",
287
384
  stroke: 1.5
288
- })
289
- }),
290
- /* @__PURE__ */ jsx("div", {
385
+ }, void 0, false, {
386
+ fileName: _jsxFileName,
387
+ lineNumber: 218,
388
+ columnNumber: 11
389
+ }, this)
390
+ }, void 0, false, {
391
+ fileName: _jsxFileName,
392
+ lineNumber: 217,
393
+ columnNumber: 9
394
+ }, this),
395
+ /* @__PURE__ */ jsxDEV("div", {
291
396
  role: "group",
292
397
  "aria-labelledby": labelId,
293
398
  className: "min-w-0 flex-1",
294
399
  children
295
- }),
296
- readOnly ? null : /* @__PURE__ */ jsx(Tooltip, {
400
+ }, void 0, false, {
401
+ fileName: _jsxFileName,
402
+ lineNumber: 221,
403
+ columnNumber: 7
404
+ }, this),
405
+ readOnly ? null : /* @__PURE__ */ jsxDEV(Tooltip, {
297
406
  content: "Remove",
298
- children: /* @__PURE__ */ jsx("button", {
407
+ children: /* @__PURE__ */ jsxDEV("button", {
299
408
  type: "button",
300
409
  "aria-label": "Remove",
301
410
  onClick: onRemove,
302
411
  className: "mt-1 flex size-6 shrink-0 items-center justify-center rounded-kit-md text-kit-fg-3 opacity-0 transition-opacity hover:bg-kit-hover hover:text-kit-fg focus-visible:opacity-100 group-hover/il:opacity-100",
303
- children: /* @__PURE__ */ jsx(IconX, {
412
+ children: /* @__PURE__ */ jsxDEV(IconX, {
304
413
  className: "size-3.5",
305
414
  stroke: 1.5
306
- })
307
- })
308
- })
415
+ }, void 0, false, {
416
+ fileName: _jsxFileName,
417
+ lineNumber: 225,
418
+ columnNumber: 13
419
+ }, this)
420
+ }, void 0, false, {
421
+ fileName: _jsxFileName,
422
+ lineNumber: 224,
423
+ columnNumber: 11
424
+ }, this)
425
+ }, void 0, false, {
426
+ fileName: _jsxFileName,
427
+ lineNumber: 223,
428
+ columnNumber: 9
429
+ }, this)
309
430
  ]
310
- });
431
+ }, void 0, true, {
432
+ fileName: _jsxFileName,
433
+ lineNumber: 213,
434
+ columnNumber: 5
435
+ }, this);
311
436
  }
312
437
  function ObjectArray({ field, path }) {
313
438
  const form = useForm();
@@ -338,7 +463,7 @@ function ObjectArray({ field, path }) {
338
463
  const [openId, setOpenId] = React.useState(null);
339
464
  const dialogNav = React.useRef(null);
340
465
  const Nested = host.NestedForm;
341
- return /* @__PURE__ */ jsx(FieldShell, {
466
+ return /* @__PURE__ */ jsxDEV(FieldShell, {
342
467
  field,
343
468
  path,
344
469
  id,
@@ -346,11 +471,15 @@ function ObjectArray({ field, path }) {
346
471
  onChange: (v) => form.setAt(path, v),
347
472
  readOnly,
348
473
  issue: form.visibleIssue(key),
349
- meta: /* @__PURE__ */ jsx("span", {
474
+ meta: /* @__PURE__ */ jsxDEV("span", {
350
475
  className: "text-kit-xs text-kit-fg-3",
351
476
  children: listMeta(list.length, field)
352
- }),
353
- children: /* @__PURE__ */ jsx(RowList, {
477
+ }, void 0, false, {
478
+ fileName: _jsxFileName,
479
+ lineNumber: 271,
480
+ columnNumber: 159
481
+ }, this),
482
+ children: /* @__PURE__ */ jsxDEV(RowList, {
354
483
  field,
355
484
  rows,
356
485
  readOnly,
@@ -365,38 +494,62 @@ function ObjectArray({ field, path }) {
365
494
  const tf = rowToggleField(itemSchemaFor(field, r.item));
366
495
  if (!tf) return null;
367
496
  const on = isObj(r.item) && r.item[tf.name] !== false;
368
- return /* @__PURE__ */ jsx(RowCheck, {
497
+ return /* @__PURE__ */ jsxDEV(RowCheck, {
369
498
  on,
370
499
  label: tf.title,
371
500
  title: r.preview.title,
372
501
  readOnly,
373
502
  onToggle: () => form.setAt([...r.path, tf.name], !on)
374
- });
503
+ }, void 0, false, {
504
+ fileName: _jsxFileName,
505
+ lineNumber: 291,
506
+ columnNumber: 18
507
+ }, this);
375
508
  },
376
509
  renderInline: (r) => {
377
510
  const s = itemSchemaFor(field, r.item);
378
- if (mode === "dialog" && Nested) return /* @__PURE__ */ jsx(Nested, {
511
+ if (mode === "dialog" && Nested) return /* @__PURE__ */ jsxDEV(Nested, {
379
512
  fields: s?.fields ?? [],
380
513
  title: r.preview.title,
381
514
  icon: s?.icon,
382
515
  path: r.path,
383
516
  navRef: dialogNav
384
- });
517
+ }, void 0, false, {
518
+ fileName: _jsxFileName,
519
+ lineNumber: 296,
520
+ columnNumber: 51
521
+ }, this);
385
522
  const tf = rowToggleField(s);
386
- return /* @__PURE__ */ jsx(FieldList, {
523
+ return /* @__PURE__ */ jsxDEV(FieldList, {
387
524
  fields: (s?.fields ?? []).filter((f) => f !== tf),
388
525
  basePath: r.path,
389
526
  memoryKey: `inl:${pathKey(r.path)}`
390
- });
527
+ }, void 0, false, {
528
+ fileName: _jsxFileName,
529
+ lineNumber: 299,
530
+ columnNumber: 18
531
+ }, this);
391
532
  },
392
533
  emptyLabel: `No ${plural(itemNoun(field))} yet.`,
393
- addButton: /* @__PURE__ */ jsx(AddItemButton, {
534
+ addButton: /* @__PURE__ */ jsxDEV(AddItemButton, {
394
535
  field,
395
536
  disabled: readOnly || field.validation?.max != null && list.length >= field.validation.max,
396
537
  onAdd: ops.add
397
- })
398
- })
399
- });
538
+ }, void 0, false, {
539
+ fileName: _jsxFileName,
540
+ lineNumber: 302,
541
+ columnNumber: 20
542
+ }, this)
543
+ }, void 0, false, {
544
+ fileName: _jsxFileName,
545
+ lineNumber: 272,
546
+ columnNumber: 7
547
+ }, this)
548
+ }, void 0, false, {
549
+ fileName: _jsxFileName,
550
+ lineNumber: 271,
551
+ columnNumber: 5
552
+ }, this);
400
553
  }
401
554
  /** Shared list operations (arrays and slots). Remove shows an Undo toast; add can drill into the new item. */
402
555
  function useListOps(field, _path, list, write, afterAdd) {
@@ -457,50 +610,106 @@ function useListOps(field, _path, list, write, afterAdd) {
457
610
  function AddItemButton({ field, onAdd, disabled }) {
458
611
  const of = itemSchemas(field);
459
612
  const noun = itemNoun(field);
460
- if (of.length <= 1) return /* @__PURE__ */ jsxs(Button, {
613
+ if (of.length <= 1) return /* @__PURE__ */ jsxDEV(Button, {
461
614
  size: "sm",
462
615
  variant: "ghost",
463
616
  className: "text-kit-fg-2",
464
- leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
617
+ leftIcon: /* @__PURE__ */ jsxDEV(IconPlus, { stroke: 1.5 }, void 0, false, {
618
+ fileName: _jsxFileName,
619
+ lineNumber: 352,
620
+ columnNumber: 77
621
+ }, this),
465
622
  disabled,
466
623
  onClick: () => of[0] && onAdd(newItem(field, of[0])),
467
624
  children: ["Add ", noun]
468
- });
469
- if (of.length > 6) return /* @__PURE__ */ jsx(AddItemSearch, {
625
+ }, void 0, true, {
626
+ fileName: _jsxFileName,
627
+ lineNumber: 352,
628
+ columnNumber: 7
629
+ }, this);
630
+ if (of.length > 6) return /* @__PURE__ */ jsxDEV(AddItemSearch, {
470
631
  field,
471
632
  of,
472
633
  noun,
473
634
  onAdd,
474
635
  disabled
475
- });
476
- return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
477
- render: /* @__PURE__ */ jsx(Button, {
636
+ }, void 0, false, {
637
+ fileName: _jsxFileName,
638
+ lineNumber: 356,
639
+ columnNumber: 41
640
+ }, this);
641
+ return /* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
642
+ render: /* @__PURE__ */ jsxDEV(Button, {
478
643
  size: "sm",
479
644
  variant: "ghost",
480
645
  className: "text-kit-fg-2",
481
- leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
646
+ leftIcon: /* @__PURE__ */ jsxDEV(IconPlus, { stroke: 1.5 }, void 0, false, {
647
+ fileName: _jsxFileName,
648
+ lineNumber: 359,
649
+ columnNumber: 98
650
+ }, this),
482
651
  disabled
483
- }),
652
+ }, void 0, false, {
653
+ fileName: _jsxFileName,
654
+ lineNumber: 359,
655
+ columnNumber: 28
656
+ }, this),
484
657
  children: ["Add ", noun]
485
- }), /* @__PURE__ */ jsxs(MenuContent, {
658
+ }, void 0, true, {
659
+ fileName: _jsxFileName,
660
+ lineNumber: 359,
661
+ columnNumber: 7
662
+ }, this), /* @__PURE__ */ jsxDEV(MenuContent, {
486
663
  align: "start",
487
664
  className: "w-64",
488
- children: [/* @__PURE__ */ jsxs(MenuLabel, { children: ["Add to ", field.title.toLowerCase()] }), of.map((s) => /* @__PURE__ */ jsx(MenuItem, {
489
- icon: /* @__PURE__ */ jsx(KitIcon, {
665
+ children: [/* @__PURE__ */ jsxDEV(MenuLabel, { children: ["Add to ", field.title.toLowerCase()] }, void 0, true, {
666
+ fileName: _jsxFileName,
667
+ lineNumber: 361,
668
+ columnNumber: 9
669
+ }, this), of.map((s) => /* @__PURE__ */ jsxDEV(MenuItem, {
670
+ icon: /* @__PURE__ */ jsxDEV(KitIcon, {
490
671
  name: s.icon,
491
672
  fallback: "list"
492
- }),
673
+ }, void 0, false, {
674
+ fileName: _jsxFileName,
675
+ lineNumber: 363,
676
+ columnNumber: 40
677
+ }, this),
493
678
  onClick: () => onAdd(newItem(field, s)),
494
679
  className: "h-auto py-1.5",
495
- children: /* @__PURE__ */ jsxs("span", {
680
+ children: /* @__PURE__ */ jsxDEV("span", {
496
681
  className: "flex flex-col",
497
- children: [/* @__PURE__ */ jsx("span", { children: s.title }), s.description ? /* @__PURE__ */ jsx("span", {
682
+ children: [/* @__PURE__ */ jsxDEV("span", { children: s.title }, void 0, false, {
683
+ fileName: _jsxFileName,
684
+ lineNumber: 365,
685
+ columnNumber: 15
686
+ }, this), s.description ? /* @__PURE__ */ jsxDEV("span", {
498
687
  className: "whitespace-normal text-kit-xs text-kit-fg-3",
499
688
  children: s.description
500
- }) : null]
501
- })
502
- }, s.name))]
503
- })] });
689
+ }, void 0, false, {
690
+ fileName: _jsxFileName,
691
+ lineNumber: 366,
692
+ columnNumber: 32
693
+ }, this) : null]
694
+ }, void 0, true, {
695
+ fileName: _jsxFileName,
696
+ lineNumber: 364,
697
+ columnNumber: 13
698
+ }, this)
699
+ }, s.name, false, {
700
+ fileName: _jsxFileName,
701
+ lineNumber: 363,
702
+ columnNumber: 11
703
+ }, this))]
704
+ }, void 0, true, {
705
+ fileName: _jsxFileName,
706
+ lineNumber: 360,
707
+ columnNumber: 7
708
+ }, this)] }, void 0, true, {
709
+ fileName: _jsxFileName,
710
+ lineNumber: 358,
711
+ columnNumber: 5
712
+ }, this);
504
713
  }
505
714
  /** More item types than this and the Add menu becomes a searchable list (the dashboard's Add field picker does the same). */
506
715
  var ADD_SEARCH_AT = 6;
@@ -526,29 +735,45 @@ function AddItemSearch({ field, of, noun, onAdd, disabled }) {
526
735
  reset(false);
527
736
  };
528
737
  const label = `Search ${field.title.toLowerCase()} types`;
529
- return /* @__PURE__ */ jsxs(Popover, {
738
+ return /* @__PURE__ */ jsxDEV(Popover, {
530
739
  open,
531
740
  onOpenChange: reset,
532
- children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
533
- render: /* @__PURE__ */ jsx(Button, {
741
+ children: [/* @__PURE__ */ jsxDEV(PopoverTrigger, {
742
+ render: /* @__PURE__ */ jsxDEV(Button, {
534
743
  size: "sm",
535
744
  variant: "ghost",
536
745
  className: "text-kit-fg-2",
537
- leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
746
+ leftIcon: /* @__PURE__ */ jsxDEV(IconPlus, { stroke: 1.5 }, void 0, false, {
747
+ fileName: _jsxFileName,
748
+ lineNumber: 402,
749
+ columnNumber: 101
750
+ }, this),
538
751
  disabled
539
- }),
752
+ }, void 0, false, {
753
+ fileName: _jsxFileName,
754
+ lineNumber: 402,
755
+ columnNumber: 31
756
+ }, this),
540
757
  children: ["Add ", noun]
541
- }), /* @__PURE__ */ jsxs(PopoverContent, {
758
+ }, void 0, true, {
759
+ fileName: _jsxFileName,
760
+ lineNumber: 402,
761
+ columnNumber: 7
762
+ }, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
542
763
  className: "w-72 p-0",
543
764
  align: "start",
544
765
  "aria-label": `Add to ${field.title.toLowerCase()}`,
545
- children: [/* @__PURE__ */ jsxs("label", {
766
+ children: [/* @__PURE__ */ jsxDEV("label", {
546
767
  className: "flex h-10 items-center gap-2 border-b border-kit-line px-3 text-kit-fg-3",
547
- children: [/* @__PURE__ */ jsx(IconSearch, {
768
+ children: [/* @__PURE__ */ jsxDEV(IconSearch, {
548
769
  className: "size-4 shrink-0",
549
770
  stroke: 1.5,
550
771
  "aria-hidden": true
551
- }), /* @__PURE__ */ jsx("input", {
772
+ }, void 0, false, {
773
+ fileName: _jsxFileName,
774
+ lineNumber: 405,
775
+ columnNumber: 11
776
+ }, this), /* @__PURE__ */ jsxDEV("input", {
552
777
  autoFocus: true,
553
778
  value: q,
554
779
  onChange: (e) => {
@@ -575,17 +800,29 @@ function AddItemSearch({ field, of, noun, onAdd, disabled }) {
575
800
  "aria-controls": listId,
576
801
  "aria-activedescendant": shown.length ? optionId(at) : void 0,
577
802
  className: "h-full min-w-0 flex-1 bg-transparent text-kit-sm text-kit-fg outline-none placeholder:text-kit-fg-3"
578
- })]
579
- }), /* @__PURE__ */ jsxs("div", {
803
+ }, void 0, false, {
804
+ fileName: _jsxFileName,
805
+ lineNumber: 406,
806
+ columnNumber: 11
807
+ }, this)]
808
+ }, void 0, true, {
809
+ fileName: _jsxFileName,
810
+ lineNumber: 404,
811
+ columnNumber: 9
812
+ }, this), /* @__PURE__ */ jsxDEV("div", {
580
813
  id: listId,
581
814
  role: "listbox",
582
815
  "aria-label": `${field.title} types`,
583
816
  className: "max-h-80 overflow-y-auto p-1",
584
- children: [shown.length === 0 ? /* @__PURE__ */ jsx("p", {
817
+ children: [shown.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
585
818
  role: "status",
586
819
  className: "px-3 py-6 text-center text-kit-sm text-kit-fg-3",
587
820
  children: "No matches"
588
- }) : null, shown.map((s, i) => /* @__PURE__ */ jsxs("div", {
821
+ }, void 0, false, {
822
+ fileName: _jsxFileName,
823
+ lineNumber: 437,
824
+ columnNumber: 13
825
+ }, this) : null, shown.map((s, i) => /* @__PURE__ */ jsxDEV("div", {
589
826
  id: optionId(i),
590
827
  role: "option",
591
828
  "aria-selected": i === at,
@@ -593,21 +830,53 @@ function AddItemSearch({ field, of, noun, onAdd, disabled }) {
593
830
  onMouseDown: (e) => e.preventDefault(),
594
831
  onClick: () => pick(s),
595
832
  className: cn("flex w-full cursor-pointer items-center gap-2.5 rounded-kit-md px-2 py-1.5 text-left text-kit-sm text-kit-fg", i === at && "bg-kit-hover"),
596
- children: [/* @__PURE__ */ jsx(KitIcon, {
833
+ children: [/* @__PURE__ */ jsxDEV(KitIcon, {
597
834
  name: s.icon,
598
835
  fallback: "list",
599
836
  className: "size-4 shrink-0 text-kit-fg-2"
600
- }), /* @__PURE__ */ jsxs("span", {
837
+ }, void 0, false, {
838
+ fileName: _jsxFileName,
839
+ lineNumber: 452,
840
+ columnNumber: 15
841
+ }, this), /* @__PURE__ */ jsxDEV("span", {
601
842
  className: "flex min-w-0 flex-col",
602
- children: [/* @__PURE__ */ jsx("span", { children: s.title }), s.description ? /* @__PURE__ */ jsx("span", {
843
+ children: [/* @__PURE__ */ jsxDEV("span", { children: s.title }, void 0, false, {
844
+ fileName: _jsxFileName,
845
+ lineNumber: 454,
846
+ columnNumber: 17
847
+ }, this), s.description ? /* @__PURE__ */ jsxDEV("span", {
603
848
  className: "whitespace-normal text-kit-xs text-kit-fg-3",
604
849
  children: s.description
605
- }) : null]
606
- })]
607
- }, s.name))]
608
- })]
609
- })]
610
- });
850
+ }, void 0, false, {
851
+ fileName: _jsxFileName,
852
+ lineNumber: 455,
853
+ columnNumber: 34
854
+ }, this) : null]
855
+ }, void 0, true, {
856
+ fileName: _jsxFileName,
857
+ lineNumber: 453,
858
+ columnNumber: 15
859
+ }, this)]
860
+ }, s.name, true, {
861
+ fileName: _jsxFileName,
862
+ lineNumber: 442,
863
+ columnNumber: 13
864
+ }, this))]
865
+ }, void 0, true, {
866
+ fileName: _jsxFileName,
867
+ lineNumber: 435,
868
+ columnNumber: 9
869
+ }, this)]
870
+ }, void 0, true, {
871
+ fileName: _jsxFileName,
872
+ lineNumber: 403,
873
+ columnNumber: 7
874
+ }, this)]
875
+ }, void 0, true, {
876
+ fileName: _jsxFileName,
877
+ lineNumber: 401,
878
+ columnNumber: 5
879
+ }, this);
611
880
  }
612
881
  /** The row list used by arrays AND slots. Without `onOpen` the rows are inert (a drill nothing can draw yet). */
613
882
  function RowList({ field, rows, readOnly, layout, mode, openId, onOpen, onCloseInline, ops, renderInline, emptyLabel, addButton, leading, rowToggle, dialogNav, menuExtra }) {
@@ -617,21 +886,29 @@ function RowList({ field, rows, readOnly, layout, mode, openId, onOpen, onCloseI
617
886
  distance: 5
618
887
  });
619
888
  const openRow = rows.find((r) => r.id === openId);
620
- if (rows.length === 0) return /* @__PURE__ */ jsxs("div", {
889
+ if (rows.length === 0) return /* @__PURE__ */ jsxDEV("div", {
621
890
  className: "flex flex-col items-center gap-2 rounded-kit-lg border border-dashed border-kit-line-strong px-4 py-5 text-center",
622
- children: [/* @__PURE__ */ jsx("span", {
891
+ children: [/* @__PURE__ */ jsxDEV("span", {
623
892
  className: "text-kit-sm text-kit-fg-3",
624
893
  children: emptyLabel
625
- }), readOnly ? null : addButton]
626
- });
627
- return /* @__PURE__ */ jsxs("div", {
894
+ }, void 0, false, {
895
+ fileName: _jsxFileName,
896
+ lineNumber: 508,
897
+ columnNumber: 9
898
+ }, this), readOnly ? null : addButton]
899
+ }, void 0, true, {
900
+ fileName: _jsxFileName,
901
+ lineNumber: 507,
902
+ columnNumber: 7
903
+ }, this);
904
+ return /* @__PURE__ */ jsxDEV("div", {
628
905
  className: "flex flex-col gap-1.5",
629
906
  children: [
630
- /* @__PURE__ */ jsx("div", {
907
+ /* @__PURE__ */ jsxDEV("div", {
631
908
  className: cn(layout === "grid" ? "grid grid-cols-2 gap-1.5 @[520px]:grid-cols-3" : "overflow-hidden rounded-kit-lg border border-kit-line bg-kit-surface"),
632
- children: /* @__PURE__ */ jsx(AnimatePresence, {
909
+ children: /* @__PURE__ */ jsxDEV(AnimatePresence, {
633
910
  initial: false,
634
- children: rows.map((r) => /* @__PURE__ */ jsx(Row, {
911
+ children: rows.map((r) => /* @__PURE__ */ jsxDEV(Row, {
635
912
  r,
636
913
  count: rows.length,
637
914
  field,
@@ -648,45 +925,93 @@ function RowList({ field, rows, readOnly, layout, mode, openId, onOpen, onCloseI
648
925
  inline: mode === "inline" && openId === r.id ? renderInline(r) : null,
649
926
  popover: mode === "popover" && openId === r.id ? renderInline(r) : null,
650
927
  onClosePopover: onCloseInline
651
- }, r.id))
652
- })
653
- }),
928
+ }, r.id, false, {
929
+ fileName: _jsxFileName,
930
+ lineNumber: 517,
931
+ columnNumber: 13
932
+ }, this))
933
+ }, void 0, false, {
934
+ fileName: _jsxFileName,
935
+ lineNumber: 515,
936
+ columnNumber: 9
937
+ }, this)
938
+ }, void 0, false, {
939
+ fileName: _jsxFileName,
940
+ lineNumber: 514,
941
+ columnNumber: 7
942
+ }, this),
654
943
  sort.a11y,
655
- readOnly ? null : /* @__PURE__ */ jsx("div", {
944
+ readOnly ? null : /* @__PURE__ */ jsxDEV("div", {
656
945
  className: "flex items-center",
657
946
  children: addButton
658
- }),
659
- mode === "dialog" && openRow ? /* @__PURE__ */ jsx(Modal, {
947
+ }, void 0, false, {
948
+ fileName: _jsxFileName,
949
+ lineNumber: 540,
950
+ columnNumber: 26
951
+ }, this),
952
+ mode === "dialog" && openRow ? /* @__PURE__ */ jsxDEV(Modal, {
660
953
  open: true,
661
954
  onOpenChange: (o, d) => {
662
955
  if (o) return;
663
956
  if (d.reason === "escape-key" && dialogNav?.current?.back()) return d.cancel();
664
957
  onCloseInline();
665
958
  },
666
- children: /* @__PURE__ */ jsxs(ModalContent, {
959
+ children: /* @__PURE__ */ jsxDEV(ModalContent, {
667
960
  size: "lg",
668
961
  children: [
669
- /* @__PURE__ */ jsx(ModalHeader, {
962
+ /* @__PURE__ */ jsxDEV(ModalHeader, {
670
963
  title: openRow.preview.title,
671
964
  description: `${field.title} · ${openRow.index + 1} of ${rows.length}`
672
- }),
673
- /* @__PURE__ */ jsx(ModalBody, {
965
+ }, void 0, false, {
966
+ fileName: _jsxFileName,
967
+ lineNumber: 552,
968
+ columnNumber: 13
969
+ }, this),
970
+ /* @__PURE__ */ jsxDEV(ModalBody, {
674
971
  className: "flex min-h-[320px] flex-col gap-5",
675
972
  children: renderInline(openRow)
676
- }),
677
- /* @__PURE__ */ jsxs(ModalFooter, { children: [/* @__PURE__ */ jsx("span", {
973
+ }, void 0, false, {
974
+ fileName: _jsxFileName,
975
+ lineNumber: 553,
976
+ columnNumber: 13
977
+ }, this),
978
+ /* @__PURE__ */ jsxDEV(ModalFooter, { children: [/* @__PURE__ */ jsxDEV("span", {
678
979
  className: "mr-auto text-kit-xs text-kit-fg-3",
679
980
  children: "Changes save as you type"
680
- }), /* @__PURE__ */ jsx(Button, {
981
+ }, void 0, false, {
982
+ fileName: _jsxFileName,
983
+ lineNumber: 555,
984
+ columnNumber: 15
985
+ }, this), /* @__PURE__ */ jsxDEV(Button, {
681
986
  variant: "primary",
682
987
  onClick: onCloseInline,
683
988
  children: "Done"
684
- })] })
989
+ }, void 0, false, {
990
+ fileName: _jsxFileName,
991
+ lineNumber: 556,
992
+ columnNumber: 15
993
+ }, this)] }, void 0, true, {
994
+ fileName: _jsxFileName,
995
+ lineNumber: 554,
996
+ columnNumber: 13
997
+ }, this)
685
998
  ]
686
- })
687
- }) : null
999
+ }, void 0, true, {
1000
+ fileName: _jsxFileName,
1001
+ lineNumber: 551,
1002
+ columnNumber: 11
1003
+ }, this)
1004
+ }, void 0, false, {
1005
+ fileName: _jsxFileName,
1006
+ lineNumber: 542,
1007
+ columnNumber: 9
1008
+ }, this) : null
688
1009
  ]
689
- });
1010
+ }, void 0, true, {
1011
+ fileName: _jsxFileName,
1012
+ lineNumber: 513,
1013
+ columnNumber: 5
1014
+ }, this);
690
1015
  }
691
1016
  function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, leading, toggle, extra, inline, popover, onClosePopover }) {
692
1017
  const form = useForm();
@@ -702,100 +1027,269 @@ function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, l
702
1027
  };
703
1028
  const peers = Object.entries(env.presence).filter(([k]) => k === pathKey(r.path) || k.startsWith(`${pathKey(r.path)}.`)).flatMap(([, p]) => p);
704
1029
  const nChanged = env.review?.count(r.path) ?? 0;
705
- const changeBar = nChanged ? /* @__PURE__ */ jsx("span", {
1030
+ const changeBar = nChanged ? /* @__PURE__ */ jsxDEV("span", {
706
1031
  "aria-hidden": true,
707
1032
  className: "pointer-events-none absolute inset-y-1.5 left-0 z-[1] w-0.5 rounded-full",
708
1033
  style: { background: env.review.color(r.path) ?? "var(--kit-warning)" }
709
- }) : null;
1034
+ }, void 0, false, {
1035
+ fileName: _jsxFileName,
1036
+ lineNumber: 585,
1037
+ columnNumber: 32
1038
+ }, this) : null;
710
1039
  const changedNote = nChanged ? `${nChanged} changed` : "";
711
- const menu = readOnly ? null : /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
1040
+ const menuShell = React.useRef(null);
1041
+ const focusPlan = React.useRef(null);
1042
+ const rowButtons = (shell) => [...shell.querySelectorAll("[data-row-open]")].filter((b) => b.closest("[data-slot=\"kit-field\"]") === shell);
1043
+ const plan = (pick) => {
1044
+ const shell = menuShell.current;
1045
+ focusPlan.current = shell ? {
1046
+ was: rowButtons(shell).map((b) => b.dataset.rowOpen ?? ""),
1047
+ pick
1048
+ } : null;
1049
+ };
1050
+ const focusNewRow = () => plan((was, now) => now.find((b) => !was.includes(b.dataset.rowOpen ?? "")));
1051
+ const focusNeighbour = () => plan((was, now) => {
1052
+ const at = was.indexOf(String(r.id));
1053
+ for (const id of [was[at + 1], was[at - 1]]) {
1054
+ const b = id ? now.find((x) => x.dataset.rowOpen === id) : void 0;
1055
+ if (b) return b;
1056
+ }
1057
+ return now.length ? void 0 : [...menuShell.current?.querySelectorAll("button") ?? []].find((b) => /^Add /.test(b.textContent?.trim() ?? ""));
1058
+ });
1059
+ const landFocus = () => {
1060
+ const p = focusPlan.current;
1061
+ const shell = menuShell.current;
1062
+ focusPlan.current = null;
1063
+ if (!p || !shell || !p.was.length) return true;
1064
+ let tries = 0;
1065
+ const go = () => {
1066
+ const el = p.pick(p.was, rowButtons(shell));
1067
+ if (el) el.focus();
1068
+ else if (tries++ < 10) requestAnimationFrame(go);
1069
+ };
1070
+ requestAnimationFrame(go);
1071
+ return false;
1072
+ };
1073
+ const menu = readOnly ? null : /* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
712
1074
  "aria-label": `${r.preview.title} actions`,
713
- onClick: (e) => e.stopPropagation(),
1075
+ onClick: (e) => {
1076
+ e.stopPropagation();
1077
+ menuShell.current = e.currentTarget.closest("[data-slot=\"kit-field\"]");
1078
+ },
714
1079
  className: "flex size-7 shrink-0 items-center justify-center rounded-kit-md text-kit-fg-3 hover:bg-kit-hover hover:text-kit-fg data-[popup-open]:bg-kit-hover data-[popup-open]:text-kit-fg",
715
- children: /* @__PURE__ */ jsx(IconDots, {
1080
+ children: /* @__PURE__ */ jsxDEV(IconDots, {
716
1081
  className: "size-4",
717
1082
  stroke: 1.5
718
- })
719
- }), /* @__PURE__ */ jsxs(MenuContent, {
1083
+ }, void 0, false, {
1084
+ fileName: _jsxFileName,
1085
+ lineNumber: 634,
1086
+ columnNumber: 9
1087
+ }, this)
1088
+ }, void 0, false, {
1089
+ fileName: _jsxFileName,
1090
+ lineNumber: 626,
1091
+ columnNumber: 7
1092
+ }, this), /* @__PURE__ */ jsxDEV(MenuContent, {
720
1093
  align: "end",
721
1094
  className: "w-52",
1095
+ finalFocus: landFocus,
722
1096
  children: [
723
- /* @__PURE__ */ jsx(MenuItem, {
724
- icon: /* @__PURE__ */ jsx(IconArrowUp, { stroke: 1.5 }),
1097
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1098
+ icon: /* @__PURE__ */ jsxDEV(IconArrowUp, { stroke: 1.5 }, void 0, false, {
1099
+ fileName: _jsxFileName,
1100
+ lineNumber: 637,
1101
+ columnNumber: 25
1102
+ }, this),
725
1103
  disabled: !!field.orderLocked || r.index === 0,
726
1104
  onClick: () => ops.move(r.index, -1),
727
1105
  children: "Move up"
728
- }),
729
- /* @__PURE__ */ jsx(MenuItem, {
730
- icon: /* @__PURE__ */ jsx(IconArrowDown, { stroke: 1.5 }),
1106
+ }, void 0, false, {
1107
+ fileName: _jsxFileName,
1108
+ lineNumber: 637,
1109
+ columnNumber: 9
1110
+ }, this),
1111
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1112
+ icon: /* @__PURE__ */ jsxDEV(IconArrowDown, { stroke: 1.5 }, void 0, false, {
1113
+ fileName: _jsxFileName,
1114
+ lineNumber: 638,
1115
+ columnNumber: 25
1116
+ }, this),
731
1117
  disabled: !!field.orderLocked || r.index === count - 1,
732
1118
  onClick: () => ops.move(r.index, 1),
733
1119
  children: "Move down"
734
- }),
735
- /* @__PURE__ */ jsx(MenuSeparator, {}),
736
- /* @__PURE__ */ jsx(MenuItem, {
737
- icon: /* @__PURE__ */ jsx(IconCopy, { stroke: 1.5 }),
1120
+ }, void 0, false, {
1121
+ fileName: _jsxFileName,
1122
+ lineNumber: 638,
1123
+ columnNumber: 9
1124
+ }, this),
1125
+ /* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
1126
+ fileName: _jsxFileName,
1127
+ lineNumber: 639,
1128
+ columnNumber: 9
1129
+ }, this),
1130
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1131
+ icon: /* @__PURE__ */ jsxDEV(IconCopy, { stroke: 1.5 }, void 0, false, {
1132
+ fileName: _jsxFileName,
1133
+ lineNumber: 640,
1134
+ columnNumber: 25
1135
+ }, this),
738
1136
  disabled: ops.atMax,
739
- onClick: () => ops.duplicate(r.index),
1137
+ onClick: () => {
1138
+ focusNewRow();
1139
+ ops.duplicate(r.index);
1140
+ },
740
1141
  children: ops.atMax ? "Duplicate · limit reached" : "Duplicate"
741
- }),
742
- field.type === "array" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItem, {
743
- icon: /* @__PURE__ */ jsx(IconRowInsertTop, { stroke: 1.5 }),
1142
+ }, void 0, false, {
1143
+ fileName: _jsxFileName,
1144
+ lineNumber: 640,
1145
+ columnNumber: 9
1146
+ }, this),
1147
+ field.type === "array" ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV(MenuItem, {
1148
+ icon: /* @__PURE__ */ jsxDEV(IconRowInsertTop, { stroke: 1.5 }, void 0, false, {
1149
+ fileName: _jsxFileName,
1150
+ lineNumber: 643,
1151
+ columnNumber: 29
1152
+ }, this),
744
1153
  disabled: ops.atMax,
745
- onClick: () => ops.insertBlank(r.index),
1154
+ onClick: () => {
1155
+ focusNewRow();
1156
+ ops.insertBlank(r.index);
1157
+ },
746
1158
  children: "Add item above"
747
- }), /* @__PURE__ */ jsx(MenuItem, {
748
- icon: /* @__PURE__ */ jsx(IconRowInsertBottom, { stroke: 1.5 }),
1159
+ }, void 0, false, {
1160
+ fileName: _jsxFileName,
1161
+ lineNumber: 643,
1162
+ columnNumber: 13
1163
+ }, this), /* @__PURE__ */ jsxDEV(MenuItem, {
1164
+ icon: /* @__PURE__ */ jsxDEV(IconRowInsertBottom, { stroke: 1.5 }, void 0, false, {
1165
+ fileName: _jsxFileName,
1166
+ lineNumber: 644,
1167
+ columnNumber: 29
1168
+ }, this),
749
1169
  disabled: ops.atMax,
750
- onClick: () => ops.insertBlank(r.index + 1),
1170
+ onClick: () => {
1171
+ focusNewRow();
1172
+ ops.insertBlank(r.index + 1);
1173
+ },
751
1174
  children: "Add item below"
752
- })] }) : null,
753
- extra ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), extra] }) : null,
754
- /* @__PURE__ */ jsx(MenuSeparator, {}),
755
- /* @__PURE__ */ jsx(MenuItem, {
1175
+ }, void 0, false, {
1176
+ fileName: _jsxFileName,
1177
+ lineNumber: 644,
1178
+ columnNumber: 13
1179
+ }, this)] }, void 0, true, {
1180
+ fileName: _jsxFileName,
1181
+ lineNumber: 642,
1182
+ columnNumber: 11
1183
+ }, this) : null,
1184
+ extra ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
1185
+ fileName: _jsxFileName,
1186
+ lineNumber: 649,
1187
+ columnNumber: 13
1188
+ }, this), extra] }, void 0, true, {
1189
+ fileName: _jsxFileName,
1190
+ lineNumber: 648,
1191
+ columnNumber: 11
1192
+ }, this) : null,
1193
+ /* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
1194
+ fileName: _jsxFileName,
1195
+ lineNumber: 653,
1196
+ columnNumber: 9
1197
+ }, this),
1198
+ /* @__PURE__ */ jsxDEV(MenuItem, {
756
1199
  danger: true,
757
- icon: /* @__PURE__ */ jsx(IconTrash, { stroke: 1.5 }),
1200
+ icon: /* @__PURE__ */ jsxDEV(IconTrash, { stroke: 1.5 }, void 0, false, {
1201
+ fileName: _jsxFileName,
1202
+ lineNumber: 654,
1203
+ columnNumber: 32
1204
+ }, this),
758
1205
  disabled: ops.atMin,
759
- onClick: () => ops.remove(r.index, r.preview.title),
1206
+ onClick: () => {
1207
+ focusNeighbour();
1208
+ ops.remove(r.index, r.preview.title);
1209
+ },
760
1210
  children: ops.atMin ? `Remove · at least ${field.validation?.min} required` : "Remove"
761
- })
1211
+ }, void 0, false, {
1212
+ fileName: _jsxFileName,
1213
+ lineNumber: 654,
1214
+ columnNumber: 9
1215
+ }, this)
762
1216
  ]
763
- })] });
764
- const grip = readOnly ? null : field.orderLocked ? /* @__PURE__ */ jsx(OrderLockSlot, { className: "h-7 items-center" }) : /* @__PURE__ */ jsx("button", {
1217
+ }, void 0, true, {
1218
+ fileName: _jsxFileName,
1219
+ lineNumber: 636,
1220
+ columnNumber: 7
1221
+ }, this)] }, void 0, true, {
1222
+ fileName: _jsxFileName,
1223
+ lineNumber: 625,
1224
+ columnNumber: 5
1225
+ }, this);
1226
+ const grip = readOnly ? null : field.orderLocked ? /* @__PURE__ */ jsxDEV(OrderLockSlot, { className: "h-7 items-center" }, void 0, false, {
1227
+ fileName: _jsxFileName,
1228
+ lineNumber: 659,
1229
+ columnNumber: 5
1230
+ }, this) : /* @__PURE__ */ jsxDEV("button", {
765
1231
  type: "button",
766
1232
  "aria-label": `Reorder ${r.preview.title}`,
767
1233
  onClick: (e) => e.stopPropagation(),
768
1234
  ...sort.handle(r.id),
769
1235
  className: "relative flex h-7 w-4 shrink-0 cursor-grab touch-none items-center justify-center text-kit-fg-4 transition-colors before:absolute before:-inset-2 hover:text-kit-fg-2 active:cursor-grabbing",
770
- children: /* @__PURE__ */ jsx(IconGripVertical, {
1236
+ children: /* @__PURE__ */ jsxDEV(IconGripVertical, {
771
1237
  className: "size-3.5",
772
1238
  stroke: 1.5
773
- })
774
- });
1239
+ }, void 0, false, {
1240
+ fileName: _jsxFileName,
1241
+ lineNumber: 668,
1242
+ columnNumber: 7
1243
+ }, this)
1244
+ }, void 0, false, {
1245
+ fileName: _jsxFileName,
1246
+ lineNumber: 661,
1247
+ columnNumber: 5
1248
+ }, this);
775
1249
  if (grid) {
776
- const tile = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
1250
+ const tile = /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("span", {
777
1251
  "data-fit": r.preview.media ? tileFit.fit : void 0,
778
1252
  className: cn("flex aspect-[4/3] items-center justify-center", r.preview.media && tileFit.fit === "contain" ? CHECKER : "bg-kit-muted"),
779
- children: r.preview.media ? /* @__PURE__ */ jsx("img", {
1253
+ children: r.preview.media ? /* @__PURE__ */ jsxDEV("img", {
780
1254
  src: mediaSrc ? mediaSrc(r.preview.media) : r.preview.media,
781
1255
  alt: "",
782
1256
  ref: tileFit.ref,
783
1257
  onLoad: tileFit.onLoad,
784
1258
  className: tileFit.fit === "contain" ? "size-full object-contain" : "size-full object-cover"
785
- }) : /* @__PURE__ */ jsx(KitIcon, {
1259
+ }, void 0, false, {
1260
+ fileName: _jsxFileName,
1261
+ lineNumber: 677,
1262
+ columnNumber: 13
1263
+ }, this) : /* @__PURE__ */ jsxDEV(KitIcon, {
786
1264
  name: r.preview.icon ?? field.icon,
787
1265
  fallback: "list",
788
1266
  className: "size-5 text-kit-fg-3"
789
- })
790
- }), /* @__PURE__ */ jsx("span", {
1267
+ }, void 0, false, {
1268
+ fileName: _jsxFileName,
1269
+ lineNumber: 679,
1270
+ columnNumber: 13
1271
+ }, this)
1272
+ }, void 0, false, {
1273
+ fileName: _jsxFileName,
1274
+ lineNumber: 675,
1275
+ columnNumber: 9
1276
+ }, this), /* @__PURE__ */ jsxDEV("span", {
791
1277
  className: "block truncate px-2 pb-1.5 pt-1.5 text-kit-xs font-medium text-kit-fg",
792
1278
  children: r.preview.title
793
- })] });
794
- return /* @__PURE__ */ jsx("div", {
1279
+ }, void 0, false, {
1280
+ fileName: _jsxFileName,
1281
+ lineNumber: 682,
1282
+ columnNumber: 9
1283
+ }, this)] }, void 0, true, {
1284
+ fileName: _jsxFileName,
1285
+ lineNumber: 673,
1286
+ columnNumber: 7
1287
+ }, this);
1288
+ return /* @__PURE__ */ jsxDEV("div", {
795
1289
  ref: sort.register(r.id),
796
1290
  style: sort.style(r.id),
797
1291
  className: cn("relative", isDragging && "z-10"),
798
- children: /* @__PURE__ */ jsxs(motion.div, {
1292
+ children: /* @__PURE__ */ jsxDEV(motion.div, {
799
1293
  layout: !isDragging ? "position" : false,
800
1294
  initial: {
801
1295
  opacity: 0,
@@ -811,72 +1305,140 @@ function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, l
811
1305
  },
812
1306
  className: cn("group/row relative overflow-hidden rounded-kit-lg border border-kit-line bg-kit-surface transition-colors hover:border-kit-line-strong", isDragging && "shadow-kit-lg"),
813
1307
  children: [
814
- onOpen ? /* @__PURE__ */ jsx("button", {
1308
+ onOpen ? /* @__PURE__ */ jsxDEV("button", {
815
1309
  type: "button",
816
1310
  onClick: onOpen,
817
1311
  "aria-label": `Open ${r.preview.title}, ${r.index + 1} of ${count}`,
818
1312
  "aria-haspopup": mode === "popover" || mode === "dialog" ? "dialog" : void 0,
819
1313
  className: "block w-full text-left",
820
1314
  children: tile
821
- }) : /* @__PURE__ */ jsx("div", {
1315
+ }, void 0, false, {
1316
+ fileName: _jsxFileName,
1317
+ lineNumber: 695,
1318
+ columnNumber: 13
1319
+ }, this) : /* @__PURE__ */ jsxDEV("div", {
822
1320
  className: "block w-full text-left",
823
1321
  children: tile
824
- }),
825
- /* @__PURE__ */ jsxs("div", {
1322
+ }, void 0, false, {
1323
+ fileName: _jsxFileName,
1324
+ lineNumber: 699,
1325
+ columnNumber: 13
1326
+ }, this),
1327
+ /* @__PURE__ */ jsxDEV("div", {
826
1328
  className: "absolute right-1 top-1 flex items-center gap-0.5 rounded-kit-md bg-kit-surface/90 opacity-0 shadow-kit-xs transition-opacity group-hover/row:opacity-100 [@media(pointer:coarse)]:opacity-100",
827
1329
  children: [grip, menu]
828
- }),
829
- /* @__PURE__ */ jsx(IssueDot, {
1330
+ }, void 0, true, {
1331
+ fileName: _jsxFileName,
1332
+ lineNumber: 701,
1333
+ columnNumber: 11
1334
+ }, this),
1335
+ /* @__PURE__ */ jsxDEV(IssueDot, {
830
1336
  errors: roll.errors,
831
1337
  warnings: roll.warnings,
832
1338
  className: "absolute left-2 top-2 ring-2 ring-kit-surface"
833
- }),
1339
+ }, void 0, false, {
1340
+ fileName: _jsxFileName,
1341
+ lineNumber: 705,
1342
+ columnNumber: 11
1343
+ }, this),
834
1344
  changeBar
835
1345
  ]
836
- })
837
- });
1346
+ }, void 0, true, {
1347
+ fileName: _jsxFileName,
1348
+ lineNumber: 687,
1349
+ columnNumber: 9
1350
+ }, this)
1351
+ }, void 0, false, {
1352
+ fileName: _jsxFileName,
1353
+ lineNumber: 686,
1354
+ columnNumber: 7
1355
+ }, this);
838
1356
  }
839
1357
  const inlineMode = mode === "inline";
840
1358
  const bodyId = `${uid}${r.id}-body`;
841
1359
  const verb = inlineMode ? open ? "Collapse" : "Expand" : "Open";
842
- const trailing = !onOpen ? null : inlineMode ? /* @__PURE__ */ jsx(IconChevronDown, {
1360
+ const trailing = !onOpen ? null : inlineMode ? /* @__PURE__ */ jsxDEV(IconChevronDown, {
843
1361
  "aria-hidden": true,
844
1362
  className: cn("size-4 shrink-0 text-kit-fg-3 transition-transform duration-200", open && "rotate-180 text-kit-fg-2"),
845
1363
  stroke: 1.5
846
- }) : mode === "drill" ? /* @__PURE__ */ jsx(IconChevronRight, {
1364
+ }, void 0, false, {
1365
+ fileName: _jsxFileName,
1366
+ lineNumber: 718,
1367
+ columnNumber: 5
1368
+ }, this) : mode === "drill" ? /* @__PURE__ */ jsxDEV(IconChevronRight, {
847
1369
  "aria-hidden": true,
848
1370
  className: "size-4 shrink-0 text-kit-fg-3 transition-transform duration-150 group-hover/row:translate-x-0.5",
849
1371
  stroke: 1.5
850
- }) : /* @__PURE__ */ jsx(IconArrowsDiagonal, {
1372
+ }, void 0, false, {
1373
+ fileName: _jsxFileName,
1374
+ lineNumber: 720,
1375
+ columnNumber: 5
1376
+ }, this) : /* @__PURE__ */ jsxDEV(IconArrowsDiagonal, {
851
1377
  "aria-hidden": true,
852
1378
  className: "size-3.5 shrink-0 text-kit-fg-3",
853
1379
  stroke: 1.5
854
- });
855
- const titleInner = /* @__PURE__ */ jsxs(Fragment, { children: [leading ?? (toggle && !r.preview.media ? null : /* @__PURE__ */ jsx(Thumb, {
1380
+ }, void 0, false, {
1381
+ fileName: _jsxFileName,
1382
+ lineNumber: 722,
1383
+ columnNumber: 5
1384
+ }, this);
1385
+ const titleInner = /* @__PURE__ */ jsxDEV(Fragment, { children: [leading ?? (toggle && !r.preview.media ? null : /* @__PURE__ */ jsxDEV(Thumb, {
856
1386
  media: r.preview.media,
857
1387
  fit: r.preview.mediaFit,
858
1388
  icon: r.preview.icon ?? field.icon,
859
1389
  fallback: "list"
860
- })), /* @__PURE__ */ jsxs("span", {
1390
+ }, void 0, false, {
1391
+ fileName: _jsxFileName,
1392
+ lineNumber: 726,
1393
+ columnNumber: 56
1394
+ }, this)), /* @__PURE__ */ jsxDEV("span", {
861
1395
  className: "min-w-0 flex-1",
862
- children: [/* @__PURE__ */ jsxs("span", {
1396
+ children: [/* @__PURE__ */ jsxDEV("span", {
863
1397
  className: cn("flex items-center gap-1.5 truncate text-kit-sm", r.preview.empty || r.dim ? "text-kit-fg-3" : "text-kit-fg", open && "font-medium"),
864
- children: [/* @__PURE__ */ jsx("span", {
1398
+ children: [/* @__PURE__ */ jsxDEV("span", {
865
1399
  className: "truncate",
866
1400
  children: r.preview.title
867
- }), r.chip ? /* @__PURE__ */ jsx("span", {
1401
+ }, void 0, false, {
1402
+ fileName: _jsxFileName,
1403
+ lineNumber: 729,
1404
+ columnNumber: 11
1405
+ }, this), r.chip ? /* @__PURE__ */ jsxDEV("span", {
868
1406
  className: "shrink-0 rounded-kit-md bg-kit-muted px-1 text-kit-2xs font-medium text-kit-fg-2",
869
1407
  children: r.chip
870
- }) : null]
871
- }), (r.extra ?? r.preview.subtitle) || changedNote ? /* @__PURE__ */ jsxs("span", {
1408
+ }, void 0, false, {
1409
+ fileName: _jsxFileName,
1410
+ lineNumber: 730,
1411
+ columnNumber: 21
1412
+ }, this) : null]
1413
+ }, void 0, true, {
1414
+ fileName: _jsxFileName,
1415
+ lineNumber: 728,
1416
+ columnNumber: 9
1417
+ }, this), (r.extra ?? r.preview.subtitle) || changedNote ? /* @__PURE__ */ jsxDEV("span", {
872
1418
  className: "block truncate text-kit-xs text-kit-fg-3",
873
- children: [changedNote ? /* @__PURE__ */ jsxs("span", {
1419
+ children: [changedNote ? /* @__PURE__ */ jsxDEV("span", {
874
1420
  className: "text-kit-fg-2",
875
1421
  children: [changedNote, r.extra ?? r.preview.subtitle ? " · " : ""]
876
- }) : null, r.extra ?? r.preview.subtitle]
877
- }) : null]
878
- })] });
879
- const rowInner = /* @__PURE__ */ jsxs("div", {
1422
+ }, void 0, true, {
1423
+ fileName: _jsxFileName,
1424
+ lineNumber: 735,
1425
+ columnNumber: 28
1426
+ }, this) : null, r.extra ?? r.preview.subtitle]
1427
+ }, void 0, true, {
1428
+ fileName: _jsxFileName,
1429
+ lineNumber: 734,
1430
+ columnNumber: 11
1431
+ }, this) : null]
1432
+ }, void 0, true, {
1433
+ fileName: _jsxFileName,
1434
+ lineNumber: 727,
1435
+ columnNumber: 7
1436
+ }, this)] }, void 0, true, {
1437
+ fileName: _jsxFileName,
1438
+ lineNumber: 725,
1439
+ columnNumber: 5
1440
+ }, this);
1441
+ const rowInner = /* @__PURE__ */ jsxDEV("div", {
880
1442
  onClick: (e) => {
881
1443
  const target = e.target;
882
1444
  if (!onOpen || !e.currentTarget.contains(target) || target.closest("button,[role^=menuitem],a,input")) return;
@@ -886,7 +1448,7 @@ function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, l
886
1448
  children: [
887
1449
  grip,
888
1450
  toggle,
889
- onOpen ? /* @__PURE__ */ jsx("button", {
1451
+ onOpen ? /* @__PURE__ */ jsxDEV("button", {
890
1452
  type: "button",
891
1453
  onClick: onOpen,
892
1454
  "data-row-open": r.id,
@@ -896,29 +1458,49 @@ function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, l
896
1458
  "aria-label": `${verb} ${r.preview.title}${r.chip ? `, ${r.chip}` : ""}${changedNote ? `, ${changedNote}` : ""}, ${r.index + 1} of ${count}`,
897
1459
  className: "flex min-w-0 flex-1 items-center gap-2.5 rounded-kit-md text-left outline-none",
898
1460
  children: titleInner
899
- }) : /* @__PURE__ */ jsx("div", {
1461
+ }, void 0, false, {
1462
+ fileName: _jsxFileName,
1463
+ lineNumber: 757,
1464
+ columnNumber: 9
1465
+ }, this) : /* @__PURE__ */ jsxDEV("div", {
900
1466
  "data-row-open": r.id,
901
1467
  className: "flex min-w-0 flex-1 items-center gap-2.5 text-left",
902
1468
  children: titleInner
903
- }),
904
- /* @__PURE__ */ jsx(IssueDot, {
1469
+ }, void 0, false, {
1470
+ fileName: _jsxFileName,
1471
+ lineNumber: 770,
1472
+ columnNumber: 9
1473
+ }, this),
1474
+ /* @__PURE__ */ jsxDEV(IssueDot, {
905
1475
  errors: roll.errors,
906
1476
  warnings: roll.warnings
907
- }),
908
- peers.length ? /* @__PURE__ */ jsx(PeerStack, {
1477
+ }, void 0, false, {
1478
+ fileName: _jsxFileName,
1479
+ lineNumber: 774,
1480
+ columnNumber: 7
1481
+ }, this),
1482
+ peers.length ? /* @__PURE__ */ jsxDEV(PeerStack, {
909
1483
  peers,
910
1484
  size: 16
911
- }) : null,
1485
+ }, void 0, false, {
1486
+ fileName: _jsxFileName,
1487
+ lineNumber: 775,
1488
+ columnNumber: 23
1489
+ }, this) : null,
912
1490
  menu,
913
1491
  trailing
914
1492
  ]
915
- });
916
- return /* @__PURE__ */ jsxs("div", {
1493
+ }, void 0, true, {
1494
+ fileName: _jsxFileName,
1495
+ lineNumber: 743,
1496
+ columnNumber: 5
1497
+ }, this);
1498
+ return /* @__PURE__ */ jsxDEV("div", {
917
1499
  ref: sort.register(r.id),
918
1500
  style: sort.style(r.id),
919
1501
  "data-row-id": r.id,
920
1502
  className: cn("relative border-b border-kit-line-subtle bg-kit-surface last:border-b-0", isDragging && "z-10 rounded-kit-lg shadow-kit-lg ring-1 ring-kit-line-strong"),
921
- children: [changeBar, /* @__PURE__ */ jsxs(motion.div, {
1503
+ children: [changeBar, /* @__PURE__ */ jsxDEV(motion.div, {
922
1504
  layout: !isDragging && !dragging ? "position" : false,
923
1505
  initial: dragging ? false : {
924
1506
  opacity: 0,
@@ -946,19 +1528,31 @@ function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, l
946
1528
  ]
947
1529
  },
948
1530
  className: "overflow-hidden",
949
- children: [mode === "popover" ? /* @__PURE__ */ jsxs(Popover, {
1531
+ children: [mode === "popover" ? /* @__PURE__ */ jsxDEV(Popover, {
950
1532
  open,
951
1533
  onOpenChange: (o) => !o && onClosePopover(),
952
- children: [/* @__PURE__ */ jsx(PopoverAnchor, { render: rowInner }), /* @__PURE__ */ jsx(PopoverContent, {
1534
+ children: [/* @__PURE__ */ jsxDEV(PopoverAnchor, { render: rowInner }, void 0, false, {
1535
+ fileName: _jsxFileName,
1536
+ lineNumber: 798,
1537
+ columnNumber: 13
1538
+ }, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
953
1539
  className: "w-[340px] p-4",
954
1540
  align: "end",
955
1541
  side: "left",
956
1542
  sideOffset: 10,
957
1543
  children: popover
958
- })]
959
- }) : rowInner, inlineMode ? /* @__PURE__ */ jsx(AnimatePresence, {
1544
+ }, void 0, false, {
1545
+ fileName: _jsxFileName,
1546
+ lineNumber: 799,
1547
+ columnNumber: 13
1548
+ }, this)]
1549
+ }, void 0, true, {
1550
+ fileName: _jsxFileName,
1551
+ lineNumber: 797,
1552
+ columnNumber: 11
1553
+ }, this) : rowInner, inlineMode ? /* @__PURE__ */ jsxDEV(AnimatePresence, {
960
1554
  initial: false,
961
- children: open ? /* @__PURE__ */ jsx(motion.div, {
1555
+ children: open ? /* @__PURE__ */ jsxDEV(motion.div, {
962
1556
  initial: {
963
1557
  height: 0,
964
1558
  opacity: 0
@@ -981,27 +1575,55 @@ function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, l
981
1575
  ]
982
1576
  },
983
1577
  className: "overflow-hidden",
984
- children: /* @__PURE__ */ jsx("div", {
1578
+ children: /* @__PURE__ */ jsxDEV("div", {
985
1579
  className: "px-3 pb-3 pt-1",
986
- children: /* @__PURE__ */ jsx("div", {
1580
+ children: /* @__PURE__ */ jsxDEV("div", {
987
1581
  id: bodyId,
988
1582
  role: "group",
989
1583
  "aria-label": r.preview.title,
990
1584
  "data-group": "inset",
991
1585
  className: INSET_LINE,
992
- children: /* @__PURE__ */ jsx(InsetScope, { children: inline })
993
- })
994
- })
995
- }) : null
996
- }) : null]
997
- })]
998
- });
1586
+ children: /* @__PURE__ */ jsxDEV(InsetScope, { children: inline }, void 0, false, {
1587
+ fileName: _jsxFileName,
1588
+ lineNumber: 812,
1589
+ columnNumber: 120
1590
+ }, this)
1591
+ }, void 0, false, {
1592
+ fileName: _jsxFileName,
1593
+ lineNumber: 812,
1594
+ columnNumber: 19
1595
+ }, this)
1596
+ }, void 0, false, {
1597
+ fileName: _jsxFileName,
1598
+ lineNumber: 811,
1599
+ columnNumber: 17
1600
+ }, this)
1601
+ }, void 0, false, {
1602
+ fileName: _jsxFileName,
1603
+ lineNumber: 809,
1604
+ columnNumber: 15
1605
+ }, this) : null
1606
+ }, void 0, false, {
1607
+ fileName: _jsxFileName,
1608
+ lineNumber: 807,
1609
+ columnNumber: 11
1610
+ }, this) : null]
1611
+ }, void 0, true, {
1612
+ fileName: _jsxFileName,
1613
+ lineNumber: 788,
1614
+ columnNumber: 7
1615
+ }, this)]
1616
+ }, void 0, true, {
1617
+ fileName: _jsxFileName,
1618
+ lineNumber: 781,
1619
+ columnNumber: 5
1620
+ }, this);
999
1621
  }
1000
1622
  /** The included / not-included check on a feature row (D47): a real checkbox, outside the row's open button. */
1001
1623
  function RowCheck({ on, label, title, readOnly, onToggle }) {
1002
- return /* @__PURE__ */ jsx(Tooltip, {
1624
+ return /* @__PURE__ */ jsxDEV(Tooltip, {
1003
1625
  content: on ? label : `Not ${label.toLowerCase()}`,
1004
- children: /* @__PURE__ */ jsx("button", {
1626
+ children: /* @__PURE__ */ jsxDEV("button", {
1005
1627
  type: "button",
1006
1628
  role: "checkbox",
1007
1629
  "aria-checked": on,
@@ -1012,18 +1634,38 @@ function RowCheck({ on, label, title, readOnly, onToggle }) {
1012
1634
  onToggle();
1013
1635
  },
1014
1636
  className: "group/chk flex size-7 shrink-0 items-center justify-center rounded-kit-md transition-colors hover:bg-kit-hover disabled:pointer-events-none",
1015
- children: /* @__PURE__ */ jsx("span", {
1637
+ children: /* @__PURE__ */ jsxDEV("span", {
1016
1638
  className: cn("flex size-[18px] items-center justify-center rounded-full transition-colors", on ? "bg-kit-control-checked text-kit-fg-inverse" : "border border-dashed border-kit-field-border-hover text-kit-fg-3 group-hover/chk:border-[var(--kit-emphasis-line)]"),
1017
- children: on ? /* @__PURE__ */ jsx(IconCheck, {
1639
+ children: on ? /* @__PURE__ */ jsxDEV(IconCheck, {
1018
1640
  className: "size-3",
1019
1641
  stroke: 2.5
1020
- }) : /* @__PURE__ */ jsx(IconMinus, {
1642
+ }, void 0, false, {
1643
+ fileName: _jsxFileName,
1644
+ lineNumber: 845,
1645
+ columnNumber: 17
1646
+ }, this) : /* @__PURE__ */ jsxDEV(IconMinus, {
1021
1647
  className: "size-3",
1022
1648
  stroke: 2
1023
- })
1024
- })
1025
- })
1026
- });
1649
+ }, void 0, false, {
1650
+ fileName: _jsxFileName,
1651
+ lineNumber: 845,
1652
+ columnNumber: 65
1653
+ }, this)
1654
+ }, void 0, false, {
1655
+ fileName: _jsxFileName,
1656
+ lineNumber: 839,
1657
+ columnNumber: 9
1658
+ }, this)
1659
+ }, void 0, false, {
1660
+ fileName: _jsxFileName,
1661
+ lineNumber: 827,
1662
+ columnNumber: 7
1663
+ }, this)
1664
+ }, void 0, false, {
1665
+ fileName: _jsxFileName,
1666
+ lineNumber: 826,
1667
+ columnNumber: 5
1668
+ }, this);
1027
1669
  }
1028
1670
  //#endregion
1029
1671
  export { ADD_SEARCH_AT, ARRAY_CONTROLS, ArrayField, RowList, RowsHostContext, rowToggleField, useDrill, useListOps };