@questpie/admin 3.2.4 → 3.2.6

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 (255) hide show
  1. package/dist/client/blocks/block-renderer.d.mts +2 -2
  2. package/dist/client/blocks/block-renderer.mjs +164 -339
  3. package/dist/client/components/actions/action-button.mjs +9 -9
  4. package/dist/client/components/actions/action-dialog.mjs +195 -493
  5. package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
  6. package/dist/client/components/actions/header-actions.mjs +73 -165
  7. package/dist/client/components/admin-link.d.mts +2 -2
  8. package/dist/client/components/admin-link.mjs +40 -126
  9. package/dist/client/components/auth/auth-loading.mjs +9 -44
  10. package/dist/client/components/blocks/block-canvas.mjs +31 -95
  11. package/dist/client/components/blocks/block-editor-context.mjs +13 -57
  12. package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
  13. package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
  14. package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
  15. package/dist/client/components/blocks/block-insert-button.mjs +49 -165
  16. package/dist/client/components/blocks/block-item-menu.mjs +102 -301
  17. package/dist/client/components/blocks/block-item.mjs +136 -370
  18. package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
  19. package/dist/client/components/blocks/block-tree.mjs +12 -68
  20. package/dist/client/components/blocks/block-type-icon.mjs +14 -56
  21. package/dist/client/components/brand-logo.mjs +35 -149
  22. package/dist/client/components/component-renderer.mjs +42 -118
  23. package/dist/client/components/error-boundary.mjs +14 -58
  24. package/dist/client/components/fields/array-field.mjs +209 -521
  25. package/dist/client/components/fields/asset-preview-field.mjs +41 -141
  26. package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
  27. package/dist/client/components/fields/boolean-field.mjs +29 -59
  28. package/dist/client/components/fields/date-field.mjs +7 -37
  29. package/dist/client/components/fields/datetime-field.mjs +7 -38
  30. package/dist/client/components/fields/email-field.mjs +25 -54
  31. package/dist/client/components/fields/field-wrapper.mjs +30 -105
  32. package/dist/client/components/fields/json-field.mjs +94 -296
  33. package/dist/client/components/fields/locale-badge.mjs +6 -15
  34. package/dist/client/components/fields/number-field.mjs +27 -60
  35. package/dist/client/components/fields/object-array-field.mjs +283 -659
  36. package/dist/client/components/fields/object-field.mjs +165 -633
  37. package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
  38. package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
  39. package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
  40. package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
  41. package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
  42. package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
  43. package/dist/client/components/fields/relation-field.mjs +10 -66
  44. package/dist/client/components/fields/relation-picker.mjs +18 -18
  45. package/dist/client/components/fields/relation-select.mjs +12 -12
  46. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
  47. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
  48. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
  49. package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
  50. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
  51. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
  52. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
  53. package/dist/client/components/fields/rich-text-field.mjs +14 -53
  54. package/dist/client/components/fields/select-field.mjs +61 -72
  55. package/dist/client/components/fields/text-field.mjs +26 -59
  56. package/dist/client/components/fields/textarea-field.mjs +26 -58
  57. package/dist/client/components/fields/time-field.mjs +7 -35
  58. package/dist/client/components/fields/upload-field.mjs +47 -165
  59. package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
  60. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
  61. package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
  62. package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
  63. package/dist/client/components/history-sidebar.mjs +285 -605
  64. package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
  65. package/dist/client/components/locale-switcher.mjs +106 -228
  66. package/dist/client/components/media/media-grid.mjs +84 -273
  67. package/dist/client/components/media/media-picker-dialog.mjs +176 -476
  68. package/dist/client/components/preview/live-preview-mode.mjs +233 -458
  69. package/dist/client/components/preview/preview-pane.mjs +22 -22
  70. package/dist/client/components/primitives/asset-preview.mjs +290 -666
  71. package/dist/client/components/primitives/checkbox-input.mjs +9 -35
  72. package/dist/client/components/primitives/date-input.mjs +109 -327
  73. package/dist/client/components/primitives/dropzone.mjs +209 -336
  74. package/dist/client/components/primitives/field-select-control.mjs +12 -80
  75. package/dist/client/components/primitives/number-input.mjs +4 -4
  76. package/dist/client/components/primitives/select-multi.mjs +229 -572
  77. package/dist/client/components/primitives/select-single.mjs +179 -499
  78. package/dist/client/components/primitives/time-input.mjs +43 -117
  79. package/dist/client/components/primitives/toggle-input.mjs +9 -29
  80. package/dist/client/components/sheets/resource-sheet.mjs +61 -70
  81. package/dist/client/components/ui/accordion.mjs +35 -155
  82. package/dist/client/components/ui/alert.mjs +13 -68
  83. package/dist/client/components/ui/badge.mjs +9 -51
  84. package/dist/client/components/ui/button.mjs +8 -54
  85. package/dist/client/components/ui/card.mjs +37 -193
  86. package/dist/client/components/ui/checkbox.mjs +12 -68
  87. package/dist/client/components/ui/command.mjs +48 -219
  88. package/dist/client/components/ui/dialog.mjs +50 -262
  89. package/dist/client/components/ui/drawer.mjs +55 -259
  90. package/dist/client/components/ui/dropdown-menu.mjs +86 -427
  91. package/dist/client/components/ui/empty-state.mjs +28 -98
  92. package/dist/client/components/ui/field.mjs +73 -309
  93. package/dist/client/components/ui/input-group.mjs +42 -167
  94. package/dist/client/components/ui/input.mjs +7 -37
  95. package/dist/client/components/ui/kbd.mjs +6 -36
  96. package/dist/client/components/ui/label.mjs +7 -37
  97. package/dist/client/components/ui/popover.mjs +34 -169
  98. package/dist/client/components/ui/responsive-dialog.mjs +67 -273
  99. package/dist/client/components/ui/scroll-fade.mjs +63 -158
  100. package/dist/client/components/ui/search-input.mjs +33 -100
  101. package/dist/client/components/ui/select.mjs +72 -393
  102. package/dist/client/components/ui/separator.mjs +7 -38
  103. package/dist/client/components/ui/sheet.mjs +49 -269
  104. package/dist/client/components/ui/sidebar.mjs +171 -690
  105. package/dist/client/components/ui/skeleton.mjs +7 -38
  106. package/dist/client/components/ui/sonner.mjs +11 -42
  107. package/dist/client/components/ui/switch.mjs +9 -45
  108. package/dist/client/components/ui/table.mjs +48 -266
  109. package/dist/client/components/ui/tabs.mjs +26 -139
  110. package/dist/client/components/ui/textarea.mjs +6 -32
  111. package/dist/client/components/ui/tooltip.mjs +27 -129
  112. package/dist/client/components/widgets/chart-widget.mjs +174 -522
  113. package/dist/client/components/widgets/progress-widget.mjs +66 -172
  114. package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
  115. package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
  116. package/dist/client/components/widgets/stats-widget.mjs +41 -175
  117. package/dist/client/components/widgets/table-widget.mjs +9 -9
  118. package/dist/client/components/widgets/timeline-widget.mjs +86 -226
  119. package/dist/client/components/widgets/value-widget.mjs +74 -381
  120. package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
  121. package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
  122. package/dist/client/contexts/focus-context.mjs +63 -146
  123. package/dist/client/hooks/typed-hooks.mjs +241 -701
  124. package/dist/client/hooks/use-action.mjs +62 -198
  125. package/dist/client/hooks/use-admin-config.mjs +5 -35
  126. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  127. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  128. package/dist/client/hooks/use-audit-history.mjs +21 -69
  129. package/dist/client/hooks/use-brand.mjs +1 -9
  130. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  131. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  132. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  133. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  134. package/dist/client/hooks/use-collection.mjs +194 -614
  135. package/dist/client/hooks/use-current-user.mjs +0 -1
  136. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  137. package/dist/client/hooks/use-field-options.mjs +61 -202
  138. package/dist/client/hooks/use-global-fields.mjs +14 -46
  139. package/dist/client/hooks/use-global-meta.mjs +9 -30
  140. package/dist/client/hooks/use-global-schema.mjs +9 -30
  141. package/dist/client/hooks/use-global.mjs +63 -219
  142. package/dist/client/hooks/use-locks.mjs +117 -325
  143. package/dist/client/hooks/use-media-query.mjs +16 -36
  144. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  145. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  146. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  147. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  148. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  149. package/dist/client/hooks/use-saved-views.mjs +22 -103
  150. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  151. package/dist/client/hooks/use-search.mjs +31 -143
  152. package/dist/client/hooks/use-server-actions.mjs +18 -50
  153. package/dist/client/hooks/use-server-validation.mjs +72 -166
  154. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  155. package/dist/client/hooks/use-setup-status.mjs +12 -25
  156. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  157. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  158. package/dist/client/hooks/use-upload.mjs +54 -152
  159. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  160. package/dist/client/hooks/use-view-state.mjs +187 -437
  161. package/dist/client/i18n/hooks.mjs +65 -197
  162. package/dist/client/lib/render-profiler.mjs +14 -41
  163. package/dist/client/preview/block-scope-context.mjs +14 -36
  164. package/dist/client/preview/preview-banner.d.mts +2 -2
  165. package/dist/client/preview/preview-banner.mjs +42 -108
  166. package/dist/client/preview/preview-field.d.mts +4 -4
  167. package/dist/client/preview/preview-field.mjs +167 -348
  168. package/dist/client/preview/use-collection-preview.mjs +121 -215
  169. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  170. package/dist/client/runtime/locale-scope.mjs +22 -63
  171. package/dist/client/runtime/provider.mjs +100 -255
  172. package/dist/client/runtime/translations-provider.mjs +41 -107
  173. package/dist/client/scope/picker.mjs +86 -321
  174. package/dist/client/scope/provider.mjs +8 -17
  175. package/dist/client/utils/build-field-definitions-from-schema.mjs +4 -2
  176. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  177. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  178. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  179. package/dist/client/views/auth/auth-layout.mjs +104 -284
  180. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  181. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  182. package/dist/client/views/auth/invite-form.mjs +107 -442
  183. package/dist/client/views/auth/login-form.d.mts +2 -2
  184. package/dist/client/views/auth/login-form.mjs +116 -337
  185. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  186. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  187. package/dist/client/views/auth/setup-form.d.mts +2 -2
  188. package/dist/client/views/auth/setup-form.mjs +140 -478
  189. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  190. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -379
  191. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  192. package/dist/client/views/collection/cells/primitive-cells.mjs +116 -356
  193. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  194. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  195. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  196. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  197. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  198. package/dist/client/views/collection/field-renderer.mjs +58 -182
  199. package/dist/client/views/collection/form-view.mjs +284 -518
  200. package/dist/client/views/collection/table-view.mjs +231 -463
  201. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  202. package/dist/client/views/common/global-search.mjs +241 -560
  203. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  204. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  205. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  206. package/dist/client/views/globals/global-form-view.mjs +477 -1301
  207. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  208. package/dist/client/views/layout/admin-layout.mjs +83 -246
  209. package/dist/client/views/layout/admin-router.mjs +458 -1274
  210. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  211. package/dist/client/views/layout/admin-theme.mjs +30 -64
  212. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  213. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  216. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  217. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  218. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  219. package/dist/client/views/pages/invite-page.d.mts +2 -2
  220. package/dist/client/views/pages/invite-page.mjs +35 -90
  221. package/dist/client/views/pages/login-page.d.mts +2 -2
  222. package/dist/client/views/pages/login-page.mjs +41 -121
  223. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  224. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  225. package/dist/client/views/pages/setup-page.d.mts +2 -2
  226. package/dist/client/views/pages/setup-page.mjs +33 -95
  227. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  228. package/dist/server/adapters/index.d.mts +2 -0
  229. package/dist/server/adapters/nextjs.d.mts +1 -0
  230. package/dist/server/auth-helpers.d.mts +1 -0
  231. package/dist/server/modules/admin/.generated/module.d.mts +1 -0
  232. package/dist/server/modules/admin/collections/account.d.mts +46 -46
  233. package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
  234. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  235. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  236. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  237. package/dist/server/modules/admin/collections/assets.d.mts +39 -39
  238. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  239. package/dist/server/modules/admin/collections/user.d.mts +62 -62
  240. package/dist/server/modules/admin/collections/verification.d.mts +23 -23
  241. package/dist/server/modules/admin/index.d.mts +20 -19
  242. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  243. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  244. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  245. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  246. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  247. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  248. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  249. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  250. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
  251. package/dist/server/modules/audit/.generated/module.d.mts +6 -6
  252. package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
  253. package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
  254. package/dist/server.d.mts +2 -0
  255. package/package.json +3 -5
@@ -2,7 +2,6 @@ import { useResolveText } from "../../../../i18n/hooks.mjs";
2
2
  import { cn } from "../../../../lib/utils.mjs";
3
3
  import { Badge } from "../../../../components/ui/badge.mjs";
4
4
  import { getRelationItemAvatarUrl, getRelationItemId, getRelationItemLabelWithField } from "./cell-helpers.mjs";
5
- import { c } from "react/compiler-runtime";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
7
6
 
8
7
  //#region src/client/views/collection/cells/shared/relation-chip.tsx
@@ -10,139 +9,44 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
9
  * Clickable relation chip component
11
10
  * Shows label and navigates to related item on click (or opens sheet if onClick provided)
12
11
  */
13
- function RelationChip(t0) {
14
- const $ = c(37);
15
- const { item, targetCollection, onClick, className, showAvatar: t1, avatarField, labelField } = t0;
16
- const showAvatar = t1 === void 0 ? false : t1;
17
- const resolveText = useResolveText();
18
- let t2;
19
- if ($[0] !== item || $[1] !== labelField || $[2] !== resolveText) {
20
- t2 = resolveText(getRelationItemLabelWithField(item, labelField));
21
- $[0] = item;
22
- $[1] = labelField;
23
- $[2] = resolveText;
24
- $[3] = t2;
25
- } else t2 = $[3];
26
- const label = t2;
27
- let t3;
28
- if ($[4] !== avatarField || $[5] !== item) {
29
- t3 = getRelationItemAvatarUrl(item, avatarField);
30
- $[4] = avatarField;
31
- $[5] = item;
32
- $[6] = t3;
33
- } else t3 = $[6];
34
- const avatarUrl = t3;
35
- let t4;
36
- if ($[7] !== item) {
37
- t4 = getRelationItemId(item);
38
- $[7] = item;
39
- $[8] = t4;
40
- } else t4 = $[8];
41
- const id = t4;
12
+ function RelationChip({ item, targetCollection, onClick, className, showAvatar = false, avatarField, labelField }) {
13
+ const label = useResolveText()(getRelationItemLabelWithField(item, labelField));
14
+ const avatarUrl = getRelationItemAvatarUrl(item, avatarField);
15
+ const id = getRelationItemId(item);
42
16
  const canInteract = targetCollection && id;
43
- let t5;
44
- if ($[9] !== avatarUrl || $[10] !== label || $[11] !== showAvatar) {
45
- t5 = showAvatar && avatarUrl ? /* @__PURE__ */ jsx("img", {
46
- src: avatarUrl,
47
- alt: label,
48
- className: "image-outline size-4 rounded-full object-cover"
49
- }) : null;
50
- $[9] = avatarUrl;
51
- $[10] = label;
52
- $[11] = showAvatar;
53
- $[12] = t5;
54
- } else t5 = $[12];
55
- const avatar = t5;
56
- let t6;
57
- if ($[13] !== id || $[14] !== onClick || $[15] !== targetCollection) {
58
- t6 = (e) => {
59
- e.stopPropagation();
60
- if (onClick && id && targetCollection) {
61
- e.preventDefault();
62
- onClick(id, targetCollection);
63
- }
64
- };
65
- $[13] = id;
66
- $[14] = onClick;
67
- $[15] = targetCollection;
68
- $[16] = t6;
69
- } else t6 = $[16];
70
- const handleClick = t6;
71
- if (canInteract) {
72
- const href = `/admin/collections/${targetCollection}/${id}`;
73
- let t7$1;
74
- if ($[17] !== handleClick || $[18] !== href) {
75
- t7$1 = /* @__PURE__ */ jsx("a", {
76
- href,
77
- onClick: handleClick,
78
- onPointerDown: _temp
79
- });
80
- $[17] = handleClick;
81
- $[18] = href;
82
- $[19] = t7$1;
83
- } else t7$1 = $[19];
84
- let t8$1;
85
- if ($[20] !== className) {
86
- t8$1 = cn("qa-relation-chip cursor-pointer", "max-w-40", className);
87
- $[20] = className;
88
- $[21] = t8$1;
89
- } else t8$1 = $[21];
90
- let t9$1;
91
- if ($[22] !== label) {
92
- t9$1 = /* @__PURE__ */ jsx("span", {
93
- className: "truncate",
94
- children: label
95
- });
96
- $[22] = label;
97
- $[23] = t9$1;
98
- } else t9$1 = $[23];
99
- let t10;
100
- if ($[24] !== avatar || $[25] !== t7$1 || $[26] !== t8$1 || $[27] !== t9$1) {
101
- t10 = /* @__PURE__ */ jsxs(Badge, {
102
- variant: "secondary",
103
- render: t7$1,
104
- className: t8$1,
105
- children: [avatar, t9$1]
106
- });
107
- $[24] = avatar;
108
- $[25] = t7$1;
109
- $[26] = t8$1;
110
- $[27] = t9$1;
111
- $[28] = t10;
112
- } else t10 = $[28];
113
- return t10;
114
- }
115
- let t7;
116
- if ($[29] !== className) {
117
- t7 = cn("qa-relation-chip cursor-default", className);
118
- $[29] = className;
119
- $[30] = t7;
120
- } else t7 = $[30];
121
- let t8;
122
- if ($[31] !== label) {
123
- t8 = /* @__PURE__ */ jsx("span", {
17
+ const avatar = showAvatar && avatarUrl ? /* @__PURE__ */ jsx("img", {
18
+ src: avatarUrl,
19
+ alt: label,
20
+ className: "image-outline size-4 rounded-full object-cover"
21
+ }) : null;
22
+ const handleClick = (e) => {
23
+ e.stopPropagation();
24
+ if (onClick && id && targetCollection) {
25
+ e.preventDefault();
26
+ onClick(id, targetCollection);
27
+ }
28
+ };
29
+ if (canInteract) return /* @__PURE__ */ jsxs(Badge, {
30
+ variant: "secondary",
31
+ render: /* @__PURE__ */ jsx("a", {
32
+ href: `/admin/collections/${targetCollection}/${id}`,
33
+ onClick: handleClick,
34
+ onPointerDown: (e) => e.stopPropagation()
35
+ }),
36
+ className: cn("qa-relation-chip cursor-pointer", "max-w-40", className),
37
+ children: [avatar, /* @__PURE__ */ jsx("span", {
124
38
  className: "truncate",
125
39
  children: label
126
- });
127
- $[31] = label;
128
- $[32] = t8;
129
- } else t8 = $[32];
130
- let t9;
131
- if ($[33] !== avatar || $[34] !== t7 || $[35] !== t8) {
132
- t9 = /* @__PURE__ */ jsxs(Badge, {
133
- variant: "secondary",
134
- className: t7,
135
- children: [avatar, t8]
136
- });
137
- $[33] = avatar;
138
- $[34] = t7;
139
- $[35] = t8;
140
- $[36] = t9;
141
- } else t9 = $[36];
142
- return t9;
143
- }
144
- function _temp(e_0) {
145
- return e_0.stopPropagation();
40
+ })]
41
+ });
42
+ return /* @__PURE__ */ jsxs(Badge, {
43
+ variant: "secondary",
44
+ className: cn("qa-relation-chip cursor-default", className),
45
+ children: [avatar, /* @__PURE__ */ jsx("span", {
46
+ className: "truncate",
47
+ children: label
48
+ })]
49
+ });
146
50
  }
147
51
 
148
52
  //#endregion
@@ -2,7 +2,6 @@ import { useTranslation } from "../../../i18n/hooks.mjs";
2
2
  import { Badge } from "../../../components/ui/badge.mjs";
3
3
  import { AssetThumbnail } from "./shared/asset-thumbnail.mjs";
4
4
  import { useCollectionItem } from "../../../hooks/use-collection.mjs";
5
- import { c } from "react/compiler-runtime";
6
5
  import "react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
8
7
 
@@ -11,33 +10,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
11
10
  * Upload cell - displays single asset thumbnail or file info
12
11
  * Uses AssetThumbnail with size="sm"
13
12
  */
14
- function UploadCell(t0) {
15
- const $ = c(6);
16
- const { value, fieldDef } = t0;
17
- if (Array.isArray(value)) {
18
- let t1$1;
19
- if ($[0] !== fieldDef || $[1] !== value) {
20
- t1$1 = /* @__PURE__ */ jsx(UploadManyCell, {
21
- value,
22
- fieldDef
23
- });
24
- $[0] = fieldDef;
25
- $[1] = value;
26
- $[2] = t1$1;
27
- } else t1$1 = $[2];
28
- return t1$1;
29
- }
30
- let t1;
31
- if ($[3] !== fieldDef || $[4] !== value) {
32
- t1 = /* @__PURE__ */ jsx(UploadSingleCell, {
33
- value,
34
- fieldDef
35
- });
36
- $[3] = fieldDef;
37
- $[4] = value;
38
- $[5] = t1;
39
- } else t1 = $[5];
40
- return t1;
13
+ function UploadCell({ value, fieldDef }) {
14
+ if (Array.isArray(value)) return /* @__PURE__ */ jsx(UploadManyCell, {
15
+ value,
16
+ fieldDef
17
+ });
18
+ return /* @__PURE__ */ jsx(UploadSingleCell, {
19
+ value,
20
+ fieldDef
21
+ });
41
22
  }
42
23
  function getUploadCollection(fieldDef) {
43
24
  const options = fieldDef?.["~options"] ?? {};
@@ -57,161 +38,63 @@ function hasAssetDisplayData(value) {
57
38
  const asset = value;
58
39
  return !!(asset.url || asset.filename || asset.mimeType);
59
40
  }
60
- function UploadSingleCell(t0) {
61
- const $ = c(11);
62
- const { value, fieldDef } = t0;
63
- let t1;
64
- if ($[0] !== fieldDef) {
65
- t1 = getUploadCollection(fieldDef);
66
- $[0] = fieldDef;
67
- $[1] = t1;
68
- } else t1 = $[1];
69
- const collection = t1;
70
- let t2;
71
- if ($[2] !== value) {
72
- t2 = getAssetId(value);
73
- $[2] = value;
74
- $[3] = t2;
75
- } else t2 = $[3];
76
- const assetId = t2;
77
- let t3;
78
- if ($[4] !== assetId || $[5] !== value) {
79
- t3 = !!assetId && !hasAssetDisplayData(value);
80
- $[4] = assetId;
81
- $[5] = value;
82
- $[6] = t3;
83
- } else t3 = $[6];
84
- const shouldFetch = t3;
85
- let t4;
86
- if ($[7] !== shouldFetch) {
87
- t4 = {
88
- enabled: shouldFetch,
89
- staleTime: 3e4
90
- };
91
- $[7] = shouldFetch;
92
- $[8] = t4;
93
- } else t4 = $[8];
94
- const { data: fetchedAsset } = useCollectionItem(collection, assetId || "", void 0, t4);
95
- const t5 = fetchedAsset || value;
96
- let t6;
97
- if ($[9] !== t5) {
98
- t6 = /* @__PURE__ */ jsx(AssetThumbnail, {
99
- asset: t5,
100
- size: "sm",
101
- showFilename: true
102
- });
103
- $[9] = t5;
104
- $[10] = t6;
105
- } else t6 = $[10];
106
- return t6;
41
+ function UploadSingleCell({ value, fieldDef }) {
42
+ const collection = getUploadCollection(fieldDef);
43
+ const assetId = getAssetId(value);
44
+ const shouldFetch = !!assetId && !hasAssetDisplayData(value);
45
+ const { data: fetchedAsset } = useCollectionItem(collection, assetId || "", void 0, {
46
+ enabled: shouldFetch,
47
+ staleTime: 3e4
48
+ });
49
+ return /* @__PURE__ */ jsx(AssetThumbnail, {
50
+ asset: fetchedAsset || value,
51
+ size: "sm",
52
+ showFilename: true
53
+ });
107
54
  }
108
55
  /**
109
56
  * Upload many cell - displays multiple assets count or thumbnails
110
57
  */
111
- function UploadManyCell(t0) {
112
- const $ = c(15);
113
- const { value } = t0;
58
+ function UploadManyCell({ value }) {
114
59
  const { t } = useTranslation();
115
- if (value === null || value === void 0) {
116
- let t1$1;
117
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
118
- t1$1 = /* @__PURE__ */ jsx("span", {
119
- className: "text-muted-foreground",
120
- children: "-"
121
- });
122
- $[0] = t1$1;
123
- } else t1$1 = $[0];
124
- return t1$1;
125
- }
126
- if (!Array.isArray(value)) {
127
- let t1$1;
128
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
129
- t1$1 = /* @__PURE__ */ jsx("span", {
130
- className: "text-muted-foreground",
131
- children: "-"
132
- });
133
- $[1] = t1$1;
134
- } else t1$1 = $[1];
135
- return t1$1;
136
- }
137
- if (value.length === 0) {
138
- let t1$1;
139
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
140
- t1$1 = /* @__PURE__ */ jsx("span", {
141
- className: "text-muted-foreground",
142
- children: "-"
143
- });
144
- $[2] = t1$1;
145
- } else t1$1 = $[2];
146
- return t1$1;
147
- }
148
- let t1;
149
- if ($[3] !== value) {
150
- t1 = Symbol.for("react.early_return_sentinel");
151
- bb0: {
152
- const imageAssets = value.filter(_temp).slice(0, 3);
153
- if (imageAssets.length > 0) {
154
- const remaining = value.length - imageAssets.length;
155
- const t2$1 = /* @__PURE__ */ jsx("div", {
156
- className: "flex -space-x-2",
157
- children: imageAssets.map(_temp2)
158
- });
159
- let t3$1;
160
- if ($[5] !== remaining) {
161
- t3$1 = remaining > 0 && /* @__PURE__ */ jsxs("span", {
162
- className: "text-muted-foreground ml-1 text-xs tabular-nums",
163
- children: ["+", remaining]
164
- });
165
- $[5] = remaining;
166
- $[6] = t3$1;
167
- } else t3$1 = $[6];
168
- let t4;
169
- if ($[7] !== t2$1 || $[8] !== t3$1) {
170
- t4 = /* @__PURE__ */ jsxs("div", {
171
- className: "flex items-center gap-1",
172
- children: [t2$1, t3$1]
173
- });
174
- $[7] = t2$1;
175
- $[8] = t3$1;
176
- $[9] = t4;
177
- } else t4 = $[9];
178
- t1 = t4;
179
- break bb0;
180
- }
181
- }
182
- $[3] = value;
183
- $[4] = t1;
184
- } else t1 = $[4];
185
- if (t1 !== Symbol.for("react.early_return_sentinel")) return t1;
186
- let t2;
187
- if ($[10] !== t || $[11] !== value.length) {
188
- t2 = t("cell.file", { count: value.length });
189
- $[10] = t;
190
- $[11] = value.length;
191
- $[12] = t2;
192
- } else t2 = $[12];
193
- let t3;
194
- if ($[13] !== t2) {
195
- t3 = /* @__PURE__ */ jsx(Badge, {
196
- variant: "secondary",
197
- children: t2
60
+ if (value === null || value === void 0) return /* @__PURE__ */ jsx("span", {
61
+ className: "text-muted-foreground",
62
+ children: "-"
63
+ });
64
+ if (!Array.isArray(value)) return /* @__PURE__ */ jsx("span", {
65
+ className: "text-muted-foreground",
66
+ children: "-"
67
+ });
68
+ if (value.length === 0) return /* @__PURE__ */ jsx("span", {
69
+ className: "text-muted-foreground",
70
+ children: "-"
71
+ });
72
+ const imageAssets = value.filter((item) => {
73
+ if (typeof item !== "object" || item === null) return false;
74
+ const mimeType = item.mimeType;
75
+ return typeof mimeType === "string" && mimeType.startsWith("image/");
76
+ }).slice(0, 3);
77
+ if (imageAssets.length > 0) {
78
+ const remaining = value.length - imageAssets.length;
79
+ return /* @__PURE__ */ jsxs("div", {
80
+ className: "flex items-center gap-1",
81
+ children: [/* @__PURE__ */ jsx("div", {
82
+ className: "flex -space-x-2",
83
+ children: imageAssets.map((asset, index) => /* @__PURE__ */ jsx("img", {
84
+ src: asset.url,
85
+ alt: asset.filename || "Asset",
86
+ className: "image-outline bg-background size-6 rounded object-cover"
87
+ }, asset.id || index))
88
+ }), remaining > 0 && /* @__PURE__ */ jsxs("span", {
89
+ className: "text-muted-foreground ml-1 text-xs tabular-nums",
90
+ children: ["+", remaining]
91
+ })]
198
92
  });
199
- $[13] = t2;
200
- $[14] = t3;
201
- } else t3 = $[14];
202
- return t3;
203
- }
204
- function _temp2(asset, index) {
205
- return /* @__PURE__ */ jsx("img", {
206
- src: asset.url,
207
- alt: asset.filename || "Asset",
208
- className: "image-outline bg-background size-6 rounded object-cover"
209
- }, asset.id || index);
210
- }
211
- function _temp(item) {
212
- if (typeof item !== "object" || item === null) return false;
213
- const mimeType = item.mimeType;
214
- return typeof mimeType === "string" && mimeType.startsWith("image/");
93
+ }
94
+ return /* @__PURE__ */ jsx(Badge, {
95
+ variant: "secondary",
96
+ children: t("cell.file", { count: value.length })
97
+ });
215
98
  }
216
99
 
217
100
  //#endregion
@@ -5,68 +5,28 @@ import { DefaultCell, TextCell } from "../cells/primitive-cells.mjs";
5
5
  import { LocaleSwitcher } from "../../../components/locale-switcher.mjs";
6
6
  import { normalizeColumnConfig } from "../../../builder/types/collection-types.mjs";
7
7
  import { computeDefaultColumns, formatHeader } from "./column-defaults.mjs";
8
- import { c } from "react/compiler-runtime";
9
8
  import { jsx, jsxs } from "react/jsx-runtime";
10
9
 
11
10
  //#region src/client/views/collection/columns/build-columns.tsx
12
11
  /**
13
12
  * Column header component that resolves I18nText labels
14
13
  */
15
- function ColumnHeader(t0) {
16
- const $ = c(17);
17
- const { label, fallback, localized } = t0;
14
+ function ColumnHeader({ label, fallback, localized }) {
18
15
  const resolveText = useResolveText();
19
16
  const contentLocales = useSafeContentLocales();
20
17
  const { locale: contentLocale, setLocale: setContentLocale } = useScopedLocale();
21
18
  const resolvedLocale = contentLocale ?? contentLocales?.defaultLocale ?? contentLocales?.locales[0]?.code;
22
- let t1;
23
- if ($[0] !== contentLocales || $[1] !== resolvedLocale) {
24
- t1 = contentLocales?.locales?.length ? contentLocales.locales : resolvedLocale ? [{ code: resolvedLocale }] : [];
25
- $[0] = contentLocales;
26
- $[1] = resolvedLocale;
27
- $[2] = t1;
28
- } else t1 = $[2];
29
- const localeOptions = t1;
19
+ const localeOptions = contentLocales?.locales?.length ? contentLocales.locales : resolvedLocale ? [{ code: resolvedLocale }] : [];
30
20
  const showLocaleSwitcher = localized && localeOptions.length > 0;
31
- let t2;
32
- if ($[3] !== fallback || $[4] !== label || $[5] !== resolveText) {
33
- t2 = resolveText(label, fallback);
34
- $[3] = fallback;
35
- $[4] = label;
36
- $[5] = resolveText;
37
- $[6] = t2;
38
- } else t2 = $[6];
39
- let t3;
40
- if ($[7] !== t2) {
41
- t3 = /* @__PURE__ */ jsx("span", { children: t2 });
42
- $[7] = t2;
43
- $[8] = t3;
44
- } else t3 = $[8];
45
- let t4;
46
- if ($[9] !== localeOptions || $[10] !== resolvedLocale || $[11] !== setContentLocale || $[12] !== showLocaleSwitcher) {
47
- t4 = showLocaleSwitcher && /* @__PURE__ */ jsx(LocaleSwitcher, {
21
+ return /* @__PURE__ */ jsxs("span", {
22
+ className: "inline-flex items-center gap-1.5",
23
+ children: [/* @__PURE__ */ jsx("span", { children: resolveText(label, fallback) }), showLocaleSwitcher && /* @__PURE__ */ jsx(LocaleSwitcher, {
48
24
  locales: localeOptions,
49
25
  value: resolvedLocale,
50
26
  onChange: setContentLocale,
51
27
  labelMode: "code"
52
- });
53
- $[9] = localeOptions;
54
- $[10] = resolvedLocale;
55
- $[11] = setContentLocale;
56
- $[12] = showLocaleSwitcher;
57
- $[13] = t4;
58
- } else t4 = $[13];
59
- let t5;
60
- if ($[14] !== t3 || $[15] !== t4) {
61
- t5 = /* @__PURE__ */ jsxs("span", {
62
- className: "inline-flex items-center gap-1.5",
63
- children: [t3, t4]
64
- });
65
- $[14] = t3;
66
- $[15] = t4;
67
- $[16] = t5;
68
- } else t5 = $[16];
69
- return t5;
28
+ })]
29
+ });
70
30
  }
71
31
  /**
72
32
  * Field types that need fieldDef passed to their cell component
@@ -139,7 +99,7 @@ function buildColumns(options) {
139
99
  columnConfigs = [titleColumn, ...titleColumn === "_title" ? allFields : allFields.filter((f) => f !== titleColumn)];
140
100
  } else if (listConfig?.columns && listConfig.columns.length > 0) columnConfigs = listConfig.columns;
141
101
  else if (Object.keys(fields).length > 0) columnConfigs = computeDefaultColumns(fields, { meta });
142
- else columnConfigs = [titleColumn, ...fallbackColumns.filter((c$1) => c$1 !== titleColumn && c$1 !== "_title")];
102
+ else columnConfigs = [titleColumn, ...fallbackColumns.filter((c) => c !== titleColumn && c !== "_title")];
143
103
  return columnConfigs.map((colConfig) => {
144
104
  const normalized = normalizeColumnConfig(colConfig);
145
105
  const fieldName = normalized.field;