wimui 0.51.2 → 0.52.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/_internal/FeedbackCloseButton.cjs +1 -1
- package/dist/components/_internal/FeedbackCloseButton.js +14 -13
- package/dist/components/_internal/FieldLabelContent.cjs +1 -1
- package/dist/components/_internal/FieldLabelContent.js +18 -17
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.js +46 -45
- package/dist/components/ai/AIResponseFeedback/airesponse-feedback.module.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/airesponse-feedback.module.js +1 -1
- package/dist/components/ai/AgentStatus/AgentStatus.cjs +1 -1
- package/dist/components/ai/AgentStatus/AgentStatus.js +24 -23
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.cjs +1 -1
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.js +47 -45
- package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +82 -81
- package/dist/components/ai/CodeBlock/CodeBlock.cjs +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.js +53 -52
- package/dist/components/ai/CodeBlock/code-block.module.cjs +1 -1
- package/dist/components/ai/CodeBlock/code-block.module.js +1 -1
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.cjs +2 -2
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.js +105 -104
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.cjs +1 -1
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.js +60 -59
- package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
- package/dist/components/ai/ModelSelector/ModelSelector.js +83 -82
- package/dist/components/ai/ModelSelector/model-selector.module.cjs +1 -1
- package/dist/components/ai/ModelSelector/model-selector.module.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.cjs +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +76 -75
- package/dist/components/ai/SourceCitation/SourceCitation.cjs +1 -1
- package/dist/components/ai/SourceCitation/SourceCitation.js +39 -38
- package/dist/components/ai/Terminal/Terminal.cjs +2 -2
- package/dist/components/ai/Terminal/Terminal.js +65 -64
- package/dist/components/ai/Terminal/terminal.module.cjs +1 -1
- package/dist/components/ai/Terminal/terminal.module.js +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.cjs +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.js +4 -4
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +58 -57
- package/dist/components/ai/ThreadList/thread-list.module.cjs +1 -1
- package/dist/components/ai/ThreadList/thread-list.module.js +1 -1
- package/dist/components/data-display/Accordion/accordion.module.cjs +1 -1
- package/dist/components/data-display/Accordion/accordion.module.js +1 -1
- package/dist/components/data-display/Barcode/Barcode.cjs +1 -1
- package/dist/components/data-display/Barcode/Barcode.js +76 -75
- package/dist/components/data-display/Calendar/Calendar.cjs +1 -1
- package/dist/components/data-display/Calendar/Calendar.js +75 -74
- package/dist/components/data-display/Calendar/calendar.module.cjs +1 -1
- package/dist/components/data-display/Calendar/calendar.module.js +1 -1
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.cjs +1 -1
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.js +54 -52
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.js +62 -61
- package/dist/components/data-display/Carousel/carousel.module.cjs +1 -1
- package/dist/components/data-display/Carousel/carousel.module.js +1 -1
- package/dist/components/data-display/Chip/Chip.cjs +1 -1
- package/dist/components/data-display/Chip/Chip.js +36 -35
- package/dist/components/data-display/Comment/Comment.cjs +1 -1
- package/dist/components/data-display/Comment/Comment.js +58 -57
- package/dist/components/data-display/Comment/comment.module.cjs +1 -1
- package/dist/components/data-display/Comment/comment.module.js +1 -1
- package/dist/components/data-display/Countdown/Countdown.cjs +1 -1
- package/dist/components/data-display/Countdown/Countdown.js +56 -55
- package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.js +128 -127
- package/dist/components/data-display/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/data-display/JsonViewer/JsonViewer.js +153 -152
- package/dist/components/data-display/JsonViewer/json-viewer.module.cjs +1 -1
- package/dist/components/data-display/JsonViewer/json-viewer.module.js +3 -3
- package/dist/components/data-display/Kanban/Kanban.cjs +1 -1
- package/dist/components/data-display/Kanban/Kanban.js +95 -94
- package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
- package/dist/components/data-display/NodeGraph/NodeGraph.js +62 -61
- package/dist/components/data-display/NodeGraph/node-graph.module.cjs +1 -1
- package/dist/components/data-display/NodeGraph/node-graph.module.js +1 -1
- package/dist/components/data-display/PivotTable/PivotTable.cjs +1 -1
- package/dist/components/data-display/PivotTable/PivotTable.js +153 -152
- package/dist/components/data-display/PivotTable/pivot-table.module.cjs +1 -1
- package/dist/components/data-display/PivotTable/pivot-table.module.js +1 -1
- package/dist/components/data-display/Presence/Presence.cjs +1 -1
- package/dist/components/data-display/Presence/Presence.js +28 -27
- package/dist/components/data-display/PullToRefresh/PullToRefresh.cjs +1 -1
- package/dist/components/data-display/PullToRefresh/PullToRefresh.js +73 -72
- package/dist/components/data-display/Reaction/Reaction.cjs +1 -1
- package/dist/components/data-display/Reaction/Reaction.js +31 -30
- package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
- package/dist/components/data-display/ScheduleView/ScheduleView.js +49 -48
- package/dist/components/data-display/SortableList/SortableList.cjs +1 -1
- package/dist/components/data-display/SortableList/SortableList.js +44 -43
- package/dist/components/data-display/Tag/Tag.cjs +1 -1
- package/dist/components/data-display/Tag/Tag.js +29 -28
- package/dist/components/data-display/Tag/tag.module.cjs +1 -1
- package/dist/components/data-display/Tag/tag.module.js +1 -1
- package/dist/components/data-display/TreeDiagram/TreeDiagram.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/TreeDiagram.js +85 -84
- package/dist/components/data-display/TreeDiagram/tree-diagram.module.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/tree-diagram.module.js +1 -1
- package/dist/components/data-display/TreeView/TreeView.cjs +1 -1
- package/dist/components/data-display/TreeView/TreeView.js +123 -122
- package/dist/components/feedback/Autosave/Autosave.cjs +1 -1
- package/dist/components/feedback/Autosave/Autosave.js +32 -31
- package/dist/components/feedback/Banner/banner.module.cjs +1 -1
- package/dist/components/feedback/Banner/banner.module.js +2 -2
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.cjs +1 -1
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.js +35 -34
- package/dist/components/feedback/Notification/notification.module.cjs +1 -1
- package/dist/components/feedback/Notification/notification.module.js +2 -2
- package/dist/components/feedback/ScrollProgress/ScrollProgress.cjs +1 -1
- package/dist/components/feedback/ScrollProgress/ScrollProgress.js +21 -20
- package/dist/components/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +98 -97
- package/dist/components/form/Button/Button.cjs +1 -1
- package/dist/components/form/Button/Button.js +55 -54
- package/dist/components/form/ColorInput/ColorInput.cjs +1 -1
- package/dist/components/form/ColorInput/ColorInput.js +30 -29
- package/dist/components/form/ColorPicker/color-picker.module.cjs +1 -1
- package/dist/components/form/ColorPicker/color-picker.module.js +1 -1
- package/dist/components/form/Combobox/combobox.module.cjs +1 -1
- package/dist/components/form/Combobox/combobox.module.js +1 -1
- package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
- package/dist/components/form/CopyButton/CopyButton.js +27 -26
- package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/form/DatePicker/DatePicker.js +47 -46
- package/dist/components/form/DatePicker/date-picker.module.cjs +1 -1
- package/dist/components/form/DatePicker/date-picker.module.js +1 -1
- package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/form/DateRangePicker/DateRangePicker.js +36 -35
- package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
- package/dist/components/form/Dropzone/Dropzone.js +56 -55
- package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/form/FileUpload/FileUpload.js +47 -46
- package/dist/components/form/FloatButton/FloatButton.cjs +1 -1
- package/dist/components/form/FloatButton/FloatButton.d.ts +4 -1
- package/dist/components/form/FloatButton/FloatButton.js +6 -6
- package/dist/components/form/ImageCropper/ImageCropper.cjs +1 -1
- package/dist/components/form/ImageCropper/ImageCropper.js +101 -99
- package/dist/components/form/InlineEdit/InlineEdit.cjs +1 -1
- package/dist/components/form/InlineEdit/InlineEdit.js +66 -65
- package/dist/components/form/InlineEdit/inline-edit.module.cjs +1 -1
- package/dist/components/form/InlineEdit/inline-edit.module.js +1 -1
- package/dist/components/form/Input/Input.cjs +1 -1
- package/dist/components/form/Input/Input.js +45 -44
- package/dist/components/form/InputBase/InputBase.cjs +1 -1
- package/dist/components/form/InputBase/InputBase.js +51 -50
- package/dist/components/form/InputBase/input-base.module.cjs +1 -1
- package/dist/components/form/InputBase/input-base.module.js +1 -1
- package/dist/components/form/Mentions/mentions.module.cjs +1 -1
- package/dist/components/form/Mentions/mentions.module.js +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.cjs +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.js +1 -1
- package/dist/components/form/PasswordStrength/PasswordStrength.cjs +1 -1
- package/dist/components/form/PasswordStrength/PasswordStrength.js +27 -26
- package/dist/components/form/PhoneInput/PhoneInput.cjs +1 -1
- package/dist/components/form/PhoneInput/PhoneInput.js +10 -10
- package/dist/components/form/PhoneInput/phone-input.module.cjs +1 -1
- package/dist/components/form/PhoneInput/phone-input.module.js +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.js +90 -89
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +30 -29
- package/dist/components/form/Rating/rating.module.cjs +1 -1
- package/dist/components/form/Rating/rating.module.js +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.cjs +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.js +223 -222
- package/dist/components/form/RichTextEditor/rich-text-editor.module.cjs +1 -1
- package/dist/components/form/RichTextEditor/rich-text-editor.module.js +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.js +7 -7
- package/dist/components/form/SegmentedControl/segmented-control.module.cjs +1 -1
- package/dist/components/form/SegmentedControl/segmented-control.module.js +1 -1
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +112 -111
- package/dist/components/form/Select/select.module.cjs +1 -1
- package/dist/components/form/Select/select.module.js +1 -1
- package/dist/components/form/SignaturePad/SignaturePad.cjs +1 -1
- package/dist/components/form/SignaturePad/SignaturePad.js +86 -79
- package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
- package/dist/components/form/SmartSearchInput/SmartSearchInput.js +63 -62
- package/dist/components/form/TagInput/TagInput.cjs +1 -1
- package/dist/components/form/TagInput/TagInput.js +68 -67
- package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.js +68 -67
- package/dist/components/form/ThemeToggle/theme-toggle.module.cjs +1 -1
- package/dist/components/form/ThemeToggle/theme-toggle.module.js +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.js +6 -6
- package/dist/components/form/ToggleGroup/toggle-group.module.cjs +1 -1
- package/dist/components/form/ToggleGroup/toggle-group.module.js +1 -1
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.js +127 -126
- package/dist/components/form/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/form/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.js +90 -89
- package/dist/components/layout/Navbar/Navbar.cjs +1 -1
- package/dist/components/layout/Navbar/Navbar.d.ts +1 -1
- package/dist/components/layout/Navbar/Navbar.js +1 -1
- package/dist/components/layout/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/layout/Splitter/Splitter.cjs +1 -1
- package/dist/components/layout/Splitter/Splitter.js +40 -39
- package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/layout/Toolbar/Toolbar.js +66 -39
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +90 -89
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +115 -114
- package/dist/components/media/Gallery/Gallery.cjs +1 -1
- package/dist/components/media/Gallery/Gallery.js +132 -131
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +72 -71
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.js +128 -127
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +56 -55
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +136 -135
- package/dist/components/media/Video/components/VideoControls.cjs +1 -1
- package/dist/components/media/Video/components/VideoControls.js +103 -102
- package/dist/components/navigation/BackTop/BackTop.cjs +1 -1
- package/dist/components/navigation/BackTop/BackTop.js +37 -36
- package/dist/components/navigation/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/navigation/Breadcrumb/Breadcrumb.js +41 -40
- package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.js +100 -99
- package/dist/components/navigation/CommandPalette/command-palette.module.cjs +1 -1
- package/dist/components/navigation/CommandPalette/command-palette.module.js +1 -1
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.d.ts +6 -0
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.js +32 -22
- package/dist/components/navigation/HamburgerMenu/hamburger-menu.module.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/hamburger-menu.module.js +1 -1
- package/dist/components/navigation/Menubar/menubar.module.cjs +1 -1
- package/dist/components/navigation/Menubar/menubar.module.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +39 -38
- package/dist/components/navigation/SpeedDial/SpeedDial.cjs +1 -1
- package/dist/components/navigation/SpeedDial/SpeedDial.js +50 -47
- package/dist/components/navigation/TabBar/tab-bar.module.cjs +1 -1
- package/dist/components/navigation/TabBar/tab-bar.module.js +1 -1
- package/dist/components/navigation/TabNavigation/tab-navigation.module.cjs +1 -1
- package/dist/components/navigation/TabNavigation/tab-navigation.module.js +1 -1
- package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
- package/dist/components/navigation/Tabs/tabs.module.js +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +63 -62
- package/dist/components/typography/Spoiler/Spoiler.cjs +1 -1
- package/dist/components/typography/Spoiler/Spoiler.js +38 -37
- package/dist/components/typography/Spoiler/spoiler.module.cjs +1 -1
- package/dist/components/typography/Spoiler/spoiler.module.js +1 -1
- package/dist/i18n/generated/common.cjs +2 -0
- package/dist/i18n/generated/common.d.ts +3 -0
- package/dist/i18n/generated/common.js +570 -0
- package/dist/i18n/generated/components.cjs +2 -0
- package/dist/i18n/generated/components.d.ts +3 -0
- package/dist/i18n/generated/components.js +399 -0
- package/dist/i18n/generated/data-display.cjs +2 -0
- package/dist/i18n/generated/data-display.d.ts +3 -0
- package/dist/i18n/generated/data-display.js +12 -0
- package/dist/i18n/generated/form.cjs +2 -0
- package/dist/i18n/generated/form.d.ts +3 -0
- package/dist/i18n/generated/form.js +321 -0
- package/dist/i18n/generated/keys.d.ts +5 -1
- package/dist/i18n/generated/locales.cjs +2 -0
- package/dist/i18n/generated/locales.d.ts +1 -0
- package/dist/i18n/generated/locales.js +9 -0
- package/dist/i18n/instance.cjs +1 -1
- package/dist/i18n/instance.d.ts +18 -3
- package/dist/i18n/instance.js +24 -26
- package/dist/i18n/useWimTranslation.cjs +1 -1
- package/dist/i18n/useWimTranslation.d.ts +7 -8
- package/dist/i18n/useWimTranslation.js +6 -5
- package/dist/llms-full.txt +7 -3
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +1 -1
- package/dist/locales/ja/common.json +1 -1
- package/dist/locales/pt/common.json +1 -1
- package/dist/styles.css +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +10 -10
- package/dist/i18n/generated/resources.cjs +0 -2
- package/dist/i18n/generated/resources.d.ts +0 -4
- package/dist/i18n/generated/resources.js +0 -1283
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import t from "../../../
|
|
4
|
-
import n from "../../../icon/
|
|
5
|
-
import r from "../../../icon/
|
|
6
|
-
import i from "../../../icon/
|
|
7
|
-
import a from "../../../icon/
|
|
8
|
-
import o from "../../../icon/
|
|
9
|
-
import ee from "../../../icon/list.js";
|
|
10
|
-
import te from "../../../icon/
|
|
11
|
-
import ne from "../../../icon/
|
|
12
|
-
import re from "../../../icon/
|
|
3
|
+
import { componentsNs as t } from "../../../i18n/generated/components.js";
|
|
4
|
+
import n from "../../../icon/bold.js";
|
|
5
|
+
import r from "../../../icon/eraser.js";
|
|
6
|
+
import i from "../../../icon/image.js";
|
|
7
|
+
import a from "../../../icon/italic.js";
|
|
8
|
+
import o from "../../../icon/link.js";
|
|
9
|
+
import ee from "../../../icon/list-ordered.js";
|
|
10
|
+
import te from "../../../icon/list.js";
|
|
11
|
+
import ne from "../../../icon/strikethrough.js";
|
|
12
|
+
import re from "../../../icon/underline.js";
|
|
13
|
+
import ie from "../../../icon/unlink.js";
|
|
13
14
|
import { Icon as s } from "../../media/Icon/Icon.js";
|
|
14
15
|
import { Button as c } from "../Button/Button.js";
|
|
15
|
-
import { FieldTemplate as
|
|
16
|
+
import { FieldTemplate as ae } from "../FieldTemplate/FieldTemplate.js";
|
|
16
17
|
import { Input as l } from "../Input/Input.js";
|
|
17
|
-
import { Dialog as
|
|
18
|
-
import { isSafeImageUrl as u, isSafeLinkUrl as
|
|
18
|
+
import { Dialog as oe, DialogClose as se, DialogContent as ce, DialogFooter as le, DialogHeader as ue, DialogTitle as de } from "../../overlay/Dialog/Dialog.js";
|
|
19
|
+
import { isSafeImageUrl as u, isSafeLinkUrl as fe } from "./safeUrl.js";
|
|
19
20
|
import { createMarkdownExtensions as d, markdownToHtml as f } from "./markdown.js";
|
|
20
21
|
import p from "./rich-text-editor.module.js";
|
|
21
22
|
import m from "react";
|
|
22
|
-
import
|
|
23
|
-
import { Fragment as
|
|
24
|
-
import { EditorContent as
|
|
25
|
-
import { createDocument as
|
|
23
|
+
import pe from "classnames";
|
|
24
|
+
import { Fragment as me, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
25
|
+
import { EditorContent as he, useEditor as ge, useEditorState as _e } from "@tiptap/react";
|
|
26
|
+
import { createDocument as ve } from "@tiptap/core";
|
|
26
27
|
import { StarterKit as _ } from "@tiptap/starter-kit";
|
|
27
28
|
import { Placeholder as v } from "@tiptap/extensions";
|
|
28
|
-
import { Image as
|
|
29
|
+
import { Image as ye } from "@tiptap/extension-image";
|
|
29
30
|
//#region src/components/form/RichTextEditor/RichTextEditor.tsx
|
|
30
|
-
var
|
|
31
|
+
var be = [
|
|
31
32
|
"bold",
|
|
32
33
|
"italic",
|
|
33
34
|
"underline",
|
|
@@ -44,12 +45,12 @@ var ye = [
|
|
|
44
45
|
"unlink",
|
|
45
46
|
"separator",
|
|
46
47
|
"removeFormat"
|
|
47
|
-
],
|
|
48
|
+
], xe = ye.extend({ parseHTML() {
|
|
48
49
|
return [{
|
|
49
50
|
tag: "img[src]",
|
|
50
51
|
getAttrs: (e) => u(e.getAttribute("src")) ? null : !1
|
|
51
52
|
}];
|
|
52
|
-
} }),
|
|
53
|
+
} }), Se = (e, t, n) => [
|
|
53
54
|
_.configure({
|
|
54
55
|
heading: { levels: [
|
|
55
56
|
1,
|
|
@@ -66,23 +67,23 @@ var ye = [
|
|
|
66
67
|
openOnClick: !1,
|
|
67
68
|
autolink: !1,
|
|
68
69
|
linkOnPaste: !1,
|
|
69
|
-
isAllowedUri: (e) =>
|
|
70
|
+
isAllowedUri: (e) => fe(e),
|
|
70
71
|
HTMLAttributes: {
|
|
71
72
|
target: null,
|
|
72
73
|
rel: null
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
}),
|
|
76
|
-
|
|
77
|
+
xe.configure({
|
|
77
78
|
inline: !1,
|
|
78
79
|
allowBase64: !1
|
|
79
80
|
}),
|
|
80
81
|
v.configure({ placeholder: e }),
|
|
81
82
|
...t === "markdown" ? d(n) : []
|
|
82
|
-
],
|
|
83
|
+
], Ce = (e, t) => e.isEmpty ? "" : t === "markdown" ? e.getMarkdown() : e.getHTML(), we = (e, t, n) => n === "markdown" ? f(e, t) : t, Te = m.memo(({ onClick: e, active: t, disabled: n, title: r, tabIndex: i, onFocus: a, buttonRef: o, children: ee }) => /* @__PURE__ */ h("button", {
|
|
83
84
|
ref: o,
|
|
84
85
|
type: "button",
|
|
85
|
-
className:
|
|
86
|
+
className: pe(p.toolbarBtn, t && p.active),
|
|
86
87
|
onClick: e,
|
|
87
88
|
onFocus: a,
|
|
88
89
|
disabled: n,
|
|
@@ -92,53 +93,53 @@ var ye = [
|
|
|
92
93
|
tabIndex: i,
|
|
93
94
|
children: ee
|
|
94
95
|
}));
|
|
95
|
-
|
|
96
|
-
var y = ({ value: d, defaultValue: f = "", onChange: _, placeholder: v, disabled:
|
|
97
|
-
let { t:
|
|
96
|
+
Te.displayName = "ToolbarButton";
|
|
97
|
+
var y = ({ value: d, defaultValue: f = "", onChange: _, placeholder: v, disabled: ye, intent: xe = "default", variant: y = "outline", fullWidth: Ee = !1, width: b, minHeight: x = 200, label: S, error: C, required: w, layout: De, className: Oe, id: ke, toolbar: T = be, labels: Ae = {}, "aria-label": je, "aria-labelledby": E, onImageUpload: D, format: Me = "html" }) => {
|
|
98
|
+
let { t: O } = e(t), { bold: Ne = O("a11y.rte_bold"), italic: Pe = O("a11y.rte_italic"), underline: Fe = O("a11y.rte_underline"), strikethrough: Ie = O("a11y.rte_strikethrough"), h1: Le = O("a11y.rte_h1"), h2: Re = O("a11y.rte_h2"), h3: ze = O("a11y.rte_h3"), ul: Be = O("a11y.rte_ul"), ol: Ve = O("a11y.rte_ol"), link: He = O("a11y.rte_link"), unlink: Ue = O("a11y.rte_unlink"), removeFormat: We = O("a11y.rte_remove_format"), toolbar: Ge = O("a11y.rte_toolbar"), linkPrompt: Ke = O("a11y.rte_link_prompt"), linkApply: qe = O("a11y.rte_link_apply"), linkCancel: Je = O("a11y.rte_link_cancel"), linkInvalid: Ye = O("a11y.rte_link_invalid"), image: Xe = O("a11y.rte_image"), imageUrl: Ze = O("a11y.rte_image_url"), imageAlt: Qe = O("a11y.rte_image_alt"), imageAltHint: $e = O("a11y.rte_image_alt_hint"), imageUpload: et = O("a11y.rte_image_upload"), imageUploadFailed: k = O("a11y.rte_image_upload_failed"), imageInvalid: tt = O("a11y.rte_image_invalid") } = Ae, nt = m.useId(), A = ke || `wim-rte-${nt}`, j = C ? `${A}-error` : void 0, M = S ? `${A}-label` : void 0, N = !!ye, P = C ? "danger" : xe, rt = typeof b == "string" && [
|
|
98
99
|
"xs",
|
|
99
100
|
"sm",
|
|
100
101
|
"md",
|
|
101
102
|
"lg",
|
|
102
103
|
"xl"
|
|
103
|
-
].includes(
|
|
104
|
+
].includes(b), it = b !== void 0 && !rt && !Ee, F = rt && !Ee ? b : void 0, at = F ? p[`width${F.charAt(0).toUpperCase()}${F.slice(1)}`] : void 0, I = m.useRef(d ?? f), ot = m.useRef(_);
|
|
104
105
|
m.useEffect(() => {
|
|
105
|
-
|
|
106
|
+
ot.current = _;
|
|
106
107
|
}, [_]);
|
|
107
|
-
let
|
|
108
|
+
let st = m.useMemo(() => {
|
|
108
109
|
let e = {
|
|
109
|
-
id:
|
|
110
|
+
id: A,
|
|
110
111
|
class: p.content,
|
|
111
112
|
role: "textbox",
|
|
112
113
|
"aria-multiline": "true",
|
|
113
|
-
style: `min-height: ${typeof
|
|
114
|
-
tabindex:
|
|
115
|
-
}, t =
|
|
116
|
-
return t && (e["aria-label"] = t), n && (e["aria-labelledby"] = n),
|
|
114
|
+
style: `min-height: ${typeof x == "number" ? `${x}px` : x}`,
|
|
115
|
+
tabindex: N ? "-1" : "0"
|
|
116
|
+
}, t = je ?? (S || E ? void 0 : O("a11y.rte_editor")), n = E ?? (S ? M : void 0);
|
|
117
|
+
return t && (e["aria-label"] = t), n && (e["aria-labelledby"] = n), P === "danger" && (e["aria-invalid"] = "true"), j && (e["aria-describedby"] = j), w && (e["aria-required"] = "true"), N && (e["aria-disabled"] = "true"), v && (e["aria-placeholder"] = v), e;
|
|
117
118
|
}, [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
P,
|
|
121
|
-
ke,
|
|
122
|
-
C,
|
|
123
|
-
D,
|
|
119
|
+
A,
|
|
120
|
+
x,
|
|
124
121
|
N,
|
|
125
|
-
|
|
122
|
+
je,
|
|
123
|
+
S,
|
|
124
|
+
E,
|
|
126
125
|
M,
|
|
127
|
-
|
|
126
|
+
P,
|
|
127
|
+
j,
|
|
128
|
+
w,
|
|
128
129
|
v,
|
|
129
|
-
|
|
130
|
-
]),
|
|
130
|
+
O
|
|
131
|
+
]), L = m.useRef(D);
|
|
131
132
|
m.useEffect(() => {
|
|
132
|
-
|
|
133
|
-
}, [
|
|
134
|
-
let [
|
|
133
|
+
L.current = D;
|
|
134
|
+
}, [D]);
|
|
135
|
+
let [ct, lt] = m.useState(void 0), ut = m.useRef(k);
|
|
135
136
|
m.useEffect(() => {
|
|
136
|
-
|
|
137
|
-
}, [
|
|
138
|
-
let
|
|
139
|
-
let r =
|
|
137
|
+
ut.current = k;
|
|
138
|
+
}, [k]);
|
|
139
|
+
let R = m.useCallback(async (e, t, n) => {
|
|
140
|
+
let r = L.current;
|
|
140
141
|
if (r) {
|
|
141
|
-
|
|
142
|
+
lt(void 0);
|
|
142
143
|
for (let i of t) try {
|
|
143
144
|
let t = await r(i);
|
|
144
145
|
if (!u(t)) throw Error("URL not allowed");
|
|
@@ -149,62 +150,62 @@ var y = ({ value: d, defaultValue: f = "", onChange: _, placeholder: v, disabled
|
|
|
149
150
|
alt: ""
|
|
150
151
|
}).run();
|
|
151
152
|
} catch {
|
|
152
|
-
|
|
153
|
+
lt(ut.current);
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
|
-
}, []),
|
|
156
|
-
let n =
|
|
157
|
-
return !
|
|
158
|
-
}, [
|
|
159
|
-
let i =
|
|
160
|
-
if (r || !
|
|
156
|
+
}, []), dt = (e) => Array.from(e ?? []).filter((e) => e.type.startsWith("image/")), z = m.useRef({ ed: null }), ft = m.useCallback((e, t) => {
|
|
157
|
+
let n = dt(t.clipboardData?.files), r = z.current.ed;
|
|
158
|
+
return !L.current || n.length === 0 || !r ? !1 : (t.preventDefault(), R(r, n), !0);
|
|
159
|
+
}, [R]), pt = m.useCallback((e, t, n, r) => {
|
|
160
|
+
let i = dt(t.dataTransfer?.files), a = z.current.ed;
|
|
161
|
+
if (r || !L.current || i.length === 0 || !a) return !1;
|
|
161
162
|
t.preventDefault();
|
|
162
163
|
let o = e.posAtCoords({
|
|
163
164
|
left: t.clientX,
|
|
164
165
|
top: t.clientY
|
|
165
166
|
});
|
|
166
|
-
return
|
|
167
|
-
}, [
|
|
168
|
-
attributes:
|
|
169
|
-
handlePaste:
|
|
170
|
-
handleDrop:
|
|
167
|
+
return R(a, i, o?.pos), !0;
|
|
168
|
+
}, [R]), B = m.useMemo(() => ({
|
|
169
|
+
attributes: st,
|
|
170
|
+
handlePaste: ft,
|
|
171
|
+
handleDrop: pt
|
|
171
172
|
}), [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
]), [
|
|
176
|
-
extensions:
|
|
177
|
-
content:
|
|
178
|
-
editable: !
|
|
173
|
+
st,
|
|
174
|
+
ft,
|
|
175
|
+
pt
|
|
176
|
+
]), [V] = m.useState(Me), mt = d ?? f, H = ge({
|
|
177
|
+
extensions: Se(v ?? "", V, V === "markdown" ? mt : void 0),
|
|
178
|
+
content: V === "markdown" ? "" : mt,
|
|
179
|
+
editable: !N,
|
|
179
180
|
immediatelyRender: !1,
|
|
180
|
-
editorProps:
|
|
181
|
+
editorProps: B,
|
|
181
182
|
onUpdate: ({ editor: e }) => {
|
|
182
|
-
let t =
|
|
183
|
-
t !==
|
|
183
|
+
let t = Ce(e, V);
|
|
184
|
+
t !== I.current && (I.current = t, ot.current?.(t));
|
|
184
185
|
}
|
|
185
186
|
});
|
|
186
187
|
m.useEffect(() => {
|
|
187
|
-
|
|
188
|
-
}, [
|
|
189
|
-
|
|
190
|
-
}, [
|
|
191
|
-
|
|
192
|
-
}, [
|
|
193
|
-
if (!
|
|
194
|
-
let e =
|
|
195
|
-
e && e.options.placeholder !== (v ?? "") && (e.options.placeholder = v ?? "",
|
|
196
|
-
}, [
|
|
197
|
-
if (!
|
|
198
|
-
|
|
199
|
-
let e =
|
|
200
|
-
e.eq(
|
|
188
|
+
H && !H.isDestroyed && H.setOptions({ editorProps: B });
|
|
189
|
+
}, [H, B]), m.useEffect(() => {
|
|
190
|
+
z.current.ed = H;
|
|
191
|
+
}, [H]), m.useEffect(() => {
|
|
192
|
+
H && !H.isDestroyed && H.setEditable(!N, !1);
|
|
193
|
+
}, [H, N]), m.useEffect(() => {
|
|
194
|
+
if (!H || H.isDestroyed) return;
|
|
195
|
+
let e = H.extensionManager.extensions.find((e) => e.name === "placeholder");
|
|
196
|
+
e && e.options.placeholder !== (v ?? "") && (e.options.placeholder = v ?? "", H.view.dispatch(H.state.tr));
|
|
197
|
+
}, [H, v]), m.useEffect(() => {
|
|
198
|
+
if (!H || H.isDestroyed || d === void 0 || d === I.current || d === Ce(H, V)) return;
|
|
199
|
+
I.current = d;
|
|
200
|
+
let e = ve(we(H, d, V), H.schema);
|
|
201
|
+
e.eq(H.state.doc) || H.commands.setContent(e.toJSON(), { emitUpdate: !1 });
|
|
201
202
|
}, [
|
|
202
|
-
|
|
203
|
+
H,
|
|
203
204
|
d,
|
|
204
|
-
|
|
205
|
+
V
|
|
205
206
|
]);
|
|
206
|
-
let
|
|
207
|
-
editor:
|
|
207
|
+
let ht = _e({
|
|
208
|
+
editor: H,
|
|
208
209
|
selector: ({ editor: e }) => ({
|
|
209
210
|
bold: !!e?.isActive("bold"),
|
|
210
211
|
italic: !!e?.isActive("italic"),
|
|
@@ -217,31 +218,31 @@ var y = ({ value: d, defaultValue: f = "", onChange: _, placeholder: v, disabled
|
|
|
217
218
|
ol: !!e?.isActive("orderedList"),
|
|
218
219
|
image: !!e?.isActive("image")
|
|
219
220
|
})
|
|
220
|
-
}),
|
|
221
|
-
!
|
|
222
|
-
}, [
|
|
223
|
-
|
|
221
|
+
}), U = m.useCallback((e) => {
|
|
222
|
+
!N && H && e(H);
|
|
223
|
+
}, [H, N]), gt = m.useCallback(() => {
|
|
224
|
+
U((e) => {
|
|
224
225
|
let { from: t, to: n, empty: r } = e.state.selection, i = e.chain().focus();
|
|
225
226
|
r && i.selectAll(), i.unsetBold().unsetItalic().unsetStrike().clearNodes(), e.schema.marks.underline && i.unsetUnderline(), r && i.setTextSelection({
|
|
226
227
|
from: t,
|
|
227
228
|
to: n
|
|
228
229
|
}), i.run();
|
|
229
230
|
});
|
|
230
|
-
}, [
|
|
231
|
-
if (
|
|
232
|
-
let { from: e, to: t } =
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
let e =
|
|
231
|
+
}, [U]), [_t, W] = m.useState(!1), [G, vt] = m.useState("https://"), [yt, K] = m.useState(void 0), bt = m.useCallback(() => {
|
|
232
|
+
if (N || !H) return;
|
|
233
|
+
let { from: e, to: t } = H.state.selection, n = H.state.doc.textBetween(e, t, " "), r = H.getAttributes("link").href;
|
|
234
|
+
vt(r ?? (n.startsWith("http") ? n : "https://")), K(void 0), W(!0);
|
|
235
|
+
}, [H, N]), xt = m.useCallback(() => {
|
|
236
|
+
let e = G.trim();
|
|
236
237
|
if (!e) {
|
|
237
|
-
|
|
238
|
+
W(!1);
|
|
238
239
|
return;
|
|
239
240
|
}
|
|
240
|
-
if (!
|
|
241
|
-
|
|
241
|
+
if (!fe(e)) {
|
|
242
|
+
K(Ye);
|
|
242
243
|
return;
|
|
243
244
|
}
|
|
244
|
-
|
|
245
|
+
W(!1), U((t) => {
|
|
245
246
|
t.state.selection.empty && !t.isActive("link") ? t.chain().focus().insertContent({
|
|
246
247
|
type: "text",
|
|
247
248
|
text: e,
|
|
@@ -252,194 +253,194 @@ var y = ({ value: d, defaultValue: f = "", onChange: _, placeholder: v, disabled
|
|
|
252
253
|
}).run() : t.chain().focus().extendMarkRange("link").setLink({ href: e }).run();
|
|
253
254
|
});
|
|
254
255
|
}, [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
]), [
|
|
259
|
-
if (
|
|
260
|
-
let e =
|
|
261
|
-
|
|
262
|
-
}, [
|
|
263
|
-
let e =
|
|
256
|
+
G,
|
|
257
|
+
Ye,
|
|
258
|
+
U
|
|
259
|
+
]), [St, q] = m.useState(!1), [J, Y] = m.useState(""), [X, Ct] = m.useState(""), [wt, Z] = m.useState(void 0), [Tt, Et] = m.useState(!1), Dt = m.useRef(null), Ot = `${A}-image-alt-hint`, kt = m.useCallback(() => {
|
|
260
|
+
if (N || !H) return;
|
|
261
|
+
let e = H.isActive("image") ? H.getAttributes("image") : {};
|
|
262
|
+
Y(e.src ?? ""), Ct(e.alt ?? ""), Z(void 0), q(!0);
|
|
263
|
+
}, [H, N]), At = m.useCallback(() => {
|
|
264
|
+
let e = J.trim();
|
|
264
265
|
if (!e) {
|
|
265
|
-
|
|
266
|
+
q(!1);
|
|
266
267
|
return;
|
|
267
268
|
}
|
|
268
269
|
if (!u(e)) {
|
|
269
|
-
|
|
270
|
+
Z(tt);
|
|
270
271
|
return;
|
|
271
272
|
}
|
|
272
|
-
|
|
273
|
+
q(!1), U((t) => t.chain().focus().setImage({
|
|
273
274
|
src: e,
|
|
274
|
-
alt:
|
|
275
|
+
alt: X.trim()
|
|
275
276
|
}).run());
|
|
276
277
|
}, [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
J,
|
|
279
|
+
X,
|
|
280
|
+
tt,
|
|
281
|
+
U
|
|
281
282
|
]), jt = m.useCallback(async (e) => {
|
|
282
283
|
let t = e.target.files?.[0];
|
|
283
|
-
if (e.target.value = "", t &&
|
|
284
|
-
Et(!0),
|
|
284
|
+
if (e.target.value = "", t && D) {
|
|
285
|
+
Et(!0), Z(void 0);
|
|
285
286
|
try {
|
|
286
|
-
let e = await
|
|
287
|
+
let e = await D(t);
|
|
287
288
|
if (!u(e)) throw Error("URL not allowed");
|
|
288
|
-
|
|
289
|
+
Y(e);
|
|
289
290
|
} catch {
|
|
290
|
-
|
|
291
|
+
Z(k);
|
|
291
292
|
} finally {
|
|
292
293
|
Et(!1);
|
|
293
294
|
}
|
|
294
295
|
}
|
|
295
|
-
}, [
|
|
296
|
-
let e =
|
|
296
|
+
}, [D, k]), Mt = m.useRef([]), [Q, Nt] = m.useState(0), $ = m.useMemo(() => {
|
|
297
|
+
let e = V === "markdown" ? T.filter((e) => e !== "underline") : T;
|
|
297
298
|
return e.filter((t, n) => t !== "separator" || n > 0 && n < e.length - 1 && e[n - 1] !== "separator");
|
|
298
|
-
}, [
|
|
299
|
-
let t =
|
|
299
|
+
}, [T, V]), Pt = m.useMemo(() => $.filter((e) => e !== "separator"), [$]), Ft = m.useMemo(() => $.map((e, t) => e === "separator" ? -1 : $.slice(0, t).filter((e) => e !== "separator").length), [$]), It = m.useCallback((e) => {
|
|
300
|
+
let t = Pt.length;
|
|
300
301
|
if (t === 0) return;
|
|
301
302
|
let n;
|
|
302
|
-
e.key === "ArrowRight" ? n = (
|
|
303
|
-
}, [
|
|
303
|
+
e.key === "ArrowRight" ? n = (Q + 1) % t : e.key === "ArrowLeft" ? n = (Q - 1 + t) % t : e.key === "Home" ? n = 0 : e.key === "End" && (n = t - 1), n !== void 0 && (e.preventDefault(), Nt(n), Mt.current[n]?.focus());
|
|
304
|
+
}, [Pt.length, Q]), Lt = m.useCallback((e) => {
|
|
304
305
|
e.preventDefault();
|
|
305
|
-
}, []),
|
|
306
|
+
}, []), Rt = {
|
|
306
307
|
bold: {
|
|
307
|
-
title:
|
|
308
|
+
title: Ne,
|
|
308
309
|
icon: /* @__PURE__ */ h(s, {
|
|
309
|
-
component:
|
|
310
|
+
component: n,
|
|
310
311
|
size: "sm"
|
|
311
312
|
}),
|
|
312
|
-
onClick: () =>
|
|
313
|
+
onClick: () => U((e) => e.chain().focus().toggleBold().run())
|
|
313
314
|
},
|
|
314
315
|
italic: {
|
|
315
|
-
title:
|
|
316
|
+
title: Pe,
|
|
316
317
|
icon: /* @__PURE__ */ h(s, {
|
|
317
|
-
component:
|
|
318
|
+
component: a,
|
|
318
319
|
size: "sm"
|
|
319
320
|
}),
|
|
320
|
-
onClick: () =>
|
|
321
|
+
onClick: () => U((e) => e.chain().focus().toggleItalic().run())
|
|
321
322
|
},
|
|
322
323
|
underline: {
|
|
323
|
-
title:
|
|
324
|
+
title: Fe,
|
|
324
325
|
icon: /* @__PURE__ */ h(s, {
|
|
325
|
-
component:
|
|
326
|
+
component: re,
|
|
326
327
|
size: "sm"
|
|
327
328
|
}),
|
|
328
|
-
onClick: () =>
|
|
329
|
+
onClick: () => U((e) => e.chain().focus().toggleUnderline().run())
|
|
329
330
|
},
|
|
330
331
|
strikethrough: {
|
|
331
|
-
title:
|
|
332
|
+
title: Ie,
|
|
332
333
|
icon: /* @__PURE__ */ h(s, {
|
|
333
|
-
component:
|
|
334
|
+
component: ne,
|
|
334
335
|
size: "sm"
|
|
335
336
|
}),
|
|
336
|
-
onClick: () =>
|
|
337
|
+
onClick: () => U((e) => e.chain().focus().toggleStrike().run())
|
|
337
338
|
},
|
|
338
339
|
h1: {
|
|
339
|
-
title:
|
|
340
|
+
title: Le,
|
|
340
341
|
icon: /* @__PURE__ */ h("span", {
|
|
341
342
|
"aria-hidden": "true",
|
|
342
343
|
children: "H1"
|
|
343
344
|
}),
|
|
344
|
-
onClick: () =>
|
|
345
|
+
onClick: () => U((e) => e.chain().focus().toggleHeading({ level: 1 }).run())
|
|
345
346
|
},
|
|
346
347
|
h2: {
|
|
347
|
-
title:
|
|
348
|
+
title: Re,
|
|
348
349
|
icon: /* @__PURE__ */ h("span", {
|
|
349
350
|
"aria-hidden": "true",
|
|
350
351
|
children: "H2"
|
|
351
352
|
}),
|
|
352
|
-
onClick: () =>
|
|
353
|
+
onClick: () => U((e) => e.chain().focus().toggleHeading({ level: 2 }).run())
|
|
353
354
|
},
|
|
354
355
|
h3: {
|
|
355
|
-
title:
|
|
356
|
+
title: ze,
|
|
356
357
|
icon: /* @__PURE__ */ h("span", {
|
|
357
358
|
"aria-hidden": "true",
|
|
358
359
|
children: "H3"
|
|
359
360
|
}),
|
|
360
|
-
onClick: () =>
|
|
361
|
+
onClick: () => U((e) => e.chain().focus().toggleHeading({ level: 3 }).run())
|
|
361
362
|
},
|
|
362
363
|
ul: {
|
|
363
|
-
title:
|
|
364
|
+
title: Be,
|
|
364
365
|
icon: /* @__PURE__ */ h(s, {
|
|
365
|
-
component:
|
|
366
|
+
component: te,
|
|
366
367
|
size: "sm"
|
|
367
368
|
}),
|
|
368
|
-
onClick: () =>
|
|
369
|
+
onClick: () => U((e) => e.chain().focus().toggleBulletList().run())
|
|
369
370
|
},
|
|
370
371
|
ol: {
|
|
371
|
-
title:
|
|
372
|
+
title: Ve,
|
|
372
373
|
icon: /* @__PURE__ */ h(s, {
|
|
373
|
-
component:
|
|
374
|
+
component: ee,
|
|
374
375
|
size: "sm"
|
|
375
376
|
}),
|
|
376
|
-
onClick: () =>
|
|
377
|
+
onClick: () => U((e) => e.chain().focus().toggleOrderedList().run())
|
|
377
378
|
},
|
|
378
379
|
link: {
|
|
379
|
-
title:
|
|
380
|
+
title: He,
|
|
380
381
|
icon: /* @__PURE__ */ h(s, {
|
|
381
|
-
component:
|
|
382
|
+
component: o,
|
|
382
383
|
size: "sm"
|
|
383
384
|
}),
|
|
384
|
-
onClick:
|
|
385
|
+
onClick: bt
|
|
385
386
|
},
|
|
386
387
|
unlink: {
|
|
387
|
-
title:
|
|
388
|
+
title: Ue,
|
|
388
389
|
icon: /* @__PURE__ */ h(s, {
|
|
389
|
-
component:
|
|
390
|
+
component: ie,
|
|
390
391
|
size: "sm"
|
|
391
392
|
}),
|
|
392
|
-
onClick: () =>
|
|
393
|
+
onClick: () => U((e) => e.chain().focus().extendMarkRange("link").unsetLink().run())
|
|
393
394
|
},
|
|
394
395
|
image: {
|
|
395
|
-
title:
|
|
396
|
+
title: Xe,
|
|
396
397
|
icon: /* @__PURE__ */ h(s, {
|
|
397
|
-
component:
|
|
398
|
+
component: i,
|
|
398
399
|
size: "sm"
|
|
399
400
|
}),
|
|
400
401
|
onClick: kt
|
|
401
402
|
},
|
|
402
403
|
removeFormat: {
|
|
403
|
-
title:
|
|
404
|
+
title: We,
|
|
404
405
|
icon: /* @__PURE__ */ h(s, {
|
|
405
|
-
component:
|
|
406
|
+
component: r,
|
|
406
407
|
size: "sm"
|
|
407
408
|
}),
|
|
408
|
-
onClick:
|
|
409
|
+
onClick: gt
|
|
409
410
|
}
|
|
410
411
|
};
|
|
411
|
-
return /* @__PURE__ */ h(
|
|
412
|
-
label:
|
|
413
|
-
error:
|
|
414
|
-
required:
|
|
415
|
-
layout:
|
|
416
|
-
labelId:
|
|
417
|
-
errorId:
|
|
418
|
-
className:
|
|
412
|
+
return /* @__PURE__ */ h(ae, {
|
|
413
|
+
label: S,
|
|
414
|
+
error: C,
|
|
415
|
+
required: w,
|
|
416
|
+
layout: De,
|
|
417
|
+
labelId: M,
|
|
418
|
+
errorId: j,
|
|
419
|
+
className: Oe,
|
|
419
420
|
children: /* @__PURE__ */ g("div", {
|
|
420
|
-
className:
|
|
421
|
-
style:
|
|
421
|
+
className: pe("wim-rich-text-editor", p.root, p[P], N && p.disabled, p[y], Ee && p.fullWidth, it && p.hasCustomWidth, at),
|
|
422
|
+
style: it ? { "--wim-input-width": typeof b == "number" ? `${b}px` : b } : void 0,
|
|
422
423
|
children: [
|
|
423
424
|
/* @__PURE__ */ h("div", {
|
|
424
425
|
className: p.toolbar,
|
|
425
426
|
role: "toolbar",
|
|
426
|
-
"aria-label":
|
|
427
|
-
"aria-controls":
|
|
428
|
-
onMouseDown:
|
|
429
|
-
onKeyDown:
|
|
430
|
-
children:
|
|
427
|
+
"aria-label": Ge,
|
|
428
|
+
"aria-controls": A,
|
|
429
|
+
onMouseDown: Lt,
|
|
430
|
+
onKeyDown: It,
|
|
431
|
+
children: $.map((e, t) => {
|
|
431
432
|
if (e === "separator") return /* @__PURE__ */ h("span", {
|
|
432
433
|
className: p.toolbarSep,
|
|
433
434
|
"aria-hidden": "true"
|
|
434
435
|
}, `sep-${t}`);
|
|
435
|
-
let n =
|
|
436
|
-
return /* @__PURE__ */ h(
|
|
436
|
+
let n = Ft[t], r = Rt[e], i = e === "link" || e === "unlink" || e === "removeFormat" ? void 0 : ht?.[e] ?? !1;
|
|
437
|
+
return /* @__PURE__ */ h(Te, {
|
|
437
438
|
buttonRef: (e) => {
|
|
438
439
|
Mt.current[n] = e;
|
|
439
440
|
},
|
|
440
|
-
tabIndex: n === Math.min(
|
|
441
|
+
tabIndex: n === Math.min(Q, Pt.length - 1) ? 0 : -1,
|
|
441
442
|
onFocus: () => Nt(n),
|
|
442
|
-
disabled:
|
|
443
|
+
disabled: N,
|
|
443
444
|
active: i,
|
|
444
445
|
title: r.title,
|
|
445
446
|
onClick: r.onClick,
|
|
@@ -447,65 +448,65 @@ var y = ({ value: d, defaultValue: f = "", onChange: _, placeholder: v, disabled
|
|
|
447
448
|
}, `${e}-${t}`);
|
|
448
449
|
})
|
|
449
450
|
}),
|
|
450
|
-
/* @__PURE__ */ h(
|
|
451
|
-
editor:
|
|
451
|
+
/* @__PURE__ */ h(he, {
|
|
452
|
+
editor: H,
|
|
452
453
|
className: p.contentHost
|
|
453
454
|
}),
|
|
454
|
-
|
|
455
|
+
ct && /* @__PURE__ */ h("p", {
|
|
455
456
|
role: "alert",
|
|
456
457
|
className: p.uploadError,
|
|
457
|
-
children:
|
|
458
|
+
children: ct
|
|
458
459
|
}),
|
|
459
|
-
/* @__PURE__ */ h(
|
|
460
|
-
open:
|
|
461
|
-
onOpenChange:
|
|
462
|
-
children: /* @__PURE__ */ g(
|
|
460
|
+
/* @__PURE__ */ h(oe, {
|
|
461
|
+
open: _t,
|
|
462
|
+
onOpenChange: W,
|
|
463
|
+
children: /* @__PURE__ */ g(ce, { children: [/* @__PURE__ */ h(ue, { children: /* @__PURE__ */ h(de, { children: He }) }), /* @__PURE__ */ g("form", {
|
|
463
464
|
onSubmit: (e) => {
|
|
464
|
-
e.preventDefault(),
|
|
465
|
+
e.preventDefault(), xt();
|
|
465
466
|
},
|
|
466
467
|
children: [/* @__PURE__ */ h(l, {
|
|
467
|
-
label:
|
|
468
|
+
label: Ke,
|
|
468
469
|
type: "url",
|
|
469
|
-
value:
|
|
470
|
-
error:
|
|
470
|
+
value: G,
|
|
471
|
+
error: yt,
|
|
471
472
|
onChange: (e) => {
|
|
472
|
-
|
|
473
|
+
vt(e.target.value), K(void 0);
|
|
473
474
|
},
|
|
474
475
|
fullWidth: !0
|
|
475
|
-
}), /* @__PURE__ */ g(
|
|
476
|
+
}), /* @__PURE__ */ g(le, { children: [/* @__PURE__ */ h(se, {
|
|
476
477
|
asChild: !0,
|
|
477
478
|
children: /* @__PURE__ */ h(c, {
|
|
478
479
|
variant: "ghost",
|
|
479
480
|
type: "button",
|
|
480
|
-
children:
|
|
481
|
+
children: Je
|
|
481
482
|
})
|
|
482
483
|
}), /* @__PURE__ */ h(c, {
|
|
483
484
|
variant: "solid",
|
|
484
485
|
type: "submit",
|
|
485
|
-
children:
|
|
486
|
+
children: qe
|
|
486
487
|
})] })]
|
|
487
488
|
})] })
|
|
488
489
|
}),
|
|
489
|
-
/* @__PURE__ */ h(
|
|
490
|
-
open:
|
|
491
|
-
onOpenChange:
|
|
492
|
-
children: /* @__PURE__ */ g(
|
|
490
|
+
/* @__PURE__ */ h(oe, {
|
|
491
|
+
open: St,
|
|
492
|
+
onOpenChange: q,
|
|
493
|
+
children: /* @__PURE__ */ g(ce, { children: [/* @__PURE__ */ h(ue, { children: /* @__PURE__ */ h(de, { children: Xe }) }), /* @__PURE__ */ g("form", {
|
|
493
494
|
className: p.imageForm,
|
|
494
495
|
onSubmit: (e) => {
|
|
495
496
|
e.preventDefault(), At();
|
|
496
497
|
},
|
|
497
498
|
children: [
|
|
498
499
|
/* @__PURE__ */ h(l, {
|
|
499
|
-
label:
|
|
500
|
+
label: Ze,
|
|
500
501
|
type: "url",
|
|
501
|
-
value:
|
|
502
|
+
value: J,
|
|
502
503
|
error: wt,
|
|
503
504
|
onChange: (e) => {
|
|
504
|
-
|
|
505
|
+
Y(e.target.value), Z(void 0);
|
|
505
506
|
},
|
|
506
507
|
fullWidth: !0
|
|
507
508
|
}),
|
|
508
|
-
|
|
509
|
+
D && /* @__PURE__ */ g(me, { children: [/* @__PURE__ */ h("input", {
|
|
509
510
|
ref: Dt,
|
|
510
511
|
type: "file",
|
|
511
512
|
accept: "image/*",
|
|
@@ -516,31 +517,31 @@ var y = ({ value: d, defaultValue: f = "", onChange: _, placeholder: v, disabled
|
|
|
516
517
|
variant: "outline",
|
|
517
518
|
loading: Tt,
|
|
518
519
|
onClick: () => Dt.current?.click(),
|
|
519
|
-
children:
|
|
520
|
+
children: et
|
|
520
521
|
})] }),
|
|
521
522
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(l, {
|
|
522
|
-
label:
|
|
523
|
+
label: Qe,
|
|
523
524
|
"aria-describedby": Ot,
|
|
524
|
-
value:
|
|
525
|
+
value: X,
|
|
525
526
|
onChange: (e) => Ct(e.target.value),
|
|
526
527
|
fullWidth: !0
|
|
527
528
|
}), /* @__PURE__ */ h("p", {
|
|
528
529
|
id: Ot,
|
|
529
530
|
className: p.imageHint,
|
|
530
|
-
children:
|
|
531
|
+
children: $e
|
|
531
532
|
})] }),
|
|
532
|
-
/* @__PURE__ */ g(
|
|
533
|
+
/* @__PURE__ */ g(le, { children: [/* @__PURE__ */ h(se, {
|
|
533
534
|
asChild: !0,
|
|
534
535
|
children: /* @__PURE__ */ h(c, {
|
|
535
536
|
variant: "ghost",
|
|
536
537
|
type: "button",
|
|
537
|
-
children:
|
|
538
|
+
children: Je
|
|
538
539
|
})
|
|
539
540
|
}), /* @__PURE__ */ h(c, {
|
|
540
541
|
variant: "solid",
|
|
541
542
|
type: "submit",
|
|
542
543
|
disabled: Tt,
|
|
543
|
-
children:
|
|
544
|
+
children: qe
|
|
544
545
|
})] })
|
|
545
546
|
]
|
|
546
547
|
})] })
|