@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockContent } from "./types.mjs";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/client/blocks/block-renderer.d.ts
|
|
6
6
|
|
|
@@ -50,6 +50,6 @@ declare function BlockRenderer({
|
|
|
50
50
|
onBlockClick,
|
|
51
51
|
onBlockInsert,
|
|
52
52
|
className
|
|
53
|
-
}: BlockRendererProps):
|
|
53
|
+
}: BlockRendererProps): react_jsx_runtime19.JSX.Element | null;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { BlockRenderer, BlockRendererProps };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.mjs";
|
|
2
2
|
import { BlockScopeProvider } from "../preview/block-scope-context.mjs";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import * as React from "react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
|
|
@@ -34,126 +33,85 @@ const EMPTY_DATA = {};
|
|
|
34
33
|
* registered renderer component. Layout blocks receive their rendered
|
|
35
34
|
* children as the `children` prop.
|
|
36
35
|
*/
|
|
37
|
-
function BlockRenderer(
|
|
38
|
-
const $ = c(13);
|
|
39
|
-
const { content, renderers, data, selectedBlockId, onBlockClick, onBlockInsert, className } = t0;
|
|
36
|
+
function BlockRenderer({ content, renderers, data, selectedBlockId, onBlockClick, onBlockInsert, className }) {
|
|
40
37
|
const resolvedData = data ?? EMPTY_DATA;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!renderFn) {
|
|
50
|
-
if (process.env.NODE_ENV !== "production") console.warn(`[BlockRenderer] No renderer found for block type "${node.type}"`);
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
const values = content._values[node.id] || {};
|
|
54
|
-
const blockData = resolvedData[node.id];
|
|
55
|
-
const isSelected = selectedBlockId === node.id;
|
|
56
|
-
const renderedChildren = node.children.length > 0 ? node.children.map((child, childIndex) => renderBlock(child, node.id, childIndex)) : void 0;
|
|
57
|
-
const blockElement = /* @__PURE__ */ jsx(renderFn, {
|
|
58
|
-
id: node.id,
|
|
59
|
-
type: node.type,
|
|
60
|
-
values,
|
|
61
|
-
data: blockData,
|
|
62
|
-
children: renderedChildren
|
|
63
|
-
});
|
|
64
|
-
const scopedBlockElement = /* @__PURE__ */ jsx(BlockScopeProvider, {
|
|
65
|
-
blockId: node.id,
|
|
66
|
-
basePath: "content._values",
|
|
67
|
-
children: blockElement
|
|
68
|
-
});
|
|
69
|
-
if (onBlockClick) return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(PreviewBlockWrapper, {
|
|
70
|
-
id: node.id,
|
|
71
|
-
isSelected,
|
|
72
|
-
onBlockClick,
|
|
73
|
-
type: node.type,
|
|
74
|
-
children: scopedBlockElement
|
|
75
|
-
}), onBlockInsert && /* @__PURE__ */ jsx(PreviewBlockInsertControl, {
|
|
76
|
-
onBlockInsert,
|
|
77
|
-
parentId,
|
|
78
|
-
referenceBlockId: node.id,
|
|
79
|
-
insertIndex: index + 1
|
|
80
|
-
})] }, node.id);
|
|
81
|
-
return /* @__PURE__ */ jsx("div", {
|
|
82
|
-
"data-block-id": node.id,
|
|
83
|
-
"data-block-type": node.type,
|
|
84
|
-
children: scopedBlockElement
|
|
85
|
-
}, node.id);
|
|
86
|
-
}
|
|
87
|
-
if (!content?._tree?.length) {
|
|
88
|
-
t3 = null;
|
|
89
|
-
break bb0;
|
|
90
|
-
}
|
|
91
|
-
t1 = className;
|
|
92
|
-
t2 = content._tree.map((node_0, index_0) => renderBlock(node_0, null, index_0));
|
|
38
|
+
/**
|
|
39
|
+
* Recursively render a block node.
|
|
40
|
+
*/
|
|
41
|
+
function renderBlock(node, parentId, index) {
|
|
42
|
+
const renderFn = renderers[node.type] ?? renderers[kebabToCamelCase(node.type)];
|
|
43
|
+
if (!renderFn) {
|
|
44
|
+
if (process.env.NODE_ENV !== "production") console.warn(`[BlockRenderer] No renderer found for block type "${node.type}"`);
|
|
45
|
+
return null;
|
|
93
46
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (t3 !== Symbol.for("react.early_return_sentinel")) return t3;
|
|
110
|
-
let t4;
|
|
111
|
-
if ($[10] !== t1 || $[11] !== t2) {
|
|
112
|
-
t4 = /* @__PURE__ */ jsx("div", {
|
|
113
|
-
className: t1,
|
|
114
|
-
children: t2
|
|
47
|
+
const values = content._values[node.id] || {};
|
|
48
|
+
const blockData = resolvedData[node.id];
|
|
49
|
+
const isSelected = selectedBlockId === node.id;
|
|
50
|
+
const renderedChildren = node.children.length > 0 ? node.children.map((child, childIndex) => renderBlock(child, node.id, childIndex)) : void 0;
|
|
51
|
+
const blockElement = /* @__PURE__ */ jsx(renderFn, {
|
|
52
|
+
id: node.id,
|
|
53
|
+
type: node.type,
|
|
54
|
+
values,
|
|
55
|
+
data: blockData,
|
|
56
|
+
children: renderedChildren
|
|
57
|
+
});
|
|
58
|
+
const scopedBlockElement = /* @__PURE__ */ jsx(BlockScopeProvider, {
|
|
59
|
+
blockId: node.id,
|
|
60
|
+
basePath: "content._values",
|
|
61
|
+
children: blockElement
|
|
115
62
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
63
|
+
if (onBlockClick) return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(PreviewBlockWrapper, {
|
|
64
|
+
id: node.id,
|
|
65
|
+
isSelected,
|
|
66
|
+
onBlockClick,
|
|
67
|
+
type: node.type,
|
|
68
|
+
children: scopedBlockElement
|
|
69
|
+
}), onBlockInsert && /* @__PURE__ */ jsx(PreviewBlockInsertControl, {
|
|
70
|
+
onBlockInsert,
|
|
71
|
+
parentId,
|
|
72
|
+
referenceBlockId: node.id,
|
|
73
|
+
insertIndex: index + 1
|
|
74
|
+
})] }, node.id);
|
|
75
|
+
return /* @__PURE__ */ jsx("div", {
|
|
76
|
+
"data-block-id": node.id,
|
|
77
|
+
"data-block-type": node.type,
|
|
78
|
+
children: scopedBlockElement
|
|
79
|
+
}, node.id);
|
|
80
|
+
}
|
|
81
|
+
if (!content?._tree?.length) return null;
|
|
82
|
+
return /* @__PURE__ */ jsx("div", {
|
|
83
|
+
className,
|
|
84
|
+
children: content._tree.map((node, index) => renderBlock(node, null, index))
|
|
85
|
+
});
|
|
121
86
|
}
|
|
122
|
-
function PreviewBlockInsertControl(
|
|
123
|
-
const $ = c(29);
|
|
124
|
-
const { insertIndex, onBlockInsert, parentId, referenceBlockId } = t0;
|
|
87
|
+
function PreviewBlockInsertControl({ insertIndex, onBlockInsert, parentId, referenceBlockId }) {
|
|
125
88
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
t2 = () => setIsHovered(true);
|
|
153
|
-
t3 = () => setIsHovered(false);
|
|
154
|
-
t4 = () => setIsHovered(true);
|
|
155
|
-
t5 = () => setIsHovered(false);
|
|
156
|
-
t6 = {
|
|
89
|
+
const previewRingColor = "var(--ring, var(--highlight, #b700ff))";
|
|
90
|
+
const softRingColor = `color-mix(in srgb, ${previewRingColor} 34%, transparent)`;
|
|
91
|
+
const mutedRingColor = `color-mix(in srgb, ${previewRingColor} 12%, transparent)`;
|
|
92
|
+
const handleInsert = React.useCallback((event) => {
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
event.stopPropagation();
|
|
95
|
+
onBlockInsert({
|
|
96
|
+
position: {
|
|
97
|
+
parentId,
|
|
98
|
+
index: insertIndex
|
|
99
|
+
},
|
|
100
|
+
referenceBlockId
|
|
101
|
+
});
|
|
102
|
+
}, [
|
|
103
|
+
insertIndex,
|
|
104
|
+
onBlockInsert,
|
|
105
|
+
parentId,
|
|
106
|
+
referenceBlockId
|
|
107
|
+
]);
|
|
108
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
109
|
+
"data-preview-block-insert": "",
|
|
110
|
+
onMouseEnter: () => setIsHovered(true),
|
|
111
|
+
onMouseLeave: () => setIsHovered(false),
|
|
112
|
+
onFocus: () => setIsHovered(true),
|
|
113
|
+
onBlur: () => setIsHovered(false),
|
|
114
|
+
style: {
|
|
157
115
|
alignItems: "center",
|
|
158
116
|
display: "flex",
|
|
159
117
|
height: 24,
|
|
@@ -163,250 +121,117 @@ function PreviewBlockInsertControl(t0) {
|
|
|
163
121
|
pointerEvents: "auto",
|
|
164
122
|
position: "relative",
|
|
165
123
|
zIndex: 40
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
$[6] = t3;
|
|
169
|
-
$[7] = t4;
|
|
170
|
-
$[8] = t5;
|
|
171
|
-
$[9] = t6;
|
|
172
|
-
} else {
|
|
173
|
-
t2 = $[5];
|
|
174
|
-
t3 = $[6];
|
|
175
|
-
t4 = $[7];
|
|
176
|
-
t5 = $[8];
|
|
177
|
-
t6 = $[9];
|
|
178
|
-
}
|
|
179
|
-
const t7 = isHovered ? .82 : 0;
|
|
180
|
-
const t8 = isHovered ? "translateX(-50%) scaleX(1)" : "translateX(-50%) scaleX(0.58)";
|
|
181
|
-
let t9;
|
|
182
|
-
if ($[10] !== t7 || $[11] !== t8) {
|
|
183
|
-
t9 = /* @__PURE__ */ jsx("span", {
|
|
124
|
+
},
|
|
125
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
184
126
|
"aria-hidden": "true",
|
|
185
127
|
style: {
|
|
186
|
-
background:
|
|
128
|
+
background: `linear-gradient(90deg, transparent, ${softRingColor}, transparent)`,
|
|
187
129
|
height: 1,
|
|
188
130
|
left: "50%",
|
|
189
|
-
opacity:
|
|
131
|
+
opacity: isHovered ? .82 : 0,
|
|
190
132
|
position: "absolute",
|
|
191
|
-
transform:
|
|
133
|
+
transform: isHovered ? "translateX(-50%) scaleX(1)" : "translateX(-50%) scaleX(0.58)",
|
|
192
134
|
transformOrigin: "center",
|
|
193
135
|
transition: "opacity 140ms ease, transform 140ms ease",
|
|
194
136
|
width: "min(240px, calc(100% - 48px))"
|
|
195
137
|
}
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
t10 = (event_0) => {
|
|
204
|
-
if (event_0.key === "Enter" || event_0.key === " ") handleInsert(event_0);
|
|
205
|
-
};
|
|
206
|
-
$[13] = handleInsert;
|
|
207
|
-
$[14] = t10;
|
|
208
|
-
} else t10 = $[14];
|
|
209
|
-
const t11 = isHovered ? 1 : .28;
|
|
210
|
-
const t12 = isHovered ? "scale(1)" : "scale(0.92)";
|
|
211
|
-
let t13;
|
|
212
|
-
if ($[15] !== t11 || $[16] !== t12) {
|
|
213
|
-
t13 = {
|
|
214
|
-
alignItems: "center",
|
|
215
|
-
background: "transparent",
|
|
216
|
-
border: 0,
|
|
217
|
-
borderRadius: 999,
|
|
218
|
-
color: "var(--ring, var(--highlight, #b700ff))",
|
|
219
|
-
cursor: "pointer",
|
|
220
|
-
display: "inline-flex",
|
|
221
|
-
height: 32,
|
|
222
|
-
justifyContent: "center",
|
|
223
|
-
lineHeight: 1,
|
|
224
|
-
opacity: t11,
|
|
225
|
-
outline: "none",
|
|
226
|
-
padding: 0,
|
|
227
|
-
pointerEvents: "auto",
|
|
228
|
-
position: "relative",
|
|
229
|
-
transition: "opacity 140ms ease, transform 140ms ease",
|
|
230
|
-
transform: t12,
|
|
231
|
-
width: 40
|
|
232
|
-
};
|
|
233
|
-
$[15] = t11;
|
|
234
|
-
$[16] = t12;
|
|
235
|
-
$[17] = t13;
|
|
236
|
-
} else t13 = $[17];
|
|
237
|
-
const t14 = `1px solid ${isHovered ? "color-mix(in srgb, var(--ring, var(--highlight, #b700ff)) 34%, transparent)" : "color-mix(in srgb, var(--ring, var(--highlight, #b700ff)) 12%, transparent)"}`;
|
|
238
|
-
const t15 = isHovered ? "0 0 0 3px color-mix(in srgb, var(--ring, var(--highlight, #b700ff)) 8%, transparent), 0 5px 14px rgba(0, 0, 0, 0.12)" : "0 2px 8px rgba(0, 0, 0, 0.10)";
|
|
239
|
-
let t16;
|
|
240
|
-
if ($[18] !== t14 || $[19] !== t15) {
|
|
241
|
-
t16 = /* @__PURE__ */ jsx("span", {
|
|
242
|
-
"aria-hidden": "true",
|
|
138
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
139
|
+
type: "button",
|
|
140
|
+
"aria-label": "Add block here",
|
|
141
|
+
onClick: handleInsert,
|
|
142
|
+
onKeyDown: (event) => {
|
|
143
|
+
if (event.key === "Enter" || event.key === " ") handleInsert(event);
|
|
144
|
+
},
|
|
243
145
|
style: {
|
|
244
146
|
alignItems: "center",
|
|
245
|
-
background: "
|
|
246
|
-
border:
|
|
147
|
+
background: "transparent",
|
|
148
|
+
border: 0,
|
|
247
149
|
borderRadius: 999,
|
|
248
|
-
|
|
150
|
+
color: previewRingColor,
|
|
151
|
+
cursor: "pointer",
|
|
249
152
|
display: "inline-flex",
|
|
250
|
-
|
|
251
|
-
fontWeight: 500,
|
|
252
|
-
height: 24,
|
|
153
|
+
height: 32,
|
|
253
154
|
justifyContent: "center",
|
|
254
|
-
|
|
255
|
-
|
|
155
|
+
lineHeight: 1,
|
|
156
|
+
opacity: isHovered ? 1 : .28,
|
|
157
|
+
outline: "none",
|
|
158
|
+
padding: 0,
|
|
159
|
+
pointerEvents: "auto",
|
|
160
|
+
position: "relative",
|
|
161
|
+
transition: "opacity 140ms ease, transform 140ms ease",
|
|
162
|
+
transform: isHovered ? "scale(1)" : "scale(0.92)",
|
|
163
|
+
width: 40
|
|
256
164
|
},
|
|
257
|
-
children: "
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
$[25] = t17;
|
|
278
|
-
} else t17 = $[25];
|
|
279
|
-
let t18;
|
|
280
|
-
if ($[26] !== t17 || $[27] !== t9) {
|
|
281
|
-
t18 = /* @__PURE__ */ jsxs("div", {
|
|
282
|
-
"data-preview-block-insert": "",
|
|
283
|
-
onMouseEnter: t2,
|
|
284
|
-
onMouseLeave: t3,
|
|
285
|
-
onFocus: t4,
|
|
286
|
-
onBlur: t5,
|
|
287
|
-
style: t6,
|
|
288
|
-
children: [t9, t17]
|
|
289
|
-
});
|
|
290
|
-
$[26] = t17;
|
|
291
|
-
$[27] = t9;
|
|
292
|
-
$[28] = t18;
|
|
293
|
-
} else t18 = $[28];
|
|
294
|
-
return t18;
|
|
165
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
style: {
|
|
168
|
+
alignItems: "center",
|
|
169
|
+
background: "var(--background, #fff)",
|
|
170
|
+
border: `1px solid ${isHovered ? softRingColor : mutedRingColor}`,
|
|
171
|
+
borderRadius: 999,
|
|
172
|
+
boxShadow: isHovered ? `0 0 0 3px color-mix(in srgb, ${previewRingColor} 8%, transparent), 0 5px 14px rgba(0, 0, 0, 0.12)` : "0 2px 8px rgba(0, 0, 0, 0.10)",
|
|
173
|
+
display: "inline-flex",
|
|
174
|
+
fontSize: 13,
|
|
175
|
+
fontWeight: 500,
|
|
176
|
+
height: 24,
|
|
177
|
+
justifyContent: "center",
|
|
178
|
+
transition: "border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease",
|
|
179
|
+
width: 24
|
|
180
|
+
},
|
|
181
|
+
children: "+"
|
|
182
|
+
})
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
295
185
|
}
|
|
296
|
-
function PreviewBlockWrapper(
|
|
297
|
-
const $ = c(25);
|
|
298
|
-
const { children, id, isSelected, onBlockClick, type } = t0;
|
|
186
|
+
function PreviewBlockWrapper({ children, id, isSelected, onBlockClick, type }) {
|
|
299
187
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
300
188
|
const [hasDomFocus, setHasDomFocus] = React.useState(false);
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (target?.closest("[data-preview-field]")) return;
|
|
326
|
-
const closestBlock = target?.closest("[data-block-id]");
|
|
327
|
-
if (closestBlock && closestBlock !== e.currentTarget) return;
|
|
189
|
+
const shouldShowAffordance = isHovered || hasDomFocus || isSelected;
|
|
190
|
+
const previewRingColor = "var(--ring, var(--highlight, #b700ff))";
|
|
191
|
+
const previewStyle = React.useMemo(() => ({
|
|
192
|
+
outlineColor: shouldShowAffordance ? previewRingColor : "transparent",
|
|
193
|
+
outlineOffset: "4px",
|
|
194
|
+
outlineStyle: isSelected ? "solid" : "dashed",
|
|
195
|
+
outlineWidth: "2px",
|
|
196
|
+
boxShadow: isSelected ? `0 0 0 4px color-mix(in srgb, ${previewRingColor} 18%, transparent)` : void 0,
|
|
197
|
+
cursor: "pointer",
|
|
198
|
+
transition: "outline-color 150ms ease, box-shadow 150ms ease"
|
|
199
|
+
}), [isSelected, shouldShowAffordance]);
|
|
200
|
+
const handleClick = React.useCallback((e) => {
|
|
201
|
+
const target = e.target;
|
|
202
|
+
if (target?.closest("[data-preview-field]")) return;
|
|
203
|
+
const closestBlock = target?.closest("[data-block-id]");
|
|
204
|
+
if (closestBlock && closestBlock !== e.currentTarget) return;
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
e.stopPropagation();
|
|
207
|
+
onBlockClick(id);
|
|
208
|
+
}, [id, onBlockClick]);
|
|
209
|
+
const handleKeyDown = React.useCallback((e) => {
|
|
210
|
+
const target = e.target;
|
|
211
|
+
if (target?.closest("[data-preview-field]") || target?.closest("[data-block-id]") !== e.currentTarget) return;
|
|
212
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
328
213
|
e.preventDefault();
|
|
329
214
|
e.stopPropagation();
|
|
330
215
|
onBlockClick(id);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
$[9] = t6;
|
|
351
|
-
} else t6 = $[9];
|
|
352
|
-
const handleKeyDown = t6;
|
|
353
|
-
const t7 = isSelected ? "true" : void 0;
|
|
354
|
-
let t10;
|
|
355
|
-
let t11;
|
|
356
|
-
let t8;
|
|
357
|
-
let t9;
|
|
358
|
-
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
359
|
-
t8 = () => setIsHovered(true);
|
|
360
|
-
t9 = () => setIsHovered(false);
|
|
361
|
-
t10 = () => setHasDomFocus(true);
|
|
362
|
-
t11 = () => setHasDomFocus(false);
|
|
363
|
-
$[10] = t10;
|
|
364
|
-
$[11] = t11;
|
|
365
|
-
$[12] = t8;
|
|
366
|
-
$[13] = t9;
|
|
367
|
-
} else {
|
|
368
|
-
t10 = $[10];
|
|
369
|
-
t11 = $[11];
|
|
370
|
-
t8 = $[12];
|
|
371
|
-
t9 = $[13];
|
|
372
|
-
}
|
|
373
|
-
const t12 = isSelected && "outline-primary shadow-primary/20 shadow-[0_0_0_4px] outline outline-2 outline-offset-4";
|
|
374
|
-
let t13;
|
|
375
|
-
if ($[14] !== t12) {
|
|
376
|
-
t13 = cn("group/preview-block relative cursor-pointer transition-[outline-color,outline-offset,box-shadow] duration-150", "hover:outline-primary/40 hover:outline hover:outline-2 hover:outline-offset-4 hover:outline-dashed", t12);
|
|
377
|
-
$[14] = t12;
|
|
378
|
-
$[15] = t13;
|
|
379
|
-
} else t13 = $[15];
|
|
380
|
-
let t14;
|
|
381
|
-
if ($[16] !== children || $[17] !== handleClick || $[18] !== handleKeyDown || $[19] !== id || $[20] !== previewStyle || $[21] !== t13 || $[22] !== t7 || $[23] !== type) {
|
|
382
|
-
t14 = /* @__PURE__ */ jsx("div", {
|
|
383
|
-
"data-block-id": id,
|
|
384
|
-
"data-block-type": type,
|
|
385
|
-
"data-preview-block": "",
|
|
386
|
-
"data-preview-block-selected": t7,
|
|
387
|
-
onClick: handleClick,
|
|
388
|
-
onKeyDown: handleKeyDown,
|
|
389
|
-
onMouseEnter: t8,
|
|
390
|
-
onMouseLeave: t9,
|
|
391
|
-
onFocus: t10,
|
|
392
|
-
onBlur: t11,
|
|
393
|
-
role: "button",
|
|
394
|
-
tabIndex: 0,
|
|
395
|
-
style: previewStyle,
|
|
396
|
-
className: t13,
|
|
397
|
-
children
|
|
398
|
-
});
|
|
399
|
-
$[16] = children;
|
|
400
|
-
$[17] = handleClick;
|
|
401
|
-
$[18] = handleKeyDown;
|
|
402
|
-
$[19] = id;
|
|
403
|
-
$[20] = previewStyle;
|
|
404
|
-
$[21] = t13;
|
|
405
|
-
$[22] = t7;
|
|
406
|
-
$[23] = type;
|
|
407
|
-
$[24] = t14;
|
|
408
|
-
} else t14 = $[24];
|
|
409
|
-
return t14;
|
|
216
|
+
}
|
|
217
|
+
}, [id, onBlockClick]);
|
|
218
|
+
return /* @__PURE__ */ jsx("div", {
|
|
219
|
+
"data-block-id": id,
|
|
220
|
+
"data-block-type": type,
|
|
221
|
+
"data-preview-block": "",
|
|
222
|
+
"data-preview-block-selected": isSelected ? "true" : void 0,
|
|
223
|
+
onClick: handleClick,
|
|
224
|
+
onKeyDown: handleKeyDown,
|
|
225
|
+
onMouseEnter: () => setIsHovered(true),
|
|
226
|
+
onMouseLeave: () => setIsHovered(false),
|
|
227
|
+
onFocus: () => setHasDomFocus(true),
|
|
228
|
+
onBlur: () => setHasDomFocus(false),
|
|
229
|
+
role: "button",
|
|
230
|
+
tabIndex: 0,
|
|
231
|
+
style: previewStyle,
|
|
232
|
+
className: cn("group/preview-block relative cursor-pointer transition-[outline-color,outline-offset,box-shadow] duration-150", "hover:outline-primary/40 hover:outline hover:outline-2 hover:outline-offset-4 hover:outline-dashed", isSelected && "outline-primary shadow-primary/20 shadow-[0_0_0_4px] outline outline-2 outline-offset-4"),
|
|
233
|
+
children
|
|
234
|
+
});
|
|
410
235
|
}
|
|
411
236
|
function kebabToCamelCase(value) {
|
|
412
237
|
return value.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
@@ -40,8 +40,8 @@ function ActionButton({ action, collection, item, items, helpers, size = "defaul
|
|
|
40
40
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
41
41
|
const actionQueryClient = React.useMemo(() => ({
|
|
42
42
|
invalidateQueries: (filters) => queryClient.invalidateQueries(filters),
|
|
43
|
-
refetchQueries: (
|
|
44
|
-
resetQueries: (
|
|
43
|
+
refetchQueries: (filters) => queryClient.refetchQueries(filters),
|
|
44
|
+
resetQueries: (filters) => queryClient.resetQueries(filters)
|
|
45
45
|
}), [queryClient]);
|
|
46
46
|
const ctx = React.useMemo(() => ({
|
|
47
47
|
item,
|
|
@@ -80,14 +80,14 @@ function ActionButton({ action, collection, item, items, helpers, size = "defaul
|
|
|
80
80
|
case "api": {
|
|
81
81
|
setIsLoading(true);
|
|
82
82
|
const itemAny = item;
|
|
83
|
-
const
|
|
83
|
+
const itemId = itemAny != null ? String(itemAny.id) : "";
|
|
84
84
|
const method = handler.method ? handler.method : "POST";
|
|
85
|
-
const endpoint = handler.endpoint.replace("{id}",
|
|
85
|
+
const endpoint = handler.endpoint.replace("{id}", itemId);
|
|
86
86
|
try {
|
|
87
87
|
const collectionClient = client.collections?.[collection];
|
|
88
88
|
if (method === "DELETE" && collectionClient?.delete) {
|
|
89
|
-
if (!
|
|
90
|
-
await collectionClient.delete({ id:
|
|
89
|
+
if (!itemId) throw new Error(t("toast.deleteFailed"));
|
|
90
|
+
await collectionClient.delete({ id: itemId });
|
|
91
91
|
helpers.toast.success(t("toast.deleteSuccess"));
|
|
92
92
|
await helpers.invalidateCollection(collection);
|
|
93
93
|
} else {
|
|
@@ -95,8 +95,8 @@ function ActionButton({ action, collection, item, items, helpers, size = "defaul
|
|
|
95
95
|
helpers.refresh();
|
|
96
96
|
}
|
|
97
97
|
setIsLoading(false);
|
|
98
|
-
} catch (
|
|
99
|
-
helpers.toast.error(
|
|
98
|
+
} catch (error) {
|
|
99
|
+
helpers.toast.error(error instanceof Error ? error.message : t("error.actionFailed"));
|
|
100
100
|
setIsLoading(false);
|
|
101
101
|
}
|
|
102
102
|
break;
|
|
@@ -106,7 +106,7 @@ function ActionButton({ action, collection, item, items, helpers, size = "defaul
|
|
|
106
106
|
try {
|
|
107
107
|
await handler.fn(ctx);
|
|
108
108
|
setIsLoading(false);
|
|
109
|
-
} catch (
|
|
109
|
+
} catch (error) {
|
|
110
110
|
helpers.toast.error(t("error.actionFailed"));
|
|
111
111
|
setIsLoading(false);
|
|
112
112
|
}
|