@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
@@ -29,16 +29,16 @@ function ChartWidgetSkeleton() {
29
29
  t0 = /* @__PURE__ */ jsxs("div", {
30
30
  className: "flex h-48 w-full items-end gap-2 pt-4",
31
31
  children: [
32
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[40%] flex-1 rounded-t" }),
33
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[65%] flex-1 rounded-t" }),
34
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[45%] flex-1 rounded-t" }),
35
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[80%] flex-1 rounded-t" }),
36
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[55%] flex-1 rounded-t" }),
37
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[70%] flex-1 rounded-t" }),
38
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[50%] flex-1 rounded-t" }),
39
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[75%] flex-1 rounded-t" }),
40
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[60%] flex-1 rounded-t" }),
41
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[85%] flex-1 rounded-t" })
32
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[40%] flex-1 rounded-t-sm" }),
33
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[65%] flex-1 rounded-t-sm" }),
34
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[45%] flex-1 rounded-t-sm" }),
35
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[80%] flex-1 rounded-t-sm" }),
36
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[55%] flex-1 rounded-t-sm" }),
37
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[70%] flex-1 rounded-t-sm" }),
38
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[50%] flex-1 rounded-t-sm" }),
39
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[75%] flex-1 rounded-t-sm" }),
40
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[60%] flex-1 rounded-t-sm" }),
41
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[85%] flex-1 rounded-t-sm" })
42
42
  ]
43
43
  });
44
44
  $[0] = t0;
@@ -120,18 +120,27 @@ function TableWidgetSkeleton(t0) {
120
120
  const columns = t2 === void 0 ? 3 : t2;
121
121
  let t3;
122
122
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
123
- t3 = /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" });
123
+ t3 = /* @__PURE__ */ jsx(Skeleton, {
124
+ variant: "text",
125
+ className: "h-4 w-24"
126
+ });
124
127
  $[0] = t3;
125
128
  } else t3 = $[0];
126
129
  let t4;
127
130
  if ($[1] !== columns) {
128
- t4 = columns > 1 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" });
131
+ t4 = columns > 1 && /* @__PURE__ */ jsx(Skeleton, {
132
+ variant: "text",
133
+ className: "h-4 flex-1"
134
+ });
129
135
  $[1] = columns;
130
136
  $[2] = t4;
131
137
  } else t4 = $[2];
132
138
  let t5;
133
139
  if ($[3] !== columns) {
134
- t5 = columns > 2 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" });
140
+ t5 = columns > 2 && /* @__PURE__ */ jsx(Skeleton, {
141
+ variant: "text",
142
+ className: "h-4 flex-1"
143
+ });
135
144
  $[3] = columns;
136
145
  $[4] = t5;
137
146
  } else t5 = $[4];
@@ -222,18 +231,27 @@ function TableSkeletonRow(t0) {
222
231
  } else t4 = $[1];
223
232
  let t5;
224
233
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
225
- t5 = /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" });
234
+ t5 = /* @__PURE__ */ jsx(Skeleton, {
235
+ variant: "text",
236
+ className: "h-4 w-20"
237
+ });
226
238
  $[2] = t5;
227
239
  } else t5 = $[2];
228
240
  let t6;
229
241
  if ($[3] !== columns) {
230
- t6 = columns > 1 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" });
242
+ t6 = columns > 1 && /* @__PURE__ */ jsx(Skeleton, {
243
+ variant: "text",
244
+ className: "h-4 flex-1"
245
+ });
231
246
  $[3] = columns;
232
247
  $[4] = t6;
233
248
  } else t6 = $[4];
234
249
  let t7;
235
250
  if ($[5] !== columns) {
236
- t7 = columns > 2 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" });
251
+ t7 = columns > 2 && /* @__PURE__ */ jsx(Skeleton, {
252
+ variant: "text",
253
+ className: "h-4 flex-1"
254
+ });
237
255
  $[5] = columns;
238
256
  $[6] = t7;
239
257
  } else t7 = $[6];
@@ -313,7 +331,10 @@ function TimelineSkeletonItem(t0) {
313
331
  const last = t1 === void 0 ? false : t1;
314
332
  let t2;
315
333
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
316
- t2 = /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-3 rounded-full" });
334
+ t2 = /* @__PURE__ */ jsx(Skeleton, {
335
+ variant: "avatar",
336
+ className: "h-3 w-3"
337
+ });
317
338
  $[0] = t2;
318
339
  } else t2 = $[0];
319
340
  let t3;
@@ -363,10 +384,22 @@ function ProgressWidgetSkeleton() {
363
384
  children: [
364
385
  /* @__PURE__ */ jsxs("div", {
365
386
  className: "flex items-center justify-between",
366
- children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12" })]
387
+ children: [/* @__PURE__ */ jsx(Skeleton, {
388
+ variant: "text",
389
+ className: "h-4 w-32"
390
+ }), /* @__PURE__ */ jsx(Skeleton, {
391
+ variant: "text",
392
+ className: "h-4 w-12"
393
+ })]
394
+ }),
395
+ /* @__PURE__ */ jsx(Skeleton, {
396
+ variant: "chip",
397
+ className: "h-2 w-full"
367
398
  }),
368
- /* @__PURE__ */ jsx(Skeleton, { className: "h-2 w-full rounded-full" }),
369
- /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-24" })
399
+ /* @__PURE__ */ jsx(Skeleton, {
400
+ variant: "text",
401
+ className: "h-3 w-24"
402
+ })
370
403
  ]
371
404
  });
372
405
  $[0] = t0;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import * as react_jsx_runtime14 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/contexts/focus-context.d.ts
5
5
 
@@ -48,7 +48,7 @@ type FocusProviderProps = {
48
48
  declare function FocusProvider({
49
49
  children,
50
50
  onFocusChange
51
- }: FocusProviderProps): react_jsx_runtime14.JSX.Element;
51
+ }: FocusProviderProps): react_jsx_runtime16.JSX.Element;
52
52
  /**
53
53
  * Use the focus context
54
54
  */
@@ -221,7 +221,7 @@ function useActionHelpers(t0) {
221
221
  */
222
222
  function _temp() {}
223
223
  function useActions(t0) {
224
- const $ = c(22);
224
+ const $ = c(25);
225
225
  const { collection, actionsConfig, onRefresh } = t0;
226
226
  const [dialogAction, setDialogAction] = React.useState(null);
227
227
  const [dialogItem, setDialogItem] = React.useState(null);
@@ -233,7 +233,7 @@ function useActions(t0) {
233
233
  const defaultActions = t1;
234
234
  let t2;
235
235
  if ($[1] !== actionsConfig) {
236
- t2 = actionsConfig?.header && (actionsConfig.header.primary?.length > 0 || actionsConfig.header.secondary?.length > 0) ? actionsConfig.header : defaultActions.header ?? {
236
+ t2 = actionsConfig?.header !== void 0 ? actionsConfig.header : defaultActions.header ?? {
237
237
  primary: [],
238
238
  secondary: []
239
239
  };
@@ -241,72 +241,80 @@ function useActions(t0) {
241
241
  $[2] = t2;
242
242
  } else t2 = $[2];
243
243
  let t3;
244
- if ($[3] !== actionsConfig) {
245
- t3 = actionsConfig?.bulk && actionsConfig.bulk.length > 0 ? actionsConfig.bulk : defaultActions.bulk ?? [];
246
- $[3] = actionsConfig;
244
+ if ($[3] !== actionsConfig?.row) {
245
+ t3 = actionsConfig?.row ?? [];
246
+ $[3] = actionsConfig?.row;
247
247
  $[4] = t3;
248
248
  } else t3 = $[4];
249
249
  let t4;
250
- if ($[5] !== t2 || $[6] !== t3) {
251
- t4 = {
252
- header: t2,
253
- bulk: t3
254
- };
255
- $[5] = t2;
256
- $[6] = t3;
257
- $[7] = t4;
258
- } else t4 = $[7];
259
- const actions = t4;
250
+ if ($[5] !== actionsConfig) {
251
+ t4 = actionsConfig?.bulk !== void 0 ? actionsConfig.bulk : defaultActions.bulk ?? [];
252
+ $[5] = actionsConfig;
253
+ $[6] = t4;
254
+ } else t4 = $[6];
260
255
  let t5;
261
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
262
- t5 = () => {
263
- setDialogAction(null);
264
- setDialogItem(null);
256
+ if ($[7] !== t2 || $[8] !== t3 || $[9] !== t4) {
257
+ t5 = {
258
+ header: t2,
259
+ row: t3,
260
+ bulk: t4
265
261
  };
266
- $[8] = t5;
267
- } else t5 = $[8];
268
- const closeDialog = t5;
262
+ $[7] = t2;
263
+ $[8] = t3;
264
+ $[9] = t4;
265
+ $[10] = t5;
266
+ } else t5 = $[10];
267
+ const actions = t5;
269
268
  let t6;
270
- if ($[9] !== onRefresh) {
269
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
271
270
  t6 = () => {
272
- onRefresh?.();
271
+ setDialogAction(null);
272
+ setDialogItem(null);
273
273
  };
274
- $[9] = onRefresh;
275
- $[10] = t6;
276
- } else t6 = $[10];
274
+ $[11] = t6;
275
+ } else t6 = $[11];
276
+ const closeDialog = t6;
277
277
  let t7;
278
- if ($[11] !== collection || $[12] !== t6) {
279
- t7 = {
280
- collection,
281
- onRefresh: t6
278
+ if ($[12] !== onRefresh) {
279
+ t7 = () => {
280
+ onRefresh?.();
282
281
  };
283
- $[11] = collection;
284
- $[12] = t6;
282
+ $[12] = onRefresh;
285
283
  $[13] = t7;
286
284
  } else t7 = $[13];
287
- const { helpers: baseHelpers } = useActionHelpers(t7);
288
285
  let t8;
289
- if ($[14] !== baseHelpers) {
286
+ if ($[14] !== collection || $[15] !== t7) {
290
287
  t8 = {
288
+ collection,
289
+ onRefresh: t7
290
+ };
291
+ $[14] = collection;
292
+ $[15] = t7;
293
+ $[16] = t8;
294
+ } else t8 = $[16];
295
+ const { helpers: baseHelpers } = useActionHelpers(t8);
296
+ let t9;
297
+ if ($[17] !== baseHelpers) {
298
+ t9 = {
291
299
  ...baseHelpers,
292
300
  closeDialog
293
301
  };
294
- $[14] = baseHelpers;
295
- $[15] = t8;
296
- } else t8 = $[15];
297
- const helpers = t8;
298
- let t9;
299
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
300
- t9 = (action, item) => {
302
+ $[17] = baseHelpers;
303
+ $[18] = t9;
304
+ } else t9 = $[18];
305
+ const helpers = t9;
306
+ let t10;
307
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
308
+ t10 = (action, item) => {
301
309
  setDialogAction(action);
302
310
  setDialogItem(item ?? null);
303
311
  };
304
- $[16] = t9;
305
- } else t9 = $[16];
306
- const openDialog = t9;
307
- let t10;
308
- if ($[17] !== actions || $[18] !== dialogAction || $[19] !== dialogItem || $[20] !== helpers) {
309
- t10 = {
312
+ $[19] = t10;
313
+ } else t10 = $[19];
314
+ const openDialog = t10;
315
+ let t11;
316
+ if ($[20] !== actions || $[21] !== dialogAction || $[22] !== dialogItem || $[23] !== helpers) {
317
+ t11 = {
310
318
  helpers,
311
319
  actions,
312
320
  dialogAction,
@@ -316,13 +324,13 @@ function useActions(t0) {
316
324
  openDialog,
317
325
  closeDialog
318
326
  };
319
- $[17] = actions;
320
- $[18] = dialogAction;
321
- $[19] = dialogItem;
322
- $[20] = helpers;
323
- $[21] = t10;
324
- } else t10 = $[21];
325
- return t10;
327
+ $[20] = actions;
328
+ $[21] = dialogAction;
329
+ $[22] = dialogItem;
330
+ $[23] = helpers;
331
+ $[24] = t11;
332
+ } else t11 = $[24];
333
+ return t11;
326
334
  }
327
335
 
328
336
  //#endregion
@@ -31,70 +31,6 @@ function useAuditFetcher(path) {
31
31
  } else t1 = $[4];
32
32
  return t1;
33
33
  }
34
- function useCollectionAuditHistory(collection, id, options, queryOptions) {
35
- const $ = c(17);
36
- let t0;
37
- let t1;
38
- let t2;
39
- if ($[0] !== collection || $[1] !== id || $[2] !== options) {
40
- const params = new URLSearchParams();
41
- if (options?.limit) params.set("limit", String(options.limit));
42
- t0 = collection;
43
- t1 = id;
44
- t2 = params.toString() ? `?${params}` : "";
45
- $[0] = collection;
46
- $[1] = id;
47
- $[2] = options;
48
- $[3] = t0;
49
- $[4] = t1;
50
- $[5] = t2;
51
- } else {
52
- t0 = $[3];
53
- t1 = $[4];
54
- t2 = $[5];
55
- }
56
- const fetchAudit = useAuditFetcher(`/${t0}/${t1}/audit${t2}`);
57
- let t3;
58
- if ($[6] !== collection || $[7] !== id || $[8] !== options) {
59
- t3 = [
60
- "questpie",
61
- "audit",
62
- "collection",
63
- collection,
64
- id,
65
- options
66
- ];
67
- $[6] = collection;
68
- $[7] = id;
69
- $[8] = options;
70
- $[9] = t3;
71
- } else t3 = $[9];
72
- let t4;
73
- if ($[10] !== fetchAudit) {
74
- t4 = (t5$1) => {
75
- const { signal } = t5$1;
76
- return fetchAudit(signal);
77
- };
78
- $[10] = fetchAudit;
79
- $[11] = t4;
80
- } else t4 = $[11];
81
- const t5 = !!collection && !!id && (queryOptions?.enabled ?? true);
82
- let t6;
83
- if ($[12] !== queryOptions || $[13] !== t3 || $[14] !== t4 || $[15] !== t5) {
84
- t6 = {
85
- queryKey: t3,
86
- queryFn: t4,
87
- enabled: t5,
88
- ...queryOptions
89
- };
90
- $[12] = queryOptions;
91
- $[13] = t3;
92
- $[14] = t4;
93
- $[15] = t5;
94
- $[16] = t6;
95
- } else t6 = $[16];
96
- return useQuery(t6);
97
- }
98
34
  function useGlobalAuditHistory(globalName, options, queryOptions) {
99
35
  const $ = c(14);
100
36
  let t0;
@@ -154,4 +90,4 @@ function useGlobalAuditHistory(globalName, options, queryOptions) {
154
90
  }
155
91
 
156
92
  //#endregion
157
- export { useCollectionAuditHistory, useGlobalAuditHistory };
93
+ export { useGlobalAuditHistory };
@@ -1,6 +1,6 @@
1
1
  import { createFormSchema } from "../builder/validation.mjs";
2
- import { useCollectionFields } from "./use-collection-fields.mjs";
3
2
  import { useValidationErrorMap } from "./use-validation-error-map.mjs";
3
+ import { useCollectionFields } from "./use-collection-fields.mjs";
4
4
  import { c } from "react/compiler-runtime";
5
5
 
6
6
  //#region src/client/hooks/use-collection-validation.ts
@@ -26,28 +26,41 @@ import { c } from "react/compiler-runtime";
26
26
  * }
27
27
  * ```
28
28
  */
29
- function useCollectionValidation(collection) {
30
- const $ = c(5);
31
- const { fields } = useCollectionFields(collection);
32
- let t0;
29
+ function useCollectionValidation(collection, t0) {
30
+ const $ = c(9);
31
+ let t1;
32
+ if ($[0] !== t0) {
33
+ t1 = t0 === void 0 ? {} : t0;
34
+ $[0] = t0;
35
+ $[1] = t1;
36
+ } else t1 = $[1];
37
+ const enabled = t1.enabled ?? true;
38
+ let t2;
39
+ if ($[2] !== enabled) {
40
+ t2 = { schemaQueryOptions: { enabled } };
41
+ $[2] = enabled;
42
+ $[3] = t2;
43
+ } else t2 = $[3];
44
+ const { fields } = useCollectionFields(collection, t2);
45
+ let t3;
33
46
  bb0: {
34
- if (!fields || Object.keys(fields).length === 0) {
35
- t0 = void 0;
47
+ if (!enabled || !fields || Object.keys(fields).length === 0) {
48
+ t3 = void 0;
36
49
  break bb0;
37
50
  }
38
- let t1$1;
39
- if ($[0] !== fields) {
40
- t1$1 = createFormSchema(fields);
41
- $[0] = fields;
42
- $[1] = t1$1;
43
- } else t1$1 = $[1];
44
- t0 = t1$1;
51
+ let t4$1;
52
+ if ($[4] !== fields) {
53
+ t4$1 = createFormSchema(fields);
54
+ $[4] = fields;
55
+ $[5] = t4$1;
56
+ } else t4$1 = $[5];
57
+ t3 = t4$1;
45
58
  }
46
- const schema = t0;
59
+ const schema = t3;
47
60
  const errorMap = useValidationErrorMap();
48
- let t1;
49
- if ($[2] !== errorMap || $[3] !== schema) {
50
- t1 = async (values, _context, _options) => {
61
+ let t4;
62
+ if ($[6] !== errorMap || $[7] !== schema) {
63
+ t4 = async (values, _context, _options) => {
51
64
  if (!schema) return {
52
65
  values,
53
66
  errors: {}
@@ -62,11 +75,11 @@ function useCollectionValidation(collection) {
62
75
  errors: zodErrorToFieldErrors(result.error, errorMap)
63
76
  };
64
77
  };
65
- $[2] = errorMap;
66
- $[3] = schema;
67
- $[4] = t1;
68
- } else t1 = $[4];
69
- return schema ? t1 : void 0;
78
+ $[6] = errorMap;
79
+ $[7] = schema;
80
+ $[8] = t4;
81
+ } else t4 = $[8];
82
+ return enabled && schema ? t4 : void 0;
70
83
  }
71
84
  /**
72
85
  * Convert Zod error to react-hook-form FieldErrors format with i18n support
@@ -324,6 +324,101 @@ function useCollectionUpdate(collection, mutationOptions) {
324
324
  return useMutation(t7);
325
325
  }
326
326
  /**
327
+ * Hook to update multiple collection items with distinct data per record.
328
+ */
329
+ function useCollectionUpdateBatch(collection, mutationOptions) {
330
+ const $ = c(29);
331
+ const { client, queryOpts, queryClient, locale } = useQuestpieQueryOptions();
332
+ let t0;
333
+ if ($[0] !== collection || $[1] !== locale || $[2] !== queryOpts) {
334
+ t0 = queryOpts.key([
335
+ "collections",
336
+ collection,
337
+ "find",
338
+ locale
339
+ ]);
340
+ $[0] = collection;
341
+ $[1] = locale;
342
+ $[2] = queryOpts;
343
+ $[3] = t0;
344
+ } else t0 = $[3];
345
+ const listQueryKey = t0;
346
+ let t1;
347
+ if ($[4] !== collection || $[5] !== locale || $[6] !== queryOpts) {
348
+ t1 = queryOpts.key([
349
+ "collections",
350
+ collection,
351
+ "count",
352
+ locale
353
+ ]);
354
+ $[4] = collection;
355
+ $[5] = locale;
356
+ $[6] = queryOpts;
357
+ $[7] = t1;
358
+ } else t1 = $[7];
359
+ const countQueryKey = t1;
360
+ let t2;
361
+ if ($[8] !== collection || $[9] !== locale || $[10] !== queryOpts) {
362
+ t2 = queryOpts.key([
363
+ "collections",
364
+ collection,
365
+ "findOne",
366
+ locale
367
+ ]);
368
+ $[8] = collection;
369
+ $[9] = locale;
370
+ $[10] = queryOpts;
371
+ $[11] = t2;
372
+ } else t2 = $[11];
373
+ const itemQueryKey = t2;
374
+ let t3;
375
+ if ($[12] !== client || $[13] !== collection || $[14] !== locale) {
376
+ t3 = (params) => client.collections[collection].updateBatch(params, { locale });
377
+ $[12] = client;
378
+ $[13] = collection;
379
+ $[14] = locale;
380
+ $[15] = t3;
381
+ } else t3 = $[15];
382
+ let t4;
383
+ if ($[16] !== mutationOptions?.onSuccess) {
384
+ t4 = (data, variables, context) => {
385
+ (mutationOptions?.onSuccess)?.(data, variables, context);
386
+ };
387
+ $[16] = mutationOptions?.onSuccess;
388
+ $[17] = t4;
389
+ } else t4 = $[17];
390
+ let t5;
391
+ if ($[18] !== countQueryKey || $[19] !== itemQueryKey || $[20] !== listQueryKey || $[21] !== mutationOptions?.onSettled || $[22] !== queryClient) {
392
+ t5 = (data_0, error, variables_0, context_0) => {
393
+ queryClient.invalidateQueries({ queryKey: listQueryKey });
394
+ queryClient.invalidateQueries({ queryKey: countQueryKey });
395
+ queryClient.invalidateQueries({ queryKey: itemQueryKey });
396
+ (mutationOptions?.onSettled)?.(data_0, error, variables_0, context_0);
397
+ };
398
+ $[18] = countQueryKey;
399
+ $[19] = itemQueryKey;
400
+ $[20] = listQueryKey;
401
+ $[21] = mutationOptions?.onSettled;
402
+ $[22] = queryClient;
403
+ $[23] = t5;
404
+ } else t5 = $[23];
405
+ let t6;
406
+ if ($[24] !== mutationOptions || $[25] !== t3 || $[26] !== t4 || $[27] !== t5) {
407
+ t6 = {
408
+ mutationFn: t3,
409
+ onSuccess: t4,
410
+ onSettled: t5,
411
+ ...mutationOptions
412
+ };
413
+ $[24] = mutationOptions;
414
+ $[25] = t3;
415
+ $[26] = t4;
416
+ $[27] = t5;
417
+ $[28] = t6;
418
+ } else t6 = $[28];
419
+ return useMutation(t6);
420
+ }
421
+ /**
327
422
  * Hook to delete collection item
328
423
  *
329
424
  * Uses RegisteredCMS from module augmentation for automatic type inference.
@@ -670,4 +765,4 @@ function useCollectionRevertVersion(collection, mutationOptions) {
670
765
  }
671
766
 
672
767
  //#endregion
673
- export { useCollectionCount, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions };
768
+ export { useCollectionCount, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionUpdateBatch, useCollectionVersions };