@questpie/admin 3.2.4 → 3.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.d.mts +2 -2
- 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 +61 -72
- 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 +229 -572
- package/dist/client/components/primitives/select-single.mjs +179 -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.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.mjs +86 -321
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/utils/build-field-definitions-from-schema.mjs +4 -2
- 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.d.mts +2 -2
- 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 +116 -356
- 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.d.mts +2 -2
- package/dist/client/views/pages/login-page.mjs +41 -121
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +46 -173
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +33 -95
- package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
- package/dist/server/adapters/index.d.mts +2 -0
- package/dist/server/adapters/nextjs.d.mts +1 -0
- package/dist/server/auth-helpers.d.mts +1 -0
- package/dist/server/modules/admin/.generated/module.d.mts +1 -0
- 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 +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +62 -62
- package/dist/server/modules/admin/collections/verification.d.mts +23 -23
- 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/dist/server.d.mts +2 -0
- package/package.json +3 -5
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
|
|
4
4
|
import { Button } from "../ui/button.mjs";
|
|
5
5
|
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../ui/dialog.mjs";
|
|
6
|
-
import { c } from "react/compiler-runtime";
|
|
7
6
|
import { Icon } from "@iconify/react";
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -32,169 +31,55 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
32
31
|
* />
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
|
-
function ConfirmationDialog(
|
|
36
|
-
const $ = c(49);
|
|
37
|
-
const { open, onOpenChange, config, onConfirm, loading: t1 } = t0;
|
|
38
|
-
const loading = t1 === void 0 ? false : t1;
|
|
34
|
+
function ConfirmationDialog({ open, onOpenChange, config, onConfirm, loading = false }) {
|
|
39
35
|
const { t } = useTranslation();
|
|
40
36
|
const resolveText = useResolveText();
|
|
41
37
|
const [isProcessing, setIsProcessing] = React.useState(false);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
throw _err;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
$[0] = onConfirm;
|
|
57
|
-
$[1] = onOpenChange;
|
|
58
|
-
$[2] = t2;
|
|
59
|
-
} else t2 = $[2];
|
|
60
|
-
const handleConfirm = t2;
|
|
38
|
+
const handleConfirm = async () => {
|
|
39
|
+
setIsProcessing(true);
|
|
40
|
+
try {
|
|
41
|
+
await onConfirm();
|
|
42
|
+
onOpenChange(false);
|
|
43
|
+
setIsProcessing(false);
|
|
44
|
+
} catch (_err) {
|
|
45
|
+
setIsProcessing(false);
|
|
46
|
+
throw _err;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
61
49
|
const isLoading = loading || isProcessing;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
67
|
-
icon: "ph:warning",
|
|
68
|
-
className: "size-5"
|
|
69
|
-
})
|
|
70
|
-
});
|
|
71
|
-
$[3] = config.destructive;
|
|
72
|
-
$[4] = t3;
|
|
73
|
-
} else t3 = $[4];
|
|
74
|
-
let t4;
|
|
75
|
-
if ($[5] !== config.title || $[6] !== resolveText) {
|
|
76
|
-
t4 = resolveText(config.title);
|
|
77
|
-
$[5] = config.title;
|
|
78
|
-
$[6] = resolveText;
|
|
79
|
-
$[7] = t4;
|
|
80
|
-
} else t4 = $[7];
|
|
81
|
-
let t5;
|
|
82
|
-
if ($[8] !== t4) {
|
|
83
|
-
t5 = /* @__PURE__ */ jsx(DialogTitle, { children: t4 });
|
|
84
|
-
$[8] = t4;
|
|
85
|
-
$[9] = t5;
|
|
86
|
-
} else t5 = $[9];
|
|
87
|
-
let t6;
|
|
88
|
-
if ($[10] !== config.description || $[11] !== resolveText) {
|
|
89
|
-
t6 = config.description && /* @__PURE__ */ jsx(DialogDescription, { children: resolveText(config.description) });
|
|
90
|
-
$[10] = config.description;
|
|
91
|
-
$[11] = resolveText;
|
|
92
|
-
$[12] = t6;
|
|
93
|
-
} else t6 = $[12];
|
|
94
|
-
let t7;
|
|
95
|
-
if ($[13] !== t5 || $[14] !== t6) {
|
|
96
|
-
t7 = /* @__PURE__ */ jsxs("div", {
|
|
97
|
-
className: "space-y-1",
|
|
98
|
-
children: [t5, t6]
|
|
99
|
-
});
|
|
100
|
-
$[13] = t5;
|
|
101
|
-
$[14] = t6;
|
|
102
|
-
$[15] = t7;
|
|
103
|
-
} else t7 = $[15];
|
|
104
|
-
let t8;
|
|
105
|
-
if ($[16] !== t3 || $[17] !== t7) {
|
|
106
|
-
t8 = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs("div", {
|
|
107
|
-
className: "flex items-start gap-3",
|
|
108
|
-
children: [t3, t7]
|
|
109
|
-
}) });
|
|
110
|
-
$[16] = t3;
|
|
111
|
-
$[17] = t7;
|
|
112
|
-
$[18] = t8;
|
|
113
|
-
} else t8 = $[18];
|
|
114
|
-
let t9;
|
|
115
|
-
if ($[19] !== onOpenChange) {
|
|
116
|
-
t9 = () => onOpenChange(false);
|
|
117
|
-
$[19] = onOpenChange;
|
|
118
|
-
$[20] = t9;
|
|
119
|
-
} else t9 = $[20];
|
|
120
|
-
let t10;
|
|
121
|
-
if ($[21] !== config.cancelLabel || $[22] !== resolveText || $[23] !== t) {
|
|
122
|
-
t10 = resolveText(config.cancelLabel) || t("common.cancel");
|
|
123
|
-
$[21] = config.cancelLabel;
|
|
124
|
-
$[22] = resolveText;
|
|
125
|
-
$[23] = t;
|
|
126
|
-
$[24] = t10;
|
|
127
|
-
} else t10 = $[24];
|
|
128
|
-
let t11;
|
|
129
|
-
if ($[25] !== isLoading || $[26] !== t10 || $[27] !== t9) {
|
|
130
|
-
t11 = /* @__PURE__ */ jsx(Button, {
|
|
131
|
-
variant: "outline",
|
|
132
|
-
onClick: t9,
|
|
133
|
-
disabled: isLoading,
|
|
134
|
-
children: t10
|
|
135
|
-
});
|
|
136
|
-
$[25] = isLoading;
|
|
137
|
-
$[26] = t10;
|
|
138
|
-
$[27] = t9;
|
|
139
|
-
$[28] = t11;
|
|
140
|
-
} else t11 = $[28];
|
|
141
|
-
const t12 = config.destructive ? "destructive" : "default";
|
|
142
|
-
let t13;
|
|
143
|
-
if ($[29] !== config.confirmLabel || $[30] !== isLoading || $[31] !== resolveText || $[32] !== t) {
|
|
144
|
-
t13 = isLoading ? t("ui.processing") : resolveText(config.confirmLabel) || t("common.confirm");
|
|
145
|
-
$[29] = config.confirmLabel;
|
|
146
|
-
$[30] = isLoading;
|
|
147
|
-
$[31] = resolveText;
|
|
148
|
-
$[32] = t;
|
|
149
|
-
$[33] = t13;
|
|
150
|
-
} else t13 = $[33];
|
|
151
|
-
let t14;
|
|
152
|
-
if ($[34] !== handleConfirm || $[35] !== isLoading || $[36] !== t12 || $[37] !== t13) {
|
|
153
|
-
t14 = /* @__PURE__ */ jsx(Button, {
|
|
154
|
-
variant: t12,
|
|
155
|
-
onClick: handleConfirm,
|
|
156
|
-
disabled: isLoading,
|
|
157
|
-
children: t13
|
|
158
|
-
});
|
|
159
|
-
$[34] = handleConfirm;
|
|
160
|
-
$[35] = isLoading;
|
|
161
|
-
$[36] = t12;
|
|
162
|
-
$[37] = t13;
|
|
163
|
-
$[38] = t14;
|
|
164
|
-
} else t14 = $[38];
|
|
165
|
-
let t15;
|
|
166
|
-
if ($[39] !== t11 || $[40] !== t14) {
|
|
167
|
-
t15 = /* @__PURE__ */ jsxs(DialogFooter, {
|
|
168
|
-
className: "mt-4",
|
|
169
|
-
children: [t11, t14]
|
|
170
|
-
});
|
|
171
|
-
$[39] = t11;
|
|
172
|
-
$[40] = t14;
|
|
173
|
-
$[41] = t15;
|
|
174
|
-
} else t15 = $[41];
|
|
175
|
-
let t16;
|
|
176
|
-
if ($[42] !== t15 || $[43] !== t8) {
|
|
177
|
-
t16 = /* @__PURE__ */ jsxs(DialogContent, {
|
|
50
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
51
|
+
open,
|
|
52
|
+
onOpenChange,
|
|
53
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
178
54
|
className: "qa-confirmation-dialog sm:max-w-[425px]",
|
|
179
|
-
children: [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
55
|
+
children: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs("div", {
|
|
56
|
+
className: "flex items-start gap-3",
|
|
57
|
+
children: [config.destructive && /* @__PURE__ */ jsx("div", {
|
|
58
|
+
className: "border-border-subtle bg-surface-low text-foreground-subtle flex size-10 shrink-0 items-center justify-center rounded-full border",
|
|
59
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
60
|
+
icon: "ph:warning",
|
|
61
|
+
className: "size-5"
|
|
62
|
+
})
|
|
63
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: "space-y-1",
|
|
65
|
+
children: [/* @__PURE__ */ jsx(DialogTitle, { children: resolveText(config.title) }), config.description && /* @__PURE__ */ jsx(DialogDescription, { children: resolveText(config.description) })]
|
|
66
|
+
})]
|
|
67
|
+
}) }), /* @__PURE__ */ jsxs(DialogFooter, {
|
|
68
|
+
className: "mt-4",
|
|
69
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
70
|
+
variant: "outline",
|
|
71
|
+
onClick: () => onOpenChange(false),
|
|
72
|
+
disabled: isLoading,
|
|
73
|
+
children: resolveText(config.cancelLabel) || t("common.cancel")
|
|
74
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
75
|
+
variant: config.destructive ? "destructive" : "default",
|
|
76
|
+
onClick: handleConfirm,
|
|
77
|
+
disabled: isLoading,
|
|
78
|
+
children: isLoading ? t("ui.processing") : resolveText(config.confirmLabel) || t("common.confirm")
|
|
79
|
+
})]
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
});
|
|
198
83
|
}
|
|
199
84
|
|
|
200
85
|
//#endregion
|
|
@@ -4,9 +4,8 @@ import { selectAuthClient, useAdminStore } from "../../runtime/provider.mjs";
|
|
|
4
4
|
import { Button } from "../ui/button.mjs";
|
|
5
5
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuTrigger } from "../ui/dropdown-menu.mjs";
|
|
6
6
|
import { ActionButton } from "./action-button.mjs";
|
|
7
|
-
import { c } from "react/compiler-runtime";
|
|
8
7
|
import { Icon } from "@iconify/react";
|
|
9
|
-
import "react";
|
|
8
|
+
import * as React from "react";
|
|
10
9
|
import { useQueryClient } from "@tanstack/react-query";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
11
|
|
|
@@ -36,173 +35,82 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
36
35
|
* />
|
|
37
36
|
* ```
|
|
38
37
|
*/
|
|
39
|
-
function HeaderActions(
|
|
40
|
-
const $ = c(37);
|
|
41
|
-
const { actions, collection, helpers, onOpenDialog } = t0;
|
|
38
|
+
function HeaderActions({ actions, collection, helpers, onOpenDialog }) {
|
|
42
39
|
const authClient = useAdminStore(selectAuthClient);
|
|
43
40
|
const queryClient = useQueryClient();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
const actionQueryClient = React.useMemo(() => ({
|
|
42
|
+
invalidateQueries: (filters) => queryClient.invalidateQueries(filters),
|
|
43
|
+
refetchQueries: (filters) => queryClient.refetchQueries(filters),
|
|
44
|
+
resetQueries: (filters) => queryClient.resetQueries(filters)
|
|
45
|
+
}), [queryClient]);
|
|
46
|
+
const ctx = React.useMemo(() => ({
|
|
47
|
+
collection,
|
|
48
|
+
helpers,
|
|
49
|
+
queryClient: actionQueryClient,
|
|
50
|
+
authClient
|
|
51
|
+
}), [
|
|
52
|
+
collection,
|
|
53
|
+
helpers,
|
|
54
|
+
actionQueryClient,
|
|
55
|
+
authClient
|
|
56
|
+
]);
|
|
57
|
+
const filterVisible = React.useCallback((actionList) => {
|
|
58
|
+
if (!actionList) return [];
|
|
59
|
+
return actionList.filter((action) => {
|
|
60
|
+
if (action.visible === void 0) return true;
|
|
61
|
+
if (typeof action.visible === "function") return action.visible(ctx);
|
|
62
|
+
return action.visible;
|
|
63
|
+
});
|
|
64
|
+
}, [ctx]);
|
|
65
|
+
const visiblePrimary = React.useMemo(() => filterVisible(actions.primary), [actions.primary, filterVisible]);
|
|
66
|
+
const visibleSecondary = React.useMemo(() => filterVisible(actions.secondary), [actions.secondary, filterVisible]);
|
|
67
|
+
const regularSecondary = visibleSecondary.filter((a) => a.variant !== "destructive");
|
|
68
|
+
const destructiveSecondary = visibleSecondary.filter((a) => a.variant === "destructive");
|
|
69
|
+
if (visiblePrimary.length === 0 && visibleSecondary.length === 0) return null;
|
|
70
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
71
|
+
className: "qa-header-actions flex items-center gap-1.5",
|
|
72
|
+
children: [visiblePrimary.map((action) => /* @__PURE__ */ jsx(ActionButton, {
|
|
73
|
+
action,
|
|
58
74
|
collection,
|
|
59
75
|
helpers,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
} else t5 = $[14];
|
|
99
|
-
const visibleSecondary = t5;
|
|
100
|
-
let t6;
|
|
101
|
-
let t7;
|
|
102
|
-
let t8;
|
|
103
|
-
let t9;
|
|
104
|
-
if ($[15] !== collection || $[16] !== helpers || $[17] !== onOpenDialog || $[18] !== visiblePrimary || $[19] !== visibleSecondary) {
|
|
105
|
-
t9 = Symbol.for("react.early_return_sentinel");
|
|
106
|
-
bb0: {
|
|
107
|
-
const regularSecondary = visibleSecondary.filter(_temp);
|
|
108
|
-
const destructiveSecondary = visibleSecondary.filter(_temp2);
|
|
109
|
-
if (visiblePrimary.length === 0 && visibleSecondary.length === 0) {
|
|
110
|
-
t9 = null;
|
|
111
|
-
break bb0;
|
|
112
|
-
}
|
|
113
|
-
t6 = "qa-header-actions flex items-center gap-1.5";
|
|
114
|
-
if ($[24] !== collection || $[25] !== helpers || $[26] !== onOpenDialog || $[27] !== visiblePrimary) {
|
|
115
|
-
let t10$1;
|
|
116
|
-
if ($[29] !== collection || $[30] !== helpers || $[31] !== onOpenDialog) {
|
|
117
|
-
t10$1 = (action_0) => /* @__PURE__ */ jsx(ActionButton, {
|
|
118
|
-
action: action_0,
|
|
119
|
-
collection,
|
|
120
|
-
helpers,
|
|
121
|
-
size: "sm",
|
|
122
|
-
onOpenDialog
|
|
123
|
-
}, action_0.id);
|
|
124
|
-
$[29] = collection;
|
|
125
|
-
$[30] = helpers;
|
|
126
|
-
$[31] = onOpenDialog;
|
|
127
|
-
$[32] = t10$1;
|
|
128
|
-
} else t10$1 = $[32];
|
|
129
|
-
t7 = visiblePrimary.map(t10$1);
|
|
130
|
-
$[24] = collection;
|
|
131
|
-
$[25] = helpers;
|
|
132
|
-
$[26] = onOpenDialog;
|
|
133
|
-
$[27] = visiblePrimary;
|
|
134
|
-
$[28] = t7;
|
|
135
|
-
} else t7 = $[28];
|
|
136
|
-
t8 = visibleSecondary.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
137
|
-
nativeButton: false,
|
|
138
|
-
render: /* @__PURE__ */ jsx(Button, {
|
|
139
|
-
variant: "outline",
|
|
140
|
-
size: "icon-sm"
|
|
141
|
-
}),
|
|
142
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
143
|
-
icon: "ph:dots-three-vertical",
|
|
144
|
-
className: "size-3.5"
|
|
145
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
146
|
-
className: "sr-only",
|
|
147
|
-
children: "More actions"
|
|
148
|
-
})]
|
|
149
|
-
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
150
|
-
align: "end",
|
|
151
|
-
children: [
|
|
152
|
-
regularSecondary.map((action_1) => /* @__PURE__ */ jsx(ActionButton, {
|
|
153
|
-
action: action_1,
|
|
154
|
-
collection,
|
|
155
|
-
helpers,
|
|
156
|
-
size: "sm",
|
|
157
|
-
presentation: "menu",
|
|
158
|
-
onOpenDialog
|
|
159
|
-
}, action_1.id)),
|
|
160
|
-
regularSecondary.length > 0 && destructiveSecondary.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
161
|
-
destructiveSecondary.map((action_2) => /* @__PURE__ */ jsx(ActionButton, {
|
|
162
|
-
action: action_2,
|
|
163
|
-
collection,
|
|
164
|
-
helpers,
|
|
165
|
-
size: "sm",
|
|
166
|
-
presentation: "menu",
|
|
167
|
-
onOpenDialog
|
|
168
|
-
}, action_2.id))
|
|
169
|
-
]
|
|
170
|
-
})] });
|
|
171
|
-
}
|
|
172
|
-
$[15] = collection;
|
|
173
|
-
$[16] = helpers;
|
|
174
|
-
$[17] = onOpenDialog;
|
|
175
|
-
$[18] = visiblePrimary;
|
|
176
|
-
$[19] = visibleSecondary;
|
|
177
|
-
$[20] = t6;
|
|
178
|
-
$[21] = t7;
|
|
179
|
-
$[22] = t8;
|
|
180
|
-
$[23] = t9;
|
|
181
|
-
} else {
|
|
182
|
-
t6 = $[20];
|
|
183
|
-
t7 = $[21];
|
|
184
|
-
t8 = $[22];
|
|
185
|
-
t9 = $[23];
|
|
186
|
-
}
|
|
187
|
-
if (t9 !== Symbol.for("react.early_return_sentinel")) return t9;
|
|
188
|
-
let t10;
|
|
189
|
-
if ($[33] !== t6 || $[34] !== t7 || $[35] !== t8) {
|
|
190
|
-
t10 = /* @__PURE__ */ jsxs("div", {
|
|
191
|
-
className: t6,
|
|
192
|
-
children: [t7, t8]
|
|
193
|
-
});
|
|
194
|
-
$[33] = t6;
|
|
195
|
-
$[34] = t7;
|
|
196
|
-
$[35] = t8;
|
|
197
|
-
$[36] = t10;
|
|
198
|
-
} else t10 = $[36];
|
|
199
|
-
return t10;
|
|
200
|
-
}
|
|
201
|
-
function _temp2(a_0) {
|
|
202
|
-
return a_0.variant === "destructive";
|
|
203
|
-
}
|
|
204
|
-
function _temp(a) {
|
|
205
|
-
return a.variant !== "destructive";
|
|
76
|
+
size: "sm",
|
|
77
|
+
onOpenDialog
|
|
78
|
+
}, action.id)), visibleSecondary.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
79
|
+
nativeButton: false,
|
|
80
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
81
|
+
variant: "outline",
|
|
82
|
+
size: "icon-sm"
|
|
83
|
+
}),
|
|
84
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
85
|
+
icon: "ph:dots-three-vertical",
|
|
86
|
+
className: "size-3.5"
|
|
87
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
88
|
+
className: "sr-only",
|
|
89
|
+
children: "More actions"
|
|
90
|
+
})]
|
|
91
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
92
|
+
align: "end",
|
|
93
|
+
children: [
|
|
94
|
+
regularSecondary.map((action) => /* @__PURE__ */ jsx(ActionButton, {
|
|
95
|
+
action,
|
|
96
|
+
collection,
|
|
97
|
+
helpers,
|
|
98
|
+
size: "sm",
|
|
99
|
+
presentation: "menu",
|
|
100
|
+
onOpenDialog
|
|
101
|
+
}, action.id)),
|
|
102
|
+
regularSecondary.length > 0 && destructiveSecondary.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
103
|
+
destructiveSecondary.map((action) => /* @__PURE__ */ jsx(ActionButton, {
|
|
104
|
+
action,
|
|
105
|
+
collection,
|
|
106
|
+
helpers,
|
|
107
|
+
size: "sm",
|
|
108
|
+
presentation: "menu",
|
|
109
|
+
onOpenDialog
|
|
110
|
+
}, action.id))
|
|
111
|
+
]
|
|
112
|
+
})] })]
|
|
113
|
+
});
|
|
206
114
|
}
|
|
207
115
|
|
|
208
116
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollectionNames, GlobalNames } from "../builder/index.mjs";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
4
4
|
import { QuestpieApp } from "questpie/client";
|
|
5
5
|
|
|
6
6
|
//#region src/client/components/admin-link.d.ts
|
|
@@ -61,6 +61,6 @@ declare function AdminLink<TApp extends QuestpieApp>({
|
|
|
61
61
|
children,
|
|
62
62
|
onClick,
|
|
63
63
|
...rest
|
|
64
|
-
}: AdminLinkProps<TApp>):
|
|
64
|
+
}: AdminLinkProps<TApp>): react_jsx_runtime11.JSX.Element;
|
|
65
65
|
//#endregion
|
|
66
66
|
export { AdminLink };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getAdminLinkHref, useAdminRoutes } from "../hooks/use-admin-routes.mjs";
|
|
2
|
-
import
|
|
3
|
-
import "react";
|
|
2
|
+
import * as React from "react";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
|
|
6
5
|
//#region src/client/components/admin-link.tsx
|
|
@@ -28,79 +27,31 @@ import { jsx } from "react/jsx-runtime";
|
|
|
28
27
|
* <AdminLink pageId="analytics">Analytics</AdminLink>
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
31
|
-
function AdminLink(
|
|
32
|
-
const $ = c(29);
|
|
33
|
-
let action;
|
|
34
|
-
let children;
|
|
35
|
-
let collection;
|
|
36
|
-
let customHref;
|
|
37
|
-
let global;
|
|
38
|
-
let id;
|
|
39
|
-
let onClick;
|
|
40
|
-
let pageId;
|
|
41
|
-
let rest;
|
|
42
|
-
let t1;
|
|
43
|
-
let to;
|
|
44
|
-
if ($[0] !== t0) {
|
|
45
|
-
({to, collection, action, id, global, pageId, href: customHref, useNavigate: t1, children, onClick, ...rest} = t0);
|
|
46
|
-
$[0] = t0;
|
|
47
|
-
$[1] = action;
|
|
48
|
-
$[2] = children;
|
|
49
|
-
$[3] = collection;
|
|
50
|
-
$[4] = customHref;
|
|
51
|
-
$[5] = global;
|
|
52
|
-
$[6] = id;
|
|
53
|
-
$[7] = onClick;
|
|
54
|
-
$[8] = pageId;
|
|
55
|
-
$[9] = rest;
|
|
56
|
-
$[10] = t1;
|
|
57
|
-
$[11] = to;
|
|
58
|
-
} else {
|
|
59
|
-
action = $[1];
|
|
60
|
-
children = $[2];
|
|
61
|
-
collection = $[3];
|
|
62
|
-
customHref = $[4];
|
|
63
|
-
global = $[5];
|
|
64
|
-
id = $[6];
|
|
65
|
-
onClick = $[7];
|
|
66
|
-
pageId = $[8];
|
|
67
|
-
rest = $[9];
|
|
68
|
-
t1 = $[10];
|
|
69
|
-
to = $[11];
|
|
70
|
-
}
|
|
71
|
-
const useNavigate = t1 === void 0 ? false : t1;
|
|
30
|
+
function AdminLink({ to, collection, action, id, global, pageId, href: customHref, useNavigate = false, children, onClick, ...rest }) {
|
|
72
31
|
const { routes } = useAdminRoutes();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
$[19] = t3$1;
|
|
97
|
-
} else t3$1 = $[19];
|
|
98
|
-
t2 = t3$1;
|
|
99
|
-
}
|
|
100
|
-
const href = t2;
|
|
101
|
-
let t3;
|
|
102
|
-
if ($[20] !== href || $[21] !== onClick || $[22] !== useNavigate) {
|
|
103
|
-
t3 = (e) => {
|
|
32
|
+
const href = React.useMemo(() => {
|
|
33
|
+
if (customHref) return customHref;
|
|
34
|
+
return getAdminLinkHref(routes, {
|
|
35
|
+
to,
|
|
36
|
+
collection,
|
|
37
|
+
action,
|
|
38
|
+
id,
|
|
39
|
+
global,
|
|
40
|
+
pageId
|
|
41
|
+
});
|
|
42
|
+
}, [
|
|
43
|
+
customHref,
|
|
44
|
+
to,
|
|
45
|
+
collection,
|
|
46
|
+
action,
|
|
47
|
+
id,
|
|
48
|
+
global,
|
|
49
|
+
pageId,
|
|
50
|
+
routes
|
|
51
|
+
]);
|
|
52
|
+
return /* @__PURE__ */ jsx("a", {
|
|
53
|
+
href,
|
|
54
|
+
onClick: React.useCallback((e) => {
|
|
104
55
|
if (onClick) onClick(e);
|
|
105
56
|
if (useNavigate && !e.defaultPrevented) {
|
|
106
57
|
e.preventDefault();
|
|
@@ -109,62 +60,25 @@ function AdminLink(t0) {
|
|
|
109
60
|
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
110
61
|
}
|
|
111
62
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if ($[24] !== children || $[25] !== handleClick || $[26] !== href || $[27] !== rest) {
|
|
121
|
-
t4 = /* @__PURE__ */ jsx("a", {
|
|
122
|
-
href,
|
|
123
|
-
onClick: handleClick,
|
|
124
|
-
...rest,
|
|
125
|
-
children
|
|
126
|
-
});
|
|
127
|
-
$[24] = children;
|
|
128
|
-
$[25] = handleClick;
|
|
129
|
-
$[26] = href;
|
|
130
|
-
$[27] = rest;
|
|
131
|
-
$[28] = t4;
|
|
132
|
-
} else t4 = $[28];
|
|
133
|
-
return t4;
|
|
63
|
+
}, [
|
|
64
|
+
onClick,
|
|
65
|
+
useNavigate,
|
|
66
|
+
href
|
|
67
|
+
]),
|
|
68
|
+
...rest,
|
|
69
|
+
children
|
|
70
|
+
});
|
|
134
71
|
}
|
|
135
72
|
/**
|
|
136
73
|
* Link to edit an item in a collection
|
|
137
74
|
*/
|
|
138
|
-
function CollectionEditLink(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
$[0] = t0;
|
|
146
|
-
$[1] = collection;
|
|
147
|
-
$[2] = id;
|
|
148
|
-
$[3] = rest;
|
|
149
|
-
} else {
|
|
150
|
-
collection = $[1];
|
|
151
|
-
id = $[2];
|
|
152
|
-
rest = $[3];
|
|
153
|
-
}
|
|
154
|
-
let t1;
|
|
155
|
-
if ($[4] !== collection || $[5] !== id || $[6] !== rest) {
|
|
156
|
-
t1 = /* @__PURE__ */ jsx(AdminLink, {
|
|
157
|
-
collection,
|
|
158
|
-
action: "edit",
|
|
159
|
-
id,
|
|
160
|
-
...rest
|
|
161
|
-
});
|
|
162
|
-
$[4] = collection;
|
|
163
|
-
$[5] = id;
|
|
164
|
-
$[6] = rest;
|
|
165
|
-
$[7] = t1;
|
|
166
|
-
} else t1 = $[7];
|
|
167
|
-
return t1;
|
|
75
|
+
function CollectionEditLink({ collection, id, ...rest }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(AdminLink, {
|
|
77
|
+
collection,
|
|
78
|
+
action: "edit",
|
|
79
|
+
id,
|
|
80
|
+
...rest
|
|
81
|
+
});
|
|
168
82
|
}
|
|
169
83
|
|
|
170
84
|
//#endregion
|