@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useTranslation } from "../../i18n/hooks.mjs";
|
|
2
2
|
import { cn } from "../../lib/utils.mjs";
|
|
3
|
+
import { Button } from "../ui/button.mjs";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { Icon } from "@iconify/react";
|
|
5
6
|
import * as React from "react";
|
|
@@ -47,18 +48,19 @@ function formatFileSize(bytes) {
|
|
|
47
48
|
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
48
49
|
}
|
|
49
50
|
function Dropzone(t0) {
|
|
50
|
-
const $ = c(
|
|
51
|
-
const { onDrop, accept, maxSize, multiple: t1, disabled: t2, loading: t3, progress, label, hint, error, className, children, onValidationError } = t0;
|
|
51
|
+
const $ = c(70);
|
|
52
|
+
const { onDrop, accept, maxSize, multiple: t1, disabled: t2, loading: t3, progress, variant: t4, label, hint, error, className, children, action, onValidationError } = t0;
|
|
52
53
|
const multiple = t1 === void 0 ? false : t1;
|
|
53
54
|
const disabled = t2 === void 0 ? false : t2;
|
|
54
55
|
const loading = t3 === void 0 ? false : t3;
|
|
56
|
+
const variant = t4 === void 0 ? "panel" : t4;
|
|
55
57
|
const { t } = useTranslation();
|
|
56
58
|
const [isDragging, setIsDragging] = React.useState(false);
|
|
57
59
|
const inputRef = React.useRef(null);
|
|
58
60
|
const dragCounterRef = React.useRef(0);
|
|
59
|
-
let
|
|
61
|
+
let t5;
|
|
60
62
|
if ($[0] !== accept || $[1] !== maxSize || $[2] !== t) {
|
|
61
|
-
|
|
63
|
+
t5 = (files) => {
|
|
62
64
|
const valid = [];
|
|
63
65
|
const errors = [];
|
|
64
66
|
for (const file of files) {
|
|
@@ -91,12 +93,12 @@ function Dropzone(t0) {
|
|
|
91
93
|
$[0] = accept;
|
|
92
94
|
$[1] = maxSize;
|
|
93
95
|
$[2] = t;
|
|
94
|
-
$[3] =
|
|
95
|
-
} else
|
|
96
|
-
const validateFiles =
|
|
97
|
-
let
|
|
96
|
+
$[3] = t5;
|
|
97
|
+
} else t5 = $[3];
|
|
98
|
+
const validateFiles = t5;
|
|
99
|
+
let t6;
|
|
98
100
|
if ($[4] !== disabled || $[5] !== loading || $[6] !== multiple || $[7] !== onDrop || $[8] !== onValidationError || $[9] !== validateFiles) {
|
|
99
|
-
|
|
101
|
+
t6 = (files_0) => {
|
|
100
102
|
if (disabled || loading) return;
|
|
101
103
|
const fileArray = Array.from(files_0);
|
|
102
104
|
const { valid: valid_0, errors: errors_0 } = validateFiles(multiple ? fileArray : fileArray.slice(0, 1));
|
|
@@ -109,12 +111,12 @@ function Dropzone(t0) {
|
|
|
109
111
|
$[7] = onDrop;
|
|
110
112
|
$[8] = onValidationError;
|
|
111
113
|
$[9] = validateFiles;
|
|
112
|
-
$[10] =
|
|
113
|
-
} else
|
|
114
|
-
const handleFiles =
|
|
115
|
-
let
|
|
114
|
+
$[10] = t6;
|
|
115
|
+
} else t6 = $[10];
|
|
116
|
+
const handleFiles = t6;
|
|
117
|
+
let t7;
|
|
116
118
|
if ($[11] !== disabled || $[12] !== loading) {
|
|
117
|
-
|
|
119
|
+
t7 = (e) => {
|
|
118
120
|
e.preventDefault();
|
|
119
121
|
e.stopPropagation();
|
|
120
122
|
dragCounterRef.current = dragCounterRef.current + 1;
|
|
@@ -122,24 +124,24 @@ function Dropzone(t0) {
|
|
|
122
124
|
};
|
|
123
125
|
$[11] = disabled;
|
|
124
126
|
$[12] = loading;
|
|
125
|
-
$[13] =
|
|
126
|
-
} else
|
|
127
|
-
const handleDragEnter =
|
|
128
|
-
let
|
|
127
|
+
$[13] = t7;
|
|
128
|
+
} else t7 = $[13];
|
|
129
|
+
const handleDragEnter = t7;
|
|
130
|
+
let t8;
|
|
129
131
|
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
130
|
-
|
|
132
|
+
t8 = (e_0) => {
|
|
131
133
|
e_0.preventDefault();
|
|
132
134
|
e_0.stopPropagation();
|
|
133
135
|
dragCounterRef.current = dragCounterRef.current - 1;
|
|
134
136
|
if (dragCounterRef.current === 0) setIsDragging(false);
|
|
135
137
|
};
|
|
136
|
-
$[14] =
|
|
137
|
-
} else
|
|
138
|
-
const handleDragLeave =
|
|
138
|
+
$[14] = t8;
|
|
139
|
+
} else t8 = $[14];
|
|
140
|
+
const handleDragLeave = t8;
|
|
139
141
|
const handleDragOver = _temp;
|
|
140
|
-
let
|
|
142
|
+
let t9;
|
|
141
143
|
if ($[15] !== handleFiles) {
|
|
142
|
-
|
|
144
|
+
t9 = (e_2) => {
|
|
143
145
|
e_2.preventDefault();
|
|
144
146
|
e_2.stopPropagation();
|
|
145
147
|
dragCounterRef.current = 0;
|
|
@@ -147,50 +149,51 @@ function Dropzone(t0) {
|
|
|
147
149
|
if (e_2.dataTransfer.files.length > 0) handleFiles(e_2.dataTransfer.files);
|
|
148
150
|
};
|
|
149
151
|
$[15] = handleFiles;
|
|
150
|
-
$[16] =
|
|
151
|
-
} else
|
|
152
|
-
const handleDrop =
|
|
153
|
-
let
|
|
152
|
+
$[16] = t9;
|
|
153
|
+
} else t9 = $[16];
|
|
154
|
+
const handleDrop = t9;
|
|
155
|
+
let t10;
|
|
154
156
|
if ($[17] !== disabled || $[18] !== loading) {
|
|
155
|
-
|
|
157
|
+
t10 = () => {
|
|
156
158
|
if (disabled || loading) return;
|
|
157
159
|
inputRef.current?.click();
|
|
158
160
|
};
|
|
159
161
|
$[17] = disabled;
|
|
160
162
|
$[18] = loading;
|
|
161
|
-
$[19] =
|
|
162
|
-
} else
|
|
163
|
-
const handleClick =
|
|
164
|
-
let
|
|
163
|
+
$[19] = t10;
|
|
164
|
+
} else t10 = $[19];
|
|
165
|
+
const handleClick = t10;
|
|
166
|
+
let t11;
|
|
165
167
|
if ($[20] !== handleFiles) {
|
|
166
|
-
|
|
168
|
+
t11 = (e_3) => {
|
|
167
169
|
if (e_3.target.files && e_3.target.files.length > 0) handleFiles(e_3.target.files);
|
|
168
170
|
e_3.target.value = "";
|
|
169
171
|
};
|
|
170
172
|
$[20] = handleFiles;
|
|
171
|
-
$[21] =
|
|
172
|
-
} else
|
|
173
|
-
const handleInputChange =
|
|
174
|
-
let
|
|
173
|
+
$[21] = t11;
|
|
174
|
+
} else t11 = $[21];
|
|
175
|
+
const handleInputChange = t11;
|
|
176
|
+
let t12;
|
|
175
177
|
if ($[22] !== accept) {
|
|
176
|
-
|
|
178
|
+
t12 = accept?.join(",") || void 0;
|
|
177
179
|
$[22] = accept;
|
|
178
|
-
$[23] =
|
|
179
|
-
} else
|
|
180
|
-
const acceptString =
|
|
181
|
-
|
|
180
|
+
$[23] = t12;
|
|
181
|
+
} else t12 = $[23];
|
|
182
|
+
const acceptString = t12;
|
|
183
|
+
const isCompact = variant === "compact";
|
|
184
|
+
let t13;
|
|
182
185
|
bb0: {
|
|
183
186
|
if (hint) {
|
|
184
|
-
|
|
187
|
+
t13 = hint;
|
|
185
188
|
break bb0;
|
|
186
189
|
}
|
|
187
190
|
let parts;
|
|
188
191
|
if ($[24] !== accept || $[25] !== maxSize || $[26] !== t) {
|
|
189
192
|
parts = [];
|
|
190
193
|
if (accept && accept.length > 0) {
|
|
191
|
-
let
|
|
194
|
+
let t14$1;
|
|
192
195
|
if ($[28] !== t) {
|
|
193
|
-
|
|
196
|
+
t14$1 = (mimeType) => {
|
|
194
197
|
if (mimeType.startsWith("image/")) return t("dropzone.typeImages");
|
|
195
198
|
if (mimeType.startsWith("video/")) return t("dropzone.typeVideos");
|
|
196
199
|
if (mimeType.startsWith("audio/")) return t("dropzone.typeAudio");
|
|
@@ -199,162 +202,192 @@ function Dropzone(t0) {
|
|
|
199
202
|
return mimeType;
|
|
200
203
|
};
|
|
201
204
|
$[28] = t;
|
|
202
|
-
$[29] =
|
|
203
|
-
} else
|
|
204
|
-
const types = accept.map(
|
|
205
|
+
$[29] = t14$1;
|
|
206
|
+
} else t14$1 = $[29];
|
|
207
|
+
const types = accept.map(t14$1).filter(_temp2);
|
|
205
208
|
parts.push(types.join(", "));
|
|
206
209
|
}
|
|
207
210
|
if (maxSize) {
|
|
208
|
-
let
|
|
211
|
+
let t14$1;
|
|
209
212
|
if ($[30] !== maxSize) {
|
|
210
|
-
|
|
213
|
+
t14$1 = formatFileSize(maxSize);
|
|
211
214
|
$[30] = maxSize;
|
|
212
|
-
$[31] =
|
|
213
|
-
} else
|
|
214
|
-
parts.push(`Max ${
|
|
215
|
+
$[31] = t14$1;
|
|
216
|
+
} else t14$1 = $[31];
|
|
217
|
+
parts.push(`Max ${t14$1}`);
|
|
215
218
|
}
|
|
216
219
|
$[24] = accept;
|
|
217
220
|
$[25] = maxSize;
|
|
218
221
|
$[26] = t;
|
|
219
222
|
$[27] = parts;
|
|
220
223
|
} else parts = $[27];
|
|
221
|
-
|
|
224
|
+
t13 = parts.length > 0 ? parts.join(" • ") : void 0;
|
|
222
225
|
}
|
|
223
|
-
const hintText =
|
|
224
|
-
const
|
|
225
|
-
let
|
|
226
|
+
const hintText = t13;
|
|
227
|
+
const t14 = disabled || loading ? -1 : 0;
|
|
228
|
+
let t15;
|
|
226
229
|
if ($[32] !== handleClick) {
|
|
227
|
-
|
|
230
|
+
t15 = (e_4) => {
|
|
228
231
|
if (e_4.key === "Enter" || e_4.key === " ") {
|
|
229
232
|
e_4.preventDefault();
|
|
230
233
|
handleClick();
|
|
231
234
|
}
|
|
232
235
|
};
|
|
233
236
|
$[32] = handleClick;
|
|
234
|
-
$[33] =
|
|
235
|
-
} else
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
$[33] = t15;
|
|
238
|
+
} else t15 = $[33];
|
|
239
|
+
const t16 = isCompact ? "min-h-16 flex-row items-center justify-start gap-3 border border-dashed p-3 text-left" : "min-h-[120px] flex-col items-center justify-center gap-2 border-2 p-6 text-center";
|
|
240
|
+
const t17 = isDragging && "border-border-strong bg-surface-high";
|
|
241
|
+
const t18 = error && "border-destructive/50 bg-destructive/5";
|
|
242
|
+
const t19 = (disabled || loading) && "pointer-events-none opacity-60";
|
|
243
|
+
let t20;
|
|
244
|
+
if ($[34] !== className || $[35] !== t16 || $[36] !== t17 || $[37] !== t18 || $[38] !== t19) {
|
|
245
|
+
t20 = cn("qa-dropzone control-surface relative flex cursor-pointer hover:bg-muted/40 rounded-lg border transition-colors", t16, t17, t18, t19, className);
|
|
242
246
|
$[34] = className;
|
|
243
|
-
$[35] =
|
|
244
|
-
$[36] =
|
|
245
|
-
$[37] =
|
|
246
|
-
$[38] =
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const t20 = isDragging || void 0;
|
|
247
|
+
$[35] = t16;
|
|
248
|
+
$[36] = t17;
|
|
249
|
+
$[37] = t18;
|
|
250
|
+
$[38] = t19;
|
|
251
|
+
$[39] = t20;
|
|
252
|
+
} else t20 = $[39];
|
|
250
253
|
const t21 = disabled || loading;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
+
const t22 = isDragging || void 0;
|
|
255
|
+
const t23 = disabled || loading;
|
|
256
|
+
let t24;
|
|
257
|
+
if ($[40] !== acceptString || $[41] !== handleInputChange || $[42] !== multiple || $[43] !== t23) {
|
|
258
|
+
t24 = /* @__PURE__ */ jsx("input", {
|
|
254
259
|
ref: inputRef,
|
|
255
260
|
type: "file",
|
|
256
261
|
accept: acceptString,
|
|
257
262
|
multiple,
|
|
258
263
|
onChange: handleInputChange,
|
|
259
264
|
className: "sr-only",
|
|
260
|
-
disabled:
|
|
265
|
+
disabled: t23,
|
|
261
266
|
tabIndex: -1
|
|
262
267
|
});
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
} else
|
|
269
|
-
let
|
|
270
|
-
if ($[
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
268
|
+
$[40] = acceptString;
|
|
269
|
+
$[41] = handleInputChange;
|
|
270
|
+
$[42] = multiple;
|
|
271
|
+
$[43] = t23;
|
|
272
|
+
$[44] = t24;
|
|
273
|
+
} else t24 = $[44];
|
|
274
|
+
let t25;
|
|
275
|
+
if ($[45] !== action || $[46] !== children || $[47] !== disabled || $[48] !== hintText || $[49] !== isCompact || $[50] !== isDragging || $[51] !== label || $[52] !== loading || $[53] !== progress || $[54] !== t) {
|
|
276
|
+
t25 = children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
277
|
+
/* @__PURE__ */ jsx("div", {
|
|
278
|
+
className: cn("flex shrink-0 items-center justify-center", isCompact && "bg-background/70 border-border-subtle size-9 rounded border"),
|
|
279
|
+
children: loading ? /* @__PURE__ */ jsxs("div", {
|
|
280
|
+
className: "relative",
|
|
281
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
282
|
+
icon: "ph:spinner-gap",
|
|
283
|
+
className: cn("text-muted-foreground animate-spin", isCompact ? "size-5" : "size-10")
|
|
284
|
+
}), typeof progress === "number" && /* @__PURE__ */ jsxs("span", {
|
|
285
|
+
className: cn("text-muted-foreground absolute inset-0 flex items-center justify-center font-medium tabular-nums", isCompact ? "text-[9px]" : "text-xs"),
|
|
286
|
+
children: [progress, "%"]
|
|
287
|
+
})]
|
|
288
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
289
|
+
icon: "ph:cloud-arrow-up",
|
|
290
|
+
className: cn("transition-colors", isCompact ? "size-5" : "size-10", isDragging ? "text-foreground" : "text-muted-foreground")
|
|
291
|
+
})
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ jsxs("div", {
|
|
294
|
+
className: cn("min-w-0 space-y-1", isCompact && "flex-1"),
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ jsx("p", {
|
|
297
|
+
className: cn("text-foreground text-sm font-medium", isCompact && "truncate"),
|
|
298
|
+
children: loading ? t("dropzone.uploading") : label || t("dropzone.label")
|
|
299
|
+
}),
|
|
300
|
+
hintText && !loading && /* @__PURE__ */ jsx("p", {
|
|
301
|
+
className: cn("text-muted-foreground text-xs", isCompact && "truncate"),
|
|
302
|
+
children: hintText
|
|
303
|
+
}),
|
|
304
|
+
loading && typeof progress === "number" && /* @__PURE__ */ jsx("div", {
|
|
305
|
+
className: cn("bg-muted mt-2 h-1.5 overflow-hidden rounded-full", isCompact ? "w-full" : "mx-auto w-32"),
|
|
306
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
307
|
+
className: "bg-primary h-full rounded-full transition-[width] duration-300",
|
|
308
|
+
style: { width: `${progress}%` }
|
|
309
|
+
})
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
}),
|
|
313
|
+
action && !loading && !disabled && /* @__PURE__ */ jsxs(Button, {
|
|
314
|
+
type: "button",
|
|
315
|
+
variant: "outline",
|
|
316
|
+
size: "sm",
|
|
317
|
+
disabled: action.disabled,
|
|
318
|
+
onClick: (e_5) => {
|
|
319
|
+
e_5.stopPropagation();
|
|
320
|
+
action.onClick();
|
|
321
|
+
},
|
|
322
|
+
onKeyDown: _temp3,
|
|
323
|
+
className: cn("shrink-0", isCompact && "max-w-[45%] px-2.5"),
|
|
324
|
+
children: [action.icon && /* @__PURE__ */ jsx(Icon, {
|
|
325
|
+
icon: action.icon,
|
|
326
|
+
className: "size-4 shrink-0"
|
|
327
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
328
|
+
className: "truncate",
|
|
329
|
+
children: action.label
|
|
281
330
|
})]
|
|
282
|
-
}) : /* @__PURE__ */ jsx(Icon, {
|
|
283
|
-
icon: "ph:cloud-arrow-up",
|
|
284
|
-
className: cn("size-10 transition-colors", isDragging ? "text-primary" : "text-muted-foreground")
|
|
285
331
|
})
|
|
286
|
-
})
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
})
|
|
303
|
-
})
|
|
304
|
-
]
|
|
305
|
-
})] });
|
|
306
|
-
$[44] = children;
|
|
307
|
-
$[45] = hintText;
|
|
308
|
-
$[46] = isDragging;
|
|
309
|
-
$[47] = label;
|
|
310
|
-
$[48] = loading;
|
|
311
|
-
$[49] = progress;
|
|
312
|
-
$[50] = t;
|
|
313
|
-
$[51] = t23;
|
|
314
|
-
} else t23 = $[51];
|
|
315
|
-
let t24;
|
|
316
|
-
if ($[52] !== error) {
|
|
317
|
-
t24 = error && /* @__PURE__ */ jsx("p", {
|
|
332
|
+
] });
|
|
333
|
+
$[45] = action;
|
|
334
|
+
$[46] = children;
|
|
335
|
+
$[47] = disabled;
|
|
336
|
+
$[48] = hintText;
|
|
337
|
+
$[49] = isCompact;
|
|
338
|
+
$[50] = isDragging;
|
|
339
|
+
$[51] = label;
|
|
340
|
+
$[52] = loading;
|
|
341
|
+
$[53] = progress;
|
|
342
|
+
$[54] = t;
|
|
343
|
+
$[55] = t25;
|
|
344
|
+
} else t25 = $[55];
|
|
345
|
+
let t26;
|
|
346
|
+
if ($[56] !== error) {
|
|
347
|
+
t26 = error && /* @__PURE__ */ jsx("p", {
|
|
318
348
|
className: "text-destructive absolute right-0 bottom-2 left-0 text-center text-xs",
|
|
319
349
|
children: error
|
|
320
350
|
});
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
} else
|
|
324
|
-
let
|
|
325
|
-
if ($[
|
|
326
|
-
|
|
351
|
+
$[56] = error;
|
|
352
|
+
$[57] = t26;
|
|
353
|
+
} else t26 = $[57];
|
|
354
|
+
let t27;
|
|
355
|
+
if ($[58] !== handleClick || $[59] !== handleDragEnter || $[60] !== handleDrop || $[61] !== t14 || $[62] !== t15 || $[63] !== t20 || $[64] !== t21 || $[65] !== t22 || $[66] !== t24 || $[67] !== t25 || $[68] !== t26) {
|
|
356
|
+
t27 = /* @__PURE__ */ jsxs("div", {
|
|
327
357
|
role: "button",
|
|
328
|
-
tabIndex:
|
|
358
|
+
tabIndex: t14,
|
|
329
359
|
onClick: handleClick,
|
|
330
|
-
onKeyDown:
|
|
360
|
+
onKeyDown: t15,
|
|
331
361
|
onDragEnter: handleDragEnter,
|
|
332
362
|
onDragLeave: handleDragLeave,
|
|
333
363
|
onDragOver: handleDragOver,
|
|
334
364
|
onDrop: handleDrop,
|
|
335
|
-
className:
|
|
336
|
-
"aria-disabled":
|
|
337
|
-
"data-dragging":
|
|
365
|
+
className: t20,
|
|
366
|
+
"aria-disabled": t21,
|
|
367
|
+
"data-dragging": t22,
|
|
338
368
|
children: [
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
369
|
+
t24,
|
|
370
|
+
t25,
|
|
371
|
+
t26
|
|
342
372
|
]
|
|
343
373
|
});
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
} else
|
|
357
|
-
return
|
|
374
|
+
$[58] = handleClick;
|
|
375
|
+
$[59] = handleDragEnter;
|
|
376
|
+
$[60] = handleDrop;
|
|
377
|
+
$[61] = t14;
|
|
378
|
+
$[62] = t15;
|
|
379
|
+
$[63] = t20;
|
|
380
|
+
$[64] = t21;
|
|
381
|
+
$[65] = t22;
|
|
382
|
+
$[66] = t24;
|
|
383
|
+
$[67] = t25;
|
|
384
|
+
$[68] = t26;
|
|
385
|
+
$[69] = t27;
|
|
386
|
+
} else t27 = $[69];
|
|
387
|
+
return t27;
|
|
388
|
+
}
|
|
389
|
+
function _temp3(e_6) {
|
|
390
|
+
e_6.stopPropagation();
|
|
358
391
|
}
|
|
359
392
|
function _temp2(v, i, a) {
|
|
360
393
|
return a.indexOf(v) === i;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../lib/utils.mjs";
|
|
4
|
+
import { Button } from "../ui/button.mjs";
|
|
5
|
+
import { InputGroup } from "../ui/input-group.mjs";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/client/components/primitives/field-select-control.tsx
|
|
10
|
+
function FieldSelectTrigger(t0) {
|
|
11
|
+
const $ = c(13);
|
|
12
|
+
let asInputGroupControl;
|
|
13
|
+
let className;
|
|
14
|
+
let hasValue;
|
|
15
|
+
let props;
|
|
16
|
+
if ($[0] !== t0) {
|
|
17
|
+
({className, hasValue, asInputGroupControl, ...props} = t0);
|
|
18
|
+
$[0] = t0;
|
|
19
|
+
$[1] = asInputGroupControl;
|
|
20
|
+
$[2] = className;
|
|
21
|
+
$[3] = hasValue;
|
|
22
|
+
$[4] = props;
|
|
23
|
+
} else {
|
|
24
|
+
asInputGroupControl = $[1];
|
|
25
|
+
className = $[2];
|
|
26
|
+
hasValue = $[3];
|
|
27
|
+
props = $[4];
|
|
28
|
+
}
|
|
29
|
+
const t1 = asInputGroupControl ? "input-group-control" : void 0;
|
|
30
|
+
const t2 = !hasValue && "text-muted-foreground";
|
|
31
|
+
const t3 = asInputGroupControl && "h-full min-w-0 flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0";
|
|
32
|
+
let t4;
|
|
33
|
+
if ($[5] !== className || $[6] !== t2 || $[7] !== t3) {
|
|
34
|
+
t4 = cn("qa-field-select-control qa-select-single control-surface w-full justify-between px-3 py-2 font-normal", "hover:bg-surface-low focus-visible:border-border-strong focus-visible:ring-ring/20 aria-expanded:border-border-strong aria-expanded:ring-ring/20 focus-visible:ring-[3px] aria-expanded:ring-[3px]", t2, t3, className);
|
|
35
|
+
$[5] = className;
|
|
36
|
+
$[6] = t2;
|
|
37
|
+
$[7] = t3;
|
|
38
|
+
$[8] = t4;
|
|
39
|
+
} else t4 = $[8];
|
|
40
|
+
let t5;
|
|
41
|
+
if ($[9] !== props || $[10] !== t1 || $[11] !== t4) {
|
|
42
|
+
t5 = /* @__PURE__ */ jsx(Button, {
|
|
43
|
+
variant: "outline",
|
|
44
|
+
"data-slot": t1,
|
|
45
|
+
className: t4,
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
$[9] = props;
|
|
49
|
+
$[10] = t1;
|
|
50
|
+
$[11] = t4;
|
|
51
|
+
$[12] = t5;
|
|
52
|
+
} else t5 = $[12];
|
|
53
|
+
return t5;
|
|
54
|
+
}
|
|
55
|
+
function FieldSelectActionGroup(t0) {
|
|
56
|
+
const $ = c(10);
|
|
57
|
+
let className;
|
|
58
|
+
let error;
|
|
59
|
+
let props;
|
|
60
|
+
if ($[0] !== t0) {
|
|
61
|
+
({className, error, ...props} = t0);
|
|
62
|
+
$[0] = t0;
|
|
63
|
+
$[1] = className;
|
|
64
|
+
$[2] = error;
|
|
65
|
+
$[3] = props;
|
|
66
|
+
} else {
|
|
67
|
+
className = $[1];
|
|
68
|
+
error = $[2];
|
|
69
|
+
props = $[3];
|
|
70
|
+
}
|
|
71
|
+
const t1 = error && "border-destructive ring-destructive/20 ring-[2px]";
|
|
72
|
+
let t2;
|
|
73
|
+
if ($[4] !== className || $[5] !== t1) {
|
|
74
|
+
t2 = cn("qa-field-select-action-group control-surface overflow-hidden p-0", t1, className);
|
|
75
|
+
$[4] = className;
|
|
76
|
+
$[5] = t1;
|
|
77
|
+
$[6] = t2;
|
|
78
|
+
} else t2 = $[6];
|
|
79
|
+
let t3;
|
|
80
|
+
if ($[7] !== props || $[8] !== t2) {
|
|
81
|
+
t3 = /* @__PURE__ */ jsx(InputGroup, {
|
|
82
|
+
className: t2,
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
$[7] = props;
|
|
86
|
+
$[8] = t2;
|
|
87
|
+
$[9] = t3;
|
|
88
|
+
} else t3 = $[9];
|
|
89
|
+
return t3;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { FieldSelectActionGroup, FieldSelectTrigger };
|