@questpie/admin 3.2.4 → 3.2.5
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/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +164 -339
- package/dist/client/components/actions/action-button.mjs +9 -9
- package/dist/client/components/actions/action-dialog.mjs +195 -493
- package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
- package/dist/client/components/actions/header-actions.mjs +73 -165
- package/dist/client/components/admin-link.mjs +40 -126
- package/dist/client/components/auth/auth-loading.mjs +9 -44
- package/dist/client/components/blocks/block-canvas.mjs +31 -95
- package/dist/client/components/blocks/block-editor-context.mjs +13 -57
- package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
- package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
- package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
- package/dist/client/components/blocks/block-insert-button.mjs +49 -165
- package/dist/client/components/blocks/block-item-menu.mjs +102 -301
- package/dist/client/components/blocks/block-item.mjs +136 -370
- package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
- package/dist/client/components/blocks/block-tree.mjs +12 -68
- package/dist/client/components/blocks/block-type-icon.mjs +14 -56
- package/dist/client/components/brand-logo.mjs +35 -149
- package/dist/client/components/component-renderer.mjs +42 -118
- package/dist/client/components/error-boundary.mjs +14 -58
- package/dist/client/components/fields/array-field.mjs +209 -521
- package/dist/client/components/fields/asset-preview-field.mjs +41 -141
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
- package/dist/client/components/fields/boolean-field.mjs +29 -59
- package/dist/client/components/fields/date-field.mjs +7 -37
- package/dist/client/components/fields/datetime-field.mjs +7 -38
- package/dist/client/components/fields/email-field.mjs +25 -54
- package/dist/client/components/fields/field-wrapper.mjs +30 -105
- package/dist/client/components/fields/json-field.mjs +94 -296
- package/dist/client/components/fields/locale-badge.mjs +6 -15
- package/dist/client/components/fields/number-field.mjs +27 -60
- package/dist/client/components/fields/object-array-field.mjs +283 -659
- package/dist/client/components/fields/object-field.mjs +165 -633
- package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
- package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
- package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
- package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
- package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
- package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
- package/dist/client/components/fields/relation-field.mjs +10 -66
- package/dist/client/components/fields/relation-picker.mjs +18 -18
- package/dist/client/components/fields/relation-select.mjs +12 -12
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
- package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
- package/dist/client/components/fields/rich-text-field.mjs +14 -53
- package/dist/client/components/fields/select-field.mjs +39 -74
- package/dist/client/components/fields/text-field.mjs +26 -59
- package/dist/client/components/fields/textarea-field.mjs +26 -58
- package/dist/client/components/fields/time-field.mjs +7 -35
- package/dist/client/components/fields/upload-field.mjs +47 -165
- package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
- package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
- package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
- package/dist/client/components/history-sidebar.mjs +285 -605
- package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
- package/dist/client/components/locale-switcher.mjs +106 -228
- package/dist/client/components/media/media-grid.mjs +84 -273
- package/dist/client/components/media/media-picker-dialog.mjs +176 -476
- package/dist/client/components/preview/live-preview-mode.mjs +233 -458
- package/dist/client/components/preview/preview-pane.mjs +22 -22
- package/dist/client/components/primitives/asset-preview.mjs +290 -666
- package/dist/client/components/primitives/checkbox-input.mjs +9 -35
- package/dist/client/components/primitives/date-input.mjs +109 -327
- package/dist/client/components/primitives/dropzone.mjs +209 -336
- package/dist/client/components/primitives/field-select-control.mjs +12 -80
- package/dist/client/components/primitives/number-input.mjs +4 -4
- package/dist/client/components/primitives/select-multi.mjs +200 -559
- package/dist/client/components/primitives/select-single.mjs +165 -499
- package/dist/client/components/primitives/time-input.mjs +43 -117
- package/dist/client/components/primitives/toggle-input.mjs +9 -29
- package/dist/client/components/sheets/resource-sheet.mjs +61 -70
- package/dist/client/components/ui/accordion.mjs +35 -155
- package/dist/client/components/ui/alert.mjs +13 -68
- package/dist/client/components/ui/badge.mjs +9 -51
- package/dist/client/components/ui/button.mjs +8 -54
- package/dist/client/components/ui/card.mjs +37 -193
- package/dist/client/components/ui/checkbox.mjs +12 -68
- package/dist/client/components/ui/command.mjs +48 -219
- package/dist/client/components/ui/dialog.mjs +50 -262
- package/dist/client/components/ui/drawer.mjs +55 -259
- package/dist/client/components/ui/dropdown-menu.mjs +86 -427
- package/dist/client/components/ui/empty-state.mjs +28 -98
- package/dist/client/components/ui/field.mjs +73 -309
- package/dist/client/components/ui/input-group.mjs +42 -167
- package/dist/client/components/ui/input.mjs +7 -37
- package/dist/client/components/ui/kbd.mjs +6 -36
- package/dist/client/components/ui/label.mjs +7 -37
- package/dist/client/components/ui/popover.mjs +34 -169
- package/dist/client/components/ui/responsive-dialog.mjs +67 -273
- package/dist/client/components/ui/scroll-fade.mjs +63 -158
- package/dist/client/components/ui/search-input.mjs +33 -100
- package/dist/client/components/ui/select.mjs +72 -393
- package/dist/client/components/ui/separator.mjs +7 -38
- package/dist/client/components/ui/sheet.mjs +49 -269
- package/dist/client/components/ui/sidebar.mjs +171 -690
- package/dist/client/components/ui/skeleton.mjs +7 -38
- package/dist/client/components/ui/sonner.mjs +11 -42
- package/dist/client/components/ui/switch.mjs +9 -45
- package/dist/client/components/ui/table.mjs +48 -266
- package/dist/client/components/ui/tabs.mjs +26 -139
- package/dist/client/components/ui/textarea.mjs +6 -32
- package/dist/client/components/ui/tooltip.mjs +27 -129
- package/dist/client/components/widgets/chart-widget.mjs +174 -522
- package/dist/client/components/widgets/progress-widget.mjs +66 -172
- package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
- package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
- package/dist/client/components/widgets/stats-widget.mjs +41 -175
- package/dist/client/components/widgets/table-widget.mjs +9 -9
- package/dist/client/components/widgets/timeline-widget.mjs +86 -226
- package/dist/client/components/widgets/value-widget.mjs +74 -381
- package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
- package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
- package/dist/client/contexts/focus-context.mjs +63 -146
- package/dist/client/hooks/typed-hooks.mjs +241 -701
- package/dist/client/hooks/use-action.mjs +62 -198
- package/dist/client/hooks/use-admin-config.mjs +5 -35
- package/dist/client/hooks/use-admin-preferences.mjs +16 -88
- package/dist/client/hooks/use-admin-routes.mjs +22 -56
- package/dist/client/hooks/use-audit-history.mjs +21 -69
- package/dist/client/hooks/use-brand.mjs +1 -9
- package/dist/client/hooks/use-collection-fields.mjs +17 -57
- package/dist/client/hooks/use-collection-meta.mjs +12 -44
- package/dist/client/hooks/use-collection-schema.mjs +10 -33
- package/dist/client/hooks/use-collection-validation.mjs +23 -53
- package/dist/client/hooks/use-collection.mjs +194 -614
- package/dist/client/hooks/use-current-user.mjs +0 -1
- package/dist/client/hooks/use-field-hooks.mjs +10 -10
- package/dist/client/hooks/use-field-options.mjs +61 -202
- package/dist/client/hooks/use-global-fields.mjs +14 -46
- package/dist/client/hooks/use-global-meta.mjs +9 -30
- package/dist/client/hooks/use-global-schema.mjs +9 -30
- package/dist/client/hooks/use-global.mjs +63 -219
- package/dist/client/hooks/use-locks.mjs +117 -325
- package/dist/client/hooks/use-media-query.mjs +16 -36
- package/dist/client/hooks/use-prefill-params.mjs +0 -1
- package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
- package/dist/client/hooks/use-reactive-fields.mjs +1 -1
- package/dist/client/hooks/use-reactive-prop.mjs +65 -223
- package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
- package/dist/client/hooks/use-saved-views.mjs +22 -103
- package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
- package/dist/client/hooks/use-search.mjs +31 -143
- package/dist/client/hooks/use-server-actions.mjs +18 -50
- package/dist/client/hooks/use-server-validation.mjs +72 -166
- package/dist/client/hooks/use-server-widget-data.mjs +7 -33
- package/dist/client/hooks/use-setup-status.mjs +12 -25
- package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
- package/dist/client/hooks/use-transition-stage.mjs +8 -38
- package/dist/client/hooks/use-upload.mjs +54 -152
- package/dist/client/hooks/use-validation-error-map.mjs +6 -26
- package/dist/client/hooks/use-view-state.mjs +187 -437
- package/dist/client/i18n/hooks.mjs +65 -197
- package/dist/client/lib/render-profiler.mjs +14 -41
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/block-scope-context.mjs +14 -36
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-banner.mjs +42 -108
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +167 -348
- package/dist/client/preview/use-collection-preview.mjs +121 -215
- package/dist/client/runtime/content-locales-provider.mjs +31 -83
- package/dist/client/runtime/locale-scope.mjs +22 -63
- package/dist/client/runtime/provider.mjs +100 -255
- package/dist/client/runtime/translations-provider.mjs +41 -107
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/picker.mjs +86 -321
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.mjs +121 -412
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/auth-layout.mjs +104 -284
- package/dist/client/views/auth/forgot-password-form.mjs +94 -325
- package/dist/client/views/auth/invite-form.mjs +107 -442
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +116 -337
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +128 -453
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/auth/setup-form.mjs +140 -478
- package/dist/client/views/collection/auto-form-fields.mjs +243 -615
- package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -379
- package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
- package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
- package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
- package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
- package/dist/client/views/collection/columns/build-columns.mjs +8 -48
- package/dist/client/views/collection/field-renderer.mjs +58 -182
- package/dist/client/views/collection/form-view.mjs +284 -518
- package/dist/client/views/collection/table-view.mjs +231 -463
- package/dist/client/views/collection/view-skeletons.mjs +112 -237
- package/dist/client/views/common/global-search.mjs +241 -560
- package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
- package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
- package/dist/client/views/dashboard/widget-card.mjs +61 -269
- package/dist/client/views/globals/global-form-view.mjs +477 -1301
- package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
- package/dist/client/views/layout/admin-layout.mjs +83 -246
- package/dist/client/views/layout/admin-router.mjs +458 -1274
- package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
- package/dist/client/views/layout/admin-theme.mjs +30 -64
- package/dist/client/views/layout/admin-view-layout.mjs +40 -144
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +95 -290
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/dashboard-page.mjs +11 -57
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +31 -83
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +35 -90
- package/dist/client/views/pages/login-page.mjs +41 -121
- package/dist/client/views/pages/reset-password-page.mjs +46 -173
- package/dist/client/views/pages/setup-page.mjs +33 -95
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
- package/dist/server/modules/admin/collections/account.d.mts +46 -46
- package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
- 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 +39 -39
- package/dist/server/modules/admin/collections/session.d.mts +41 -41
- package/dist/server/modules/admin/collections/user.d.mts +63 -63
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/index.d.mts +20 -19
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- 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 +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
- package/dist/server/modules/audit/.generated/module.d.mts +6 -6
- package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
- package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
- package/package.json +3 -5
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../../lib/utils.mjs";
|
|
2
2
|
import { Button } from "../../../../components/ui/button.mjs";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { Icon } from "@iconify/react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
|
|
@@ -35,125 +34,49 @@ function isVideo(mimeType) {
|
|
|
35
34
|
function isAudio(mimeType) {
|
|
36
35
|
return !!mimeType?.toLowerCase().startsWith("audio/");
|
|
37
36
|
}
|
|
38
|
-
function AssetThumbnail(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
if (typeof asset === "string") {
|
|
56
|
-
let t4$1;
|
|
57
|
-
if ($[1] !== className) {
|
|
58
|
-
t4$1 = cn("qa-asset-thumbnail text-muted-foreground inline-flex items-center gap-2", className);
|
|
59
|
-
$[1] = className;
|
|
60
|
-
$[2] = t4$1;
|
|
61
|
-
} else t4$1 = $[2];
|
|
62
|
-
let t5$1;
|
|
63
|
-
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
64
|
-
t5$1 = /* @__PURE__ */ jsx("span", {
|
|
65
|
-
className: "bg-muted border-border-subtle flex size-8 shrink-0 items-center justify-center rounded border",
|
|
66
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
67
|
-
icon: "ph:file",
|
|
68
|
-
className: "size-4"
|
|
69
|
-
})
|
|
70
|
-
});
|
|
71
|
-
$[3] = t5$1;
|
|
72
|
-
} else t5$1 = $[3];
|
|
73
|
-
let t6$1;
|
|
74
|
-
if ($[4] !== asset || $[5] !== t4$1) {
|
|
75
|
-
t6$1 = /* @__PURE__ */ jsx("span", {
|
|
76
|
-
className: t4$1,
|
|
77
|
-
title: asset,
|
|
78
|
-
children: t5$1
|
|
79
|
-
});
|
|
80
|
-
$[4] = asset;
|
|
81
|
-
$[5] = t4$1;
|
|
82
|
-
$[6] = t6$1;
|
|
83
|
-
} else t6$1 = $[6];
|
|
84
|
-
return t6$1;
|
|
85
|
-
}
|
|
37
|
+
function AssetThumbnail({ asset, size = "sm", showFilename = false, showControls = false, onClick, className }) {
|
|
38
|
+
if (asset === null || asset === void 0) return /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "text-muted-foreground",
|
|
40
|
+
children: "-"
|
|
41
|
+
});
|
|
42
|
+
if (typeof asset === "string") return /* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: cn("qa-asset-thumbnail text-muted-foreground inline-flex items-center gap-2", className),
|
|
44
|
+
title: asset,
|
|
45
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: "bg-muted border-border-subtle flex size-8 shrink-0 items-center justify-center rounded border",
|
|
47
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
48
|
+
icon: "ph:file",
|
|
49
|
+
className: "size-4"
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
});
|
|
86
53
|
const assetObj = asset;
|
|
87
54
|
const url = assetObj.url;
|
|
88
55
|
const filename = assetObj.filename;
|
|
89
56
|
const mimeType = assetObj.mimeType;
|
|
90
57
|
const alt = assetObj.alt;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
$[8] = t4;
|
|
96
|
-
} else t4 = $[8];
|
|
97
|
-
const isImageType = t4;
|
|
98
|
-
let t5;
|
|
99
|
-
if ($[9] !== mimeType) {
|
|
100
|
-
t5 = isVideo(mimeType);
|
|
101
|
-
$[9] = mimeType;
|
|
102
|
-
$[10] = t5;
|
|
103
|
-
} else t5 = $[10];
|
|
104
|
-
const isVideoType = t5;
|
|
105
|
-
let t6;
|
|
106
|
-
if ($[11] !== mimeType) {
|
|
107
|
-
t6 = isAudio(mimeType);
|
|
108
|
-
$[11] = mimeType;
|
|
109
|
-
$[12] = t6;
|
|
110
|
-
} else t6 = $[12];
|
|
111
|
-
const isAudioType = t6;
|
|
112
|
-
let t7;
|
|
113
|
-
if ($[13] !== mimeType) {
|
|
114
|
-
t7 = getFileIcon(mimeType);
|
|
115
|
-
$[13] = mimeType;
|
|
116
|
-
$[14] = t7;
|
|
117
|
-
} else t7 = $[14];
|
|
118
|
-
const fileIcon = t7;
|
|
58
|
+
const isImageType = isImage(mimeType);
|
|
59
|
+
const isVideoType = isVideo(mimeType);
|
|
60
|
+
const isAudioType = isAudio(mimeType);
|
|
61
|
+
const fileIcon = getFileIcon(mimeType);
|
|
119
62
|
if (size === "sm") {
|
|
120
63
|
const assetId = assetObj.id;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if ($[18] !== handleClick) {
|
|
131
|
-
t9$1 = handleClick ? {
|
|
132
|
-
role: "button",
|
|
133
|
-
tabIndex: 0,
|
|
134
|
-
onClick: handleClick,
|
|
135
|
-
onKeyDown: (e) => {
|
|
136
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
137
|
-
e.preventDefault();
|
|
138
|
-
handleClick();
|
|
139
|
-
}
|
|
64
|
+
const handleClick = onClick && assetId ? () => onClick(assetId) : void 0;
|
|
65
|
+
const containerProps = handleClick ? {
|
|
66
|
+
role: "button",
|
|
67
|
+
tabIndex: 0,
|
|
68
|
+
onClick: handleClick,
|
|
69
|
+
onKeyDown: (e) => {
|
|
70
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
handleClick();
|
|
140
73
|
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
let t11$1;
|
|
148
|
-
if ($[20] !== className || $[21] !== t10$1) {
|
|
149
|
-
t11$1 = cn("qa-asset-thumbnail flex items-center gap-2", t10$1, className);
|
|
150
|
-
$[20] = className;
|
|
151
|
-
$[21] = t10$1;
|
|
152
|
-
$[22] = t11$1;
|
|
153
|
-
} else t11$1 = $[22];
|
|
154
|
-
let t12$1;
|
|
155
|
-
if ($[23] !== fileIcon || $[24] !== filename || $[25] !== isImageType || $[26] !== url) {
|
|
156
|
-
t12$1 = isImageType && url ? /* @__PURE__ */ jsx("img", {
|
|
74
|
+
}
|
|
75
|
+
} : {};
|
|
76
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
77
|
+
className: cn("qa-asset-thumbnail flex items-center gap-2", onClick && "cursor-pointer hover:opacity-80", className),
|
|
78
|
+
...containerProps,
|
|
79
|
+
children: [isImageType && url ? /* @__PURE__ */ jsx("img", {
|
|
157
80
|
src: url,
|
|
158
81
|
alt: filename || "Asset",
|
|
159
82
|
className: "image-outline size-8 rounded object-cover"
|
|
@@ -163,292 +86,140 @@ function AssetThumbnail(t0) {
|
|
|
163
86
|
icon: fileIcon,
|
|
164
87
|
className: "text-muted-foreground size-4"
|
|
165
88
|
})
|
|
166
|
-
})
|
|
167
|
-
$[23] = fileIcon;
|
|
168
|
-
$[24] = filename;
|
|
169
|
-
$[25] = isImageType;
|
|
170
|
-
$[26] = url;
|
|
171
|
-
$[27] = t12$1;
|
|
172
|
-
} else t12$1 = $[27];
|
|
173
|
-
let t13$1;
|
|
174
|
-
if ($[28] !== filename || $[29] !== showFilename) {
|
|
175
|
-
t13$1 = showFilename && filename && /* @__PURE__ */ jsx("span", {
|
|
89
|
+
}), showFilename && filename && /* @__PURE__ */ jsx("span", {
|
|
176
90
|
className: "max-w-[120px] truncate text-xs",
|
|
177
91
|
title: filename,
|
|
178
92
|
children: filename
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
$[29] = showFilename;
|
|
182
|
-
$[30] = t13$1;
|
|
183
|
-
} else t13$1 = $[30];
|
|
184
|
-
let t14$1;
|
|
185
|
-
if ($[31] !== containerProps || $[32] !== t11$1 || $[33] !== t12$1 || $[34] !== t13$1) {
|
|
186
|
-
t14$1 = /* @__PURE__ */ jsxs("div", {
|
|
187
|
-
className: t11$1,
|
|
188
|
-
...containerProps,
|
|
189
|
-
children: [t12$1, t13$1]
|
|
190
|
-
});
|
|
191
|
-
$[31] = containerProps;
|
|
192
|
-
$[32] = t11$1;
|
|
193
|
-
$[33] = t12$1;
|
|
194
|
-
$[34] = t13$1;
|
|
195
|
-
$[35] = t14$1;
|
|
196
|
-
} else t14$1 = $[35];
|
|
197
|
-
return t14$1;
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
198
95
|
}
|
|
199
96
|
if (size === "md") {
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
if ($[36] !== assetId_0 || $[37] !== onClick) {
|
|
203
|
-
t8$1 = onClick && assetId_0 ? () => onClick(assetId_0) : void 0;
|
|
204
|
-
$[36] = assetId_0;
|
|
205
|
-
$[37] = onClick;
|
|
206
|
-
$[38] = t8$1;
|
|
207
|
-
} else t8$1 = $[38];
|
|
208
|
-
const handleClick_0 = t8$1;
|
|
97
|
+
const assetId = assetObj.id;
|
|
98
|
+
const handleClick = onClick && assetId ? () => onClick(assetId) : void 0;
|
|
209
99
|
if (isImageType && url) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
e_0.preventDefault();
|
|
219
|
-
handleClick_0();
|
|
220
|
-
}
|
|
100
|
+
const interactiveProps = handleClick ? {
|
|
101
|
+
role: "button",
|
|
102
|
+
tabIndex: 0,
|
|
103
|
+
onClick: handleClick,
|
|
104
|
+
onKeyDown: (e) => {
|
|
105
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
handleClick();
|
|
221
108
|
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
let t11$2;
|
|
229
|
-
if ($[41] !== className || $[42] !== t10$2) {
|
|
230
|
-
t11$2 = cn("qa-asset-thumbnail flex items-center justify-center", t10$2, className);
|
|
231
|
-
$[41] = className;
|
|
232
|
-
$[42] = t10$2;
|
|
233
|
-
$[43] = t11$2;
|
|
234
|
-
} else t11$2 = $[43];
|
|
235
|
-
const t12$2 = filename || "Asset";
|
|
236
|
-
let t13$2;
|
|
237
|
-
if ($[44] !== t12$2 || $[45] !== url) {
|
|
238
|
-
t13$2 = /* @__PURE__ */ jsx("img", {
|
|
109
|
+
}
|
|
110
|
+
} : {};
|
|
111
|
+
return /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: cn("qa-asset-thumbnail flex items-center justify-center", onClick && "cursor-pointer hover:opacity-80", className),
|
|
113
|
+
...interactiveProps,
|
|
114
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
239
115
|
src: url,
|
|
240
|
-
alt:
|
|
116
|
+
alt: filename || "Asset",
|
|
241
117
|
className: "image-outline size-10 rounded object-cover"
|
|
242
|
-
})
|
|
243
|
-
|
|
244
|
-
$[45] = url;
|
|
245
|
-
$[46] = t13$2;
|
|
246
|
-
} else t13$2 = $[46];
|
|
247
|
-
let t14$1;
|
|
248
|
-
if ($[47] !== interactiveProps || $[48] !== t11$2 || $[49] !== t13$2) {
|
|
249
|
-
t14$1 = /* @__PURE__ */ jsx("div", {
|
|
250
|
-
className: t11$2,
|
|
251
|
-
...interactiveProps,
|
|
252
|
-
children: t13$2
|
|
253
|
-
});
|
|
254
|
-
$[47] = interactiveProps;
|
|
255
|
-
$[48] = t11$2;
|
|
256
|
-
$[49] = t13$2;
|
|
257
|
-
$[50] = t14$1;
|
|
258
|
-
} else t14$1 = $[50];
|
|
259
|
-
return t14$1;
|
|
118
|
+
})
|
|
119
|
+
});
|
|
260
120
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
t9$1 = handleClick_0 ? {
|
|
121
|
+
{
|
|
122
|
+
const interactiveProps = handleClick ? {
|
|
264
123
|
role: "button",
|
|
265
124
|
tabIndex: 0,
|
|
266
|
-
onClick:
|
|
267
|
-
onKeyDown: (
|
|
268
|
-
if (
|
|
269
|
-
|
|
270
|
-
|
|
125
|
+
onClick: handleClick,
|
|
126
|
+
onKeyDown: (e) => {
|
|
127
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
handleClick();
|
|
271
130
|
}
|
|
272
131
|
}
|
|
273
132
|
} : {};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
$[54] = t10$1;
|
|
284
|
-
$[55] = t11$1;
|
|
285
|
-
} else t11$1 = $[55];
|
|
286
|
-
let t12$1;
|
|
287
|
-
if ($[56] !== fileIcon) {
|
|
288
|
-
t12$1 = /* @__PURE__ */ jsx("div", {
|
|
289
|
-
className: "bg-muted flex size-10 items-center justify-center rounded border",
|
|
290
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
291
|
-
icon: fileIcon,
|
|
292
|
-
className: "text-muted-foreground size-5"
|
|
133
|
+
return /* @__PURE__ */ jsx("div", {
|
|
134
|
+
className: cn("qa-asset-thumbnail flex items-center justify-center", onClick && "cursor-pointer hover:opacity-80", className),
|
|
135
|
+
...interactiveProps,
|
|
136
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
137
|
+
className: "bg-muted flex size-10 items-center justify-center rounded border",
|
|
138
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
139
|
+
icon: fileIcon,
|
|
140
|
+
className: "text-muted-foreground size-5"
|
|
141
|
+
})
|
|
293
142
|
})
|
|
294
143
|
});
|
|
295
|
-
|
|
296
|
-
$[57] = t12$1;
|
|
297
|
-
} else t12$1 = $[57];
|
|
298
|
-
let t13$1;
|
|
299
|
-
if ($[58] !== interactiveProps_0 || $[59] !== t11$1 || $[60] !== t12$1) {
|
|
300
|
-
t13$1 = /* @__PURE__ */ jsx("div", {
|
|
301
|
-
className: t11$1,
|
|
302
|
-
...interactiveProps_0,
|
|
303
|
-
children: t12$1
|
|
304
|
-
});
|
|
305
|
-
$[58] = interactiveProps_0;
|
|
306
|
-
$[59] = t11$1;
|
|
307
|
-
$[60] = t12$1;
|
|
308
|
-
$[61] = t13$1;
|
|
309
|
-
} else t13$1 = $[61];
|
|
310
|
-
return t13$1;
|
|
144
|
+
}
|
|
311
145
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
146
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
147
|
+
className: cn("qa-asset-thumbnail bg-muted relative overflow-hidden border", className),
|
|
148
|
+
children: [
|
|
149
|
+
isImageType && url && /* @__PURE__ */ jsx("div", {
|
|
150
|
+
className: "relative",
|
|
151
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
152
|
+
src: url,
|
|
153
|
+
alt: alt || filename || "Asset preview",
|
|
154
|
+
className: "image-outline max-h-[400px] w-full object-contain"
|
|
155
|
+
})
|
|
156
|
+
}),
|
|
157
|
+
isVideoType && url && /* @__PURE__ */ jsx("div", {
|
|
158
|
+
className: "relative",
|
|
159
|
+
children: showControls ? /* @__PURE__ */ jsxs("video", {
|
|
160
|
+
src: url,
|
|
161
|
+
controls: true,
|
|
162
|
+
className: "max-h-[400px] w-full",
|
|
163
|
+
preload: "metadata",
|
|
164
|
+
children: [/* @__PURE__ */ jsx("track", { kind: "captions" }), "Your browser does not support the video tag."]
|
|
165
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
166
|
+
className: "flex flex-col items-center justify-center gap-4 p-12",
|
|
167
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
168
|
+
icon: fileIcon,
|
|
169
|
+
className: "text-muted-foreground size-20"
|
|
170
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
171
|
+
className: "text-muted-foreground text-sm",
|
|
172
|
+
children: filename || "Video"
|
|
173
|
+
})]
|
|
174
|
+
})
|
|
175
|
+
}),
|
|
176
|
+
isAudioType && url && /* @__PURE__ */ jsxs("div", {
|
|
177
|
+
className: "flex flex-col items-center justify-center gap-4 p-8",
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
180
|
+
icon: fileIcon,
|
|
181
|
+
className: "text-muted-foreground size-16"
|
|
182
|
+
}),
|
|
183
|
+
showControls && /* @__PURE__ */ jsxs("audio", {
|
|
184
|
+
src: url,
|
|
185
|
+
controls: true,
|
|
186
|
+
className: "w-full max-w-md",
|
|
187
|
+
preload: "metadata",
|
|
188
|
+
children: [/* @__PURE__ */ jsx("track", { kind: "captions" }), "Your browser does not support the audio tag."]
|
|
189
|
+
}),
|
|
190
|
+
!showControls && /* @__PURE__ */ jsx("p", {
|
|
191
|
+
className: "text-muted-foreground text-sm",
|
|
192
|
+
children: filename || "Audio"
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
}),
|
|
196
|
+
(!url || !isImageType && !isVideoType && !isAudioType) && /* @__PURE__ */ jsxs("div", {
|
|
345
197
|
className: "flex flex-col items-center justify-center gap-4 p-12",
|
|
346
198
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
347
199
|
icon: fileIcon,
|
|
348
200
|
className: "text-muted-foreground size-20"
|
|
349
201
|
}), /* @__PURE__ */ jsx("p", {
|
|
350
202
|
className: "text-muted-foreground text-sm",
|
|
351
|
-
children: filename || "
|
|
203
|
+
children: filename || "File"
|
|
352
204
|
})]
|
|
353
|
-
})
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
/* @__PURE__ */ jsx(Icon, {
|
|
368
|
-
icon: fileIcon,
|
|
369
|
-
className: "text-muted-foreground size-16"
|
|
370
|
-
}),
|
|
371
|
-
showControls && /* @__PURE__ */ jsxs("audio", {
|
|
372
|
-
src: url,
|
|
373
|
-
controls: true,
|
|
374
|
-
className: "w-full max-w-md",
|
|
375
|
-
preload: "metadata",
|
|
376
|
-
children: [/* @__PURE__ */ jsx("track", { kind: "captions" }), "Your browser does not support the audio tag."]
|
|
377
|
-
}),
|
|
378
|
-
!showControls && /* @__PURE__ */ jsx("p", {
|
|
379
|
-
className: "text-muted-foreground text-sm",
|
|
380
|
-
children: filename || "Audio"
|
|
205
|
+
}),
|
|
206
|
+
url && /* @__PURE__ */ jsx("div", {
|
|
207
|
+
className: "absolute top-2 right-2",
|
|
208
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
209
|
+
type: "button",
|
|
210
|
+
variant: "secondary",
|
|
211
|
+
size: "icon-sm",
|
|
212
|
+
nativeButton: false,
|
|
213
|
+
render: /* @__PURE__ */ jsx("a", {
|
|
214
|
+
href: url,
|
|
215
|
+
target: "_blank",
|
|
216
|
+
rel: "noopener noreferrer"
|
|
217
|
+
}),
|
|
218
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: "ph:arrow-square-out-bold" })
|
|
381
219
|
})
|
|
382
|
-
]
|
|
383
|
-
});
|
|
384
|
-
$[75] = fileIcon;
|
|
385
|
-
$[76] = filename;
|
|
386
|
-
$[77] = isAudioType;
|
|
387
|
-
$[78] = showControls;
|
|
388
|
-
$[79] = url;
|
|
389
|
-
$[80] = t11;
|
|
390
|
-
} else t11 = $[80];
|
|
391
|
-
let t12;
|
|
392
|
-
if ($[81] !== fileIcon || $[82] !== filename || $[83] !== isAudioType || $[84] !== isImageType || $[85] !== isVideoType || $[86] !== url) {
|
|
393
|
-
t12 = (!url || !isImageType && !isVideoType && !isAudioType) && /* @__PURE__ */ jsxs("div", {
|
|
394
|
-
className: "flex flex-col items-center justify-center gap-4 p-12",
|
|
395
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
396
|
-
icon: fileIcon,
|
|
397
|
-
className: "text-muted-foreground size-20"
|
|
398
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
399
|
-
className: "text-muted-foreground text-sm",
|
|
400
|
-
children: filename || "File"
|
|
401
|
-
})]
|
|
402
|
-
});
|
|
403
|
-
$[81] = fileIcon;
|
|
404
|
-
$[82] = filename;
|
|
405
|
-
$[83] = isAudioType;
|
|
406
|
-
$[84] = isImageType;
|
|
407
|
-
$[85] = isVideoType;
|
|
408
|
-
$[86] = url;
|
|
409
|
-
$[87] = t12;
|
|
410
|
-
} else t12 = $[87];
|
|
411
|
-
let t13;
|
|
412
|
-
if ($[88] !== url) {
|
|
413
|
-
t13 = url && /* @__PURE__ */ jsx("div", {
|
|
414
|
-
className: "absolute top-2 right-2",
|
|
415
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
416
|
-
type: "button",
|
|
417
|
-
variant: "secondary",
|
|
418
|
-
size: "icon-sm",
|
|
419
|
-
nativeButton: false,
|
|
420
|
-
render: /* @__PURE__ */ jsx("a", {
|
|
421
|
-
href: url,
|
|
422
|
-
target: "_blank",
|
|
423
|
-
rel: "noopener noreferrer"
|
|
424
|
-
}),
|
|
425
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: "ph:arrow-square-out-bold" })
|
|
426
220
|
})
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
$[89] = t13;
|
|
430
|
-
} else t13 = $[89];
|
|
431
|
-
let t14;
|
|
432
|
-
if ($[90] !== t10 || $[91] !== t11 || $[92] !== t12 || $[93] !== t13 || $[94] !== t8 || $[95] !== t9) {
|
|
433
|
-
t14 = /* @__PURE__ */ jsxs("div", {
|
|
434
|
-
className: t8,
|
|
435
|
-
children: [
|
|
436
|
-
t9,
|
|
437
|
-
t10,
|
|
438
|
-
t11,
|
|
439
|
-
t12,
|
|
440
|
-
t13
|
|
441
|
-
]
|
|
442
|
-
});
|
|
443
|
-
$[90] = t10;
|
|
444
|
-
$[91] = t11;
|
|
445
|
-
$[92] = t12;
|
|
446
|
-
$[93] = t13;
|
|
447
|
-
$[94] = t8;
|
|
448
|
-
$[95] = t9;
|
|
449
|
-
$[96] = t14;
|
|
450
|
-
} else t14 = $[96];
|
|
451
|
-
return t14;
|
|
221
|
+
]
|
|
222
|
+
});
|
|
452
223
|
}
|
|
453
224
|
|
|
454
225
|
//#endregion
|