@questpie/admin 3.2.3 → 3.2.5

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 (244) 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 +106 -220
  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 +107 -313
  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 -182
  47. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +8 -19
  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 +196 -530
  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 +39 -74
  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 +306 -611
  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 +177 -494
  68. package/dist/client/components/preview/live-preview-mode.mjs +240 -438
  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 +200 -559
  77. package/dist/client/components/primitives/select-single.mjs +165 -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.d.mts +4 -0
  123. package/dist/client/contexts/focus-context.mjs +87 -150
  124. package/dist/client/hooks/typed-hooks.mjs +241 -701
  125. package/dist/client/hooks/use-action.mjs +62 -198
  126. package/dist/client/hooks/use-admin-config.mjs +5 -35
  127. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  128. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  129. package/dist/client/hooks/use-audit-history.mjs +21 -69
  130. package/dist/client/hooks/use-brand.mjs +1 -9
  131. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  132. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  133. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  134. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  135. package/dist/client/hooks/use-collection.mjs +194 -614
  136. package/dist/client/hooks/use-current-user.mjs +0 -1
  137. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  138. package/dist/client/hooks/use-field-options.mjs +61 -202
  139. package/dist/client/hooks/use-global-fields.mjs +14 -46
  140. package/dist/client/hooks/use-global-meta.mjs +9 -30
  141. package/dist/client/hooks/use-global-schema.mjs +9 -30
  142. package/dist/client/hooks/use-global.mjs +63 -219
  143. package/dist/client/hooks/use-locks.mjs +117 -325
  144. package/dist/client/hooks/use-media-query.mjs +16 -36
  145. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  146. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  147. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  148. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  149. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  150. package/dist/client/hooks/use-saved-views.mjs +22 -103
  151. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  152. package/dist/client/hooks/use-search.mjs +31 -143
  153. package/dist/client/hooks/use-server-actions.mjs +18 -50
  154. package/dist/client/hooks/use-server-validation.mjs +72 -166
  155. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  156. package/dist/client/hooks/use-setup-status.mjs +12 -25
  157. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  158. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  159. package/dist/client/hooks/use-upload.mjs +54 -152
  160. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  161. package/dist/client/hooks/use-view-state.mjs +187 -437
  162. package/dist/client/i18n/hooks.mjs +65 -197
  163. package/dist/client/lib/render-profiler.mjs +14 -41
  164. package/dist/client/preview/block-scope-context.d.mts +2 -2
  165. package/dist/client/preview/block-scope-context.mjs +14 -36
  166. package/dist/client/preview/diff.mjs +110 -0
  167. package/dist/client/preview/preview-banner.mjs +42 -108
  168. package/dist/client/preview/preview-field.d.mts +4 -4
  169. package/dist/client/preview/preview-field.mjs +166 -409
  170. package/dist/client/preview/use-collection-preview.mjs +135 -201
  171. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  172. package/dist/client/runtime/locale-scope.mjs +22 -63
  173. package/dist/client/runtime/provider.mjs +100 -255
  174. package/dist/client/runtime/translations-provider.mjs +41 -107
  175. package/dist/client/scope/picker.d.mts +2 -2
  176. package/dist/client/scope/picker.mjs +86 -321
  177. package/dist/client/scope/provider.d.mts +2 -2
  178. package/dist/client/scope/provider.mjs +8 -17
  179. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  180. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  181. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  182. package/dist/client/views/auth/auth-layout.mjs +104 -284
  183. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  184. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  185. package/dist/client/views/auth/invite-form.mjs +107 -442
  186. package/dist/client/views/auth/login-form.d.mts +2 -2
  187. package/dist/client/views/auth/login-form.mjs +116 -337
  188. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  189. package/dist/client/views/auth/setup-form.mjs +140 -478
  190. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  191. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -400
  192. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  193. package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
  194. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  195. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  196. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  197. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  198. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  199. package/dist/client/views/collection/field-renderer.mjs +11 -24
  200. package/dist/client/views/collection/form-view.mjs +288 -560
  201. package/dist/client/views/collection/table-view.mjs +239 -469
  202. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  203. package/dist/client/views/common/global-search.mjs +241 -543
  204. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  205. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  206. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  207. package/dist/client/views/globals/global-form-view.mjs +478 -1298
  208. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  209. package/dist/client/views/layout/admin-layout.mjs +83 -246
  210. package/dist/client/views/layout/admin-router.mjs +457 -1289
  211. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  212. package/dist/client/views/layout/admin-theme.mjs +30 -64
  213. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  216. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  217. package/dist/client/views/pages/invite-page.mjs +35 -90
  218. package/dist/client/views/pages/login-page.mjs +41 -121
  219. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  220. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  221. package/dist/client/views/pages/setup-page.d.mts +2 -2
  222. package/dist/client/views/pages/setup-page.mjs +33 -95
  223. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  224. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  225. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  226. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  227. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  228. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  229. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  230. package/dist/server/modules/admin/collections/assets.d.mts +34 -34
  231. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  232. package/dist/server/modules/admin/collections/user.d.mts +53 -53
  233. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  234. package/dist/server/modules/admin/index.d.mts +21 -20
  235. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  236. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  237. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  238. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  239. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  240. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  241. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  242. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  243. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
  244. 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;
@@ -7,7 +7,6 @@ import { scopeDependencies, trackDependencies } from "../../utils/dependency-tra
7
7
  import { buildComponentProps, getFieldContext, getFieldOptions, getFullFieldName } from "./field-context.mjs";
8
8
  import { useFieldHooks } from "../../hooks/use-field-hooks.mjs";
9
9
  import { useReactiveProps } from "../../hooks/use-reactive-prop.mjs";
10
- import { c } from "react/compiler-runtime";
11
10
  import * as React from "react";
12
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
12
  import { useFormContext, useWatch } from "react-hook-form";
@@ -25,9 +24,7 @@ function renderConfigError(message) {
25
24
  children: message
26
25
  });
27
26
  }
28
- function FieldComponentSkeleton(t0) {
29
- const $ = c(3);
30
- const { type } = t0;
27
+ function FieldComponentSkeleton({ type }) {
31
28
  const largeFieldTypes = new Set([
32
29
  "blocks",
33
30
  "json",
@@ -36,25 +33,14 @@ function FieldComponentSkeleton(t0) {
36
33
  ]);
37
34
  const tallFieldTypes = new Set(["textarea", "upload"]);
38
35
  const controlClassName = largeFieldTypes.has(type ?? "") ? "h-40 w-full" : tallFieldTypes.has(type ?? "") ? "h-28 w-full" : "h-10 w-full";
39
- let t1;
40
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
41
- t1 = /* @__PURE__ */ jsx(Skeleton, {
36
+ return /* @__PURE__ */ jsxs("div", {
37
+ className: "space-y-2",
38
+ "aria-busy": "true",
39
+ children: [/* @__PURE__ */ jsx(Skeleton, {
42
40
  variant: "text",
43
41
  className: "h-4 w-24"
44
- });
45
- $[0] = t1;
46
- } else t1 = $[0];
47
- let t2;
48
- if ($[1] !== controlClassName) {
49
- t2 = /* @__PURE__ */ jsxs("div", {
50
- className: "space-y-2",
51
- "aria-busy": "true",
52
- children: [t1, /* @__PURE__ */ jsx(Skeleton, { className: controlClassName })]
53
- });
54
- $[1] = controlClassName;
55
- $[2] = t2;
56
- } else t2 = $[2];
57
- return t2;
42
+ }), /* @__PURE__ */ jsx(Skeleton, { className: controlClassName })]
43
+ });
58
44
  }
59
45
  function stripFieldUiOptions(options) {
60
46
  const rest = { ...options };
@@ -197,8 +183,6 @@ function FieldRenderer({ fieldName, fieldDef, collection, mode = "collection", r
197
183
  loadOptions: fieldOptions.loadOptions,
198
184
  staticOptions: context.options
199
185
  });
200
- if (context.isHidden) return null;
201
- if (!fieldDef) return renderConfigError(`Field "${fieldName}" not found in ${mode === "global" ? "global" : "collection"} "${collection}" config.`);
202
186
  const resolvedOptions = hookOptions ?? context.options;
203
187
  const rawComponentProps = buildComponentProps(context);
204
188
  const { props: resolvedFieldProps } = useReactiveProps({
@@ -208,8 +192,11 @@ function FieldRenderer({ fieldName, fieldDef, collection, mode = "collection", r
208
192
  props: React.useMemo(() => ({
209
193
  ...stripFieldUiOptions(getFieldOptions(fieldDef)),
210
194
  ...extraProps ?? {}
211
- }), [fieldDef, extraProps])
195
+ }), [fieldDef, extraProps]),
196
+ enabled: !context.isHidden && !!fieldDef
212
197
  });
198
+ if (context.isHidden) return null;
199
+ if (!fieldDef) return renderConfigError(`Field "${fieldName}" not found in ${mode === "global" ? "global" : "collection"} "${collection}" config.`);
213
200
  const fieldValue = isComputed ? computedValue : watchedFieldValue === void 0 ? rawComponentProps.value : watchedFieldValue;
214
201
  const componentProps = {
215
202
  ...rawComponentProps,