@questpie/admin 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/README.md +34 -5
  2. package/dist/client/blocks/block-renderer.d.mts +2 -2
  3. package/dist/client/blocks/block-renderer.mjs +4 -1
  4. package/dist/client/builder/types/action-types.d.mts +31 -3
  5. package/dist/client/builder/types/collection-types.d.mts +140 -0
  6. package/dist/client/builder/types/ui-config.d.mts +16 -2
  7. package/dist/client/builder/types/views.d.mts +57 -0
  8. package/dist/client/builder/types/widget-types.d.mts +5 -0
  9. package/dist/client/components/actions/action-button.mjs +137 -199
  10. package/dist/client/components/actions/action-dialog.mjs +198 -156
  11. package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
  12. package/dist/client/components/actions/header-actions.mjs +52 -53
  13. package/dist/client/components/admin-link.d.mts +2 -2
  14. package/dist/client/components/auth/auth-loading.mjs +41 -18
  15. package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
  16. package/dist/client/components/blocks/block-insert-button.mjs +4 -4
  17. package/dist/client/components/blocks/block-item.mjs +2 -2
  18. package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
  19. package/dist/client/components/component-renderer.mjs +1 -1
  20. package/dist/client/components/fields/array-field.mjs +14 -14
  21. package/dist/client/components/fields/asset-preview-field.mjs +1 -1
  22. package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
  23. package/dist/client/components/fields/json-field.mjs +2 -2
  24. package/dist/client/components/fields/object-array-field.mjs +22 -22
  25. package/dist/client/components/fields/object-field.mjs +5 -5
  26. package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
  27. package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
  28. package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
  29. package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
  30. package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
  31. package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
  32. package/dist/client/components/fields/relation-picker.mjs +7 -6
  33. package/dist/client/components/fields/relation-select.mjs +71 -47
  34. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
  35. package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
  36. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
  37. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
  38. package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
  39. package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
  40. package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
  41. package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
  42. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
  43. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
  44. package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
  45. package/dist/client/components/fields/upload-field.mjs +45 -49
  46. package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
  47. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
  48. package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
  49. package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
  50. package/dist/client/components/history-sidebar.mjs +850 -340
  51. package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
  52. package/dist/client/components/locale-switcher.mjs +8 -8
  53. package/dist/client/components/media/media-grid.mjs +12 -9
  54. package/dist/client/components/media/media-picker-dialog.mjs +242 -230
  55. package/dist/client/components/preview/live-preview-mode.mjs +1 -1
  56. package/dist/client/components/primitives/asset-preview.mjs +37 -22
  57. package/dist/client/components/primitives/date-input.mjs +212 -249
  58. package/dist/client/components/primitives/dropzone.mjs +192 -159
  59. package/dist/client/components/primitives/field-select-control.mjs +93 -0
  60. package/dist/client/components/primitives/select-multi.mjs +251 -230
  61. package/dist/client/components/primitives/select-single.mjs +345 -290
  62. package/dist/client/components/primitives/time-input.mjs +2 -2
  63. package/dist/client/components/sheets/resource-sheet.mjs +2 -0
  64. package/dist/client/components/ui/accordion.mjs +4 -4
  65. package/dist/client/components/ui/alert.mjs +3 -3
  66. package/dist/client/components/ui/badge.mjs +4 -4
  67. package/dist/client/components/ui/button.mjs +47 -37
  68. package/dist/client/components/ui/card.mjs +2 -2
  69. package/dist/client/components/ui/checkbox.mjs +1 -1
  70. package/dist/client/components/ui/command.mjs +5 -5
  71. package/dist/client/components/ui/dialog.mjs +3 -3
  72. package/dist/client/components/ui/drawer.mjs +1 -1
  73. package/dist/client/components/ui/dropdown-menu.mjs +157 -15
  74. package/dist/client/components/ui/empty-state.mjs +88 -59
  75. package/dist/client/components/ui/field.mjs +2 -2
  76. package/dist/client/components/ui/input-group.mjs +3 -3
  77. package/dist/client/components/ui/input.mjs +1 -1
  78. package/dist/client/components/ui/kbd.mjs +1 -1
  79. package/dist/client/components/ui/label.mjs +1 -1
  80. package/dist/client/components/ui/popover.mjs +19 -11
  81. package/dist/client/components/ui/scroll-fade.mjs +170 -0
  82. package/dist/client/components/ui/search-input.mjs +1 -1
  83. package/dist/client/components/ui/select.mjs +129 -27
  84. package/dist/client/components/ui/sheet.mjs +54 -34
  85. package/dist/client/components/ui/sidebar.mjs +15 -14
  86. package/dist/client/components/ui/skeleton.mjs +28 -12
  87. package/dist/client/components/ui/switch.mjs +2 -2
  88. package/dist/client/components/ui/table.mjs +82 -74
  89. package/dist/client/components/ui/tabs.mjs +26 -31
  90. package/dist/client/components/ui/textarea.mjs +1 -1
  91. package/dist/client/components/ui/tooltip.mjs +1 -1
  92. package/dist/client/components/widgets/chart-widget.mjs +134 -96
  93. package/dist/client/components/widgets/progress-widget.mjs +59 -34
  94. package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
  95. package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
  96. package/dist/client/components/widgets/stats-widget.mjs +91 -72
  97. package/dist/client/components/widgets/table-widget.mjs +159 -246
  98. package/dist/client/components/widgets/timeline-widget.mjs +66 -43
  99. package/dist/client/components/widgets/value-widget.mjs +261 -152
  100. package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
  101. package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
  102. package/dist/client/contexts/focus-context.d.mts +2 -2
  103. package/dist/client/hooks/use-action.mjs +63 -55
  104. package/dist/client/hooks/use-audit-history.mjs +1 -65
  105. package/dist/client/hooks/use-collection-validation.mjs +36 -23
  106. package/dist/client/hooks/use-collection.mjs +96 -1
  107. package/dist/client/hooks/use-saved-views.mjs +70 -49
  108. package/dist/client/hooks/use-server-actions.mjs +59 -40
  109. package/dist/client/hooks/use-server-validation.mjs +156 -41
  110. package/dist/client/hooks/use-server-widget-data.mjs +1 -1
  111. package/dist/client/hooks/use-setup-status.d.mts +3 -3
  112. package/dist/client/hooks/use-setup-status.mjs +2 -2
  113. package/dist/client/hooks/use-transition-stage.mjs +2 -10
  114. package/dist/client/hooks/use-validation-error-map.mjs +31 -13
  115. package/dist/client/hooks/use-view-state.mjs +238 -174
  116. package/dist/client/i18n/date-locale.mjs +33 -0
  117. package/dist/client/i18n/hooks.mjs +17 -1
  118. package/dist/client/lib/utils.mjs +3 -2
  119. package/dist/client/preview/block-scope-context.d.mts +2 -2
  120. package/dist/client/preview/preview-banner.d.mts +2 -2
  121. package/dist/client/preview/preview-field.d.mts +4 -4
  122. package/dist/client/preview/preview-field.mjs +2 -2
  123. package/dist/client/runtime/provider.mjs +8 -1
  124. package/dist/client/runtime/translations-provider.mjs +1 -1
  125. package/dist/client/scope/picker.d.mts +2 -2
  126. package/dist/client/scope/provider.d.mts +2 -2
  127. package/dist/client/styles/base.css +1022 -0
  128. package/dist/client/styles/index.css +3 -589
  129. package/dist/client/utils/auto-expand-fields.mjs +4 -2
  130. package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
  131. package/dist/client/utils/use-lazy-component.mjs +80 -0
  132. package/dist/client/views/auth/auth-layout.d.mts +18 -11
  133. package/dist/client/views/auth/auth-layout.mjs +291 -80
  134. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  135. package/dist/client/views/auth/forgot-password-form.mjs +2 -2
  136. package/dist/client/views/auth/login-form.d.mts +2 -2
  137. package/dist/client/views/auth/login-form.mjs +1 -1
  138. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  139. package/dist/client/views/auth/reset-password-form.mjs +2 -2
  140. package/dist/client/views/auth/setup-form.d.mts +2 -2
  141. package/dist/client/views/collection/auto-form-fields.mjs +11 -9
  142. package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
  143. package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
  144. package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
  145. package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
  146. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
  147. package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
  148. package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
  149. package/dist/client/views/collection/columns/build-columns.mjs +29 -9
  150. package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
  151. package/dist/client/views/collection/field-renderer.mjs +50 -89
  152. package/dist/client/views/collection/form-view.mjs +237 -227
  153. package/dist/client/views/collection/table-view.mjs +1162 -229
  154. package/dist/client/views/collection/view-skeletons.mjs +222 -79
  155. package/dist/client/views/common/global-search.mjs +29 -18
  156. package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
  157. package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
  158. package/dist/client/views/dashboard/widget-card.mjs +23 -14
  159. package/dist/client/views/globals/global-form-view.mjs +634 -589
  160. package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
  161. package/dist/client/views/layout/admin-layout.d.mts +3 -6
  162. package/dist/client/views/layout/admin-layout.mjs +149 -172
  163. package/dist/client/views/layout/admin-router.mjs +747 -544
  164. package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
  165. package/dist/client/views/layout/admin-sidebar.mjs +751 -591
  166. package/dist/client/views/layout/admin-theme.d.mts +10 -0
  167. package/dist/client/views/layout/admin-theme.mjs +84 -0
  168. package/dist/client/views/layout/admin-view-layout.mjs +161 -0
  169. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  170. package/dist/client/views/pages/accept-invite-page.mjs +49 -26
  171. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  172. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  173. package/dist/client/views/pages/forgot-password-page.mjs +2 -19
  174. package/dist/client/views/pages/invite-page.d.mts +2 -2
  175. package/dist/client/views/pages/invite-page.mjs +2 -19
  176. package/dist/client/views/pages/login-page.d.mts +3 -3
  177. package/dist/client/views/pages/login-page.mjs +4 -21
  178. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  179. package/dist/client/views/pages/reset-password-page.mjs +3 -20
  180. package/dist/client/views/pages/setup-page.d.mts +2 -2
  181. package/dist/client/views/pages/setup-page.mjs +3 -20
  182. package/dist/client.d.mts +6 -2
  183. package/dist/client.mjs +2 -1
  184. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  185. package/dist/index.d.mts +6 -2
  186. package/dist/index.mjs +2 -1
  187. package/dist/server/augmentation/dashboard.d.mts +67 -3
  188. package/dist/server/augmentation/form-layout.d.mts +21 -0
  189. package/dist/server/augmentation/index.d.mts +1 -1
  190. package/dist/server/codegen/admin-client-template.mjs +4 -0
  191. package/dist/server/fields/blocks.d.mts +1 -1
  192. package/dist/server/fields/blocks.mjs +12 -0
  193. package/dist/server/fields/rich-text.d.mts +1 -1
  194. package/dist/server/fields/rich-text.mjs +8 -0
  195. package/dist/server/i18n/index.mjs +17 -1
  196. package/dist/server/i18n/messages/cs.mjs +23 -0
  197. package/dist/server/i18n/messages/de.mjs +23 -0
  198. package/dist/server/i18n/messages/en.mjs +64 -1
  199. package/dist/server/i18n/messages/es.mjs +23 -0
  200. package/dist/server/i18n/messages/fr.mjs +23 -0
  201. package/dist/server/i18n/messages/pl.mjs +23 -0
  202. package/dist/server/i18n/messages/pt.mjs +23 -0
  203. package/dist/server/i18n/messages/sk.mjs +83 -1
  204. package/dist/server/modules/admin/block/introspection.mjs +4 -1
  205. package/dist/server/modules/admin/block/prefetch.mjs +12 -2
  206. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  207. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  208. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  209. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  210. package/dist/server/modules/admin/collections/apikey.d.mts +64 -64
  211. package/dist/server/modules/admin/collections/assets.d.mts +20 -20
  212. package/dist/server/modules/admin/collections/assets.mjs +0 -1
  213. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  214. package/dist/server/modules/admin/collections/user.d.mts +40 -28
  215. package/dist/server/modules/admin/collections/user.mjs +40 -9
  216. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  217. package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
  218. package/dist/server/modules/admin/factories.mjs +7 -18
  219. package/dist/server/modules/admin/index.d.mts +1 -1
  220. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  221. package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
  222. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  223. package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
  224. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  225. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  226. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  227. package/dist/server/modules/admin/routes/setup.d.mts +10 -10
  228. package/dist/server/modules/admin/routes/setup.mjs +7 -7
  229. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  230. package/dist/server/modules/admin/routes/translations.mjs +5 -1
  231. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  232. package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
  233. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +25 -25
  234. package/dist/server/modules/audit/.generated/module.d.mts +7 -7
  235. package/dist/server/modules/audit/.generated/module.mjs +1 -1
  236. package/dist/server/modules/audit/collections/audit-log.d.mts +39 -39
  237. package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
  238. package/dist/server/modules/audit/config/app.mjs +99 -42
  239. package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
  240. package/dist/server/plugin.mjs +4 -2
  241. package/dist/server/proxy-factories.d.mts +4 -3
  242. package/dist/server/proxy-factories.mjs +34 -8
  243. package/dist/shared/types/saved-views.types.d.mts +2 -0
  244. package/package.json +6 -4
  245. package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
  246. package/dist/client/components/ui/spinner.mjs +0 -52
  247. package/dist/client/components/ui/toolbar.mjs +0 -136
  248. package/dist/client/contexts/breadcrumb-context.mjs +0 -60
  249. package/dist/client/views/layout/admin-topbar.mjs +0 -236
@@ -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, error: uploadError } = useUpload();
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((t_0) => {
201
- if (t_0.startsWith("image/")) return "Images";
202
- if (t_0.startsWith("video/")) return "Videos";
203
- if (t_0.startsWith("audio/")) return "Audio";
204
- if (t_0 === "application/pdf") return "PDF";
205
- return t_0;
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(`Max ${mb}MB`);
209
+ parts.push(t("upload.maxSize", { size: `${mb}MB` }));
212
210
  }
213
211
  return parts.join(" • ") || void 0;
214
- }, [normalizedAccept, maxSize]);
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
- label: resolvedPlaceholder || t("dropzone.label"),
250
+ variant: "compact",
251
+ label: resolvedPlaceholder || t("upload.dropzone"),
249
252
  hint: hintText,
250
- onValidationError: handleValidationError
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
- className: "mr-2 size-4"
261
- }), "Browse Library"]
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((t_0) => {
401
- if (t_0.startsWith("image/")) return "Images";
402
- if (t_0.startsWith("video/")) return "Videos";
403
- if (t_0.startsWith("audio/")) return "Audio";
404
- if (t_0 === "application/pdf") return "PDF";
405
- return t_0;
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(`Max ${mb}MB`);
409
+ parts.push(t("upload.maxSize", { size: `${mb}MB` }));
412
410
  }
413
411
  return parts.join(" • ") || void 0;
414
- }, [normalizedAccept, maxSize]);
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
- label: hasItems ? t("dropzone.addMore") : resolvedPlaceholder || t("dropzone.label"),
465
+ variant: "compact",
466
+ label: hasItems ? t("upload.browse") : resolvedPlaceholder || t("upload.dropzone"),
464
467
  hint: hintText,
465
- onValidationError: handleValidationError,
466
- className: hasItems ? "min-h-[80px]" : void 0
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
- className: "mr-2 size-4"
477
- }), "Browse Library"]
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 border-dashed p-4 text-sm",
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" : "card");
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(31);
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 = `hover:bg-muted hover:border-border flex items-center gap-2 border border-transparent p-2.5 transition-colors ${isDragging ? "bg-muted opacity-50" : ""}`;
41
+ const t4 = isDragging && "opacity-75";
41
42
  let t5;
42
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
43
- t5 = /* @__PURE__ */ jsx(Icon, {
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
- $[7] = t5;
49
- } else t5 = $[7];
50
- let t6;
51
- if ($[8] !== attributes || $[9] !== listeners) {
52
- t6 = /* @__PURE__ */ jsx("button", {
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: t5
64
+ children: t6
58
65
  });
59
- $[8] = attributes;
60
- $[9] = listeners;
61
- $[10] = t6;
62
- } else t6 = $[10];
63
- let t7;
64
- if ($[11] !== isVisible || $[12] !== onToggle) {
65
- t7 = /* @__PURE__ */ jsx(Checkbox, {
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
- $[11] = isVisible;
70
- $[12] = onToggle;
71
- $[13] = t7;
72
- } else t7 = $[13];
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] !== t8) {
82
- t9 = /* @__PURE__ */ jsx("span", {
83
- className: "text-sm font-medium",
84
- children: t8
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] !== field.type) {
88
+ if ($[19] !== t9) {
91
89
  t10 = /* @__PURE__ */ jsx("span", {
92
- className: "text-muted-foreground ml-auto text-xs",
93
- children: field.type
90
+ className: "text-sm font-medium",
91
+ children: t9
94
92
  });
95
- $[19] = field.type;
93
+ $[19] = t9;
96
94
  $[20] = t10;
97
95
  } else t10 = $[20];
98
96
  let t11;
99
- if ($[21] !== t10 || $[22] !== t7 || $[23] !== t9) {
100
- t11 = /* @__PURE__ */ jsxs("label", {
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
- t7,
104
- t9,
105
- t10
110
+ t8,
111
+ t10,
112
+ t11
106
113
  ]
107
114
  });
108
- $[21] = t10;
109
- $[22] = t7;
110
- $[23] = t9;
115
+ $[23] = t10;
111
116
  $[24] = t11;
112
- } else t11 = $[24];
113
- let t12;
114
- if ($[25] !== setNodeRef || $[26] !== style || $[27] !== t11 || $[28] !== t4 || $[29] !== t6) {
115
- t12 = /* @__PURE__ */ jsxs("div", {
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: t4,
119
- children: [t6, t11]
125
+ className: t5,
126
+ children: [t7, t12]
120
127
  });
121
- $[25] = setNodeRef;
122
- $[26] = style;
123
- $[27] = t11;
124
- $[28] = t4;
125
- $[29] = t6;
126
- $[30] = t12;
127
- } else t12 = $[30];
128
- return t12;
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("div", {
278
- className: "text-muted-foreground p-8 text-center text-sm",
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;