@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
|
@@ -25,30 +25,14 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
25
25
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
var t = {};
|
|
30
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
32
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
import { computed, defineComponent, Fragment, h, inject, nextTick, onMounted, provide, ref, toRef, watch } from 'vue';
|
|
37
|
-
import { ArrowHookUpRight, AttachIcon, CloseIcon, PersonNote, SendFilled } from "../../_internal/icons/index.mjs";
|
|
28
|
+
import { computed, defineComponent, h, inject, nextTick, onMounted, provide, ref, toRef, watch } from 'vue';
|
|
38
29
|
import { useConfig, useLocale, useTheme, useThemeClass } from "../../_mixins/index.mjs";
|
|
39
|
-
import { resolveSlot } from "../../_utils/index.mjs";
|
|
40
30
|
import { renderMarkdown } from "../../_utils/markdown/index.mjs";
|
|
41
|
-
import { UButton } from "../../button/index.mjs";
|
|
42
|
-
import { UFlex } from "../../flex/index.mjs";
|
|
43
|
-
import { UIcon } from "../../icon/index.mjs";
|
|
44
|
-
import { UInput } from "../../input/index.mjs";
|
|
45
|
-
import { UList, UListItem } from "../../list/index.mjs";
|
|
46
31
|
import { USafeTopScrollbar } from "../../safe-top-scrollbar/index.mjs";
|
|
47
|
-
import { UTooltip } from "../../tooltip/index.mjs";
|
|
48
|
-
import { UText } from "../../typography/index.mjs";
|
|
49
|
-
import { UUpload, UUploadTrigger } from "../../upload/index.mjs";
|
|
50
32
|
import { chatLight } from "../styles/index.mjs";
|
|
51
|
-
import
|
|
33
|
+
import ChatFooter from "./ChatParts/ChatFooter/ChatFooter.mjs";
|
|
34
|
+
import ChatHeader from "./ChatParts/ChatHeader/ChatHeader.mjs";
|
|
35
|
+
import ChatMessagesArea from "./ChatParts/ChatMessagesArea/ChatMessagesArea.mjs";
|
|
52
36
|
import { ChatBubbleActionKey, chatInjectionKey, ChatMessageType, MessageStatus } from "./interface.mjs";
|
|
53
37
|
import style from "./styles/index.cssr.mjs";
|
|
54
38
|
const SENDING_DELAY = 100;
|
|
@@ -77,6 +61,14 @@ export const chatMainAreaProps = Object.assign(Object.assign({}, useTheme.props)
|
|
|
77
61
|
type: Number,
|
|
78
62
|
default: 10
|
|
79
63
|
},
|
|
64
|
+
disabled: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
legacyInput: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
80
72
|
headerButtonProps: {
|
|
81
73
|
type: Object,
|
|
82
74
|
default: undefined
|
|
@@ -221,10 +213,8 @@ export const chatMainAreaProps = Object.assign(Object.assign({}, useTheme.props)
|
|
|
221
213
|
export default defineComponent({
|
|
222
214
|
name: 'ChatMainArea',
|
|
223
215
|
props: chatMainAreaProps,
|
|
224
|
-
setup(props
|
|
225
|
-
|
|
226
|
-
}) {
|
|
227
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
|
|
216
|
+
setup(props) {
|
|
217
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22;
|
|
228
218
|
const UChat = inject(chatInjectionKey, null);
|
|
229
219
|
const isStandalone = !UChat;
|
|
230
220
|
const {
|
|
@@ -235,89 +225,82 @@ export default defineComponent({
|
|
|
235
225
|
localeRef
|
|
236
226
|
} = useLocale('Chat');
|
|
237
227
|
const selectedChatRef = (_b = UChat === null || UChat === void 0 ? void 0 : UChat.selectedChatRef) !== null && _b !== void 0 ? _b : toRef(props, 'selectedChat');
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return rest;
|
|
259
|
-
});
|
|
260
|
-
const footerButtonPropsRef = (_r = UChat === null || UChat === void 0 ? void 0 : UChat.footerButtonPropsRef) !== null && _r !== void 0 ? _r : toRef(props, 'footerButtonProps');
|
|
261
|
-
const footerUploadPropsRef = (_s = UChat === null || UChat === void 0 ? void 0 : UChat.footerUploadPropsRef) !== null && _s !== void 0 ? _s : toRef(props, 'footerUploadProps');
|
|
262
|
-
const footerIconPropsRef = (_t = UChat === null || UChat === void 0 ? void 0 : UChat.footerIconPropsRef) !== null && _t !== void 0 ? _t : toRef(props, 'footerIconProps');
|
|
263
|
-
const footerSuffixIconPropsRef = (_u = UChat === null || UChat === void 0 ? void 0 : UChat.footerSuffixIconPropsRef) !== null && _u !== void 0 ? _u : toRef(props, 'footerSuffixIconProps');
|
|
264
|
-
const inputPlaceholderRef = (_v = UChat === null || UChat === void 0 ? void 0 : UChat.inputPlaceholderRef) !== null && _v !== void 0 ? _v : computed(() => {
|
|
228
|
+
const legacyInputRef = (_c = UChat === null || UChat === void 0 ? void 0 : UChat.legacyInputRef) !== null && _c !== void 0 ? _c : toRef(props, 'legacyInput');
|
|
229
|
+
const disabledRef = (_d = UChat === null || UChat === void 0 ? void 0 : UChat.disabledRef) !== null && _d !== void 0 ? _d : toRef(props, 'disabled');
|
|
230
|
+
const messagesRef = (_e = UChat === null || UChat === void 0 ? void 0 : UChat.messagesRef) !== null && _e !== void 0 ? _e : toRef(props, 'messages');
|
|
231
|
+
const typingChatIdsRef = (_f = UChat === null || UChat === void 0 ? void 0 : UChat.typingChatIdsRef) !== null && _f !== void 0 ? _f : toRef(props, 'typingChatIds');
|
|
232
|
+
const messagesLoadingRef = (_g = UChat === null || UChat === void 0 ? void 0 : UChat.messagesLoadingRef) !== null && _g !== void 0 ? _g : toRef(props, 'loading');
|
|
233
|
+
const messagesLoadingCountRef = (_h = UChat === null || UChat === void 0 ? void 0 : UChat.messagesLoadingCountRef) !== null && _h !== void 0 ? _h : toRef(props, 'loadingCount');
|
|
234
|
+
const headerButtonPropsRef = (_j = UChat === null || UChat === void 0 ? void 0 : UChat.headerButtonPropsRef) !== null && _j !== void 0 ? _j : toRef(props, 'headerButtonProps');
|
|
235
|
+
const headerIconPropsRef = (_k = UChat === null || UChat === void 0 ? void 0 : UChat.headerIconPropsRef) !== null && _k !== void 0 ? _k : toRef(props, 'headerIconProps');
|
|
236
|
+
const headerShareButtonPropsRef = (_l = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareButtonPropsRef) !== null && _l !== void 0 ? _l : toRef(props, 'headerShareButtonProps');
|
|
237
|
+
const headerProfileButtonPropsRef = (_m = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileButtonPropsRef) !== null && _m !== void 0 ? _m : toRef(props, 'headerProfileButtonProps');
|
|
238
|
+
const headerCloseButtonPropsRef = (_o = UChat === null || UChat === void 0 ? void 0 : UChat.headerCloseButtonPropsRef) !== null && _o !== void 0 ? _o : toRef(props, 'headerCloseButtonProps');
|
|
239
|
+
const headerShareIconPropsRef = (_p = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareIconPropsRef) !== null && _p !== void 0 ? _p : toRef(props, 'headerShareIconProps');
|
|
240
|
+
const headerProfileIconPropsRef = (_q = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileIconPropsRef) !== null && _q !== void 0 ? _q : toRef(props, 'headerProfileIconProps');
|
|
241
|
+
const messageUploadPropsRef = (_r = UChat === null || UChat === void 0 ? void 0 : UChat.messageUploadPropsRef) !== null && _r !== void 0 ? _r : toRef(props, 'messageUploadProps');
|
|
242
|
+
const footerInputPropsRef = (_s = UChat === null || UChat === void 0 ? void 0 : UChat.footerInputPropsRef) !== null && _s !== void 0 ? _s : toRef(props, 'footerInputProps');
|
|
243
|
+
const footerButtonPropsRef = (_t = UChat === null || UChat === void 0 ? void 0 : UChat.footerButtonPropsRef) !== null && _t !== void 0 ? _t : toRef(props, 'footerButtonProps');
|
|
244
|
+
const footerUploadPropsRef = (_u = UChat === null || UChat === void 0 ? void 0 : UChat.footerUploadPropsRef) !== null && _u !== void 0 ? _u : toRef(props, 'footerUploadProps');
|
|
245
|
+
const footerIconPropsRef = (_v = UChat === null || UChat === void 0 ? void 0 : UChat.footerIconPropsRef) !== null && _v !== void 0 ? _v : toRef(props, 'footerIconProps');
|
|
246
|
+
const footerSuffixIconPropsRef = (_w = UChat === null || UChat === void 0 ? void 0 : UChat.footerSuffixIconPropsRef) !== null && _w !== void 0 ? _w : toRef(props, 'footerSuffixIconProps');
|
|
247
|
+
const inputPlaceholderRef = (_x = UChat === null || UChat === void 0 ? void 0 : UChat.inputPlaceholderRef) !== null && _x !== void 0 ? _x : computed(() => {
|
|
265
248
|
var _a;
|
|
266
249
|
return (_a = props.inputPlaceholder) !== null && _a !== void 0 ? _a : localeRef.value.inputPlaceholder;
|
|
267
250
|
});
|
|
268
|
-
const retryTextRef = (
|
|
251
|
+
const retryTextRef = (_y = UChat === null || UChat === void 0 ? void 0 : UChat.retryTextRef) !== null && _y !== void 0 ? _y : computed(() => {
|
|
269
252
|
var _a;
|
|
270
253
|
return (_a = props.retryText) !== null && _a !== void 0 ? _a : localeRef.value.retryText;
|
|
271
254
|
});
|
|
272
|
-
const typingTextRef = (
|
|
255
|
+
const typingTextRef = (_z = UChat === null || UChat === void 0 ? void 0 : UChat.typingTextRef) !== null && _z !== void 0 ? _z : computed(() => {
|
|
273
256
|
var _a;
|
|
274
257
|
return (_a = props.typingText) !== null && _a !== void 0 ? _a : localeRef.value.typingText;
|
|
275
258
|
});
|
|
276
|
-
const closeButtonTextRef = (
|
|
259
|
+
const closeButtonTextRef = (_0 = UChat === null || UChat === void 0 ? void 0 : UChat.closeButtonTextRef) !== null && _0 !== void 0 ? _0 : computed(() => {
|
|
277
260
|
var _a;
|
|
278
261
|
return (_a = props.closeButtonText) !== null && _a !== void 0 ? _a : localeRef.value.closeButtonText;
|
|
279
262
|
});
|
|
280
|
-
const shareButtonTooltipRef = (
|
|
263
|
+
const shareButtonTooltipRef = (_1 = UChat === null || UChat === void 0 ? void 0 : UChat.shareButtonTooltipRef) !== null && _1 !== void 0 ? _1 : computed(() => {
|
|
281
264
|
var _a;
|
|
282
265
|
return (_a = props.shareButtonTooltip) !== null && _a !== void 0 ? _a : localeRef.value.shareButtonTooltip;
|
|
283
266
|
});
|
|
284
|
-
const profileButtonTooltipRef = (
|
|
267
|
+
const profileButtonTooltipRef = (_2 = UChat === null || UChat === void 0 ? void 0 : UChat.profileButtonTooltipRef) !== null && _2 !== void 0 ? _2 : computed(() => {
|
|
285
268
|
var _a;
|
|
286
269
|
return (_a = props.profileButtonTooltip) !== null && _a !== void 0 ? _a : localeRef.value.profileButtonTooltip;
|
|
287
270
|
});
|
|
288
|
-
const unreadNotificationTextRef = (
|
|
271
|
+
const unreadNotificationTextRef = (_3 = UChat === null || UChat === void 0 ? void 0 : UChat.unreadNotificationTextRef) !== null && _3 !== void 0 ? _3 : computed(() => {
|
|
289
272
|
var _a;
|
|
290
273
|
return (_a = props.unreadNotificationText) !== null && _a !== void 0 ? _a : localeRef.value.unreadNotificationText;
|
|
291
274
|
});
|
|
292
|
-
const notificationsShownSetRef = (
|
|
293
|
-
const unreadCountsBeforeReadRef = (
|
|
294
|
-
const markNotificationShown = (
|
|
275
|
+
const notificationsShownSetRef = (_4 = UChat === null || UChat === void 0 ? void 0 : UChat.notificationsShownSetRef) !== null && _4 !== void 0 ? _4 : ref(new Set());
|
|
276
|
+
const unreadCountsBeforeReadRef = (_5 = UChat === null || UChat === void 0 ? void 0 : UChat.unreadCountsBeforeReadRef) !== null && _5 !== void 0 ? _5 : ref({});
|
|
277
|
+
const markNotificationShown = (_6 = UChat === null || UChat === void 0 ? void 0 : UChat.markNotificationShown) !== null && _6 !== void 0 ? _6 : chatId => {
|
|
295
278
|
notificationsShownSetRef.value.add(chatId);
|
|
296
279
|
notificationsShownSetRef.value = new Set(notificationsShownSetRef.value);
|
|
297
280
|
};
|
|
298
|
-
const editMessageIdRef = (
|
|
299
|
-
const startEditingMessageRef = (
|
|
300
|
-
const bubbleActionsRef = (
|
|
301
|
-
const markdownRef = (
|
|
302
|
-
const markdownOptionsRef = (
|
|
303
|
-
const handleMessageSend = (
|
|
281
|
+
const editMessageIdRef = (_7 = UChat === null || UChat === void 0 ? void 0 : UChat.editMessageIdRef) !== null && _7 !== void 0 ? _7 : ref(null);
|
|
282
|
+
const startEditingMessageRef = (_8 = UChat === null || UChat === void 0 ? void 0 : UChat.startEditingMessage) !== null && _8 !== void 0 ? _8 : ref();
|
|
283
|
+
const bubbleActionsRef = (_9 = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) !== null && _9 !== void 0 ? _9 : toRef(props, 'bubbleActions');
|
|
284
|
+
const markdownRef = (_10 = UChat === null || UChat === void 0 ? void 0 : UChat.markdownRef) !== null && _10 !== void 0 ? _10 : toRef(props, 'markdown');
|
|
285
|
+
const markdownOptionsRef = (_11 = UChat === null || UChat === void 0 ? void 0 : UChat.markdownOptionsRef) !== null && _11 !== void 0 ? _11 : toRef(props, 'markdownOptions');
|
|
286
|
+
const handleMessageSend = (_12 = UChat === null || UChat === void 0 ? void 0 : UChat.handleMessageSend) !== null && _12 !== void 0 ? _12 : (content, attachments) => {
|
|
304
287
|
var _a;
|
|
305
288
|
return (_a = props.onMessageSend) === null || _a === void 0 ? void 0 : _a.call(props, content, attachments);
|
|
306
289
|
};
|
|
307
|
-
const handleMessageRetry = (
|
|
290
|
+
const handleMessageRetry = (_13 = UChat === null || UChat === void 0 ? void 0 : UChat.handleMessageRetry) !== null && _13 !== void 0 ? _13 : message => {
|
|
308
291
|
var _a;
|
|
309
292
|
return (_a = props.onMessageRetry) === null || _a === void 0 ? void 0 : _a.call(props, message);
|
|
310
293
|
};
|
|
311
|
-
const handleFooterInputChange = (
|
|
294
|
+
const handleFooterInputChange = (_14 = UChat === null || UChat === void 0 ? void 0 : UChat.handleFooterInputChange) !== null && _14 !== void 0 ? _14 : (value, chatId) => {
|
|
312
295
|
var _a;
|
|
313
296
|
return (_a = props.onFooterInputChange) === null || _a === void 0 ? void 0 : _a.call(props, value, chatId);
|
|
314
297
|
};
|
|
315
|
-
const onAttachmentUpload = (
|
|
316
|
-
const onChatClose = (
|
|
317
|
-
const onChatShare = (
|
|
318
|
-
const onUserProfile = (
|
|
319
|
-
const onMessagesScrollToTop = (
|
|
320
|
-
const onMessagesScrollToBottom = (
|
|
298
|
+
const onAttachmentUpload = (_15 = UChat === null || UChat === void 0 ? void 0 : UChat.onAttachmentUpload) !== null && _15 !== void 0 ? _15 : toRef(props, 'onAttachmentUpload');
|
|
299
|
+
const onChatClose = (_16 = UChat === null || UChat === void 0 ? void 0 : UChat.onChatClose) !== null && _16 !== void 0 ? _16 : toRef(props, 'onChatClose');
|
|
300
|
+
const onChatShare = (_17 = UChat === null || UChat === void 0 ? void 0 : UChat.onChatShare) !== null && _17 !== void 0 ? _17 : toRef(props, 'onChatShare');
|
|
301
|
+
const onUserProfile = (_18 = UChat === null || UChat === void 0 ? void 0 : UChat.onUserProfile) !== null && _18 !== void 0 ? _18 : toRef(props, 'onUserProfile');
|
|
302
|
+
const onMessagesScrollToTop = (_19 = UChat === null || UChat === void 0 ? void 0 : UChat.onMessagesScrollToTop) !== null && _19 !== void 0 ? _19 : toRef(props, 'onMessagesScrollToTop');
|
|
303
|
+
const onMessagesScrollToBottom = (_20 = UChat === null || UChat === void 0 ? void 0 : UChat.onMessagesScrollToBottom) !== null && _20 !== void 0 ? _20 : toRef(props, 'onMessagesScrollToBottom');
|
|
321
304
|
const cssVarsRef = computed(() => {
|
|
322
305
|
const {
|
|
323
306
|
common: {
|
|
@@ -397,9 +380,8 @@ export default defineComponent({
|
|
|
397
380
|
});
|
|
398
381
|
const themeClassHandle = useThemeClass('chat-main-area', computed(() => ''), cssVarsRef, props);
|
|
399
382
|
const messagesBodyRef = ref();
|
|
400
|
-
const
|
|
401
|
-
const
|
|
402
|
-
const handleInputValueChange = (_20 = UChat === null || UChat === void 0 ? void 0 : UChat.handleInputValueChange) !== null && _20 !== void 0 ? _20 : value => {
|
|
383
|
+
const uncontrolledInputValueRef = ref((_21 = props.inputValue) !== null && _21 !== void 0 ? _21 : '');
|
|
384
|
+
const handleInputValueChange = (_22 = UChat === null || UChat === void 0 ? void 0 : UChat.handleInputValueChange) !== null && _22 !== void 0 ? _22 : value => {
|
|
403
385
|
var _a;
|
|
404
386
|
uncontrolledInputValueRef.value = value;
|
|
405
387
|
(_a = props['onUpdate:inputValue']) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
@@ -426,10 +408,6 @@ export default defineComponent({
|
|
|
426
408
|
if (!messagesRef.value) return 0;
|
|
427
409
|
return messagesRef.value.filter(msg => !msg.isOwn && msg.status === MessageStatus.UNREAD).length;
|
|
428
410
|
});
|
|
429
|
-
const isTyping = computed(() => {
|
|
430
|
-
if (!selectedChatRef.value || !typingChatIdsRef.value) return false;
|
|
431
|
-
return typingChatIdsRef.value.includes(selectedChatRef.value.id);
|
|
432
|
-
});
|
|
433
411
|
const showNotificationManually = ref(false);
|
|
434
412
|
const hasUnreadMessages = ref(false);
|
|
435
413
|
const unreadCountOnOpen = ref(0);
|
|
@@ -558,147 +536,6 @@ export default defineComponent({
|
|
|
558
536
|
element.scrollTop = element.scrollHeight;
|
|
559
537
|
}
|
|
560
538
|
}
|
|
561
|
-
const toKeyString = value => {
|
|
562
|
-
if (typeof value === 'symbol') return value.toString();
|
|
563
|
-
if (typeof value === 'function') {
|
|
564
|
-
const result = value();
|
|
565
|
-
return typeof result === 'string' || typeof result === 'number' ? String(result) : '';
|
|
566
|
-
}
|
|
567
|
-
return value != null ? String(value) : '';
|
|
568
|
-
};
|
|
569
|
-
const renderHeader = () => {
|
|
570
|
-
const chat = selectedChatRef.value;
|
|
571
|
-
const keyId = toKeyString(chat === null || chat === void 0 ? void 0 : chat.id);
|
|
572
|
-
const keyTitle = toKeyString(chat === null || chat === void 0 ? void 0 : chat.title);
|
|
573
|
-
return h("div", {
|
|
574
|
-
class: `${mergedClsPrefixRef.value}-chat-main__header`
|
|
575
|
-
}, h("div", {
|
|
576
|
-
class: `${mergedClsPrefixRef.value}-chat-main__header-inner`
|
|
577
|
-
}, h("div", {
|
|
578
|
-
class: `${mergedClsPrefixRef.value}-chat-main__header-title-wrap`
|
|
579
|
-
}, h(UText, {
|
|
580
|
-
key: `${keyId}-${keyTitle}`,
|
|
581
|
-
variant: "heading-s-bold",
|
|
582
|
-
class: `${mergedClsPrefixRef.value}-chat-main__header-title`,
|
|
583
|
-
theme: mergedThemeRef.value.peers.Typography,
|
|
584
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.Typography
|
|
585
|
-
}, {
|
|
586
|
-
default: () => {
|
|
587
|
-
var _a, _b;
|
|
588
|
-
return (_b = (_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : '';
|
|
589
|
-
}
|
|
590
|
-
}), isTyping.value && h(UText, {
|
|
591
|
-
class: [`${mergedClsPrefixRef.value}-chat-main__header-subtitle`, 'typing'],
|
|
592
|
-
variant: "body-m-medium"
|
|
593
|
-
}, {
|
|
594
|
-
default: () => {
|
|
595
|
-
var _a;
|
|
596
|
-
return (_a = typingTextRef.value) !== null && _a !== void 0 ? _a : '';
|
|
597
|
-
}
|
|
598
|
-
})), h(UFlex, {
|
|
599
|
-
align: "center",
|
|
600
|
-
size: "small",
|
|
601
|
-
class: `${mergedClsPrefixRef.value}-chat-main__header-actions`
|
|
602
|
-
}, {
|
|
603
|
-
default: () => resolveSlot(slots.headerActions, () => {
|
|
604
|
-
const shareButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerShareButtonPropsRef.value);
|
|
605
|
-
const profileButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerProfileButtonPropsRef.value);
|
|
606
|
-
const closeButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerCloseButtonPropsRef.value);
|
|
607
|
-
const shareIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerShareIconPropsRef.value);
|
|
608
|
-
const profileIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerProfileIconPropsRef.value);
|
|
609
|
-
const buttons = [];
|
|
610
|
-
buttons.push(h(UTooltip, null, {
|
|
611
|
-
trigger: () => h(UButton, Object.assign({
|
|
612
|
-
secondary: true,
|
|
613
|
-
circle: true,
|
|
614
|
-
size: "large"
|
|
615
|
-
}, shareButtonProps, {
|
|
616
|
-
theme: mergedThemeRef.value.peers.Button,
|
|
617
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.Button,
|
|
618
|
-
onClick: () => {
|
|
619
|
-
var _a;
|
|
620
|
-
return (_a = onChatShare === null || onChatShare === void 0 ? void 0 : onChatShare.value) === null || _a === void 0 ? void 0 : _a.call(onChatShare);
|
|
621
|
-
}
|
|
622
|
-
}), {
|
|
623
|
-
default: () => h(UIcon, Object.assign({
|
|
624
|
-
size: 20
|
|
625
|
-
}, shareIconProps, {
|
|
626
|
-
theme: mergedThemeRef.value.peers.HeaderShareIcon,
|
|
627
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.HeaderShareIcon
|
|
628
|
-
}), {
|
|
629
|
-
default: () => h(ArrowHookUpRight, null)
|
|
630
|
-
})
|
|
631
|
-
}),
|
|
632
|
-
default: () => shareButtonTooltipRef.value
|
|
633
|
-
}));
|
|
634
|
-
buttons.push(h(UTooltip, null, {
|
|
635
|
-
trigger: () => h(UButton, Object.assign({
|
|
636
|
-
secondary: true,
|
|
637
|
-
circle: true,
|
|
638
|
-
size: "large"
|
|
639
|
-
}, profileButtonProps, {
|
|
640
|
-
theme: mergedThemeRef.value.peers.Button,
|
|
641
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.Button,
|
|
642
|
-
onClick: () => {
|
|
643
|
-
var _a;
|
|
644
|
-
return (_a = onUserProfile === null || onUserProfile === void 0 ? void 0 : onUserProfile.value) === null || _a === void 0 ? void 0 : _a.call(onUserProfile);
|
|
645
|
-
}
|
|
646
|
-
}), {
|
|
647
|
-
default: () => h(UIcon, Object.assign({
|
|
648
|
-
size: 20
|
|
649
|
-
}, profileIconProps, {
|
|
650
|
-
theme: mergedThemeRef.value.peers.HeaderProfileIcon,
|
|
651
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.HeaderProfileIcon
|
|
652
|
-
}), {
|
|
653
|
-
default: () => h(PersonNote, null)
|
|
654
|
-
})
|
|
655
|
-
}),
|
|
656
|
-
default: () => profileButtonTooltipRef.value
|
|
657
|
-
}));
|
|
658
|
-
buttons.push(h(UButton, Object.assign({
|
|
659
|
-
type: "primary",
|
|
660
|
-
size: "large",
|
|
661
|
-
round: true
|
|
662
|
-
}, closeButtonProps, {
|
|
663
|
-
theme: mergedThemeRef.value.peers.Button,
|
|
664
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.Button,
|
|
665
|
-
onClick: () => {
|
|
666
|
-
var _a;
|
|
667
|
-
return (_a = onChatClose === null || onChatClose === void 0 ? void 0 : onChatClose.value) === null || _a === void 0 ? void 0 : _a.call(onChatClose);
|
|
668
|
-
}
|
|
669
|
-
}), {
|
|
670
|
-
default: () => closeButtonTextRef.value
|
|
671
|
-
}));
|
|
672
|
-
return buttons;
|
|
673
|
-
})
|
|
674
|
-
})));
|
|
675
|
-
};
|
|
676
|
-
const renderMessages = () => {
|
|
677
|
-
var _a;
|
|
678
|
-
return h(UChatMessages, {
|
|
679
|
-
messages: messagesRef.value,
|
|
680
|
-
loading: messagesLoadingRef.value,
|
|
681
|
-
loadingCount: messagesLoadingCountRef.value,
|
|
682
|
-
typingChatIds: typingChatIdsRef.value,
|
|
683
|
-
selectedChatId: (_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.id,
|
|
684
|
-
typingText: typingTextRef.value,
|
|
685
|
-
retryText: retryTextRef.value,
|
|
686
|
-
uploadProps: messageUploadPropsRef.value,
|
|
687
|
-
showUnreadNotification: showUnreadNotification.value,
|
|
688
|
-
unreadNotificationText: unreadNotificationTextRef.value,
|
|
689
|
-
unreadNotificationCount: unreadCountOnOpen.value,
|
|
690
|
-
markdown: markdownRef.value,
|
|
691
|
-
markdownOptions: markdownOptionsRef.value,
|
|
692
|
-
onMessageRetry: handleMessageRetry
|
|
693
|
-
}, {
|
|
694
|
-
messageAttachment: slots.messageAttachment,
|
|
695
|
-
messageAttachmentTitle: slots.messageAttachmentTitle,
|
|
696
|
-
messageAttachmentSubtitle: slots.messageAttachmentSubtitle,
|
|
697
|
-
messageStatus: slots.messageStatus,
|
|
698
|
-
messageAfterContent: slots.messageAfterContent,
|
|
699
|
-
bubbleActions: slots.bubbleActions
|
|
700
|
-
});
|
|
701
|
-
};
|
|
702
539
|
const startEditingMessage = message => {
|
|
703
540
|
editingMessage.value = message;
|
|
704
541
|
if (editMessageIdRef) {
|
|
@@ -832,136 +669,25 @@ export default defineComponent({
|
|
|
832
669
|
};
|
|
833
670
|
}
|
|
834
671
|
};
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
}
|
|
842
|
-
default: () => {
|
|
843
|
-
var _a;
|
|
844
|
-
return h(UListItem, {
|
|
845
|
-
header: {
|
|
846
|
-
text: localeRef.value.editingTitle
|
|
847
|
-
},
|
|
848
|
-
description: {
|
|
849
|
-
text: ((_a = editingMessage.value) === null || _a === void 0 ? void 0 : _a.content) || ''
|
|
850
|
-
}
|
|
851
|
-
}, {
|
|
852
|
-
suffix: () => h(UButton, {
|
|
853
|
-
text: true,
|
|
854
|
-
circle: true,
|
|
855
|
-
size: "small",
|
|
856
|
-
onClick: cancelEditingMessage,
|
|
857
|
-
theme: mergedThemeRef.value.peers.Button,
|
|
858
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.Button
|
|
859
|
-
}, {
|
|
860
|
-
icon: () => h(UIcon, {
|
|
861
|
-
size: 16
|
|
862
|
-
}, {
|
|
863
|
-
default: () => h(CloseIcon, null)
|
|
864
|
-
})
|
|
865
|
-
})
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
}));
|
|
672
|
+
const uploadChangeRef = computed(() => handleOnChange());
|
|
673
|
+
const uploadFileListUpdateRef = computed(() => uploadChangeRef.value ? undefined : handleFileListUpdate);
|
|
674
|
+
const handleFooterUpdateValue = value => {
|
|
675
|
+
inputValue.value = value;
|
|
676
|
+
if (selectedChatRef.value) {
|
|
677
|
+
chatInputs.value[selectedChatRef.value.id] = value;
|
|
678
|
+
}
|
|
869
679
|
};
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}, h(UUpload, Object.assign({
|
|
874
|
-
abstract: true,
|
|
875
|
-
multiple: true,
|
|
876
|
-
defaultUpload: false,
|
|
877
|
-
fileList: attachmentFileList.value,
|
|
878
|
-
onUpdateFileList: !handleOnChange() ? handleFileListUpdate : undefined
|
|
879
|
-
}, footerUploadPropsRef.value, {
|
|
880
|
-
onChange: handleOnChange()
|
|
881
|
-
}), {
|
|
882
|
-
default: () => h(UFlex, {
|
|
883
|
-
align: "end",
|
|
884
|
-
size: "small",
|
|
885
|
-
wrap: false,
|
|
886
|
-
class: `${mergedClsPrefixRef.value}-chat-main__input-container`
|
|
887
|
-
}, {
|
|
888
|
-
default: () => h(Fragment, null, props.showAttachButton && h(UUploadTrigger, {
|
|
889
|
-
abstract: true
|
|
890
|
-
}, {
|
|
891
|
-
default: ({
|
|
892
|
-
handleClick
|
|
893
|
-
}) => {
|
|
894
|
-
var _a;
|
|
895
|
-
return h(UButton, Object.assign({
|
|
896
|
-
secondary: true,
|
|
897
|
-
size: "large",
|
|
898
|
-
class: `${mergedClsPrefixRef.value}-chat-main__attach-btn`
|
|
899
|
-
}, footerButtonPropsRef.value, {
|
|
900
|
-
disabled: ((_a = footerInputPropsRef.value) === null || _a === void 0 ? void 0 : _a.disabled) || !!(editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value),
|
|
901
|
-
theme: mergedThemeRef.value.peers.Button,
|
|
902
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.Button,
|
|
903
|
-
onClick: handleClick
|
|
904
|
-
}), {
|
|
905
|
-
default: () => h(UIcon, Object.assign({
|
|
906
|
-
size: 24
|
|
907
|
-
}, footerIconPropsRef.value, {
|
|
908
|
-
theme: mergedThemeRef.value.peers.FooterAttachIcon,
|
|
909
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.FooterAttachIcon
|
|
910
|
-
}), {
|
|
911
|
-
default: () => resolveSlot(slots.footerAttachIcon, () => [h(AttachIcon, null)])
|
|
912
|
-
})
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
}), h(UInput, Object.assign({
|
|
916
|
-
ref: "inputRef",
|
|
917
|
-
value: inputValue.value,
|
|
918
|
-
placeholder: inputPlaceholderRef.value,
|
|
919
|
-
class: `${mergedClsPrefixRef.value}-chat-main__input`,
|
|
920
|
-
theme: mergedThemeRef.value.peers.Input,
|
|
921
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.Input,
|
|
922
|
-
type: "textarea",
|
|
923
|
-
autosize: {
|
|
924
|
-
minRows: 1,
|
|
925
|
-
maxRows: 5
|
|
926
|
-
},
|
|
927
|
-
onUpdateValue: value => {
|
|
928
|
-
inputValue.value = value;
|
|
929
|
-
if (selectedChatRef.value) {
|
|
930
|
-
chatInputs.value[selectedChatRef.value.id] = value;
|
|
931
|
-
}
|
|
932
|
-
},
|
|
933
|
-
onKeydown: e => {
|
|
934
|
-
var _a, _b;
|
|
935
|
-
(_b = (_a = footerInputPropsRef.value) === null || _a === void 0 ? void 0 : _a.onKeydown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
936
|
-
if (e.key === 'Enter' && !e.shiftKey) {
|
|
937
|
-
e.preventDefault();
|
|
938
|
-
e.stopPropagation();
|
|
939
|
-
void handleSendMessage();
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
}, safeFooterInputPropsRef.value), {
|
|
943
|
-
prefix: () => renderEditingBlock(),
|
|
944
|
-
suffix: () => h(UIcon, Object.assign({
|
|
945
|
-
size: 24,
|
|
946
|
-
class: `${mergedClsPrefixRef.value}-chat-main__input-suffix`
|
|
947
|
-
}, footerSuffixIconPropsRef.value, {
|
|
948
|
-
theme: mergedThemeRef.value.peers.FooterSuffixIcon,
|
|
949
|
-
themeOverrides: mergedThemeRef.value.peerOverrides.FooterSuffixIcon,
|
|
950
|
-
onClick: () => {
|
|
951
|
-
void handleSendMessage();
|
|
952
|
-
}
|
|
953
|
-
}), {
|
|
954
|
-
default: () => resolveSlot(slots.footerSuffixIcon, () => [h(SendFilled, null)])
|
|
955
|
-
})
|
|
956
|
-
}))
|
|
957
|
-
})
|
|
958
|
-
}));
|
|
680
|
+
const handleFooterSend = value => {
|
|
681
|
+
handleFooterUpdateValue(value);
|
|
682
|
+
void handleSendMessage();
|
|
959
683
|
};
|
|
960
684
|
if (isStandalone) {
|
|
961
685
|
provide(chatInjectionKey, {
|
|
962
686
|
mergedClsPrefixRef,
|
|
963
687
|
mergedThemeRef,
|
|
964
688
|
selectedChatRef,
|
|
689
|
+
legacyInputRef,
|
|
690
|
+
disabledRef,
|
|
965
691
|
inputValueRef: inputValue,
|
|
966
692
|
handleInputValueChange,
|
|
967
693
|
messagesRef,
|
|
@@ -988,6 +714,8 @@ export default defineComponent({
|
|
|
988
714
|
shareButtonTooltipRef,
|
|
989
715
|
profileButtonTooltipRef,
|
|
990
716
|
unreadNotificationTextRef,
|
|
717
|
+
markdownRef,
|
|
718
|
+
markdownOptionsRef,
|
|
991
719
|
notificationsShownSetRef,
|
|
992
720
|
unreadCountsBeforeReadRef,
|
|
993
721
|
markNotificationShown,
|
|
@@ -1013,17 +741,20 @@ export default defineComponent({
|
|
|
1013
741
|
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
1014
742
|
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
1015
743
|
isStandalone,
|
|
1016
|
-
renderHeader,
|
|
1017
|
-
renderMessages,
|
|
1018
|
-
renderEditingBlock,
|
|
1019
|
-
renderFooter,
|
|
1020
744
|
messagesBodyRef,
|
|
1021
|
-
inputRef,
|
|
1022
745
|
inputValue,
|
|
746
|
+
attachmentFileList,
|
|
747
|
+
editingMessage,
|
|
748
|
+
showUnreadNotification,
|
|
749
|
+
unreadCountOnOpen,
|
|
750
|
+
uploadChange: uploadChangeRef,
|
|
751
|
+
uploadFileListUpdate: uploadFileListUpdateRef,
|
|
1023
752
|
handleSendMessage,
|
|
753
|
+
handleFooterUpdateValue,
|
|
754
|
+
handleFooterSend,
|
|
755
|
+
cancelEditingMessage,
|
|
1024
756
|
handleMessagesScroll,
|
|
1025
|
-
scrollToBottom
|
|
1026
|
-
editingMessage
|
|
757
|
+
scrollToBottom
|
|
1027
758
|
};
|
|
1028
759
|
},
|
|
1029
760
|
render() {
|
|
@@ -1034,13 +765,38 @@ export default defineComponent({
|
|
|
1034
765
|
} = this;
|
|
1035
766
|
const mainArea = h("div", {
|
|
1036
767
|
class: [`${mergedClsPrefix}-chat-main`, this.isStandalone && `${mergedClsPrefix}-chat-main--standalone`]
|
|
1037
|
-
}, !this.isStandalone &&
|
|
768
|
+
}, !this.isStandalone && h(ChatHeader, null, {
|
|
769
|
+
actions: this.$slots.headerActions
|
|
770
|
+
}), h(USafeTopScrollbar, {
|
|
1038
771
|
ref: "messagesBodyRef",
|
|
1039
772
|
class: `${mergedClsPrefix}-chat-main__body`,
|
|
1040
773
|
onScroll: this.handleMessagesScroll
|
|
1041
774
|
}, {
|
|
1042
|
-
default: () =>
|
|
1043
|
-
|
|
775
|
+
default: () => h(ChatMessagesArea, {
|
|
776
|
+
showUnreadNotification: this.showUnreadNotification,
|
|
777
|
+
unreadNotificationCount: this.unreadCountOnOpen
|
|
778
|
+
}, {
|
|
779
|
+
messageAttachment: this.$slots.messageAttachment,
|
|
780
|
+
messageAttachmentTitle: this.$slots.messageAttachmentTitle,
|
|
781
|
+
messageAttachmentSubtitle: this.$slots.messageAttachmentSubtitle,
|
|
782
|
+
messageStatus: this.$slots.messageStatus,
|
|
783
|
+
messageAfterContent: this.$slots.messageAfterContent,
|
|
784
|
+
bubbleActions: this.$slots.bubbleActions
|
|
785
|
+
})
|
|
786
|
+
}), h(ChatFooter, {
|
|
787
|
+
value: this.inputValue,
|
|
788
|
+
editingMessage: this.editingMessage,
|
|
789
|
+
showAttachButton: this.showAttachButton,
|
|
790
|
+
fileList: this.attachmentFileList,
|
|
791
|
+
onUpdateFileList: this.uploadFileListUpdate,
|
|
792
|
+
onUploadChange: this.uploadChange,
|
|
793
|
+
onUpdateValue: this.handleFooterUpdateValue,
|
|
794
|
+
onSend: this.handleFooterSend,
|
|
795
|
+
onCancelEditing: this.cancelEditingMessage
|
|
796
|
+
}, {
|
|
797
|
+
attachIcon: this.$slots.footerAttachIcon,
|
|
798
|
+
suffixIcon: this.$slots.footerSuffixIcon
|
|
799
|
+
}));
|
|
1044
800
|
if (!this.isStandalone) {
|
|
1045
801
|
return mainArea;
|
|
1046
802
|
}
|