@questpie/admin 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-editor-layout.mjs +2 -2
- 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 +91 -63
- 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 +106 -86
- 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 +406 -365
- package/dist/client/components/primitives/select-single.mjs +391 -323
- 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 +154 -100
- package/dist/client/components/widgets/progress-widget.mjs +63 -36
- package/dist/client/components/widgets/quick-actions-widget.mjs +207 -115
- package/dist/client/components/widgets/recent-items-widget.mjs +147 -103
- package/dist/client/components/widgets/stats-widget.mjs +91 -72
- package/dist/client/components/widgets/table-widget.mjs +161 -247
- package/dist/client/components/widgets/timeline-widget.mjs +119 -78
- package/dist/client/components/widgets/value-widget.mjs +286 -157
- 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 +70 -46
- 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-banner.mjs +75 -46
- 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/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/auth-layout.d.mts +17 -10
- 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 +1167 -234
- 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 +152 -155
- package/dist/client/views/layout/admin-router.mjs +936 -616
- package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
- package/dist/client/views/layout/admin-sidebar.mjs +762 -592
- 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 +3 -3
- 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 +70 -71
- 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 +29 -7
- package/dist/server/i18n/messages/cs.mjs +414 -1
- package/dist/server/i18n/messages/de.mjs +412 -1
- package/dist/server/i18n/messages/en.mjs +166 -1
- package/dist/server/i18n/messages/es.mjs +412 -1
- package/dist/server/i18n/messages/fr.mjs +412 -1
- package/dist/server/i18n/messages/pl.mjs +416 -1
- package/dist/server/i18n/messages/pt.mjs +409 -1
- package/dist/server/i18n/messages/sk.mjs +216 -2
- 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 +2 -2
- package/dist/server/modules/admin/collections/admin-locks.d.mts +2 -2
- 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 +42 -42
- 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 +40 -28
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- 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 +67 -28
- package/dist/server/modules/admin/routes/i18n-helpers.mjs +34 -0
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.mjs +25 -17
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
- package/dist/server/modules/admin/routes/setup.d.mts +10 -10
- package/dist/server/modules/admin/routes/setup.mjs +16 -13
- 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-preferences/collections/admin-preferences.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +2 -2
- 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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useTranslation } from "../../../i18n/hooks.mjs";
|
|
2
2
|
import { cn } from "../../../lib/utils.mjs";
|
|
3
3
|
import { Button } from "../../ui/button.mjs";
|
|
4
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "../../ui/select.mjs";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "../../ui/dropdown-menu.mjs";
|
|
4
6
|
import { TableControls } from "./table-controls.mjs";
|
|
5
7
|
import { c } from "react/compiler-runtime";
|
|
6
8
|
import { Icon } from "@iconify/react";
|
|
@@ -36,13 +38,79 @@ const EDITOR_ICONS = {
|
|
|
36
38
|
alignLeft: "ph:text-align-left",
|
|
37
39
|
alignCenter: "ph:text-align-center",
|
|
38
40
|
alignRight: "ph:text-align-right",
|
|
39
|
-
alignJustify: "ph:text-align-justify"
|
|
41
|
+
alignJustify: "ph:text-align-justify",
|
|
42
|
+
blocks: "ph:list-plus",
|
|
43
|
+
formatting: "ph:text-aa",
|
|
44
|
+
insert: "ph:plus",
|
|
45
|
+
more: "ph:dots-three-vertical"
|
|
40
46
|
};
|
|
47
|
+
const HEADING_OPTIONS = [
|
|
48
|
+
{
|
|
49
|
+
value: "paragraph",
|
|
50
|
+
group: "text"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
value: "1",
|
|
54
|
+
group: "heading"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: "2",
|
|
58
|
+
group: "heading"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: "3",
|
|
62
|
+
group: "heading"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: "4",
|
|
66
|
+
group: "heading"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: "5",
|
|
70
|
+
group: "heading"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: "6",
|
|
74
|
+
group: "heading"
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
const ALIGNMENT_OPTIONS = [
|
|
78
|
+
{
|
|
79
|
+
value: "left",
|
|
80
|
+
icon: EDITOR_ICONS.alignLeft,
|
|
81
|
+
labelKey: "editor.alignLeft"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
value: "center",
|
|
85
|
+
icon: EDITOR_ICONS.alignCenter,
|
|
86
|
+
labelKey: "editor.alignCenter"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
value: "right",
|
|
90
|
+
icon: EDITOR_ICONS.alignRight,
|
|
91
|
+
labelKey: "editor.alignRight"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
value: "justify",
|
|
95
|
+
icon: EDITOR_ICONS.alignJustify,
|
|
96
|
+
labelKey: "editor.alignJustify"
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
function getHeadingOptionLabel(value, t) {
|
|
100
|
+
if (value === "paragraph") return t("editor.paragraph");
|
|
101
|
+
return t("editor.heading", { level: value });
|
|
102
|
+
}
|
|
103
|
+
function getCurrentAlignment(editor) {
|
|
104
|
+
if (editor.isActive({ textAlign: "center" })) return "center";
|
|
105
|
+
if (editor.isActive({ textAlign: "right" })) return "right";
|
|
106
|
+
if (editor.isActive({ textAlign: "justify" })) return "justify";
|
|
107
|
+
return "left";
|
|
108
|
+
}
|
|
41
109
|
/**
|
|
42
110
|
* Icon-based toolbar button with tooltip showing keyboard shortcuts
|
|
43
111
|
*/
|
|
44
112
|
function ToolbarButton(t0) {
|
|
45
|
-
const $ = c(
|
|
113
|
+
const $ = c(30);
|
|
46
114
|
let active;
|
|
47
115
|
let children;
|
|
48
116
|
let className;
|
|
@@ -84,16 +152,18 @@ function ToolbarButton(t0) {
|
|
|
84
152
|
} else t1 = $[12];
|
|
85
153
|
const tooltipText = t1;
|
|
86
154
|
const iconSuffix = active ? "-fill" : "";
|
|
87
|
-
const buttonSize = iconName ? "icon-
|
|
88
|
-
|
|
155
|
+
const buttonSize = iconName ? "icon-sm" : "xs";
|
|
156
|
+
const t2 = typeof active === "boolean" ? active : void 0;
|
|
157
|
+
let t3;
|
|
89
158
|
if ($[13] !== className) {
|
|
90
|
-
|
|
159
|
+
t3 = cn("item-surface text-muted-foreground hover:bg-surface-high hover:text-foreground motion-reduce:transition-none", "data-[active=true]:bg-surface-high data-[active=true]:text-foreground", "aria-expanded:bg-surface-high", className);
|
|
91
160
|
$[13] = className;
|
|
92
|
-
$[14] =
|
|
93
|
-
} else
|
|
94
|
-
let
|
|
161
|
+
$[14] = t3;
|
|
162
|
+
} else t3 = $[14];
|
|
163
|
+
let t4;
|
|
95
164
|
if ($[15] !== children || $[16] !== iconName || $[17] !== iconSuffix) {
|
|
96
|
-
|
|
165
|
+
t4 = iconName ? /* @__PURE__ */ jsx(Icon, {
|
|
166
|
+
"aria-hidden": "true",
|
|
97
167
|
icon: `${iconName}${iconSuffix}`,
|
|
98
168
|
width: 16,
|
|
99
169
|
height: 16
|
|
@@ -101,21 +171,24 @@ function ToolbarButton(t0) {
|
|
|
101
171
|
$[15] = children;
|
|
102
172
|
$[16] = iconName;
|
|
103
173
|
$[17] = iconSuffix;
|
|
104
|
-
$[18] =
|
|
105
|
-
} else
|
|
106
|
-
let
|
|
107
|
-
if ($[19] !== active || $[20] !== buttonSize || $[21] !== disabled || $[22] !== onClick || $[23] !== rest || $[24] !== t2 || $[25] !== t3 || $[26] !== tooltipText) {
|
|
108
|
-
|
|
174
|
+
$[18] = t4;
|
|
175
|
+
} else t4 = $[18];
|
|
176
|
+
let t5;
|
|
177
|
+
if ($[19] !== active || $[20] !== buttonSize || $[21] !== disabled || $[22] !== onClick || $[23] !== rest || $[24] !== t2 || $[25] !== t3 || $[26] !== t4 || $[27] !== title || $[28] !== tooltipText) {
|
|
178
|
+
t5 = /* @__PURE__ */ jsx(Button, {
|
|
109
179
|
type: "button",
|
|
110
180
|
variant: "ghost",
|
|
111
181
|
size: buttonSize,
|
|
182
|
+
"aria-label": title,
|
|
183
|
+
"aria-pressed": t2,
|
|
112
184
|
"data-active": active,
|
|
185
|
+
"data-rich-text-toolbar-button": "",
|
|
113
186
|
title: tooltipText,
|
|
114
187
|
disabled,
|
|
115
188
|
onClick,
|
|
116
|
-
className:
|
|
189
|
+
className: t3,
|
|
117
190
|
...rest,
|
|
118
|
-
children:
|
|
191
|
+
children: t4
|
|
119
192
|
});
|
|
120
193
|
$[19] = active;
|
|
121
194
|
$[20] = buttonSize;
|
|
@@ -124,10 +197,12 @@ function ToolbarButton(t0) {
|
|
|
124
197
|
$[23] = rest;
|
|
125
198
|
$[24] = t2;
|
|
126
199
|
$[25] = t3;
|
|
127
|
-
$[26] =
|
|
128
|
-
$[27] =
|
|
129
|
-
|
|
130
|
-
|
|
200
|
+
$[26] = t4;
|
|
201
|
+
$[27] = title;
|
|
202
|
+
$[28] = tooltipText;
|
|
203
|
+
$[29] = t5;
|
|
204
|
+
} else t5 = $[29];
|
|
205
|
+
return t5;
|
|
131
206
|
}
|
|
132
207
|
/**
|
|
133
208
|
* Toolbar button group with divider
|
|
@@ -139,6 +214,7 @@ function ToolbarGroup(t0) {
|
|
|
139
214
|
if ($[0] !== children) {
|
|
140
215
|
t1 = /* @__PURE__ */ jsx("div", {
|
|
141
216
|
className: "flex items-center gap-1",
|
|
217
|
+
role: "group",
|
|
142
218
|
children
|
|
143
219
|
});
|
|
144
220
|
$[0] = children;
|
|
@@ -146,17 +222,101 @@ function ToolbarGroup(t0) {
|
|
|
146
222
|
} else t1 = $[1];
|
|
147
223
|
return t1;
|
|
148
224
|
}
|
|
225
|
+
function ToolbarMenuItem(t0) {
|
|
226
|
+
const $ = c(17);
|
|
227
|
+
const { active, disabled, icon, label, onClick, shortcut } = t0;
|
|
228
|
+
const t1 = active ? "true" : void 0;
|
|
229
|
+
const t2 = active ? "bg-accent text-accent-foreground" : "";
|
|
230
|
+
let t3;
|
|
231
|
+
if ($[0] !== t2) {
|
|
232
|
+
t3 = cn("min-w-44", t2);
|
|
233
|
+
$[0] = t2;
|
|
234
|
+
$[1] = t3;
|
|
235
|
+
} else t3 = $[1];
|
|
236
|
+
let t4;
|
|
237
|
+
if ($[2] !== icon) {
|
|
238
|
+
t4 = /* @__PURE__ */ jsx(Icon, {
|
|
239
|
+
"aria-hidden": "true",
|
|
240
|
+
icon
|
|
241
|
+
});
|
|
242
|
+
$[2] = icon;
|
|
243
|
+
$[3] = t4;
|
|
244
|
+
} else t4 = $[3];
|
|
245
|
+
let t5;
|
|
246
|
+
if ($[4] !== label) {
|
|
247
|
+
t5 = /* @__PURE__ */ jsx("span", { children: label });
|
|
248
|
+
$[4] = label;
|
|
249
|
+
$[5] = t5;
|
|
250
|
+
} else t5 = $[5];
|
|
251
|
+
let t6;
|
|
252
|
+
if ($[6] !== active || $[7] !== shortcut) {
|
|
253
|
+
t6 = shortcut ? /* @__PURE__ */ jsx(DropdownMenuShortcut, { children: shortcut }) : active ? /* @__PURE__ */ jsx(Icon, {
|
|
254
|
+
"aria-hidden": "true",
|
|
255
|
+
icon: "ph:check",
|
|
256
|
+
className: "ml-auto size-3.5"
|
|
257
|
+
}) : null;
|
|
258
|
+
$[6] = active;
|
|
259
|
+
$[7] = shortcut;
|
|
260
|
+
$[8] = t6;
|
|
261
|
+
} else t6 = $[8];
|
|
262
|
+
let t7;
|
|
263
|
+
if ($[9] !== disabled || $[10] !== onClick || $[11] !== t1 || $[12] !== t3 || $[13] !== t4 || $[14] !== t5 || $[15] !== t6) {
|
|
264
|
+
t7 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
265
|
+
"aria-current": t1,
|
|
266
|
+
disabled,
|
|
267
|
+
onClick,
|
|
268
|
+
className: t3,
|
|
269
|
+
children: [
|
|
270
|
+
t4,
|
|
271
|
+
t5,
|
|
272
|
+
t6
|
|
273
|
+
]
|
|
274
|
+
});
|
|
275
|
+
$[9] = disabled;
|
|
276
|
+
$[10] = onClick;
|
|
277
|
+
$[11] = t1;
|
|
278
|
+
$[12] = t3;
|
|
279
|
+
$[13] = t4;
|
|
280
|
+
$[14] = t5;
|
|
281
|
+
$[15] = t6;
|
|
282
|
+
$[16] = t7;
|
|
283
|
+
} else t7 = $[16];
|
|
284
|
+
return t7;
|
|
285
|
+
}
|
|
149
286
|
/**
|
|
150
287
|
* Main toolbar component with icon-based buttons
|
|
151
288
|
*/
|
|
152
289
|
function RichTextToolbar(t0) {
|
|
153
|
-
const $ = c(
|
|
290
|
+
const $ = c(77);
|
|
154
291
|
const { editor, features, disabled, headingValue, onHeadingChange, onLinkClick, onImageClick, onTableClick, inTable } = t0;
|
|
155
292
|
const { t } = useTranslation();
|
|
156
293
|
const isEditable = !disabled;
|
|
157
294
|
let t1;
|
|
158
|
-
if ($[0] !== editor
|
|
159
|
-
t1 =
|
|
295
|
+
if ($[0] !== editor) {
|
|
296
|
+
t1 = getCurrentAlignment(editor);
|
|
297
|
+
$[0] = editor;
|
|
298
|
+
$[1] = t1;
|
|
299
|
+
} else t1 = $[1];
|
|
300
|
+
const currentAlignment = t1;
|
|
301
|
+
let t2;
|
|
302
|
+
if ($[2] !== currentAlignment) {
|
|
303
|
+
t2 = ALIGNMENT_OPTIONS.find((option) => option.value === currentAlignment) ?? ALIGNMENT_OPTIONS[0];
|
|
304
|
+
$[2] = currentAlignment;
|
|
305
|
+
$[3] = t2;
|
|
306
|
+
} else t2 = $[3];
|
|
307
|
+
const currentAlignmentOption = t2;
|
|
308
|
+
const hasMoreFormatting = features.underline || features.strike || features.code;
|
|
309
|
+
const hasBlockMenu = features.bulletList || features.orderedList || features.blockquote || features.codeBlock || features.horizontalRule;
|
|
310
|
+
const hasInsertMenu = features.link || features.image || features.table;
|
|
311
|
+
let t3;
|
|
312
|
+
if ($[4] !== t) {
|
|
313
|
+
t3 = t("editor.richTextToolbar");
|
|
314
|
+
$[4] = t;
|
|
315
|
+
$[5] = t3;
|
|
316
|
+
} else t3 = $[5];
|
|
317
|
+
let t4;
|
|
318
|
+
if ($[6] !== editor || $[7] !== features.history || $[8] !== isEditable || $[9] !== t) {
|
|
319
|
+
t4 = features.history && /* @__PURE__ */ jsxs(ToolbarGroup, { children: [/* @__PURE__ */ jsx(ToolbarButton, {
|
|
160
320
|
icon: EDITOR_ICONS.undo,
|
|
161
321
|
disabled: !isEditable || !editor.can().undo(),
|
|
162
322
|
title: t("editor.undo"),
|
|
@@ -169,59 +329,51 @@ function RichTextToolbar(t0) {
|
|
|
169
329
|
shortcut: "⌘⇧Z",
|
|
170
330
|
onClick: () => editor.chain().focus().redo().run()
|
|
171
331
|
})] });
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
} else
|
|
178
|
-
let
|
|
179
|
-
if ($[
|
|
180
|
-
|
|
181
|
-
className: "border-input bg-transparent h-6 border px-2 text-xs",
|
|
332
|
+
$[6] = editor;
|
|
333
|
+
$[7] = features.history;
|
|
334
|
+
$[8] = isEditable;
|
|
335
|
+
$[9] = t;
|
|
336
|
+
$[10] = t4;
|
|
337
|
+
} else t4 = $[10];
|
|
338
|
+
let t5;
|
|
339
|
+
if ($[11] !== features.heading || $[12] !== headingValue || $[13] !== isEditable || $[14] !== onHeadingChange || $[15] !== t) {
|
|
340
|
+
t5 = features.heading && /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(Select, {
|
|
182
341
|
value: headingValue,
|
|
183
|
-
onChange: (event) => onHeadingChange(event.target.value),
|
|
184
342
|
disabled: !isEditable,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
children: "Heading 5"
|
|
209
|
-
}),
|
|
210
|
-
/* @__PURE__ */ jsx("option", {
|
|
211
|
-
value: "6",
|
|
212
|
-
children: "Heading 6"
|
|
213
|
-
})
|
|
214
|
-
]
|
|
343
|
+
onValueChange: (value) => {
|
|
344
|
+
if (typeof value === "string") onHeadingChange(value);
|
|
345
|
+
},
|
|
346
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
347
|
+
"aria-label": t("editor.blockType"),
|
|
348
|
+
className: "h-8 min-w-[136px] px-2.5 text-sm",
|
|
349
|
+
size: "sm",
|
|
350
|
+
children: /* @__PURE__ */ jsx(SelectValue, { children: HEADING_OPTIONS.find((option_1) => option_1.value === headingValue)?.value ? getHeadingOptionLabel(HEADING_OPTIONS.find((option_0) => option_0.value === headingValue)?.value ?? "paragraph", t) : t("editor.paragraph") })
|
|
351
|
+
}), /* @__PURE__ */ jsxs(SelectContent, {
|
|
352
|
+
align: "start",
|
|
353
|
+
className: "min-w-[136px]",
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ jsxs(SelectGroup, { children: [/* @__PURE__ */ jsx(SelectLabel, { children: t("editor.textBlocks") }), /* @__PURE__ */ jsx(SelectItem, {
|
|
356
|
+
value: "paragraph",
|
|
357
|
+
children: t("editor.paragraph")
|
|
358
|
+
})] }),
|
|
359
|
+
/* @__PURE__ */ jsx(SelectSeparator, {}),
|
|
360
|
+
/* @__PURE__ */ jsxs(SelectGroup, { children: [/* @__PURE__ */ jsx(SelectLabel, { children: t("editor.headings") }), HEADING_OPTIONS.filter(_temp).map((option_3) => /* @__PURE__ */ jsx(SelectItem, {
|
|
361
|
+
value: option_3.value,
|
|
362
|
+
children: getHeadingOptionLabel(option_3.value, t)
|
|
363
|
+
}, option_3.value))] })
|
|
364
|
+
]
|
|
365
|
+
})]
|
|
215
366
|
}) });
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
367
|
+
$[11] = features.heading;
|
|
368
|
+
$[12] = headingValue;
|
|
369
|
+
$[13] = isEditable;
|
|
370
|
+
$[14] = onHeadingChange;
|
|
371
|
+
$[15] = t;
|
|
372
|
+
$[16] = t5;
|
|
373
|
+
} else t5 = $[16];
|
|
374
|
+
let t6;
|
|
375
|
+
if ($[17] !== editor || $[18] !== features.bold || $[19] !== isEditable || $[20] !== t) {
|
|
376
|
+
t6 = features.bold && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
225
377
|
icon: EDITOR_ICONS.bold,
|
|
226
378
|
active: editor.isActive("bold"),
|
|
227
379
|
disabled: !isEditable,
|
|
@@ -229,15 +381,15 @@ function RichTextToolbar(t0) {
|
|
|
229
381
|
shortcut: "⌘B",
|
|
230
382
|
onClick: () => editor.chain().focus().toggleBold().run()
|
|
231
383
|
});
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
} else
|
|
238
|
-
let
|
|
239
|
-
if ($[
|
|
240
|
-
|
|
384
|
+
$[17] = editor;
|
|
385
|
+
$[18] = features.bold;
|
|
386
|
+
$[19] = isEditable;
|
|
387
|
+
$[20] = t;
|
|
388
|
+
$[21] = t6;
|
|
389
|
+
} else t6 = $[21];
|
|
390
|
+
let t7;
|
|
391
|
+
if ($[22] !== editor || $[23] !== features.italic || $[24] !== isEditable || $[25] !== t) {
|
|
392
|
+
t7 = features.italic && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
241
393
|
icon: EDITOR_ICONS.italic,
|
|
242
394
|
active: editor.isActive("italic"),
|
|
243
395
|
disabled: !isEditable,
|
|
@@ -245,237 +397,210 @@ function RichTextToolbar(t0) {
|
|
|
245
397
|
shortcut: "⌘I",
|
|
246
398
|
onClick: () => editor.chain().focus().toggleItalic().run()
|
|
247
399
|
});
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
} else
|
|
254
|
-
let
|
|
255
|
-
if ($[
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
400
|
+
$[22] = editor;
|
|
401
|
+
$[23] = features.italic;
|
|
402
|
+
$[24] = isEditable;
|
|
403
|
+
$[25] = t;
|
|
404
|
+
$[26] = t7;
|
|
405
|
+
} else t7 = $[26];
|
|
406
|
+
let t8;
|
|
407
|
+
if ($[27] !== editor || $[28] !== features.code || $[29] !== features.strike || $[30] !== features.underline || $[31] !== hasMoreFormatting || $[32] !== isEditable || $[33] !== t) {
|
|
408
|
+
t8 = hasMoreFormatting && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
409
|
+
nativeButton: false,
|
|
410
|
+
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
411
|
+
icon: EDITOR_ICONS.formatting,
|
|
412
|
+
active: editor.isActive("underline") || editor.isActive("strike") || editor.isActive("code"),
|
|
413
|
+
disabled: !isEditable,
|
|
414
|
+
title: t("editor.moreFormatting")
|
|
415
|
+
})
|
|
416
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
417
|
+
align: "start",
|
|
418
|
+
className: "w-56",
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: t("editor.formatting") }),
|
|
421
|
+
features.underline && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
422
|
+
icon: EDITOR_ICONS.underline,
|
|
423
|
+
active: editor.isActive("underline"),
|
|
424
|
+
disabled: !isEditable,
|
|
425
|
+
label: t("editor.underline"),
|
|
426
|
+
shortcut: "⌘U",
|
|
427
|
+
onClick: () => editor.chain().focus().toggleUnderline().run()
|
|
428
|
+
}),
|
|
429
|
+
features.strike && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
430
|
+
icon: EDITOR_ICONS.strikethrough,
|
|
431
|
+
active: editor.isActive("strike"),
|
|
432
|
+
disabled: !isEditable,
|
|
433
|
+
label: t("editor.strikethrough"),
|
|
434
|
+
onClick: () => editor.chain().focus().toggleStrike().run()
|
|
435
|
+
}),
|
|
436
|
+
features.code && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
437
|
+
icon: EDITOR_ICONS.code,
|
|
438
|
+
active: editor.isActive("code"),
|
|
439
|
+
disabled: !isEditable,
|
|
440
|
+
label: t("editor.code"),
|
|
441
|
+
shortcut: "⌘E",
|
|
442
|
+
onClick: () => editor.chain().focus().toggleCode().run()
|
|
443
|
+
})
|
|
444
|
+
]
|
|
445
|
+
})] });
|
|
446
|
+
$[27] = editor;
|
|
447
|
+
$[28] = features.code;
|
|
448
|
+
$[29] = features.strike;
|
|
449
|
+
$[30] = features.underline;
|
|
450
|
+
$[31] = hasMoreFormatting;
|
|
297
451
|
$[32] = isEditable;
|
|
298
452
|
$[33] = t;
|
|
299
|
-
$[34] =
|
|
300
|
-
} else
|
|
301
|
-
let t8;
|
|
302
|
-
if ($[35] !== editor || $[36] !== features.codeBlock || $[37] !== isEditable || $[38] !== t) {
|
|
303
|
-
t8 = features.codeBlock && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
304
|
-
icon: EDITOR_ICONS.codeBlock,
|
|
305
|
-
active: editor.isActive("codeBlock"),
|
|
306
|
-
disabled: !isEditable,
|
|
307
|
-
title: t("editor.codeBlock"),
|
|
308
|
-
onClick: () => editor.chain().focus().toggleCodeBlock().run()
|
|
309
|
-
});
|
|
310
|
-
$[35] = editor;
|
|
311
|
-
$[36] = features.codeBlock;
|
|
312
|
-
$[37] = isEditable;
|
|
313
|
-
$[38] = t;
|
|
314
|
-
$[39] = t8;
|
|
315
|
-
} else t8 = $[39];
|
|
453
|
+
$[34] = t8;
|
|
454
|
+
} else t8 = $[34];
|
|
316
455
|
let t9;
|
|
317
|
-
if ($[
|
|
456
|
+
if ($[35] !== t6 || $[36] !== t7 || $[37] !== t8) {
|
|
318
457
|
t9 = /* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
319
|
-
t3,
|
|
320
|
-
t4,
|
|
321
|
-
t5,
|
|
322
458
|
t6,
|
|
323
459
|
t7,
|
|
324
460
|
t8
|
|
325
461
|
] });
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
|
|
331
|
-
$[45] = t8;
|
|
332
|
-
$[46] = t9;
|
|
333
|
-
} else t9 = $[46];
|
|
462
|
+
$[35] = t6;
|
|
463
|
+
$[36] = t7;
|
|
464
|
+
$[37] = t8;
|
|
465
|
+
$[38] = t9;
|
|
466
|
+
} else t9 = $[38];
|
|
334
467
|
let t10;
|
|
335
|
-
if ($[
|
|
336
|
-
t10 =
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
onClick: () => editor.chain().focus().toggleBulletList().run()
|
|
342
|
-
});
|
|
343
|
-
$[47] = editor;
|
|
344
|
-
$[48] = features.bulletList;
|
|
345
|
-
$[49] = isEditable;
|
|
346
|
-
$[50] = t;
|
|
347
|
-
$[51] = t10;
|
|
348
|
-
} else t10 = $[51];
|
|
349
|
-
let t11;
|
|
350
|
-
if ($[52] !== editor || $[53] !== features.orderedList || $[54] !== isEditable || $[55] !== t) {
|
|
351
|
-
t11 = features.orderedList && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
352
|
-
icon: EDITOR_ICONS.orderedList,
|
|
353
|
-
active: editor.isActive("orderedList"),
|
|
354
|
-
disabled: !isEditable,
|
|
355
|
-
title: t("editor.orderedList"),
|
|
356
|
-
onClick: () => editor.chain().focus().toggleOrderedList().run()
|
|
357
|
-
});
|
|
358
|
-
$[52] = editor;
|
|
359
|
-
$[53] = features.orderedList;
|
|
360
|
-
$[54] = isEditable;
|
|
361
|
-
$[55] = t;
|
|
362
|
-
$[56] = t11;
|
|
363
|
-
} else t11 = $[56];
|
|
364
|
-
let t12;
|
|
365
|
-
if ($[57] !== editor || $[58] !== features.blockquote || $[59] !== isEditable || $[60] !== t) {
|
|
366
|
-
t12 = features.blockquote && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
367
|
-
icon: EDITOR_ICONS.blockquote,
|
|
368
|
-
active: editor.isActive("blockquote"),
|
|
369
|
-
disabled: !isEditable,
|
|
370
|
-
title: t("editor.quote"),
|
|
371
|
-
onClick: () => editor.chain().focus().toggleBlockquote().run()
|
|
372
|
-
});
|
|
373
|
-
$[57] = editor;
|
|
374
|
-
$[58] = features.blockquote;
|
|
375
|
-
$[59] = isEditable;
|
|
376
|
-
$[60] = t;
|
|
377
|
-
$[61] = t12;
|
|
378
|
-
} else t12 = $[61];
|
|
379
|
-
let t13;
|
|
380
|
-
if ($[62] !== editor || $[63] !== features.horizontalRule || $[64] !== isEditable || $[65] !== t) {
|
|
381
|
-
t13 = features.horizontalRule && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
382
|
-
icon: EDITOR_ICONS.horizontalRule,
|
|
383
|
-
disabled: !isEditable,
|
|
384
|
-
title: t("editor.horizontalRule"),
|
|
385
|
-
onClick: () => editor.chain().focus().setHorizontalRule().run()
|
|
386
|
-
});
|
|
387
|
-
$[62] = editor;
|
|
388
|
-
$[63] = features.horizontalRule;
|
|
389
|
-
$[64] = isEditable;
|
|
390
|
-
$[65] = t;
|
|
391
|
-
$[66] = t13;
|
|
392
|
-
} else t13 = $[66];
|
|
393
|
-
let t14;
|
|
394
|
-
if ($[67] !== t10 || $[68] !== t11 || $[69] !== t12 || $[70] !== t13) {
|
|
395
|
-
t14 = /* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
396
|
-
t10,
|
|
397
|
-
t11,
|
|
398
|
-
t12,
|
|
399
|
-
t13
|
|
400
|
-
] });
|
|
401
|
-
$[67] = t10;
|
|
402
|
-
$[68] = t11;
|
|
403
|
-
$[69] = t12;
|
|
404
|
-
$[70] = t13;
|
|
405
|
-
$[71] = t14;
|
|
406
|
-
} else t14 = $[71];
|
|
407
|
-
let t15;
|
|
408
|
-
if ($[72] !== editor || $[73] !== features.align || $[74] !== isEditable || $[75] !== t) {
|
|
409
|
-
t15 = features.align && /* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
410
|
-
/* @__PURE__ */ jsx(ToolbarButton, {
|
|
411
|
-
icon: EDITOR_ICONS.alignLeft,
|
|
412
|
-
active: editor.isActive({ textAlign: "left" }),
|
|
468
|
+
if ($[39] !== editor || $[40] !== features.blockquote || $[41] !== features.bulletList || $[42] !== features.codeBlock || $[43] !== features.horizontalRule || $[44] !== features.orderedList || $[45] !== hasBlockMenu || $[46] !== isEditable || $[47] !== t) {
|
|
469
|
+
t10 = hasBlockMenu && /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
470
|
+
nativeButton: false,
|
|
471
|
+
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
472
|
+
icon: EDITOR_ICONS.blocks,
|
|
473
|
+
active: editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("blockquote") || editor.isActive("codeBlock"),
|
|
413
474
|
disabled: !isEditable,
|
|
414
|
-
title: t("editor.
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
475
|
+
title: t("editor.blocks")
|
|
476
|
+
})
|
|
477
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
478
|
+
align: "start",
|
|
479
|
+
className: "w-56",
|
|
480
|
+
children: [
|
|
481
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: t("editor.list") }),
|
|
482
|
+
features.bulletList && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
483
|
+
icon: EDITOR_ICONS.bulletList,
|
|
484
|
+
active: editor.isActive("bulletList"),
|
|
485
|
+
disabled: !isEditable,
|
|
486
|
+
label: t("editor.unorderedList"),
|
|
487
|
+
onClick: () => editor.chain().focus().toggleBulletList().run()
|
|
488
|
+
}),
|
|
489
|
+
features.orderedList && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
490
|
+
icon: EDITOR_ICONS.orderedList,
|
|
491
|
+
active: editor.isActive("orderedList"),
|
|
492
|
+
disabled: !isEditable,
|
|
493
|
+
label: t("editor.orderedList"),
|
|
494
|
+
onClick: () => editor.chain().focus().toggleOrderedList().run()
|
|
495
|
+
}),
|
|
496
|
+
(features.blockquote || features.codeBlock || features.horizontalRule) && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
497
|
+
features.blockquote && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
498
|
+
icon: EDITOR_ICONS.blockquote,
|
|
499
|
+
active: editor.isActive("blockquote"),
|
|
500
|
+
disabled: !isEditable,
|
|
501
|
+
label: t("editor.quote"),
|
|
502
|
+
onClick: () => editor.chain().focus().toggleBlockquote().run()
|
|
503
|
+
}),
|
|
504
|
+
features.codeBlock && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
505
|
+
icon: EDITOR_ICONS.codeBlock,
|
|
506
|
+
active: editor.isActive("codeBlock"),
|
|
507
|
+
disabled: !isEditable,
|
|
508
|
+
label: t("editor.codeBlock"),
|
|
509
|
+
onClick: () => editor.chain().focus().toggleCodeBlock().run()
|
|
510
|
+
}),
|
|
511
|
+
features.horizontalRule && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
512
|
+
icon: EDITOR_ICONS.horizontalRule,
|
|
513
|
+
disabled: !isEditable,
|
|
514
|
+
label: t("editor.horizontalRule"),
|
|
515
|
+
onClick: () => editor.chain().focus().setHorizontalRule().run()
|
|
516
|
+
})
|
|
517
|
+
]
|
|
518
|
+
})] }) });
|
|
519
|
+
$[39] = editor;
|
|
520
|
+
$[40] = features.blockquote;
|
|
521
|
+
$[41] = features.bulletList;
|
|
522
|
+
$[42] = features.codeBlock;
|
|
523
|
+
$[43] = features.horizontalRule;
|
|
524
|
+
$[44] = features.orderedList;
|
|
525
|
+
$[45] = hasBlockMenu;
|
|
526
|
+
$[46] = isEditable;
|
|
527
|
+
$[47] = t;
|
|
528
|
+
$[48] = t10;
|
|
529
|
+
} else t10 = $[48];
|
|
530
|
+
let t11;
|
|
531
|
+
if ($[49] !== currentAlignment || $[50] !== currentAlignmentOption || $[51] !== editor || $[52] !== features.align || $[53] !== isEditable || $[54] !== t) {
|
|
532
|
+
t11 = features.align && /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
533
|
+
nativeButton: false,
|
|
534
|
+
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
535
|
+
icon: currentAlignmentOption.icon,
|
|
536
|
+
active: currentAlignment !== "left",
|
|
427
537
|
disabled: !isEditable,
|
|
428
|
-
title: t("editor.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
538
|
+
title: t("editor.alignment")
|
|
539
|
+
})
|
|
540
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
541
|
+
align: "start",
|
|
542
|
+
className: "w-56",
|
|
543
|
+
children: [/* @__PURE__ */ jsx(DropdownMenuLabel, { children: t("editor.alignment") }), /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
544
|
+
value: currentAlignment,
|
|
545
|
+
onValueChange: (value_0) => {
|
|
546
|
+
editor.chain().focus().setTextAlign(value_0).run();
|
|
547
|
+
},
|
|
548
|
+
children: ALIGNMENT_OPTIONS.map((option_4) => /* @__PURE__ */ jsxs(DropdownMenuRadioItem, {
|
|
549
|
+
value: option_4.value,
|
|
550
|
+
disabled: !isEditable,
|
|
551
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
552
|
+
"aria-hidden": "true",
|
|
553
|
+
icon: option_4.icon
|
|
554
|
+
}), /* @__PURE__ */ jsx("span", { children: t(option_4.labelKey) })]
|
|
555
|
+
}, option_4.value))
|
|
556
|
+
})]
|
|
557
|
+
})] }) });
|
|
558
|
+
$[49] = currentAlignment;
|
|
559
|
+
$[50] = currentAlignmentOption;
|
|
560
|
+
$[51] = editor;
|
|
561
|
+
$[52] = features.align;
|
|
562
|
+
$[53] = isEditable;
|
|
563
|
+
$[54] = t;
|
|
564
|
+
$[55] = t11;
|
|
565
|
+
} else t11 = $[55];
|
|
566
|
+
let t12;
|
|
567
|
+
if ($[56] !== editor || $[57] !== features.image || $[58] !== features.link || $[59] !== features.table || $[60] !== features.tableControls || $[61] !== hasInsertMenu || $[62] !== inTable || $[63] !== isEditable || $[64] !== onImageClick || $[65] !== onLinkClick || $[66] !== onTableClick || $[67] !== t) {
|
|
568
|
+
t12 = hasInsertMenu && /* @__PURE__ */ jsxs(ToolbarGroup, { children: [/* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
569
|
+
nativeButton: false,
|
|
570
|
+
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
571
|
+
icon: EDITOR_ICONS.insert,
|
|
572
|
+
active: editor.isActive("link"),
|
|
434
573
|
disabled: !isEditable,
|
|
435
|
-
title: t("editor.
|
|
436
|
-
onClick: () => editor.chain().focus().setTextAlign("justify").run()
|
|
574
|
+
title: t("editor.insert")
|
|
437
575
|
})
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
disabled: !isEditable,
|
|
467
|
-
title: t("editor.image"),
|
|
468
|
-
onClick: onImageClick
|
|
469
|
-
});
|
|
470
|
-
$[83] = features.image;
|
|
471
|
-
$[84] = isEditable;
|
|
472
|
-
$[85] = onImageClick;
|
|
473
|
-
$[86] = t;
|
|
474
|
-
$[87] = t17;
|
|
475
|
-
} else t17 = $[87];
|
|
476
|
-
let t18;
|
|
477
|
-
if ($[88] !== editor || $[89] !== features.table || $[90] !== features.tableControls || $[91] !== inTable || $[92] !== isEditable || $[93] !== onTableClick || $[94] !== t) {
|
|
478
|
-
t18 = features.table && (features.tableControls ? /* @__PURE__ */ jsx(TableControls, {
|
|
576
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
577
|
+
align: "start",
|
|
578
|
+
className: "w-56",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: t("editor.insert") }),
|
|
581
|
+
features.link && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
582
|
+
icon: EDITOR_ICONS.link,
|
|
583
|
+
active: editor.isActive("link"),
|
|
584
|
+
disabled: !isEditable,
|
|
585
|
+
label: t("editor.link"),
|
|
586
|
+
shortcut: "⌘K",
|
|
587
|
+
onClick: onLinkClick
|
|
588
|
+
}),
|
|
589
|
+
features.image && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
590
|
+
icon: EDITOR_ICONS.image,
|
|
591
|
+
disabled: !isEditable,
|
|
592
|
+
label: t("editor.image"),
|
|
593
|
+
onClick: onImageClick
|
|
594
|
+
}),
|
|
595
|
+
features.table && /* @__PURE__ */ jsx(ToolbarMenuItem, {
|
|
596
|
+
icon: EDITOR_ICONS.table,
|
|
597
|
+
active: inTable,
|
|
598
|
+
disabled: !isEditable,
|
|
599
|
+
label: t("editor.table"),
|
|
600
|
+
onClick: onTableClick
|
|
601
|
+
})
|
|
602
|
+
]
|
|
603
|
+
})] }), features.table && features.tableControls && inTable && /* @__PURE__ */ jsx(TableControls, {
|
|
479
604
|
editor,
|
|
480
605
|
disabled: !isEditable,
|
|
481
606
|
inTable,
|
|
@@ -485,56 +610,49 @@ function RichTextToolbar(t0) {
|
|
|
485
610
|
disabled: !isEditable,
|
|
486
611
|
title: t("editor.table")
|
|
487
612
|
})
|
|
488
|
-
})
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
$[
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
t18
|
|
510
|
-
] });
|
|
511
|
-
$[96] = t16;
|
|
512
|
-
$[97] = t17;
|
|
513
|
-
$[98] = t18;
|
|
514
|
-
$[99] = t19;
|
|
515
|
-
} else t19 = $[99];
|
|
516
|
-
let t20;
|
|
517
|
-
if ($[100] !== t1 || $[101] !== t14 || $[102] !== t15 || $[103] !== t19 || $[104] !== t2 || $[105] !== t9) {
|
|
518
|
-
t20 = /* @__PURE__ */ jsxs("div", {
|
|
519
|
-
className: "bg-muted flex flex-wrap items-center gap-1.5 border-b p-1.5",
|
|
613
|
+
})] });
|
|
614
|
+
$[56] = editor;
|
|
615
|
+
$[57] = features.image;
|
|
616
|
+
$[58] = features.link;
|
|
617
|
+
$[59] = features.table;
|
|
618
|
+
$[60] = features.tableControls;
|
|
619
|
+
$[61] = hasInsertMenu;
|
|
620
|
+
$[62] = inTable;
|
|
621
|
+
$[63] = isEditable;
|
|
622
|
+
$[64] = onImageClick;
|
|
623
|
+
$[65] = onLinkClick;
|
|
624
|
+
$[66] = onTableClick;
|
|
625
|
+
$[67] = t;
|
|
626
|
+
$[68] = t12;
|
|
627
|
+
} else t12 = $[68];
|
|
628
|
+
let t13;
|
|
629
|
+
if ($[69] !== t10 || $[70] !== t11 || $[71] !== t12 || $[72] !== t3 || $[73] !== t4 || $[74] !== t5 || $[75] !== t9) {
|
|
630
|
+
t13 = /* @__PURE__ */ jsxs("div", {
|
|
631
|
+
"aria-label": t3,
|
|
632
|
+
className: "qp-rich-text-editor__toolbar border-border-subtle bg-surface-low flex flex-nowrap items-center gap-1.5 overflow-x-auto border-b p-1.5",
|
|
633
|
+
role: "toolbar",
|
|
520
634
|
children: [
|
|
521
|
-
|
|
522
|
-
|
|
635
|
+
t4,
|
|
636
|
+
t5,
|
|
523
637
|
t9,
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
638
|
+
t10,
|
|
639
|
+
t11,
|
|
640
|
+
t12
|
|
527
641
|
]
|
|
528
642
|
});
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
$[
|
|
532
|
-
$[
|
|
533
|
-
$[
|
|
534
|
-
$[
|
|
535
|
-
$[
|
|
536
|
-
|
|
537
|
-
|
|
643
|
+
$[69] = t10;
|
|
644
|
+
$[70] = t11;
|
|
645
|
+
$[71] = t12;
|
|
646
|
+
$[72] = t3;
|
|
647
|
+
$[73] = t4;
|
|
648
|
+
$[74] = t5;
|
|
649
|
+
$[75] = t9;
|
|
650
|
+
$[76] = t13;
|
|
651
|
+
} else t13 = $[76];
|
|
652
|
+
return t13;
|
|
653
|
+
}
|
|
654
|
+
function _temp(option_2) {
|
|
655
|
+
return option_2.group === "heading";
|
|
538
656
|
}
|
|
539
657
|
|
|
540
658
|
//#endregion
|