@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.
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 +1 -1
  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 +68 -68
  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 +12 -0
  215. package/dist/server/modules/admin/collections/user.mjs +40 -9
  216. package/dist/server/modules/admin/collections/verification.d.mts +2 -2
  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 +27 -27
  234. package/dist/server/modules/audit/.generated/module.d.mts +1 -1
  235. package/dist/server/modules/audit/.generated/module.mjs +1 -1
  236. package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
  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
@@ -3,11 +3,12 @@
3
3
  import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
4
4
  import { cn } from "../../lib/utils.mjs";
5
5
  import { Button } from "../ui/button.mjs";
6
+ import { Skeleton } from "../ui/skeleton.mjs";
6
7
  import { buildValidationSchema } from "../../builder/validation.mjs";
8
+ import { useValidationErrorMap } from "../../hooks/use-validation-error-map.mjs";
7
9
  import { AutoFormFields } from "../../views/collection/auto-form-fields.mjs";
8
10
  import { ResponsiveDialog, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogFooter, ResponsiveDialogHeader, ResponsiveDialogTitle } from "../ui/responsive-dialog.mjs";
9
11
  import { c } from "react/compiler-runtime";
10
- import { Icon } from "@iconify/react";
11
12
  import * as React from "react";
12
13
  import { useQueryClient } from "@tanstack/react-query";
13
14
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -26,7 +27,7 @@ import { toast } from "sonner";
26
27
  * Create a custom resolver for action form validation
27
28
  * Uses buildValidationSchema and handles Zod v4 compatibility
28
29
  */
29
- function createActionFormResolver(fields) {
30
+ function createActionFormResolver(fields, errorMap) {
30
31
  const schema = buildValidationSchema(fields);
31
32
  return async (values) => {
32
33
  const result = schema.safeParse(values);
@@ -37,10 +38,13 @@ function createActionFormResolver(fields) {
37
38
  const errors = {};
38
39
  for (const issue of result.error.issues) {
39
40
  const path = issue.path.join(".");
40
- if (path && !errors[path]) errors[path] = {
41
- type: issue.code,
42
- message: issue.message
43
- };
41
+ if (path && !errors[path]) {
42
+ const { message } = errorMap(issue);
43
+ errors[path] = {
44
+ type: issue.code,
45
+ message
46
+ };
47
+ }
44
48
  }
45
49
  return {
46
50
  values: {},
@@ -55,41 +59,64 @@ function createActionFormResolver(fields) {
55
59
  * from field definitions, providing full field system support.
56
60
  */
57
61
  function FormDialogContent(t0) {
58
- const $ = c(60);
62
+ const $ = c(66);
59
63
  const { action, ctx, onClose } = t0;
60
64
  const { config } = action.handler;
61
65
  const resolveText = useResolveText();
62
66
  const { t } = useTranslation();
63
- let t1;
67
+ const errorMap = useValidationErrorMap();
68
+ let values;
64
69
  if ($[0] !== config.fields) {
65
- t1 = createActionFormResolver(config.fields);
70
+ values = {};
71
+ for (const [fieldName, fieldDef] of Object.entries(config.fields)) {
72
+ const options = fieldDef["~options"];
73
+ if (options?.defaultValue !== void 0) values[fieldName] = options.defaultValue;
74
+ }
66
75
  $[0] = config.fields;
67
- $[1] = t1;
68
- } else t1 = $[1];
69
- const resolver = t1;
70
- let t2;
76
+ $[1] = values;
77
+ } else values = $[1];
78
+ let t1;
71
79
  if ($[2] !== config.defaultValues) {
72
- t2 = config.defaultValues || {};
80
+ t1 = config.defaultValues || {};
73
81
  $[2] = config.defaultValues;
74
- $[3] = t2;
75
- } else t2 = $[3];
82
+ $[3] = t1;
83
+ } else t1 = $[3];
84
+ let t2;
85
+ if ($[4] !== t1 || $[5] !== values) {
86
+ t2 = {
87
+ ...values,
88
+ ...t1
89
+ };
90
+ $[4] = t1;
91
+ $[5] = values;
92
+ $[6] = t2;
93
+ } else t2 = $[6];
94
+ const defaultValues = t2;
76
95
  let t3;
77
- if ($[4] !== resolver || $[5] !== t2) {
78
- t3 = {
79
- defaultValues: t2,
96
+ if ($[7] !== config.fields || $[8] !== errorMap) {
97
+ t3 = createActionFormResolver(config.fields, errorMap);
98
+ $[7] = config.fields;
99
+ $[8] = errorMap;
100
+ $[9] = t3;
101
+ } else t3 = $[9];
102
+ const resolver = t3;
103
+ let t4;
104
+ if ($[10] !== defaultValues || $[11] !== resolver) {
105
+ t4 = {
106
+ defaultValues,
80
107
  resolver
81
108
  };
82
- $[4] = resolver;
83
- $[5] = t2;
84
- $[6] = t3;
85
- } else t3 = $[6];
86
- const form = useForm(t3);
109
+ $[10] = defaultValues;
110
+ $[11] = resolver;
111
+ $[12] = t4;
112
+ } else t4 = $[12];
113
+ const form = useForm(t4);
87
114
  const [isSubmitting, setIsSubmitting] = React.useState(false);
88
- let t4;
89
- if ($[7] !== config || $[8] !== ctx || $[9] !== form || $[10] !== onClose || $[11] !== t) {
90
- let t5$1;
91
- if ($[13] !== config || $[14] !== ctx || $[15] !== onClose || $[16] !== t) {
92
- t5$1 = async (data) => {
115
+ let t5;
116
+ if ($[13] !== config || $[14] !== ctx || $[15] !== form || $[16] !== onClose || $[17] !== t) {
117
+ let t6$1;
118
+ if ($[19] !== config || $[20] !== ctx || $[21] !== onClose || $[22] !== t) {
119
+ t6$1 = async (data) => {
93
120
  setIsSubmitting(true);
94
121
  const submitPromise = async () => {
95
122
  await config.onSubmit(data, ctx);
@@ -107,141 +134,141 @@ function FormDialogContent(t0) {
107
134
  }
108
135
  });
109
136
  };
110
- $[13] = config;
111
- $[14] = ctx;
112
- $[15] = onClose;
113
- $[16] = t;
114
- $[17] = t5$1;
115
- } else t5$1 = $[17];
116
- t4 = form.handleSubmit(t5$1);
117
- $[7] = config;
118
- $[8] = ctx;
119
- $[9] = form;
120
- $[10] = onClose;
121
- $[11] = t;
122
- $[12] = t4;
123
- } else t4 = $[12];
124
- const handleSubmit = t4;
125
- const t5 = config.fields;
126
- let t6;
127
- if ($[18] !== t5) {
128
- t6 = { fields: t5 };
137
+ $[19] = config;
138
+ $[20] = ctx;
139
+ $[21] = onClose;
140
+ $[22] = t;
141
+ $[23] = t6$1;
142
+ } else t6$1 = $[23];
143
+ t5 = form.handleSubmit(t6$1);
144
+ $[13] = config;
145
+ $[14] = ctx;
146
+ $[15] = form;
147
+ $[16] = onClose;
148
+ $[17] = t;
129
149
  $[18] = t5;
130
- $[19] = t6;
131
- } else t6 = $[19];
132
- const collectionConfig = t6;
150
+ } else t5 = $[18];
151
+ const handleSubmit = t5;
152
+ const t6 = config.fields;
133
153
  let t7;
134
- if ($[20] !== config.title || $[21] !== resolveText) {
135
- t7 = resolveText(config.title);
136
- $[20] = config.title;
137
- $[21] = resolveText;
138
- $[22] = t7;
139
- } else t7 = $[22];
154
+ if ($[24] !== t6) {
155
+ t7 = { fields: t6 };
156
+ $[24] = t6;
157
+ $[25] = t7;
158
+ } else t7 = $[25];
159
+ const collectionConfig = t7;
140
160
  let t8;
141
- if ($[23] !== t7) {
142
- t8 = /* @__PURE__ */ jsx(ResponsiveDialogTitle, { children: t7 });
143
- $[23] = t7;
144
- $[24] = t8;
145
- } else t8 = $[24];
161
+ if ($[26] !== config.title || $[27] !== resolveText) {
162
+ t8 = resolveText(config.title);
163
+ $[26] = config.title;
164
+ $[27] = resolveText;
165
+ $[28] = t8;
166
+ } else t8 = $[28];
146
167
  let t9;
147
- if ($[25] !== config.description || $[26] !== resolveText) {
148
- t9 = config.description && /* @__PURE__ */ jsx(ResponsiveDialogDescription, { children: resolveText(config.description) });
149
- $[25] = config.description;
150
- $[26] = resolveText;
151
- $[27] = t9;
152
- } else t9 = $[27];
168
+ if ($[29] !== t8) {
169
+ t9 = /* @__PURE__ */ jsx(ResponsiveDialogTitle, { children: t8 });
170
+ $[29] = t8;
171
+ $[30] = t9;
172
+ } else t9 = $[30];
153
173
  let t10;
154
- if ($[28] !== t8 || $[29] !== t9) {
155
- t10 = /* @__PURE__ */ jsxs(ResponsiveDialogHeader, { children: [t8, t9] });
156
- $[28] = t8;
157
- $[29] = t9;
158
- $[30] = t10;
159
- } else t10 = $[30];
174
+ if ($[31] !== config.description || $[32] !== resolveText) {
175
+ t10 = config.description && /* @__PURE__ */ jsx(ResponsiveDialogDescription, { children: resolveText(config.description) });
176
+ $[31] = config.description;
177
+ $[32] = resolveText;
178
+ $[33] = t10;
179
+ } else t10 = $[33];
160
180
  let t11;
161
- if ($[31] !== collectionConfig) {
162
- t11 = /* @__PURE__ */ jsx(AutoFormFields, {
181
+ if ($[34] !== t10 || $[35] !== t9) {
182
+ t11 = /* @__PURE__ */ jsxs(ResponsiveDialogHeader, { children: [t9, t10] });
183
+ $[34] = t10;
184
+ $[35] = t9;
185
+ $[36] = t11;
186
+ } else t11 = $[36];
187
+ let t12;
188
+ if ($[37] !== collectionConfig) {
189
+ t12 = /* @__PURE__ */ jsx(AutoFormFields, {
163
190
  collection: "__action__",
164
191
  config: collectionConfig
165
192
  });
166
- $[31] = collectionConfig;
167
- $[32] = t11;
168
- } else t11 = $[32];
169
- let t12;
170
- if ($[33] !== config.cancelLabel || $[34] !== resolveText || $[35] !== t) {
171
- t12 = resolveText(config.cancelLabel, t("common.cancel"));
172
- $[33] = config.cancelLabel;
173
- $[34] = resolveText;
174
- $[35] = t;
175
- $[36] = t12;
176
- } else t12 = $[36];
193
+ $[37] = collectionConfig;
194
+ $[38] = t12;
195
+ } else t12 = $[38];
177
196
  let t13;
178
- if ($[37] !== isSubmitting || $[38] !== onClose || $[39] !== t12) {
179
- t13 = /* @__PURE__ */ jsx(Button, {
197
+ if ($[39] !== config.cancelLabel || $[40] !== resolveText || $[41] !== t) {
198
+ t13 = resolveText(config.cancelLabel, t("common.cancel"));
199
+ $[39] = config.cancelLabel;
200
+ $[40] = resolveText;
201
+ $[41] = t;
202
+ $[42] = t13;
203
+ } else t13 = $[42];
204
+ let t14;
205
+ if ($[43] !== isSubmitting || $[44] !== onClose || $[45] !== t13) {
206
+ t14 = /* @__PURE__ */ jsx(Button, {
180
207
  type: "button",
181
208
  variant: "outline",
182
209
  onClick: onClose,
183
210
  disabled: isSubmitting,
184
- children: t12
211
+ children: t13
185
212
  });
186
- $[37] = isSubmitting;
187
- $[38] = onClose;
188
- $[39] = t12;
189
- $[40] = t13;
190
- } else t13 = $[40];
191
- let t14;
192
- if ($[41] !== config.submitLabel || $[42] !== isSubmitting || $[43] !== resolveText || $[44] !== t) {
193
- t14 = isSubmitting ? t("common.loading") : resolveText(config.submitLabel, t("common.submit"));
194
- $[41] = config.submitLabel;
195
- $[42] = isSubmitting;
196
- $[43] = resolveText;
197
- $[44] = t;
198
- $[45] = t14;
199
- } else t14 = $[45];
213
+ $[43] = isSubmitting;
214
+ $[44] = onClose;
215
+ $[45] = t13;
216
+ $[46] = t14;
217
+ } else t14 = $[46];
200
218
  let t15;
201
- if ($[46] !== isSubmitting || $[47] !== t14) {
202
- t15 = /* @__PURE__ */ jsx(Button, {
219
+ if ($[47] !== config.submitLabel || $[48] !== isSubmitting || $[49] !== resolveText || $[50] !== t) {
220
+ t15 = isSubmitting ? t("common.loading") : resolveText(config.submitLabel, t("common.submit"));
221
+ $[47] = config.submitLabel;
222
+ $[48] = isSubmitting;
223
+ $[49] = resolveText;
224
+ $[50] = t;
225
+ $[51] = t15;
226
+ } else t15 = $[51];
227
+ let t16;
228
+ if ($[52] !== isSubmitting || $[53] !== t15) {
229
+ t16 = /* @__PURE__ */ jsx(Button, {
203
230
  type: "submit",
204
231
  disabled: isSubmitting,
205
- children: t14
232
+ children: t15
206
233
  });
207
- $[46] = isSubmitting;
208
- $[47] = t14;
209
- $[48] = t15;
210
- } else t15 = $[48];
211
- let t16;
212
- if ($[49] !== t13 || $[50] !== t15) {
213
- t16 = /* @__PURE__ */ jsxs(ResponsiveDialogFooter, {
234
+ $[52] = isSubmitting;
235
+ $[53] = t15;
236
+ $[54] = t16;
237
+ } else t16 = $[54];
238
+ let t17;
239
+ if ($[55] !== t14 || $[56] !== t16) {
240
+ t17 = /* @__PURE__ */ jsxs(ResponsiveDialogFooter, {
214
241
  className: "mt-6",
215
- children: [t13, t15]
242
+ children: [t14, t16]
216
243
  });
217
- $[49] = t13;
218
- $[50] = t15;
219
- $[51] = t16;
220
- } else t16 = $[51];
221
- let t17;
222
- if ($[52] !== handleSubmit || $[53] !== t11 || $[54] !== t16) {
223
- t17 = /* @__PURE__ */ jsxs("form", {
244
+ $[55] = t14;
245
+ $[56] = t16;
246
+ $[57] = t17;
247
+ } else t17 = $[57];
248
+ let t18;
249
+ if ($[58] !== handleSubmit || $[59] !== t12 || $[60] !== t17) {
250
+ t18 = /* @__PURE__ */ jsxs("form", {
224
251
  onSubmit: handleSubmit,
225
252
  className: "space-y-4",
226
- children: [t11, t16]
253
+ children: [t12, t17]
227
254
  });
228
- $[52] = handleSubmit;
229
- $[53] = t11;
230
- $[54] = t16;
231
- $[55] = t17;
232
- } else t17 = $[55];
233
- let t18;
234
- if ($[56] !== form || $[57] !== t10 || $[58] !== t17) {
235
- t18 = /* @__PURE__ */ jsxs(FormProvider, {
255
+ $[58] = handleSubmit;
256
+ $[59] = t12;
257
+ $[60] = t17;
258
+ $[61] = t18;
259
+ } else t18 = $[61];
260
+ let t19;
261
+ if ($[62] !== form || $[63] !== t11 || $[64] !== t18) {
262
+ t19 = /* @__PURE__ */ jsxs(FormProvider, {
236
263
  ...form,
237
- children: [t10, t17]
264
+ children: [t11, t18]
238
265
  });
239
- $[56] = form;
240
- $[57] = t10;
241
- $[58] = t17;
242
- $[59] = t18;
243
- } else t18 = $[59];
244
- return t18;
266
+ $[62] = form;
267
+ $[63] = t11;
268
+ $[64] = t18;
269
+ $[65] = t19;
270
+ } else t19 = $[65];
271
+ return t19;
245
272
  }
246
273
  /**
247
274
  * Custom Dialog content - renders lazy-loaded component
@@ -255,6 +282,7 @@ function CustomDialogContent(t0) {
255
282
  const [loading, setLoading] = React.useState(true);
256
283
  const [error, setError] = React.useState(null);
257
284
  let t1;
285
+ let t2;
258
286
  if ($[0] !== handler.component || $[1] !== t) {
259
287
  t1 = () => {
260
288
  let mounted = true;
@@ -289,8 +317,8 @@ function CustomDialogContent(t0) {
289
317
  }
290
318
  } else if (mounted) setComponent(() => comp);
291
319
  if (mounted) setLoading(false);
292
- } catch (t2$1) {
293
- const err = t2$1;
320
+ } catch (t3$1) {
321
+ const err = t3$1;
294
322
  if (mounted) {
295
323
  if (err instanceof Error) setError(err);
296
324
  else setError(new Error(t("error.failedToLoad")));
@@ -302,30 +330,44 @@ function CustomDialogContent(t0) {
302
330
  mounted = false;
303
331
  };
304
332
  };
333
+ t2 = [handler.component, t];
305
334
  $[0] = handler.component;
306
335
  $[1] = t;
307
336
  $[2] = t1;
308
- } else t1 = $[2];
309
- let t2;
310
- if ($[3] !== handler.component) {
311
- t2 = [handler.component];
312
- $[3] = handler.component;
313
- $[4] = t2;
314
- } else t2 = $[4];
337
+ $[3] = t2;
338
+ } else {
339
+ t1 = $[2];
340
+ t2 = $[3];
341
+ }
315
342
  React.useEffect(t1, t2);
316
343
  if (loading) {
317
344
  let t3$1;
345
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
346
+ t3$1 = /* @__PURE__ */ jsxs("div", {
347
+ className: "space-y-2",
348
+ children: [/* @__PURE__ */ jsx(Skeleton, {
349
+ variant: "text",
350
+ className: "h-4 w-24"
351
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
352
+ });
353
+ $[4] = t3$1;
354
+ } else t3$1 = $[4];
355
+ let t4$1;
318
356
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
319
- t3$1 = /* @__PURE__ */ jsx("div", {
320
- className: "flex h-32 items-center justify-center",
321
- children: /* @__PURE__ */ jsx(Icon, {
322
- icon: "ph:spinner-gap",
323
- className: "text-muted-foreground size-6 animate-spin"
324
- })
357
+ t4$1 = /* @__PURE__ */ jsxs("div", {
358
+ className: "space-y-4 py-2",
359
+ "aria-busy": "true",
360
+ children: [t3$1, /* @__PURE__ */ jsxs("div", {
361
+ className: "space-y-2",
362
+ children: [/* @__PURE__ */ jsx(Skeleton, {
363
+ variant: "text",
364
+ className: "h-4 w-32"
365
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
366
+ })]
325
367
  });
326
- $[5] = t3$1;
327
- } else t3$1 = $[5];
328
- return t3$1;
368
+ $[5] = t4$1;
369
+ } else t4$1 = $[5];
370
+ return t4$1;
329
371
  }
330
372
  if (error) {
331
373
  let t3$1;
@@ -62,10 +62,10 @@ function ConfirmationDialog(t0) {
62
62
  let t3;
63
63
  if ($[3] !== config.destructive) {
64
64
  t3 = config.destructive && /* @__PURE__ */ jsx("div", {
65
- className: "bg-destructive/10 flex size-10 shrink-0 items-center justify-center rounded-full",
65
+ className: "border-border-subtle bg-surface-low text-foreground-subtle flex size-10 shrink-0 items-center justify-center rounded-full border",
66
66
  children: /* @__PURE__ */ jsx(Icon, {
67
67
  icon: "ph:warning",
68
- className: "text-destructive size-5"
68
+ className: "size-5"
69
69
  })
70
70
  });
71
71
  $[3] = config.destructive;
@@ -1,10 +1,8 @@
1
1
  "use client";
2
2
 
3
- import { useResolveText } from "../../i18n/hooks.mjs";
4
3
  import { selectAuthClient, useAdminStore } from "../../runtime/provider.mjs";
5
- import { resolveIconElement } from "../component-renderer.mjs";
6
4
  import { Button } from "../ui/button.mjs";
7
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../ui/dropdown-menu.mjs";
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuTrigger } from "../ui/dropdown-menu.mjs";
8
6
  import { ActionButton } from "./action-button.mjs";
9
7
  import { c } from "react/compiler-runtime";
10
8
  import { Icon } from "@iconify/react";
@@ -39,9 +37,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
39
37
  * ```
40
38
  */
41
39
  function HeaderActions(t0) {
42
- const $ = c(38);
40
+ const $ = c(37);
43
41
  const { actions, collection, helpers, onOpenDialog } = t0;
44
- const resolveText = useResolveText();
45
42
  const authClient = useAdminStore(selectAuthClient);
46
43
  const queryClient = useQueryClient();
47
44
  let t1;
@@ -104,7 +101,7 @@ function HeaderActions(t0) {
104
101
  let t7;
105
102
  let t8;
106
103
  let t9;
107
- if ($[15] !== collection || $[16] !== helpers || $[17] !== onOpenDialog || $[18] !== resolveText || $[19] !== visiblePrimary || $[20] !== visibleSecondary) {
104
+ if ($[15] !== collection || $[16] !== helpers || $[17] !== onOpenDialog || $[18] !== visiblePrimary || $[19] !== visibleSecondary) {
108
105
  t9 = Symbol.for("react.early_return_sentinel");
109
106
  bb0: {
110
107
  const regularSecondary = visibleSecondary.filter(_temp);
@@ -113,38 +110,38 @@ function HeaderActions(t0) {
113
110
  t9 = null;
114
111
  break bb0;
115
112
  }
116
- t6 = "qa-header-actions flex items-center gap-2";
117
- if ($[25] !== collection || $[26] !== helpers || $[27] !== onOpenDialog || $[28] !== visiblePrimary) {
113
+ t6 = "qa-header-actions flex items-center gap-1.5";
114
+ if ($[24] !== collection || $[25] !== helpers || $[26] !== onOpenDialog || $[27] !== visiblePrimary) {
118
115
  let t10$1;
119
- if ($[30] !== collection || $[31] !== helpers || $[32] !== onOpenDialog) {
116
+ if ($[29] !== collection || $[30] !== helpers || $[31] !== onOpenDialog) {
120
117
  t10$1 = (action_0) => /* @__PURE__ */ jsx(ActionButton, {
121
118
  action: action_0,
122
119
  collection,
123
120
  helpers,
121
+ size: "sm",
124
122
  onOpenDialog
125
123
  }, action_0.id);
126
- $[30] = collection;
127
- $[31] = helpers;
128
- $[32] = onOpenDialog;
129
- $[33] = t10$1;
130
- } else t10$1 = $[33];
124
+ $[29] = collection;
125
+ $[30] = helpers;
126
+ $[31] = onOpenDialog;
127
+ $[32] = t10$1;
128
+ } else t10$1 = $[32];
131
129
  t7 = visiblePrimary.map(t10$1);
132
- $[25] = collection;
133
- $[26] = helpers;
134
- $[27] = onOpenDialog;
135
- $[28] = visiblePrimary;
136
- $[29] = t7;
137
- } else t7 = $[29];
130
+ $[24] = collection;
131
+ $[25] = helpers;
132
+ $[26] = onOpenDialog;
133
+ $[27] = visiblePrimary;
134
+ $[28] = t7;
135
+ } else t7 = $[28];
138
136
  t8 = visibleSecondary.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
139
137
  nativeButton: false,
140
138
  render: /* @__PURE__ */ jsx(Button, {
141
139
  variant: "outline",
142
- size: "icon",
143
- className: "size-9"
140
+ size: "icon-sm"
144
141
  }),
145
142
  children: [/* @__PURE__ */ jsx(Icon, {
146
143
  icon: "ph:dots-three-vertical",
147
- className: "size-4"
144
+ className: "size-3.5"
148
145
  }), /* @__PURE__ */ jsx("span", {
149
146
  className: "sr-only",
150
147
  children: "More actions"
@@ -152,51 +149,53 @@ function HeaderActions(t0) {
152
149
  }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
153
150
  align: "end",
154
151
  children: [
155
- regularSecondary.map((action_1) => {
156
- return /* @__PURE__ */ jsxs(DropdownMenuItem, {
157
- onClick: () => onOpenDialog?.(action_1),
158
- children: [resolveIconElement(action_1.icon, { className: "mr-2 size-4" }), resolveText(action_1.label)]
159
- }, action_1.id);
160
- }),
152
+ regularSecondary.map((action_1) => /* @__PURE__ */ jsx(ActionButton, {
153
+ action: action_1,
154
+ collection,
155
+ helpers,
156
+ size: "sm",
157
+ presentation: "menu",
158
+ onOpenDialog
159
+ }, action_1.id)),
161
160
  regularSecondary.length > 0 && destructiveSecondary.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
162
- destructiveSecondary.map((action_2) => {
163
- return /* @__PURE__ */ jsxs(DropdownMenuItem, {
164
- variant: "destructive",
165
- onClick: () => onOpenDialog?.(action_2),
166
- children: [resolveIconElement(action_2.icon, { className: "mr-2 size-4" }), resolveText(action_2.label)]
167
- }, action_2.id);
168
- })
161
+ destructiveSecondary.map((action_2) => /* @__PURE__ */ jsx(ActionButton, {
162
+ action: action_2,
163
+ collection,
164
+ helpers,
165
+ size: "sm",
166
+ presentation: "menu",
167
+ onOpenDialog
168
+ }, action_2.id))
169
169
  ]
170
170
  })] });
171
171
  }
172
172
  $[15] = collection;
173
173
  $[16] = helpers;
174
174
  $[17] = onOpenDialog;
175
- $[18] = resolveText;
176
- $[19] = visiblePrimary;
177
- $[20] = visibleSecondary;
178
- $[21] = t6;
179
- $[22] = t7;
180
- $[23] = t8;
181
- $[24] = t9;
175
+ $[18] = visiblePrimary;
176
+ $[19] = visibleSecondary;
177
+ $[20] = t6;
178
+ $[21] = t7;
179
+ $[22] = t8;
180
+ $[23] = t9;
182
181
  } else {
183
- t6 = $[21];
184
- t7 = $[22];
185
- t8 = $[23];
186
- t9 = $[24];
182
+ t6 = $[20];
183
+ t7 = $[21];
184
+ t8 = $[22];
185
+ t9 = $[23];
187
186
  }
188
187
  if (t9 !== Symbol.for("react.early_return_sentinel")) return t9;
189
188
  let t10;
190
- if ($[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
189
+ if ($[33] !== t6 || $[34] !== t7 || $[35] !== t8) {
191
190
  t10 = /* @__PURE__ */ jsxs("div", {
192
191
  className: t6,
193
192
  children: [t7, t8]
194
193
  });
195
- $[34] = t6;
196
- $[35] = t7;
197
- $[36] = t8;
198
- $[37] = t10;
199
- } else t10 = $[37];
194
+ $[33] = t6;
195
+ $[34] = t7;
196
+ $[35] = t8;
197
+ $[36] = t10;
198
+ } else t10 = $[36];
200
199
  return t10;
201
200
  }
202
201
  function _temp2(a_0) {
@@ -1,6 +1,6 @@
1
1
  import { CollectionNames, GlobalNames } from "../builder/index.mjs";
2
2
  import * as React from "react";
3
- import * as react_jsx_runtime12 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
4
4
  import { QuestpieApp } from "questpie/client";
5
5
 
6
6
  //#region src/client/components/admin-link.d.ts
@@ -61,6 +61,6 @@ declare function AdminLink<TApp extends QuestpieApp>({
61
61
  children,
62
62
  onClick,
63
63
  ...rest
64
- }: AdminLinkProps<TApp>): react_jsx_runtime12.JSX.Element;
64
+ }: AdminLinkProps<TApp>): react_jsx_runtime14.JSX.Element;
65
65
  //#endregion
66
66
  export { AdminLink };