@questpie/admin 3.0.3 → 3.0.4
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/README.md +34 -5
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +4 -1
- package/dist/client/builder/types/action-types.d.mts +31 -3
- package/dist/client/builder/types/collection-types.d.mts +140 -0
- package/dist/client/builder/types/ui-config.d.mts +16 -2
- package/dist/client/builder/types/views.d.mts +57 -0
- package/dist/client/builder/types/widget-types.d.mts +5 -0
- package/dist/client/components/actions/action-button.mjs +137 -199
- package/dist/client/components/actions/action-dialog.mjs +198 -156
- package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
- package/dist/client/components/actions/header-actions.mjs +52 -53
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/auth/auth-loading.mjs +41 -18
- package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
- package/dist/client/components/blocks/block-insert-button.mjs +4 -4
- package/dist/client/components/blocks/block-item.mjs +2 -2
- package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
- package/dist/client/components/component-renderer.mjs +1 -1
- package/dist/client/components/fields/array-field.mjs +14 -14
- package/dist/client/components/fields/asset-preview-field.mjs +1 -1
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
- package/dist/client/components/fields/json-field.mjs +2 -2
- package/dist/client/components/fields/object-array-field.mjs +22 -22
- package/dist/client/components/fields/object-field.mjs +5 -5
- package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
- package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
- package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
- package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
- package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
- package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
- package/dist/client/components/fields/relation-picker.mjs +7 -6
- package/dist/client/components/fields/relation-select.mjs +71 -47
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
- package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
- package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
- package/dist/client/components/fields/upload-field.mjs +45 -49
- package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
- package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
- package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
- package/dist/client/components/history-sidebar.mjs +850 -340
- package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
- package/dist/client/components/locale-switcher.mjs +8 -8
- package/dist/client/components/media/media-grid.mjs +12 -9
- package/dist/client/components/media/media-picker-dialog.mjs +242 -230
- package/dist/client/components/preview/live-preview-mode.mjs +1 -1
- package/dist/client/components/primitives/asset-preview.mjs +37 -22
- package/dist/client/components/primitives/date-input.mjs +212 -249
- package/dist/client/components/primitives/dropzone.mjs +192 -159
- package/dist/client/components/primitives/field-select-control.mjs +93 -0
- package/dist/client/components/primitives/select-multi.mjs +251 -230
- package/dist/client/components/primitives/select-single.mjs +345 -290
- package/dist/client/components/primitives/time-input.mjs +2 -2
- package/dist/client/components/sheets/resource-sheet.mjs +2 -0
- package/dist/client/components/ui/accordion.mjs +4 -4
- package/dist/client/components/ui/alert.mjs +3 -3
- package/dist/client/components/ui/badge.mjs +4 -4
- package/dist/client/components/ui/button.mjs +47 -37
- package/dist/client/components/ui/card.mjs +2 -2
- package/dist/client/components/ui/checkbox.mjs +1 -1
- package/dist/client/components/ui/command.mjs +5 -5
- package/dist/client/components/ui/dialog.mjs +3 -3
- package/dist/client/components/ui/drawer.mjs +1 -1
- package/dist/client/components/ui/dropdown-menu.mjs +157 -15
- package/dist/client/components/ui/empty-state.mjs +88 -59
- package/dist/client/components/ui/field.mjs +2 -2
- package/dist/client/components/ui/input-group.mjs +3 -3
- package/dist/client/components/ui/input.mjs +1 -1
- package/dist/client/components/ui/kbd.mjs +1 -1
- package/dist/client/components/ui/label.mjs +1 -1
- package/dist/client/components/ui/popover.mjs +19 -11
- package/dist/client/components/ui/scroll-fade.mjs +170 -0
- package/dist/client/components/ui/search-input.mjs +1 -1
- package/dist/client/components/ui/select.mjs +129 -27
- package/dist/client/components/ui/sheet.mjs +54 -34
- package/dist/client/components/ui/sidebar.mjs +15 -14
- package/dist/client/components/ui/skeleton.mjs +28 -12
- package/dist/client/components/ui/switch.mjs +2 -2
- package/dist/client/components/ui/table.mjs +82 -74
- package/dist/client/components/ui/tabs.mjs +26 -31
- package/dist/client/components/ui/textarea.mjs +1 -1
- package/dist/client/components/ui/tooltip.mjs +1 -1
- package/dist/client/components/widgets/chart-widget.mjs +134 -96
- package/dist/client/components/widgets/progress-widget.mjs +59 -34
- package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
- package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
- package/dist/client/components/widgets/stats-widget.mjs +91 -72
- package/dist/client/components/widgets/table-widget.mjs +159 -246
- package/dist/client/components/widgets/timeline-widget.mjs +66 -43
- package/dist/client/components/widgets/value-widget.mjs +261 -152
- package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-action.mjs +63 -55
- package/dist/client/hooks/use-audit-history.mjs +1 -65
- package/dist/client/hooks/use-collection-validation.mjs +36 -23
- package/dist/client/hooks/use-collection.mjs +96 -1
- package/dist/client/hooks/use-saved-views.mjs +70 -49
- package/dist/client/hooks/use-server-actions.mjs +59 -40
- package/dist/client/hooks/use-server-validation.mjs +156 -41
- package/dist/client/hooks/use-server-widget-data.mjs +1 -1
- package/dist/client/hooks/use-setup-status.d.mts +3 -3
- package/dist/client/hooks/use-setup-status.mjs +2 -2
- package/dist/client/hooks/use-transition-stage.mjs +2 -10
- package/dist/client/hooks/use-validation-error-map.mjs +31 -13
- package/dist/client/hooks/use-view-state.mjs +238 -174
- package/dist/client/i18n/date-locale.mjs +33 -0
- package/dist/client/i18n/hooks.mjs +17 -1
- package/dist/client/lib/utils.mjs +3 -2
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +2 -2
- package/dist/client/runtime/provider.mjs +8 -1
- package/dist/client/runtime/translations-provider.mjs +1 -1
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +1022 -0
- package/dist/client/styles/index.css +3 -589
- package/dist/client/utils/auto-expand-fields.mjs +4 -2
- package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
- package/dist/client/utils/use-lazy-component.mjs +80 -0
- package/dist/client/views/auth/auth-layout.d.mts +18 -11
- package/dist/client/views/auth/auth-layout.mjs +291 -80
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +1 -1
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +11 -9
- package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
- package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
- package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
- package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
- package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
- package/dist/client/views/collection/columns/build-columns.mjs +29 -9
- package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
- package/dist/client/views/collection/field-renderer.mjs +50 -89
- package/dist/client/views/collection/form-view.mjs +237 -227
- package/dist/client/views/collection/table-view.mjs +1162 -229
- package/dist/client/views/collection/view-skeletons.mjs +222 -79
- package/dist/client/views/common/global-search.mjs +29 -18
- package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
- package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
- package/dist/client/views/dashboard/widget-card.mjs +23 -14
- package/dist/client/views/globals/global-form-view.mjs +634 -589
- package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
- package/dist/client/views/layout/admin-layout.d.mts +3 -6
- package/dist/client/views/layout/admin-layout.mjs +149 -172
- package/dist/client/views/layout/admin-router.mjs +747 -544
- package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
- package/dist/client/views/layout/admin-sidebar.mjs +751 -591
- package/dist/client/views/layout/admin-theme.d.mts +10 -0
- package/dist/client/views/layout/admin-theme.mjs +84 -0
- package/dist/client/views/layout/admin-view-layout.mjs +161 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +49 -26
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +2 -19
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +2 -19
- package/dist/client/views/pages/login-page.d.mts +1 -1
- package/dist/client/views/pages/login-page.mjs +4 -21
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +3 -20
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +3 -20
- package/dist/client.d.mts +6 -2
- package/dist/client.mjs +2 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +2 -1
- package/dist/server/augmentation/dashboard.d.mts +67 -3
- package/dist/server/augmentation/form-layout.d.mts +21 -0
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/codegen/admin-client-template.mjs +4 -0
- package/dist/server/fields/blocks.d.mts +1 -1
- package/dist/server/fields/blocks.mjs +12 -0
- package/dist/server/fields/rich-text.d.mts +1 -1
- package/dist/server/fields/rich-text.mjs +8 -0
- package/dist/server/i18n/index.mjs +17 -1
- package/dist/server/i18n/messages/cs.mjs +23 -0
- package/dist/server/i18n/messages/de.mjs +23 -0
- package/dist/server/i18n/messages/en.mjs +64 -1
- package/dist/server/i18n/messages/es.mjs +23 -0
- package/dist/server/i18n/messages/fr.mjs +23 -0
- package/dist/server/i18n/messages/pl.mjs +23 -0
- package/dist/server/i18n/messages/pt.mjs +23 -0
- package/dist/server/i18n/messages/sk.mjs +83 -1
- package/dist/server/modules/admin/block/introspection.mjs +4 -1
- package/dist/server/modules/admin/block/prefetch.mjs +12 -2
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- 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 +20 -20
- package/dist/server/modules/admin/collections/assets.mjs +0 -1
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +12 -0
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +2 -2
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
- package/dist/server/modules/admin/factories.mjs +7 -18
- package/dist/server/modules/admin/index.d.mts +1 -1
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
- 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 +10 -10
- package/dist/server/modules/admin/routes/setup.mjs +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/translations.mjs +5 -1
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/dist/server/modules/audit/.generated/module.d.mts +1 -1
- package/dist/server/modules/audit/.generated/module.mjs +1 -1
- package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
- package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
- package/dist/server/modules/audit/config/app.mjs +99 -42
- package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
- package/dist/server/plugin.mjs +4 -2
- package/dist/server/proxy-factories.d.mts +4 -3
- package/dist/server/proxy-factories.mjs +34 -8
- package/dist/shared/types/saved-views.types.d.mts +2 -0
- package/package.json +6 -4
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
- package/dist/client/components/ui/spinner.mjs +0 -52
- package/dist/client/components/ui/toolbar.mjs +0 -136
- package/dist/client/contexts/breadcrumb-context.mjs +0 -60
- package/dist/client/views/layout/admin-topbar.mjs +0 -236
|
@@ -2,20 +2,163 @@ import { useResolveText, useTranslation } from "../../../i18n/hooks.mjs";
|
|
|
2
2
|
import { cn } from "../../../lib/utils.mjs";
|
|
3
3
|
import { LocaleBadge } from "../locale-badge.mjs";
|
|
4
4
|
import { Label } from "../../ui/label.mjs";
|
|
5
|
+
import { Skeleton } from "../../ui/skeleton.mjs";
|
|
6
|
+
import { isModifierShortcut } from "../../../utils/keyboard-shortcuts.mjs";
|
|
7
|
+
import { createLinkAttributes, isLikelyLinkHref } from "./link-utils.mjs";
|
|
5
8
|
import { RichTextToolbar } from "./toolbar.mjs";
|
|
6
9
|
import { RichTextBubbleMenu } from "./bubble-menu.mjs";
|
|
7
10
|
import { buildExtensions } from "./extensions.mjs";
|
|
11
|
+
import { getImageAltFromFile, getImageFilesFromDataTransfer, useRichTextImageUpload } from "./image-upload.mjs";
|
|
8
12
|
import { ImagePopover } from "./image-popover.mjs";
|
|
9
|
-
import { LinkPopover } from "./link-popover.mjs";
|
|
10
13
|
import { mergePresetFeatures } from "./presets.mjs";
|
|
11
14
|
import { defaultFeatures } from "./types.mjs";
|
|
12
15
|
import { getCharacterCount, getHeadingLevel, getOutput, isSameValue } from "./utils.mjs";
|
|
13
16
|
import { c } from "react/compiler-runtime";
|
|
14
17
|
import * as React from "react";
|
|
15
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { toast } from "sonner";
|
|
16
20
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
17
21
|
|
|
18
22
|
//#region src/client/components/fields/rich-text-editor/index.tsx
|
|
23
|
+
function RichTextToolbarSkeleton() {
|
|
24
|
+
const $ = c(3);
|
|
25
|
+
let t0;
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
28
|
+
t0 = /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: "flex items-center gap-1",
|
|
30
|
+
role: "presentation",
|
|
31
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }), /* @__PURE__ */ jsx(Skeleton, { className: "size-8" })]
|
|
32
|
+
});
|
|
33
|
+
t1 = /* @__PURE__ */ jsx(Skeleton, { className: "h-8 min-w-[136px]" });
|
|
34
|
+
$[0] = t0;
|
|
35
|
+
$[1] = t1;
|
|
36
|
+
} else {
|
|
37
|
+
t0 = $[0];
|
|
38
|
+
t1 = $[1];
|
|
39
|
+
}
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t2 = /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: "qp-rich-text-editor__toolbar border-border-subtle bg-surface-low flex flex-nowrap items-center gap-1.5 overflow-hidden border-b p-1.5",
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
children: [
|
|
46
|
+
t0,
|
|
47
|
+
t1,
|
|
48
|
+
/* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "flex items-center gap-1",
|
|
50
|
+
role: "presentation",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }),
|
|
53
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }),
|
|
54
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" })
|
|
55
|
+
]
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }),
|
|
58
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" })
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
$[2] = t2;
|
|
62
|
+
} else t2 = $[2];
|
|
63
|
+
return t2;
|
|
64
|
+
}
|
|
65
|
+
function RichTextEditorContentSkeleton() {
|
|
66
|
+
const $ = c(4);
|
|
67
|
+
let t0;
|
|
68
|
+
let t1;
|
|
69
|
+
let t2;
|
|
70
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
71
|
+
t0 = /* @__PURE__ */ jsx(Skeleton, {
|
|
72
|
+
variant: "text",
|
|
73
|
+
className: "h-4 w-full max-w-[92%]"
|
|
74
|
+
});
|
|
75
|
+
t1 = /* @__PURE__ */ jsx(Skeleton, {
|
|
76
|
+
variant: "text",
|
|
77
|
+
className: "h-4 w-full max-w-[78%]"
|
|
78
|
+
});
|
|
79
|
+
t2 = /* @__PURE__ */ jsx(Skeleton, {
|
|
80
|
+
variant: "text",
|
|
81
|
+
className: "h-4 w-full max-w-[86%]"
|
|
82
|
+
});
|
|
83
|
+
$[0] = t0;
|
|
84
|
+
$[1] = t1;
|
|
85
|
+
$[2] = t2;
|
|
86
|
+
} else {
|
|
87
|
+
t0 = $[0];
|
|
88
|
+
t1 = $[1];
|
|
89
|
+
t2 = $[2];
|
|
90
|
+
}
|
|
91
|
+
let t3;
|
|
92
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
93
|
+
t3 = /* @__PURE__ */ jsxs("div", {
|
|
94
|
+
className: "qp-rich-text-editor__content space-y-3",
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
children: [
|
|
97
|
+
t0,
|
|
98
|
+
t1,
|
|
99
|
+
t2,
|
|
100
|
+
/* @__PURE__ */ jsx("div", {
|
|
101
|
+
className: "pt-3",
|
|
102
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
103
|
+
variant: "text",
|
|
104
|
+
className: "h-4 w-full max-w-[58%]"
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
});
|
|
109
|
+
$[3] = t3;
|
|
110
|
+
} else t3 = $[3];
|
|
111
|
+
return t3;
|
|
112
|
+
}
|
|
113
|
+
function RichTextEditorLoadingSkeleton(t0) {
|
|
114
|
+
const $ = c(10);
|
|
115
|
+
const { disabled, readOnly, error, showToolbar } = t0;
|
|
116
|
+
const t1 = disabled || readOnly ? "opacity-60" : "";
|
|
117
|
+
const t2 = error ? "border-destructive" : "border-border";
|
|
118
|
+
let t3;
|
|
119
|
+
if ($[0] !== t1 || $[1] !== t2) {
|
|
120
|
+
t3 = cn("qp-rich-text-editor control-surface h-auto min-h-[160px] overflow-hidden", t1, t2);
|
|
121
|
+
$[0] = t1;
|
|
122
|
+
$[1] = t2;
|
|
123
|
+
$[2] = t3;
|
|
124
|
+
} else t3 = $[2];
|
|
125
|
+
let t4;
|
|
126
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
127
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
128
|
+
className: "sr-only",
|
|
129
|
+
children: "Loading editor"
|
|
130
|
+
});
|
|
131
|
+
$[3] = t4;
|
|
132
|
+
} else t4 = $[3];
|
|
133
|
+
let t5;
|
|
134
|
+
if ($[4] !== showToolbar) {
|
|
135
|
+
t5 = showToolbar && /* @__PURE__ */ jsx(RichTextToolbarSkeleton, {});
|
|
136
|
+
$[4] = showToolbar;
|
|
137
|
+
$[5] = t5;
|
|
138
|
+
} else t5 = $[5];
|
|
139
|
+
let t6;
|
|
140
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
141
|
+
t6 = /* @__PURE__ */ jsx(RichTextEditorContentSkeleton, {});
|
|
142
|
+
$[6] = t6;
|
|
143
|
+
} else t6 = $[6];
|
|
144
|
+
let t7;
|
|
145
|
+
if ($[7] !== t3 || $[8] !== t5) {
|
|
146
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
147
|
+
className: t3,
|
|
148
|
+
"data-admin-rich-text-editor": "root",
|
|
149
|
+
"aria-busy": "true",
|
|
150
|
+
children: [
|
|
151
|
+
t4,
|
|
152
|
+
t5,
|
|
153
|
+
t6
|
|
154
|
+
]
|
|
155
|
+
});
|
|
156
|
+
$[7] = t3;
|
|
157
|
+
$[8] = t5;
|
|
158
|
+
$[9] = t7;
|
|
159
|
+
} else t7 = $[9];
|
|
160
|
+
return t7;
|
|
161
|
+
}
|
|
19
162
|
/**
|
|
20
163
|
* Main RichText Editor Component.
|
|
21
164
|
*
|
|
@@ -25,7 +168,7 @@ import { EditorContent, useEditor } from "@tiptap/react";
|
|
|
25
168
|
* "Schema is missing its top node type" error.
|
|
26
169
|
*/
|
|
27
170
|
function RichTextEditor(t0) {
|
|
28
|
-
const $ = c(
|
|
171
|
+
const $ = c(119);
|
|
29
172
|
const { name, value, onChange, disabled, readOnly, label, description, placeholder, required, error, localized, locale, extensions, preset, features, showCharacterCount, maxCharacters, enableImages, onImageUpload, imageCollection, enableMediaLibrary } = t0;
|
|
30
173
|
const { t } = useTranslation();
|
|
31
174
|
const resolveText = useResolveText();
|
|
@@ -45,57 +188,221 @@ function RichTextEditor(t0) {
|
|
|
45
188
|
$[5] = t2;
|
|
46
189
|
} else t2 = $[5];
|
|
47
190
|
const resolvedDescription = t2;
|
|
191
|
+
const descriptionId = resolvedDescription ? `${name}-description` : void 0;
|
|
192
|
+
const errorId = error ? `${name}-error` : void 0;
|
|
48
193
|
let t3;
|
|
194
|
+
if ($[6] !== descriptionId || $[7] !== errorId) {
|
|
195
|
+
t3 = [descriptionId, errorId].filter(Boolean);
|
|
196
|
+
$[6] = descriptionId;
|
|
197
|
+
$[7] = errorId;
|
|
198
|
+
$[8] = t3;
|
|
199
|
+
} else t3 = $[8];
|
|
200
|
+
const describedBy = t3.join(" ");
|
|
201
|
+
let t4;
|
|
49
202
|
bb0: {
|
|
50
203
|
if (preset) {
|
|
51
|
-
let
|
|
52
|
-
if ($[
|
|
53
|
-
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
} else
|
|
58
|
-
|
|
204
|
+
let t5$2;
|
|
205
|
+
if ($[9] !== features || $[10] !== preset) {
|
|
206
|
+
t5$2 = mergePresetFeatures(preset, features);
|
|
207
|
+
$[9] = features;
|
|
208
|
+
$[10] = preset;
|
|
209
|
+
$[11] = t5$2;
|
|
210
|
+
} else t5$2 = $[11];
|
|
211
|
+
t4 = t5$2;
|
|
59
212
|
break bb0;
|
|
60
213
|
}
|
|
61
|
-
let
|
|
62
|
-
if ($[
|
|
63
|
-
|
|
214
|
+
let t5$1;
|
|
215
|
+
if ($[12] !== features) {
|
|
216
|
+
t5$1 = {
|
|
64
217
|
...defaultFeatures,
|
|
65
218
|
...features
|
|
66
219
|
};
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
} else
|
|
70
|
-
|
|
220
|
+
$[12] = features;
|
|
221
|
+
$[13] = t5$1;
|
|
222
|
+
} else t5$1 = $[13];
|
|
223
|
+
t4 = t5$1;
|
|
71
224
|
}
|
|
72
|
-
const resolvedFeatures =
|
|
73
|
-
let
|
|
74
|
-
if ($[
|
|
75
|
-
|
|
225
|
+
const resolvedFeatures = t4;
|
|
226
|
+
let t5;
|
|
227
|
+
if ($[14] !== t) {
|
|
228
|
+
t5 = t("editor.unorderedList");
|
|
229
|
+
$[14] = t;
|
|
230
|
+
$[15] = t5;
|
|
231
|
+
} else t5 = $[15];
|
|
232
|
+
let t6;
|
|
233
|
+
if ($[16] !== t) {
|
|
234
|
+
t6 = t("editor.bulletListDescription");
|
|
235
|
+
$[16] = t;
|
|
236
|
+
$[17] = t6;
|
|
237
|
+
} else t6 = $[17];
|
|
238
|
+
let t7;
|
|
239
|
+
if ($[18] !== t) {
|
|
240
|
+
t7 = t("editor.codeBlock");
|
|
241
|
+
$[18] = t;
|
|
242
|
+
$[19] = t7;
|
|
243
|
+
} else t7 = $[19];
|
|
244
|
+
let t8;
|
|
245
|
+
if ($[20] !== t) {
|
|
246
|
+
t8 = t("editor.codeBlockDescription");
|
|
247
|
+
$[20] = t;
|
|
248
|
+
$[21] = t8;
|
|
249
|
+
} else t8 = $[21];
|
|
250
|
+
let t9;
|
|
251
|
+
if ($[22] !== t) {
|
|
252
|
+
t9 = t("editor.horizontalRule");
|
|
253
|
+
$[22] = t;
|
|
254
|
+
$[23] = t9;
|
|
255
|
+
} else t9 = $[23];
|
|
256
|
+
let t10;
|
|
257
|
+
if ($[24] !== t) {
|
|
258
|
+
t10 = t("editor.dividerDescription");
|
|
259
|
+
$[24] = t;
|
|
260
|
+
$[25] = t10;
|
|
261
|
+
} else t10 = $[25];
|
|
262
|
+
let t11;
|
|
263
|
+
let t12;
|
|
264
|
+
if ($[26] !== t) {
|
|
265
|
+
t11 = (level) => t("editor.heading", { level });
|
|
266
|
+
t12 = t("editor.heading1Description");
|
|
267
|
+
$[26] = t;
|
|
268
|
+
$[27] = t11;
|
|
269
|
+
$[28] = t12;
|
|
270
|
+
} else {
|
|
271
|
+
t11 = $[27];
|
|
272
|
+
t12 = $[28];
|
|
273
|
+
}
|
|
274
|
+
let t13;
|
|
275
|
+
if ($[29] !== t) {
|
|
276
|
+
t13 = t("editor.heading2Description");
|
|
277
|
+
$[29] = t;
|
|
278
|
+
$[30] = t13;
|
|
279
|
+
} else t13 = $[30];
|
|
280
|
+
let t14;
|
|
281
|
+
if ($[31] !== t) {
|
|
282
|
+
t14 = t("editor.heading3Description");
|
|
283
|
+
$[31] = t;
|
|
284
|
+
$[32] = t14;
|
|
285
|
+
} else t14 = $[32];
|
|
286
|
+
let t15;
|
|
287
|
+
if ($[33] !== t) {
|
|
288
|
+
t15 = t("editor.orderedList");
|
|
289
|
+
$[33] = t;
|
|
290
|
+
$[34] = t15;
|
|
291
|
+
} else t15 = $[34];
|
|
292
|
+
let t16;
|
|
293
|
+
if ($[35] !== t) {
|
|
294
|
+
t16 = t("editor.orderedListDescription");
|
|
295
|
+
$[35] = t;
|
|
296
|
+
$[36] = t16;
|
|
297
|
+
} else t16 = $[36];
|
|
298
|
+
let t17;
|
|
299
|
+
if ($[37] !== t) {
|
|
300
|
+
t17 = t("editor.paragraph");
|
|
301
|
+
$[37] = t;
|
|
302
|
+
$[38] = t17;
|
|
303
|
+
} else t17 = $[38];
|
|
304
|
+
let t18;
|
|
305
|
+
if ($[39] !== t) {
|
|
306
|
+
t18 = t("editor.paragraphDescription");
|
|
307
|
+
$[39] = t;
|
|
308
|
+
$[40] = t18;
|
|
309
|
+
} else t18 = $[40];
|
|
310
|
+
let t19;
|
|
311
|
+
if ($[41] !== t) {
|
|
312
|
+
t19 = t("editor.quote");
|
|
313
|
+
$[41] = t;
|
|
314
|
+
$[42] = t19;
|
|
315
|
+
} else t19 = $[42];
|
|
316
|
+
let t20;
|
|
317
|
+
if ($[43] !== t) {
|
|
318
|
+
t20 = t("editor.quoteDescription");
|
|
319
|
+
$[43] = t;
|
|
320
|
+
$[44] = t20;
|
|
321
|
+
} else t20 = $[44];
|
|
322
|
+
let t21;
|
|
323
|
+
if ($[45] !== t) {
|
|
324
|
+
t21 = t("editor.table");
|
|
325
|
+
$[45] = t;
|
|
326
|
+
$[46] = t21;
|
|
327
|
+
} else t21 = $[46];
|
|
328
|
+
let t22;
|
|
329
|
+
if ($[47] !== t) {
|
|
330
|
+
t22 = t("editor.tableDescription");
|
|
331
|
+
$[47] = t;
|
|
332
|
+
$[48] = t22;
|
|
333
|
+
} else t22 = $[48];
|
|
334
|
+
let t23;
|
|
335
|
+
if ($[49] !== t10 || $[50] !== t11 || $[51] !== t12 || $[52] !== t13 || $[53] !== t14 || $[54] !== t15 || $[55] !== t16 || $[56] !== t17 || $[57] !== t18 || $[58] !== t19 || $[59] !== t20 || $[60] !== t21 || $[61] !== t22 || $[62] !== t5 || $[63] !== t6 || $[64] !== t7 || $[65] !== t8 || $[66] !== t9) {
|
|
336
|
+
t23 = {
|
|
337
|
+
bulletList: t5,
|
|
338
|
+
bulletListDescription: t6,
|
|
339
|
+
codeBlock: t7,
|
|
340
|
+
codeBlockDescription: t8,
|
|
341
|
+
divider: t9,
|
|
342
|
+
dividerDescription: t10,
|
|
343
|
+
heading: t11,
|
|
344
|
+
heading1Description: t12,
|
|
345
|
+
heading2Description: t13,
|
|
346
|
+
heading3Description: t14,
|
|
347
|
+
orderedList: t15,
|
|
348
|
+
orderedListDescription: t16,
|
|
349
|
+
paragraph: t17,
|
|
350
|
+
paragraphDescription: t18,
|
|
351
|
+
quote: t19,
|
|
352
|
+
quoteDescription: t20,
|
|
353
|
+
table: t21,
|
|
354
|
+
tableDescription: t22
|
|
355
|
+
};
|
|
356
|
+
$[49] = t10;
|
|
357
|
+
$[50] = t11;
|
|
358
|
+
$[51] = t12;
|
|
359
|
+
$[52] = t13;
|
|
360
|
+
$[53] = t14;
|
|
361
|
+
$[54] = t15;
|
|
362
|
+
$[55] = t16;
|
|
363
|
+
$[56] = t17;
|
|
364
|
+
$[57] = t18;
|
|
365
|
+
$[58] = t19;
|
|
366
|
+
$[59] = t20;
|
|
367
|
+
$[60] = t21;
|
|
368
|
+
$[61] = t22;
|
|
369
|
+
$[62] = t5;
|
|
370
|
+
$[63] = t6;
|
|
371
|
+
$[64] = t7;
|
|
372
|
+
$[65] = t8;
|
|
373
|
+
$[66] = t9;
|
|
374
|
+
$[67] = t23;
|
|
375
|
+
} else t23 = $[67];
|
|
376
|
+
const extensionLabels = t23;
|
|
377
|
+
let t24;
|
|
378
|
+
if ($[68] !== extensionLabels || $[69] !== extensions || $[70] !== maxCharacters || $[71] !== placeholder || $[72] !== resolvedFeatures || $[73] !== t) {
|
|
379
|
+
t24 = () => {
|
|
76
380
|
const result = buildExtensions({
|
|
77
381
|
features: resolvedFeatures,
|
|
382
|
+
labels: extensionLabels,
|
|
78
383
|
placeholder: placeholder || t("editor.startWriting"),
|
|
79
384
|
maxCharacters,
|
|
80
385
|
customExtensions: extensions
|
|
81
386
|
});
|
|
82
387
|
return result instanceof Promise ? void 0 : result;
|
|
83
388
|
};
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
389
|
+
$[68] = extensionLabels;
|
|
390
|
+
$[69] = extensions;
|
|
391
|
+
$[70] = maxCharacters;
|
|
392
|
+
$[71] = placeholder;
|
|
393
|
+
$[72] = resolvedFeatures;
|
|
394
|
+
$[73] = t;
|
|
395
|
+
$[74] = t24;
|
|
396
|
+
} else t24 = $[74];
|
|
397
|
+
const [resolvedExtensions, setResolvedExtensions] = React.useState(t24);
|
|
398
|
+
let t25;
|
|
399
|
+
let t26;
|
|
400
|
+
if ($[75] !== extensionLabels || $[76] !== extensions || $[77] !== maxCharacters || $[78] !== placeholder || $[79] !== resolvedFeatures || $[80] !== t) {
|
|
401
|
+
t25 = () => {
|
|
96
402
|
let mounted = true;
|
|
97
403
|
const result_0 = buildExtensions({
|
|
98
404
|
features: resolvedFeatures,
|
|
405
|
+
labels: extensionLabels,
|
|
99
406
|
placeholder: placeholder || t("editor.startWriting"),
|
|
100
407
|
maxCharacters,
|
|
101
408
|
customExtensions: extensions
|
|
@@ -108,29 +415,31 @@ function RichTextEditor(t0) {
|
|
|
108
415
|
mounted = false;
|
|
109
416
|
};
|
|
110
417
|
};
|
|
111
|
-
|
|
418
|
+
t26 = [
|
|
112
419
|
resolvedFeatures,
|
|
420
|
+
extensionLabels,
|
|
113
421
|
placeholder,
|
|
114
422
|
maxCharacters,
|
|
115
423
|
extensions,
|
|
116
424
|
t
|
|
117
425
|
];
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
426
|
+
$[75] = extensionLabels;
|
|
427
|
+
$[76] = extensions;
|
|
428
|
+
$[77] = maxCharacters;
|
|
429
|
+
$[78] = placeholder;
|
|
430
|
+
$[79] = resolvedFeatures;
|
|
431
|
+
$[80] = t;
|
|
432
|
+
$[81] = t25;
|
|
433
|
+
$[82] = t26;
|
|
125
434
|
} else {
|
|
126
|
-
|
|
127
|
-
|
|
435
|
+
t25 = $[81];
|
|
436
|
+
t26 = $[82];
|
|
128
437
|
}
|
|
129
|
-
React.useEffect(
|
|
130
|
-
const
|
|
131
|
-
let
|
|
132
|
-
if ($[
|
|
133
|
-
|
|
438
|
+
React.useEffect(t25, t26);
|
|
439
|
+
const t27 = disabled || readOnly;
|
|
440
|
+
let t28;
|
|
441
|
+
if ($[83] !== locale || $[84] !== localized || $[85] !== name || $[86] !== required || $[87] !== resolvedLabel) {
|
|
442
|
+
t28 = resolvedLabel && /* @__PURE__ */ jsxs("div", {
|
|
134
443
|
className: "flex items-center gap-2",
|
|
135
444
|
children: [/* @__PURE__ */ jsxs(Label, {
|
|
136
445
|
htmlFor: name,
|
|
@@ -140,17 +449,19 @@ function RichTextEditor(t0) {
|
|
|
140
449
|
})]
|
|
141
450
|
}), localized && /* @__PURE__ */ jsx(LocaleBadge, { locale: locale || "i18n" })]
|
|
142
451
|
});
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
} else
|
|
150
|
-
let
|
|
151
|
-
if ($[
|
|
152
|
-
|
|
452
|
+
$[83] = locale;
|
|
453
|
+
$[84] = localized;
|
|
454
|
+
$[85] = name;
|
|
455
|
+
$[86] = required;
|
|
456
|
+
$[87] = resolvedLabel;
|
|
457
|
+
$[88] = t28;
|
|
458
|
+
} else t28 = $[88];
|
|
459
|
+
let t29;
|
|
460
|
+
if ($[89] !== describedBy || $[90] !== disabled || $[91] !== enableImages || $[92] !== enableMediaLibrary || $[93] !== error || $[94] !== imageCollection || $[95] !== locale || $[96] !== maxCharacters || $[97] !== name || $[98] !== onChange || $[99] !== onImageUpload || $[100] !== readOnly || $[101] !== resolvedExtensions || $[102] !== resolvedFeatures || $[103] !== resolvedLabel || $[104] !== showCharacterCount || $[105] !== value) {
|
|
461
|
+
t29 = resolvedExtensions ? /* @__PURE__ */ jsx(RichTextEditorCore, {
|
|
153
462
|
name,
|
|
463
|
+
ariaLabel: resolvedLabel ?? name,
|
|
464
|
+
ariaDescribedBy: describedBy || void 0,
|
|
154
465
|
value,
|
|
155
466
|
onChange,
|
|
156
467
|
disabled,
|
|
@@ -165,355 +476,305 @@ function RichTextEditor(t0) {
|
|
|
165
476
|
onImageUpload,
|
|
166
477
|
imageCollection,
|
|
167
478
|
enableMediaLibrary
|
|
168
|
-
}) : /* @__PURE__ */ jsx(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
})
|
|
479
|
+
}) : /* @__PURE__ */ jsx(RichTextEditorLoadingSkeleton, {
|
|
480
|
+
disabled,
|
|
481
|
+
readOnly,
|
|
482
|
+
error,
|
|
483
|
+
showToolbar: resolvedFeatures.toolbar
|
|
174
484
|
});
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
485
|
+
$[89] = describedBy;
|
|
486
|
+
$[90] = disabled;
|
|
487
|
+
$[91] = enableImages;
|
|
488
|
+
$[92] = enableMediaLibrary;
|
|
489
|
+
$[93] = error;
|
|
490
|
+
$[94] = imageCollection;
|
|
491
|
+
$[95] = locale;
|
|
492
|
+
$[96] = maxCharacters;
|
|
493
|
+
$[97] = name;
|
|
494
|
+
$[98] = onChange;
|
|
495
|
+
$[99] = onImageUpload;
|
|
496
|
+
$[100] = readOnly;
|
|
497
|
+
$[101] = resolvedExtensions;
|
|
498
|
+
$[102] = resolvedFeatures;
|
|
499
|
+
$[103] = resolvedLabel;
|
|
500
|
+
$[104] = showCharacterCount;
|
|
501
|
+
$[105] = value;
|
|
502
|
+
$[106] = t29;
|
|
503
|
+
} else t29 = $[106];
|
|
504
|
+
let t30;
|
|
505
|
+
if ($[107] !== descriptionId || $[108] !== resolvedDescription) {
|
|
506
|
+
t30 = resolvedDescription && /* @__PURE__ */ jsx("p", {
|
|
507
|
+
id: descriptionId,
|
|
195
508
|
className: "text-muted-foreground text-xs",
|
|
196
509
|
children: resolvedDescription
|
|
197
510
|
});
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
511
|
+
$[107] = descriptionId;
|
|
512
|
+
$[108] = resolvedDescription;
|
|
513
|
+
$[109] = t30;
|
|
514
|
+
} else t30 = $[109];
|
|
515
|
+
let t31;
|
|
516
|
+
if ($[110] !== error || $[111] !== errorId) {
|
|
517
|
+
t31 = error && /* @__PURE__ */ jsx("p", {
|
|
518
|
+
id: errorId,
|
|
204
519
|
className: "text-destructive text-xs",
|
|
205
520
|
children: error
|
|
206
521
|
});
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
522
|
+
$[110] = error;
|
|
523
|
+
$[111] = errorId;
|
|
524
|
+
$[112] = t31;
|
|
525
|
+
} else t31 = $[112];
|
|
526
|
+
let t32;
|
|
527
|
+
if ($[113] !== t27 || $[114] !== t28 || $[115] !== t29 || $[116] !== t30 || $[117] !== t31) {
|
|
528
|
+
t32 = /* @__PURE__ */ jsxs("div", {
|
|
213
529
|
className: "space-y-2",
|
|
214
|
-
"data-disabled":
|
|
530
|
+
"data-disabled": t27,
|
|
215
531
|
children: [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
532
|
+
t28,
|
|
533
|
+
t29,
|
|
534
|
+
t30,
|
|
535
|
+
t31
|
|
220
536
|
]
|
|
221
537
|
});
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
} else
|
|
229
|
-
return
|
|
538
|
+
$[113] = t27;
|
|
539
|
+
$[114] = t28;
|
|
540
|
+
$[115] = t29;
|
|
541
|
+
$[116] = t30;
|
|
542
|
+
$[117] = t31;
|
|
543
|
+
$[118] = t32;
|
|
544
|
+
} else t32 = $[118];
|
|
545
|
+
return t32;
|
|
230
546
|
}
|
|
231
547
|
/**
|
|
232
548
|
* Core editor — only mounts when extensions are ready.
|
|
233
549
|
* `useEditor` always receives a complete extension list, so the ProseMirror
|
|
234
550
|
* schema always has its `doc` node.
|
|
235
551
|
*/
|
|
236
|
-
function RichTextEditorCore(
|
|
237
|
-
const
|
|
238
|
-
const { name, value, onChange, disabled, readOnly, error, locale, features, resolvedExtensions, showCharacterCount, maxCharacters, enableImages, onImageUpload, imageCollection, enableMediaLibrary } = t0;
|
|
552
|
+
function RichTextEditorCore({ name, ariaLabel, ariaDescribedBy, value, onChange, disabled, readOnly, error, locale, features, resolvedExtensions, showCharacterCount, maxCharacters, enableImages, onImageUpload, imageCollection, enableMediaLibrary }) {
|
|
553
|
+
const { t } = useTranslation();
|
|
239
554
|
const [linkOpen, setLinkOpen] = React.useState(false);
|
|
240
555
|
const [imageOpen, setImageOpen] = React.useState(false);
|
|
556
|
+
const [uploadingInlineImage, setUploadingInlineImage] = React.useState(false);
|
|
241
557
|
const lastEmittedValueRef = React.useRef(void 0);
|
|
558
|
+
const editorRef = React.useRef(null);
|
|
242
559
|
const allowImages = features.image && (enableImages ?? true);
|
|
243
560
|
const allowLinks = features.link;
|
|
244
561
|
const allowBubbleMenu = features.bubbleMenu;
|
|
245
562
|
const allowToolbar = features.toolbar;
|
|
246
563
|
const allowCharacterCount = features.characterCount && (showCharacterCount || maxCharacters);
|
|
247
564
|
const isEditable = !disabled && !readOnly;
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
565
|
+
const editorStateRef = React.useRef({
|
|
566
|
+
allowImages,
|
|
567
|
+
allowLinks,
|
|
568
|
+
isEditable
|
|
569
|
+
});
|
|
570
|
+
editorStateRef.current = {
|
|
571
|
+
allowImages,
|
|
572
|
+
allowLinks,
|
|
573
|
+
isEditable
|
|
574
|
+
};
|
|
575
|
+
const { uploadImageFile } = useRichTextImageUpload({
|
|
576
|
+
imageCollection,
|
|
577
|
+
onImageUpload
|
|
578
|
+
});
|
|
579
|
+
const insertUploadedImages = React.useCallback(async (files, options) => {
|
|
580
|
+
const currentEditor = editorRef.current;
|
|
581
|
+
if (!currentEditor || files.length === 0) return;
|
|
582
|
+
try {
|
|
583
|
+
setUploadingInlineImage(true);
|
|
584
|
+
const imageNodes = [];
|
|
585
|
+
for (const file of files) {
|
|
586
|
+
const url = await uploadImageFile(file);
|
|
587
|
+
imageNodes.push({
|
|
588
|
+
type: "image",
|
|
589
|
+
attrs: {
|
|
590
|
+
src: url,
|
|
591
|
+
alt: getImageAltFromFile(file)
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
if (imageNodes.length === 0) return;
|
|
596
|
+
const chain = currentEditor.chain().focus();
|
|
597
|
+
if (typeof options?.position === "number") chain.insertContentAt(options.position, imageNodes).run();
|
|
598
|
+
else chain.insertContent(imageNodes).run();
|
|
599
|
+
} catch (err) {
|
|
600
|
+
const error_0 = err instanceof Error ? err : new Error(t("upload.error"));
|
|
601
|
+
toast.error(error_0.message);
|
|
602
|
+
} finally {
|
|
603
|
+
setUploadingInlineImage(false);
|
|
604
|
+
}
|
|
605
|
+
}, [t, uploadImageFile]);
|
|
606
|
+
const handleEditorPaste = React.useCallback((event) => {
|
|
607
|
+
const currentEditor_0 = editorRef.current;
|
|
608
|
+
const state = editorStateRef.current;
|
|
609
|
+
if (!currentEditor_0 || !state.isEditable) return false;
|
|
610
|
+
const imageFiles = getImageFilesFromDataTransfer(event.clipboardData);
|
|
611
|
+
if (state.allowImages && imageFiles.length > 0) {
|
|
612
|
+
event.preventDefault();
|
|
613
|
+
insertUploadedImages(imageFiles);
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
616
|
+
const pastedText = event.clipboardData?.getData("text/plain") ?? "";
|
|
617
|
+
if (state.allowLinks && isLikelyLinkHref(pastedText) && !currentEditor_0.state.selection.empty) {
|
|
618
|
+
event.preventDefault();
|
|
619
|
+
currentEditor_0.chain().focus().extendMarkRange("link").setLink(createLinkAttributes(pastedText)).run();
|
|
620
|
+
return true;
|
|
621
|
+
}
|
|
622
|
+
return false;
|
|
623
|
+
}, [insertUploadedImages]);
|
|
624
|
+
const handleEditorDrop = React.useCallback((view, event_0, moved) => {
|
|
625
|
+
const state_0 = editorStateRef.current;
|
|
626
|
+
if (moved || !state_0.isEditable || !state_0.allowImages) return false;
|
|
627
|
+
const imageFiles_0 = getImageFilesFromDataTransfer(event_0.dataTransfer);
|
|
628
|
+
if (imageFiles_0.length === 0) return false;
|
|
629
|
+
event_0.preventDefault();
|
|
630
|
+
const position = view.posAtCoords({
|
|
631
|
+
left: event_0.clientX,
|
|
632
|
+
top: event_0.clientY
|
|
633
|
+
})?.pos;
|
|
634
|
+
insertUploadedImages(imageFiles_0, { position });
|
|
635
|
+
return true;
|
|
636
|
+
}, [insertUploadedImages]);
|
|
637
|
+
const handleEditorKeyDown = React.useCallback((event_1) => {
|
|
638
|
+
if (!isModifierShortcut(event_1)) return false;
|
|
639
|
+
const key = event_1.key.toLowerCase();
|
|
640
|
+
if (key === "k" && allowLinks && isEditable) {
|
|
641
|
+
event_1.preventDefault();
|
|
642
|
+
event_1.stopPropagation();
|
|
643
|
+
setLinkOpen(true);
|
|
644
|
+
return true;
|
|
645
|
+
}
|
|
646
|
+
if ([
|
|
647
|
+
"b",
|
|
648
|
+
"e",
|
|
649
|
+
"i",
|
|
650
|
+
"u",
|
|
651
|
+
"y",
|
|
652
|
+
"z"
|
|
653
|
+
].includes(key)) event_1.stopPropagation();
|
|
654
|
+
return false;
|
|
655
|
+
}, [allowLinks, isEditable]);
|
|
656
|
+
const editor = useEditor({
|
|
657
|
+
extensions: resolvedExtensions,
|
|
658
|
+
content: value ?? "",
|
|
659
|
+
editorProps: {
|
|
660
|
+
attributes: {
|
|
661
|
+
class: "qp-rich-text-editor__content",
|
|
662
|
+
"aria-label": ariaLabel ?? name,
|
|
663
|
+
"aria-multiline": "true",
|
|
664
|
+
"data-admin-rich-text-editor": "content",
|
|
665
|
+
role: "textbox",
|
|
666
|
+
...ariaDescribedBy ? { "aria-describedby": ariaDescribedBy } : {},
|
|
667
|
+
...error ? { "aria-invalid": "true" } : {}
|
|
668
|
+
},
|
|
669
|
+
handleKeyDown: (_view, event_2) => handleEditorKeyDown(event_2),
|
|
670
|
+
handlePaste: (_view_0, event_3) => handleEditorPaste(event_3),
|
|
671
|
+
handleDrop: (view_0, event_4, _slice, moved_0) => handleEditorDrop(view_0, event_4, moved_0)
|
|
672
|
+
},
|
|
673
|
+
editable: isEditable,
|
|
674
|
+
onUpdate: ({ editor: currentEditor_1 }) => {
|
|
258
675
|
if (disabled || readOnly) return;
|
|
259
|
-
const nextValue = getOutput(
|
|
676
|
+
const nextValue = getOutput(currentEditor_1);
|
|
260
677
|
lastEmittedValueRef.current = nextValue;
|
|
261
678
|
onChange?.(nextValue);
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
React.useEffect(() => {
|
|
682
|
+
editorRef.current = editor;
|
|
683
|
+
return () => {
|
|
684
|
+
if (editorRef.current === editor) editorRef.current = null;
|
|
262
685
|
};
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
t4 = {
|
|
271
|
-
extensions: resolvedExtensions,
|
|
272
|
-
content: t1,
|
|
273
|
-
editorProps: t2,
|
|
274
|
-
editable: isEditable,
|
|
275
|
-
onUpdate: t3
|
|
276
|
-
};
|
|
277
|
-
$[5] = isEditable;
|
|
278
|
-
$[6] = resolvedExtensions;
|
|
279
|
-
$[7] = t1;
|
|
280
|
-
$[8] = t3;
|
|
281
|
-
$[9] = t4;
|
|
282
|
-
} else t4 = $[9];
|
|
283
|
-
const editor = useEditor(t4);
|
|
284
|
-
let t5;
|
|
285
|
-
if ($[10] !== editor) {
|
|
286
|
-
t5 = getHeadingLevel(editor);
|
|
287
|
-
$[10] = editor;
|
|
288
|
-
$[11] = t5;
|
|
289
|
-
} else t5 = $[11];
|
|
290
|
-
const headingValue = t5;
|
|
291
|
-
let t6;
|
|
292
|
-
if ($[12] !== editor) {
|
|
293
|
-
t6 = editor?.isActive("table") ?? false;
|
|
294
|
-
$[12] = editor;
|
|
295
|
-
$[13] = t6;
|
|
296
|
-
} else t6 = $[13];
|
|
297
|
-
const inTable = t6;
|
|
298
|
-
let t7;
|
|
299
|
-
let t8;
|
|
300
|
-
if ($[14] !== editor || $[15] !== isEditable) {
|
|
301
|
-
t7 = () => {
|
|
302
|
-
if (!editor) return;
|
|
303
|
-
editor.setEditable(isEditable);
|
|
304
|
-
};
|
|
305
|
-
t8 = [editor, isEditable];
|
|
306
|
-
$[14] = editor;
|
|
307
|
-
$[15] = isEditable;
|
|
308
|
-
$[16] = t7;
|
|
309
|
-
$[17] = t8;
|
|
310
|
-
} else {
|
|
311
|
-
t7 = $[16];
|
|
312
|
-
t8 = $[17];
|
|
313
|
-
}
|
|
314
|
-
React.useEffect(t7, t8);
|
|
686
|
+
}, [editor]);
|
|
687
|
+
const headingValue = getHeadingLevel(editor);
|
|
688
|
+
const inTable = editor?.isActive("table") ?? false;
|
|
689
|
+
React.useEffect(() => {
|
|
690
|
+
if (!editor) return;
|
|
691
|
+
editor.setEditable(isEditable);
|
|
692
|
+
}, [editor, isEditable]);
|
|
315
693
|
const prevLocaleRef = React.useRef(locale);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
$[34] = inTable;
|
|
401
|
-
$[35] = isEditable;
|
|
402
|
-
$[36] = t17;
|
|
403
|
-
} else t17 = $[36];
|
|
404
|
-
let t18;
|
|
405
|
-
if ($[37] !== allowBubbleMenu || $[38] !== editor || $[39] !== features || $[40] !== isEditable) {
|
|
406
|
-
t18 = editor && allowBubbleMenu && /* @__PURE__ */ jsx(RichTextBubbleMenu, {
|
|
407
|
-
editor,
|
|
408
|
-
features,
|
|
409
|
-
disabled: !isEditable,
|
|
410
|
-
onLinkClick: () => setLinkOpen(true)
|
|
411
|
-
});
|
|
412
|
-
$[37] = allowBubbleMenu;
|
|
413
|
-
$[38] = editor;
|
|
414
|
-
$[39] = features;
|
|
415
|
-
$[40] = isEditable;
|
|
416
|
-
$[41] = t18;
|
|
417
|
-
} else t18 = $[41];
|
|
418
|
-
let t19;
|
|
419
|
-
if ($[42] !== editor || $[43] !== name) {
|
|
420
|
-
t19 = editor ? /* @__PURE__ */ jsx(EditorContent, {
|
|
421
|
-
editor,
|
|
422
|
-
id: name
|
|
423
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
424
|
-
className: "text-muted-foreground flex min-h-[120px] items-center justify-center text-sm",
|
|
425
|
-
children: "Loading editor..."
|
|
426
|
-
});
|
|
427
|
-
$[42] = editor;
|
|
428
|
-
$[43] = name;
|
|
429
|
-
$[44] = t19;
|
|
430
|
-
} else t19 = $[44];
|
|
431
|
-
let t20;
|
|
432
|
-
if ($[45] !== allowCharacterCount || $[46] !== characterCount || $[47] !== maxCharacters || $[48] !== showCharacterCount) {
|
|
433
|
-
t20 = allowCharacterCount && showCharacterCount && /* @__PURE__ */ jsxs("div", {
|
|
434
|
-
className: "bg-muted text-muted-foreground flex items-center justify-between border-t px-2 py-1 text-xs",
|
|
435
|
-
children: [/* @__PURE__ */ jsxs("span", { children: [
|
|
436
|
-
characterCount.words,
|
|
437
|
-
" word",
|
|
438
|
-
characterCount.words === 1 ? "" : "s"
|
|
439
|
-
] }), /* @__PURE__ */ jsxs("span", { children: [
|
|
440
|
-
characterCount.characters,
|
|
441
|
-
typeof maxCharacters === "number" ? ` / ${maxCharacters}` : "",
|
|
442
|
-
" ",
|
|
443
|
-
"characters"
|
|
444
|
-
] })]
|
|
445
|
-
});
|
|
446
|
-
$[45] = allowCharacterCount;
|
|
447
|
-
$[46] = characterCount;
|
|
448
|
-
$[47] = maxCharacters;
|
|
449
|
-
$[48] = showCharacterCount;
|
|
450
|
-
$[49] = t20;
|
|
451
|
-
} else t20 = $[49];
|
|
452
|
-
let t21;
|
|
453
|
-
if ($[50] !== t16 || $[51] !== t17 || $[52] !== t18 || $[53] !== t19 || $[54] !== t20) {
|
|
454
|
-
t21 = /* @__PURE__ */ jsxs("div", {
|
|
455
|
-
className: t16,
|
|
456
|
-
children: [
|
|
457
|
-
t17,
|
|
458
|
-
t18,
|
|
459
|
-
t19,
|
|
460
|
-
t20
|
|
461
|
-
]
|
|
462
|
-
});
|
|
463
|
-
$[50] = t16;
|
|
464
|
-
$[51] = t17;
|
|
465
|
-
$[52] = t18;
|
|
466
|
-
$[53] = t19;
|
|
467
|
-
$[54] = t20;
|
|
468
|
-
$[55] = t21;
|
|
469
|
-
} else t21 = $[55];
|
|
470
|
-
let t22;
|
|
471
|
-
if ($[56] !== allowLinks || $[57] !== editor || $[58] !== isEditable || $[59] !== linkOpen) {
|
|
472
|
-
t22 = allowLinks && /* @__PURE__ */ jsx(LinkPopover, {
|
|
473
|
-
editor,
|
|
474
|
-
open: linkOpen,
|
|
475
|
-
onOpenChange: setLinkOpen,
|
|
476
|
-
disabled: !isEditable
|
|
477
|
-
});
|
|
478
|
-
$[56] = allowLinks;
|
|
479
|
-
$[57] = editor;
|
|
480
|
-
$[58] = isEditable;
|
|
481
|
-
$[59] = linkOpen;
|
|
482
|
-
$[60] = t22;
|
|
483
|
-
} else t22 = $[60];
|
|
484
|
-
let t23;
|
|
485
|
-
if ($[61] !== allowImages || $[62] !== editor || $[63] !== enableMediaLibrary || $[64] !== imageCollection || $[65] !== imageOpen || $[66] !== isEditable || $[67] !== onImageUpload) {
|
|
486
|
-
t23 = allowImages && /* @__PURE__ */ jsx(ImagePopover, {
|
|
487
|
-
editor,
|
|
488
|
-
open: imageOpen,
|
|
489
|
-
onOpenChange: setImageOpen,
|
|
490
|
-
disabled: !isEditable,
|
|
491
|
-
onImageUpload,
|
|
492
|
-
imageCollection,
|
|
493
|
-
enableMediaLibrary
|
|
494
|
-
});
|
|
495
|
-
$[61] = allowImages;
|
|
496
|
-
$[62] = editor;
|
|
497
|
-
$[63] = enableMediaLibrary;
|
|
498
|
-
$[64] = imageCollection;
|
|
499
|
-
$[65] = imageOpen;
|
|
500
|
-
$[66] = isEditable;
|
|
501
|
-
$[67] = onImageUpload;
|
|
502
|
-
$[68] = t23;
|
|
503
|
-
} else t23 = $[68];
|
|
504
|
-
let t24;
|
|
505
|
-
if ($[69] !== t21 || $[70] !== t22 || $[71] !== t23) {
|
|
506
|
-
t24 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
507
|
-
t21,
|
|
508
|
-
t22,
|
|
509
|
-
t23
|
|
510
|
-
] });
|
|
511
|
-
$[69] = t21;
|
|
512
|
-
$[70] = t22;
|
|
513
|
-
$[71] = t23;
|
|
514
|
-
$[72] = t24;
|
|
515
|
-
} else t24 = $[72];
|
|
516
|
-
return t24;
|
|
694
|
+
React.useEffect(() => {
|
|
695
|
+
if (prevLocaleRef.current !== locale) {
|
|
696
|
+
prevLocaleRef.current = locale;
|
|
697
|
+
lastEmittedValueRef.current = void 0;
|
|
698
|
+
}
|
|
699
|
+
}, [locale]);
|
|
700
|
+
React.useEffect(() => {
|
|
701
|
+
if (!editor) return;
|
|
702
|
+
if (value === void 0) return;
|
|
703
|
+
if (isSameValue(value, lastEmittedValueRef.current)) return;
|
|
704
|
+
lastEmittedValueRef.current = value;
|
|
705
|
+
editor.commands.setContent(value ?? "", false);
|
|
706
|
+
}, [editor, value]);
|
|
707
|
+
const characterCount = getCharacterCount(editor);
|
|
708
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
709
|
+
className: cn("qp-rich-text-editor control-surface h-auto min-h-[160px] overflow-hidden", disabled || readOnly ? "opacity-60" : "", error ? "border-destructive" : "border-border"),
|
|
710
|
+
"data-admin-rich-text-editor": "root",
|
|
711
|
+
children: [
|
|
712
|
+
editor && allowToolbar && /* @__PURE__ */ jsx(RichTextToolbar, {
|
|
713
|
+
editor,
|
|
714
|
+
features,
|
|
715
|
+
disabled: !isEditable,
|
|
716
|
+
headingValue,
|
|
717
|
+
onHeadingChange: (value_0) => {
|
|
718
|
+
if (!editor) return;
|
|
719
|
+
if (value_0 === "paragraph") {
|
|
720
|
+
editor.chain().focus().setParagraph().run();
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
editor.chain().focus().toggleHeading({ level: Number(value_0) }).run();
|
|
724
|
+
},
|
|
725
|
+
onLinkClick: () => setLinkOpen(true),
|
|
726
|
+
onImageClick: () => setImageOpen(true),
|
|
727
|
+
onTableClick: () => {
|
|
728
|
+
if (!inTable) editor.chain().focus().insertTable({
|
|
729
|
+
rows: 3,
|
|
730
|
+
cols: 3,
|
|
731
|
+
withHeaderRow: true
|
|
732
|
+
}).run();
|
|
733
|
+
},
|
|
734
|
+
inTable
|
|
735
|
+
}),
|
|
736
|
+
editor && (allowBubbleMenu || linkOpen) && /* @__PURE__ */ jsx(RichTextBubbleMenu, {
|
|
737
|
+
editor,
|
|
738
|
+
features,
|
|
739
|
+
disabled: !isEditable,
|
|
740
|
+
linkOpen,
|
|
741
|
+
onImageClick: allowImages ? () => setImageOpen(true) : void 0,
|
|
742
|
+
onLinkOpenChange: setLinkOpen,
|
|
743
|
+
showFormatting: allowBubbleMenu
|
|
744
|
+
}),
|
|
745
|
+
editor ? /* @__PURE__ */ jsx(EditorContent, {
|
|
746
|
+
editor,
|
|
747
|
+
id: name
|
|
748
|
+
}) : /* @__PURE__ */ jsx(RichTextEditorContentSkeleton, {}),
|
|
749
|
+
uploadingInlineImage && /* @__PURE__ */ jsx("div", {
|
|
750
|
+
className: "qp-rich-text-editor__upload-status",
|
|
751
|
+
role: "status",
|
|
752
|
+
"aria-live": "polite",
|
|
753
|
+
children: t("editor.uploading")
|
|
754
|
+
}),
|
|
755
|
+
allowCharacterCount && showCharacterCount && /* @__PURE__ */ jsxs("div", {
|
|
756
|
+
className: "bg-surface-low text-muted-foreground border-border-subtle flex items-center justify-between border-t px-2 py-1 text-xs",
|
|
757
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [
|
|
758
|
+
characterCount.words,
|
|
759
|
+
" word",
|
|
760
|
+
characterCount.words === 1 ? "" : "s"
|
|
761
|
+
] }), /* @__PURE__ */ jsxs("span", { children: [
|
|
762
|
+
characterCount.characters,
|
|
763
|
+
typeof maxCharacters === "number" ? ` / ${maxCharacters}` : "",
|
|
764
|
+
" ",
|
|
765
|
+
"characters"
|
|
766
|
+
] })]
|
|
767
|
+
})
|
|
768
|
+
]
|
|
769
|
+
}), allowImages && /* @__PURE__ */ jsx(ImagePopover, {
|
|
770
|
+
editor,
|
|
771
|
+
open: imageOpen,
|
|
772
|
+
onOpenChange: setImageOpen,
|
|
773
|
+
disabled: !isEditable,
|
|
774
|
+
onImageUpload,
|
|
775
|
+
imageCollection,
|
|
776
|
+
enableMediaLibrary
|
|
777
|
+
})] });
|
|
517
778
|
}
|
|
518
779
|
|
|
519
780
|
//#endregion
|