@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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { FieldComponentProps } from "../../../builder/types/field-types.mjs";
|
|
2
|
+
import "../../../builder/index.mjs";
|
|
3
|
+
import { RichTextPreset } from "./presets.mjs";
|
|
4
|
+
import { Extension } from "@tiptap/core";
|
|
5
|
+
|
|
6
|
+
//#region src/client/components/fields/rich-text-editor/types.d.ts
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Feature toggles for the RichText editor
|
|
10
|
+
*/
|
|
11
|
+
type RichTextFeatures = {
|
|
12
|
+
toolbar?: boolean;
|
|
13
|
+
bubbleMenu?: boolean;
|
|
14
|
+
slashCommands?: boolean;
|
|
15
|
+
history?: boolean;
|
|
16
|
+
heading?: boolean;
|
|
17
|
+
bold?: boolean;
|
|
18
|
+
italic?: boolean;
|
|
19
|
+
underline?: boolean;
|
|
20
|
+
strike?: boolean;
|
|
21
|
+
code?: boolean;
|
|
22
|
+
codeBlock?: boolean;
|
|
23
|
+
blockquote?: boolean;
|
|
24
|
+
bulletList?: boolean;
|
|
25
|
+
orderedList?: boolean;
|
|
26
|
+
horizontalRule?: boolean;
|
|
27
|
+
align?: boolean;
|
|
28
|
+
link?: boolean;
|
|
29
|
+
image?: boolean;
|
|
30
|
+
table?: boolean;
|
|
31
|
+
tableControls?: boolean;
|
|
32
|
+
characterCount?: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Props for the RichTextEditor component
|
|
36
|
+
*/
|
|
37
|
+
interface RichTextEditorProps extends FieldComponentProps<any> {
|
|
38
|
+
/**
|
|
39
|
+
* Custom Tiptap extensions
|
|
40
|
+
*/
|
|
41
|
+
extensions?: Extension[];
|
|
42
|
+
/**
|
|
43
|
+
* Preset configuration (minimal, simple, standard, advanced)
|
|
44
|
+
* Can be overridden by features prop
|
|
45
|
+
*/
|
|
46
|
+
preset?: RichTextPreset;
|
|
47
|
+
/**
|
|
48
|
+
* Feature toggles (overrides preset)
|
|
49
|
+
*/
|
|
50
|
+
features?: RichTextFeatures;
|
|
51
|
+
/**
|
|
52
|
+
* Show character count
|
|
53
|
+
*/
|
|
54
|
+
showCharacterCount?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Max character limit
|
|
57
|
+
*/
|
|
58
|
+
maxCharacters?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Enable image uploads
|
|
61
|
+
*/
|
|
62
|
+
enableImages?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Image upload handler
|
|
65
|
+
*/
|
|
66
|
+
onImageUpload?: (file: File) => Promise<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Target collection for image uploads
|
|
69
|
+
*/
|
|
70
|
+
imageCollection?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Enable media library picker for images
|
|
73
|
+
*/
|
|
74
|
+
enableMediaLibrary?: boolean;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { RichTextEditorProps };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
|
|
2
2
|
import { cn } from "../../lib/utils.mjs";
|
|
3
3
|
import { selectClient, useAdminStore } from "../../runtime/provider.mjs";
|
|
4
|
-
import { Button } from "../ui/button.mjs";
|
|
5
4
|
import { sanitizeFilename, useResolvedControl } from "./field-utils.mjs";
|
|
6
5
|
import { FieldWrapper } from "./field-wrapper.mjs";
|
|
7
6
|
import { useCollectionItem } from "../../hooks/use-collection.mjs";
|
|
@@ -12,7 +11,6 @@ import { AssetPreview } from "../primitives/asset-preview.mjs";
|
|
|
12
11
|
import { MediaPickerDialog } from "../media/media-picker-dialog.mjs";
|
|
13
12
|
import { Dropzone } from "../primitives/dropzone.mjs";
|
|
14
13
|
import { c } from "react/compiler-runtime";
|
|
15
|
-
import { Icon } from "@iconify/react";
|
|
16
14
|
import * as React from "react";
|
|
17
15
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
18
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -158,7 +156,7 @@ function SingleUploadInner({ field, error, collection, unresolvedCollectionMessa
|
|
|
158
156
|
const { t } = useTranslation();
|
|
159
157
|
const resolveText = useResolveText();
|
|
160
158
|
const resolvedPlaceholder = placeholder ? resolveText(placeholder) : void 0;
|
|
161
|
-
const { upload, isUploading, progress
|
|
159
|
+
const { upload, isUploading, progress } = useUpload();
|
|
162
160
|
const [isPickerOpen, setIsPickerOpen] = React.useState(false);
|
|
163
161
|
const [isEditSheetOpen, setIsEditSheetOpen] = React.useState(false);
|
|
164
162
|
const assetId = field.value;
|
|
@@ -197,21 +195,25 @@ function SingleUploadInner({ field, error, collection, unresolvedCollectionMessa
|
|
|
197
195
|
const hintText = React.useMemo(() => {
|
|
198
196
|
const parts = [];
|
|
199
197
|
if (normalizedAccept?.length) {
|
|
200
|
-
const types = normalizedAccept.map((
|
|
201
|
-
if (
|
|
202
|
-
if (
|
|
203
|
-
if (
|
|
204
|
-
if (
|
|
205
|
-
return
|
|
198
|
+
const types = normalizedAccept.map((type) => {
|
|
199
|
+
if (type.startsWith("image/")) return t("dropzone.typeImages");
|
|
200
|
+
if (type.startsWith("video/")) return t("dropzone.typeVideos");
|
|
201
|
+
if (type.startsWith("audio/")) return t("dropzone.typeAudio");
|
|
202
|
+
if (type === "application/pdf") return t("dropzone.typePDF");
|
|
203
|
+
return type;
|
|
206
204
|
}).filter((v, i, a) => a.indexOf(v) === i);
|
|
207
205
|
parts.push(types.join(", "));
|
|
208
206
|
}
|
|
209
207
|
if (maxSize) {
|
|
210
208
|
const mb = (maxSize / (1024 * 1024)).toFixed(0);
|
|
211
|
-
parts.push(
|
|
209
|
+
parts.push(t("upload.maxSize", { size: `${mb}MB` }));
|
|
212
210
|
}
|
|
213
211
|
return parts.join(" • ") || void 0;
|
|
214
|
-
}, [
|
|
212
|
+
}, [
|
|
213
|
+
normalizedAccept,
|
|
214
|
+
maxSize,
|
|
215
|
+
t
|
|
216
|
+
]);
|
|
215
217
|
const hasValue = !!assetId;
|
|
216
218
|
const isLoading = isUploading || hasValue && isLoadingAsset;
|
|
217
219
|
const handlePickerSelect = (id) => {
|
|
@@ -221,7 +223,7 @@ function SingleUploadInner({ field, error, collection, unresolvedCollectionMessa
|
|
|
221
223
|
className,
|
|
222
224
|
children: [
|
|
223
225
|
unresolvedCollectionMessage && /* @__PURE__ */ jsx("p", {
|
|
224
|
-
className: "border-warning/40 bg-warning/5 text-warning mb-2 border px-3 py-2 text-xs",
|
|
226
|
+
className: "border-warning/40 bg-warning/5 text-warning mb-2 border px-3 py-2 text-xs text-pretty",
|
|
225
227
|
children: unresolvedCollectionMessage
|
|
226
228
|
}),
|
|
227
229
|
hasValue && showPreview && asset ? /* @__PURE__ */ jsx(AssetPreview, {
|
|
@@ -245,20 +247,16 @@ function SingleUploadInner({ field, error, collection, unresolvedCollectionMessa
|
|
|
245
247
|
disabled,
|
|
246
248
|
loading: isUploading,
|
|
247
249
|
progress: isUploading ? progress : void 0,
|
|
248
|
-
|
|
250
|
+
variant: "compact",
|
|
251
|
+
label: resolvedPlaceholder || t("upload.dropzone"),
|
|
249
252
|
hint: hintText,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
!hasValue && !isUploading && !disabled && !!collection && /* @__PURE__ */ jsxs(Button, {
|
|
253
|
-
type: "button",
|
|
254
|
-
variant: "outline",
|
|
255
|
-
size: "sm",
|
|
256
|
-
onClick: () => setIsPickerOpen(true),
|
|
257
|
-
className: "mt-2 w-full",
|
|
258
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
253
|
+
action: collection ? {
|
|
254
|
+
label: t("upload.browseLibrary"),
|
|
259
255
|
icon: "ph:folder-open-bold",
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
onClick: () => setIsPickerOpen(true),
|
|
257
|
+
disabled
|
|
258
|
+
} : void 0,
|
|
259
|
+
onValidationError: handleValidationError
|
|
262
260
|
}),
|
|
263
261
|
/* @__PURE__ */ jsx(MediaPickerDialog, {
|
|
264
262
|
open: isPickerOpen,
|
|
@@ -276,7 +274,7 @@ function SingleUploadInner({ field, error, collection, unresolvedCollectionMessa
|
|
|
276
274
|
onOpenChange: setIsEditSheetOpen
|
|
277
275
|
}),
|
|
278
276
|
error && /* @__PURE__ */ jsx("p", {
|
|
279
|
-
className: "text-destructive mt-1 text-xs",
|
|
277
|
+
className: "text-destructive mt-1 text-xs text-pretty",
|
|
280
278
|
children: error
|
|
281
279
|
})
|
|
282
280
|
]
|
|
@@ -397,21 +395,25 @@ function MultipleUploadInner({ field, collection, unresolvedCollectionMessage, a
|
|
|
397
395
|
const hintText = React.useMemo(() => {
|
|
398
396
|
const parts = [];
|
|
399
397
|
if (normalizedAccept?.length) {
|
|
400
|
-
const types = normalizedAccept.map((
|
|
401
|
-
if (
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
404
|
-
if (
|
|
405
|
-
return
|
|
398
|
+
const types = normalizedAccept.map((type) => {
|
|
399
|
+
if (type.startsWith("image/")) return t("dropzone.typeImages");
|
|
400
|
+
if (type.startsWith("video/")) return t("dropzone.typeVideos");
|
|
401
|
+
if (type.startsWith("audio/")) return t("dropzone.typeAudio");
|
|
402
|
+
if (type === "application/pdf") return t("dropzone.typePDF");
|
|
403
|
+
return type;
|
|
406
404
|
}).filter((v, i, a_0) => a_0.indexOf(v) === i);
|
|
407
405
|
parts.push(types.join(", "));
|
|
408
406
|
}
|
|
409
407
|
if (maxSize) {
|
|
410
408
|
const mb = (maxSize / (1024 * 1024)).toFixed(0);
|
|
411
|
-
parts.push(
|
|
409
|
+
parts.push(t("upload.maxSize", { size: `${mb}MB` }));
|
|
412
410
|
}
|
|
413
411
|
return parts.join(" • ") || void 0;
|
|
414
|
-
}, [
|
|
412
|
+
}, [
|
|
413
|
+
normalizedAccept,
|
|
414
|
+
maxSize,
|
|
415
|
+
t
|
|
416
|
+
]);
|
|
415
417
|
const hasItems = assetIds.length > 0 || pendingUploads.length > 0;
|
|
416
418
|
const canAddMore = !maxItems || assetIds.length < maxItems;
|
|
417
419
|
const previewVariant = layout === "grid" ? "thumbnail" : "compact";
|
|
@@ -419,7 +421,7 @@ function MultipleUploadInner({ field, collection, unresolvedCollectionMessage, a
|
|
|
419
421
|
className,
|
|
420
422
|
children: [
|
|
421
423
|
unresolvedCollectionMessage && /* @__PURE__ */ jsx("p", {
|
|
422
|
-
className: "border-warning/40 bg-warning/5 text-warning mb-2 border px-3 py-2 text-xs",
|
|
424
|
+
className: "border-warning/40 bg-warning/5 text-warning mb-2 border px-3 py-2 text-xs text-pretty",
|
|
423
425
|
children: unresolvedCollectionMessage
|
|
424
426
|
}),
|
|
425
427
|
hasItems && /* @__PURE__ */ jsx(DndContext, {
|
|
@@ -460,21 +462,15 @@ function MultipleUploadInner({ field, collection, unresolvedCollectionMessage, a
|
|
|
460
462
|
disabled,
|
|
461
463
|
loading: isUploading,
|
|
462
464
|
progress: isUploading ? progress : void 0,
|
|
463
|
-
|
|
465
|
+
variant: "compact",
|
|
466
|
+
label: hasItems ? t("upload.browse") : resolvedPlaceholder || t("upload.dropzone"),
|
|
464
467
|
hint: hintText,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}),
|
|
468
|
-
canAddMore && !isUploading && !disabled && !!collection && /* @__PURE__ */ jsxs(Button, {
|
|
469
|
-
type: "button",
|
|
470
|
-
variant: "outline",
|
|
471
|
-
size: "sm",
|
|
472
|
-
onClick: () => setIsPickerOpen(true),
|
|
473
|
-
className: "mt-2 w-full",
|
|
474
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
468
|
+
action: !disabled ? {
|
|
469
|
+
label: t("upload.browseLibrary"),
|
|
475
470
|
icon: "ph:folder-open-bold",
|
|
476
|
-
|
|
477
|
-
}
|
|
471
|
+
onClick: () => setIsPickerOpen(true)
|
|
472
|
+
} : void 0,
|
|
473
|
+
onValidationError: handleValidationError
|
|
478
474
|
}),
|
|
479
475
|
/* @__PURE__ */ jsx(MediaPickerDialog, {
|
|
480
476
|
open: isPickerOpen,
|
|
@@ -493,7 +489,7 @@ function MultipleUploadInner({ field, collection, unresolvedCollectionMessage, a
|
|
|
493
489
|
onOpenChange: (open) => !open && setEditAssetId(null)
|
|
494
490
|
}),
|
|
495
491
|
isUploading && !canAddMore && /* @__PURE__ */ jsxs("div", {
|
|
496
|
-
className: "text-muted-foreground flex items-center justify-center gap-2 border
|
|
492
|
+
className: "panel-surface text-muted-foreground flex items-center justify-center gap-2 border-dashed p-4 text-sm tabular-nums",
|
|
497
493
|
children: [
|
|
498
494
|
t("upload.uploading"),
|
|
499
495
|
" ",
|
|
@@ -525,7 +521,7 @@ function UploadField(t0) {
|
|
|
525
521
|
} else t6 = $[2];
|
|
526
522
|
const unresolvedCollectionMessage = t6;
|
|
527
523
|
const fieldDisabled = disabled || !!unresolvedCollectionMessage;
|
|
528
|
-
const effectivePreviewVariant = previewVariant ?? (multiple ? layout === "grid" ? "thumbnail" : "compact" : "
|
|
524
|
+
const effectivePreviewVariant = previewVariant ?? (multiple ? layout === "grid" ? "thumbnail" : "compact" : "compact");
|
|
529
525
|
let t7;
|
|
530
526
|
if ($[3] !== accept || $[4] !== className || $[5] !== collection || $[6] !== description || $[7] !== editable || $[8] !== effectivePreviewVariant || $[9] !== fieldDisabled || $[10] !== label || $[11] !== layout || $[12] !== locale || $[13] !== localized || $[14] !== maxItems || $[15] !== maxSize || $[16] !== multiple || $[17] !== name || $[18] !== onUploadComplete || $[19] !== onUploadError || $[20] !== onUploadStart || $[21] !== orderable || $[22] !== placeholder || $[23] !== required || $[24] !== resolveText || $[25] !== showPreview || $[26] !== unresolvedCollectionMessage) {
|
|
531
527
|
t7 = (t8$1) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
|
|
2
|
+
import { cn } from "../../lib/utils.mjs";
|
|
2
3
|
import { Checkbox } from "../ui/checkbox.mjs";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { Icon } from "@iconify/react";
|
|
@@ -10,7 +11,7 @@ import { CSS } from "@dnd-kit/utilities";
|
|
|
10
11
|
|
|
11
12
|
//#region src/client/components/filter-builder/columns-tab.tsx
|
|
12
13
|
function SortableColumnItem(t0) {
|
|
13
|
-
const $ = c(
|
|
14
|
+
const $ = c(33);
|
|
14
15
|
const { field, isVisible, onToggle } = t0;
|
|
15
16
|
const resolveText = useResolveText();
|
|
16
17
|
let t1;
|
|
@@ -37,95 +38,101 @@ function SortableColumnItem(t0) {
|
|
|
37
38
|
$[6] = t3;
|
|
38
39
|
} else t3 = $[6];
|
|
39
40
|
const style = t3;
|
|
40
|
-
const t4 =
|
|
41
|
+
const t4 = isDragging && "opacity-75";
|
|
41
42
|
let t5;
|
|
42
|
-
if ($[7]
|
|
43
|
-
t5 =
|
|
43
|
+
if ($[7] !== t4) {
|
|
44
|
+
t5 = cn("border-border-subtle bg-surface-low hover:border-border-strong hover:bg-surface-high flex items-center gap-2 rounded-md border p-2.5 transition-[background-color,border-color,opacity]", t4);
|
|
45
|
+
$[7] = t4;
|
|
46
|
+
$[8] = t5;
|
|
47
|
+
} else t5 = $[8];
|
|
48
|
+
let t6;
|
|
49
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
+
t6 = /* @__PURE__ */ jsx(Icon, {
|
|
44
51
|
icon: "ph:dots-six-vertical-bold",
|
|
45
52
|
width: 16,
|
|
46
53
|
height: 16
|
|
47
54
|
});
|
|
48
|
-
$[
|
|
49
|
-
} else
|
|
50
|
-
let
|
|
51
|
-
if ($[
|
|
52
|
-
|
|
55
|
+
$[9] = t6;
|
|
56
|
+
} else t6 = $[9];
|
|
57
|
+
let t7;
|
|
58
|
+
if ($[10] !== attributes || $[11] !== listeners) {
|
|
59
|
+
t7 = /* @__PURE__ */ jsx("button", {
|
|
53
60
|
type: "button",
|
|
54
61
|
className: "text-muted-foreground hover:text-foreground cursor-grab touch-none active:cursor-grabbing",
|
|
55
62
|
...attributes,
|
|
56
63
|
...listeners,
|
|
57
|
-
children:
|
|
64
|
+
children: t6
|
|
58
65
|
});
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
} else
|
|
63
|
-
let
|
|
64
|
-
if ($[
|
|
65
|
-
|
|
66
|
+
$[10] = attributes;
|
|
67
|
+
$[11] = listeners;
|
|
68
|
+
$[12] = t7;
|
|
69
|
+
} else t7 = $[12];
|
|
70
|
+
let t8;
|
|
71
|
+
if ($[13] !== isVisible || $[14] !== onToggle) {
|
|
72
|
+
t8 = /* @__PURE__ */ jsx(Checkbox, {
|
|
66
73
|
checked: isVisible,
|
|
67
74
|
onCheckedChange: onToggle
|
|
68
75
|
});
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
} else
|
|
73
|
-
let t8;
|
|
74
|
-
if ($[14] !== field.label || $[15] !== resolveText) {
|
|
75
|
-
t8 = resolveText(field.label);
|
|
76
|
-
$[14] = field.label;
|
|
77
|
-
$[15] = resolveText;
|
|
78
|
-
$[16] = t8;
|
|
79
|
-
} else t8 = $[16];
|
|
76
|
+
$[13] = isVisible;
|
|
77
|
+
$[14] = onToggle;
|
|
78
|
+
$[15] = t8;
|
|
79
|
+
} else t8 = $[15];
|
|
80
80
|
let t9;
|
|
81
|
-
if ($[17] !==
|
|
82
|
-
t9 =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
$[17] = t8;
|
|
81
|
+
if ($[16] !== field.label || $[17] !== resolveText) {
|
|
82
|
+
t9 = resolveText(field.label);
|
|
83
|
+
$[16] = field.label;
|
|
84
|
+
$[17] = resolveText;
|
|
87
85
|
$[18] = t9;
|
|
88
86
|
} else t9 = $[18];
|
|
89
87
|
let t10;
|
|
90
|
-
if ($[19] !==
|
|
88
|
+
if ($[19] !== t9) {
|
|
91
89
|
t10 = /* @__PURE__ */ jsx("span", {
|
|
92
|
-
className: "text-
|
|
93
|
-
children:
|
|
90
|
+
className: "text-sm font-medium",
|
|
91
|
+
children: t9
|
|
94
92
|
});
|
|
95
|
-
$[19] =
|
|
93
|
+
$[19] = t9;
|
|
96
94
|
$[20] = t10;
|
|
97
95
|
} else t10 = $[20];
|
|
98
96
|
let t11;
|
|
99
|
-
if ($[21] !==
|
|
100
|
-
t11 = /* @__PURE__ */
|
|
97
|
+
if ($[21] !== field.type) {
|
|
98
|
+
t11 = /* @__PURE__ */ jsx("span", {
|
|
99
|
+
className: "text-muted-foreground ml-auto text-xs",
|
|
100
|
+
children: field.type
|
|
101
|
+
});
|
|
102
|
+
$[21] = field.type;
|
|
103
|
+
$[22] = t11;
|
|
104
|
+
} else t11 = $[22];
|
|
105
|
+
let t12;
|
|
106
|
+
if ($[23] !== t10 || $[24] !== t11 || $[25] !== t8) {
|
|
107
|
+
t12 = /* @__PURE__ */ jsxs("label", {
|
|
101
108
|
className: "flex flex-1 cursor-pointer items-center gap-3",
|
|
102
109
|
children: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
t8,
|
|
111
|
+
t10,
|
|
112
|
+
t11
|
|
106
113
|
]
|
|
107
114
|
});
|
|
108
|
-
$[
|
|
109
|
-
$[22] = t7;
|
|
110
|
-
$[23] = t9;
|
|
115
|
+
$[23] = t10;
|
|
111
116
|
$[24] = t11;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
$[25] = t8;
|
|
118
|
+
$[26] = t12;
|
|
119
|
+
} else t12 = $[26];
|
|
120
|
+
let t13;
|
|
121
|
+
if ($[27] !== setNodeRef || $[28] !== style || $[29] !== t12 || $[30] !== t5 || $[31] !== t7) {
|
|
122
|
+
t13 = /* @__PURE__ */ jsxs("div", {
|
|
116
123
|
ref: setNodeRef,
|
|
117
124
|
style,
|
|
118
|
-
className:
|
|
119
|
-
children: [
|
|
125
|
+
className: t5,
|
|
126
|
+
children: [t7, t12]
|
|
120
127
|
});
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
} else
|
|
128
|
-
return
|
|
128
|
+
$[27] = setNodeRef;
|
|
129
|
+
$[28] = style;
|
|
130
|
+
$[29] = t12;
|
|
131
|
+
$[30] = t5;
|
|
132
|
+
$[31] = t7;
|
|
133
|
+
$[32] = t13;
|
|
134
|
+
} else t13 = $[32];
|
|
135
|
+
return t13;
|
|
129
136
|
}
|
|
130
137
|
/**
|
|
131
138
|
* Sort fields by visibleColumns order:
|
|
@@ -274,8 +281,8 @@ function ColumnsTab(t0) {
|
|
|
274
281
|
} else t10 = $[31];
|
|
275
282
|
let t11;
|
|
276
283
|
if ($[32] !== orderedFields.length || $[33] !== t) {
|
|
277
|
-
t11 = orderedFields.length === 0 && /* @__PURE__ */ jsx("
|
|
278
|
-
className: "text-muted-foreground
|
|
284
|
+
t11 = orderedFields.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
285
|
+
className: "text-muted-foreground py-2 text-sm",
|
|
279
286
|
children: t("viewOptions.noFieldsAvailable")
|
|
280
287
|
});
|
|
281
288
|
$[32] = orderedFields.length;
|