@questpie/admin 3.0.2 → 3.0.4

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 (249) hide show
  1. package/README.md +34 -5
  2. package/dist/client/blocks/block-renderer.d.mts +2 -2
  3. package/dist/client/blocks/block-renderer.mjs +4 -1
  4. package/dist/client/builder/types/action-types.d.mts +31 -3
  5. package/dist/client/builder/types/collection-types.d.mts +140 -0
  6. package/dist/client/builder/types/ui-config.d.mts +16 -2
  7. package/dist/client/builder/types/views.d.mts +57 -0
  8. package/dist/client/builder/types/widget-types.d.mts +5 -0
  9. package/dist/client/components/actions/action-button.mjs +137 -199
  10. package/dist/client/components/actions/action-dialog.mjs +198 -156
  11. package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
  12. package/dist/client/components/actions/header-actions.mjs +52 -53
  13. package/dist/client/components/admin-link.d.mts +2 -2
  14. package/dist/client/components/auth/auth-loading.mjs +41 -18
  15. package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
  16. package/dist/client/components/blocks/block-insert-button.mjs +4 -4
  17. package/dist/client/components/blocks/block-item.mjs +2 -2
  18. package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
  19. package/dist/client/components/component-renderer.mjs +1 -1
  20. package/dist/client/components/fields/array-field.mjs +14 -14
  21. package/dist/client/components/fields/asset-preview-field.mjs +1 -1
  22. package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
  23. package/dist/client/components/fields/json-field.mjs +2 -2
  24. package/dist/client/components/fields/object-array-field.mjs +22 -22
  25. package/dist/client/components/fields/object-field.mjs +5 -5
  26. package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
  27. package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
  28. package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
  29. package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
  30. package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
  31. package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
  32. package/dist/client/components/fields/relation-picker.mjs +7 -6
  33. package/dist/client/components/fields/relation-select.mjs +71 -47
  34. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
  35. package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
  36. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
  37. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
  38. package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
  39. package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
  40. package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
  41. package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
  42. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
  43. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
  44. package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
  45. package/dist/client/components/fields/upload-field.mjs +45 -49
  46. package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
  47. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
  48. package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
  49. package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
  50. package/dist/client/components/history-sidebar.mjs +850 -340
  51. package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
  52. package/dist/client/components/locale-switcher.mjs +8 -8
  53. package/dist/client/components/media/media-grid.mjs +12 -9
  54. package/dist/client/components/media/media-picker-dialog.mjs +242 -230
  55. package/dist/client/components/preview/live-preview-mode.mjs +1 -1
  56. package/dist/client/components/primitives/asset-preview.mjs +37 -22
  57. package/dist/client/components/primitives/date-input.mjs +212 -249
  58. package/dist/client/components/primitives/dropzone.mjs +192 -159
  59. package/dist/client/components/primitives/field-select-control.mjs +93 -0
  60. package/dist/client/components/primitives/select-multi.mjs +251 -230
  61. package/dist/client/components/primitives/select-single.mjs +345 -290
  62. package/dist/client/components/primitives/time-input.mjs +2 -2
  63. package/dist/client/components/sheets/resource-sheet.mjs +2 -0
  64. package/dist/client/components/ui/accordion.mjs +4 -4
  65. package/dist/client/components/ui/alert.mjs +3 -3
  66. package/dist/client/components/ui/badge.mjs +4 -4
  67. package/dist/client/components/ui/button.mjs +47 -37
  68. package/dist/client/components/ui/card.mjs +2 -2
  69. package/dist/client/components/ui/checkbox.mjs +1 -1
  70. package/dist/client/components/ui/command.mjs +5 -5
  71. package/dist/client/components/ui/dialog.mjs +3 -3
  72. package/dist/client/components/ui/drawer.mjs +1 -1
  73. package/dist/client/components/ui/dropdown-menu.mjs +157 -15
  74. package/dist/client/components/ui/empty-state.mjs +88 -59
  75. package/dist/client/components/ui/field.mjs +2 -2
  76. package/dist/client/components/ui/input-group.mjs +3 -3
  77. package/dist/client/components/ui/input.mjs +1 -1
  78. package/dist/client/components/ui/kbd.mjs +1 -1
  79. package/dist/client/components/ui/label.mjs +1 -1
  80. package/dist/client/components/ui/popover.mjs +19 -11
  81. package/dist/client/components/ui/scroll-fade.mjs +170 -0
  82. package/dist/client/components/ui/search-input.mjs +1 -1
  83. package/dist/client/components/ui/select.mjs +129 -27
  84. package/dist/client/components/ui/sheet.mjs +54 -34
  85. package/dist/client/components/ui/sidebar.mjs +15 -14
  86. package/dist/client/components/ui/skeleton.mjs +28 -12
  87. package/dist/client/components/ui/switch.mjs +2 -2
  88. package/dist/client/components/ui/table.mjs +82 -74
  89. package/dist/client/components/ui/tabs.mjs +26 -31
  90. package/dist/client/components/ui/textarea.mjs +1 -1
  91. package/dist/client/components/ui/tooltip.mjs +1 -1
  92. package/dist/client/components/widgets/chart-widget.mjs +134 -96
  93. package/dist/client/components/widgets/progress-widget.mjs +59 -34
  94. package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
  95. package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
  96. package/dist/client/components/widgets/stats-widget.mjs +91 -72
  97. package/dist/client/components/widgets/table-widget.mjs +159 -246
  98. package/dist/client/components/widgets/timeline-widget.mjs +66 -43
  99. package/dist/client/components/widgets/value-widget.mjs +261 -152
  100. package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
  101. package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
  102. package/dist/client/contexts/focus-context.d.mts +2 -2
  103. package/dist/client/hooks/use-action.mjs +63 -55
  104. package/dist/client/hooks/use-audit-history.mjs +1 -65
  105. package/dist/client/hooks/use-collection-validation.mjs +36 -23
  106. package/dist/client/hooks/use-collection.mjs +96 -1
  107. package/dist/client/hooks/use-saved-views.mjs +70 -49
  108. package/dist/client/hooks/use-server-actions.mjs +59 -40
  109. package/dist/client/hooks/use-server-validation.mjs +156 -41
  110. package/dist/client/hooks/use-server-widget-data.mjs +1 -1
  111. package/dist/client/hooks/use-setup-status.d.mts +3 -3
  112. package/dist/client/hooks/use-setup-status.mjs +2 -2
  113. package/dist/client/hooks/use-transition-stage.mjs +2 -10
  114. package/dist/client/hooks/use-validation-error-map.mjs +31 -13
  115. package/dist/client/hooks/use-view-state.mjs +238 -174
  116. package/dist/client/i18n/date-locale.mjs +33 -0
  117. package/dist/client/i18n/hooks.mjs +17 -1
  118. package/dist/client/lib/utils.mjs +3 -2
  119. package/dist/client/preview/block-scope-context.d.mts +2 -2
  120. package/dist/client/preview/preview-banner.d.mts +2 -2
  121. package/dist/client/preview/preview-field.d.mts +4 -4
  122. package/dist/client/preview/preview-field.mjs +2 -2
  123. package/dist/client/runtime/provider.mjs +8 -1
  124. package/dist/client/runtime/translations-provider.mjs +1 -1
  125. package/dist/client/scope/picker.d.mts +2 -2
  126. package/dist/client/scope/provider.d.mts +2 -2
  127. package/dist/client/styles/base.css +1022 -0
  128. package/dist/client/styles/index.css +3 -589
  129. package/dist/client/utils/auto-expand-fields.mjs +4 -2
  130. package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
  131. package/dist/client/utils/use-lazy-component.mjs +80 -0
  132. package/dist/client/views/auth/auth-layout.d.mts +18 -11
  133. package/dist/client/views/auth/auth-layout.mjs +291 -80
  134. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  135. package/dist/client/views/auth/forgot-password-form.mjs +2 -2
  136. package/dist/client/views/auth/login-form.d.mts +2 -2
  137. package/dist/client/views/auth/login-form.mjs +1 -1
  138. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  139. package/dist/client/views/auth/reset-password-form.mjs +2 -2
  140. package/dist/client/views/auth/setup-form.d.mts +2 -2
  141. package/dist/client/views/collection/auto-form-fields.mjs +11 -9
  142. package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
  143. package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
  144. package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
  145. package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
  146. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
  147. package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
  148. package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
  149. package/dist/client/views/collection/columns/build-columns.mjs +29 -9
  150. package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
  151. package/dist/client/views/collection/field-renderer.mjs +50 -89
  152. package/dist/client/views/collection/form-view.mjs +237 -227
  153. package/dist/client/views/collection/table-view.mjs +1162 -229
  154. package/dist/client/views/collection/view-skeletons.mjs +222 -79
  155. package/dist/client/views/common/global-search.mjs +29 -18
  156. package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
  157. package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
  158. package/dist/client/views/dashboard/widget-card.mjs +23 -14
  159. package/dist/client/views/globals/global-form-view.mjs +634 -589
  160. package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
  161. package/dist/client/views/layout/admin-layout.d.mts +3 -6
  162. package/dist/client/views/layout/admin-layout.mjs +149 -172
  163. package/dist/client/views/layout/admin-router.mjs +747 -544
  164. package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
  165. package/dist/client/views/layout/admin-sidebar.mjs +751 -591
  166. package/dist/client/views/layout/admin-theme.d.mts +10 -0
  167. package/dist/client/views/layout/admin-theme.mjs +84 -0
  168. package/dist/client/views/layout/admin-view-layout.mjs +161 -0
  169. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  170. package/dist/client/views/pages/accept-invite-page.mjs +49 -26
  171. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  172. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  173. package/dist/client/views/pages/forgot-password-page.mjs +2 -19
  174. package/dist/client/views/pages/invite-page.d.mts +2 -2
  175. package/dist/client/views/pages/invite-page.mjs +2 -19
  176. package/dist/client/views/pages/login-page.d.mts +3 -3
  177. package/dist/client/views/pages/login-page.mjs +4 -21
  178. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  179. package/dist/client/views/pages/reset-password-page.mjs +3 -20
  180. package/dist/client/views/pages/setup-page.d.mts +2 -2
  181. package/dist/client/views/pages/setup-page.mjs +3 -20
  182. package/dist/client.d.mts +6 -2
  183. package/dist/client.mjs +2 -1
  184. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  185. package/dist/index.d.mts +6 -2
  186. package/dist/index.mjs +2 -1
  187. package/dist/server/augmentation/dashboard.d.mts +67 -3
  188. package/dist/server/augmentation/form-layout.d.mts +21 -0
  189. package/dist/server/augmentation/index.d.mts +1 -1
  190. package/dist/server/codegen/admin-client-template.mjs +4 -0
  191. package/dist/server/fields/blocks.d.mts +1 -1
  192. package/dist/server/fields/blocks.mjs +12 -0
  193. package/dist/server/fields/rich-text.d.mts +1 -1
  194. package/dist/server/fields/rich-text.mjs +8 -0
  195. package/dist/server/i18n/index.mjs +17 -1
  196. package/dist/server/i18n/messages/cs.mjs +23 -0
  197. package/dist/server/i18n/messages/de.mjs +23 -0
  198. package/dist/server/i18n/messages/en.mjs +64 -1
  199. package/dist/server/i18n/messages/es.mjs +23 -0
  200. package/dist/server/i18n/messages/fr.mjs +23 -0
  201. package/dist/server/i18n/messages/pl.mjs +23 -0
  202. package/dist/server/i18n/messages/pt.mjs +23 -0
  203. package/dist/server/i18n/messages/sk.mjs +83 -1
  204. package/dist/server/modules/admin/block/introspection.mjs +4 -1
  205. package/dist/server/modules/admin/block/prefetch.mjs +12 -2
  206. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  207. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  208. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  209. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  210. package/dist/server/modules/admin/collections/apikey.d.mts +64 -64
  211. package/dist/server/modules/admin/collections/assets.d.mts +20 -20
  212. package/dist/server/modules/admin/collections/assets.mjs +0 -1
  213. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  214. package/dist/server/modules/admin/collections/user.d.mts +40 -28
  215. package/dist/server/modules/admin/collections/user.mjs +40 -9
  216. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  217. package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
  218. package/dist/server/modules/admin/factories.mjs +7 -18
  219. package/dist/server/modules/admin/index.d.mts +1 -1
  220. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  221. package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
  222. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  223. package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
  224. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  225. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  226. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  227. package/dist/server/modules/admin/routes/setup.d.mts +10 -10
  228. package/dist/server/modules/admin/routes/setup.mjs +7 -7
  229. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  230. package/dist/server/modules/admin/routes/translations.mjs +5 -1
  231. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  232. package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
  233. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +25 -25
  234. package/dist/server/modules/audit/.generated/module.d.mts +7 -7
  235. package/dist/server/modules/audit/.generated/module.mjs +1 -1
  236. package/dist/server/modules/audit/collections/audit-log.d.mts +39 -39
  237. package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
  238. package/dist/server/modules/audit/config/app.mjs +99 -42
  239. package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
  240. package/dist/server/plugin.mjs +4 -2
  241. package/dist/server/proxy-factories.d.mts +4 -3
  242. package/dist/server/proxy-factories.mjs +34 -8
  243. package/dist/shared/types/saved-views.types.d.mts +2 -0
  244. package/package.json +6 -4
  245. package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
  246. package/dist/client/components/ui/spinner.mjs +0 -52
  247. package/dist/client/components/ui/toolbar.mjs +0 -136
  248. package/dist/client/contexts/breadcrumb-context.mjs +0 -60
  249. package/dist/client/views/layout/admin-topbar.mjs +0 -236
@@ -65,7 +65,7 @@ const MIME_TYPE_FILTERS = [
65
65
  }
66
66
  ];
67
67
  function MediaPickerDialog(t0) {
68
- const $ = c(112);
68
+ const $ = c(116);
69
69
  const { open, onOpenChange, mode: t1, accept, onSelect, maxItems, collection } = t0;
70
70
  const mode = t1 === void 0 ? "single" : t1;
71
71
  const { t } = useTranslation();
@@ -189,9 +189,17 @@ function MediaPickerDialog(t0) {
189
189
  } else t11 = $[26];
190
190
  const previewAsset = t11;
191
191
  let t12;
192
+ if ($[27] !== mimeFilter || $[28] !== t) {
193
+ t12 = t((MIME_TYPE_FILTERS.find((filter) => filter.value === mimeFilter) ?? MIME_TYPE_FILTERS[0]).labelKey);
194
+ $[27] = mimeFilter;
195
+ $[28] = t;
196
+ $[29] = t12;
197
+ } else t12 = $[29];
198
+ const selectedMimeFilterLabel = t12;
192
199
  let t13;
193
- if ($[27] !== open) {
194
- t12 = () => {
200
+ let t14;
201
+ if ($[30] !== open) {
202
+ t13 = () => {
195
203
  if (!open) {
196
204
  setSelectedIds(/* @__PURE__ */ new Set());
197
205
  setSearchQuery("");
@@ -200,19 +208,19 @@ function MediaPickerDialog(t0) {
200
208
  return;
201
209
  }
202
210
  };
203
- t13 = [open];
204
- $[27] = open;
205
- $[28] = t12;
206
- $[29] = t13;
211
+ t14 = [open];
212
+ $[30] = open;
213
+ $[31] = t13;
214
+ $[32] = t14;
207
215
  } else {
208
- t12 = $[28];
209
- t13 = $[29];
216
+ t13 = $[31];
217
+ t14 = $[32];
210
218
  }
211
- React.useEffect(t12, t13);
212
- let t14;
219
+ React.useEffect(t13, t14);
213
220
  let t15;
214
- if ($[30] !== assets || $[31] !== open || $[32] !== previewAssetId) {
215
- t14 = () => {
221
+ let t16;
222
+ if ($[33] !== assets || $[34] !== open || $[35] !== previewAssetId) {
223
+ t15 = () => {
216
224
  if (!open || assets.length === 0) return;
217
225
  if (!previewAssetId) {
218
226
  setPreviewAssetId(assets[0].id);
@@ -220,39 +228,39 @@ function MediaPickerDialog(t0) {
220
228
  }
221
229
  if (!assets.some((asset_0) => asset_0.id === previewAssetId)) setPreviewAssetId(assets[0].id);
222
230
  };
223
- t15 = [
231
+ t16 = [
224
232
  open,
225
233
  assets,
226
234
  previewAssetId
227
235
  ];
228
- $[30] = assets;
229
- $[31] = open;
230
- $[32] = previewAssetId;
231
- $[33] = t14;
232
- $[34] = t15;
236
+ $[33] = assets;
237
+ $[34] = open;
238
+ $[35] = previewAssetId;
239
+ $[36] = t15;
240
+ $[37] = t16;
233
241
  } else {
234
- t14 = $[33];
235
- t15 = $[34];
242
+ t15 = $[36];
243
+ t16 = $[37];
236
244
  }
237
- React.useEffect(t14, t15);
238
- let t16;
239
- if ($[35] !== maxItems || $[36] !== mode || $[37] !== t) {
240
- t16 = (ids) => {
245
+ React.useEffect(t15, t16);
246
+ let t17;
247
+ if ($[38] !== maxItems || $[39] !== mode || $[40] !== t) {
248
+ t17 = (ids) => {
241
249
  if (mode === "multiple" && maxItems && ids.size > maxItems) {
242
250
  toast.warning(t("error.maxItemsAllowed", { max: maxItems }));
243
251
  return;
244
252
  }
245
253
  setSelectedIds(ids);
246
254
  };
247
- $[35] = maxItems;
248
- $[36] = mode;
249
- $[37] = t;
250
- $[38] = t16;
251
- } else t16 = $[38];
252
- const handleSelectionChange = t16;
253
- let t17;
254
- if ($[39] !== availableUploadCollections || $[40] !== mode || $[41] !== onOpenChange || $[42] !== onSelect || $[43] !== resolvedCollection || $[44] !== selectedIds || $[45] !== t) {
255
- t17 = () => {
255
+ $[38] = maxItems;
256
+ $[39] = mode;
257
+ $[40] = t;
258
+ $[41] = t17;
259
+ } else t17 = $[41];
260
+ const handleSelectionChange = t17;
261
+ let t18;
262
+ if ($[42] !== availableUploadCollections || $[43] !== mode || $[44] !== onOpenChange || $[45] !== onSelect || $[46] !== resolvedCollection || $[47] !== selectedIds || $[48] !== t) {
263
+ t18 = () => {
256
264
  if (!resolvedCollection) {
257
265
  toast.error(availableUploadCollections.length > 1 ? `Multiple upload collections are available (${availableUploadCollections.join(", ")}). Specify the collection for MediaPickerDialog.` : "No upload collection is configured for media library.");
258
266
  return;
@@ -267,102 +275,102 @@ function MediaPickerDialog(t0) {
267
275
  } else onSelect(Array.from(selectedIds));
268
276
  onOpenChange(false);
269
277
  };
270
- $[39] = availableUploadCollections;
271
- $[40] = mode;
272
- $[41] = onOpenChange;
273
- $[42] = onSelect;
274
- $[43] = resolvedCollection;
275
- $[44] = selectedIds;
276
- $[45] = t;
277
- $[46] = t17;
278
- } else t17 = $[46];
279
- const handleSelect = t17;
280
- let t18;
281
- if ($[47] !== onOpenChange) {
282
- t18 = () => {
278
+ $[42] = availableUploadCollections;
279
+ $[43] = mode;
280
+ $[44] = onOpenChange;
281
+ $[45] = onSelect;
282
+ $[46] = resolvedCollection;
283
+ $[47] = selectedIds;
284
+ $[48] = t;
285
+ $[49] = t18;
286
+ } else t18 = $[49];
287
+ const handleSelect = t18;
288
+ let t19;
289
+ if ($[50] !== onOpenChange) {
290
+ t19 = () => {
283
291
  onOpenChange(false);
284
292
  };
285
- $[47] = onOpenChange;
286
- $[48] = t18;
287
- } else t18 = $[48];
288
- const handleCancel = t18;
289
- let t19;
290
- if ($[49] !== t) {
291
- t19 = t("media.browseLibrary");
292
- $[49] = t;
293
- $[50] = t19;
294
- } else t19 = $[50];
295
- let t20;
296
- if ($[51] !== t19) {
297
- t20 = /* @__PURE__ */ jsx(SheetTitle, { children: t19 });
293
+ $[50] = onOpenChange;
298
294
  $[51] = t19;
299
- $[52] = t20;
300
- } else t20 = $[52];
301
- const t21 = mode === "single" ? "Select an asset from your library" : `Select up to ${maxItems || "multiple"} assets`;
302
- let t22;
303
- if ($[53] !== t21) {
304
- t22 = /* @__PURE__ */ jsx(SheetDescription, { children: t21 });
305
- $[53] = t21;
306
- $[54] = t22;
307
- } else t22 = $[54];
295
+ } else t19 = $[51];
296
+ const handleCancel = t19;
297
+ let t20;
298
+ if ($[52] !== t) {
299
+ t20 = t("media.browseLibrary");
300
+ $[52] = t;
301
+ $[53] = t20;
302
+ } else t20 = $[53];
303
+ let t21;
304
+ if ($[54] !== t20) {
305
+ t21 = /* @__PURE__ */ jsx(SheetTitle, { children: t20 });
306
+ $[54] = t20;
307
+ $[55] = t21;
308
+ } else t21 = $[55];
309
+ const t22 = mode === "single" ? "Select an asset from your library" : `Select up to ${maxItems || "multiple"} assets`;
308
310
  let t23;
309
- if ($[55] !== t20 || $[56] !== t22) {
310
- t23 = /* @__PURE__ */ jsxs(SheetHeader, {
311
- className: "px-6 pt-6",
312
- children: [t20, t22]
313
- });
314
- $[55] = t20;
311
+ if ($[56] !== t22) {
312
+ t23 = /* @__PURE__ */ jsx(SheetDescription, { children: t22 });
315
313
  $[56] = t22;
316
314
  $[57] = t23;
317
315
  } else t23 = $[57];
318
316
  let t24;
319
- if ($[58] !== availableUploadCollections || $[59] !== resolvedCollection) {
320
- t24 = !resolvedCollection && /* @__PURE__ */ jsx("div", {
321
- className: "border-warning/40 bg-warning/5 text-warning border p-3 text-sm",
322
- children: availableUploadCollections.length > 1 ? `Multiple upload collections are available (${availableUploadCollections.join(", ")}). Pass the collection prop to choose one.` : "No upload collection is configured for media library."
317
+ if ($[58] !== t21 || $[59] !== t23) {
318
+ t24 = /* @__PURE__ */ jsxs(SheetHeader, {
319
+ className: "px-6 pt-6",
320
+ children: [t21, t23]
323
321
  });
324
- $[58] = availableUploadCollections;
325
- $[59] = resolvedCollection;
322
+ $[58] = t21;
323
+ $[59] = t23;
326
324
  $[60] = t24;
327
325
  } else t24 = $[60];
328
326
  let t25;
329
- if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
330
- t25 = /* @__PURE__ */ jsx(Icon, {
327
+ if ($[61] !== availableUploadCollections || $[62] !== resolvedCollection) {
328
+ t25 = !resolvedCollection && /* @__PURE__ */ jsx("div", {
329
+ className: "border-warning/40 bg-warning/5 text-warning border p-3 text-sm",
330
+ children: availableUploadCollections.length > 1 ? `Multiple upload collections are available (${availableUploadCollections.join(", ")}). Pass the collection prop to choose one.` : "No upload collection is configured for media library."
331
+ });
332
+ $[61] = availableUploadCollections;
333
+ $[62] = resolvedCollection;
334
+ $[63] = t25;
335
+ } else t25 = $[63];
336
+ let t26;
337
+ if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
338
+ t26 = /* @__PURE__ */ jsx(Icon, {
331
339
  icon: "ph:magnifying-glass-bold",
332
340
  className: "text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"
333
341
  });
334
- $[61] = t25;
335
- } else t25 = $[61];
336
- let t26;
337
- if ($[62] !== t) {
338
- t26 = t("media.searchPlaceholder");
339
- $[62] = t;
340
- $[63] = t26;
341
- } else t26 = $[63];
342
+ $[64] = t26;
343
+ } else t26 = $[64];
342
344
  let t27;
343
- if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
344
- t27 = (e) => setSearchQuery(e.target.value);
345
- $[64] = t27;
346
- } else t27 = $[64];
345
+ if ($[65] !== t) {
346
+ t27 = t("media.searchPlaceholder");
347
+ $[65] = t;
348
+ $[66] = t27;
349
+ } else t27 = $[66];
347
350
  let t28;
348
- if ($[65] !== searchQuery || $[66] !== t26) {
349
- t28 = /* @__PURE__ */ jsxs("div", {
351
+ if ($[67] === Symbol.for("react.memo_cache_sentinel")) {
352
+ t28 = (e) => setSearchQuery(e.target.value);
353
+ $[67] = t28;
354
+ } else t28 = $[67];
355
+ let t29;
356
+ if ($[68] !== searchQuery || $[69] !== t27) {
357
+ t29 = /* @__PURE__ */ jsxs("div", {
350
358
  className: "relative flex-1",
351
- children: [t25, /* @__PURE__ */ jsx(Input, {
359
+ children: [t26, /* @__PURE__ */ jsx(Input, {
352
360
  type: "text",
353
- placeholder: t26,
361
+ placeholder: t27,
354
362
  value: searchQuery,
355
- onChange: t27,
363
+ onChange: t28,
356
364
  className: "pl-9"
357
365
  })]
358
366
  });
359
- $[65] = searchQuery;
360
- $[66] = t26;
361
- $[67] = t28;
362
- } else t28 = $[67];
363
- let t29;
364
- if ($[68] !== accept || $[69] !== mimeFilter || $[70] !== t) {
365
- t29 = !accept && /* @__PURE__ */ jsxs(Select, {
367
+ $[68] = searchQuery;
368
+ $[69] = t27;
369
+ $[70] = t29;
370
+ } else t29 = $[70];
371
+ let t30;
372
+ if ($[71] !== accept || $[72] !== mimeFilter || $[73] !== selectedMimeFilterLabel || $[74] !== t) {
373
+ t30 = !accept && /* @__PURE__ */ jsxs(Select, {
366
374
  value: mimeFilter,
367
375
  onValueChange: (value) => setMimeFilter(value || "all"),
368
376
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
@@ -372,36 +380,37 @@ function MediaPickerDialog(t0) {
372
380
  children: [/* @__PURE__ */ jsx(Icon, {
373
381
  icon: "ph:funnel-simple-bold",
374
382
  className: "size-4"
375
- }), /* @__PURE__ */ jsx(SelectValue, {})]
383
+ }), /* @__PURE__ */ jsx(SelectValue, { children: selectedMimeFilterLabel })]
376
384
  })
377
- }), /* @__PURE__ */ jsx(SelectContent, { children: MIME_TYPE_FILTERS.map((filter) => /* @__PURE__ */ jsx(SelectItem, {
378
- value: filter.value,
379
- children: t(filter.labelKey)
380
- }, filter.value)) })]
385
+ }), /* @__PURE__ */ jsx(SelectContent, { children: MIME_TYPE_FILTERS.map((filter_0) => /* @__PURE__ */ jsx(SelectItem, {
386
+ value: filter_0.value,
387
+ children: t(filter_0.labelKey)
388
+ }, filter_0.value)) })]
381
389
  });
382
- $[68] = accept;
383
- $[69] = mimeFilter;
384
- $[70] = t;
385
- $[71] = t29;
386
- } else t29 = $[71];
387
- let t30;
388
- if ($[72] !== t28 || $[73] !== t29) {
389
- t30 = /* @__PURE__ */ jsxs("div", {
390
+ $[71] = accept;
391
+ $[72] = mimeFilter;
392
+ $[73] = selectedMimeFilterLabel;
393
+ $[74] = t;
394
+ $[75] = t30;
395
+ } else t30 = $[75];
396
+ let t31;
397
+ if ($[76] !== t29 || $[77] !== t30) {
398
+ t31 = /* @__PURE__ */ jsxs("div", {
390
399
  className: "flex flex-col gap-3 border-b pb-4 sm:flex-row",
391
- children: [t28, t29]
400
+ children: [t29, t30]
392
401
  });
393
- $[72] = t28;
394
- $[73] = t29;
395
- $[74] = t30;
396
- } else t30 = $[74];
397
- let t31;
398
- if ($[75] === Symbol.for("react.memo_cache_sentinel")) {
399
- t31 = (asset_1) => setPreviewAssetId(asset_1.id);
400
- $[75] = t31;
401
- } else t31 = $[75];
402
+ $[76] = t29;
403
+ $[77] = t30;
404
+ $[78] = t31;
405
+ } else t31 = $[78];
402
406
  let t32;
403
- if ($[76] !== assets || $[77] !== handleSelectionChange || $[78] !== isLoading || $[79] !== mode || $[80] !== selectedIds) {
404
- t32 = /* @__PURE__ */ jsx("div", {
407
+ if ($[79] === Symbol.for("react.memo_cache_sentinel")) {
408
+ t32 = (asset_1) => setPreviewAssetId(asset_1.id);
409
+ $[79] = t32;
410
+ } else t32 = $[79];
411
+ let t33;
412
+ if ($[80] !== assets || $[81] !== handleSelectionChange || $[82] !== isLoading || $[83] !== mode || $[84] !== selectedIds) {
413
+ t33 = /* @__PURE__ */ jsx("div", {
405
414
  className: "flex-1 overflow-y-auto pr-1",
406
415
  children: /* @__PURE__ */ jsx(MediaGrid, {
407
416
  assets,
@@ -411,147 +420,150 @@ function MediaPickerDialog(t0) {
411
420
  loading: isLoading,
412
421
  columns: 5,
413
422
  className: "gap-2",
414
- onAssetClick: t31
423
+ onAssetClick: t32
415
424
  })
416
425
  });
417
- $[76] = assets;
418
- $[77] = handleSelectionChange;
419
- $[78] = isLoading;
420
- $[79] = mode;
421
- $[80] = selectedIds;
422
- $[81] = t32;
423
- } else t32 = $[81];
424
- let t33;
425
- if ($[82] === Symbol.for("react.memo_cache_sentinel")) {
426
- t33 = /* @__PURE__ */ jsx("p", {
427
- className: "text-muted-foreground text-xs tracking-wide uppercase",
426
+ $[80] = assets;
427
+ $[81] = handleSelectionChange;
428
+ $[82] = isLoading;
429
+ $[83] = mode;
430
+ $[84] = selectedIds;
431
+ $[85] = t33;
432
+ } else t33 = $[85];
433
+ let t34;
434
+ if ($[86] === Symbol.for("react.memo_cache_sentinel")) {
435
+ t34 = /* @__PURE__ */ jsx("p", {
436
+ className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
428
437
  children: "Preview"
429
438
  });
430
- $[82] = t33;
431
- } else t33 = $[82];
432
- let t34;
433
- if ($[83] !== previewAsset) {
434
- t34 = /* @__PURE__ */ jsxs("div", {
435
- className: "hidden w-80 shrink-0 flex-col gap-3 border-l pl-4 lg:flex xl:w-96",
436
- children: [t33, previewAsset ? /* @__PURE__ */ jsx(AssetPreview, {
439
+ $[86] = t34;
440
+ } else t34 = $[86];
441
+ let t35;
442
+ if ($[87] !== previewAsset) {
443
+ t35 = /* @__PURE__ */ jsxs("div", {
444
+ className: "border-border hidden w-80 shrink-0 flex-col gap-3 border-l pl-4 lg:flex xl:w-96",
445
+ children: [t34, previewAsset ? /* @__PURE__ */ jsx(AssetPreview, {
437
446
  asset: previewAsset,
438
447
  variant: "card"
439
448
  }) : /* @__PURE__ */ jsx("div", {
440
- className: "text-muted-foreground flex items-center justify-center border border-dashed p-6 text-xs",
449
+ className: "text-muted-foreground flex min-h-24 items-center justify-center p-4 text-sm",
441
450
  children: "Select an asset to preview"
442
451
  })]
443
452
  });
444
- $[83] = previewAsset;
445
- $[84] = t34;
446
- } else t34 = $[84];
447
- let t35;
448
- if ($[85] !== t32 || $[86] !== t34) {
449
- t35 = /* @__PURE__ */ jsxs("div", {
453
+ $[87] = previewAsset;
454
+ $[88] = t35;
455
+ } else t35 = $[88];
456
+ let t36;
457
+ if ($[89] !== t33 || $[90] !== t35) {
458
+ t36 = /* @__PURE__ */ jsxs("div", {
450
459
  className: "flex flex-1 gap-4 overflow-hidden",
451
- children: [t32, t34]
460
+ children: [t33, t35]
452
461
  });
453
- $[85] = t32;
454
- $[86] = t34;
455
- $[87] = t35;
456
- } else t35 = $[87];
457
- let t36;
458
- if ($[88] !== previewAsset) {
459
- t36 = /* @__PURE__ */ jsx("div", {
462
+ $[89] = t33;
463
+ $[90] = t35;
464
+ $[91] = t36;
465
+ } else t36 = $[91];
466
+ let t37;
467
+ if ($[92] !== previewAsset) {
468
+ t37 = /* @__PURE__ */ jsx("div", {
460
469
  className: "border-t pt-4 lg:hidden",
461
470
  children: previewAsset ? /* @__PURE__ */ jsx(AssetPreview, {
462
471
  asset: previewAsset,
463
472
  variant: "compact"
464
473
  }) : /* @__PURE__ */ jsx("div", {
465
- className: "text-muted-foreground flex items-center justify-center border border-dashed p-4 text-xs",
474
+ className: "text-muted-foreground flex min-h-16 items-center justify-center p-2 text-sm",
466
475
  children: "Select an asset to preview"
467
476
  })
468
477
  });
469
- $[88] = previewAsset;
470
- $[89] = t36;
471
- } else t36 = $[89];
472
- let t37;
473
- if ($[90] !== t24 || $[91] !== t30 || $[92] !== t35 || $[93] !== t36) {
474
- t37 = /* @__PURE__ */ jsxs("div", {
478
+ $[92] = previewAsset;
479
+ $[93] = t37;
480
+ } else t37 = $[93];
481
+ let t38;
482
+ if ($[94] !== t25 || $[95] !== t31 || $[96] !== t36 || $[97] !== t37) {
483
+ t38 = /* @__PURE__ */ jsxs("div", {
475
484
  className: "flex flex-1 flex-col gap-4 overflow-hidden px-6 pb-6",
476
485
  children: [
477
- t24,
478
- t30,
479
- t35,
480
- t36
486
+ t25,
487
+ t31,
488
+ t36,
489
+ t37
481
490
  ]
482
491
  });
483
- $[90] = t24;
484
- $[91] = t30;
485
- $[92] = t35;
486
- $[93] = t36;
487
- $[94] = t37;
488
- } else t37 = $[94];
489
- let t38;
490
- if ($[95] !== handleCancel) {
491
- t38 = /* @__PURE__ */ jsx(Button, {
492
+ $[94] = t25;
493
+ $[95] = t31;
494
+ $[96] = t36;
495
+ $[97] = t37;
496
+ $[98] = t38;
497
+ } else t38 = $[98];
498
+ let t39;
499
+ if ($[99] !== handleCancel) {
500
+ t39 = /* @__PURE__ */ jsx(Button, {
492
501
  variant: "outline",
493
502
  onClick: handleCancel,
494
503
  children: "Cancel"
495
504
  });
496
- $[95] = handleCancel;
497
- $[96] = t38;
498
- } else t38 = $[96];
499
- const t39 = selectedIds.size === 0 || isLoading;
500
- const t40 = selectedIds.size > 0 && `(${selectedIds.size})`;
501
- let t41;
502
- if ($[97] !== handleSelect || $[98] !== t39 || $[99] !== t40) {
503
- t41 = /* @__PURE__ */ jsxs(Button, {
505
+ $[99] = handleCancel;
506
+ $[100] = t39;
507
+ } else t39 = $[100];
508
+ const t40 = selectedIds.size === 0 || isLoading;
509
+ const t41 = selectedIds.size > 0 && `(${selectedIds.size})`;
510
+ let t42;
511
+ if ($[101] !== handleSelect || $[102] !== t40 || $[103] !== t41) {
512
+ t42 = /* @__PURE__ */ jsxs(Button, {
513
+ className: "tabular-nums",
504
514
  onClick: handleSelect,
505
- disabled: t39,
506
- children: ["Select ", t40]
515
+ disabled: t40,
516
+ children: ["Select ", t41]
507
517
  });
508
- $[97] = handleSelect;
509
- $[98] = t39;
510
- $[99] = t40;
511
- $[100] = t41;
512
- } else t41 = $[100];
513
- let t42;
514
- if ($[101] !== t38 || $[102] !== t41) {
515
- t42 = /* @__PURE__ */ jsx(SheetFooter, {
518
+ $[101] = handleSelect;
519
+ $[102] = t40;
520
+ $[103] = t41;
521
+ $[104] = t42;
522
+ } else t42 = $[104];
523
+ let t43;
524
+ if ($[105] !== t39 || $[106] !== t42) {
525
+ t43 = /* @__PURE__ */ jsx(SheetFooter, {
516
526
  className: "border-t px-6 py-4",
517
527
  children: /* @__PURE__ */ jsxs("div", {
518
528
  className: "flex w-full justify-end gap-2",
519
- children: [t38, t41]
529
+ children: [t39, t42]
520
530
  })
521
531
  });
522
- $[101] = t38;
523
- $[102] = t41;
524
- $[103] = t42;
525
- } else t42 = $[103];
526
- let t43;
527
- if ($[104] !== t23 || $[105] !== t37 || $[106] !== t42) {
528
- t43 = /* @__PURE__ */ jsxs(SheetContent, {
529
- side: "right",
530
- className: "qa-media-picker w-full p-0 data-[side=right]:sm:max-w-6xl",
531
- children: [
532
- t23,
533
- t37,
534
- t42
535
- ]
536
- });
537
- $[104] = t23;
538
- $[105] = t37;
532
+ $[105] = t39;
539
533
  $[106] = t42;
540
534
  $[107] = t43;
541
535
  } else t43 = $[107];
542
536
  let t44;
543
- if ($[108] !== onOpenChange || $[109] !== open || $[110] !== t43) {
544
- t44 = /* @__PURE__ */ jsx(Sheet, {
545
- open,
546
- onOpenChange,
547
- children: t43
537
+ if ($[108] !== t24 || $[109] !== t38 || $[110] !== t43) {
538
+ t44 = /* @__PURE__ */ jsxs(SheetContent, {
539
+ side: "right",
540
+ showOverlay: false,
541
+ className: "qa-media-picker w-full p-0 data-[side=right]:sm:max-w-6xl",
542
+ children: [
543
+ t24,
544
+ t38,
545
+ t43
546
+ ]
548
547
  });
549
- $[108] = onOpenChange;
550
- $[109] = open;
548
+ $[108] = t24;
549
+ $[109] = t38;
551
550
  $[110] = t43;
552
551
  $[111] = t44;
553
552
  } else t44 = $[111];
554
- return t44;
553
+ let t45;
554
+ if ($[112] !== onOpenChange || $[113] !== open || $[114] !== t44) {
555
+ t45 = /* @__PURE__ */ jsx(Sheet, {
556
+ open,
557
+ onOpenChange,
558
+ modal: false,
559
+ children: t44
560
+ });
561
+ $[112] = onOpenChange;
562
+ $[113] = open;
563
+ $[114] = t44;
564
+ $[115] = t45;
565
+ } else t45 = $[115];
566
+ return t45;
555
567
  }
556
568
  function _temp(pattern) {
557
569
  if (pattern.startsWith(".")) return { filename: { endsWith: pattern } };
@@ -393,7 +393,7 @@ function LivePreviewContent(t0) {
393
393
  "aria-label": "Resize preview pane",
394
394
  onMouseDown: handleMouseDown,
395
395
  onClick: _temp2,
396
- className: "bg-border hover:bg-primary/40 w-1 shrink-0 cursor-col-resize appearance-none border-0 p-0 transition-colors"
396
+ className: "bg-border hover:bg-border-strong w-1 shrink-0 cursor-col-resize appearance-none border-0 p-0 transition-colors"
397
397
  }), /* @__PURE__ */ jsx("div", {
398
398
  className: "bg-muted min-w-0",
399
399
  style: { width: `${previewPercent}%` },