@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,219 @@
|
|
|
1
|
+
import { computed, defineComponent, h, inject } from 'vue';
|
|
2
|
+
import { ArrowHookUpRight, PersonNote } from "../../../../_internal/icons/index.mjs";
|
|
3
|
+
import { useConfig, useLocale, useTheme } from "../../../../_mixins/index.mjs";
|
|
4
|
+
import { resolveSlot } from "../../../../_utils/index.mjs";
|
|
5
|
+
import { UButton } from "../../../../button/index.mjs";
|
|
6
|
+
import { UFlex } from "../../../../flex/index.mjs";
|
|
7
|
+
import { UIcon } from "../../../../icon/index.mjs";
|
|
8
|
+
import { UTooltip } from "../../../../tooltip/index.mjs";
|
|
9
|
+
import { UText } from "../../../../typography/index.mjs";
|
|
10
|
+
import { chatLight } from "../../../styles/index.mjs";
|
|
11
|
+
import { chatInjectionKey } from "../../interface.mjs";
|
|
12
|
+
import style from "../../styles/index.cssr.mjs";
|
|
13
|
+
import { chatHeaderProps } from "./interface.mjs";
|
|
14
|
+
export default defineComponent({
|
|
15
|
+
name: 'ChatHeader',
|
|
16
|
+
props: chatHeaderProps,
|
|
17
|
+
slots: Object,
|
|
18
|
+
setup(props) {
|
|
19
|
+
var _a;
|
|
20
|
+
const UChat = inject(chatInjectionKey, null);
|
|
21
|
+
const {
|
|
22
|
+
mergedClsPrefixRef
|
|
23
|
+
} = useConfig(props);
|
|
24
|
+
const {
|
|
25
|
+
localeRef
|
|
26
|
+
} = useLocale('Chat');
|
|
27
|
+
const theme = useTheme('Chat', '-chat', style, chatLight, props, mergedClsPrefixRef);
|
|
28
|
+
const mergedThemeRef = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.mergedThemeRef) !== null && _a !== void 0 ? _a : theme;
|
|
29
|
+
const selectedChatRef = computed(() => {
|
|
30
|
+
var _a;
|
|
31
|
+
return (_a = UChat === null || UChat === void 0 ? void 0 : UChat.selectedChatRef.value) !== null && _a !== void 0 ? _a : props.selectedChat;
|
|
32
|
+
});
|
|
33
|
+
const typingRef = computed(() => {
|
|
34
|
+
var _a;
|
|
35
|
+
const selectedChat = selectedChatRef.value;
|
|
36
|
+
const typingChatIds = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.typingChatIdsRef.value) !== null && _a !== void 0 ? _a : props.typingChatIds;
|
|
37
|
+
if (!selectedChat || !typingChatIds) return false;
|
|
38
|
+
return typingChatIds.includes(selectedChat.id);
|
|
39
|
+
});
|
|
40
|
+
const typingTextRef = computed(() => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
return (_b = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.typingTextRef.value) !== null && _a !== void 0 ? _a : props.typingText) !== null && _b !== void 0 ? _b : localeRef.value.typingText;
|
|
43
|
+
});
|
|
44
|
+
const closeButtonTextRef = computed(() => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
return (_b = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.closeButtonTextRef.value) !== null && _a !== void 0 ? _a : props.closeButtonText) !== null && _b !== void 0 ? _b : localeRef.value.closeButtonText;
|
|
47
|
+
});
|
|
48
|
+
const shareButtonTooltipRef = computed(() => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
return (_b = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.shareButtonTooltipRef.value) !== null && _a !== void 0 ? _a : props.shareButtonTooltip) !== null && _b !== void 0 ? _b : localeRef.value.shareButtonTooltip;
|
|
51
|
+
});
|
|
52
|
+
const profileButtonTooltipRef = computed(() => {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
return (_b = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.profileButtonTooltipRef.value) !== null && _a !== void 0 ? _a : props.profileButtonTooltip) !== null && _b !== void 0 ? _b : localeRef.value.profileButtonTooltip;
|
|
55
|
+
});
|
|
56
|
+
const baseButtonPropsRef = computed(() => {
|
|
57
|
+
var _a;
|
|
58
|
+
return (_a = UChat === null || UChat === void 0 ? void 0 : UChat.headerButtonPropsRef.value) !== null && _a !== void 0 ? _a : props.buttonProps;
|
|
59
|
+
});
|
|
60
|
+
const baseIconPropsRef = computed(() => {
|
|
61
|
+
var _a;
|
|
62
|
+
return (_a = UChat === null || UChat === void 0 ? void 0 : UChat.headerIconPropsRef.value) !== null && _a !== void 0 ? _a : props.iconProps;
|
|
63
|
+
});
|
|
64
|
+
const shareButtonPropsRef = computed(() => {
|
|
65
|
+
var _a;
|
|
66
|
+
return Object.assign(Object.assign({}, baseButtonPropsRef.value), (_a = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareButtonPropsRef.value) !== null && _a !== void 0 ? _a : props.shareButtonProps);
|
|
67
|
+
});
|
|
68
|
+
const profileButtonPropsRef = computed(() => {
|
|
69
|
+
var _a;
|
|
70
|
+
return Object.assign(Object.assign({}, baseButtonPropsRef.value), (_a = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileButtonPropsRef.value) !== null && _a !== void 0 ? _a : props.profileButtonProps);
|
|
71
|
+
});
|
|
72
|
+
const closeButtonPropsRef = computed(() => {
|
|
73
|
+
var _a;
|
|
74
|
+
return Object.assign(Object.assign({}, baseButtonPropsRef.value), (_a = UChat === null || UChat === void 0 ? void 0 : UChat.headerCloseButtonPropsRef.value) !== null && _a !== void 0 ? _a : props.closeButtonProps);
|
|
75
|
+
});
|
|
76
|
+
const shareIconPropsRef = computed(() => {
|
|
77
|
+
var _a;
|
|
78
|
+
return Object.assign(Object.assign({}, baseIconPropsRef.value), (_a = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareIconPropsRef.value) !== null && _a !== void 0 ? _a : props.shareIconProps);
|
|
79
|
+
});
|
|
80
|
+
const profileIconPropsRef = computed(() => {
|
|
81
|
+
var _a;
|
|
82
|
+
return Object.assign(Object.assign({}, baseIconPropsRef.value), (_a = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileIconPropsRef.value) !== null && _a !== void 0 ? _a : props.profileIconProps);
|
|
83
|
+
});
|
|
84
|
+
function toKeyString(value) {
|
|
85
|
+
if (typeof value === 'symbol') return value.toString();
|
|
86
|
+
if (typeof value === 'function') {
|
|
87
|
+
const result = value();
|
|
88
|
+
return typeof result === 'string' || typeof result === 'number' ? String(result) : '';
|
|
89
|
+
}
|
|
90
|
+
return value != null ? String(value) : '';
|
|
91
|
+
}
|
|
92
|
+
function handleChatShare() {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
const handler = (_b = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.onChatShare) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : props.onChatShare;
|
|
95
|
+
handler === null || handler === void 0 ? void 0 : handler();
|
|
96
|
+
}
|
|
97
|
+
function handleUserProfile() {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
const handler = (_b = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.onUserProfile) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : props.onUserProfile;
|
|
100
|
+
handler === null || handler === void 0 ? void 0 : handler();
|
|
101
|
+
}
|
|
102
|
+
function handleChatClose() {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
const handler = (_b = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.onChatClose) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : props.onChatClose;
|
|
105
|
+
handler === null || handler === void 0 ? void 0 : handler();
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
109
|
+
mergedTheme: mergedThemeRef,
|
|
110
|
+
selectedChat: selectedChatRef,
|
|
111
|
+
typing: typingRef,
|
|
112
|
+
typingText: typingTextRef,
|
|
113
|
+
closeButtonText: closeButtonTextRef,
|
|
114
|
+
shareButtonTooltip: shareButtonTooltipRef,
|
|
115
|
+
profileButtonTooltip: profileButtonTooltipRef,
|
|
116
|
+
mergedShareButtonProps: shareButtonPropsRef,
|
|
117
|
+
mergedProfileButtonProps: profileButtonPropsRef,
|
|
118
|
+
mergedCloseButtonProps: closeButtonPropsRef,
|
|
119
|
+
mergedShareIconProps: shareIconPropsRef,
|
|
120
|
+
mergedProfileIconProps: profileIconPropsRef,
|
|
121
|
+
toKeyString,
|
|
122
|
+
handleChatShare,
|
|
123
|
+
handleUserProfile,
|
|
124
|
+
handleChatClose
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
render() {
|
|
128
|
+
const {
|
|
129
|
+
mergedClsPrefix,
|
|
130
|
+
mergedTheme,
|
|
131
|
+
selectedChat
|
|
132
|
+
} = this;
|
|
133
|
+
const keyId = this.toKeyString(selectedChat === null || selectedChat === void 0 ? void 0 : selectedChat.id);
|
|
134
|
+
const keyTitle = this.toKeyString(selectedChat === null || selectedChat === void 0 ? void 0 : selectedChat.title);
|
|
135
|
+
const renderDefaultActions = () => [h(UTooltip, null, {
|
|
136
|
+
trigger: () => h(UButton, Object.assign({
|
|
137
|
+
secondary: true,
|
|
138
|
+
circle: true,
|
|
139
|
+
size: "large"
|
|
140
|
+
}, this.mergedShareButtonProps, {
|
|
141
|
+
theme: mergedTheme.peers.Button,
|
|
142
|
+
themeOverrides: mergedTheme.peerOverrides.Button,
|
|
143
|
+
onClick: this.handleChatShare
|
|
144
|
+
}), {
|
|
145
|
+
default: () => h(UIcon, Object.assign({
|
|
146
|
+
size: 20
|
|
147
|
+
}, this.mergedShareIconProps, {
|
|
148
|
+
theme: mergedTheme.peers.HeaderShareIcon,
|
|
149
|
+
themeOverrides: mergedTheme.peerOverrides.HeaderShareIcon
|
|
150
|
+
}), {
|
|
151
|
+
default: () => h(ArrowHookUpRight, null)
|
|
152
|
+
})
|
|
153
|
+
}),
|
|
154
|
+
default: () => this.shareButtonTooltip
|
|
155
|
+
}), h(UTooltip, null, {
|
|
156
|
+
trigger: () => h(UButton, Object.assign({
|
|
157
|
+
secondary: true,
|
|
158
|
+
circle: true,
|
|
159
|
+
size: "large"
|
|
160
|
+
}, this.mergedProfileButtonProps, {
|
|
161
|
+
theme: mergedTheme.peers.Button,
|
|
162
|
+
themeOverrides: mergedTheme.peerOverrides.Button,
|
|
163
|
+
onClick: this.handleUserProfile
|
|
164
|
+
}), {
|
|
165
|
+
default: () => h(UIcon, Object.assign({
|
|
166
|
+
size: 20
|
|
167
|
+
}, this.mergedProfileIconProps, {
|
|
168
|
+
theme: mergedTheme.peers.HeaderProfileIcon,
|
|
169
|
+
themeOverrides: mergedTheme.peerOverrides.HeaderProfileIcon
|
|
170
|
+
}), {
|
|
171
|
+
default: () => h(PersonNote, null)
|
|
172
|
+
})
|
|
173
|
+
}),
|
|
174
|
+
default: () => this.profileButtonTooltip
|
|
175
|
+
}), h(UButton, Object.assign({
|
|
176
|
+
type: "primary",
|
|
177
|
+
size: "large",
|
|
178
|
+
round: true
|
|
179
|
+
}, this.mergedCloseButtonProps, {
|
|
180
|
+
theme: mergedTheme.peers.Button,
|
|
181
|
+
themeOverrides: mergedTheme.peerOverrides.Button,
|
|
182
|
+
onClick: this.handleChatClose
|
|
183
|
+
}), {
|
|
184
|
+
default: () => this.closeButtonText
|
|
185
|
+
})];
|
|
186
|
+
return h("div", {
|
|
187
|
+
class: `${mergedClsPrefix}-chat-main__header`
|
|
188
|
+
}, h("div", {
|
|
189
|
+
class: `${mergedClsPrefix}-chat-main__header-inner`
|
|
190
|
+
}, h("div", {
|
|
191
|
+
class: `${mergedClsPrefix}-chat-main__header-title-wrap`
|
|
192
|
+
}, h(UText, {
|
|
193
|
+
key: `${keyId}-${keyTitle}`,
|
|
194
|
+
variant: "heading-s-bold",
|
|
195
|
+
class: `${mergedClsPrefix}-chat-main__header-title`,
|
|
196
|
+
theme: mergedTheme.peers.Typography,
|
|
197
|
+
themeOverrides: mergedTheme.peerOverrides.Typography
|
|
198
|
+
}, {
|
|
199
|
+
default: () => {
|
|
200
|
+
var _a;
|
|
201
|
+
return (_a = selectedChat === null || selectedChat === void 0 ? void 0 : selectedChat.title) !== null && _a !== void 0 ? _a : '';
|
|
202
|
+
}
|
|
203
|
+
}), this.typing && h(UText, {
|
|
204
|
+
class: [`${mergedClsPrefix}-chat-main__header-subtitle`, 'typing'],
|
|
205
|
+
variant: "body-m-medium"
|
|
206
|
+
}, {
|
|
207
|
+
default: () => {
|
|
208
|
+
var _a;
|
|
209
|
+
return (_a = this.typingText) !== null && _a !== void 0 ? _a : '';
|
|
210
|
+
}
|
|
211
|
+
})), h(UFlex, {
|
|
212
|
+
align: "center",
|
|
213
|
+
size: "small",
|
|
214
|
+
class: `${mergedClsPrefix}-chat-main__header-actions`
|
|
215
|
+
}, {
|
|
216
|
+
default: () => resolveSlot(this.$slots.actions, renderDefaultActions)
|
|
217
|
+
})));
|
|
218
|
+
}
|
|
219
|
+
});
|