@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.
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +164 -339
- package/dist/client/components/actions/action-button.mjs +9 -9
- package/dist/client/components/actions/action-dialog.mjs +195 -493
- package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
- package/dist/client/components/actions/header-actions.mjs +73 -165
- package/dist/client/components/admin-link.mjs +40 -126
- package/dist/client/components/auth/auth-loading.mjs +9 -44
- package/dist/client/components/blocks/block-canvas.mjs +31 -95
- package/dist/client/components/blocks/block-editor-context.mjs +13 -57
- package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
- package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
- package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
- package/dist/client/components/blocks/block-insert-button.mjs +49 -165
- package/dist/client/components/blocks/block-item-menu.mjs +102 -301
- package/dist/client/components/blocks/block-item.mjs +136 -370
- package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
- package/dist/client/components/blocks/block-tree.mjs +12 -68
- package/dist/client/components/blocks/block-type-icon.mjs +14 -56
- package/dist/client/components/brand-logo.mjs +35 -149
- package/dist/client/components/component-renderer.mjs +42 -118
- package/dist/client/components/error-boundary.mjs +14 -58
- package/dist/client/components/fields/array-field.mjs +209 -521
- package/dist/client/components/fields/asset-preview-field.mjs +41 -141
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
- package/dist/client/components/fields/boolean-field.mjs +29 -59
- package/dist/client/components/fields/date-field.mjs +7 -37
- package/dist/client/components/fields/datetime-field.mjs +7 -38
- package/dist/client/components/fields/email-field.mjs +25 -54
- package/dist/client/components/fields/field-wrapper.mjs +30 -105
- package/dist/client/components/fields/json-field.mjs +94 -296
- package/dist/client/components/fields/locale-badge.mjs +6 -15
- package/dist/client/components/fields/number-field.mjs +27 -60
- package/dist/client/components/fields/object-array-field.mjs +283 -659
- package/dist/client/components/fields/object-field.mjs +165 -633
- package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
- package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
- package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
- package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
- package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
- package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
- package/dist/client/components/fields/relation-field.mjs +10 -66
- package/dist/client/components/fields/relation-picker.mjs +18 -18
- package/dist/client/components/fields/relation-select.mjs +12 -12
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
- package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
- package/dist/client/components/fields/rich-text-field.mjs +14 -53
- package/dist/client/components/fields/select-field.mjs +39 -74
- package/dist/client/components/fields/text-field.mjs +26 -59
- package/dist/client/components/fields/textarea-field.mjs +26 -58
- package/dist/client/components/fields/time-field.mjs +7 -35
- package/dist/client/components/fields/upload-field.mjs +47 -165
- package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
- package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
- package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
- package/dist/client/components/history-sidebar.mjs +285 -605
- package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
- package/dist/client/components/locale-switcher.mjs +106 -228
- package/dist/client/components/media/media-grid.mjs +84 -273
- package/dist/client/components/media/media-picker-dialog.mjs +176 -476
- package/dist/client/components/preview/live-preview-mode.mjs +233 -458
- package/dist/client/components/preview/preview-pane.mjs +22 -22
- package/dist/client/components/primitives/asset-preview.mjs +290 -666
- package/dist/client/components/primitives/checkbox-input.mjs +9 -35
- package/dist/client/components/primitives/date-input.mjs +109 -327
- package/dist/client/components/primitives/dropzone.mjs +209 -336
- package/dist/client/components/primitives/field-select-control.mjs +12 -80
- package/dist/client/components/primitives/number-input.mjs +4 -4
- package/dist/client/components/primitives/select-multi.mjs +200 -559
- package/dist/client/components/primitives/select-single.mjs +165 -499
- package/dist/client/components/primitives/time-input.mjs +43 -117
- package/dist/client/components/primitives/toggle-input.mjs +9 -29
- package/dist/client/components/sheets/resource-sheet.mjs +61 -70
- package/dist/client/components/ui/accordion.mjs +35 -155
- package/dist/client/components/ui/alert.mjs +13 -68
- package/dist/client/components/ui/badge.mjs +9 -51
- package/dist/client/components/ui/button.mjs +8 -54
- package/dist/client/components/ui/card.mjs +37 -193
- package/dist/client/components/ui/checkbox.mjs +12 -68
- package/dist/client/components/ui/command.mjs +48 -219
- package/dist/client/components/ui/dialog.mjs +50 -262
- package/dist/client/components/ui/drawer.mjs +55 -259
- package/dist/client/components/ui/dropdown-menu.mjs +86 -427
- package/dist/client/components/ui/empty-state.mjs +28 -98
- package/dist/client/components/ui/field.mjs +73 -309
- package/dist/client/components/ui/input-group.mjs +42 -167
- package/dist/client/components/ui/input.mjs +7 -37
- package/dist/client/components/ui/kbd.mjs +6 -36
- package/dist/client/components/ui/label.mjs +7 -37
- package/dist/client/components/ui/popover.mjs +34 -169
- package/dist/client/components/ui/responsive-dialog.mjs +67 -273
- package/dist/client/components/ui/scroll-fade.mjs +63 -158
- package/dist/client/components/ui/search-input.mjs +33 -100
- package/dist/client/components/ui/select.mjs +72 -393
- package/dist/client/components/ui/separator.mjs +7 -38
- package/dist/client/components/ui/sheet.mjs +49 -269
- package/dist/client/components/ui/sidebar.mjs +171 -690
- package/dist/client/components/ui/skeleton.mjs +7 -38
- package/dist/client/components/ui/sonner.mjs +11 -42
- package/dist/client/components/ui/switch.mjs +9 -45
- package/dist/client/components/ui/table.mjs +48 -266
- package/dist/client/components/ui/tabs.mjs +26 -139
- package/dist/client/components/ui/textarea.mjs +6 -32
- package/dist/client/components/ui/tooltip.mjs +27 -129
- package/dist/client/components/widgets/chart-widget.mjs +174 -522
- package/dist/client/components/widgets/progress-widget.mjs +66 -172
- package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
- package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
- package/dist/client/components/widgets/stats-widget.mjs +41 -175
- package/dist/client/components/widgets/table-widget.mjs +9 -9
- package/dist/client/components/widgets/timeline-widget.mjs +86 -226
- package/dist/client/components/widgets/value-widget.mjs +74 -381
- package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
- package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
- package/dist/client/contexts/focus-context.mjs +63 -146
- package/dist/client/hooks/typed-hooks.mjs +241 -701
- package/dist/client/hooks/use-action.mjs +62 -198
- package/dist/client/hooks/use-admin-config.mjs +5 -35
- package/dist/client/hooks/use-admin-preferences.mjs +16 -88
- package/dist/client/hooks/use-admin-routes.mjs +22 -56
- package/dist/client/hooks/use-audit-history.mjs +21 -69
- package/dist/client/hooks/use-brand.mjs +1 -9
- package/dist/client/hooks/use-collection-fields.mjs +17 -57
- package/dist/client/hooks/use-collection-meta.mjs +12 -44
- package/dist/client/hooks/use-collection-schema.mjs +10 -33
- package/dist/client/hooks/use-collection-validation.mjs +23 -53
- package/dist/client/hooks/use-collection.mjs +194 -614
- package/dist/client/hooks/use-current-user.mjs +0 -1
- package/dist/client/hooks/use-field-hooks.mjs +10 -10
- package/dist/client/hooks/use-field-options.mjs +61 -202
- package/dist/client/hooks/use-global-fields.mjs +14 -46
- package/dist/client/hooks/use-global-meta.mjs +9 -30
- package/dist/client/hooks/use-global-schema.mjs +9 -30
- package/dist/client/hooks/use-global.mjs +63 -219
- package/dist/client/hooks/use-locks.mjs +117 -325
- package/dist/client/hooks/use-media-query.mjs +16 -36
- package/dist/client/hooks/use-prefill-params.mjs +0 -1
- package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
- package/dist/client/hooks/use-reactive-fields.mjs +1 -1
- package/dist/client/hooks/use-reactive-prop.mjs +65 -223
- package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
- package/dist/client/hooks/use-saved-views.mjs +22 -103
- package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
- package/dist/client/hooks/use-search.mjs +31 -143
- package/dist/client/hooks/use-server-actions.mjs +18 -50
- package/dist/client/hooks/use-server-validation.mjs +72 -166
- package/dist/client/hooks/use-server-widget-data.mjs +7 -33
- package/dist/client/hooks/use-setup-status.mjs +12 -25
- package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
- package/dist/client/hooks/use-transition-stage.mjs +8 -38
- package/dist/client/hooks/use-upload.mjs +54 -152
- package/dist/client/hooks/use-validation-error-map.mjs +6 -26
- package/dist/client/hooks/use-view-state.mjs +187 -437
- package/dist/client/i18n/hooks.mjs +65 -197
- package/dist/client/lib/render-profiler.mjs +14 -41
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/block-scope-context.mjs +14 -36
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-banner.mjs +42 -108
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +167 -348
- package/dist/client/preview/use-collection-preview.mjs +121 -215
- package/dist/client/runtime/content-locales-provider.mjs +31 -83
- package/dist/client/runtime/locale-scope.mjs +22 -63
- package/dist/client/runtime/provider.mjs +100 -255
- package/dist/client/runtime/translations-provider.mjs +41 -107
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/picker.mjs +86 -321
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.mjs +121 -412
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/auth-layout.mjs +104 -284
- package/dist/client/views/auth/forgot-password-form.mjs +94 -325
- package/dist/client/views/auth/invite-form.mjs +107 -442
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +116 -337
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +128 -453
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/auth/setup-form.mjs +140 -478
- package/dist/client/views/collection/auto-form-fields.mjs +243 -615
- package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -379
- package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
- package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
- package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
- package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
- package/dist/client/views/collection/columns/build-columns.mjs +8 -48
- package/dist/client/views/collection/field-renderer.mjs +58 -182
- package/dist/client/views/collection/form-view.mjs +284 -518
- package/dist/client/views/collection/table-view.mjs +231 -463
- package/dist/client/views/collection/view-skeletons.mjs +112 -237
- package/dist/client/views/common/global-search.mjs +241 -560
- package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
- package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
- package/dist/client/views/dashboard/widget-card.mjs +61 -269
- package/dist/client/views/globals/global-form-view.mjs +477 -1301
- package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
- package/dist/client/views/layout/admin-layout.mjs +83 -246
- package/dist/client/views/layout/admin-router.mjs +458 -1274
- package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
- package/dist/client/views/layout/admin-theme.mjs +30 -64
- package/dist/client/views/layout/admin-view-layout.mjs +40 -144
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +95 -290
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/dashboard-page.mjs +11 -57
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +31 -83
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +35 -90
- package/dist/client/views/pages/login-page.mjs +41 -121
- package/dist/client/views/pages/reset-password-page.mjs +46 -173
- package/dist/client/views/pages/setup-page.mjs +33 -95
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
- package/dist/server/modules/admin/collections/account.d.mts +46 -46
- package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +39 -39
- package/dist/server/modules/admin/collections/session.d.mts +41 -41
- package/dist/server/modules/admin/collections/user.d.mts +63 -63
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/index.d.mts +20 -19
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
- package/dist/server/modules/audit/.generated/module.d.mts +6 -6
- package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
- package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
- 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(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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(
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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" }),
|
|
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(
|
|
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
|
-
},
|
|
89
|
+
}, key);
|
|
171
90
|
}
|
|
172
|
-
if (Array.isArray(
|
|
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:
|
|
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:
|
|
102
|
+
children: val.length
|
|
184
103
|
})]
|
|
185
|
-
},
|
|
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:
|
|
111
|
+
children: label
|
|
193
112
|
})]
|
|
194
113
|
}), /* @__PURE__ */ jsx("span", {
|
|
195
114
|
className: "max-w-[140px] truncate font-medium",
|
|
196
|
-
children: formatPrimitiveValue(
|
|
115
|
+
children: formatPrimitiveValue(val)
|
|
197
116
|
})]
|
|
198
|
-
},
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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],
|
|
371
|
-
})
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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((
|
|
404
|
-
const
|
|
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(
|
|
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
|
-
},
|
|
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(
|
|
423
|
-
}, `item-${String(
|
|
424
|
-
}
|
|
425
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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:
|
|
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
|
-
},
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
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
|