@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
@@ -12,7 +12,7 @@ import { Input, Textarea } from "../ui/input.js";
12
12
  import { Select } from "../ui/select.js";
13
13
  import { useDragReorder } from "../engine/item-list.js";
14
14
  import * as React from "react";
15
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
+ import { Fragment, jsxDEV } from "react/jsx-dev-runtime";
16
16
  import { IconAlertTriangle, IconCrop, IconDots, IconDownload, IconExternalLink, IconFileText, IconFocusCentered, IconLink, IconPhoto, IconPlayerPlay, IconPlus, IconRefresh, IconReplace, IconTrash, IconUpload, IconVideo, IconWorld, IconX } from "@tabler/icons-react";
17
17
  //#region src/controls/media.tsx
18
18
  /**
@@ -36,6 +36,7 @@ import { IconAlertTriangle, IconCrop, IconDots, IconDownload, IconExternalLink,
36
36
  * - a typed video URL is held as a draft until it is one prod stores (http(s) or a site path), so the dock never
37
37
  * refuses a half-typed address.
38
38
  */
39
+ var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/controls/media.tsx";
39
40
  var fileNameFromUrl = (url) => {
40
41
  const inline = /^data:image\/([a-z0-9.+-]+)/i.exec(url.trim());
41
42
  if (inline) return `Embedded ${inline[1].replace(/\+xml$/i, "").replace(/^jpeg$/i, "jpg").toUpperCase()} image`;
@@ -90,7 +91,11 @@ function acceptsFile(accept, file) {
90
91
  }
91
92
  function MediaPicker(p) {
92
93
  const Picker = useKitServices().MediaPicker;
93
- return Picker ? /* @__PURE__ */ jsx(Picker, { ...p }) : null;
94
+ return Picker ? /* @__PURE__ */ jsxDEV(Picker, { ...p }, void 0, false, {
95
+ fileName: _jsxFileName,
96
+ lineNumber: 136,
97
+ columnNumber: 19
98
+ }, this) : null;
94
99
  }
95
100
  /**
96
101
  * Upload through the host's media library: progress while it runs, the assets handed to `onDone`, and a named reason
@@ -133,11 +138,15 @@ function useUpload(accept, kind, onDone) {
133
138
  }
134
139
  /** A line under a control that says why something did not happen (role="alert": it is the answer to an action). */
135
140
  function Reason({ children, tone = "danger" }) {
136
- return /* @__PURE__ */ jsx("p", {
141
+ return /* @__PURE__ */ jsxDEV("p", {
137
142
  role: tone === "danger" ? "alert" : "note",
138
143
  className: cn("text-kit-xs", tone === "danger" ? "text-kit-danger-fg" : "text-kit-fg-3"),
139
144
  children
140
- });
145
+ }, void 0, false, {
146
+ fileName: _jsxFileName,
147
+ lineNumber: 185,
148
+ columnNumber: 5
149
+ }, this);
141
150
  }
142
151
  function DropWell({ id, title, hint, accept, multiple, icon, disabled, onFiles, onLibrary, onUrl, refuse, progress }) {
143
152
  const [over, setOver] = React.useState(false);
@@ -148,7 +157,7 @@ function DropWell({ id, title, hint, accept, multiple, icon, disabled, onFiles,
148
157
  const takesFiles = (!!onFiles || !!refuse) && !disabled;
149
158
  const files = (f) => onFiles ? onFiles(f) : refuse?.(NO_UPLOAD);
150
159
  const pickFiles = () => onFiles ? input.current?.click() : refuse?.(NO_UPLOAD);
151
- return /* @__PURE__ */ jsxs("div", {
160
+ return /* @__PURE__ */ jsxDEV("div", {
152
161
  id,
153
162
  tabIndex: disabled ? -1 : 0,
154
163
  role: "group",
@@ -183,18 +192,34 @@ function DropWell({ id, title, hint, accept, multiple, icon, disabled, onFiles,
183
192
  "data-slot": "kit-drop-well",
184
193
  className: cn("relative flex flex-col items-center gap-2.5 rounded-kit-lg border border-dashed px-4 py-5 text-center transition-colors", over ? "border-kit-accent bg-kit-accent-softer" : "border-kit-line-strong bg-kit-subtle hover:border-kit-field-border-hover"),
185
194
  children: [
186
- /* @__PURE__ */ jsx("span", {
195
+ /* @__PURE__ */ jsxDEV("span", {
187
196
  className: cn("flex size-9 items-center justify-center rounded-kit-lg border border-kit-line bg-kit-control-bg text-kit-fg-3 [&_svg]:size-[18px]", over && "text-kit-accent-fg"),
188
197
  children: icon
189
- }),
190
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
198
+ }, void 0, false, {
199
+ fileName: _jsxFileName,
200
+ lineNumber: 271,
201
+ columnNumber: 7
202
+ }, this),
203
+ /* @__PURE__ */ jsxDEV("div", { children: [/* @__PURE__ */ jsxDEV("div", {
191
204
  className: "text-kit-sm font-medium text-kit-fg",
192
205
  children: over ? "Drop to upload" : title
193
- }), takesFiles ? /* @__PURE__ */ jsx("div", {
206
+ }, void 0, false, {
207
+ fileName: _jsxFileName,
208
+ lineNumber: 273,
209
+ columnNumber: 9
210
+ }, this), takesFiles ? /* @__PURE__ */ jsxDEV("div", {
194
211
  className: "text-kit-xs text-kit-fg-3",
195
212
  children: hint
196
- }) : null] }),
197
- urlMode && onUrl ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("form", {
213
+ }, void 0, false, {
214
+ fileName: _jsxFileName,
215
+ lineNumber: 274,
216
+ columnNumber: 23
217
+ }, this) : null] }, void 0, true, {
218
+ fileName: _jsxFileName,
219
+ lineNumber: 272,
220
+ columnNumber: 7
221
+ }, this),
222
+ urlMode && onUrl ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("form", {
198
223
  className: "flex w-full max-w-sm items-center gap-1.5",
199
224
  onSubmit: (e) => {
200
225
  e.preventDefault();
@@ -214,7 +239,7 @@ function DropWell({ id, title, hint, accept, multiple, icon, disabled, onFiles,
214
239
  setUrlError(null);
215
240
  }
216
241
  },
217
- children: [/* @__PURE__ */ jsx(Input, {
242
+ children: [/* @__PURE__ */ jsxDEV(Input, {
218
243
  autoFocus: true,
219
244
  size: "sm",
220
245
  value: url,
@@ -222,41 +247,85 @@ function DropWell({ id, title, hint, accept, multiple, icon, disabled, onFiles,
222
247
  "aria-invalid": urlError ? true : void 0,
223
248
  onChange: (e) => setUrl(e.target.value),
224
249
  placeholder: "https://…/photo.jpg",
225
- leading: /* @__PURE__ */ jsx(IconLink, { stroke: 1.5 })
226
- }), /* @__PURE__ */ jsx(Button, {
250
+ leading: /* @__PURE__ */ jsxDEV(IconLink, { stroke: 1.5 }, void 0, false, {
251
+ fileName: _jsxFileName,
252
+ lineNumber: 307,
253
+ columnNumber: 24
254
+ }, this)
255
+ }, void 0, false, {
256
+ fileName: _jsxFileName,
257
+ lineNumber: 299,
258
+ columnNumber: 13
259
+ }, this), /* @__PURE__ */ jsxDEV(Button, {
227
260
  size: "sm",
228
261
  type: "submit",
229
262
  variant: "primary",
230
263
  children: "Add"
231
- })]
232
- }), urlError ? /* @__PURE__ */ jsx(Reason, { children: urlError }) : null] }) : /* @__PURE__ */ jsxs("div", {
264
+ }, void 0, false, {
265
+ fileName: _jsxFileName,
266
+ lineNumber: 309,
267
+ columnNumber: 13
268
+ }, this)]
269
+ }, void 0, true, {
270
+ fileName: _jsxFileName,
271
+ lineNumber: 278,
272
+ columnNumber: 11
273
+ }, this), urlError ? /* @__PURE__ */ jsxDEV(Reason, { children: urlError }, void 0, false, {
274
+ fileName: _jsxFileName,
275
+ lineNumber: 314,
276
+ columnNumber: 23
277
+ }, this) : null] }, void 0, true, {
278
+ fileName: _jsxFileName,
279
+ lineNumber: 277,
280
+ columnNumber: 9
281
+ }, this) : /* @__PURE__ */ jsxDEV("div", {
233
282
  className: "flex flex-wrap justify-center gap-1.5",
234
283
  children: [
235
- onLibrary || refuse ? /* @__PURE__ */ jsx(Button, {
284
+ onLibrary || refuse ? /* @__PURE__ */ jsxDEV(Button, {
236
285
  size: "sm",
237
286
  variant: "secondary",
238
287
  onClick: onLibrary ?? (() => refuse(NO_LIBRARY)),
239
288
  disabled,
240
289
  children: "Media library"
241
- }) : null,
242
- onFiles || refuse ? /* @__PURE__ */ jsx(Button, {
290
+ }, void 0, false, {
291
+ fileName: _jsxFileName,
292
+ lineNumber: 319,
293
+ columnNumber: 13
294
+ }, this) : null,
295
+ onFiles || refuse ? /* @__PURE__ */ jsxDEV(Button, {
243
296
  size: "sm",
244
297
  variant: "ghost",
245
- leftIcon: /* @__PURE__ */ jsx(IconUpload, { stroke: 1.5 }),
298
+ leftIcon: /* @__PURE__ */ jsxDEV(IconUpload, { stroke: 1.5 }, void 0, false, {
299
+ fileName: _jsxFileName,
300
+ lineNumber: 324,
301
+ columnNumber: 57
302
+ }, this),
246
303
  onClick: pickFiles,
247
304
  disabled,
248
305
  children: "Upload"
249
- }) : null,
250
- onUrl ? /* @__PURE__ */ jsx(Button, {
306
+ }, void 0, false, {
307
+ fileName: _jsxFileName,
308
+ lineNumber: 324,
309
+ columnNumber: 13
310
+ }, this) : null,
311
+ onUrl ? /* @__PURE__ */ jsxDEV(Button, {
251
312
  size: "sm",
252
313
  variant: "ghost",
253
314
  onClick: () => setUrlMode(true),
254
315
  disabled,
255
316
  children: "Paste URL"
256
- }) : null
317
+ }, void 0, false, {
318
+ fileName: _jsxFileName,
319
+ lineNumber: 329,
320
+ columnNumber: 13
321
+ }, this) : null
257
322
  ]
258
- }),
259
- onFiles ? /* @__PURE__ */ jsx("input", {
323
+ }, void 0, true, {
324
+ fileName: _jsxFileName,
325
+ lineNumber: 317,
326
+ columnNumber: 9
327
+ }, this),
328
+ onFiles ? /* @__PURE__ */ jsxDEV("input", {
260
329
  ref: input,
261
330
  type: "file",
262
331
  hidden: true,
@@ -268,29 +337,53 @@ function DropWell({ id, title, hint, accept, multiple, icon, disabled, onFiles,
268
337
  onFiles(Array.from(e.target.files ?? []));
269
338
  e.target.value = "";
270
339
  }
271
- }) : null,
272
- progress != null ? /* @__PURE__ */ jsxs("div", {
340
+ }, void 0, false, {
341
+ fileName: _jsxFileName,
342
+ lineNumber: 336,
343
+ columnNumber: 9
344
+ }, this) : null,
345
+ progress != null ? /* @__PURE__ */ jsxDEV("div", {
273
346
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2 rounded-kit-lg bg-kit-surface px-8",
274
- children: [/* @__PURE__ */ jsxs("span", {
347
+ children: [/* @__PURE__ */ jsxDEV("span", {
275
348
  className: "text-kit-sm text-kit-fg-2",
276
349
  children: [
277
- /* @__PURE__ */ jsx("span", {
350
+ /* @__PURE__ */ jsxDEV("span", {
278
351
  role: "status",
279
352
  children: "Uploading…"
280
- }),
353
+ }, void 0, false, {
354
+ fileName: _jsxFileName,
355
+ lineNumber: 353,
356
+ columnNumber: 13
357
+ }, this),
281
358
  " ",
282
359
  progress,
283
360
  "%"
284
361
  ]
285
- }), /* @__PURE__ */ jsx(Progress, {
362
+ }, void 0, true, {
363
+ fileName: _jsxFileName,
364
+ lineNumber: 352,
365
+ columnNumber: 11
366
+ }, this), /* @__PURE__ */ jsxDEV(Progress, {
286
367
  value: progress,
287
368
  tone: "ink",
288
369
  label: "Upload progress",
289
370
  className: "max-w-56"
290
- })]
291
- }) : null
371
+ }, void 0, false, {
372
+ fileName: _jsxFileName,
373
+ lineNumber: 355,
374
+ columnNumber: 11
375
+ }, this)]
376
+ }, void 0, true, {
377
+ fileName: _jsxFileName,
378
+ lineNumber: 351,
379
+ columnNumber: 9
380
+ }, this) : null
292
381
  ]
293
- });
382
+ }, void 0, true, {
383
+ fileName: _jsxFileName,
384
+ lineNumber: 232,
385
+ columnNumber: 5
386
+ }, this);
294
387
  }
295
388
  /** Why the drop well offers nothing to pick with (no library, no upload): said once, in words. */
296
389
  var NO_SOURCE = "No media library or upload is connected to this editor, so nothing can be chosen here.";
@@ -381,41 +474,77 @@ function ImageDetails({ v, onChange, readOnly, label, urlOnly, altOnly = false,
381
474
  if (!r.width || !r.height) return;
382
475
  setFocal(50 + ((e.clientX - r.left) / r.width * 100 - 50) / fx, 50 + ((e.clientY - r.top) / r.height * 100 - 50) / fy);
383
476
  };
384
- return /* @__PURE__ */ jsxs("div", {
477
+ return /* @__PURE__ */ jsxDEV("div", {
385
478
  className: "flex flex-col gap-3",
386
479
  children: [
387
- /* @__PURE__ */ jsxs("div", {
480
+ /* @__PURE__ */ jsxDEV("div", {
388
481
  className: "flex items-center justify-between",
389
- children: [/* @__PURE__ */ jsx("span", {
482
+ children: [/* @__PURE__ */ jsxDEV("span", {
390
483
  className: "text-kit-sm font-medium text-kit-fg",
391
484
  children: "Alt text and details"
392
- }), size ? /* @__PURE__ */ jsxs("span", {
485
+ }, void 0, false, {
486
+ fileName: _jsxFileName,
487
+ lineNumber: 453,
488
+ columnNumber: 9
489
+ }, this), size ? /* @__PURE__ */ jsxDEV("span", {
393
490
  className: "tabular-nums text-kit-2xs text-kit-fg-3",
394
491
  children: [
395
492
  size.w,
396
493
  " × ",
397
494
  size.h
398
495
  ]
399
- }) : null]
400
- }),
401
- urlOnly ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Reason, {
496
+ }, void 0, true, {
497
+ fileName: _jsxFileName,
498
+ lineNumber: 455,
499
+ columnNumber: 11
500
+ }, this) : null]
501
+ }, void 0, true, {
502
+ fileName: _jsxFileName,
503
+ lineNumber: 452,
504
+ columnNumber: 7
505
+ }, this),
506
+ urlOnly ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV(Reason, {
402
507
  tone: "muted",
403
508
  children: "This placement stores the image address only, so its alt text and focal point are the media library's."
404
- }), asset?.alt ? /* @__PURE__ */ jsxs("div", {
509
+ }, void 0, false, {
510
+ fileName: _jsxFileName,
511
+ lineNumber: 462,
512
+ columnNumber: 11
513
+ }, this), asset?.alt ? /* @__PURE__ */ jsxDEV("div", {
405
514
  className: "flex flex-col gap-1",
406
- children: [/* @__PURE__ */ jsx("span", {
515
+ children: [/* @__PURE__ */ jsxDEV("span", {
407
516
  className: "text-kit-xs text-kit-fg-3",
408
517
  children: "Alt text in the media library"
409
- }), /* @__PURE__ */ jsx("span", {
518
+ }, void 0, false, {
519
+ fileName: _jsxFileName,
520
+ lineNumber: 465,
521
+ columnNumber: 15
522
+ }, this), /* @__PURE__ */ jsxDEV("span", {
410
523
  className: "text-kit-sm text-kit-fg",
411
524
  children: asset.alt
412
- })]
413
- }) : null] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("label", {
525
+ }, void 0, false, {
526
+ fileName: _jsxFileName,
527
+ lineNumber: 466,
528
+ columnNumber: 15
529
+ }, this)]
530
+ }, void 0, true, {
531
+ fileName: _jsxFileName,
532
+ lineNumber: 464,
533
+ columnNumber: 13
534
+ }, this) : null] }, void 0, true, {
535
+ fileName: _jsxFileName,
536
+ lineNumber: 461,
537
+ columnNumber: 9
538
+ }, this) : /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("label", {
414
539
  className: "flex flex-col gap-1.5",
415
- children: [/* @__PURE__ */ jsx("span", {
540
+ children: [/* @__PURE__ */ jsxDEV("span", {
416
541
  className: "text-kit-xs text-kit-fg-3",
417
542
  children: "Alt text"
418
- }), /* @__PURE__ */ jsx(Textarea, {
543
+ }, void 0, false, {
544
+ fileName: _jsxFileName,
545
+ lineNumber: 473,
546
+ columnNumber: 13
547
+ }, this), /* @__PURE__ */ jsxDEV(Textarea, {
419
548
  rows: 2,
420
549
  value: v.alt ?? "",
421
550
  readOnly,
@@ -429,39 +558,71 @@ function ImageDetails({ v, onChange, readOnly, label, urlOnly, altOnly = false,
429
558
  placeholder: "Describe the image for accessibility",
430
559
  className: "min-h-14 text-kit-sm",
431
560
  "aria-label": `${label} alt text`
432
- })]
433
- }), altOnly ? /* @__PURE__ */ jsx(Reason, {
561
+ }, void 0, false, {
562
+ fileName: _jsxFileName,
563
+ lineNumber: 474,
564
+ columnNumber: 13
565
+ }, this)]
566
+ }, void 0, true, {
567
+ fileName: _jsxFileName,
568
+ lineNumber: 472,
569
+ columnNumber: 11
570
+ }, this), altOnly ? /* @__PURE__ */ jsxDEV(Reason, {
434
571
  tone: "muted",
435
572
  children: "This image block keeps its address and alt text. A crop or focal point isn't stored with it."
436
- }) : /* @__PURE__ */ jsxs("div", {
573
+ }, void 0, false, {
574
+ fileName: _jsxFileName,
575
+ lineNumber: 491,
576
+ columnNumber: 13
577
+ }, this) : /* @__PURE__ */ jsxDEV("div", {
437
578
  className: "flex flex-col gap-1.5",
438
579
  children: [
439
- /* @__PURE__ */ jsxs("div", {
580
+ /* @__PURE__ */ jsxDEV("div", {
440
581
  className: "flex items-center justify-between",
441
- children: [/* @__PURE__ */ jsxs("span", {
582
+ children: [/* @__PURE__ */ jsxDEV("span", {
442
583
  className: "flex items-center gap-1 text-kit-xs text-kit-fg-3",
443
- children: [/* @__PURE__ */ jsx(IconCrop, {
584
+ children: [/* @__PURE__ */ jsxDEV(IconCrop, {
444
585
  className: "size-3.5",
445
586
  stroke: 1.5,
446
587
  "aria-hidden": true
447
- }), "Crop for this placement"]
448
- }), /* @__PURE__ */ jsxs("span", {
588
+ }, void 0, false, {
589
+ fileName: _jsxFileName,
590
+ lineNumber: 496,
591
+ columnNumber: 17
592
+ }, this), "Crop for this placement"]
593
+ }, void 0, true, {
594
+ fileName: _jsxFileName,
595
+ lineNumber: 495,
596
+ columnNumber: 15
597
+ }, this), /* @__PURE__ */ jsxDEV("span", {
449
598
  className: "flex items-center gap-1 text-kit-2xs text-kit-fg-3",
450
599
  children: [
451
- /* @__PURE__ */ jsx(IconFocusCentered, {
600
+ /* @__PURE__ */ jsxDEV(IconFocusCentered, {
452
601
  className: "size-3",
453
602
  stroke: 1.5,
454
603
  "aria-hidden": true
455
- }),
604
+ }, void 0, false, {
605
+ fileName: _jsxFileName,
606
+ lineNumber: 500,
607
+ columnNumber: 17
608
+ }, this),
456
609
  "Focal ",
457
610
  focal.x,
458
611
  "%, ",
459
612
  focal.y,
460
613
  "%"
461
614
  ]
462
- })]
463
- }),
464
- /* @__PURE__ */ jsx(Select, {
615
+ }, void 0, true, {
616
+ fileName: _jsxFileName,
617
+ lineNumber: 499,
618
+ columnNumber: 15
619
+ }, this)]
620
+ }, void 0, true, {
621
+ fileName: _jsxFileName,
622
+ lineNumber: 494,
623
+ columnNumber: 13
624
+ }, this),
625
+ /* @__PURE__ */ jsxDEV(Select, {
465
626
  size: "sm",
466
627
  "aria-label": `${label} crop`,
467
628
  disabled: readOnly || !size,
@@ -478,12 +639,20 @@ function ImageDetails({ v, onChange, readOnly, label, urlOnly, altOnly = false,
478
639
  meta: "Cut elsewhere",
479
640
  disabled: true
480
641
  }] : []]
481
- }),
482
- !size && !readOnly ? /* @__PURE__ */ jsx("span", {
642
+ }, void 0, false, {
643
+ fileName: _jsxFileName,
644
+ lineNumber: 505,
645
+ columnNumber: 13
646
+ }, this),
647
+ !size && !readOnly ? /* @__PURE__ */ jsxDEV("span", {
483
648
  className: "text-kit-2xs text-kit-fg-3",
484
649
  children: "The crop is cut from the picture's size, which is still loading."
485
- }) : null,
486
- /* @__PURE__ */ jsxs("div", {
650
+ }, void 0, false, {
651
+ fileName: _jsxFileName,
652
+ lineNumber: 517,
653
+ columnNumber: 35
654
+ }, this) : null,
655
+ /* @__PURE__ */ jsxDEV("div", {
487
656
  role: "slider",
488
657
  "aria-label": "Focal point. Click the subject.",
489
658
  "aria-valuetext": `${focal.x}% across, ${focal.y}% down`,
@@ -509,47 +678,91 @@ function ImageDetails({ v, onChange, readOnly, label, urlOnly, altOnly = false,
509
678
  "data-fit": fit,
510
679
  className: cn("relative mt-1 cursor-crosshair overflow-hidden rounded-kit-md border border-kit-line", fit === "contain" ? CHECKER : "bg-kit-muted"),
511
680
  style: { aspectRatio: padRatio },
512
- children: [fit === "contain" ? /* @__PURE__ */ jsx("img", {
681
+ children: [fit === "contain" ? /* @__PURE__ */ jsxDEV("img", {
513
682
  src: src(v.url),
514
683
  alt: "",
515
684
  draggable: false,
516
685
  className: "pointer-events-none size-full select-none object-contain"
517
- }) : /* @__PURE__ */ jsx("img", {
686
+ }, void 0, false, {
687
+ fileName: _jsxFileName,
688
+ lineNumber: 543,
689
+ columnNumber: 17
690
+ }, this) : /* @__PURE__ */ jsxDEV("img", {
518
691
  src: src(v.url),
519
692
  alt: "",
520
693
  draggable: false,
521
694
  className: "pointer-events-none size-full select-none object-cover transition-[object-position] duration-200",
522
695
  style: { objectPosition: `${focal.x}% ${focal.y}%` }
523
- }), /* @__PURE__ */ jsx("span", {
696
+ }, void 0, false, {
697
+ fileName: _jsxFileName,
698
+ lineNumber: 545,
699
+ columnNumber: 17
700
+ }, this), /* @__PURE__ */ jsxDEV("span", {
524
701
  "aria-hidden": true,
525
702
  className: "pointer-events-none absolute size-5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-kit-media-handle bg-kit-media-handle-ring shadow-kit-md transition-[left,top] duration-150",
526
703
  style: {
527
704
  left: `${50 + (focal.x - 50) * fx}%`,
528
705
  top: `${50 + (focal.y - 50) * fy}%`
529
706
  }
530
- })]
531
- }),
532
- /* @__PURE__ */ jsx("span", {
707
+ }, void 0, false, {
708
+ fileName: _jsxFileName,
709
+ lineNumber: 547,
710
+ columnNumber: 15
711
+ }, this)]
712
+ }, void 0, true, {
713
+ fileName: _jsxFileName,
714
+ lineNumber: 518,
715
+ columnNumber: 13
716
+ }, this),
717
+ /* @__PURE__ */ jsxDEV("span", {
533
718
  className: "text-kit-2xs text-kit-fg-3",
534
719
  children: "Click the subject. It stays in frame on every screen size."
535
- })
720
+ }, void 0, false, {
721
+ fileName: _jsxFileName,
722
+ lineNumber: 553,
723
+ columnNumber: 13
724
+ }, this)
536
725
  ]
537
- })] }),
538
- urlOnly || altOnly ? /* @__PURE__ */ jsxs("div", {
726
+ }, void 0, true, {
727
+ fileName: _jsxFileName,
728
+ lineNumber: 493,
729
+ columnNumber: 11
730
+ }, this)] }, void 0, true, {
731
+ fileName: _jsxFileName,
732
+ lineNumber: 471,
733
+ columnNumber: 9
734
+ }, this),
735
+ urlOnly || altOnly ? /* @__PURE__ */ jsxDEV("div", {
539
736
  className: "flex flex-col gap-1.5",
540
- children: [/* @__PURE__ */ jsx("span", {
737
+ children: [/* @__PURE__ */ jsxDEV("span", {
541
738
  className: "text-kit-xs text-kit-fg-3",
542
739
  children: "File name"
543
- }), /* @__PURE__ */ jsx("span", {
740
+ }, void 0, false, {
741
+ fileName: _jsxFileName,
742
+ lineNumber: 560,
743
+ columnNumber: 11
744
+ }, this), /* @__PURE__ */ jsxDEV("span", {
544
745
  className: "truncate font-kit-mono text-kit-xs text-kit-fg",
545
746
  children: asset?.name ?? v.name ?? fileNameFromUrl(v.url)
546
- })]
547
- }) : /* @__PURE__ */ jsxs("label", {
747
+ }, void 0, false, {
748
+ fileName: _jsxFileName,
749
+ lineNumber: 561,
750
+ columnNumber: 11
751
+ }, this)]
752
+ }, void 0, true, {
753
+ fileName: _jsxFileName,
754
+ lineNumber: 559,
755
+ columnNumber: 9
756
+ }, this) : /* @__PURE__ */ jsxDEV("label", {
548
757
  className: "flex flex-col gap-1.5",
549
- children: [/* @__PURE__ */ jsx("span", {
758
+ children: [/* @__PURE__ */ jsxDEV("span", {
550
759
  className: "text-kit-xs text-kit-fg-3",
551
760
  children: "File name"
552
- }), /* @__PURE__ */ jsx(Input, {
761
+ }, void 0, false, {
762
+ fileName: _jsxFileName,
763
+ lineNumber: 566,
764
+ columnNumber: 11
765
+ }, this), /* @__PURE__ */ jsxDEV(Input, {
553
766
  size: "sm",
554
767
  value: v.name ?? asset?.name ?? fileNameFromUrl(v.url),
555
768
  readOnly,
@@ -563,10 +776,22 @@ function ImageDetails({ v, onChange, readOnly, label, urlOnly, altOnly = false,
563
776
  },
564
777
  className: "font-kit-mono [&_input]:font-kit-mono",
565
778
  "aria-label": `${label} file name`
566
- })]
567
- })
779
+ }, void 0, false, {
780
+ fileName: _jsxFileName,
781
+ lineNumber: 567,
782
+ columnNumber: 11
783
+ }, this)]
784
+ }, void 0, true, {
785
+ fileName: _jsxFileName,
786
+ lineNumber: 565,
787
+ columnNumber: 9
788
+ }, this)
568
789
  ]
569
- });
790
+ }, void 0, true, {
791
+ fileName: _jsxFileName,
792
+ lineNumber: 451,
793
+ columnNumber: 5
794
+ }, this);
570
795
  }
571
796
  /**
572
797
  * V2's icon control shape (controls/icon.tsx): ONE button — a 24px glyph tile, the field's name, a quiet replace cue —
@@ -585,11 +810,11 @@ function IconImageRow({ id, title, url, readOnly, onOpen, onFiles, busy, pickerO
585
810
  const inert = readOnly || busy || !onOpen;
586
811
  const droppable = empty && !inert && !!onFiles;
587
812
  const chrome = React.useContext(RowChrome);
588
- return /* @__PURE__ */ jsxs("div", {
813
+ return /* @__PURE__ */ jsxDEV("div", {
589
814
  className: cn("flex h-8 min-w-0 items-center rounded-kit-md border bg-kit-field-bg pointer-coarse:min-h-11", "transition-colors duration-[120ms] ease-out motion-reduce:transition-none", over ? "border-kit-emphasis-line bg-kit-hover" : "border-kit-line-strong", inert ? "opacity-60" : "[@media(hover:hover)]:hover:bg-kit-hover"),
590
- children: [/* @__PURE__ */ jsx(Tooltip, {
815
+ children: [/* @__PURE__ */ jsxDEV(Tooltip, {
591
816
  content: title,
592
- children: /* @__PURE__ */ jsxs("button", {
817
+ children: /* @__PURE__ */ jsxDEV("button", {
593
818
  ref: row,
594
819
  id,
595
820
  type: "button",
@@ -609,36 +834,72 @@ function IconImageRow({ id, title, url, readOnly, onOpen, onFiles, busy, pickerO
609
834
  } : void 0,
610
835
  className: "flex min-w-0 flex-1 touch-manipulation items-center gap-3 self-stretch rounded-[5px] pl-[3px] pr-2 text-left text-kit-sm focus-visible:-outline-offset-2 disabled:cursor-not-allowed",
611
836
  children: [
612
- /* @__PURE__ */ jsx("span", {
837
+ /* @__PURE__ */ jsxDEV("span", {
613
838
  "aria-hidden": true,
614
839
  className: cn("grid size-6 shrink-0 place-items-center overflow-hidden rounded-kit-sm border", empty ? "border-dashed border-kit-emphasis-line" : cn("border-kit-line p-1", CHECKER)),
615
- children: empty ? /* @__PURE__ */ jsx(IconPlus, {
840
+ children: empty ? /* @__PURE__ */ jsxDEV(IconPlus, {
616
841
  className: "size-3.5 text-kit-fg-3",
617
842
  stroke: 1.5
618
- }) : /* @__PURE__ */ jsx("img", {
843
+ }, void 0, false, {
844
+ fileName: _jsxFileName,
845
+ lineNumber: 657,
846
+ columnNumber: 20
847
+ }, this) : /* @__PURE__ */ jsxDEV("img", {
619
848
  src: url,
620
849
  alt: "",
621
850
  className: "size-full object-contain"
622
- })
623
- }),
624
- /* @__PURE__ */ jsx("span", {
851
+ }, void 0, false, {
852
+ fileName: _jsxFileName,
853
+ lineNumber: 657,
854
+ columnNumber: 83
855
+ }, this)
856
+ }, void 0, false, {
857
+ fileName: _jsxFileName,
858
+ lineNumber: 650,
859
+ columnNumber: 9
860
+ }, this),
861
+ /* @__PURE__ */ jsxDEV("span", {
625
862
  "aria-hidden": true,
626
863
  className: cn("min-w-0 flex-1 truncate", empty ? "text-kit-fg-3" : "text-kit-fg"),
627
864
  children: empty ? busy ? "Uploading…" : "Add icon" : title
628
- }),
629
- empty ? null : /* @__PURE__ */ jsx(IconRefresh, {
865
+ }, void 0, false, {
866
+ fileName: _jsxFileName,
867
+ lineNumber: 659,
868
+ columnNumber: 9
869
+ }, this),
870
+ empty ? null : /* @__PURE__ */ jsxDEV(IconRefresh, {
630
871
  "aria-hidden": true,
631
872
  className: "size-3.5 shrink-0 text-kit-fg-3",
632
873
  stroke: 1.5
633
- })
874
+ }, void 0, false, {
875
+ fileName: _jsxFileName,
876
+ lineNumber: 662,
877
+ columnNumber: 25
878
+ }, this)
634
879
  ]
635
- })
636
- }), chrome ? /* @__PURE__ */ jsx("span", {
880
+ }, void 0, true, {
881
+ fileName: _jsxFileName,
882
+ lineNumber: 637,
883
+ columnNumber: 7
884
+ }, this)
885
+ }, void 0, false, {
886
+ fileName: _jsxFileName,
887
+ lineNumber: 636,
888
+ columnNumber: 5
889
+ }, this), chrome ? /* @__PURE__ */ jsxDEV("span", {
637
890
  "data-slot": "kit-icon-row-chrome",
638
891
  className: "flex shrink-0 items-center gap-0.5 pr-1 empty:hidden",
639
892
  children: chrome
640
- }) : null]
641
- });
893
+ }, void 0, false, {
894
+ fileName: _jsxFileName,
895
+ lineNumber: 665,
896
+ columnNumber: 17
897
+ }, this) : null]
898
+ }, void 0, true, {
899
+ fileName: _jsxFileName,
900
+ lineNumber: 628,
901
+ columnNumber: 5
902
+ }, this);
642
903
  }
643
904
  function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
644
905
  const { s, useAsset, src } = useMedia();
@@ -704,10 +965,10 @@ function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
704
965
  }));
705
966
  setPicker(false);
706
967
  };
707
- return /* @__PURE__ */ jsxs("div", {
968
+ return /* @__PURE__ */ jsxDEV("div", {
708
969
  className: "flex flex-col gap-1.5",
709
970
  children: [
710
- /* @__PURE__ */ jsx(IconImageRow, {
971
+ /* @__PURE__ */ jsxDEV(IconImageRow, {
711
972
  id,
712
973
  title: field.title,
713
974
  url: v ? src(v.url) : void 0,
@@ -716,13 +977,25 @@ function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
716
977
  onFiles: up.run,
717
978
  busy: up.progress != null,
718
979
  pickerOpen: picker
719
- }),
720
- up.error ? /* @__PURE__ */ jsx(Reason, { children: up.error }) : null,
721
- !readOnly && !library ? /* @__PURE__ */ jsx(Reason, {
980
+ }, void 0, false, {
981
+ fileName: _jsxFileName,
982
+ lineNumber: 731,
983
+ columnNumber: 9
984
+ }, this),
985
+ up.error ? /* @__PURE__ */ jsxDEV(Reason, { children: up.error }, void 0, false, {
986
+ fileName: _jsxFileName,
987
+ lineNumber: 741,
988
+ columnNumber: 21
989
+ }, this) : null,
990
+ !readOnly && !library ? /* @__PURE__ */ jsxDEV(Reason, {
722
991
  tone: "muted",
723
992
  children: NO_LIBRARY
724
- }) : null,
725
- /* @__PURE__ */ jsx(MediaPicker, {
993
+ }, void 0, false, {
994
+ fileName: _jsxFileName,
995
+ lineNumber: 742,
996
+ columnNumber: 34
997
+ }, this) : null,
998
+ /* @__PURE__ */ jsxDEV(MediaPicker, {
726
999
  open: picker,
727
1000
  onOpenChange: setPicker,
728
1001
  accept: ["svg"],
@@ -734,19 +1007,31 @@ function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
734
1007
  } : void 0,
735
1008
  icons,
736
1009
  onPickIcon: readOnly ? void 0 : pickIcon
737
- })
1010
+ }, void 0, false, {
1011
+ fileName: _jsxFileName,
1012
+ lineNumber: 743,
1013
+ columnNumber: 9
1014
+ }, this)
738
1015
  ]
739
- });
1016
+ }, void 0, true, {
1017
+ fileName: _jsxFileName,
1018
+ lineNumber: 730,
1019
+ columnNumber: 7
1020
+ }, this);
740
1021
  }
741
- if (!v) return /* @__PURE__ */ jsxs("div", {
1022
+ if (!v) return /* @__PURE__ */ jsxDEV("div", {
742
1023
  className: "flex flex-col gap-1.5",
743
1024
  children: [
744
- /* @__PURE__ */ jsx(DropWell, {
1025
+ /* @__PURE__ */ jsxDEV(DropWell, {
745
1026
  id,
746
1027
  title: "Add an image",
747
1028
  hint: "Or drop or paste one here",
748
1029
  accept,
749
- icon: /* @__PURE__ */ jsx(IconPhoto, { stroke: 1.5 }),
1030
+ icon: /* @__PURE__ */ jsxDEV(IconPhoto, { stroke: 1.5 }, void 0, false, {
1031
+ fileName: _jsxFileName,
1032
+ lineNumber: 765,
1033
+ columnNumber: 17
1034
+ }, this),
750
1035
  onFiles: up.run,
751
1036
  onLibrary: library,
752
1037
  onUrl: readOnly ? void 0 : (url) => onChange({
@@ -756,16 +1041,32 @@ function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
756
1041
  refuse: up.setError,
757
1042
  disabled: readOnly,
758
1043
  progress: up.progress
759
- }),
760
- up.error ? /* @__PURE__ */ jsx(Reason, { children: up.error }) : null,
761
- /* @__PURE__ */ jsx(MediaPicker, {
1044
+ }, void 0, false, {
1045
+ fileName: _jsxFileName,
1046
+ lineNumber: 760,
1047
+ columnNumber: 9
1048
+ }, this),
1049
+ up.error ? /* @__PURE__ */ jsxDEV(Reason, { children: up.error }, void 0, false, {
1050
+ fileName: _jsxFileName,
1051
+ lineNumber: 773,
1052
+ columnNumber: 21
1053
+ }, this) : null,
1054
+ /* @__PURE__ */ jsxDEV(MediaPicker, {
762
1055
  open: picker,
763
1056
  onOpenChange: setPicker,
764
1057
  accept: kinds,
765
1058
  onPick: (a) => a[0] && onChange(fromAsset(a[0]))
766
- })
1059
+ }, void 0, false, {
1060
+ fileName: _jsxFileName,
1061
+ lineNumber: 774,
1062
+ columnNumber: 9
1063
+ }, this)
767
1064
  ]
768
- });
1065
+ }, void 0, true, {
1066
+ fileName: _jsxFileName,
1067
+ lineNumber: 759,
1068
+ columnNumber: 7
1069
+ }, this);
769
1070
  const frameRatio = CROPS.find((c) => c.value === cropChoice(v.crop, size))?.ratio;
770
1071
  const focal = v.focal ?? {
771
1072
  x: 50,
@@ -780,11 +1081,11 @@ function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
780
1081
  onChange(next);
781
1082
  };
782
1083
  const openDetails = () => window.setTimeout(() => setDetails(true), 0);
783
- return /* @__PURE__ */ jsxs(Popover, {
1084
+ return /* @__PURE__ */ jsxDEV(Popover, {
784
1085
  open: details,
785
1086
  onOpenChange: setDetails,
786
1087
  children: [
787
- /* @__PURE__ */ jsxs(PopoverAnchor, {
1088
+ /* @__PURE__ */ jsxDEV(PopoverAnchor, {
788
1089
  className: cn("flex flex-col gap-1.5", env.variant === "document" && "max-w-xl"),
789
1090
  onPaste: (e) => {
790
1091
  const files = Array.from(e.clipboardData.files);
@@ -794,140 +1095,272 @@ function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
794
1095
  }
795
1096
  },
796
1097
  children: [
797
- /* @__PURE__ */ jsxs("div", {
1098
+ /* @__PURE__ */ jsxDEV("div", {
798
1099
  "data-slot": "kit-image-frame",
799
1100
  "data-fit": fit,
800
1101
  className: cn("group/img relative overflow-hidden rounded-kit-lg border border-kit-line", fit === "contain" ? CHECKER : "bg-kit-muted"),
801
1102
  style: { aspectRatio: frameRatio && frameRatio !== "auto" ? frameRatio : "16/9" },
802
1103
  children: [
803
- /* @__PURE__ */ jsx("button", {
1104
+ /* @__PURE__ */ jsxDEV("button", {
804
1105
  id,
805
1106
  type: "button",
806
1107
  disabled: readOnly,
807
1108
  onClick: () => library ? library() : openDetails(),
808
1109
  "aria-label": library ? `Replace ${field.title}` : `${field.title} details`,
809
1110
  className: "flex size-full items-center justify-center outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-kit-focus-ring focus-visible:[outline-style:solid] [html[data-input-modality=pointer]_&]:focus-visible:outline-none",
810
- children: /* @__PURE__ */ jsx("img", {
1111
+ children: /* @__PURE__ */ jsxDEV("img", {
811
1112
  src: src(v.url),
812
1113
  alt: alt ?? "",
813
1114
  ref: readNatural,
814
1115
  onLoad: (e) => readNatural(e.currentTarget),
815
1116
  className: fit === "contain" ? "size-full object-contain" : "size-full object-cover",
816
1117
  style: fit === "contain" ? void 0 : { objectPosition: `${focal.x}% ${focal.y}%` }
817
- })
818
- }),
819
- readOnly ? null : /* @__PURE__ */ jsxs("div", {
1118
+ }, void 0, false, {
1119
+ fileName: _jsxFileName,
1120
+ lineNumber: 818,
1121
+ columnNumber: 13
1122
+ }, this)
1123
+ }, void 0, false, {
1124
+ fileName: _jsxFileName,
1125
+ lineNumber: 810,
1126
+ columnNumber: 11
1127
+ }, this),
1128
+ readOnly ? null : /* @__PURE__ */ jsxDEV("div", {
820
1129
  className: "absolute right-2 top-2 flex gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/img:opacity-100 [@media(pointer:coarse)]:opacity-100",
821
- children: [library ? /* @__PURE__ */ jsxs("button", {
1130
+ children: [library ? /* @__PURE__ */ jsxDEV("button", {
822
1131
  type: "button",
823
1132
  onClick: library,
824
1133
  className: "flex h-7 items-center gap-1 rounded-full border border-kit-swatch-ring bg-kit-media-control px-2.5 text-kit-xs font-medium text-kit-media-control-fg shadow-kit-sm",
825
- children: [/* @__PURE__ */ jsx(IconReplace, {
1134
+ children: [/* @__PURE__ */ jsxDEV(IconReplace, {
826
1135
  className: "size-3.5",
827
1136
  stroke: 1.5,
828
1137
  "aria-hidden": true
829
- }), "Replace"]
830
- }) : null, /* @__PURE__ */ jsx(Tooltip, {
1138
+ }, void 0, false, {
1139
+ fileName: _jsxFileName,
1140
+ lineNumber: 831,
1141
+ columnNumber: 19
1142
+ }, this), "Replace"]
1143
+ }, void 0, true, {
1144
+ fileName: _jsxFileName,
1145
+ lineNumber: 830,
1146
+ columnNumber: 17
1147
+ }, this) : null, /* @__PURE__ */ jsxDEV(Tooltip, {
831
1148
  content: "Remove image",
832
- children: /* @__PURE__ */ jsx("button", {
1149
+ children: /* @__PURE__ */ jsxDEV("button", {
833
1150
  type: "button",
834
1151
  "aria-label": "Remove image",
835
1152
  onClick: () => onChange(null),
836
1153
  className: "flex size-7 items-center justify-center rounded-full border border-kit-swatch-ring bg-kit-media-control text-kit-media-control-fg shadow-kit-sm",
837
- children: /* @__PURE__ */ jsx(IconX, {
1154
+ children: /* @__PURE__ */ jsxDEV(IconX, {
838
1155
  className: "size-3.5",
839
1156
  stroke: 1.5,
840
1157
  "aria-hidden": true
841
- })
842
- })
843
- })]
844
- }),
845
- up.progress != null ? /* @__PURE__ */ jsx("div", {
1158
+ }, void 0, false, {
1159
+ fileName: _jsxFileName,
1160
+ lineNumber: 837,
1161
+ columnNumber: 19
1162
+ }, this)
1163
+ }, void 0, false, {
1164
+ fileName: _jsxFileName,
1165
+ lineNumber: 836,
1166
+ columnNumber: 17
1167
+ }, this)
1168
+ }, void 0, false, {
1169
+ fileName: _jsxFileName,
1170
+ lineNumber: 835,
1171
+ columnNumber: 15
1172
+ }, this)]
1173
+ }, void 0, true, {
1174
+ fileName: _jsxFileName,
1175
+ lineNumber: 828,
1176
+ columnNumber: 13
1177
+ }, this),
1178
+ up.progress != null ? /* @__PURE__ */ jsxDEV("div", {
846
1179
  className: "absolute inset-x-3 bottom-3",
847
- children: /* @__PURE__ */ jsx(Progress, {
1180
+ children: /* @__PURE__ */ jsxDEV(Progress, {
848
1181
  value: up.progress,
849
1182
  tone: "ink",
850
1183
  size: "sm",
851
1184
  label: "Upload progress"
852
- })
853
- }) : null
1185
+ }, void 0, false, {
1186
+ fileName: _jsxFileName,
1187
+ lineNumber: 844,
1188
+ columnNumber: 15
1189
+ }, this)
1190
+ }, void 0, false, {
1191
+ fileName: _jsxFileName,
1192
+ lineNumber: 843,
1193
+ columnNumber: 13
1194
+ }, this) : null
854
1195
  ]
855
- }),
856
- /* @__PURE__ */ jsxs("div", {
1196
+ }, void 0, true, {
1197
+ fileName: _jsxFileName,
1198
+ lineNumber: 804,
1199
+ columnNumber: 9
1200
+ }, this),
1201
+ /* @__PURE__ */ jsxDEV("div", {
857
1202
  className: "flex min-w-0 items-center gap-1.5 pl-0.5",
858
- children: [/* @__PURE__ */ jsxs("span", {
1203
+ children: [/* @__PURE__ */ jsxDEV("span", {
859
1204
  "data-slot": "kit-image-caption",
860
1205
  className: "min-w-0 flex-1 truncate text-kit-xs text-kit-fg-3",
861
1206
  children: [
862
1207
  name,
863
- size ? /* @__PURE__ */ jsxs(Fragment, { children: [" · ", /* @__PURE__ */ jsxs("span", {
1208
+ size ? /* @__PURE__ */ jsxDEV(Fragment, { children: [" · ", /* @__PURE__ */ jsxDEV("span", {
864
1209
  className: "tabular-nums",
865
1210
  children: [
866
1211
  size.w,
867
1212
  " × ",
868
1213
  size.h
869
1214
  ]
870
- })] }) : null,
1215
+ }, void 0, true, {
1216
+ fileName: _jsxFileName,
1217
+ lineNumber: 854,
1218
+ columnNumber: 17
1219
+ }, this)] }, void 0, true, {
1220
+ fileName: _jsxFileName,
1221
+ lineNumber: 852,
1222
+ columnNumber: 15
1223
+ }, this) : null,
871
1224
  " · ",
872
- alt ? /* @__PURE__ */ jsx("span", {
1225
+ alt ? /* @__PURE__ */ jsxDEV("span", {
873
1226
  className: "text-kit-fg-2",
874
1227
  children: "Alt text set"
875
- }) : /* @__PURE__ */ jsxs("span", {
1228
+ }, void 0, false, {
1229
+ fileName: _jsxFileName,
1230
+ lineNumber: 861,
1231
+ columnNumber: 15
1232
+ }, this) : /* @__PURE__ */ jsxDEV("span", {
876
1233
  className: "inline-flex items-center gap-0.5 text-kit-warning-fg",
877
- children: [/* @__PURE__ */ jsx(IconAlertTriangle, {
1234
+ children: [/* @__PURE__ */ jsxDEV(IconAlertTriangle, {
878
1235
  className: "size-3",
879
1236
  stroke: 1.5,
880
1237
  "aria-hidden": true
881
- }), "No alt text"]
882
- })
1238
+ }, void 0, false, {
1239
+ fileName: _jsxFileName,
1240
+ lineNumber: 864,
1241
+ columnNumber: 17
1242
+ }, this), "No alt text"]
1243
+ }, void 0, true, {
1244
+ fileName: _jsxFileName,
1245
+ lineNumber: 863,
1246
+ columnNumber: 15
1247
+ }, this)
883
1248
  ]
884
- }), /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
1249
+ }, void 0, true, {
1250
+ fileName: _jsxFileName,
1251
+ lineNumber: 849,
1252
+ columnNumber: 11
1253
+ }, this), /* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
885
1254
  "aria-label": "Image actions",
886
1255
  className: "flex size-6 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",
887
- children: /* @__PURE__ */ jsx(IconDots, {
1256
+ children: /* @__PURE__ */ jsxDEV(IconDots, {
888
1257
  className: "size-4",
889
1258
  stroke: 1.5,
890
1259
  "aria-hidden": true
891
- })
892
- }), /* @__PURE__ */ jsxs(MenuContent, {
1260
+ }, void 0, false, {
1261
+ fileName: _jsxFileName,
1262
+ lineNumber: 874,
1263
+ columnNumber: 15
1264
+ }, this)
1265
+ }, void 0, false, {
1266
+ fileName: _jsxFileName,
1267
+ lineNumber: 870,
1268
+ columnNumber: 13
1269
+ }, this), /* @__PURE__ */ jsxDEV(MenuContent, {
893
1270
  align: "end",
894
1271
  className: "w-52",
895
1272
  children: [
896
- /* @__PURE__ */ jsx(MenuItem, {
897
- icon: /* @__PURE__ */ jsx(IconFocusCentered, { stroke: 1.5 }),
1273
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1274
+ icon: /* @__PURE__ */ jsxDEV(IconFocusCentered, { stroke: 1.5 }, void 0, false, {
1275
+ fileName: _jsxFileName,
1276
+ lineNumber: 877,
1277
+ columnNumber: 31
1278
+ }, this),
898
1279
  onClick: openDetails,
899
1280
  children: "Alt text and details"
900
- }),
901
- /* @__PURE__ */ jsx(MenuItem, {
902
- icon: /* @__PURE__ */ jsx(IconReplace, { stroke: 1.5 }),
1281
+ }, void 0, false, {
1282
+ fileName: _jsxFileName,
1283
+ lineNumber: 877,
1284
+ columnNumber: 15
1285
+ }, this),
1286
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1287
+ icon: /* @__PURE__ */ jsxDEV(IconReplace, { stroke: 1.5 }, void 0, false, {
1288
+ fileName: _jsxFileName,
1289
+ lineNumber: 881,
1290
+ columnNumber: 31
1291
+ }, this),
903
1292
  disabled: !library,
904
1293
  onClick: library,
905
1294
  children: "Replace"
906
- }),
907
- /* @__PURE__ */ jsx(MenuItem, {
908
- icon: /* @__PURE__ */ jsx(IconExternalLink, { stroke: 1.5 }),
1295
+ }, void 0, false, {
1296
+ fileName: _jsxFileName,
1297
+ lineNumber: 881,
1298
+ columnNumber: 15
1299
+ }, this),
1300
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1301
+ icon: /* @__PURE__ */ jsxDEV(IconExternalLink, { stroke: 1.5 }, void 0, false, {
1302
+ fileName: _jsxFileName,
1303
+ lineNumber: 884,
1304
+ columnNumber: 31
1305
+ }, this),
909
1306
  onClick: () => window.open(src(v.url), "_blank", "noopener"),
910
1307
  children: "Open original"
911
- }),
912
- /* @__PURE__ */ jsx(MenuSeparator, {}),
913
- /* @__PURE__ */ jsx(MenuItem, {
1308
+ }, void 0, false, {
1309
+ fileName: _jsxFileName,
1310
+ lineNumber: 884,
1311
+ columnNumber: 15
1312
+ }, this),
1313
+ /* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
1314
+ fileName: _jsxFileName,
1315
+ lineNumber: 887,
1316
+ columnNumber: 15
1317
+ }, this),
1318
+ /* @__PURE__ */ jsxDEV(MenuItem, {
914
1319
  danger: true,
915
- icon: /* @__PURE__ */ jsx(IconTrash, { stroke: 1.5 }),
1320
+ icon: /* @__PURE__ */ jsxDEV(IconTrash, { stroke: 1.5 }, void 0, false, {
1321
+ fileName: _jsxFileName,
1322
+ lineNumber: 888,
1323
+ columnNumber: 38
1324
+ }, this),
916
1325
  disabled: readOnly,
917
1326
  onClick: () => !readOnly && onChange(null),
918
1327
  children: "Remove"
919
- })
1328
+ }, void 0, false, {
1329
+ fileName: _jsxFileName,
1330
+ lineNumber: 888,
1331
+ columnNumber: 15
1332
+ }, this)
920
1333
  ]
921
- })] })]
922
- }),
923
- up.error ? /* @__PURE__ */ jsx(Reason, { children: up.error }) : null
1334
+ }, void 0, true, {
1335
+ fileName: _jsxFileName,
1336
+ lineNumber: 876,
1337
+ columnNumber: 13
1338
+ }, this)] }, void 0, true, {
1339
+ fileName: _jsxFileName,
1340
+ lineNumber: 869,
1341
+ columnNumber: 11
1342
+ }, this)]
1343
+ }, void 0, true, {
1344
+ fileName: _jsxFileName,
1345
+ lineNumber: 848,
1346
+ columnNumber: 9
1347
+ }, this),
1348
+ up.error ? /* @__PURE__ */ jsxDEV(Reason, { children: up.error }, void 0, false, {
1349
+ fileName: _jsxFileName,
1350
+ lineNumber: 894,
1351
+ columnNumber: 21
1352
+ }, this) : null
924
1353
  ]
925
- }),
926
- /* @__PURE__ */ jsx(PopoverContent, {
1354
+ }, void 0, true, {
1355
+ fileName: _jsxFileName,
1356
+ lineNumber: 794,
1357
+ columnNumber: 7
1358
+ }, this),
1359
+ /* @__PURE__ */ jsxDEV(PopoverContent, {
927
1360
  className: "w-[320px]",
928
1361
  align: "start",
929
1362
  side: "bottom",
930
- children: /* @__PURE__ */ jsx(ImageDetails, {
1363
+ children: /* @__PURE__ */ jsxDEV(ImageDetails, {
931
1364
  v,
932
1365
  onChange,
933
1366
  readOnly,
@@ -937,28 +1370,44 @@ function ImageControl({ field, value, onChange: write, readOnly, id, path }) {
937
1370
  size,
938
1371
  asset,
939
1372
  fit
940
- })
941
- }),
942
- /* @__PURE__ */ jsx(MediaPicker, {
1373
+ }, void 0, false, {
1374
+ fileName: _jsxFileName,
1375
+ lineNumber: 897,
1376
+ columnNumber: 9
1377
+ }, this)
1378
+ }, void 0, false, {
1379
+ fileName: _jsxFileName,
1380
+ lineNumber: 896,
1381
+ columnNumber: 7
1382
+ }, this),
1383
+ /* @__PURE__ */ jsxDEV(MediaPicker, {
943
1384
  open: picker,
944
1385
  onOpenChange: setPicker,
945
1386
  accept: kinds,
946
1387
  onPick: (a) => a[0] && replace(a[0])
947
- })
1388
+ }, void 0, false, {
1389
+ fileName: _jsxFileName,
1390
+ lineNumber: 899,
1391
+ columnNumber: 7
1392
+ }, this)
948
1393
  ]
949
- });
1394
+ }, void 0, true, {
1395
+ fileName: _jsxFileName,
1396
+ lineNumber: 793,
1397
+ columnNumber: 5
1398
+ }, this);
950
1399
  }
951
1400
  function Thumb({ item, label, readOnly, sort, onRemove, onOpen, fit: known }) {
952
1401
  const { src } = useMedia();
953
1402
  const { fit, ref, onLoad } = useLoadedFit(known, item.v.url);
954
1403
  const handle = sort.handle(item.key);
955
- return /* @__PURE__ */ jsxs("div", {
1404
+ return /* @__PURE__ */ jsxDEV("div", {
956
1405
  ref: sort.register(item.key),
957
1406
  role: "listitem",
958
1407
  style: sort.style(item.key),
959
1408
  className: cn("group/thumb relative aspect-square cursor-grab touch-none overflow-hidden rounded-kit-md border border-kit-line active:cursor-grabbing", fit === "contain" ? CHECKER : "bg-kit-muted", sort.active === item.key && "z-10 opacity-90 shadow-kit-lg ring-2 ring-kit-line-strong"),
960
1409
  children: [
961
- /* @__PURE__ */ jsx("div", {
1410
+ /* @__PURE__ */ jsxDEV("div", {
962
1411
  ...readOnly ? {} : handle,
963
1412
  role: void 0,
964
1413
  tabIndex: 0,
@@ -978,7 +1427,7 @@ function Thumb({ item, label, readOnly, sort, onRemove, onOpen, fit: known }) {
978
1427
  if (!readOnly) handle.onKeyDown(e);
979
1428
  },
980
1429
  className: "size-full outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-kit-focus-ring focus-visible:[outline-style:solid] [html[data-input-modality=pointer]_&]:focus-visible:outline-none",
981
- children: /* @__PURE__ */ jsx("img", {
1430
+ children: /* @__PURE__ */ jsxDEV("img", {
982
1431
  src: src(item.v.url),
983
1432
  alt: item.v.alt ?? "",
984
1433
  ref,
@@ -986,14 +1435,26 @@ function Thumb({ item, label, readOnly, sort, onRemove, onOpen, fit: known }) {
986
1435
  "data-slot": "kit-gallery-thumb",
987
1436
  className: cn("pointer-events-none size-full select-none", fit === "contain" ? "object-contain" : "object-cover"),
988
1437
  draggable: false
989
- })
990
- }),
991
- !item.v.alt ? /* @__PURE__ */ jsx("span", {
1438
+ }, void 0, false, {
1439
+ fileName: _jsxFileName,
1440
+ lineNumber: 961,
1441
+ columnNumber: 9
1442
+ }, this)
1443
+ }, void 0, false, {
1444
+ fileName: _jsxFileName,
1445
+ lineNumber: 940,
1446
+ columnNumber: 7
1447
+ }, this),
1448
+ !item.v.alt ? /* @__PURE__ */ jsxDEV("span", {
992
1449
  role: "img",
993
1450
  className: "absolute bottom-1 left-1 size-1.5 rounded-full bg-kit-warning ring-2 ring-kit-surface",
994
1451
  "aria-label": "No alt text"
995
- }) : null,
996
- readOnly ? null : /* @__PURE__ */ jsx("button", {
1452
+ }, void 0, false, {
1453
+ fileName: _jsxFileName,
1454
+ lineNumber: 963,
1455
+ columnNumber: 22
1456
+ }, this) : null,
1457
+ readOnly ? null : /* @__PURE__ */ jsxDEV("button", {
997
1458
  type: "button",
998
1459
  "aria-label": (() => {
999
1460
  const what = item.v.alt || item.v.name || fileNameFromUrl(item.v.url);
@@ -1002,14 +1463,26 @@ function Thumb({ item, label, readOnly, sort, onRemove, onOpen, fit: known }) {
1002
1463
  onPointerDown: (e) => e.stopPropagation(),
1003
1464
  onClick: onRemove,
1004
1465
  className: "absolute right-1 top-1 flex size-6 items-center justify-center rounded-kit-md bg-kit-inverse/80 text-kit-fg-inverse opacity-0 transition-opacity focus-visible:opacity-100 group-hover/thumb:opacity-100 pointer-coarse:opacity-100",
1005
- children: /* @__PURE__ */ jsx(IconX, {
1466
+ children: /* @__PURE__ */ jsxDEV(IconX, {
1006
1467
  className: "size-3.5",
1007
1468
  stroke: 1.5,
1008
1469
  "aria-hidden": true
1009
- })
1010
- })
1470
+ }, void 0, false, {
1471
+ fileName: _jsxFileName,
1472
+ lineNumber: 976,
1473
+ columnNumber: 11
1474
+ }, this)
1475
+ }, void 0, false, {
1476
+ fileName: _jsxFileName,
1477
+ lineNumber: 965,
1478
+ columnNumber: 9
1479
+ }, this)
1011
1480
  ]
1012
- });
1481
+ }, void 0, true, {
1482
+ fileName: _jsxFileName,
1483
+ lineNumber: 929,
1484
+ columnNumber: 5
1485
+ }, this);
1013
1486
  }
1014
1487
  /** An array of images: a sortable grid of tiles with a dashed "Add images" tile last (hidden at `max`). */
1015
1488
  function GalleryControl({ value, onChange, readOnly, field, id, path }) {
@@ -1047,15 +1520,15 @@ function GalleryControl({ value, onChange, readOnly, field, id, path }) {
1047
1520
  const max = field.validation?.max;
1048
1521
  const canAdd = !readOnly && (max == null || items.length < max) && (s.MediaPicker || up.run);
1049
1522
  const noun = (i, it) => it.v.name ?? (fileNameFromUrl(it.v.url) || `Image ${i + 1}`);
1050
- return /* @__PURE__ */ jsxs("div", {
1523
+ return /* @__PURE__ */ jsxDEV("div", {
1051
1524
  className: "flex flex-col gap-2",
1052
1525
  children: [
1053
- /* @__PURE__ */ jsxs("div", {
1526
+ /* @__PURE__ */ jsxDEV("div", {
1054
1527
  id,
1055
1528
  role: "list",
1056
1529
  "aria-label": field.title,
1057
1530
  className: "grid grid-cols-3 gap-1.5 @[520px]:grid-cols-5",
1058
- children: [items.map((it, i) => /* @__PURE__ */ jsx(Thumb, {
1531
+ children: [items.map((it, i) => /* @__PURE__ */ jsxDEV(Thumb, {
1059
1532
  item: it,
1060
1533
  fit: fitOf(it.raw, field, void 0, true),
1061
1534
  label: noun(i, it),
@@ -1067,10 +1540,14 @@ function GalleryControl({ value, onChange, readOnly, field, id, path }) {
1067
1540
  title: noun(i, it)
1068
1541
  }) : window.open(src(it.v.url), "_blank", "noopener"),
1069
1542
  onRemove: () => write(raw.filter((_, j) => j !== i))
1070
- }, it.key)), canAdd ? /* @__PURE__ */ jsx("div", {
1543
+ }, it.key, false, {
1544
+ fileName: _jsxFileName,
1545
+ lineNumber: 1022,
1546
+ columnNumber: 11
1547
+ }, this)), canAdd ? /* @__PURE__ */ jsxDEV("div", {
1071
1548
  role: "listitem",
1072
1549
  className: "grid",
1073
- children: /* @__PURE__ */ jsxs("button", {
1550
+ children: /* @__PURE__ */ jsxDEV("button", {
1074
1551
  type: "button",
1075
1552
  onClick: () => s.MediaPicker ? setPicker(true) : up.run && document.getElementById(`${id}-files`)?.click(),
1076
1553
  onPaste: (e) => {
@@ -1087,16 +1564,32 @@ function GalleryControl({ value, onChange, readOnly, field, id, path }) {
1087
1564
  up.run(Array.from(e.dataTransfer.files));
1088
1565
  },
1089
1566
  className: "flex aspect-square flex-col items-center justify-center gap-1 rounded-kit-md border border-dashed border-kit-line-strong bg-kit-subtle text-kit-xs text-kit-fg-3 transition-colors hover:border-kit-field-border-hover hover:text-kit-fg",
1090
- children: [/* @__PURE__ */ jsx(IconPlus, {
1567
+ children: [/* @__PURE__ */ jsxDEV(IconPlus, {
1091
1568
  className: "size-4",
1092
1569
  stroke: 1.5,
1093
1570
  "aria-hidden": true
1094
- }), "Add images"]
1095
- })
1096
- }) : null]
1097
- }),
1571
+ }, void 0, false, {
1572
+ fileName: _jsxFileName,
1573
+ lineNumber: 1057,
1574
+ columnNumber: 15
1575
+ }, this), "Add images"]
1576
+ }, void 0, true, {
1577
+ fileName: _jsxFileName,
1578
+ lineNumber: 1039,
1579
+ columnNumber: 13
1580
+ }, this)
1581
+ }, void 0, false, {
1582
+ fileName: _jsxFileName,
1583
+ lineNumber: 1038,
1584
+ columnNumber: 11
1585
+ }, this) : null]
1586
+ }, void 0, true, {
1587
+ fileName: _jsxFileName,
1588
+ lineNumber: 1020,
1589
+ columnNumber: 7
1590
+ }, this),
1098
1591
  sort.a11y,
1099
- up.run && !s.MediaPicker ? /* @__PURE__ */ jsx("input", {
1592
+ up.run && !s.MediaPicker ? /* @__PURE__ */ jsxDEV("input", {
1100
1593
  id: `${id}-files`,
1101
1594
  type: "file",
1102
1595
  hidden: true,
@@ -1108,27 +1601,51 @@ function GalleryControl({ value, onChange, readOnly, field, id, path }) {
1108
1601
  up.run?.(Array.from(e.target.files ?? []));
1109
1602
  e.target.value = "";
1110
1603
  }
1111
- }) : null,
1112
- up.progress != null ? /* @__PURE__ */ jsx(Progress, {
1604
+ }, void 0, false, {
1605
+ fileName: _jsxFileName,
1606
+ lineNumber: 1065,
1607
+ columnNumber: 9
1608
+ }, this) : null,
1609
+ up.progress != null ? /* @__PURE__ */ jsxDEV(Progress, {
1113
1610
  value: up.progress,
1114
1611
  tone: "ink",
1115
1612
  size: "sm",
1116
1613
  label: "Upload progress"
1117
- }) : null,
1118
- up.error ? /* @__PURE__ */ jsx(Reason, { children: up.error }) : null,
1119
- !readOnly && !s.MediaPicker && !up.run ? /* @__PURE__ */ jsx(Reason, {
1614
+ }, void 0, false, {
1615
+ fileName: _jsxFileName,
1616
+ lineNumber: 1079,
1617
+ columnNumber: 30
1618
+ }, this) : null,
1619
+ up.error ? /* @__PURE__ */ jsxDEV(Reason, { children: up.error }, void 0, false, {
1620
+ fileName: _jsxFileName,
1621
+ lineNumber: 1080,
1622
+ columnNumber: 19
1623
+ }, this) : null,
1624
+ !readOnly && !s.MediaPicker && !up.run ? /* @__PURE__ */ jsxDEV(Reason, {
1120
1625
  tone: "muted",
1121
1626
  children: NO_SOURCE
1122
- }) : null,
1123
- /* @__PURE__ */ jsx(MediaPicker, {
1627
+ }, void 0, false, {
1628
+ fileName: _jsxFileName,
1629
+ lineNumber: 1081,
1630
+ columnNumber: 49
1631
+ }, this) : null,
1632
+ /* @__PURE__ */ jsxDEV(MediaPicker, {
1124
1633
  open: picker,
1125
1634
  onOpenChange: setPicker,
1126
1635
  multiple: true,
1127
1636
  accept: ["image", "svg"],
1128
1637
  onPick: (a) => a.length && add(max != null ? a.slice(0, Math.max(0, max - items.length)) : a)
1129
- })
1638
+ }, void 0, false, {
1639
+ fileName: _jsxFileName,
1640
+ lineNumber: 1082,
1641
+ columnNumber: 7
1642
+ }, this)
1130
1643
  ]
1131
- });
1644
+ }, void 0, true, {
1645
+ fileName: _jsxFileName,
1646
+ lineNumber: 1019,
1647
+ columnNumber: 5
1648
+ }, this);
1132
1649
  }
1133
1650
  var normFile = (v) => {
1134
1651
  if (typeof v === "string") return v ? { url: v } : null;
@@ -1149,89 +1666,173 @@ function FileControl({ value, onChange, readOnly, id }) {
1149
1666
  const [picker, setPicker] = React.useState(false);
1150
1667
  const up = useUpload("*", "file", (a) => a[0] && onChange(fileFromAsset(a[0])));
1151
1668
  const library = s.MediaPicker && !readOnly ? () => setPicker(true) : void 0;
1152
- const pickerEl = /* @__PURE__ */ jsx(MediaPicker, {
1669
+ const pickerEl = /* @__PURE__ */ jsxDEV(MediaPicker, {
1153
1670
  open: picker,
1154
1671
  onOpenChange: setPicker,
1155
1672
  accept: ["file"],
1156
1673
  onPick: (a) => a[0] && onChange(fileFromAsset(a[0]))
1157
- });
1158
- if (!v) return /* @__PURE__ */ jsxs("div", {
1674
+ }, void 0, false, {
1675
+ fileName: _jsxFileName,
1676
+ lineNumber: 1103,
1677
+ columnNumber: 20
1678
+ }, this);
1679
+ if (!v) return /* @__PURE__ */ jsxDEV("div", {
1159
1680
  className: "flex flex-col gap-1.5",
1160
1681
  children: [
1161
- /* @__PURE__ */ jsx(DropWell, {
1682
+ /* @__PURE__ */ jsxDEV(DropWell, {
1162
1683
  id,
1163
1684
  title: "Add a file",
1164
1685
  hint: "Or drop or paste one here",
1165
1686
  accept: "*",
1166
- icon: /* @__PURE__ */ jsx(IconFileText, { stroke: 1.5 }),
1687
+ icon: /* @__PURE__ */ jsxDEV(IconFileText, { stroke: 1.5 }, void 0, false, {
1688
+ fileName: _jsxFileName,
1689
+ lineNumber: 1107,
1690
+ columnNumber: 96
1691
+ }, this),
1167
1692
  onFiles: up.run,
1168
1693
  onLibrary: library,
1169
1694
  refuse: up.setError,
1170
1695
  disabled: readOnly,
1171
1696
  progress: up.progress
1172
- }),
1173
- up.error ? /* @__PURE__ */ jsx(Reason, { children: up.error }) : null,
1697
+ }, void 0, false, {
1698
+ fileName: _jsxFileName,
1699
+ lineNumber: 1107,
1700
+ columnNumber: 9
1701
+ }, this),
1702
+ up.error ? /* @__PURE__ */ jsxDEV(Reason, { children: up.error }, void 0, false, {
1703
+ fileName: _jsxFileName,
1704
+ lineNumber: 1108,
1705
+ columnNumber: 21
1706
+ }, this) : null,
1174
1707
  pickerEl
1175
1708
  ]
1176
- });
1709
+ }, void 0, true, {
1710
+ fileName: _jsxFileName,
1711
+ lineNumber: 1106,
1712
+ columnNumber: 7
1713
+ }, this);
1177
1714
  const name = asset?.name ?? v.name ?? fileNameFromUrl(v.url);
1178
1715
  const ext = (name.includes(".") ? name.split(".").pop() : "")?.toUpperCase() || "FILE";
1179
1716
  const meta = [ext.toLowerCase(), asset?.size ? formatBytes(asset.size) : null].filter(Boolean).join(" · ");
1180
- return /* @__PURE__ */ jsxs("div", {
1717
+ return /* @__PURE__ */ jsxDEV("div", {
1181
1718
  className: "flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-control-bg p-2",
1182
1719
  children: [
1183
- /* @__PURE__ */ jsx("span", {
1720
+ /* @__PURE__ */ jsxDEV("span", {
1184
1721
  "aria-hidden": true,
1185
1722
  className: "flex size-14 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-subtle font-kit-mono text-kit-2xs font-medium text-kit-fg-2",
1186
1723
  children: ext
1187
- }),
1188
- /* @__PURE__ */ jsxs("div", {
1724
+ }, void 0, false, {
1725
+ fileName: _jsxFileName,
1726
+ lineNumber: 1117,
1727
+ columnNumber: 7
1728
+ }, this),
1729
+ /* @__PURE__ */ jsxDEV("div", {
1189
1730
  className: "min-w-0 flex-1",
1190
- children: [/* @__PURE__ */ jsx("a", {
1731
+ children: [/* @__PURE__ */ jsxDEV("a", {
1191
1732
  id,
1192
1733
  href: src(v.url),
1193
1734
  target: "_blank",
1194
1735
  rel: "noreferrer",
1195
1736
  className: "block truncate text-kit-sm font-medium text-kit-accent-fg hover:underline",
1196
1737
  children: name
1197
- }), /* @__PURE__ */ jsx("div", {
1738
+ }, void 0, false, {
1739
+ fileName: _jsxFileName,
1740
+ lineNumber: 1121,
1741
+ columnNumber: 9
1742
+ }, this), /* @__PURE__ */ jsxDEV("div", {
1198
1743
  className: "text-kit-xs text-kit-fg-3",
1199
1744
  children: meta
1200
- })]
1201
- }),
1202
- library ? /* @__PURE__ */ jsx(Button, {
1745
+ }, void 0, false, {
1746
+ fileName: _jsxFileName,
1747
+ lineNumber: 1124,
1748
+ columnNumber: 9
1749
+ }, this)]
1750
+ }, void 0, true, {
1751
+ fileName: _jsxFileName,
1752
+ lineNumber: 1120,
1753
+ columnNumber: 7
1754
+ }, this),
1755
+ library ? /* @__PURE__ */ jsxDEV(Button, {
1203
1756
  size: "sm",
1204
1757
  variant: "ghost",
1205
1758
  onClick: library,
1206
1759
  children: "Replace"
1207
- }) : null,
1208
- /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
1209
- render: /* @__PURE__ */ jsx(IconButton, {
1760
+ }, void 0, false, {
1761
+ fileName: _jsxFileName,
1762
+ lineNumber: 1127,
1763
+ columnNumber: 9
1764
+ }, this) : null,
1765
+ /* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
1766
+ render: /* @__PURE__ */ jsxDEV(IconButton, {
1210
1767
  label: "File actions",
1211
1768
  size: "sm"
1212
- }),
1213
- children: /* @__PURE__ */ jsx(IconDots, { stroke: 1.5 })
1214
- }), /* @__PURE__ */ jsxs(MenuContent, {
1769
+ }, void 0, false, {
1770
+ fileName: _jsxFileName,
1771
+ lineNumber: 1132,
1772
+ columnNumber: 30
1773
+ }, this),
1774
+ children: /* @__PURE__ */ jsxDEV(IconDots, { stroke: 1.5 }, void 0, false, {
1775
+ fileName: _jsxFileName,
1776
+ lineNumber: 1133,
1777
+ columnNumber: 11
1778
+ }, this)
1779
+ }, void 0, false, {
1780
+ fileName: _jsxFileName,
1781
+ lineNumber: 1132,
1782
+ columnNumber: 9
1783
+ }, this), /* @__PURE__ */ jsxDEV(MenuContent, {
1215
1784
  align: "end",
1216
1785
  children: [
1217
- /* @__PURE__ */ jsx(MenuItem, {
1218
- icon: /* @__PURE__ */ jsx(IconDownload, { stroke: 1.5 }),
1786
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1787
+ icon: /* @__PURE__ */ jsxDEV(IconDownload, { stroke: 1.5 }, void 0, false, {
1788
+ fileName: _jsxFileName,
1789
+ lineNumber: 1136,
1790
+ columnNumber: 27
1791
+ }, this),
1219
1792
  onClick: () => window.open(src(v.url), "_blank", "noopener"),
1220
1793
  children: "Open"
1221
- }),
1222
- /* @__PURE__ */ jsx(MenuSeparator, {}),
1223
- /* @__PURE__ */ jsx(MenuItem, {
1794
+ }, void 0, false, {
1795
+ fileName: _jsxFileName,
1796
+ lineNumber: 1136,
1797
+ columnNumber: 11
1798
+ }, this),
1799
+ /* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
1800
+ fileName: _jsxFileName,
1801
+ lineNumber: 1139,
1802
+ columnNumber: 11
1803
+ }, this),
1804
+ /* @__PURE__ */ jsxDEV(MenuItem, {
1224
1805
  danger: true,
1225
- icon: /* @__PURE__ */ jsx(IconTrash, { stroke: 1.5 }),
1806
+ icon: /* @__PURE__ */ jsxDEV(IconTrash, { stroke: 1.5 }, void 0, false, {
1807
+ fileName: _jsxFileName,
1808
+ lineNumber: 1140,
1809
+ columnNumber: 34
1810
+ }, this),
1226
1811
  disabled: readOnly,
1227
1812
  onClick: () => !readOnly && onChange(null),
1228
1813
  children: "Remove"
1229
- })
1814
+ }, void 0, false, {
1815
+ fileName: _jsxFileName,
1816
+ lineNumber: 1140,
1817
+ columnNumber: 11
1818
+ }, this)
1230
1819
  ]
1231
- })] }),
1820
+ }, void 0, true, {
1821
+ fileName: _jsxFileName,
1822
+ lineNumber: 1135,
1823
+ columnNumber: 9
1824
+ }, this)] }, void 0, true, {
1825
+ fileName: _jsxFileName,
1826
+ lineNumber: 1131,
1827
+ columnNumber: 7
1828
+ }, this),
1232
1829
  pickerEl
1233
1830
  ]
1234
- });
1831
+ }, void 0, true, {
1832
+ fileName: _jsxFileName,
1833
+ lineNumber: 1116,
1834
+ columnNumber: 5
1835
+ }, this);
1235
1836
  }
1236
1837
  var videoProvider = (url) => /youtu/.test(url) ? "YouTube" : /vimeo/.test(url) ? "Vimeo" : /loom/.test(url) ? "Loom" : /\.(mp4|webm|mov)(\?|$)/i.test(url) ? "MP4" : url ? "Link" : "";
1237
1838
  var youTubeId = (url) => url.match(/(?:youtu\.be\/|v=|embed\/|shorts\/)([\w-]{11})/)?.[1];
@@ -1242,53 +1843,89 @@ function VideoPreview({ url, poster, title }) {
1242
1843
  React.useEffect(() => setPlaying(false), [url]);
1243
1844
  const yt = youTubeId(url);
1244
1845
  const thumb = poster ? src(poster) : yt ? `https://i.ytimg.com/vi/${yt}/hqdefault.jpg` : void 0;
1245
- if (playing && yt) return /* @__PURE__ */ jsx("iframe", {
1846
+ if (playing && yt) return /* @__PURE__ */ jsxDEV("iframe", {
1246
1847
  title,
1247
1848
  src: `https://www.youtube-nocookie.com/embed/${yt}?autoplay=1`,
1248
1849
  allow: "autoplay; encrypted-media",
1249
1850
  className: "aspect-video w-full rounded-kit-lg border border-kit-line"
1250
- });
1251
- if (playing && isFileVideo(url)) return /* @__PURE__ */ jsx("video", {
1851
+ }, void 0, false, {
1852
+ fileName: _jsxFileName,
1853
+ lineNumber: 1163,
1854
+ columnNumber: 12
1855
+ }, this);
1856
+ if (playing && isFileVideo(url)) return /* @__PURE__ */ jsxDEV("video", {
1252
1857
  src: src(url),
1253
1858
  poster: thumb,
1254
1859
  controls: true,
1255
1860
  autoPlay: true,
1256
1861
  className: "aspect-video w-full rounded-kit-lg border border-kit-line bg-kit-media-backdrop"
1257
- });
1862
+ }, void 0, false, {
1863
+ fileName: _jsxFileName,
1864
+ lineNumber: 1164,
1865
+ columnNumber: 43
1866
+ }, this);
1258
1867
  const playable = !!yt || isFileVideo(url);
1259
- return /* @__PURE__ */ jsxs("div", {
1868
+ return /* @__PURE__ */ jsxDEV("div", {
1260
1869
  className: "relative aspect-video overflow-hidden rounded-kit-lg border border-kit-line bg-kit-media-backdrop",
1261
1870
  children: [
1262
- thumb ? /* @__PURE__ */ jsx("img", {
1871
+ thumb ? /* @__PURE__ */ jsxDEV("img", {
1263
1872
  src: thumb,
1264
1873
  alt: `${title} poster`,
1265
1874
  className: "size-full object-cover opacity-85"
1266
- }) : null,
1267
- /* @__PURE__ */ jsx("button", {
1875
+ }, void 0, false, {
1876
+ fileName: _jsxFileName,
1877
+ lineNumber: 1168,
1878
+ columnNumber: 16
1879
+ }, this) : null,
1880
+ /* @__PURE__ */ jsxDEV("button", {
1268
1881
  type: "button",
1269
1882
  "aria-label": playable ? "Play preview" : "Open video link",
1270
1883
  onClick: () => playable ? setPlaying(true) : window.open(src(url), "_blank", "noopener"),
1271
1884
  className: "absolute inset-0 m-auto flex size-12 items-center justify-center rounded-full bg-kit-media-control text-kit-media-control-fg shadow-kit-lg transition-transform hover:scale-105",
1272
- children: playable ? /* @__PURE__ */ jsx(IconPlayerPlay, {
1885
+ children: playable ? /* @__PURE__ */ jsxDEV(IconPlayerPlay, {
1273
1886
  className: "size-5",
1274
1887
  stroke: 1.5,
1275
1888
  "aria-hidden": true
1276
- }) : /* @__PURE__ */ jsx(IconExternalLink, {
1889
+ }, void 0, false, {
1890
+ fileName: _jsxFileName,
1891
+ lineNumber: 1175,
1892
+ columnNumber: 21
1893
+ }, this) : /* @__PURE__ */ jsxDEV(IconExternalLink, {
1277
1894
  className: "size-5",
1278
1895
  stroke: 1.5,
1279
1896
  "aria-hidden": true
1280
- })
1281
- }),
1282
- /* @__PURE__ */ jsxs("span", {
1897
+ }, void 0, false, {
1898
+ fileName: _jsxFileName,
1899
+ lineNumber: 1175,
1900
+ columnNumber: 86
1901
+ }, this)
1902
+ }, void 0, false, {
1903
+ fileName: _jsxFileName,
1904
+ lineNumber: 1169,
1905
+ columnNumber: 7
1906
+ }, this),
1907
+ /* @__PURE__ */ jsxDEV("span", {
1283
1908
  className: "absolute left-2 top-2 inline-flex items-center gap-1 rounded-kit-md bg-kit-scrim px-1.5 py-0.5 text-kit-xs text-kit-on-scrim",
1284
- children: [/* @__PURE__ */ jsx(IconVideo, {
1909
+ children: [/* @__PURE__ */ jsxDEV(IconVideo, {
1285
1910
  className: "size-3.5",
1286
1911
  stroke: 1.5,
1287
1912
  "aria-hidden": true
1288
- }), videoProvider(url)]
1289
- })
1913
+ }, void 0, false, {
1914
+ fileName: _jsxFileName,
1915
+ lineNumber: 1178,
1916
+ columnNumber: 9
1917
+ }, this), videoProvider(url)]
1918
+ }, void 0, true, {
1919
+ fileName: _jsxFileName,
1920
+ lineNumber: 1177,
1921
+ columnNumber: 7
1922
+ }, this)
1290
1923
  ]
1291
- });
1924
+ }, void 0, true, {
1925
+ fileName: _jsxFileName,
1926
+ lineNumber: 1167,
1927
+ columnNumber: 5
1928
+ }, this);
1292
1929
  }
1293
1930
  /**
1294
1931
  * A URL input with a live preview. The value keeps its stored shape: a URL string stays a string, a `{ url, poster… }`
@@ -1312,10 +1949,10 @@ function VideoControl({ field, value, onChange, readOnly, id, onBlur }) {
1312
1949
  };
1313
1950
  const bad = draft.trim() !== "" && !isVideoUrl(draft);
1314
1951
  const errorId = `${id}-error`;
1315
- return /* @__PURE__ */ jsxs("div", {
1952
+ return /* @__PURE__ */ jsxDEV("div", {
1316
1953
  className: "flex flex-col gap-2",
1317
1954
  children: [
1318
- /* @__PURE__ */ jsx(Input, {
1955
+ /* @__PURE__ */ jsxDEV(Input, {
1319
1956
  id,
1320
1957
  value: draft,
1321
1958
  readOnly,
@@ -1332,28 +1969,52 @@ function VideoControl({ field, value, onChange, readOnly, id, onBlur }) {
1332
1969
  }
1333
1970
  },
1334
1971
  placeholder: "Paste a YouTube, Vimeo, Loom or MP4 link",
1335
- leading: /* @__PURE__ */ jsx(IconWorld, { stroke: 1.5 }),
1972
+ leading: /* @__PURE__ */ jsxDEV(IconWorld, { stroke: 1.5 }, void 0, false, {
1973
+ fileName: _jsxFileName,
1974
+ lineNumber: 1223,
1975
+ columnNumber: 18
1976
+ }, this),
1336
1977
  onChange: (e) => {
1337
1978
  setDraft(e.target.value);
1338
1979
  commit(e.target.value);
1339
1980
  }
1340
- }),
1341
- bad && touched ? /* @__PURE__ */ jsx("p", {
1981
+ }, void 0, false, {
1982
+ fileName: _jsxFileName,
1983
+ lineNumber: 1206,
1984
+ columnNumber: 7
1985
+ }, this),
1986
+ bad && touched ? /* @__PURE__ */ jsxDEV("p", {
1342
1987
  id: errorId,
1343
1988
  role: "alert",
1344
1989
  className: "text-kit-xs text-kit-danger-fg",
1345
1990
  children: "Not saved: use a full link starting with https://, or a site path starting with /."
1346
- }) : null,
1347
- stored ? /* @__PURE__ */ jsx(VideoPreview, {
1991
+ }, void 0, false, {
1992
+ fileName: _jsxFileName,
1993
+ lineNumber: 1230,
1994
+ columnNumber: 9
1995
+ }, this) : null,
1996
+ stored ? /* @__PURE__ */ jsxDEV(VideoPreview, {
1348
1997
  url: stored,
1349
1998
  poster: obj?.poster,
1350
1999
  title: field.title
1351
- }) : /* @__PURE__ */ jsx("p", {
2000
+ }, void 0, false, {
2001
+ fileName: _jsxFileName,
2002
+ lineNumber: 1236,
2003
+ columnNumber: 17
2004
+ }, this) : /* @__PURE__ */ jsxDEV("p", {
1352
2005
  className: "text-kit-xs text-kit-fg-3",
1353
2006
  children: "No video yet. The embed lazy-loads on the page, so it doesn't block the first paint."
1354
- })
2007
+ }, void 0, false, {
2008
+ fileName: _jsxFileName,
2009
+ lineNumber: 1236,
2010
+ columnNumber: 90
2011
+ }, this)
1355
2012
  ]
1356
- });
2013
+ }, void 0, true, {
2014
+ fileName: _jsxFileName,
2015
+ lineNumber: 1205,
2016
+ columnNumber: 5
2017
+ }, this);
1357
2018
  }
1358
2019
  //#endregion
1359
2020
  export { FileControl, GalleryControl, ImageControl, MediaPicker, VideoControl, VideoPreview, acceptsFile, cropChoice, fileNameFromUrl, formatBytes, fromAsset, isVideoUrl, normImage, useUpload, videoProvider, withCrop, youTubeId };