@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
@@ -44,7 +44,6 @@ import { useRealtimeHighlight } from "../../hooks/use-realtime-highlight.mjs";
44
44
  import { useDeleteSavedView, useSaveView, useSavedViews } from "../../hooks/use-saved-views.mjs";
45
45
  import { useViewState } from "../../hooks/use-view-state.mjs";
46
46
  import { BulkActionToolbar } from "./bulk-action-toolbar.mjs";
47
- import { c } from "react/compiler-runtime";
48
47
  import { Icon } from "@iconify/react";
49
48
  import * as React from "react";
50
49
  import { Suspense, useMemo, useState } from "react";
@@ -70,64 +69,24 @@ const REORDER_DROP_ANIMATION = {
70
69
  duration: REORDER_DROP_DURATION,
71
70
  easing: REORDER_MOVE_EASING
72
71
  };
73
- function UploadCollectionButton(t0) {
74
- const $ = c(13);
75
- const { collection, onUploaded } = t0;
72
+ function UploadCollectionButton({ collection, onUploaded }) {
76
73
  const { t } = useTranslation();
77
74
  const [open, setOpen] = React.useState(false);
78
- let t1;
79
- let t2;
80
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
81
- t1 = () => setOpen(true);
82
- t2 = /* @__PURE__ */ jsx(Icon, {
75
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Button, {
76
+ variant: "default",
77
+ size: "sm",
78
+ className: "gap-2",
79
+ onClick: () => setOpen(true),
80
+ children: [/* @__PURE__ */ jsx(Icon, {
83
81
  icon: "ph:cloud-arrow-up",
84
82
  className: "size-3.5"
85
- });
86
- $[0] = t1;
87
- $[1] = t2;
88
- } else {
89
- t1 = $[0];
90
- t2 = $[1];
91
- }
92
- let t3;
93
- if ($[2] !== t) {
94
- t3 = t("common.upload");
95
- $[2] = t;
96
- $[3] = t3;
97
- } else t3 = $[3];
98
- let t4;
99
- if ($[4] !== t3) {
100
- t4 = /* @__PURE__ */ jsxs(Button, {
101
- variant: "default",
102
- size: "sm",
103
- className: "gap-2",
104
- onClick: t1,
105
- children: [t2, t3]
106
- });
107
- $[4] = t3;
108
- $[5] = t4;
109
- } else t4 = $[5];
110
- let t5;
111
- if ($[6] !== collection || $[7] !== onUploaded || $[8] !== open) {
112
- t5 = /* @__PURE__ */ jsx(UploadCollectionSheet, {
113
- open,
114
- onOpenChange: setOpen,
115
- collection,
116
- onUploaded
117
- });
118
- $[6] = collection;
119
- $[7] = onUploaded;
120
- $[8] = open;
121
- $[9] = t5;
122
- } else t5 = $[9];
123
- let t6;
124
- if ($[10] !== t4 || $[11] !== t5) {
125
- t6 = /* @__PURE__ */ jsxs(Fragment, { children: [t4, t5] });
126
- $[10] = t4;
127
- $[11] = t5;
128
- $[12] = t6;
129
- } else t6 = $[12];
130
- return t6;
83
+ }), t("common.upload")]
84
+ }), /* @__PURE__ */ jsx(UploadCollectionSheet, {
85
+ open,
86
+ onOpenChange: setOpen,
87
+ collection,
88
+ onUploaded
89
+ })] });
131
90
  }
132
91
  function UploadCollectionSheet({ open, onOpenChange, collection, onUploaded }) {
133
92
  const { t } = useTranslation();
@@ -218,8 +177,8 @@ function UploadCollectionSheet({ open, onOpenChange, collection, onUploaded }) {
218
177
  collection,
219
178
  itemId: editAssetId,
220
179
  open: !!editAssetId,
221
- onOpenChange: (nextOpen_0) => {
222
- if (!nextOpen_0) setEditAssetId(null);
180
+ onOpenChange: (nextOpen) => {
181
+ if (!nextOpen) setEditAssetId(null);
223
182
  },
224
183
  onSave: () => {
225
184
  onUploaded?.();
@@ -328,247 +287,68 @@ function getGroupSortIndex(value, field) {
328
287
  }
329
288
  const ReorderRowContext = React.createContext(null);
330
289
  function ReorderHandle() {
331
- const $ = c(9);
332
290
  const sortable = React.useContext(ReorderRowContext);
333
- const t0 = sortable?.setActivatorNodeRef;
334
- let t1;
335
- if ($[0] !== sortable?.attributes) {
336
- t1 = sortable?.attributes ?? {};
337
- $[0] = sortable?.attributes;
338
- $[1] = t1;
339
- } else t1 = $[1];
340
- let t2;
341
- if ($[2] !== sortable?.listeners) {
342
- t2 = sortable?.listeners ?? {};
343
- $[2] = sortable?.listeners;
344
- $[3] = t2;
345
- } else t2 = $[3];
346
- let t3;
347
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
348
- t3 = /* @__PURE__ */ jsx(Icon, {
291
+ return /* @__PURE__ */ jsx("button", {
292
+ type: "button",
293
+ ref: sortable?.setActivatorNodeRef,
294
+ className: "text-muted-foreground/50 hover:text-muted-foreground focus-visible:ring-ring/40 flex h-8 w-full cursor-grab touch-none items-center justify-center rounded-md transition-colors select-none focus-visible:ring-2 focus-visible:outline-none active:cursor-grabbing",
295
+ "aria-label": "Drag to reorder",
296
+ ...sortable?.attributes ?? {},
297
+ ...sortable?.listeners ?? {},
298
+ children: /* @__PURE__ */ jsx(Icon, {
349
299
  icon: "ph:dots-six-vertical",
350
300
  className: "size-3.5"
351
- });
352
- $[4] = t3;
353
- } else t3 = $[4];
354
- let t4;
355
- if ($[5] !== t0 || $[6] !== t1 || $[7] !== t2) {
356
- t4 = /* @__PURE__ */ jsx("button", {
357
- type: "button",
358
- ref: t0,
359
- className: "text-muted-foreground/50 hover:text-muted-foreground focus-visible:ring-ring/40 flex h-8 w-full cursor-grab touch-none items-center justify-center rounded-md transition-colors select-none focus-visible:ring-2 focus-visible:outline-none active:cursor-grabbing",
360
- "aria-label": "Drag to reorder",
361
- ...t1,
362
- ...t2,
363
- children: t3
364
- });
365
- $[5] = t0;
366
- $[6] = t1;
367
- $[7] = t2;
368
- $[8] = t4;
369
- } else t4 = $[8];
370
- return t4;
301
+ })
302
+ });
371
303
  }
372
- function ReorderDragOverlay(t0) {
373
- const $ = c(24);
374
- const { row, columns, rect } = t0;
304
+ function ReorderDragOverlay({ row, columns, rect }) {
375
305
  if (!row) return null;
376
- let t1;
377
- let t2;
378
- let t3;
379
- let t4;
380
- let t5;
381
- if ($[0] !== columns || $[1] !== rect?.height || $[2] !== rect?.width || $[3] !== row) {
382
- const cells = row.getVisibleCells?.() ?? [];
383
- t4 = "bg-background text-foreground ring-border-strong pointer-events-none overflow-hidden rounded-md shadow-xl ring-1";
384
- const t6$1 = rect?.width;
385
- const t7$1 = rect?.height;
386
- if ($[9] !== t6$1 || $[10] !== t7$1) {
387
- t5 = {
388
- width: t6$1,
389
- height: t7$1
390
- };
391
- $[9] = t6$1;
392
- $[10] = t7$1;
393
- $[11] = t5;
394
- } else t5 = $[11];
395
- t1 = "grid h-full items-center";
396
- let t8;
397
- if ($[12] !== columns) {
398
- t8 = columns.map(_temp3).join(" ");
399
- $[12] = columns;
400
- $[13] = t8;
401
- } else t8 = $[13];
402
- if ($[14] !== t8) {
403
- t2 = { gridTemplateColumns: t8 };
404
- $[14] = t8;
405
- $[15] = t2;
406
- } else t2 = $[15];
407
- t3 = cells.map(_temp4);
408
- $[0] = columns;
409
- $[1] = rect?.height;
410
- $[2] = rect?.width;
411
- $[3] = row;
412
- $[4] = t1;
413
- $[5] = t2;
414
- $[6] = t3;
415
- $[7] = t4;
416
- $[8] = t5;
417
- } else {
418
- t1 = $[4];
419
- t2 = $[5];
420
- t3 = $[6];
421
- t4 = $[7];
422
- t5 = $[8];
423
- }
424
- let t6;
425
- if ($[16] !== t1 || $[17] !== t2 || $[18] !== t3) {
426
- t6 = /* @__PURE__ */ jsx("div", {
427
- className: t1,
428
- style: t2,
429
- children: t3
430
- });
431
- $[16] = t1;
432
- $[17] = t2;
433
- $[18] = t3;
434
- $[19] = t6;
435
- } else t6 = $[19];
436
- let t7;
437
- if ($[20] !== t4 || $[21] !== t5 || $[22] !== t6) {
438
- t7 = /* @__PURE__ */ jsx("div", {
439
- className: t4,
440
- style: t5,
441
- children: t6
442
- });
443
- $[20] = t4;
444
- $[21] = t5;
445
- $[22] = t6;
446
- $[23] = t7;
447
- } else t7 = $[23];
448
- return t7;
449
- }
450
- function _temp4(cell, index) {
306
+ const cells = row.getVisibleCells?.() ?? [];
451
307
  return /* @__PURE__ */ jsx("div", {
452
- className: cn("min-w-0 truncate px-3 py-1.5 text-sm whitespace-nowrap tabular-nums", index === 0 && "px-1.5 text-center"),
453
- children: index === 0 ? /* @__PURE__ */ jsx(Icon, {
454
- icon: "ph:dots-six-vertical",
455
- className: "text-muted-foreground mx-auto size-3.5"
456
- }) : flexRender(cell.column.columnDef.cell, cell.getContext())
457
- }, cell.id);
458
- }
459
- function _temp3(column) {
460
- return `${getColumnSize(column, 120)}px`;
308
+ className: "bg-background text-foreground ring-border-strong pointer-events-none overflow-hidden rounded-md shadow-xl ring-1",
309
+ style: {
310
+ width: rect?.width,
311
+ height: rect?.height
312
+ },
313
+ children: /* @__PURE__ */ jsx("div", {
314
+ className: "grid h-full items-center",
315
+ style: { gridTemplateColumns: columns.map((column) => `${getColumnSize(column, 120)}px`).join(" ") },
316
+ children: cells.map((cell, index) => /* @__PURE__ */ jsx("div", {
317
+ className: cn("min-w-0 truncate px-3 py-1.5 text-sm whitespace-nowrap tabular-nums", index === 0 && "px-1.5 text-center"),
318
+ children: index === 0 ? /* @__PURE__ */ jsx(Icon, {
319
+ icon: "ph:dots-six-vertical",
320
+ className: "text-muted-foreground mx-auto size-3.5"
321
+ }) : flexRender(cell.column.columnDef.cell, cell.getContext())
322
+ }, cell.id))
323
+ })
324
+ });
461
325
  }
462
- function SortableTableRow(t0) {
463
- const $ = c(33);
464
- let children;
465
- let className;
466
- let id;
467
- let props;
468
- if ($[0] !== t0) {
469
- ({id, className, children, ...props} = t0);
470
- $[0] = t0;
471
- $[1] = children;
472
- $[2] = className;
473
- $[3] = id;
474
- $[4] = props;
475
- } else {
476
- children = $[1];
477
- className = $[2];
478
- id = $[3];
479
- props = $[4];
480
- }
481
- let t1;
482
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
483
- t1 = {
326
+ function SortableTableRow({ id, className, children, ...props }) {
327
+ const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable({
328
+ id,
329
+ transition: {
484
330
  duration: REORDER_DROP_DURATION,
485
331
  easing: REORDER_MOVE_EASING
486
- };
487
- $[5] = t1;
488
- } else t1 = $[5];
489
- let t2;
490
- if ($[6] !== id) {
491
- t2 = {
492
- id,
493
- transition: t1
494
- };
495
- $[6] = id;
496
- $[7] = t2;
497
- } else t2 = $[7];
498
- const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable(t2);
499
- const t3 = isDragging && "bg-muted/[0.18] opacity-35";
500
- let t4;
501
- if ($[8] !== className || $[9] !== t3) {
502
- t4 = cn("select-none", t3, className);
503
- $[8] = className;
504
- $[9] = t3;
505
- $[10] = t4;
506
- } else t4 = $[10];
507
- let t5;
508
- if ($[11] !== isDragging || $[12] !== transform) {
509
- t5 = isDragging ? void 0 : CSS.Transform.toString(transform);
510
- $[11] = isDragging;
511
- $[12] = transform;
512
- $[13] = t5;
513
- } else t5 = $[13];
514
- const t6 = isDragging ? void 0 : transition;
515
- let t7;
516
- if ($[14] !== props.style) {
517
- t7 = props.style ?? {};
518
- $[14] = props.style;
519
- $[15] = t7;
520
- } else t7 = $[15];
521
- let t8;
522
- if ($[16] !== t5 || $[17] !== t6 || $[18] !== t7) {
523
- t8 = {
524
- transform: t5,
525
- transition: t6,
526
- ...t7
527
- };
528
- $[16] = t5;
529
- $[17] = t6;
530
- $[18] = t7;
531
- $[19] = t8;
532
- } else t8 = $[19];
533
- let t9;
534
- if ($[20] !== attributes || $[21] !== listeners || $[22] !== setActivatorNodeRef) {
535
- t9 = {
536
- attributes,
537
- listeners,
538
- setActivatorNodeRef
539
- };
540
- $[20] = attributes;
541
- $[21] = listeners;
542
- $[22] = setActivatorNodeRef;
543
- $[23] = t9;
544
- } else t9 = $[23];
545
- let t10;
546
- if ($[24] !== children || $[25] !== t9) {
547
- t10 = /* @__PURE__ */ jsx(ReorderRowContext.Provider, {
548
- value: t9,
332
+ }
333
+ });
334
+ return /* @__PURE__ */ jsx(TableRow, {
335
+ ref: setNodeRef,
336
+ className: cn("select-none", isDragging && "bg-muted/[0.18] opacity-35", className),
337
+ style: {
338
+ transform: isDragging ? void 0 : CSS.Transform.toString(transform),
339
+ transition: isDragging ? void 0 : transition,
340
+ ...props.style ?? {}
341
+ },
342
+ ...props,
343
+ children: /* @__PURE__ */ jsx(ReorderRowContext.Provider, {
344
+ value: {
345
+ attributes,
346
+ listeners,
347
+ setActivatorNodeRef
348
+ },
549
349
  children
550
- });
551
- $[24] = children;
552
- $[25] = t9;
553
- $[26] = t10;
554
- } else t10 = $[26];
555
- let t11;
556
- if ($[27] !== props || $[28] !== setNodeRef || $[29] !== t10 || $[30] !== t4 || $[31] !== t8) {
557
- t11 = /* @__PURE__ */ jsx(TableRow, {
558
- ref: setNodeRef,
559
- className: t4,
560
- style: t8,
561
- ...props,
562
- children: t10
563
- });
564
- $[27] = props;
565
- $[28] = setNodeRef;
566
- $[29] = t10;
567
- $[30] = t4;
568
- $[31] = t8;
569
- $[32] = t11;
570
- } else t11 = $[32];
571
- return t11;
350
+ })
351
+ });
572
352
  }
573
353
  /**
574
354
  * TableView - Default table-based list view for collections
@@ -597,22 +377,10 @@ function SortableTableRow(t0) {
597
377
  * ```
598
378
  */
599
379
  function TableView(props) {
600
- const $ = c(3);
601
- let t0;
602
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
603
- t0 = /* @__PURE__ */ jsx(TableViewSkeleton, {});
604
- $[0] = t0;
605
- } else t0 = $[0];
606
- let t1;
607
- if ($[1] !== props) {
608
- t1 = /* @__PURE__ */ jsx(Suspense, {
609
- fallback: t0,
610
- children: /* @__PURE__ */ jsx(TableViewInner, { ...props })
611
- });
612
- $[1] = props;
613
- $[2] = t1;
614
- } else t1 = $[2];
615
- return t1;
380
+ return /* @__PURE__ */ jsx(Suspense, {
381
+ fallback: /* @__PURE__ */ jsx(TableViewSkeleton, {}),
382
+ children: /* @__PURE__ */ jsx(TableViewInner, { ...props })
383
+ });
616
384
  }
617
385
  /**
618
386
  * Inner component that uses Suspense queries.
@@ -744,41 +512,41 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
744
512
  if (Array.isArray(val)) return val.length === 0;
745
513
  return false;
746
514
  };
747
- const normalizeSelectValue = (val_0, fieldOptions) => {
515
+ const normalizeSelectValue = (val, fieldOptions) => {
748
516
  const optionsList = fieldOptions?.options;
749
- if (!optionsList) return val_0;
517
+ if (!optionsList) return val;
750
518
  const map = new Map(flattenOptions(optionsList).map((opt) => [String(opt.value), opt.value]));
751
519
  const mapValue = (item) => map.get(String(item)) ?? item;
752
- if (Array.isArray(val_0)) return val_0.map(mapValue);
753
- if (val_0 === void 0 || val_0 === null) return val_0;
754
- return mapValue(val_0);
520
+ if (Array.isArray(val)) return val.map(mapValue);
521
+ if (val === void 0 || val === null) return val;
522
+ return mapValue(val);
755
523
  };
756
- const coerceValue = (val_1, fieldDef) => {
757
- if (!fieldDef) return val_1;
524
+ const coerceValue = (val, fieldDef) => {
525
+ if (!fieldDef) return val;
758
526
  const fieldType = fieldDef?.name ?? "text";
759
- const fieldOptions_0 = fieldDef?.["~options"] ?? {};
760
- if (fieldType === "number" && typeof val_1 === "string") {
761
- const parsed = Number(val_1);
762
- return Number.isNaN(parsed) ? val_1 : parsed;
527
+ const fieldOptions = fieldDef?.["~options"] ?? {};
528
+ if (fieldType === "number" && typeof val === "string") {
529
+ const parsed = Number(val);
530
+ return Number.isNaN(parsed) ? val : parsed;
763
531
  }
764
- if ((fieldType === "checkbox" || fieldType === "switch") && typeof val_1 === "string") {
765
- if (val_1 === "true") return true;
766
- if (val_1 === "false") return false;
532
+ if ((fieldType === "checkbox" || fieldType === "switch") && typeof val === "string") {
533
+ if (val === "true") return true;
534
+ if (val === "false") return false;
767
535
  }
768
- if (fieldType === "select") return normalizeSelectValue(val_1, fieldOptions_0);
769
- return val_1;
536
+ if (fieldType === "select") return normalizeSelectValue(val, fieldOptions);
537
+ return val;
770
538
  };
771
- const toArray = (val_2) => {
772
- if (Array.isArray(val_2)) return val_2;
773
- if (val_2 === void 0 || val_2 === null || val_2 === "") return [];
774
- return [val_2];
539
+ const toArray = (val) => {
540
+ if (Array.isArray(val)) return val;
541
+ if (val === void 0 || val === null || val === "") return [];
542
+ return [val];
775
543
  };
776
- const buildRelationCondition = (operator, val_3, relationType) => {
544
+ const buildRelationCondition = (operator, val, relationType) => {
777
545
  const isMultiple = relationType === "multiple";
778
- const ids = toArray(val_3);
546
+ const ids = toArray(val);
779
547
  switch (operator) {
780
- case "equals": return isMultiple ? { some: { id: val_3 } } : { is: { id: val_3 } };
781
- case "not_equals": return isMultiple ? { none: { id: val_3 } } : { isNot: { id: val_3 } };
548
+ case "equals": return isMultiple ? { some: { id: val } } : { is: { id: val } };
549
+ case "not_equals": return isMultiple ? { none: { id: val } } : { isNot: { id: val } };
782
550
  case "in": return isMultiple ? { some: { id: { in: ids } } } : { is: { id: { in: ids } } };
783
551
  case "not_in": return isMultiple ? { none: { id: { in: ids } } } : { isNot: { id: { in: ids } } };
784
552
  case "some": return { some: { id: { in: ids } } };
@@ -790,63 +558,63 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
790
558
  }
791
559
  };
792
560
  for (const filter of viewState.config.filters) {
793
- const { field: field_0, operator: operator_0, value } = filter;
794
- if (!field_0 || field_0 === "_title") continue;
795
- const fieldDef_0 = resolvedFields?.[field_0];
796
- const fieldType_0 = fieldDef_0?.name ?? "text";
797
- const fieldOptions_1 = fieldDef_0?.["~options"] ?? {};
798
- const relationName = fieldType_0 === "relation" ? fieldOptions_1.relationName ?? field_0 : void 0;
561
+ const { field, operator, value } = filter;
562
+ if (!field || field === "_title") continue;
563
+ const fieldDef = resolvedFields?.[field];
564
+ const fieldType = fieldDef?.name ?? "text";
565
+ const fieldOptions = fieldDef?.["~options"] ?? {};
566
+ const relationName = fieldType === "relation" ? fieldOptions.relationName ?? field : void 0;
799
567
  const hasRelation = relationName && (relationNames.length === 0 || relationNames.includes(relationName));
800
- const isRelationField = fieldType_0 === "relation" && !!hasRelation;
801
- if (operator_0 !== "is_empty" && operator_0 !== "is_not_empty" && isEmptyValue(value)) continue;
802
- const normalizedValue = coerceValue(value, fieldDef_0);
568
+ const isRelationField = fieldType === "relation" && !!hasRelation;
569
+ if (operator !== "is_empty" && operator !== "is_not_empty" && isEmptyValue(value)) continue;
570
+ const normalizedValue = coerceValue(value, fieldDef);
803
571
  if (isRelationField && relationName) {
804
- const condition = buildRelationCondition(operator_0, normalizedValue, fieldOptions_1.type === "multiple" ? "multiple" : "single");
572
+ const condition = buildRelationCondition(operator, normalizedValue, fieldOptions.type === "multiple" ? "multiple" : "single");
805
573
  if (condition) whereConditions[relationName] = condition;
806
574
  continue;
807
575
  }
808
- switch (operator_0) {
576
+ switch (operator) {
809
577
  case "equals":
810
- whereConditions[field_0] = normalizedValue;
578
+ whereConditions[field] = normalizedValue;
811
579
  break;
812
580
  case "not_equals":
813
- whereConditions[field_0] = { ne: normalizedValue };
581
+ whereConditions[field] = { ne: normalizedValue };
814
582
  break;
815
583
  case "contains":
816
- whereConditions[field_0] = { contains: normalizedValue };
584
+ whereConditions[field] = { contains: normalizedValue };
817
585
  break;
818
586
  case "not_contains":
819
- whereConditions[field_0] = { notIlike: `%${normalizedValue}%` };
587
+ whereConditions[field] = { notIlike: `%${normalizedValue}%` };
820
588
  break;
821
589
  case "starts_with":
822
- whereConditions[field_0] = { startsWith: normalizedValue };
590
+ whereConditions[field] = { startsWith: normalizedValue };
823
591
  break;
824
592
  case "ends_with":
825
- whereConditions[field_0] = { endsWith: normalizedValue };
593
+ whereConditions[field] = { endsWith: normalizedValue };
826
594
  break;
827
595
  case "greater_than":
828
- whereConditions[field_0] = { gt: normalizedValue };
596
+ whereConditions[field] = { gt: normalizedValue };
829
597
  break;
830
598
  case "less_than":
831
- whereConditions[field_0] = { lt: normalizedValue };
599
+ whereConditions[field] = { lt: normalizedValue };
832
600
  break;
833
601
  case "greater_than_or_equal":
834
- whereConditions[field_0] = { gte: normalizedValue };
602
+ whereConditions[field] = { gte: normalizedValue };
835
603
  break;
836
604
  case "less_than_or_equal":
837
- whereConditions[field_0] = { lte: normalizedValue };
605
+ whereConditions[field] = { lte: normalizedValue };
838
606
  break;
839
607
  case "in":
840
- whereConditions[field_0] = { in: Array.isArray(normalizedValue) ? normalizedValue : [normalizedValue] };
608
+ whereConditions[field] = { in: Array.isArray(normalizedValue) ? normalizedValue : [normalizedValue] };
841
609
  break;
842
610
  case "not_in":
843
- whereConditions[field_0] = { notIn: Array.isArray(normalizedValue) ? normalizedValue : [normalizedValue] };
611
+ whereConditions[field] = { notIn: Array.isArray(normalizedValue) ? normalizedValue : [normalizedValue] };
844
612
  break;
845
613
  case "is_empty":
846
- whereConditions[field_0] = { isNull: true };
614
+ whereConditions[field] = { isNull: true };
847
615
  break;
848
616
  case "is_not_empty":
849
- whereConditions[field_0] = { isNotNull: true };
617
+ whereConditions[field] = { isNotNull: true };
850
618
  break;
851
619
  }
852
620
  }
@@ -898,12 +666,12 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
898
666
  const groupableNames = groupingConfig?.fields ?? [];
899
667
  if (groupableNames.length === 0) return [];
900
668
  const groupableSet = new Set(groupableNames);
901
- return availableFields.filter((field_1) => groupableSet.has(field_1.name));
669
+ return availableFields.filter((field) => groupableSet.has(field.name));
902
670
  }, [availableFields, groupingConfig?.fields]);
903
671
  const visibleColumnDefs = useMemo(() => {
904
672
  const selectCol = {
905
673
  id: "_select",
906
- header: ({ table: t_0 }) => {
674
+ header: ({ table: t$1 }) => {
907
675
  if (isReorderMode) return /* @__PURE__ */ jsx("div", {
908
676
  className: "text-muted-foreground/60 flex h-8 items-center justify-center",
909
677
  title: "Order",
@@ -913,16 +681,16 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
913
681
  className: "size-3.5"
914
682
  })
915
683
  });
916
- const isAllSelected = t_0.getIsAllPageRowsSelected();
917
- const isSomeSelected = t_0.getIsSomePageRowsSelected();
684
+ const isAllSelected = t$1.getIsAllPageRowsSelected();
685
+ const isSomeSelected = t$1.getIsSomePageRowsSelected();
918
686
  return /* @__PURE__ */ jsx("div", {
919
687
  role: "presentation",
920
688
  onClick: (e) => e.stopPropagation(),
921
- onKeyDown: (e_0) => e_0.stopPropagation(),
689
+ onKeyDown: (e) => e.stopPropagation(),
922
690
  children: /* @__PURE__ */ jsx(Checkbox, {
923
691
  checked: isAllSelected,
924
692
  indeterminate: !isAllSelected && isSomeSelected,
925
- onCheckedChange: (checked) => t_0.toggleAllPageRowsSelected(!!checked),
693
+ onCheckedChange: (checked) => t$1.toggleAllPageRowsSelected(!!checked),
926
694
  "aria-label": "Select all"
927
695
  })
928
696
  });
@@ -931,12 +699,12 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
931
699
  if (isReorderMode) return /* @__PURE__ */ jsx(ReorderHandle, {});
932
700
  return /* @__PURE__ */ jsx("div", {
933
701
  role: "presentation",
934
- onClick: (e_1) => e_1.stopPropagation(),
935
- onKeyDown: (e_2) => e_2.stopPropagation(),
702
+ onClick: (e) => e.stopPropagation(),
703
+ onKeyDown: (e) => e.stopPropagation(),
936
704
  children: /* @__PURE__ */ jsx(Checkbox, {
937
705
  checked: row.getIsSelected(),
938
706
  disabled: !row.getCanSelect(),
939
- onCheckedChange: (checked_0) => row.toggleSelected(!!checked_0),
707
+ onCheckedChange: (checked) => row.toggleSelected(!!checked),
940
708
  "aria-label": "Select row"
941
709
  })
942
710
  });
@@ -948,13 +716,13 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
948
716
  const titleFieldName = collectionMeta?.title?.fieldName;
949
717
  const titleColName = collectionMeta?.title?.type === "field" && titleFieldName ? titleFieldName : "_title";
950
718
  const orderedColumns = [selectCol];
951
- const titleCol = columns.find((c$1) => c$1.accessorKey === titleColName || c$1.id === titleColName);
719
+ const titleCol = columns.find((c) => c.accessorKey === titleColName || c.id === titleColName);
952
720
  if (titleCol) orderedColumns.push(titleCol);
953
- const columnsToShow = viewState.config.visibleColumns.length > 0 ? viewState.config.visibleColumns : defaultColumns.length > 0 ? defaultColumns : columns.map((c_0) => c_0.accessorKey || c_0.id).filter(Boolean);
721
+ const columnsToShow = viewState.config.visibleColumns.length > 0 ? viewState.config.visibleColumns : defaultColumns.length > 0 ? defaultColumns : columns.map((c) => c.accessorKey || c.id).filter(Boolean);
954
722
  const columnMap = /* @__PURE__ */ new Map();
955
- for (const c_1 of columns) {
956
- const key = c_1.accessorKey || c_1.id;
957
- if (key) columnMap.set(key, c_1);
723
+ for (const c of columns) {
724
+ const key = c.accessorKey || c.id;
725
+ if (key) columnMap.set(key, c);
958
726
  }
959
727
  for (const colName of columnsToShow) {
960
728
  if (colName === titleColName) continue;
@@ -967,19 +735,19 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
967
735
  className: "sr-only",
968
736
  children: t("common.actions")
969
737
  }),
970
- cell: ({ row: row_0 }) => /* @__PURE__ */ jsx("div", {
738
+ cell: ({ row }) => /* @__PURE__ */ jsx("div", {
971
739
  role: "presentation",
972
740
  className: "flex justify-end gap-1",
973
741
  onClick: (event) => event.stopPropagation(),
974
- onKeyDown: (event_0) => event_0.stopPropagation(),
742
+ onKeyDown: (event) => event.stopPropagation(),
975
743
  children: actions.row.map((action) => /* @__PURE__ */ jsx(ActionButton, {
976
744
  action,
977
745
  collection,
978
- item: row_0.original,
746
+ item: row.original,
979
747
  helpers: actionHelpers,
980
748
  size: "icon-sm",
981
749
  iconOnly: true,
982
- onOpenDialog: (dialogAction_0) => openDialog(dialogAction_0, row_0.original)
750
+ onOpenDialog: (dialogAction$1) => openDialog(dialogAction$1, row.original)
983
751
  }, action.id))
984
752
  }),
985
753
  size: 72,
@@ -1037,26 +805,26 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1037
805
  return;
1038
806
  }
1039
807
  setOptimisticOrderIds((current) => {
1040
- const itemIds = items.map((item_0) => String(item_0.id));
808
+ const itemIds = items.map((item) => String(item.id));
1041
809
  if (!current) return itemIds;
1042
810
  const knownIds = new Set(itemIds);
1043
811
  const next = current.filter((id) => knownIds.has(id));
1044
- for (const id_0 of itemIds) if (!next.includes(id_0)) next.push(id_0);
812
+ for (const id of itemIds) if (!next.includes(id)) next.push(id);
1045
813
  return next;
1046
814
  });
1047
815
  }, [isReorderMode, items]);
1048
816
  const filteredItems = useMemo(() => {
1049
817
  if (!isReorderMode || !optimisticOrderIds) return items;
1050
- const itemsById = new Map(items.map((item_1) => [String(item_1.id), item_1]));
818
+ const itemsById = new Map(items.map((item) => [String(item.id), item]));
1051
819
  const seen = /* @__PURE__ */ new Set();
1052
- const ordered = optimisticOrderIds.map((id_1) => {
1053
- const item_2 = itemsById.get(id_1);
1054
- if (item_2) seen.add(id_1);
1055
- return item_2;
820
+ const ordered = optimisticOrderIds.map((id) => {
821
+ const item = itemsById.get(id);
822
+ if (item) seen.add(id);
823
+ return item;
1056
824
  }).filter(Boolean);
1057
- for (const item_3 of items) {
1058
- const id_2 = String(item_3.id);
1059
- if (!seen.has(id_2)) ordered.push(item_3);
825
+ for (const item of items) {
826
+ const id = String(item.id);
827
+ if (!seen.has(id)) ordered.push(item);
1060
828
  }
1061
829
  return ordered;
1062
830
  }, [
@@ -1111,7 +879,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1111
879
  onSortingChange: handleSortingChange,
1112
880
  enableRowSelection: true,
1113
881
  onRowSelectionChange: setRowSelection,
1114
- getRowId: (row_1) => row_1.id,
882
+ getRowId: (row) => row.id,
1115
883
  state: {
1116
884
  sorting,
1117
885
  rowSelection
@@ -1121,31 +889,31 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1121
889
  const visibleLeafColumns = table.getVisibleLeafColumns();
1122
890
  const selectColumnWidth = getColumnSize(visibleLeafColumns[0], 40);
1123
891
  const titleColumnWidth = getColumnSize(visibleLeafColumns[1], 360);
1124
- const sortableRowIds = useMemo(() => tableRows.map((row_2) => String(row_2.id)), [tableRows]);
1125
- const activeReorderRow = useMemo(() => activeReorderId ? tableRows.find((row_3) => String(row_3.id) === activeReorderId) : null, [activeReorderId, tableRows]);
892
+ const sortableRowIds = useMemo(() => tableRows.map((row) => String(row.id)), [tableRows]);
893
+ const activeReorderRow = useMemo(() => activeReorderId ? tableRows.find((row) => String(row.id) === activeReorderId) : null, [activeReorderId, tableRows]);
1126
894
  const reorderSensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 4 } }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
1127
- const handleReorderDragStart = React.useCallback((event_1) => {
1128
- const initialRect = event_1.active.rect.current.initial;
895
+ const handleReorderDragStart = React.useCallback((event) => {
896
+ const initialRect = event.active.rect.current.initial;
1129
897
  clearReorderOverlay();
1130
898
  reorderStartOrderIdsRef.current = sortableRowIds;
1131
- setActiveReorderId(String(event_1.active.id));
899
+ setActiveReorderId(String(event.active.id));
1132
900
  setActiveReorderRect(initialRect ? {
1133
901
  width: initialRect.width,
1134
902
  height: initialRect.height
1135
903
  } : null);
1136
- setOptimisticOrderIds((current_0) => current_0 ?? sortableRowIds);
904
+ setOptimisticOrderIds((current) => current ?? sortableRowIds);
1137
905
  }, [clearReorderOverlay, sortableRowIds]);
1138
906
  const handleReorderDragCancel = React.useCallback(() => {
1139
907
  setOptimisticOrderIds(reorderStartOrderIdsRef.current);
1140
908
  clearReorderOverlay();
1141
909
  reorderStartOrderIdsRef.current = null;
1142
910
  }, [clearReorderOverlay]);
1143
- const handleReorderDragEnd = React.useCallback(async (event_2) => {
911
+ const handleReorderDragEnd = React.useCallback(async (event) => {
1144
912
  if (updateBatchMutation.isPending) {
1145
913
  clearReorderOverlay();
1146
914
  return;
1147
915
  }
1148
- const { active: active_0, over } = event_2;
916
+ const { active, over } = event;
1149
917
  const previousOrderIds = reorderStartOrderIdsRef.current ?? sortableRowIds;
1150
918
  reorderStartOrderIdsRef.current = null;
1151
919
  if (!over) {
@@ -1154,8 +922,8 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1154
922
  return;
1155
923
  }
1156
924
  let nextOrderIds = previousOrderIds;
1157
- if (active_0.id !== over.id) {
1158
- const oldIndex = previousOrderIds.indexOf(String(active_0.id));
925
+ if (active.id !== over.id) {
926
+ const oldIndex = previousOrderIds.indexOf(String(active.id));
1159
927
  const newIndex = previousOrderIds.indexOf(String(over.id));
1160
928
  if (oldIndex === -1 || newIndex === -1 || oldIndex === newIndex) {
1161
929
  clearReorderOverlay(REORDER_DROP_DURATION);
@@ -1169,11 +937,11 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1169
937
  }
1170
938
  setOptimisticOrderIds(nextOrderIds);
1171
939
  clearReorderOverlay(REORDER_DROP_DURATION);
1172
- const rowsById = new Map(tableRows.map((row_4) => [String(row_4.id), row_4]));
1173
- const reorderedRows = nextOrderIds.map((id_3) => rowsById.get(id_3)).filter((row_5) => !!row_5);
940
+ const rowsById = new Map(tableRows.map((row) => [String(row.id), row]));
941
+ const reorderedRows = nextOrderIds.map((id) => rowsById.get(id)).filter((row) => !!row);
1174
942
  try {
1175
- await updateBatchMutation.mutateAsync({ updates: reorderedRows.map((row_6, index) => ({
1176
- id: String(row_6.id),
943
+ await updateBatchMutation.mutateAsync({ updates: reorderedRows.map((row, index) => ({
944
+ id: String(row.id),
1177
945
  data: { [orderField]: (index + 1) * orderStep }
1178
946
  })) });
1179
947
  actionHelpers.toast.success(t("collection.orderSaved"));
@@ -1194,59 +962,59 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1194
962
  ]);
1195
963
  const groupedRowModel = useMemo(() => {
1196
964
  const rows = tableRows;
1197
- const groupBy_0 = viewState.config.groupBy;
1198
- if (!groupBy_0) return rows.map((row_7) => ({
965
+ const groupBy = viewState.config.groupBy;
966
+ if (!groupBy) return rows.map((row) => ({
1199
967
  type: "row",
1200
- row: row_7
968
+ row
1201
969
  }));
1202
- const groupField = groupableFields.find((field_2) => field_2.name === groupBy_0);
970
+ const groupField = groupableFields.find((field) => field.name === groupBy);
1203
971
  const collapsedGroups = new Set(viewState.config.collapsedGroups ?? []);
1204
972
  const serverGroups = !isSearching ? listData?.groups : void 0;
1205
973
  if (serverGroups?.length) {
1206
- const rowsById_0 = new Map(rows.map((row_8) => [row_8.id, row_8]));
974
+ const rowsById = new Map(rows.map((row) => [row.id, row]));
1207
975
  return serverGroups.flatMap((group) => {
1208
976
  const label = stringifyGroupValue(group.value, groupField, resolveText, t, uiLocale, t("common.noValue"));
1209
- const groupKey = `${groupBy_0}:${label}`;
977
+ const groupKey = `${groupBy}:${label}`;
1210
978
  const collapsed = collapsedGroups.has(groupKey);
1211
- const groupRows = (group.docs ?? []).map((doc) => rowsById_0.get(String(doc.id))).filter(Boolean);
979
+ const groupRows = (group.docs ?? []).map((doc) => rowsById.get(String(doc.id))).filter(Boolean);
1212
980
  return [{
1213
981
  type: "group",
1214
982
  key: groupKey,
1215
983
  label,
1216
984
  count: group.count,
1217
985
  collapsed
1218
- }, ...collapsed ? [] : groupRows.map((row_9) => ({
986
+ }, ...collapsed ? [] : groupRows.map((row) => ({
1219
987
  type: "row",
1220
- row: row_9
988
+ row
1221
989
  }))];
1222
990
  });
1223
991
  }
1224
992
  const groups = /* @__PURE__ */ new Map();
1225
- for (const row_10 of rows) {
1226
- const valueLabel = stringifyGroupValue(row_10.original?.[groupBy_0], groupField, resolveText, t, uiLocale, t("common.noValue"));
1227
- const groupKey_0 = `${groupBy_0}:${valueLabel}`;
1228
- const group_0 = groups.get(groupKey_0);
1229
- if (group_0) {
1230
- group_0.rows.push(row_10);
993
+ for (const row of rows) {
994
+ const valueLabel = stringifyGroupValue(row.original?.[groupBy], groupField, resolveText, t, uiLocale, t("common.noValue"));
995
+ const groupKey = `${groupBy}:${valueLabel}`;
996
+ const group = groups.get(groupKey);
997
+ if (group) {
998
+ group.rows.push(row);
1231
999
  continue;
1232
1000
  }
1233
- groups.set(groupKey_0, {
1001
+ groups.set(groupKey, {
1234
1002
  label: valueLabel,
1235
- rows: [row_10],
1236
- sortIndex: getGroupSortIndex(row_10.original?.[groupBy_0], groupField)
1003
+ rows: [row],
1004
+ sortIndex: getGroupSortIndex(row.original?.[groupBy], groupField)
1237
1005
  });
1238
1006
  }
1239
- return Array.from(groups.entries()).sort(([, a], [, b]) => a.sortIndex - b.sortIndex).flatMap(([key_0, group_1]) => {
1240
- const collapsed_0 = collapsedGroups.has(key_0);
1007
+ return Array.from(groups.entries()).sort(([, a], [, b]) => a.sortIndex - b.sortIndex).flatMap(([key, group]) => {
1008
+ const collapsed = collapsedGroups.has(key);
1241
1009
  return [{
1242
1010
  type: "group",
1243
- key: key_0,
1244
- label: group_1.label,
1245
- count: group_1.rows.length,
1246
- collapsed: collapsed_0
1247
- }, ...collapsed_0 ? [] : group_1.rows.map((row_11) => ({
1011
+ key,
1012
+ label: group.label,
1013
+ count: group.rows.length,
1014
+ collapsed
1015
+ }, ...collapsed ? [] : group.rows.map((row) => ({
1248
1016
  type: "row",
1249
- row: row_11
1017
+ row
1250
1018
  }))];
1251
1019
  });
1252
1020
  }, [
@@ -1260,22 +1028,22 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1260
1028
  t,
1261
1029
  uiLocale
1262
1030
  ]);
1263
- const handleSaveView = (name, config_0) => {
1031
+ const handleSaveView = (name, config$1) => {
1264
1032
  saveViewMutation.mutate({
1265
1033
  name,
1266
- configuration: config_0
1034
+ configuration: config$1
1267
1035
  });
1268
1036
  };
1269
1037
  const handleDeleteView = (viewId) => {
1270
1038
  deleteViewMutation.mutate(viewId);
1271
1039
  };
1272
- const handleRowClick = (item_4) => {
1273
- navigate(`${basePath}/collections/${collection}/${item_4.id}`);
1040
+ const handleRowClick = (item) => {
1041
+ navigate(`${basePath}/collections/${collection}/${item.id}`);
1274
1042
  };
1275
- const handleBulkDelete = React.useCallback(async (ids_0) => {
1276
- const results = await Promise.allSettled(ids_0.map((id_4) => deleteMutation.mutateAsync({ id: id_4 })));
1043
+ const handleBulkDelete = React.useCallback(async (ids) => {
1044
+ const results = await Promise.allSettled(ids.map((id) => deleteMutation.mutateAsync({ id })));
1277
1045
  const successCount = results.filter((r) => r.status === "fulfilled").length;
1278
- const failCount = results.filter((r_0) => r_0.status === "rejected").length;
1046
+ const failCount = results.filter((r) => r.status === "rejected").length;
1279
1047
  if (failCount === 0) actionHelpers.toast.success(t("collection.bulkDeleteSuccess", { count: successCount }));
1280
1048
  else if (successCount === 0) actionHelpers.toast.error(t("collection.bulkDeleteError"));
1281
1049
  else actionHelpers.toast.warning(t("collection.bulkDeletePartial", {
@@ -1287,15 +1055,15 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1287
1055
  actionHelpers,
1288
1056
  t
1289
1057
  ]);
1290
- const handleBulkRestore = React.useCallback(async (ids_1) => {
1291
- const results_0 = await Promise.allSettled(ids_1.map((id_5) => restoreMutation.mutateAsync({ id: id_5 })));
1292
- const successCount_0 = results_0.filter((r_1) => r_1.status === "fulfilled").length;
1293
- const failCount_0 = results_0.filter((r_2) => r_2.status === "rejected").length;
1294
- if (failCount_0 === 0) actionHelpers.toast.success(t("collection.bulkRestoreSuccess", { count: successCount_0 }));
1295
- else if (successCount_0 === 0) actionHelpers.toast.error(t("collection.bulkRestoreError"));
1058
+ const handleBulkRestore = React.useCallback(async (ids) => {
1059
+ const results = await Promise.allSettled(ids.map((id) => restoreMutation.mutateAsync({ id })));
1060
+ const successCount = results.filter((r) => r.status === "fulfilled").length;
1061
+ const failCount = results.filter((r) => r.status === "rejected").length;
1062
+ if (failCount === 0) actionHelpers.toast.success(t("collection.bulkRestoreSuccess", { count: successCount }));
1063
+ else if (successCount === 0) actionHelpers.toast.error(t("collection.bulkRestoreError"));
1296
1064
  else actionHelpers.toast.warning(t("collection.bulkRestorePartial", {
1297
- success: successCount_0,
1298
- failed: failCount_0
1065
+ success: successCount,
1066
+ failed: failCount
1299
1067
  }));
1300
1068
  }, [
1301
1069
  restoreMutation,
@@ -1404,7 +1172,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1404
1172
  actions: actions.header,
1405
1173
  collection,
1406
1174
  helpers: actionHelpers,
1407
- onOpenDialog: (action_0) => openDialog(action_0)
1175
+ onOpenDialog: (action) => openDialog(action)
1408
1176
  })
1409
1177
  ] })
1410
1178
  }),
@@ -1416,7 +1184,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1416
1184
  className: "max-w-xl",
1417
1185
  children: /* @__PURE__ */ jsx(SearchInput, {
1418
1186
  value: searchTerm,
1419
- onChange: (e_3) => setSearchTerm(e_3.target.value),
1187
+ onChange: (e) => setSearchTerm(e.target.value),
1420
1188
  onClear: () => setSearchTerm(""),
1421
1189
  placeholder: t("common.search"),
1422
1190
  containerClassName: "h-10"
@@ -1460,7 +1228,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1460
1228
  helpers: actionHelpers,
1461
1229
  totalCount: isSearching ? searchData?.total : listData?.totalDocs,
1462
1230
  pageCount: filteredItems.length,
1463
- onOpenDialog: (action_1, items_0) => openDialog(action_1, items_0),
1231
+ onOpenDialog: (action, items$1) => openDialog(action, items$1),
1464
1232
  onBulkDelete: handleBulkDelete,
1465
1233
  onBulkRestore: handleBulkRestore,
1466
1234
  filterCount: viewState.config.filters.length,
@@ -1551,28 +1319,28 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1551
1319
  })
1552
1320
  ]
1553
1321
  }, entry.key);
1554
- const row_12 = entry.row;
1555
- const isRowDeleted = !!row_12.original?.deletedAt;
1322
+ const row = entry.row;
1323
+ const isRowDeleted = !!row.original?.deletedAt;
1556
1324
  return /* @__PURE__ */ jsx(isReorderMode ? SortableTableRow : TableRow, {
1557
- id: String(row_12.id),
1558
- "data-state": row_12.getIsSelected() && "selected",
1559
- className: cn("group", isReorderMode && "bg-muted/[0.18]", isHighlighted(row_12.id) && "animate-realtime-pulse", isRowDeleted && "opacity-50"),
1560
- children: row_12.getVisibleCells().map((cell, cellIndex) => {
1561
- const isCheckboxCol_0 = cellIndex === 0;
1562
- const columnWidth_0 = getColumnSize(cell.column, isCheckboxCol_0 ? 40 : 120);
1563
- const stickyLeft_0 = cellIndex < STICKY_TABLE_COLUMN_COUNT ? getStickyLeftOffset(visibleLeafColumns, cellIndex) : void 0;
1325
+ id: String(row.id),
1326
+ "data-state": row.getIsSelected() && "selected",
1327
+ className: cn("group", isReorderMode && "bg-muted/[0.18]", isHighlighted(row.id) && "animate-realtime-pulse", isRowDeleted && "opacity-50"),
1328
+ children: row.getVisibleCells().map((cell, cellIndex) => {
1329
+ const isCheckboxCol = cellIndex === 0;
1330
+ const columnWidth = getColumnSize(cell.column, isCheckboxCol ? 40 : 120);
1331
+ const stickyLeft = cellIndex < STICKY_TABLE_COLUMN_COUNT ? getStickyLeftOffset(visibleLeafColumns, cellIndex) : void 0;
1564
1332
  const isTitleCol = cellIndex === 1;
1565
1333
  return /* @__PURE__ */ jsx(TableCell, {
1566
- stickyLeft: stickyLeft_0,
1334
+ stickyLeft,
1567
1335
  showStickyBorder: cellIndex === STICKY_TABLE_COLUMN_COUNT - 1,
1568
- className: isCheckboxCol_0 ? "w-9 min-w-9 px-1.5" : void 0,
1569
- style: getColumnSizeStyle(columnWidth_0),
1336
+ className: isCheckboxCol ? "w-9 min-w-9 px-1.5" : void 0,
1337
+ style: getColumnSizeStyle(columnWidth),
1570
1338
  children: isTitleCol ? /* @__PURE__ */ jsxs("div", {
1571
1339
  className: "flex min-w-0 items-center gap-2",
1572
1340
  children: [
1573
1341
  /* @__PURE__ */ jsx("button", {
1574
1342
  type: "button",
1575
- onClick: () => handleRowClick(row_12.original),
1343
+ onClick: () => handleRowClick(row.original),
1576
1344
  disabled: isReorderMode,
1577
1345
  className: cn("decoration-muted-foreground/50 hover:decoration-foreground max-w-full min-w-0 text-left underline underline-offset-2 transition-colors disabled:cursor-default disabled:no-underline", !isReorderMode && "cursor-pointer"),
1578
1346
  children: flexRender(cell.column.columnDef.cell, cell.getContext())
@@ -1584,14 +1352,14 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1584
1352
  className: "size-3"
1585
1353
  }), t("common.deleted")]
1586
1354
  }),
1587
- isDocLocked(row_12.id) && (() => {
1588
- const lock = getLock(row_12.id);
1589
- const user_0 = lock ? getLockUser(lock) : null;
1355
+ isDocLocked(row.id) && (() => {
1356
+ const lock = getLock(row.id);
1357
+ const user$1 = lock ? getLockUser(lock) : null;
1590
1358
  return /* @__PURE__ */ jsxs("span", {
1591
1359
  className: "text-muted-foreground bg-muted inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-xs",
1592
- title: user_0?.name ?? user_0?.email ?? "Someone is editing",
1593
- children: [user_0?.image ? /* @__PURE__ */ jsx("img", {
1594
- src: user_0.image,
1360
+ title: user$1?.name ?? user$1?.email ?? "Someone is editing",
1361
+ children: [user$1?.image ? /* @__PURE__ */ jsx("img", {
1362
+ src: user$1.image,
1595
1363
  alt: "",
1596
1364
  className: "image-outline size-4 rounded-full"
1597
1365
  }) : /* @__PURE__ */ jsx(Icon, {
@@ -1599,7 +1367,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1599
1367
  className: "size-3"
1600
1368
  }), /* @__PURE__ */ jsx("span", {
1601
1369
  className: "max-w-20 truncate",
1602
- children: user_0?.name?.split(" ")[0] ?? t("table.editing")
1370
+ children: user$1?.name?.split(" ")[0] ?? t("table.editing")
1603
1371
  })]
1604
1372
  });
1605
1373
  })()
@@ -1607,7 +1375,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1607
1375
  }) : flexRender(cell.column.columnDef.cell, cell.getContext())
1608
1376
  }, cell.id);
1609
1377
  })
1610
- }, row_12.id);
1378
+ }, row.id);
1611
1379
  }) })
1612
1380
  })
1613
1381
  ]
@@ -1651,7 +1419,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1651
1419
  children: t("table.show")
1652
1420
  }), /* @__PURE__ */ jsxs(Select, {
1653
1421
  value: String(viewState.config.pagination?.pageSize ?? 25),
1654
- onValueChange: (value_0) => viewState.setPageSize(Number(value_0)),
1422
+ onValueChange: (value) => viewState.setPageSize(Number(value)),
1655
1423
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
1656
1424
  className: "h-8 w-[70px]",
1657
1425
  children: /* @__PURE__ */ jsx(SelectValue, {})
@@ -1757,7 +1525,7 @@ function TableViewInner({ collection, config, viewConfig, navigate, basePath = "
1757
1525
  }),
1758
1526
  dialogAction && /* @__PURE__ */ jsx(ActionDialog, {
1759
1527
  open: !!dialogAction,
1760
- onOpenChange: (open_0) => !open_0 && closeDialog(),
1528
+ onOpenChange: (open) => !open && closeDialog(),
1761
1529
  action: dialogAction,
1762
1530
  collection,
1763
1531
  item: dialogItem,