@questpie/admin 3.2.4 → 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 (248) 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.mjs +40 -126
  8. package/dist/client/components/auth/auth-loading.mjs +9 -44
  9. package/dist/client/components/blocks/block-canvas.mjs +31 -95
  10. package/dist/client/components/blocks/block-editor-context.mjs +13 -57
  11. package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
  12. package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
  13. package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
  14. package/dist/client/components/blocks/block-insert-button.mjs +49 -165
  15. package/dist/client/components/blocks/block-item-menu.mjs +102 -301
  16. package/dist/client/components/blocks/block-item.mjs +136 -370
  17. package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
  18. package/dist/client/components/blocks/block-tree.mjs +12 -68
  19. package/dist/client/components/blocks/block-type-icon.mjs +14 -56
  20. package/dist/client/components/brand-logo.mjs +35 -149
  21. package/dist/client/components/component-renderer.mjs +42 -118
  22. package/dist/client/components/error-boundary.mjs +14 -58
  23. package/dist/client/components/fields/array-field.mjs +209 -521
  24. package/dist/client/components/fields/asset-preview-field.mjs +41 -141
  25. package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
  26. package/dist/client/components/fields/boolean-field.mjs +29 -59
  27. package/dist/client/components/fields/date-field.mjs +7 -37
  28. package/dist/client/components/fields/datetime-field.mjs +7 -38
  29. package/dist/client/components/fields/email-field.mjs +25 -54
  30. package/dist/client/components/fields/field-wrapper.mjs +30 -105
  31. package/dist/client/components/fields/json-field.mjs +94 -296
  32. package/dist/client/components/fields/locale-badge.mjs +6 -15
  33. package/dist/client/components/fields/number-field.mjs +27 -60
  34. package/dist/client/components/fields/object-array-field.mjs +283 -659
  35. package/dist/client/components/fields/object-field.mjs +165 -633
  36. package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
  37. package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
  38. package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
  39. package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
  40. package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
  41. package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
  42. package/dist/client/components/fields/relation-field.mjs +10 -66
  43. package/dist/client/components/fields/relation-picker.mjs +18 -18
  44. package/dist/client/components/fields/relation-select.mjs +12 -12
  45. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
  46. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
  47. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
  48. package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
  49. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
  50. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
  51. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
  52. package/dist/client/components/fields/rich-text-field.mjs +14 -53
  53. package/dist/client/components/fields/select-field.mjs +39 -74
  54. package/dist/client/components/fields/text-field.mjs +26 -59
  55. package/dist/client/components/fields/textarea-field.mjs +26 -58
  56. package/dist/client/components/fields/time-field.mjs +7 -35
  57. package/dist/client/components/fields/upload-field.mjs +47 -165
  58. package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
  59. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
  60. package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
  61. package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
  62. package/dist/client/components/history-sidebar.mjs +285 -605
  63. package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
  64. package/dist/client/components/locale-switcher.mjs +106 -228
  65. package/dist/client/components/media/media-grid.mjs +84 -273
  66. package/dist/client/components/media/media-picker-dialog.mjs +176 -476
  67. package/dist/client/components/preview/live-preview-mode.mjs +233 -458
  68. package/dist/client/components/preview/preview-pane.mjs +22 -22
  69. package/dist/client/components/primitives/asset-preview.mjs +290 -666
  70. package/dist/client/components/primitives/checkbox-input.mjs +9 -35
  71. package/dist/client/components/primitives/date-input.mjs +109 -327
  72. package/dist/client/components/primitives/dropzone.mjs +209 -336
  73. package/dist/client/components/primitives/field-select-control.mjs +12 -80
  74. package/dist/client/components/primitives/number-input.mjs +4 -4
  75. package/dist/client/components/primitives/select-multi.mjs +200 -559
  76. package/dist/client/components/primitives/select-single.mjs +165 -499
  77. package/dist/client/components/primitives/time-input.mjs +43 -117
  78. package/dist/client/components/primitives/toggle-input.mjs +9 -29
  79. package/dist/client/components/sheets/resource-sheet.mjs +61 -70
  80. package/dist/client/components/ui/accordion.mjs +35 -155
  81. package/dist/client/components/ui/alert.mjs +13 -68
  82. package/dist/client/components/ui/badge.mjs +9 -51
  83. package/dist/client/components/ui/button.mjs +8 -54
  84. package/dist/client/components/ui/card.mjs +37 -193
  85. package/dist/client/components/ui/checkbox.mjs +12 -68
  86. package/dist/client/components/ui/command.mjs +48 -219
  87. package/dist/client/components/ui/dialog.mjs +50 -262
  88. package/dist/client/components/ui/drawer.mjs +55 -259
  89. package/dist/client/components/ui/dropdown-menu.mjs +86 -427
  90. package/dist/client/components/ui/empty-state.mjs +28 -98
  91. package/dist/client/components/ui/field.mjs +73 -309
  92. package/dist/client/components/ui/input-group.mjs +42 -167
  93. package/dist/client/components/ui/input.mjs +7 -37
  94. package/dist/client/components/ui/kbd.mjs +6 -36
  95. package/dist/client/components/ui/label.mjs +7 -37
  96. package/dist/client/components/ui/popover.mjs +34 -169
  97. package/dist/client/components/ui/responsive-dialog.mjs +67 -273
  98. package/dist/client/components/ui/scroll-fade.mjs +63 -158
  99. package/dist/client/components/ui/search-input.mjs +33 -100
  100. package/dist/client/components/ui/select.mjs +72 -393
  101. package/dist/client/components/ui/separator.mjs +7 -38
  102. package/dist/client/components/ui/sheet.mjs +49 -269
  103. package/dist/client/components/ui/sidebar.mjs +171 -690
  104. package/dist/client/components/ui/skeleton.mjs +7 -38
  105. package/dist/client/components/ui/sonner.mjs +11 -42
  106. package/dist/client/components/ui/switch.mjs +9 -45
  107. package/dist/client/components/ui/table.mjs +48 -266
  108. package/dist/client/components/ui/tabs.mjs +26 -139
  109. package/dist/client/components/ui/textarea.mjs +6 -32
  110. package/dist/client/components/ui/tooltip.mjs +27 -129
  111. package/dist/client/components/widgets/chart-widget.mjs +174 -522
  112. package/dist/client/components/widgets/progress-widget.mjs +66 -172
  113. package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
  114. package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
  115. package/dist/client/components/widgets/stats-widget.mjs +41 -175
  116. package/dist/client/components/widgets/table-widget.mjs +9 -9
  117. package/dist/client/components/widgets/timeline-widget.mjs +86 -226
  118. package/dist/client/components/widgets/value-widget.mjs +74 -381
  119. package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
  120. package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
  121. package/dist/client/contexts/focus-context.mjs +63 -146
  122. package/dist/client/hooks/typed-hooks.mjs +241 -701
  123. package/dist/client/hooks/use-action.mjs +62 -198
  124. package/dist/client/hooks/use-admin-config.mjs +5 -35
  125. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  126. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  127. package/dist/client/hooks/use-audit-history.mjs +21 -69
  128. package/dist/client/hooks/use-brand.mjs +1 -9
  129. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  130. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  131. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  132. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  133. package/dist/client/hooks/use-collection.mjs +194 -614
  134. package/dist/client/hooks/use-current-user.mjs +0 -1
  135. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  136. package/dist/client/hooks/use-field-options.mjs +61 -202
  137. package/dist/client/hooks/use-global-fields.mjs +14 -46
  138. package/dist/client/hooks/use-global-meta.mjs +9 -30
  139. package/dist/client/hooks/use-global-schema.mjs +9 -30
  140. package/dist/client/hooks/use-global.mjs +63 -219
  141. package/dist/client/hooks/use-locks.mjs +117 -325
  142. package/dist/client/hooks/use-media-query.mjs +16 -36
  143. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  144. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  145. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  146. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  147. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  148. package/dist/client/hooks/use-saved-views.mjs +22 -103
  149. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  150. package/dist/client/hooks/use-search.mjs +31 -143
  151. package/dist/client/hooks/use-server-actions.mjs +18 -50
  152. package/dist/client/hooks/use-server-validation.mjs +72 -166
  153. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  154. package/dist/client/hooks/use-setup-status.mjs +12 -25
  155. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  156. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  157. package/dist/client/hooks/use-upload.mjs +54 -152
  158. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  159. package/dist/client/hooks/use-view-state.mjs +187 -437
  160. package/dist/client/i18n/hooks.mjs +65 -197
  161. package/dist/client/lib/render-profiler.mjs +14 -41
  162. package/dist/client/preview/block-scope-context.d.mts +2 -2
  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.d.mts +2 -2
  174. package/dist/client/scope/picker.mjs +86 -321
  175. package/dist/client/scope/provider.d.mts +2 -2
  176. package/dist/client/scope/provider.mjs +8 -17
  177. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  178. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  179. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  180. package/dist/client/views/auth/auth-layout.mjs +104 -284
  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 +109 -363
  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.mjs +41 -121
  222. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  223. package/dist/client/views/pages/setup-page.mjs +33 -95
  224. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  225. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  226. package/dist/server/modules/admin/collections/account.d.mts +46 -46
  227. package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
  228. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  229. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  230. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  231. package/dist/server/modules/admin/collections/assets.d.mts +39 -39
  232. package/dist/server/modules/admin/collections/session.d.mts +41 -41
  233. package/dist/server/modules/admin/collections/user.d.mts +63 -63
  234. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  235. package/dist/server/modules/admin/index.d.mts +20 -19
  236. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  237. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  238. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  239. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  240. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  241. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  242. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  243. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  244. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
  245. package/dist/server/modules/audit/.generated/module.d.mts +6 -6
  246. package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
  247. package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
  248. package/package.json +3 -5
@@ -5,7 +5,6 @@ import { isBlockContent } from "../../../blocks/types.mjs";
5
5
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.mjs";
6
6
  import { useAdminConfig } from "../../../hooks/use-admin-config.mjs";
7
7
  import { formatFieldLabel, formatPrimitiveValue, getFieldLabel, getItemLabel, summarizeValue } from "./shared/cell-helpers.mjs";
8
- import { c } from "react/compiler-runtime";
9
8
  import "react";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
11
10
 
@@ -13,385 +12,165 @@ import { jsx, jsxs } from "react/jsx-runtime";
13
12
  /**
14
13
  * JSON cell - compact JSON display
15
14
  */
16
- function JsonCell(t0) {
17
- const $ = c(8);
18
- const { value } = t0;
19
- if (value === null || value === void 0) {
20
- let t1$1;
21
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
22
- t1$1 = /* @__PURE__ */ jsx("span", {
23
- className: "text-muted-foreground",
24
- children: "-"
25
- });
26
- $[0] = t1$1;
27
- } else t1$1 = $[0];
28
- return t1$1;
29
- }
30
- let t1;
31
- if ($[1] !== value) {
32
- t1 = typeof value === "string" ? value : JSON.stringify(value, null, 0);
33
- $[1] = value;
34
- $[2] = t1;
35
- } else t1 = $[2];
36
- const json = t1;
37
- let t2;
38
- if ($[3] !== json) {
39
- t2 = json.length > 50 ? `${json.slice(0, 50)}...` : json;
40
- $[3] = json;
41
- $[4] = t2;
42
- } else t2 = $[4];
43
- const truncated = t2;
44
- let t3;
45
- if ($[5] !== json || $[6] !== truncated) {
46
- t3 = /* @__PURE__ */ jsx("span", {
47
- className: "text-muted-foreground font-mono text-xs",
48
- title: json,
49
- children: truncated
50
- });
51
- $[5] = json;
52
- $[6] = truncated;
53
- $[7] = t3;
54
- } else t3 = $[7];
55
- return t3;
15
+ function JsonCell({ value }) {
16
+ if (value === null || value === void 0) return /* @__PURE__ */ jsx("span", {
17
+ className: "text-muted-foreground",
18
+ children: "-"
19
+ });
20
+ const json = typeof value === "string" ? value : JSON.stringify(value, null, 0);
21
+ return /* @__PURE__ */ jsx("span", {
22
+ className: "text-muted-foreground font-mono text-xs",
23
+ title: json,
24
+ children: json.length > 50 ? `${json.slice(0, 50)}...` : json
25
+ });
56
26
  }
57
27
  /**
58
28
  * Object cell - displays nested object with hover tooltip preview
59
29
  */
60
- function ObjectCell(t0) {
61
- const $ = c(40);
62
- const { value, fieldDef } = t0;
30
+ function ObjectCell({ value, fieldDef }) {
63
31
  const { t } = useTranslation();
64
32
  const resolveText = useResolveText();
65
- if (value === null || value === void 0) {
66
- let t1$1;
67
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
68
- t1$1 = /* @__PURE__ */ jsx("span", {
69
- className: "text-muted-foreground",
70
- children: "-"
71
- });
72
- $[0] = t1$1;
73
- } else t1$1 = $[0];
74
- return t1$1;
75
- }
76
- if (typeof value !== "object" || Array.isArray(value)) {
77
- const t1$1 = String(value);
78
- let t2$1;
79
- if ($[1] !== t1$1) {
80
- t2$1 = /* @__PURE__ */ jsx("span", { children: t1$1 });
81
- $[1] = t1$1;
82
- $[2] = t2$1;
83
- } else t2$1 = $[2];
84
- return t2$1;
85
- }
33
+ if (value === null || value === void 0) return /* @__PURE__ */ jsx("span", {
34
+ className: "text-muted-foreground",
35
+ children: "-"
36
+ });
37
+ if (typeof value !== "object" || Array.isArray(value)) return /* @__PURE__ */ jsx("span", { children: String(value) });
86
38
  const obj = value;
87
- let T0;
88
- let T1;
89
- let entries;
90
- let t1;
91
- let t2;
92
- let t3;
93
- let t4;
94
- let t5;
95
- let t6;
96
- let t7;
97
- if ($[3] !== fieldDef || $[4] !== obj || $[5] !== resolveText) {
98
- t7 = Symbol.for("react.early_return_sentinel");
99
- bb0: {
100
- entries = Object.entries(obj);
101
- if (entries.length === 0) {
102
- let t8$1;
103
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
104
- t8$1 = /* @__PURE__ */ jsx("span", {
105
- className: "text-muted-foreground",
106
- children: "-"
107
- });
108
- $[16] = t8$1;
109
- } else t8$1 = $[16];
110
- t7 = t8$1;
111
- break bb0;
112
- }
113
- const nestedFieldsOption = fieldDef?.["~options"]?.fields;
114
- const nestedFields = typeof nestedFieldsOption === "function" ? void 0 : nestedFieldsOption;
115
- const previewParts = entries.slice(0, 2).map((t8$1) => {
116
- const [key, val] = t8$1;
117
- return `${resolveText(getFieldLabel(key, nestedFields?.[key]))}: ${summarizeValue(val)}`;
118
- });
119
- const hasMore = entries.length > 2;
120
- T1 = Tooltip;
121
- let t9$1;
122
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
123
- t9$1 = cn("inline-flex items-center gap-1 text-xs", "text-muted-foreground hover:text-foreground", "max-w-[220px] cursor-default transition-colors");
124
- $[17] = t9$1;
125
- } else t9$1 = $[17];
126
- const t10$1 = previewParts.join(", ");
127
- let t11$1;
128
- if ($[18] !== t10$1) {
129
- t11$1 = /* @__PURE__ */ jsx("span", {
130
- className: "truncate",
131
- children: t10$1
132
- });
133
- $[18] = t10$1;
134
- $[19] = t11$1;
135
- } else t11$1 = $[19];
136
- const t12 = hasMore && /* @__PURE__ */ jsxs("span", {
137
- className: "text-muted-foreground/50 shrink-0",
138
- children: ["+", entries.length - 2]
139
- });
140
- if ($[20] !== t11$1 || $[21] !== t12) {
141
- t6 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsxs("span", {
142
- className: t9$1,
143
- children: [t11$1, t12]
144
- }) });
145
- $[20] = t11$1;
146
- $[21] = t12;
147
- $[22] = t6;
148
- } else t6 = $[22];
149
- T0 = TooltipContent;
150
- t3 = "bottom";
151
- t4 = "start";
152
- t5 = "w-72 p-0";
153
- t1 = "max-h-[300px] space-y-0.5 overflow-y-auto p-3";
154
- t2 = entries.slice(0, 12).map((t13) => {
155
- const [key_0, val_0] = t13;
156
- const nestedDef = nestedFields?.[key_0];
157
- const label_0 = resolveText(getFieldLabel(key_0, nestedDef));
158
- if (val_0 && typeof val_0 === "object" && !Array.isArray(val_0)) {
159
- const nestedObj = val_0;
39
+ const entries = Object.entries(obj);
40
+ if (entries.length === 0) return /* @__PURE__ */ jsx("span", {
41
+ className: "text-muted-foreground",
42
+ children: "-"
43
+ });
44
+ const nestedFieldsOption = fieldDef?.["~options"]?.fields;
45
+ const nestedFields = typeof nestedFieldsOption === "function" ? void 0 : nestedFieldsOption;
46
+ const previewParts = entries.slice(0, 2).map(([key, val]) => {
47
+ return `${resolveText(getFieldLabel(key, nestedFields?.[key]))}: ${summarizeValue(val)}`;
48
+ });
49
+ const hasMore = entries.length > 2;
50
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsxs("span", {
51
+ className: cn("inline-flex items-center gap-1 text-xs", "text-muted-foreground hover:text-foreground", "max-w-[220px] cursor-default transition-colors"),
52
+ children: [/* @__PURE__ */ jsx("span", {
53
+ className: "truncate",
54
+ children: previewParts.join(", ")
55
+ }), hasMore && /* @__PURE__ */ jsxs("span", {
56
+ className: "text-muted-foreground/50 shrink-0",
57
+ children: ["+", entries.length - 2]
58
+ })]
59
+ }) }), /* @__PURE__ */ jsxs(TooltipContent, {
60
+ side: "bottom",
61
+ align: "start",
62
+ className: "w-72 p-0",
63
+ children: [/* @__PURE__ */ jsx("div", {
64
+ className: "max-h-[300px] space-y-0.5 overflow-y-auto p-3",
65
+ children: entries.slice(0, 12).map(([key, val]) => {
66
+ const nestedDef = nestedFields?.[key];
67
+ const label = resolveText(getFieldLabel(key, nestedDef));
68
+ if (val && typeof val === "object" && !Array.isArray(val)) {
69
+ const nestedObj = val;
160
70
  const nestedEntries = Object.entries(nestedObj).slice(0, 4);
161
71
  return /* @__PURE__ */ jsxs("div", {
162
72
  className: "py-1",
163
73
  children: [/* @__PURE__ */ jsxs("div", {
164
74
  className: "flex items-center gap-1.5 text-xs font-medium",
165
- children: [/* @__PURE__ */ jsx("span", { className: "bg-muted-foreground/50 size-1.5 rounded-full" }), label_0]
75
+ children: [/* @__PURE__ */ jsx("span", { className: "bg-muted-foreground/50 size-1.5 rounded-full" }), label]
166
76
  }), /* @__PURE__ */ jsx("div", {
167
77
  className: "bg-muted/50 mt-1 ml-3 space-y-0.5 rounded-sm px-2 py-1.5",
168
- children: nestedEntries.map(_temp)
78
+ children: nestedEntries.map(([k, v]) => /* @__PURE__ */ jsxs("div", {
79
+ className: "flex justify-between gap-2 text-[11px]",
80
+ children: [/* @__PURE__ */ jsx("span", {
81
+ className: "text-muted-foreground",
82
+ children: formatFieldLabel(k)
83
+ }), /* @__PURE__ */ jsx("span", {
84
+ className: "max-w-[120px] truncate",
85
+ children: formatPrimitiveValue(v)
86
+ })]
87
+ }, k))
169
88
  })]
170
- }, key_0);
89
+ }, key);
171
90
  }
172
- if (Array.isArray(val_0)) return /* @__PURE__ */ jsxs("div", {
91
+ if (Array.isArray(val)) return /* @__PURE__ */ jsxs("div", {
173
92
  className: "item-surface border-border flex items-center justify-between gap-2 px-2 py-1 text-xs",
174
93
  children: [/* @__PURE__ */ jsxs("span", {
175
94
  className: "flex items-center gap-1.5",
176
95
  children: [/* @__PURE__ */ jsx("span", { className: "bg-muted-foreground/50 size-1.5 rounded-full" }), /* @__PURE__ */ jsx("span", {
177
96
  className: "text-muted-foreground",
178
- children: label_0
97
+ children: label
179
98
  })]
180
99
  }), /* @__PURE__ */ jsx(Badge, {
181
100
  variant: "secondary",
182
101
  className: "h-4 px-1 text-[10px]",
183
- children: val_0.length
102
+ children: val.length
184
103
  })]
185
- }, key_0);
104
+ }, key);
186
105
  return /* @__PURE__ */ jsxs("div", {
187
106
  className: "item-surface border-border flex items-center justify-between gap-2 px-2 py-1 text-xs",
188
107
  children: [/* @__PURE__ */ jsxs("span", {
189
108
  className: "flex items-center gap-1.5",
190
109
  children: [/* @__PURE__ */ jsx("span", { className: "bg-muted-foreground/50 size-1.5 rounded-full" }), /* @__PURE__ */ jsx("span", {
191
110
  className: "text-muted-foreground",
192
- children: label_0
111
+ children: label
193
112
  })]
194
113
  }), /* @__PURE__ */ jsx("span", {
195
114
  className: "max-w-[140px] truncate font-medium",
196
- children: formatPrimitiveValue(val_0)
115
+ children: formatPrimitiveValue(val)
197
116
  })]
198
- }, key_0);
199
- });
200
- }
201
- $[3] = fieldDef;
202
- $[4] = obj;
203
- $[5] = resolveText;
204
- $[6] = T0;
205
- $[7] = T1;
206
- $[8] = entries;
207
- $[9] = t1;
208
- $[10] = t2;
209
- $[11] = t3;
210
- $[12] = t4;
211
- $[13] = t5;
212
- $[14] = t6;
213
- $[15] = t7;
214
- } else {
215
- T0 = $[6];
216
- T1 = $[7];
217
- entries = $[8];
218
- t1 = $[9];
219
- t2 = $[10];
220
- t3 = $[11];
221
- t4 = $[12];
222
- t5 = $[13];
223
- t6 = $[14];
224
- t7 = $[15];
225
- }
226
- if (t7 !== Symbol.for("react.early_return_sentinel")) return t7;
227
- let t8;
228
- if ($[23] !== t1 || $[24] !== t2) {
229
- t8 = /* @__PURE__ */ jsx("div", {
230
- className: t1,
231
- children: t2
232
- });
233
- $[23] = t1;
234
- $[24] = t2;
235
- $[25] = t8;
236
- } else t8 = $[25];
237
- let t9;
238
- if ($[26] !== entries.length || $[27] !== t) {
239
- t9 = entries.length > 12 && /* @__PURE__ */ jsx("div", {
117
+ }, key);
118
+ })
119
+ }), entries.length > 12 && /* @__PURE__ */ jsx("div", {
240
120
  className: "text-muted-foreground border-border border-t py-1.5 text-center text-[11px]",
241
121
  children: t("cell.more", { count: entries.length - 12 })
242
- });
243
- $[26] = entries.length;
244
- $[27] = t;
245
- $[28] = t9;
246
- } else t9 = $[28];
247
- let t10;
248
- if ($[29] !== T0 || $[30] !== t3 || $[31] !== t4 || $[32] !== t5 || $[33] !== t8 || $[34] !== t9) {
249
- t10 = /* @__PURE__ */ jsxs(T0, {
250
- side: t3,
251
- align: t4,
252
- className: t5,
253
- children: [t8, t9]
254
- });
255
- $[29] = T0;
256
- $[30] = t3;
257
- $[31] = t4;
258
- $[32] = t5;
259
- $[33] = t8;
260
- $[34] = t9;
261
- $[35] = t10;
262
- } else t10 = $[35];
263
- let t11;
264
- if ($[36] !== T1 || $[37] !== t10 || $[38] !== t6) {
265
- t11 = /* @__PURE__ */ jsxs(T1, { children: [t6, t10] });
266
- $[36] = T1;
267
- $[37] = t10;
268
- $[38] = t6;
269
- $[39] = t11;
270
- } else t11 = $[39];
271
- return t11;
122
+ })]
123
+ })] });
272
124
  }
273
125
  /**
274
126
  * Array cell - displays array items with hover tooltip preview
275
127
  */
276
- function _temp(t0) {
277
- const [k, v] = t0;
278
- return /* @__PURE__ */ jsxs("div", {
279
- className: "flex justify-between gap-2 text-[11px]",
280
- children: [/* @__PURE__ */ jsx("span", {
281
- className: "text-muted-foreground",
282
- children: formatFieldLabel(k)
283
- }), /* @__PURE__ */ jsx("span", {
284
- className: "max-w-[120px] truncate",
285
- children: formatPrimitiveValue(v)
286
- })]
287
- }, k);
288
- }
289
- function ArrayCell(t0) {
290
- const $ = c(40);
291
- const { value, fieldDef } = t0;
128
+ function ArrayCell({ value, fieldDef }) {
292
129
  const { t } = useTranslation();
293
130
  const resolveText = useResolveText();
294
- if (value === null || value === void 0) {
295
- let t1$1;
296
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
297
- t1$1 = /* @__PURE__ */ jsx("span", {
298
- className: "text-muted-foreground",
299
- children: "-"
300
- });
301
- $[0] = t1$1;
302
- } else t1$1 = $[0];
303
- return t1$1;
304
- }
305
- if (!Array.isArray(value)) {
306
- const t1$1 = String(value);
307
- let t2$1;
308
- if ($[1] !== t1$1) {
309
- t2$1 = /* @__PURE__ */ jsx("span", { children: t1$1 });
310
- $[1] = t1$1;
311
- $[2] = t2$1;
312
- } else t2$1 = $[2];
313
- return t2$1;
314
- }
315
- if (value.length === 0) {
316
- let t1$1;
317
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
318
- t1$1 = /* @__PURE__ */ jsx("span", {
319
- className: "text-muted-foreground",
320
- children: "-"
321
- });
322
- $[3] = t1$1;
323
- } else t1$1 = $[3];
324
- return t1$1;
325
- }
326
- let t1;
327
- if ($[4] !== fieldDef) {
328
- t1 = fieldDef?.["~options"] ?? {};
329
- $[4] = fieldDef;
330
- $[5] = t1;
331
- } else t1 = $[5];
332
- const fieldOptions = t1;
131
+ if (value === null || value === void 0) return /* @__PURE__ */ jsx("span", {
132
+ className: "text-muted-foreground",
133
+ children: "-"
134
+ });
135
+ if (!Array.isArray(value)) return /* @__PURE__ */ jsx("span", { children: String(value) });
136
+ if (value.length === 0) return /* @__PURE__ */ jsx("span", {
137
+ className: "text-muted-foreground",
138
+ children: "-"
139
+ });
140
+ const fieldOptions = fieldDef?.["~options"] ?? {};
333
141
  const itemLabelFn = fieldOptions.itemLabel;
334
142
  const itemFieldsOption = fieldOptions.item;
335
143
  const itemFields = typeof itemFieldsOption === "function" ? void 0 : itemFieldsOption;
336
- let t2;
337
- if ($[6] !== itemLabelFn || $[7] !== value) {
338
- let t3$1;
339
- if ($[9] !== itemLabelFn) {
340
- t3$1 = (item, idx) => getItemLabel(item, idx, itemLabelFn);
341
- $[9] = itemLabelFn;
342
- $[10] = t3$1;
343
- } else t3$1 = $[10];
344
- t2 = value.slice(0, 3).map(t3$1);
345
- $[6] = itemLabelFn;
346
- $[7] = value;
347
- $[8] = t2;
348
- } else t2 = $[8];
349
- const previewLabels = t2;
350
- let t3;
351
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
352
- t3 = cn("inline-flex items-center gap-1.5 text-xs", "text-muted-foreground hover:text-foreground", "max-w-[180px] cursor-default transition-colors");
353
- $[11] = t3;
354
- } else t3 = $[11];
355
- let t4;
356
- if ($[12] !== value.length) {
357
- t4 = /* @__PURE__ */ jsx(Badge, {
144
+ const previewLabels = value.slice(0, 3).map((item, idx) => getItemLabel(item, idx, itemLabelFn));
145
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs("span", {
146
+ className: cn("inline-flex items-center gap-1.5 text-xs", "text-muted-foreground hover:text-foreground", "max-w-[180px] cursor-default transition-colors"),
147
+ children: [/* @__PURE__ */ jsx(Badge, {
358
148
  variant: "secondary",
359
149
  className: "h-4 min-w-4 shrink-0 px-1 text-[10px]",
360
150
  children: value.length
361
- });
362
- $[12] = value.length;
363
- $[13] = t4;
364
- } else t4 = $[13];
365
- const t5 = value.length > 1 && ` +${value.length - 1}`;
366
- let t6;
367
- if ($[14] !== previewLabels[0] || $[15] !== t5) {
368
- t6 = /* @__PURE__ */ jsxs("span", {
151
+ }), /* @__PURE__ */ jsxs("span", {
369
152
  className: "truncate",
370
- children: [previewLabels[0], t5]
371
- });
372
- $[14] = previewLabels[0];
373
- $[15] = t5;
374
- $[16] = t6;
375
- } else t6 = $[16];
376
- let t7;
377
- if ($[17] !== t4 || $[18] !== t6) {
378
- t7 = /* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs("span", {
379
- className: t3,
380
- children: [t4, t6]
381
- }) });
382
- $[17] = t4;
383
- $[18] = t6;
384
- $[19] = t7;
385
- } else t7 = $[19];
386
- let t8;
387
- if ($[20] !== itemFields || $[21] !== itemLabelFn || $[22] !== resolveText || $[23] !== value) {
388
- let t9$1;
389
- if ($[25] !== itemFields || $[26] !== itemLabelFn || $[27] !== resolveText) {
390
- t9$1 = (item_0, idx_0) => {
391
- const label = getItemLabel(item_0, idx_0, itemLabelFn);
392
- if (typeof item_0 === "object" && item_0 !== null) {
393
- const obj = item_0;
394
- const details = Object.entries(obj).filter(_temp2).slice(0, 3);
153
+ children: [previewLabels[0], value.length > 1 && ` +${value.length - 1}`]
154
+ })]
155
+ }) }), /* @__PURE__ */ jsxs(TooltipContent, {
156
+ side: "bottom",
157
+ align: "start",
158
+ className: "bg-popover border-border w-64 max-w-[90vw] p-0",
159
+ children: [/* @__PURE__ */ jsx("div", {
160
+ className: "max-h-[280px] space-y-0.5 overflow-y-auto p-2",
161
+ children: value.slice(0, 10).map((item, idx) => {
162
+ const label = getItemLabel(item, idx, itemLabelFn);
163
+ if (typeof item === "object" && item !== null) {
164
+ const obj = item;
165
+ const details = Object.entries(obj).filter(([k]) => ![
166
+ "id",
167
+ "_id",
168
+ "name",
169
+ "title",
170
+ "label",
171
+ "platform",
172
+ "type"
173
+ ].includes(k)).slice(0, 3);
395
174
  const itemId = obj.id ?? obj._id ?? `${label}-${JSON.stringify(obj).slice(0, 50)}`;
396
175
  return /* @__PURE__ */ jsxs("div", {
397
176
  className: "py-1",
@@ -400,91 +179,32 @@ function ArrayCell(t0) {
400
179
  children: [/* @__PURE__ */ jsx("span", { className: "bg-muted-foreground/50 size-1.5 rounded-full" }), label]
401
180
  }), details.length > 0 && /* @__PURE__ */ jsx("div", {
402
181
  className: "bg-muted/50 mt-1 ml-3 space-y-0.5 rounded-sm px-2 py-1.5",
403
- children: details.map((t10$1) => {
404
- const [k_0, v] = t10$1;
405
- const itemFieldDef = itemFields?.[k_0];
182
+ children: details.map(([k, v]) => {
183
+ const itemFieldDef = itemFields?.[k];
406
184
  return /* @__PURE__ */ jsxs("div", {
407
185
  className: "flex justify-between gap-2 text-[11px]",
408
186
  children: [/* @__PURE__ */ jsx("span", {
409
187
  className: "text-muted-foreground",
410
- children: resolveText(getFieldLabel(k_0, itemFieldDef))
188
+ children: resolveText(getFieldLabel(k, itemFieldDef))
411
189
  }), /* @__PURE__ */ jsx("span", {
412
190
  className: "max-w-[100px] truncate",
413
191
  children: formatPrimitiveValue(v)
414
192
  })]
415
- }, k_0);
193
+ }, k);
416
194
  })
417
195
  })]
418
196
  }, String(itemId));
419
197
  }
420
198
  return /* @__PURE__ */ jsxs("div", {
421
199
  className: "item-surface border-border flex items-center gap-1.5 px-2 py-1 text-xs",
422
- children: [/* @__PURE__ */ jsx("span", { className: "bg-muted-foreground/50 size-1.5 rounded-full" }), formatPrimitiveValue(item_0)]
423
- }, `item-${String(item_0)}`);
424
- };
425
- $[25] = itemFields;
426
- $[26] = itemLabelFn;
427
- $[27] = resolveText;
428
- $[28] = t9$1;
429
- } else t9$1 = $[28];
430
- t8 = value.slice(0, 10).map(t9$1);
431
- $[20] = itemFields;
432
- $[21] = itemLabelFn;
433
- $[22] = resolveText;
434
- $[23] = value;
435
- $[24] = t8;
436
- } else t8 = $[24];
437
- let t9;
438
- if ($[29] !== t8) {
439
- t9 = /* @__PURE__ */ jsx("div", {
440
- className: "max-h-[280px] space-y-0.5 overflow-y-auto p-2",
441
- children: t8
442
- });
443
- $[29] = t8;
444
- $[30] = t9;
445
- } else t9 = $[30];
446
- let t10;
447
- if ($[31] !== t || $[32] !== value.length) {
448
- t10 = value.length > 10 && /* @__PURE__ */ jsx("div", {
200
+ children: [/* @__PURE__ */ jsx("span", { className: "bg-muted-foreground/50 size-1.5 rounded-full" }), formatPrimitiveValue(item)]
201
+ }, `item-${String(item)}`);
202
+ })
203
+ }), value.length > 10 && /* @__PURE__ */ jsx("div", {
449
204
  className: "text-muted-foreground border-border border-t py-1.5 text-center text-[11px]",
450
205
  children: t("cell.more", { count: value.length - 10 })
451
- });
452
- $[31] = t;
453
- $[32] = value.length;
454
- $[33] = t10;
455
- } else t10 = $[33];
456
- let t11;
457
- if ($[34] !== t10 || $[35] !== t9) {
458
- t11 = /* @__PURE__ */ jsxs(TooltipContent, {
459
- side: "bottom",
460
- align: "start",
461
- className: "bg-popover border-border w-64 max-w-[90vw] p-0",
462
- children: [t9, t10]
463
- });
464
- $[34] = t10;
465
- $[35] = t9;
466
- $[36] = t11;
467
- } else t11 = $[36];
468
- let t12;
469
- if ($[37] !== t11 || $[38] !== t7) {
470
- t12 = /* @__PURE__ */ jsxs(Tooltip, { children: [t7, t11] });
471
- $[37] = t11;
472
- $[38] = t7;
473
- $[39] = t12;
474
- } else t12 = $[39];
475
- return t12;
476
- }
477
- function _temp2(t0) {
478
- const [k] = t0;
479
- return ![
480
- "id",
481
- "_id",
482
- "name",
483
- "title",
484
- "label",
485
- "platform",
486
- "type"
487
- ].includes(k);
206
+ })]
207
+ })] });
488
208
  }
489
209
  function coerceBlockContent(value) {
490
210
  if (isBlockContent(value)) return value;
@@ -518,228 +238,80 @@ function collectBlockStats(tree) {
518
238
  /**
519
239
  * Blocks cell - summarizes block tree content with type counts
520
240
  */
521
- function BlocksCell(t0) {
522
- const $ = c(42);
523
- const { value } = t0;
241
+ function BlocksCell({ value }) {
524
242
  const { t } = useTranslation();
525
243
  const resolveText = useResolveText();
526
244
  const { data: adminConfig } = useAdminConfig();
527
- if (value === null || value === void 0) {
528
- let t1$1;
529
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
530
- t1$1 = /* @__PURE__ */ jsx("span", {
531
- className: "text-muted-foreground",
532
- children: "-"
533
- });
534
- $[0] = t1$1;
535
- } else t1$1 = $[0];
536
- return t1$1;
537
- }
538
- let entries;
539
- let t1;
540
- let t2;
541
- let total;
542
- if ($[1] !== adminConfig?.blocks || $[2] !== resolveText || $[3] !== value) {
543
- t2 = Symbol.for("react.early_return_sentinel");
544
- bb0: {
545
- const content = coerceBlockContent(value);
546
- if (!content) {
547
- let t3$2;
548
- if ($[8] !== value) {
549
- t3$2 = /* @__PURE__ */ jsx(JsonCell, { value });
550
- $[8] = value;
551
- $[9] = t3$2;
552
- } else t3$2 = $[9];
553
- t2 = t3$2;
554
- break bb0;
555
- }
556
- if (!content._tree.length) {
557
- let t3$2;
558
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
559
- t3$2 = /* @__PURE__ */ jsx("span", {
560
- className: "text-muted-foreground",
561
- children: "-"
562
- });
563
- $[10] = t3$2;
564
- } else t3$2 = $[10];
565
- t2 = t3$2;
566
- break bb0;
567
- }
568
- const blockDefs = adminConfig?.blocks ?? {};
569
- const { total: t3$1, counts } = collectBlockStats(content._tree);
570
- total = t3$1;
571
- if (total === 0) {
572
- let t4$1;
573
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
574
- t4$1 = /* @__PURE__ */ jsx("span", {
575
- className: "text-muted-foreground",
576
- children: "-"
577
- });
578
- $[11] = t4$1;
579
- } else t4$1 = $[11];
580
- t2 = t4$1;
581
- break bb0;
582
- }
583
- entries = Array.from(counts.entries()).map((t4$1) => {
584
- const [type, count] = t4$1;
585
- return {
586
- type,
587
- count,
588
- label: getBlockLabel(type, blockDefs?.[type], resolveText)
589
- };
590
- });
591
- entries.sort(_temp3);
592
- t1 = entries.slice(0, 2).map(_temp4);
593
- }
594
- $[1] = adminConfig?.blocks;
595
- $[2] = resolveText;
596
- $[3] = value;
597
- $[4] = entries;
598
- $[5] = t1;
599
- $[6] = t2;
600
- $[7] = total;
601
- } else {
602
- entries = $[4];
603
- t1 = $[5];
604
- t2 = $[6];
605
- total = $[7];
606
- }
607
- if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
608
- const preview = t1;
245
+ if (value === null || value === void 0) return /* @__PURE__ */ jsx("span", {
246
+ className: "text-muted-foreground",
247
+ children: "-"
248
+ });
249
+ const content = coerceBlockContent(value);
250
+ if (!content) return /* @__PURE__ */ jsx(JsonCell, { value });
251
+ if (!content._tree.length) return /* @__PURE__ */ jsx("span", {
252
+ className: "text-muted-foreground",
253
+ children: "-"
254
+ });
255
+ const blockDefs = adminConfig?.blocks ?? {};
256
+ const { total, counts } = collectBlockStats(content._tree);
257
+ if (total === 0) return /* @__PURE__ */ jsx("span", {
258
+ className: "text-muted-foreground",
259
+ children: "-"
260
+ });
261
+ const entries = Array.from(counts.entries()).map(([type, count]) => ({
262
+ type,
263
+ count,
264
+ label: getBlockLabel(type, blockDefs?.[type], resolveText)
265
+ }));
266
+ entries.sort((a, b) => {
267
+ if (b.count !== a.count) return b.count - a.count;
268
+ return a.label.localeCompare(b.label);
269
+ });
270
+ const preview = entries.slice(0, 2).map((entry) => entry.count > 1 ? `${entry.label} x${entry.count}` : entry.label);
609
271
  const extraTypes = entries.length - preview.length;
610
- let t3;
611
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
612
- t3 = cn("inline-flex h-6 max-w-[240px] cursor-default items-center gap-2 rounded-md px-1.5 text-xs", "text-muted-foreground hover:bg-surface-high hover:text-foreground", "transition-[background-color,color] duration-150 ease-out");
613
- $[12] = t3;
614
- } else t3 = $[12];
615
- let t4;
616
- if ($[13] !== total) {
617
- t4 = /* @__PURE__ */ jsx(Badge, {
272
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs("span", {
273
+ className: cn("inline-flex h-6 max-w-[240px] cursor-default items-center gap-2 rounded-md px-1.5 text-xs", "text-muted-foreground hover:bg-surface-high hover:text-foreground", "transition-[background-color,color] duration-150 ease-out"),
274
+ children: [/* @__PURE__ */ jsx(Badge, {
618
275
  variant: "outline",
619
276
  className: "h-5 min-w-5 shrink-0 px-1.5 text-[10px]",
620
277
  children: total
621
- });
622
- $[13] = total;
623
- $[14] = t4;
624
- } else t4 = $[14];
625
- const t5 = preview.join(", ");
626
- const t6 = extraTypes > 0 && ` +${extraTypes}`;
627
- let t7;
628
- if ($[15] !== t5 || $[16] !== t6) {
629
- t7 = /* @__PURE__ */ jsxs("span", {
630
- className: "truncate",
631
- children: [t5, t6]
632
- });
633
- $[15] = t5;
634
- $[16] = t6;
635
- $[17] = t7;
636
- } else t7 = $[17];
637
- let t8;
638
- if ($[18] !== t4 || $[19] !== t7) {
639
- t8 = /* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs("span", {
640
- className: t3,
641
- children: [t4, t7]
642
- }) });
643
- $[18] = t4;
644
- $[19] = t7;
645
- $[20] = t8;
646
- } else t8 = $[20];
647
- let t9;
648
- if ($[21] !== t) {
649
- t9 = t("cell.blocks");
650
- $[21] = t;
651
- $[22] = t9;
652
- } else t9 = $[22];
653
- let t10;
654
- if ($[23] !== t9) {
655
- t10 = /* @__PURE__ */ jsx("span", { children: t9 });
656
- $[23] = t9;
657
- $[24] = t10;
658
- } else t10 = $[24];
659
- let t11;
660
- if ($[25] !== total) {
661
- t11 = /* @__PURE__ */ jsx(Badge, {
662
- variant: "outline",
663
- className: "h-5 px-1.5 text-[10px]",
664
- children: total
665
- });
666
- $[25] = total;
667
- $[26] = t11;
668
- } else t11 = $[26];
669
- let t12;
670
- if ($[27] !== t10 || $[28] !== t11) {
671
- t12 = /* @__PURE__ */ jsxs("div", {
672
- className: "text-muted-foreground flex items-center justify-between px-2 py-1 text-[11px]",
673
- children: [t10, t11]
674
- });
675
- $[27] = t10;
676
- $[28] = t11;
677
- $[29] = t12;
678
- } else t12 = $[29];
679
- let t13;
680
- if ($[30] !== entries) {
681
- t13 = /* @__PURE__ */ jsx("div", {
682
- className: "max-h-[280px] space-y-0.5 overflow-y-auto p-1",
683
- children: entries.slice(0, 10).map(_temp5)
684
- });
685
- $[30] = entries;
686
- $[31] = t13;
687
- } else t13 = $[31];
688
- let t14;
689
- if ($[32] !== entries.length || $[33] !== t) {
690
- t14 = entries.length > 10 && /* @__PURE__ */ jsx("div", {
691
- className: "text-muted-foreground py-1.5 text-center text-[11px]",
692
- children: t("cell.more", { count: entries.length - 10 })
693
- });
694
- $[32] = entries.length;
695
- $[33] = t;
696
- $[34] = t14;
697
- } else t14 = $[34];
698
- let t15;
699
- if ($[35] !== t12 || $[36] !== t13 || $[37] !== t14) {
700
- t15 = /* @__PURE__ */ jsxs(TooltipContent, {
701
- side: "bottom",
702
- align: "start",
703
- className: "w-64 max-w-[90vw] p-1",
704
- children: [
705
- t12,
706
- t13,
707
- t14
708
- ]
709
- });
710
- $[35] = t12;
711
- $[36] = t13;
712
- $[37] = t14;
713
- $[38] = t15;
714
- } else t15 = $[38];
715
- let t16;
716
- if ($[39] !== t15 || $[40] !== t8) {
717
- t16 = /* @__PURE__ */ jsxs(Tooltip, { children: [t8, t15] });
718
- $[39] = t15;
719
- $[40] = t8;
720
- $[41] = t16;
721
- } else t16 = $[41];
722
- return t16;
723
- }
724
- function _temp5(entry_0) {
725
- return /* @__PURE__ */ jsxs("div", {
726
- className: "flex h-7 items-center justify-between gap-2 rounded-md px-2 text-xs",
727
- children: [/* @__PURE__ */ jsx("span", {
278
+ }), /* @__PURE__ */ jsxs("span", {
728
279
  className: "truncate",
729
- children: entry_0.label
730
- }), /* @__PURE__ */ jsx(Badge, {
731
- variant: "outline",
732
- className: "h-5 px-1.5 text-[10px]",
733
- children: entry_0.count
280
+ children: [preview.join(", "), extraTypes > 0 && ` +${extraTypes}`]
734
281
  })]
735
- }, entry_0.type);
736
- }
737
- function _temp4(entry) {
738
- return entry.count > 1 ? `${entry.label} x${entry.count}` : entry.label;
739
- }
740
- function _temp3(a, b) {
741
- if (b.count !== a.count) return b.count - a.count;
742
- return a.label.localeCompare(b.label);
282
+ }) }), /* @__PURE__ */ jsxs(TooltipContent, {
283
+ side: "bottom",
284
+ align: "start",
285
+ className: "w-64 max-w-[90vw] p-1",
286
+ children: [
287
+ /* @__PURE__ */ jsxs("div", {
288
+ className: "text-muted-foreground flex items-center justify-between px-2 py-1 text-[11px]",
289
+ children: [/* @__PURE__ */ jsx("span", { children: t("cell.blocks") }), /* @__PURE__ */ jsx(Badge, {
290
+ variant: "outline",
291
+ className: "h-5 px-1.5 text-[10px]",
292
+ children: total
293
+ })]
294
+ }),
295
+ /* @__PURE__ */ jsx("div", {
296
+ className: "max-h-[280px] space-y-0.5 overflow-y-auto p-1",
297
+ children: entries.slice(0, 10).map((entry) => /* @__PURE__ */ jsxs("div", {
298
+ className: "flex h-7 items-center justify-between gap-2 rounded-md px-2 text-xs",
299
+ children: [/* @__PURE__ */ jsx("span", {
300
+ className: "truncate",
301
+ children: entry.label
302
+ }), /* @__PURE__ */ jsx(Badge, {
303
+ variant: "outline",
304
+ className: "h-5 px-1.5 text-[10px]",
305
+ children: entry.count
306
+ })]
307
+ }, entry.type))
308
+ }),
309
+ entries.length > 10 && /* @__PURE__ */ jsx("div", {
310
+ className: "text-muted-foreground py-1.5 text-center text-[11px]",
311
+ children: t("cell.more", { count: entries.length - 10 })
312
+ })
313
+ ]
314
+ })] });
743
315
  }
744
316
 
745
317
  //#endregion