@questpie/admin 3.0.3 → 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.
- package/README.md +34 -5
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +4 -1
- package/dist/client/builder/types/action-types.d.mts +31 -3
- package/dist/client/builder/types/collection-types.d.mts +140 -0
- package/dist/client/builder/types/ui-config.d.mts +16 -2
- package/dist/client/builder/types/views.d.mts +57 -0
- package/dist/client/builder/types/widget-types.d.mts +5 -0
- package/dist/client/components/actions/action-button.mjs +137 -199
- package/dist/client/components/actions/action-dialog.mjs +198 -156
- package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
- package/dist/client/components/actions/header-actions.mjs +52 -53
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/auth/auth-loading.mjs +41 -18
- package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
- package/dist/client/components/blocks/block-insert-button.mjs +4 -4
- package/dist/client/components/blocks/block-item.mjs +2 -2
- package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
- package/dist/client/components/component-renderer.mjs +1 -1
- package/dist/client/components/fields/array-field.mjs +14 -14
- package/dist/client/components/fields/asset-preview-field.mjs +1 -1
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
- package/dist/client/components/fields/json-field.mjs +2 -2
- package/dist/client/components/fields/object-array-field.mjs +22 -22
- package/dist/client/components/fields/object-field.mjs +5 -5
- package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
- package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
- package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
- package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
- package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
- package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
- package/dist/client/components/fields/relation-picker.mjs +7 -6
- package/dist/client/components/fields/relation-select.mjs +71 -47
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
- package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
- package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
- package/dist/client/components/fields/upload-field.mjs +45 -49
- package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
- package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
- package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
- package/dist/client/components/history-sidebar.mjs +850 -340
- package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
- package/dist/client/components/locale-switcher.mjs +8 -8
- package/dist/client/components/media/media-grid.mjs +12 -9
- package/dist/client/components/media/media-picker-dialog.mjs +242 -230
- package/dist/client/components/preview/live-preview-mode.mjs +1 -1
- package/dist/client/components/primitives/asset-preview.mjs +37 -22
- package/dist/client/components/primitives/date-input.mjs +212 -249
- package/dist/client/components/primitives/dropzone.mjs +192 -159
- package/dist/client/components/primitives/field-select-control.mjs +93 -0
- package/dist/client/components/primitives/select-multi.mjs +251 -230
- package/dist/client/components/primitives/select-single.mjs +345 -290
- package/dist/client/components/primitives/time-input.mjs +2 -2
- package/dist/client/components/sheets/resource-sheet.mjs +2 -0
- package/dist/client/components/ui/accordion.mjs +4 -4
- package/dist/client/components/ui/alert.mjs +3 -3
- package/dist/client/components/ui/badge.mjs +4 -4
- package/dist/client/components/ui/button.mjs +47 -37
- package/dist/client/components/ui/card.mjs +2 -2
- package/dist/client/components/ui/checkbox.mjs +1 -1
- package/dist/client/components/ui/command.mjs +5 -5
- package/dist/client/components/ui/dialog.mjs +3 -3
- package/dist/client/components/ui/drawer.mjs +1 -1
- package/dist/client/components/ui/dropdown-menu.mjs +157 -15
- package/dist/client/components/ui/empty-state.mjs +88 -59
- package/dist/client/components/ui/field.mjs +2 -2
- package/dist/client/components/ui/input-group.mjs +3 -3
- package/dist/client/components/ui/input.mjs +1 -1
- package/dist/client/components/ui/kbd.mjs +1 -1
- package/dist/client/components/ui/label.mjs +1 -1
- package/dist/client/components/ui/popover.mjs +19 -11
- package/dist/client/components/ui/scroll-fade.mjs +170 -0
- package/dist/client/components/ui/search-input.mjs +1 -1
- package/dist/client/components/ui/select.mjs +129 -27
- package/dist/client/components/ui/sheet.mjs +54 -34
- package/dist/client/components/ui/sidebar.mjs +15 -14
- package/dist/client/components/ui/skeleton.mjs +28 -12
- package/dist/client/components/ui/switch.mjs +2 -2
- package/dist/client/components/ui/table.mjs +82 -74
- package/dist/client/components/ui/tabs.mjs +26 -31
- package/dist/client/components/ui/textarea.mjs +1 -1
- package/dist/client/components/ui/tooltip.mjs +1 -1
- package/dist/client/components/widgets/chart-widget.mjs +134 -96
- package/dist/client/components/widgets/progress-widget.mjs +59 -34
- package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
- package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
- package/dist/client/components/widgets/stats-widget.mjs +91 -72
- package/dist/client/components/widgets/table-widget.mjs +159 -246
- package/dist/client/components/widgets/timeline-widget.mjs +66 -43
- package/dist/client/components/widgets/value-widget.mjs +261 -152
- package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-action.mjs +63 -55
- package/dist/client/hooks/use-audit-history.mjs +1 -65
- package/dist/client/hooks/use-collection-validation.mjs +36 -23
- package/dist/client/hooks/use-collection.mjs +96 -1
- package/dist/client/hooks/use-saved-views.mjs +70 -49
- package/dist/client/hooks/use-server-actions.mjs +59 -40
- package/dist/client/hooks/use-server-validation.mjs +156 -41
- package/dist/client/hooks/use-server-widget-data.mjs +1 -1
- package/dist/client/hooks/use-setup-status.d.mts +3 -3
- package/dist/client/hooks/use-setup-status.mjs +2 -2
- package/dist/client/hooks/use-transition-stage.mjs +2 -10
- package/dist/client/hooks/use-validation-error-map.mjs +31 -13
- package/dist/client/hooks/use-view-state.mjs +238 -174
- package/dist/client/i18n/date-locale.mjs +33 -0
- package/dist/client/i18n/hooks.mjs +17 -1
- package/dist/client/lib/utils.mjs +3 -2
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +2 -2
- package/dist/client/runtime/provider.mjs +8 -1
- package/dist/client/runtime/translations-provider.mjs +1 -1
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +1022 -0
- package/dist/client/styles/index.css +3 -589
- package/dist/client/utils/auto-expand-fields.mjs +4 -2
- package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
- package/dist/client/utils/use-lazy-component.mjs +80 -0
- package/dist/client/views/auth/auth-layout.d.mts +18 -11
- package/dist/client/views/auth/auth-layout.mjs +291 -80
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +1 -1
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +11 -9
- package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
- package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
- package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
- package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
- package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
- package/dist/client/views/collection/columns/build-columns.mjs +29 -9
- package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
- package/dist/client/views/collection/field-renderer.mjs +50 -89
- package/dist/client/views/collection/form-view.mjs +237 -227
- package/dist/client/views/collection/table-view.mjs +1162 -229
- package/dist/client/views/collection/view-skeletons.mjs +222 -79
- package/dist/client/views/common/global-search.mjs +29 -18
- package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
- package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
- package/dist/client/views/dashboard/widget-card.mjs +23 -14
- package/dist/client/views/globals/global-form-view.mjs +634 -589
- package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
- package/dist/client/views/layout/admin-layout.d.mts +3 -6
- package/dist/client/views/layout/admin-layout.mjs +149 -172
- package/dist/client/views/layout/admin-router.mjs +747 -544
- package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
- package/dist/client/views/layout/admin-sidebar.mjs +751 -591
- package/dist/client/views/layout/admin-theme.d.mts +10 -0
- package/dist/client/views/layout/admin-theme.mjs +84 -0
- package/dist/client/views/layout/admin-view-layout.mjs +161 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +49 -26
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +2 -19
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +2 -19
- package/dist/client/views/pages/login-page.d.mts +1 -1
- package/dist/client/views/pages/login-page.mjs +4 -21
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +3 -20
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +3 -20
- package/dist/client.d.mts +6 -2
- package/dist/client.mjs +2 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +2 -1
- package/dist/server/augmentation/dashboard.d.mts +67 -3
- package/dist/server/augmentation/form-layout.d.mts +21 -0
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/codegen/admin-client-template.mjs +4 -0
- package/dist/server/fields/blocks.d.mts +1 -1
- package/dist/server/fields/blocks.mjs +12 -0
- package/dist/server/fields/rich-text.d.mts +1 -1
- package/dist/server/fields/rich-text.mjs +8 -0
- package/dist/server/i18n/index.mjs +17 -1
- package/dist/server/i18n/messages/cs.mjs +23 -0
- package/dist/server/i18n/messages/de.mjs +23 -0
- package/dist/server/i18n/messages/en.mjs +64 -1
- package/dist/server/i18n/messages/es.mjs +23 -0
- package/dist/server/i18n/messages/fr.mjs +23 -0
- package/dist/server/i18n/messages/pl.mjs +23 -0
- package/dist/server/i18n/messages/pt.mjs +23 -0
- package/dist/server/i18n/messages/sk.mjs +83 -1
- package/dist/server/modules/admin/block/introspection.mjs +4 -1
- package/dist/server/modules/admin/block/prefetch.mjs +12 -2
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/assets.mjs +0 -1
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +12 -0
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +2 -2
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
- package/dist/server/modules/admin/factories.mjs +7 -18
- package/dist/server/modules/admin/index.d.mts +1 -1
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +10 -10
- package/dist/server/modules/admin/routes/setup.mjs +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/translations.mjs +5 -1
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/dist/server/modules/audit/.generated/module.d.mts +1 -1
- package/dist/server/modules/audit/.generated/module.mjs +1 -1
- package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
- package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
- package/dist/server/modules/audit/config/app.mjs +99 -42
- package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
- package/dist/server/plugin.mjs +4 -2
- package/dist/server/proxy-factories.d.mts +4 -3
- package/dist/server/proxy-factories.mjs +34 -8
- package/dist/shared/types/saved-views.types.d.mts +2 -0
- package/package.json +6 -4
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
- package/dist/client/components/ui/spinner.mjs +0 -52
- package/dist/client/components/ui/toolbar.mjs +0 -136
- package/dist/client/contexts/breadcrumb-context.mjs +0 -60
- 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(
|
|
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
|
-
|
|
194
|
-
|
|
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
|
-
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
211
|
+
t14 = [open];
|
|
212
|
+
$[30] = open;
|
|
213
|
+
$[31] = t13;
|
|
214
|
+
$[32] = t14;
|
|
207
215
|
} else {
|
|
208
|
-
|
|
209
|
-
|
|
216
|
+
t13 = $[31];
|
|
217
|
+
t14 = $[32];
|
|
210
218
|
}
|
|
211
|
-
React.useEffect(
|
|
212
|
-
let t14;
|
|
219
|
+
React.useEffect(t13, t14);
|
|
213
220
|
let t15;
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
|
|
231
|
+
t16 = [
|
|
224
232
|
open,
|
|
225
233
|
assets,
|
|
226
234
|
previewAssetId
|
|
227
235
|
];
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
236
|
+
$[33] = assets;
|
|
237
|
+
$[34] = open;
|
|
238
|
+
$[35] = previewAssetId;
|
|
239
|
+
$[36] = t15;
|
|
240
|
+
$[37] = t16;
|
|
233
241
|
} else {
|
|
234
|
-
|
|
235
|
-
|
|
242
|
+
t15 = $[36];
|
|
243
|
+
t16 = $[37];
|
|
236
244
|
}
|
|
237
|
-
React.useEffect(
|
|
238
|
-
let
|
|
239
|
-
if ($[
|
|
240
|
-
|
|
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
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
} else
|
|
252
|
-
const handleSelectionChange =
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
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
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
} else
|
|
279
|
-
const handleSelect =
|
|
280
|
-
let
|
|
281
|
-
if ($[
|
|
282
|
-
|
|
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
|
-
$[
|
|
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
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
$[53] =
|
|
306
|
-
|
|
307
|
-
|
|
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 ($[
|
|
310
|
-
t23 = /* @__PURE__ */
|
|
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] !==
|
|
320
|
-
t24 =
|
|
321
|
-
className: "
|
|
322
|
-
children:
|
|
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] =
|
|
325
|
-
$[59] =
|
|
322
|
+
$[58] = t21;
|
|
323
|
+
$[59] = t23;
|
|
326
324
|
$[60] = t24;
|
|
327
325
|
} else t24 = $[60];
|
|
328
326
|
let t25;
|
|
329
|
-
if ($[61]
|
|
330
|
-
t25 = /* @__PURE__ */ jsx(
|
|
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
|
-
$[
|
|
335
|
-
} else
|
|
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 ($[
|
|
344
|
-
t27 = (
|
|
345
|
-
$[
|
|
346
|
-
|
|
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 ($[
|
|
349
|
-
t28 =
|
|
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: [
|
|
359
|
+
children: [t26, /* @__PURE__ */ jsx(Input, {
|
|
352
360
|
type: "text",
|
|
353
|
-
placeholder:
|
|
361
|
+
placeholder: t27,
|
|
354
362
|
value: searchQuery,
|
|
355
|
-
onChange:
|
|
363
|
+
onChange: t28,
|
|
356
364
|
className: "pl-9"
|
|
357
365
|
})]
|
|
358
366
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
} else
|
|
363
|
-
let
|
|
364
|
-
if ($[
|
|
365
|
-
|
|
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((
|
|
378
|
-
value:
|
|
379
|
-
children: t(
|
|
380
|
-
},
|
|
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
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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: [
|
|
400
|
+
children: [t29, t30]
|
|
392
401
|
});
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
} else
|
|
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 ($[
|
|
404
|
-
t32 =
|
|
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:
|
|
423
|
+
onAssetClick: t32
|
|
415
424
|
})
|
|
416
425
|
});
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
} else
|
|
424
|
-
let
|
|
425
|
-
if ($[
|
|
426
|
-
|
|
427
|
-
className: "text-muted-foreground text-xs
|
|
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
|
-
$[
|
|
431
|
-
} else
|
|
432
|
-
let
|
|
433
|
-
if ($[
|
|
434
|
-
|
|
435
|
-
className: "hidden w-80 shrink-0 flex-col gap-3 border-l pl-4 lg:flex xl:w-96",
|
|
436
|
-
children: [
|
|
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
|
|
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
|
-
$[
|
|
445
|
-
$[
|
|
446
|
-
} else
|
|
447
|
-
let
|
|
448
|
-
if ($[
|
|
449
|
-
|
|
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: [
|
|
460
|
+
children: [t33, t35]
|
|
452
461
|
});
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
} else
|
|
457
|
-
let
|
|
458
|
-
if ($[
|
|
459
|
-
|
|
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
|
|
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
|
-
$[
|
|
470
|
-
$[
|
|
471
|
-
} else
|
|
472
|
-
let
|
|
473
|
-
if ($[
|
|
474
|
-
|
|
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
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
486
|
+
t25,
|
|
487
|
+
t31,
|
|
488
|
+
t36,
|
|
489
|
+
t37
|
|
481
490
|
]
|
|
482
491
|
});
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
} else
|
|
489
|
-
let
|
|
490
|
-
if ($[
|
|
491
|
-
|
|
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
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
} else
|
|
499
|
-
const
|
|
500
|
-
const
|
|
501
|
-
let
|
|
502
|
-
if ($[
|
|
503
|
-
|
|
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:
|
|
506
|
-
children: ["Select ",
|
|
515
|
+
disabled: t40,
|
|
516
|
+
children: ["Select ", t41]
|
|
507
517
|
});
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
510
|
-
$[
|
|
511
|
-
$[
|
|
512
|
-
} else
|
|
513
|
-
let
|
|
514
|
-
if ($[
|
|
515
|
-
|
|
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: [
|
|
529
|
+
children: [t39, t42]
|
|
520
530
|
})
|
|
521
531
|
});
|
|
522
|
-
$[
|
|
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] !==
|
|
544
|
-
t44 = /* @__PURE__ */
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
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] =
|
|
550
|
-
$[109] =
|
|
548
|
+
$[108] = t24;
|
|
549
|
+
$[109] = t38;
|
|
551
550
|
$[110] = t43;
|
|
552
551
|
$[111] = t44;
|
|
553
552
|
} else t44 = $[111];
|
|
554
|
-
|
|
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-
|
|
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}%` },
|