@uzum-tech/ui 2.3.7 → 2.4.0
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/index.js +63601 -32546
- package/dist/index.mjs +64856 -33810
- package/dist/index.prod.js +3 -3
- package/dist/index.prod.mjs +3 -3
- package/es/_internal/icons/Bold.d.ts +2 -0
- package/es/_internal/icons/Bold.mjs +29 -0
- package/es/_internal/icons/BulletList.d.ts +2 -0
- package/es/_internal/icons/BulletList.mjs +23 -0
- package/es/_internal/icons/HorizontalRule.d.ts +2 -0
- package/es/_internal/icons/HorizontalRule.mjs +14 -0
- package/es/_internal/icons/Italic.d.ts +2 -0
- package/es/_internal/icons/Italic.mjs +19 -0
- package/es/_internal/icons/NumberedList.d.ts +2 -0
- package/es/_internal/icons/NumberedList.mjs +23 -0
- package/es/_internal/icons/Quote.d.ts +2 -0
- package/es/_internal/icons/Quote.mjs +23 -0
- package/es/_internal/icons/SettingsLine.d.ts +2 -0
- package/es/_internal/icons/SettingsLine.mjs +19 -0
- package/es/_internal/icons/Strikethrough.d.ts +2 -0
- package/es/_internal/icons/Strikethrough.mjs +14 -0
- package/es/_internal/icons/index.d.ts +8 -0
- package/es/_internal/icons/index.mjs +8 -0
- package/es/_styles/markdown/markdown-content.cssr.d.ts +6 -0
- package/es/_styles/markdown/markdown-content.cssr.mjs +22 -0
- package/es/_utils/markdown/index.d.ts +3 -2
- package/es/_utils/markdown/index.mjs +2 -1
- package/es/_utils/markdown/render-markdown.d.ts +2 -1
- package/es/_utils/markdown/render-markdown.mjs +1 -1
- package/es/chat/src/Chat.d.ts +261 -24
- package/es/chat/src/Chat.mjs +2 -0
- package/es/chat/src/ChatMainArea.d.ts +81 -8
- package/es/chat/src/ChatMainArea.mjs +111 -355
- package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +9084 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.mjs +71 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/interface.d.ts +2645 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/interface.mjs +19 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.d.ts +9070 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.mjs +78 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/interface.d.ts +2637 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/interface.mjs +15 -0
- package/es/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.d.ts +89 -0
- package/es/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.mjs +63 -0
- package/es/chat/src/ChatParts/ChatEditorInput/interface.d.ts +42 -0
- package/es/chat/src/ChatParts/ChatEditorInput/interface.mjs +34 -0
- package/es/chat/src/ChatParts/ChatFooter/ChatFooter.d.ts +115 -0
- package/es/chat/src/ChatParts/ChatFooter/ChatFooter.mjs +99 -0
- package/es/chat/src/ChatParts/ChatFooter/interface.d.ts +56 -0
- package/es/chat/src/ChatParts/ChatFooter/interface.mjs +46 -0
- package/es/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +9205 -0
- package/es/chat/src/ChatParts/ChatHeader/ChatHeader.mjs +219 -0
- package/es/chat/src/ChatParts/ChatHeader/interface.d.ts +2694 -0
- package/es/chat/src/ChatParts/ChatHeader/interface.mjs +67 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.d.ts +9142 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.mjs +129 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/interface.d.ts +2654 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/interface.mjs +27 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.d.ts +148 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.mjs +92 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/interface.d.ts +72 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/interface.mjs +58 -0
- package/es/chat/src/interface.d.ts +7 -0
- package/es/chat/src/interface.mjs +4 -0
- package/es/chat/styles/light.d.ts +4 -0
- package/es/chat/styles/light.mjs +18 -0
- package/es/components.d.ts +12933 -32
- package/es/components.mjs +186 -180
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/index.d.ts +1 -1
- package/es/data-table/src/ColumnSettings/ColumnSettingsDrawer.d.ts +156 -0
- package/es/data-table/src/ColumnSettings/ColumnSettingsDrawer.mjs +220 -0
- package/es/data-table/src/ColumnSettings/styles.cssr.d.ts +2 -0
- package/es/data-table/src/ColumnSettings/styles.cssr.mjs +25 -0
- package/es/data-table/src/DataTable.d.ts +60 -2
- package/es/data-table/src/DataTable.mjs +99 -23
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/es/data-table/src/interface.d.ts +53 -1
- package/es/data-table/src/interface.mjs +18 -1
- package/es/data-table/src/styles/index.cssr.mjs +17 -1
- package/es/data-table/src/use-column-settings.d.ts +2 -0
- package/es/data-table/src/use-column-settings.mjs +124 -0
- package/es/data-table/src/utils/column-utils.d.ts +2 -1
- package/es/data-table/src/utils/column-utils.mjs +6 -0
- package/es/editor/index.d.ts +10 -0
- package/es/editor/index.mjs +5 -0
- package/es/editor/src/Editor.d.ts +3896 -0
- package/es/editor/src/Editor.mjs +220 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.d.ts +37 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.mjs +63 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/interface.d.ts +21 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/interface.mjs +14 -0
- package/es/editor/src/EditorParts/EditorContent/EditorContent.d.ts +4078 -0
- package/es/editor/src/EditorParts/EditorContent/EditorContent.mjs +154 -0
- package/es/editor/src/EditorParts/EditorContent/index.d.ts +2 -0
- package/es/editor/src/EditorParts/EditorContent/index.mjs +2 -0
- package/es/editor/src/EditorParts/EditorContent/interface.d.ts +1906 -0
- package/es/editor/src/EditorParts/EditorContent/interface.mjs +17 -0
- package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +4582 -0
- package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.mjs +170 -0
- package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.d.ts +11 -0
- package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.mjs +54 -0
- package/es/editor/src/EditorParts/EditorToolbar/index.d.ts +2 -0
- package/es/editor/src/EditorParts/EditorToolbar/index.mjs +2 -0
- package/es/editor/src/EditorParts/EditorToolbar/interface.d.ts +1912 -0
- package/es/editor/src/EditorParts/EditorToolbar/interface.mjs +18 -0
- package/es/editor/src/EditorParts/SendButton/SendButton.d.ts +23 -0
- package/es/editor/src/EditorParts/SendButton/SendButton.mjs +42 -0
- package/es/editor/src/EditorParts/SendButton/interface.d.ts +18 -0
- package/es/editor/src/EditorParts/SendButton/interface.mjs +8 -0
- package/es/editor/src/EditorParts/ToolbarButton/ToolbarButton.d.ts +32 -0
- package/es/editor/src/EditorParts/ToolbarButton/ToolbarButton.mjs +44 -0
- package/es/editor/src/EditorParts/ToolbarButton/interface.d.ts +20 -0
- package/es/editor/src/EditorParts/ToolbarButton/interface.mjs +13 -0
- package/es/editor/src/composables/use-editor-commands.d.ts +8 -0
- package/es/editor/src/composables/use-editor-commands.mjs +69 -0
- package/es/editor/src/composables/use-editor-css-vars.d.ts +4 -0
- package/es/editor/src/composables/use-editor-css-vars.mjs +81 -0
- package/es/editor/src/constants.d.ts +12 -0
- package/es/editor/src/constants.mjs +25 -0
- package/es/editor/src/extensions.d.ts +7 -0
- package/es/editor/src/extensions.mjs +129 -0
- package/es/editor/src/interface.d.ts +2019 -0
- package/es/editor/src/interface.mjs +52 -0
- package/es/editor/src/markdown/constants.d.ts +8 -0
- package/es/editor/src/markdown/constants.mjs +206 -0
- package/es/editor/src/markdown/editor-serializer.d.ts +9 -0
- package/es/editor/src/markdown/editor-serializer.mjs +18 -0
- package/es/editor/src/markdown/escape.d.ts +2 -0
- package/es/editor/src/markdown/escape.mjs +24 -0
- package/es/editor/src/markdown/html.d.ts +1 -0
- package/es/editor/src/markdown/html.mjs +4 -0
- package/es/editor/src/markdown/parser.d.ts +4 -0
- package/es/editor/src/markdown/parser.mjs +36 -0
- package/es/editor/src/markdown/serializer-state.d.ts +10 -0
- package/es/editor/src/markdown/serializer-state.mjs +12 -0
- package/es/editor/src/markdown/serializer.d.ts +3 -0
- package/es/editor/src/markdown/serializer.mjs +8 -0
- package/es/editor/src/styles/index.cssr.d.ts +2 -0
- package/es/editor/src/styles/index.cssr.mjs +119 -0
- package/es/editor/styles/dark.d.ts +630 -0
- package/es/editor/styles/dark.mjs +21 -0
- package/es/editor/styles/index.d.ts +3 -0
- package/es/editor/styles/index.mjs +2 -0
- package/es/editor/styles/light.d.ts +677 -0
- package/es/editor/styles/light.mjs +87 -0
- package/es/editor/tests/fixtures/round-trip.d.ts +12 -0
- package/es/editor/tests/fixtures/round-trip.mjs +98 -0
- package/es/editor/tests/utils.d.ts +7 -0
- package/es/editor/tests/utils.mjs +27 -0
- package/es/locales/common/enUS.d.ts +21 -0
- package/es/locales/common/enUS.mjs +22 -1
- package/es/locales/common/ruRU.mjs +22 -1
- package/es/locales/common/uzUZ.mjs +22 -1
- package/es/locales/common/zhCN.mjs +22 -1
- package/es/message-bubble/src/styles/index.cssr.mjs +4 -17
- package/es/styles.d.ts +1 -0
- package/es/styles.mjs +1 -0
- package/es/themes/dark.mjs +2 -0
- package/es/themes/light.mjs +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/icons/Bold.d.ts +2 -0
- package/lib/_internal/icons/Bold.js +13 -0
- package/lib/_internal/icons/BulletList.d.ts +2 -0
- package/lib/_internal/icons/BulletList.js +13 -0
- package/lib/_internal/icons/HorizontalRule.d.ts +2 -0
- package/lib/_internal/icons/HorizontalRule.js +10 -0
- package/lib/_internal/icons/Italic.d.ts +2 -0
- package/lib/_internal/icons/Italic.js +11 -0
- package/lib/_internal/icons/NumberedList.d.ts +2 -0
- package/lib/_internal/icons/NumberedList.js +13 -0
- package/lib/_internal/icons/Quote.d.ts +2 -0
- package/lib/_internal/icons/Quote.js +13 -0
- package/lib/_internal/icons/SettingsLine.d.ts +2 -0
- package/lib/_internal/icons/SettingsLine.js +11 -0
- package/lib/_internal/icons/Strikethrough.d.ts +2 -0
- package/lib/_internal/icons/Strikethrough.js +10 -0
- package/lib/_internal/icons/index.d.ts +8 -0
- package/lib/_internal/icons/index.js +18 -2
- package/lib/_styles/markdown/markdown-content.cssr.d.ts +6 -0
- package/lib/_styles/markdown/markdown-content.cssr.js +28 -0
- package/lib/_utils/markdown/index.d.ts +3 -2
- package/lib/_utils/markdown/index.js +4 -1
- package/lib/_utils/markdown/render-markdown.d.ts +2 -1
- package/lib/_utils/markdown/render-markdown.js +1 -0
- package/lib/chat/src/Chat.d.ts +261 -24
- package/lib/chat/src/Chat.js +2 -0
- package/lib/chat/src/ChatMainArea.d.ts +81 -8
- package/lib/chat/src/ChatMainArea.js +93 -223
- package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +9084 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.js +52 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/interface.d.ts +2645 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/interface.js +17 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.d.ts +9070 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.js +55 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/interface.d.ts +2637 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/interface.js +14 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.d.ts +89 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.js +45 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/interface.d.ts +42 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/interface.js +37 -0
- package/lib/chat/src/ChatParts/ChatFooter/ChatFooter.d.ts +115 -0
- package/lib/chat/src/ChatParts/ChatFooter/ChatFooter.js +66 -0
- package/lib/chat/src/ChatParts/ChatFooter/interface.d.ts +56 -0
- package/lib/chat/src/ChatParts/ChatFooter/interface.js +49 -0
- package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +9205 -0
- package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.js +164 -0
- package/lib/chat/src/ChatParts/ChatHeader/interface.d.ts +2694 -0
- package/lib/chat/src/ChatParts/ChatHeader/interface.js +53 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.d.ts +9142 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.js +98 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/interface.d.ts +2654 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/interface.js +23 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.d.ts +148 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.js +49 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/interface.d.ts +72 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/interface.js +61 -0
- package/lib/chat/src/interface.d.ts +7 -0
- package/lib/chat/src/interface.js +3 -0
- package/lib/chat/styles/light.d.ts +4 -0
- package/lib/chat/styles/light.js +19 -0
- package/lib/components.d.ts +12933 -32
- package/lib/components.js +18 -7
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/index.d.ts +1 -1
- package/lib/data-table/src/ColumnSettings/ColumnSettingsDrawer.d.ts +156 -0
- package/lib/data-table/src/ColumnSettings/ColumnSettingsDrawer.js +181 -0
- package/lib/data-table/src/ColumnSettings/styles.cssr.d.ts +2 -0
- package/lib/data-table/src/ColumnSettings/styles.cssr.js +30 -0
- package/lib/data-table/src/DataTable.d.ts +60 -2
- package/lib/data-table/src/DataTable.js +65 -23
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/lib/data-table/src/interface.d.ts +53 -1
- package/lib/data-table/src/interface.js +17 -2
- package/lib/data-table/src/styles/index.cssr.js +17 -1
- package/lib/data-table/src/use-column-settings.d.ts +2 -0
- package/lib/data-table/src/use-column-settings.js +144 -0
- package/lib/data-table/src/utils/column-utils.d.ts +2 -1
- package/lib/data-table/src/utils/column-utils.js +5 -0
- package/lib/editor/index.d.ts +10 -0
- package/lib/editor/index.js +19 -0
- package/lib/editor/src/Editor.d.ts +3896 -0
- package/lib/editor/src/Editor.js +216 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.d.ts +37 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.js +47 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/interface.d.ts +21 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/interface.js +17 -0
- package/lib/editor/src/EditorParts/EditorContent/EditorContent.d.ts +4078 -0
- package/lib/editor/src/EditorParts/EditorContent/EditorContent.js +121 -0
- package/lib/editor/src/EditorParts/EditorContent/index.d.ts +2 -0
- package/lib/editor/src/EditorParts/EditorContent/index.js +10 -0
- package/lib/editor/src/EditorParts/EditorContent/interface.d.ts +1906 -0
- package/lib/editor/src/EditorParts/EditorContent/interface.js +8 -0
- package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +4582 -0
- package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.js +126 -0
- package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.d.ts +11 -0
- package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.js +52 -0
- package/lib/editor/src/EditorParts/EditorToolbar/index.d.ts +2 -0
- package/lib/editor/src/EditorParts/EditorToolbar/index.js +10 -0
- package/lib/editor/src/EditorParts/EditorToolbar/interface.d.ts +1912 -0
- package/lib/editor/src/EditorParts/EditorToolbar/interface.js +11 -0
- package/lib/editor/src/EditorParts/SendButton/SendButton.d.ts +23 -0
- package/lib/editor/src/EditorParts/SendButton/SendButton.js +31 -0
- package/lib/editor/src/EditorParts/SendButton/interface.d.ts +18 -0
- package/lib/editor/src/EditorParts/SendButton/interface.js +11 -0
- package/lib/editor/src/EditorParts/ToolbarButton/ToolbarButton.d.ts +32 -0
- package/lib/editor/src/EditorParts/ToolbarButton/ToolbarButton.js +34 -0
- package/lib/editor/src/EditorParts/ToolbarButton/interface.d.ts +20 -0
- package/lib/editor/src/EditorParts/ToolbarButton/interface.js +16 -0
- package/lib/editor/src/composables/use-editor-commands.d.ts +8 -0
- package/lib/editor/src/composables/use-editor-commands.js +70 -0
- package/lib/editor/src/composables/use-editor-css-vars.d.ts +4 -0
- package/lib/editor/src/composables/use-editor-css-vars.js +46 -0
- package/lib/editor/src/constants.d.ts +12 -0
- package/lib/editor/src/constants.js +56 -0
- package/lib/editor/src/extensions.d.ts +7 -0
- package/lib/editor/src/extensions.js +136 -0
- package/lib/editor/src/interface.d.ts +2019 -0
- package/lib/editor/src/interface.js +22 -0
- package/lib/editor/src/markdown/constants.d.ts +8 -0
- package/lib/editor/src/markdown/constants.js +201 -0
- package/lib/editor/src/markdown/editor-serializer.d.ts +9 -0
- package/lib/editor/src/markdown/editor-serializer.js +20 -0
- package/lib/editor/src/markdown/escape.d.ts +2 -0
- package/lib/editor/src/markdown/escape.js +31 -0
- package/lib/editor/src/markdown/html.d.ts +1 -0
- package/lib/editor/src/markdown/html.js +9 -0
- package/lib/editor/src/markdown/parser.d.ts +4 -0
- package/lib/editor/src/markdown/parser.js +42 -0
- package/lib/editor/src/markdown/serializer-state.d.ts +10 -0
- package/lib/editor/src/markdown/serializer-state.js +16 -0
- package/lib/editor/src/markdown/serializer.d.ts +3 -0
- package/lib/editor/src/markdown/serializer.js +9 -0
- package/lib/editor/src/styles/index.cssr.d.ts +2 -0
- package/lib/editor/src/styles/index.cssr.js +124 -0
- package/lib/editor/styles/dark.d.ts +630 -0
- package/lib/editor/styles/dark.js +23 -0
- package/lib/editor/styles/index.d.ts +3 -0
- package/lib/editor/styles/index.js +10 -0
- package/lib/editor/styles/light.d.ts +677 -0
- package/lib/editor/styles/light.js +71 -0
- package/lib/editor/tests/fixtures/round-trip.d.ts +12 -0
- package/lib/editor/tests/fixtures/round-trip.js +125 -0
- package/lib/editor/tests/utils.d.ts +7 -0
- package/lib/editor/tests/utils.js +26 -0
- package/lib/locales/common/enUS.d.ts +21 -0
- package/lib/locales/common/enUS.js +22 -1
- package/lib/locales/common/ruRU.js +22 -1
- package/lib/locales/common/uzUZ.js +22 -1
- package/lib/locales/common/zhCN.js +22 -1
- package/lib/message-bubble/src/styles/index.cssr.js +4 -17
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +127 -125
- package/lib/themes/dark.js +136 -134
- package/lib/themes/light.js +136 -134
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -1
- package/volar.d.ts +3 -0
- package/web-types.json +437 -2
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const vue_1 = require("vue");
|
|
7
|
+
const _mixins_1 = require("../../../../_mixins");
|
|
8
|
+
const markdown_1 = require("../../../../_utils/markdown");
|
|
9
|
+
const divider_1 = require("../../../../divider");
|
|
10
|
+
const flex_1 = require("../../../../flex");
|
|
11
|
+
const styles_1 = require("../../../styles");
|
|
12
|
+
const use_editor_commands_1 = __importDefault(require("../../composables/use-editor-commands"));
|
|
13
|
+
const use_editor_css_vars_1 = __importDefault(require("../../composables/use-editor-css-vars"));
|
|
14
|
+
const constants_1 = require("../../constants");
|
|
15
|
+
const interface_1 = require("../../interface");
|
|
16
|
+
const index_cssr_1 = __importDefault(require("../../styles/index.cssr"));
|
|
17
|
+
const BlockTypeSelect_1 = __importDefault(require("../BlockTypeSelect/BlockTypeSelect"));
|
|
18
|
+
const ToolbarButton_1 = __importDefault(require("../ToolbarButton/ToolbarButton"));
|
|
19
|
+
const use_editor_toolbar_customization_1 = __importDefault(require("./composables/use-editor-toolbar-customization"));
|
|
20
|
+
const interface_2 = require("./interface");
|
|
21
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
22
|
+
name: 'EditorToolbar',
|
|
23
|
+
props: interface_2.editorToolbarProps,
|
|
24
|
+
setup(props) {
|
|
25
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
26
|
+
const { localeRef } = (0, _mixins_1.useLocale)('Editor');
|
|
27
|
+
const { ITEM_ICONS, createToolbarButtonThemeOverrides, createBlockTypeSelectThemeOverrides } = (0, use_editor_toolbar_customization_1.default)();
|
|
28
|
+
const UEditor = (0, vue_1.inject)(interface_1.editorInjectionKey, null);
|
|
29
|
+
const isStandalone = !UEditor;
|
|
30
|
+
const themeRef = (0, _mixins_1.useTheme)('Editor', '-editor', index_cssr_1.default, styles_1.editorLight, props, mergedClsPrefixRef);
|
|
31
|
+
const themeVarsRef = (0, vue_1.computed)(() => { var _a, _b; return (_b = (_a = props.themeVars) !== null && _a !== void 0 ? _a : UEditor === null || UEditor === void 0 ? void 0 : UEditor.themeVarsRef.value) !== null && _b !== void 0 ? _b : themeRef.value.self; });
|
|
32
|
+
const cssVarsRef = (0, use_editor_css_vars_1.default)(themeRef, themeVarsRef);
|
|
33
|
+
const themeClassHandle = inlineThemeDisabled
|
|
34
|
+
? (0, _mixins_1.useThemeClass)('editor-toolbar', undefined, cssVarsRef, props)
|
|
35
|
+
: undefined;
|
|
36
|
+
const editorRef = (0, vue_1.computed)(() => { var _a; return (_a = props.editor) !== null && _a !== void 0 ? _a : UEditor === null || UEditor === void 0 ? void 0 : UEditor.editorRef.value; });
|
|
37
|
+
const mergedToolbarRef = (0, vue_1.computed)(() => { var _a; return (_a = UEditor === null || UEditor === void 0 ? void 0 : UEditor.toolbarRef.value) !== null && _a !== void 0 ? _a : props.toolbar; });
|
|
38
|
+
const mergedDisabledRef = (0, vue_1.computed)(() => { var _a; return (_a = UEditor === null || UEditor === void 0 ? void 0 : UEditor.disabledRef.value) !== null && _a !== void 0 ? _a : props.disabled; });
|
|
39
|
+
const normalizedOptionsRef = (0, vue_1.computed)(() => {
|
|
40
|
+
var _a;
|
|
41
|
+
return (0, markdown_1.normalizeOptions)((_a = UEditor === null || UEditor === void 0 ? void 0 : UEditor.markdownOptionsRef.value) !== null && _a !== void 0 ? _a : props.markdownOptions);
|
|
42
|
+
});
|
|
43
|
+
const localeTooltipsRef = (0, vue_1.computed)(() => ({
|
|
44
|
+
bold: localeRef.value.boldTooltip,
|
|
45
|
+
strikethrough: localeRef.value.strikethroughTooltip,
|
|
46
|
+
italic: localeRef.value.italicTooltip,
|
|
47
|
+
blockquote: localeRef.value.blockquoteTooltip,
|
|
48
|
+
divider: localeRef.value.dividerTooltip,
|
|
49
|
+
bulletList: localeRef.value.bulletListTooltip,
|
|
50
|
+
orderedList: localeRef.value.orderedListTooltip
|
|
51
|
+
}));
|
|
52
|
+
const blocksRef = (0, vue_1.computed)(() => {
|
|
53
|
+
if (mergedToolbarRef.value === false)
|
|
54
|
+
return [];
|
|
55
|
+
const config = Array.isArray(mergedToolbarRef.value)
|
|
56
|
+
? mergedToolbarRef.value
|
|
57
|
+
: constants_1.EDITOR_DEFAULT_TOOLBAR;
|
|
58
|
+
const features = new Set(normalizedOptionsRef.value.features);
|
|
59
|
+
return config
|
|
60
|
+
.map(block => block.filter(key => features.has(constants_1.EDITOR_TOOLBAR_ITEM_FEATURES[key])))
|
|
61
|
+
.filter(block => block.length > 0);
|
|
62
|
+
});
|
|
63
|
+
const itemKeysRef = (0, vue_1.computed)(() => blocksRef.value.flat());
|
|
64
|
+
const buttonThemeOverridesRef = (0, vue_1.computed)(() => createToolbarButtonThemeOverrides(themeVarsRef.value, false));
|
|
65
|
+
const activeButtonThemeOverridesRef = (0, vue_1.computed)(() => createToolbarButtonThemeOverrides(themeVarsRef.value, true));
|
|
66
|
+
const blockTypeSelectThemeOverridesRef = (0, vue_1.computed)(() => createBlockTypeSelectThemeOverrides(themeVarsRef.value));
|
|
67
|
+
const { commandsRef, activeBlockTypeRef, setBlockType } = (0, use_editor_commands_1.default)(editorRef, itemKeysRef);
|
|
68
|
+
return {
|
|
69
|
+
ITEM_ICONS,
|
|
70
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
71
|
+
isStandalone,
|
|
72
|
+
inlineThemeDisabled,
|
|
73
|
+
cssVars: cssVarsRef,
|
|
74
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
75
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
76
|
+
blocks: blocksRef,
|
|
77
|
+
commands: commandsRef,
|
|
78
|
+
activeBlockType: activeBlockTypeRef,
|
|
79
|
+
buttonThemeOverrides: buttonThemeOverridesRef,
|
|
80
|
+
activeButtonThemeOverrides: activeButtonThemeOverridesRef,
|
|
81
|
+
blockTypeSelectThemeOverrides: blockTypeSelectThemeOverridesRef,
|
|
82
|
+
maxHeadingLevel: (0, vue_1.computed)(() => normalizedOptionsRef.value.maxHeadingLevel),
|
|
83
|
+
mergedDisabled: mergedDisabledRef,
|
|
84
|
+
mergedButtonProps: (0, vue_1.computed)(() => { var _a; return (_a = UEditor === null || UEditor === void 0 ? void 0 : UEditor.toolbarButtonPropsRef.value) !== null && _a !== void 0 ? _a : props.buttonProps; }),
|
|
85
|
+
mergedIconProps: (0, vue_1.computed)(() => { var _a; return (_a = UEditor === null || UEditor === void 0 ? void 0 : UEditor.toolbarIconPropsRef.value) !== null && _a !== void 0 ? _a : props.iconProps; }),
|
|
86
|
+
mergedDropdownProps: (0, vue_1.computed)(() => { var _a; return (_a = UEditor === null || UEditor === void 0 ? void 0 : UEditor.toolbarDropdownPropsRef.value) !== null && _a !== void 0 ? _a : props.dropdownProps; }),
|
|
87
|
+
tooltipOf: (key) => {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
return (_b = (_a = UEditor === null || UEditor === void 0 ? void 0 : UEditor.toolbarTooltipsRef.value[key]) !== null && _a !== void 0 ? _a : props.tooltips[key]) !== null && _b !== void 0 ? _b : localeTooltipsRef.value[key];
|
|
90
|
+
},
|
|
91
|
+
setBlockType
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
render() {
|
|
95
|
+
var _a;
|
|
96
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
97
|
+
if (this.blocks.length === 0)
|
|
98
|
+
return null;
|
|
99
|
+
const renderItem = (key) => {
|
|
100
|
+
if (key === 'blockType') {
|
|
101
|
+
return ((0, vue_1.h)(BlockTypeSelect_1.default, { key: key, value: this.activeBlockType, maxHeadingLevel: this.maxHeadingLevel, selectThemeOverrides: this.blockTypeSelectThemeOverrides, selectProps: this.mergedDropdownProps, disabled: this.mergedDisabled, onSelect: this.setBlockType }));
|
|
102
|
+
}
|
|
103
|
+
const command = this.commands[key];
|
|
104
|
+
if (!command)
|
|
105
|
+
return null;
|
|
106
|
+
return ((0, vue_1.h)(ToolbarButton_1.default, { key: key, icon: this.ITEM_ICONS[key], tooltip: this.tooltipOf(key), buttonThemeOverrides: command.active
|
|
107
|
+
? this.activeButtonThemeOverrides
|
|
108
|
+
: this.buttonThemeOverrides, buttonProps: this.mergedButtonProps, iconProps: this.mergedIconProps, active: command.active, disabled: command.disabled || this.mergedDisabled, onActivate: command.run }));
|
|
109
|
+
};
|
|
110
|
+
const children = [];
|
|
111
|
+
this.blocks.forEach((block, index) => {
|
|
112
|
+
if (index > 0) {
|
|
113
|
+
children.push((0, vue_1.h)(divider_1.UDivider, { key: `divider-${index}`, class: `${this.mergedClsPrefix}-editor__toolbar-divider`, vertical: true }));
|
|
114
|
+
}
|
|
115
|
+
block.forEach(key => children.push(renderItem(key)));
|
|
116
|
+
});
|
|
117
|
+
const toolbar = ((0, vue_1.h)(flex_1.UFlex, { class: [
|
|
118
|
+
`${this.mergedClsPrefix}-editor__toolbar`,
|
|
119
|
+
this.isStandalone
|
|
120
|
+
&& `${this.mergedClsPrefix}-editor__toolbar--standalone`
|
|
121
|
+
], size: 8, align: "center" }, { default: () => children }));
|
|
122
|
+
if (!this.isStandalone)
|
|
123
|
+
return toolbar;
|
|
124
|
+
return ((0, vue_1.h)("div", { class: [`${this.mergedClsPrefix}-editor`, this.themeClass], style: this.inlineThemeDisabled ? undefined : this.cssVars }, toolbar));
|
|
125
|
+
}
|
|
126
|
+
});
|
package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ExtractThemeOverrides } from '../../../../../_mixins/use-theme';
|
|
3
|
+
import type { ButtonTheme } from '../../../../../button/styles';
|
|
4
|
+
import type { SelectTheme } from '../../../../../select/styles';
|
|
5
|
+
import type { EditorThemeVars } from '../../../../styles';
|
|
6
|
+
import type { EditorToolbarButtonKey } from '../interface';
|
|
7
|
+
export default function useEditorToolbarCustomization(): {
|
|
8
|
+
ITEM_ICONS: Record<EditorToolbarButtonKey, Component>;
|
|
9
|
+
createToolbarButtonThemeOverrides: (themeVars: EditorThemeVars, active: boolean) => ExtractThemeOverrides<ButtonTheme>;
|
|
10
|
+
createBlockTypeSelectThemeOverrides: (themeVars: EditorThemeVars) => ExtractThemeOverrides<SelectTheme>;
|
|
11
|
+
};
|
package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useEditorToolbarCustomization;
|
|
4
|
+
const icons_1 = require("../../../../../_internal/icons");
|
|
5
|
+
function useEditorToolbarCustomization() {
|
|
6
|
+
const ITEM_ICONS = {
|
|
7
|
+
bold: icons_1.BoldIcon,
|
|
8
|
+
strikethrough: icons_1.StrikethroughIcon,
|
|
9
|
+
italic: icons_1.ItalicIcon,
|
|
10
|
+
blockquote: icons_1.QuoteIcon,
|
|
11
|
+
divider: icons_1.HorizontalRuleIcon,
|
|
12
|
+
bulletList: icons_1.BulletListIcon,
|
|
13
|
+
orderedList: icons_1.NumberedListIcon
|
|
14
|
+
};
|
|
15
|
+
const TOOLBAR_BUTTON_SIZE_OVERRIDES = {
|
|
16
|
+
heightTiny: '24px',
|
|
17
|
+
paddingTiny: '0',
|
|
18
|
+
iconSizeTiny: '24px',
|
|
19
|
+
iconMarginTiny: '0',
|
|
20
|
+
borderRadiusTiny: '4px'
|
|
21
|
+
};
|
|
22
|
+
function createToolbarButtonThemeOverrides(themeVars, active) {
|
|
23
|
+
return Object.assign(Object.assign({}, TOOLBAR_BUTTON_SIZE_OVERRIDES), { color: active ? themeVars.toolbarButtonColorActive : 'transparent', colorHover: themeVars.toolbarButtonColorHover, colorPressed: themeVars.toolbarButtonColorActive, colorFocus: active ? themeVars.toolbarButtonColorActive : 'transparent', colorDisabled: 'transparent', textColor: active
|
|
24
|
+
? themeVars.toolbarIconColorActive
|
|
25
|
+
: themeVars.toolbarIconColor, textColorHover: active
|
|
26
|
+
? themeVars.toolbarIconColorActive
|
|
27
|
+
: themeVars.toolbarIconColorHover, textColorPressed: themeVars.toolbarIconColorActive, textColorFocus: active
|
|
28
|
+
? themeVars.toolbarIconColorActive
|
|
29
|
+
: themeVars.toolbarIconColorHover, textColorDisabled: themeVars.toolbarIconColorDisabled });
|
|
30
|
+
}
|
|
31
|
+
function createBlockTypeSelectThemeOverrides(themeVars) {
|
|
32
|
+
return {
|
|
33
|
+
peers: {
|
|
34
|
+
InternalSelection: {
|
|
35
|
+
heightTiny: themeVars.blockTypeTriggerHeight,
|
|
36
|
+
paddingTiny: themeVars.blockTypeTriggerPadding,
|
|
37
|
+
fontSizeTiny: themeVars.blockTypeTriggerFontSize,
|
|
38
|
+
lineHeightTiny: themeVars.blockTypeTriggerLineHeight,
|
|
39
|
+
arrowSizeTiny: themeVars.blockTypeTriggerArrowSize,
|
|
40
|
+
color: themeVars.blockTypeTriggerColor,
|
|
41
|
+
textColor: themeVars.blockTypeTriggerTextColor,
|
|
42
|
+
arrowColor: themeVars.blockTypeTriggerArrowColor
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
ITEM_ICONS,
|
|
49
|
+
createToolbarButtonThemeOverrides,
|
|
50
|
+
createBlockTypeSelectThemeOverrides
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.editorToolbarProps = exports.UEditorToolbar = void 0;
|
|
7
|
+
var EditorToolbar_1 = require("./EditorToolbar");
|
|
8
|
+
Object.defineProperty(exports, "UEditorToolbar", { enumerable: true, get: function () { return __importDefault(EditorToolbar_1).default; } });
|
|
9
|
+
var interface_1 = require("./interface");
|
|
10
|
+
Object.defineProperty(exports, "editorToolbarProps", { enumerable: true, get: function () { return interface_1.editorToolbarProps; } });
|