tuikit-atomicx-vue3 3.3.0-beta.3 → 3.3.1
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/AttachmentPicker.module-BesmtGyl.js +11 -0
- package/dist/FilePicker.vue_vue_type_script_setup_true_lang-CdJ4DUzE.js +76 -0
- package/dist/ImagePicker.vue_vue_type_script_setup_true_lang-CbNUofpK.js +76 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-XRL7A5Gj.js → MessageInput.vue_vue_type_script_setup_true_lang-wUJPjWbx.js} +23 -18
- package/dist/VideoPicker.vue_vue_type_script_setup_true_lang-CmxjbNDJ.js +76 -0
- package/dist/chat/index.d.ts +3747 -2386
- package/dist/chat/index.js +12 -11
- package/dist/components/BarrageInput/BarrageInputH5.js +32 -8
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +9 -5
- package/dist/components/BarrageInput/TextEditor/index.js +14 -6
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +4 -4
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +12 -4
- package/dist/components/BarrageList/i18n/en-US/index.d.ts +1 -0
- package/dist/components/BarrageList/i18n/en-US/index.js +2 -1
- package/dist/components/BarrageList/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/BarrageList/i18n/zh-CN/index.js +2 -1
- package/dist/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.js +5 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupChatSetting.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupInfo/GroupInfo.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupMembers/GroupMembers.js +3 -3
- package/dist/components/ChatSetting/SettingItem/SettingItem.js +21 -21
- package/dist/components/ChatSetting/i18n/en-US.js +3 -3
- package/dist/components/ChatSetting/i18n/zh-CN.js +3 -3
- package/dist/components/ChatSetting/index.d.ts +1 -4
- package/dist/components/ChatSetting/index.js +3 -6
- package/dist/components/CoGuestPanel/CoGuestPanel.js +1 -1
- package/dist/components/ContactList/ContactInfo/ContactInfo.js +17 -17
- package/dist/components/ContactList/ContactInfo/ContactInfo.vue.d.ts +26 -2
- package/dist/components/ContactList/ContactInfo/GroupInfo/GroupInfo.js +2 -1
- package/dist/components/ContactList/ContactList.js +19 -10
- package/dist/components/ContactList/ContactList.vue.d.ts +109 -1
- package/dist/components/ContactList/index.d.ts +158 -26
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +8 -9
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +2 -1
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.js +8 -8
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.js +1 -2
- package/dist/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.js +8 -8
- package/dist/components/ConversationList/ConversationList.js +18 -44
- package/dist/components/ConversationList/ConversationList.vue.d.ts +197 -1535
- package/dist/components/ConversationList/ConversationListContent/ConversationListContent.js +8 -11
- package/dist/components/ConversationList/ConversationListContent/ConversationListContent.vue.d.ts +22 -340
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +80 -134
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +19 -30
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +0 -2
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +14 -15
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +12 -24
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/index.d.ts +1 -1
- package/dist/components/ConversationList/ConversationPreview/index.js +17 -21
- package/dist/components/ConversationList/ConversationSearch/ConversationSearch.js +1 -0
- package/dist/components/ConversationList/index.d.ts +468 -2400
- package/dist/components/ConversationList/index.js +1 -1
- package/dist/components/LiveAudienceList/LiveAudienceListH5.js +1 -1
- package/dist/components/LiveCoreView/index.js +113 -58
- package/dist/components/LiveCoreView/index.vue.d.ts +9 -0
- package/dist/components/LiveList/LiveList.js +7 -5
- package/dist/components/LiveList/LiveListH5.js +77 -71
- package/dist/components/LiveList/i18n/en-US/index.d.ts +5 -0
- package/dist/components/LiveList/i18n/en-US/index.js +6 -1
- package/dist/components/LiveList/i18n/zh-CN/index.d.ts +5 -0
- package/dist/components/LiveList/i18n/zh-CN/index.js +6 -1
- package/dist/components/LiveList/pullToRefresh.js +204 -0
- package/dist/components/LiveList/pullToRefresh.vue.d.ts +86 -0
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +6 -5
- package/dist/components/LiveScenePanel/index.js +3 -3
- package/dist/components/MessageInput/AttachmentPicker/AttachmentPicker.vue.d.ts +0 -4
- package/dist/components/MessageInput/AttachmentPicker/FilePicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/ImagePicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/VideoPicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/index.js +14 -19
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +3 -3
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/MessageInput.vue.d.ts +6 -9
- package/dist/components/MessageInput/TextEditor/TextEditor.vue.d.ts +2 -2
- package/dist/components/MessageInput/TextEditor/index.js +18 -9
- package/dist/components/MessageInput/index.d.ts +5 -41
- package/dist/components/MessageInput/index.js +4 -4
- package/dist/components/MessageList/Message/CustomMessage/index.js +2 -2
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.js +7 -5
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.vue.d.ts +8 -8
- package/dist/components/MessageList/Message/LocationMessage/LocationMessage.js +2 -1
- package/dist/components/MessageList/Message/MergerMessage/MergerMessage.js +2 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +12 -4
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue.d.ts +3 -3
- package/dist/components/MessageList/MessageForward/MessageForward.js +2 -3
- package/dist/components/MessageList/MessageList.js +14 -7
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/MessageTimeDivider/MessageTimeDivider.js +5 -5
- package/dist/components/MessageList/MessageTimeDivider/MessageTimeDivider.vue.d.ts +10 -10
- package/dist/components/MessageList/index.d.ts +143 -5
- package/dist/components/MessageList/index.js +5 -5
- package/dist/components/Search/Search.js +1 -3
- package/dist/components/Search/SearchResults/EmptyResult/EmptyResult.js +4 -6
- package/dist/components/Search/SearchResults/Loading/Loading.js +2 -4
- package/dist/components/Search/SearchResults/SearchResults.js +20 -22
- package/dist/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.js +6 -8
- package/dist/components/Search/SearchResults/SearchResultsItem/Group/Group.js +5 -7
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +19 -21
- package/dist/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.js +1 -3
- package/dist/components/Search/SearchResults/SearchResultsItem/User/User.js +5 -7
- package/dist/components/StreamMixer/LocalMixer/index.js +11 -5
- package/dist/components/StreamView/manager/mediaManager.js +1 -1
- package/dist/components/UserPicker/UserPicker.js +2 -2
- package/dist/components/UserPicker/UserPicker.vue.d.ts +7 -8
- package/dist/components/UserPicker/components/ListMode/ListMode.js +14 -17
- package/dist/components/UserPicker/components/ListMode/ListMode.vue.d.ts +2 -2
- package/dist/components/UserPicker/components/SelectedPanel/SelectedPanel.vue.d.ts +2 -2
- package/dist/components/UserPicker/components/TreeMode/TreeMode.vue.d.ts +3 -3
- package/dist/components/UserPicker/components/TreeMode/TreeNode.vue.d.ts +4 -4
- package/dist/components/UserPicker/hooks/useSearchFilter.d.ts +3 -3
- package/dist/components/UserPicker/hooks/useSelection.d.ts +8 -8
- package/dist/components/UserPicker/hooks/useTreeState.d.ts +3 -3
- package/dist/components/UserPicker/index.d.ts +134 -3
- package/dist/components/UserPicker/index.js +3 -2
- package/dist/components/UserPicker/type.d.ts +18 -18
- package/dist/index.js +6 -3
- package/dist/rtc/index.d.ts +9 -0
- package/dist/states/GroupSettingState/GroupSettingState.js +3 -3
- package/dist/states/LiveSeatState/usePlayStream/MixStreamPlayer.js +3 -0
- package/dist/states/LoginState.js +1 -0
- package/dist/states/MessageInputState/MessageInputState.js +25 -5
- package/dist/styles/index.css +1294 -3578
- package/dist/types/contact.d.ts +13 -12
- package/dist/types/conversation.d.ts +12 -14
- package/dist/types/engine.d.ts +12 -0
- package/dist/types/engine.js +15 -0
- package/dist/types/index.js +2 -1
- package/dist/utils/json.js +0 -1
- package/package.json +7 -3
- package/src/chat/index.ts +12 -4
- package/src/components/BarrageInput/BarrageInputH5.vue +50 -4
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.module.scss +1 -0
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
- package/src/components/BarrageInput/TextEditor/Editor.scss +1 -1
- package/src/components/BarrageInput/TextEditor/TextEditor.module.scss +2 -0
- package/src/components/BarrageInput/TextEditor/TextEditor.vue +6 -0
- package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +8 -8
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +10 -0
- package/src/components/BarrageList/i18n/en-US/index.ts +1 -0
- package/src/components/BarrageList/i18n/zh-CN/index.ts +1 -0
- package/src/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.vue +5 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupChatSetting.vue +5 -4
- package/src/components/ChatSetting/GroupChatSetting/GroupInfo/GroupInfo.vue +2 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.vue +3 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupMembers/GroupMembers.vue +3 -3
- package/src/components/ChatSetting/SettingItem/SettingItem.vue +10 -7
- package/src/components/ChatSetting/i18n/en-US.ts +3 -3
- package/src/components/ChatSetting/i18n/zh-CN.ts +3 -3
- package/src/components/ChatSetting/index.ts +3 -3
- package/src/components/CoGuestPanel/CoGuestPanel.vue +9 -0
- package/src/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/ContactInfo.vue +17 -9
- package/src/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/FriendInfo/FriendInfo.scss +4 -3
- package/src/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.vue +1 -0
- package/src/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.scss +2 -2
- package/src/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.scss +3 -2
- package/src/components/ContactList/ContactList.scss +2 -1
- package/src/components/ContactList/ContactList.vue +18 -3
- package/src/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.scss +3 -3
- package/src/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.scss +5 -6
- package/src/components/ContactList/ContactListItem/FriendItem/FriendItem.scss +3 -3
- package/src/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.scss +5 -6
- package/src/components/ContactList/ContactListItem/GroupItem/GroupItem.scss +3 -3
- package/src/components/ConversationList/ConversationActions/ConversationActions.scss +2 -12
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +2 -2
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +1 -0
- package/src/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.scss +2 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.vue +2 -2
- package/src/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.scss +2 -1
- package/src/components/ConversationList/ConversationList.scss +0 -5
- package/src/components/ConversationList/ConversationList.vue +15 -41
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +1 -0
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.vue +13 -18
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +11 -9
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.vue +14 -16
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +2 -14
- package/src/components/ConversationList/ConversationPreview/index.ts +1 -1
- package/src/components/ConversationList/ConversationSearch/ConversationSearch.vue +1 -0
- package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
- package/src/components/LiveCoreView/index.vue +145 -79
- package/src/components/LiveList/LiveList.vue +3 -0
- package/src/components/LiveList/LiveListH5.vue +60 -85
- package/src/components/LiveList/i18n/en-US/index.ts +5 -0
- package/src/components/LiveList/i18n/zh-CN/index.ts +5 -0
- package/src/components/LiveList/pullToRefresh.vue +364 -0
- package/src/components/LiveScenePanel/CameraSettingDialog.vue +6 -5
- package/src/components/LiveScenePanel/index.vue +2 -2
- package/src/components/MessageInput/AttachmentPicker/AttachmentPicker.module.scss +4 -0
- package/src/components/MessageInput/AttachmentPicker/AttachmentPicker.vue +12 -17
- package/src/components/MessageInput/AttachmentPicker/FilePicker.vue +3 -2
- package/src/components/MessageInput/AttachmentPicker/ImagePicker.vue +3 -2
- package/src/components/MessageInput/AttachmentPicker/VideoPicker.vue +3 -2
- package/src/components/MessageInput/EmojiPicker/EmojiPicker.module.scss +1 -0
- package/src/components/MessageInput/MessageInput.vue +21 -15
- package/src/components/MessageInput/TextEditor/Editor.scss +1 -0
- package/src/components/MessageInput/TextEditor/TextEditor.vue +16 -6
- package/src/components/MessageInput/types.d.ts +3 -4
- package/src/components/MessageList/Message/CustomMessage/CustomMessage.vue +1 -1
- package/src/components/MessageList/Message/FaceMessage/FaceMessage.vue +10 -7
- package/src/components/MessageList/Message/LocationMessage/LocationMessage.vue +3 -1
- package/src/components/MessageList/Message/MergerMessage/MergerMessage.vue +1 -1
- package/src/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue +2 -2
- package/src/components/MessageList/MessageForward/MessageForward.vue +3 -3
- package/src/components/MessageList/MessageList.vue +17 -5
- package/src/components/MessageList/MessageTimeDivider/MessageTimeDivider.vue +9 -9
- package/src/components/MessageList/index.ts +5 -4
- package/src/components/Search/Search.scss +0 -3
- package/src/components/Search/SearchResults/EmptyResult/EmptyResult.scss +0 -3
- package/src/components/Search/SearchResults/Loading/Loading.scss +0 -3
- package/src/components/Search/SearchResults/SearchResults.scss +7 -16
- package/src/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/Group/Group.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.scss +0 -3
- package/src/components/Search/SearchResults/SearchResultsItem/User/User.scss +5 -6
- package/src/components/StreamMixer/LocalMixer/index.vue +9 -4
- package/src/components/StreamView/manager/mediaManager.ts +1 -1
- package/src/components/UserPicker/UserPicker.vue +6 -9
- package/src/components/UserPicker/components/ListMode/ListMode.vue +3 -7
- package/src/components/UserPicker/components/SelectedPanel/SelectedPanel.vue +2 -2
- package/src/components/UserPicker/components/TreeMode/TreeMode.vue +3 -3
- package/src/components/UserPicker/components/TreeMode/TreeNode.vue +3 -3
- package/src/components/UserPicker/hooks/useSearchFilter.ts +15 -14
- package/src/components/UserPicker/hooks/useSelection.ts +32 -32
- package/src/components/UserPicker/hooks/useTreeState.ts +4 -4
- package/src/components/UserPicker/index.ts +16 -14
- package/src/components/UserPicker/type.ts +18 -18
- package/src/types/contact.ts +13 -12
- package/src/types/conversation.ts +12 -14
- package/src/types/engine.ts +15 -0
- package/src/utils/json.ts +0 -4
- package/dist/AttachmentPicker.module-0_DWsAtr.js +0 -11
- package/dist/FilePicker.vue_vue_type_script_setup_true_lang-CaSj3Gh_.js +0 -72
- package/dist/ImagePicker.vue_vue_type_script_setup_true_lang-CrzGMmrh.js +0 -72
- package/dist/VideoPicker.vue_vue_type_script_setup_true_lang-DTv6TJKr.js +0 -72
- package/dist/states/UIOpenControlState/UIOpenControlState.d.ts +0 -15
- package/dist/states/UIOpenControlState/UIOpenControlState.js +0 -28
- package/dist/states/UIOpenControlState/index.d.ts +0 -1
- package/dist/states/UIOpenControlState/index.js +0 -4
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="pull-to-refresh"
|
|
4
|
+
@touchstart="onTouchStart"
|
|
5
|
+
@touchmove="onTouchMove"
|
|
6
|
+
@touchend="onTouchEnd"
|
|
7
|
+
@touchcancel="onTouchEnd"
|
|
8
|
+
>
|
|
9
|
+
<!-- Refresh indicator -->
|
|
10
|
+
<div
|
|
11
|
+
class="refresh-indicator"
|
|
12
|
+
:class="[refreshState, { visible: isIndicatorVisible }]"
|
|
13
|
+
:style="{ transform: `translateY(${translateY}px)` }"
|
|
14
|
+
>
|
|
15
|
+
<!-- refresh-arrow -->
|
|
16
|
+
<IconArrowUpNew
|
|
17
|
+
v-if="refreshState !== RefreshState.Loading && refreshState !== RefreshState.Success && refreshState !== RefreshState.Error"
|
|
18
|
+
class="refresh-arrow"
|
|
19
|
+
:class="{ releasing: refreshState === RefreshState.Releasing }"
|
|
20
|
+
:size="16"
|
|
21
|
+
/>
|
|
22
|
+
<!-- refresh-loading -->
|
|
23
|
+
<div v-if="refreshState === RefreshState.Loading" class="refresh-loading"></div>
|
|
24
|
+
<!-- refresh-success -->
|
|
25
|
+
<IconCheck v-if="refreshState === RefreshState.Success" class="refresh-success" :size="16" />
|
|
26
|
+
<!-- refresh-error -->
|
|
27
|
+
<IconErrorToast v-if="refreshState === RefreshState.Error" class="refresh-error" :size="16" />
|
|
28
|
+
<!-- refresh-text -->
|
|
29
|
+
<span class="refresh-text">{{ statusText }}</span>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<!-- Content slot -->
|
|
33
|
+
<div ref="contentRef" class="refresh-content" :style="{ transform: `translateY(${contentTranslateY}px)` }"
|
|
34
|
+
@scroll="handleScroll"
|
|
35
|
+
@wheel="handleWheel">
|
|
36
|
+
<slot></slot>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script lang="ts" setup>
|
|
42
|
+
import { ref, computed } from 'vue';
|
|
43
|
+
import { IconCheck, IconArrowUpNew, IconErrorToast } from '@tencentcloud/uikit-base-component-vue3';
|
|
44
|
+
|
|
45
|
+
interface Props {
|
|
46
|
+
threshold?: number;
|
|
47
|
+
resistance?: number;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
resultDuration?: number;
|
|
50
|
+
text?: {
|
|
51
|
+
pull: string;
|
|
52
|
+
release: string;
|
|
53
|
+
loading: string;
|
|
54
|
+
success: string;
|
|
55
|
+
error: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Pull-to-refresh state enumeration
|
|
61
|
+
* Defines the various states that the component can be in during the entire pull-to-refresh flow
|
|
62
|
+
*/
|
|
63
|
+
enum RefreshState {
|
|
64
|
+
/**
|
|
65
|
+
* Pulling state
|
|
66
|
+
* - User is dragging down but hasn't reached the refresh threshold yet
|
|
67
|
+
* - Shows down arrow icon, indicating user can continue pulling down
|
|
68
|
+
* - Content area follows finger movement, providing visual feedback
|
|
69
|
+
*/
|
|
70
|
+
Pulling = 'pulling',
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Releasing state
|
|
74
|
+
* - User has pulled down to or beyond the threshold (props.threshold)
|
|
75
|
+
* - Shows up arrow icon, indicating user can release to trigger refresh
|
|
76
|
+
* - Releasing at this point will immediately enter refresh state
|
|
77
|
+
*/
|
|
78
|
+
Releasing = 'releasing',
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Loading state
|
|
82
|
+
* - Component enters refresh state after user releases
|
|
83
|
+
* - Shows loading animation (spinning circle)
|
|
84
|
+
* - Content area stays at threshold height, displaying refresh indicator
|
|
85
|
+
* - Parent component starts executing actual refresh logic
|
|
86
|
+
*/
|
|
87
|
+
Loading = 'loading',
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Success state
|
|
91
|
+
* - Parent component refresh operation completed successfully
|
|
92
|
+
* - Shows green checkmark icon and success text
|
|
93
|
+
* - Content area stays at threshold height, displaying success indicator
|
|
94
|
+
* - Automatically resets after displaying for props.resultDuration time
|
|
95
|
+
*/
|
|
96
|
+
Success = 'success',
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Error state
|
|
100
|
+
* - Parent component refresh operation failed (e.g., network error, API exception)
|
|
101
|
+
* - Shows red error icon and failure text
|
|
102
|
+
* - Content area stays at threshold height, displaying error indicator
|
|
103
|
+
* - Automatically resets after displaying for props.resultDuration time
|
|
104
|
+
*/
|
|
105
|
+
Error = 'error',
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const refreshState = ref(RefreshState.Pulling);
|
|
109
|
+
const startY = ref(0);
|
|
110
|
+
const currentY = ref(0);
|
|
111
|
+
const isTouching = ref(false);
|
|
112
|
+
const contentRef = ref<HTMLElement | null>(null);
|
|
113
|
+
let timer: number | null = null;
|
|
114
|
+
|
|
115
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
116
|
+
threshold: 60,
|
|
117
|
+
resistance: 2.5,
|
|
118
|
+
disabled: false,
|
|
119
|
+
resultDuration: 500,
|
|
120
|
+
text: () => ({
|
|
121
|
+
pull: 'Pull to refresh',
|
|
122
|
+
release: 'Release to refresh',
|
|
123
|
+
loading: 'Loading...',
|
|
124
|
+
success: 'Refresh success',
|
|
125
|
+
error: 'Refresh failed',
|
|
126
|
+
}),
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const emit = defineEmits<{
|
|
130
|
+
refresh: [completeRefresh: (success?: boolean) => void];
|
|
131
|
+
loadMore: [];
|
|
132
|
+
}>();
|
|
133
|
+
|
|
134
|
+
defineExpose({
|
|
135
|
+
completeRefresh,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const pullDistance = computed(() => {
|
|
139
|
+
if (refreshState.value === RefreshState.Loading) {
|
|
140
|
+
return props.threshold;
|
|
141
|
+
}
|
|
142
|
+
if (!isTouching.value) return 0;
|
|
143
|
+
return Math.max(0, (currentY.value - startY.value) / props.resistance);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const contentTranslateY = computed(() => {
|
|
147
|
+
if (refreshState.value === RefreshState.Loading || refreshState.value === RefreshState.Success || refreshState.value === RefreshState.Error) {
|
|
148
|
+
return props.threshold;
|
|
149
|
+
}
|
|
150
|
+
return Math.min(pullDistance.value, props.threshold);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const translateY = computed(() => {
|
|
154
|
+
if (refreshState.value === RefreshState.Loading || refreshState.value === RefreshState.Success || refreshState.value === RefreshState.Error) {
|
|
155
|
+
return 0;
|
|
156
|
+
}
|
|
157
|
+
return Math.min(pullDistance.value, props.threshold) - props.threshold;
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const isIndicatorVisible = computed(() => {
|
|
161
|
+
if (refreshState.value === RefreshState.Loading || refreshState.value === RefreshState.Success || refreshState.value === RefreshState.Error) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
return pullDistance.value > 10;
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const statusText = computed(() => {
|
|
168
|
+
switch (refreshState.value) {
|
|
169
|
+
case RefreshState.Releasing:
|
|
170
|
+
return props.text.release;
|
|
171
|
+
case RefreshState.Loading:
|
|
172
|
+
return props.text.loading;
|
|
173
|
+
case RefreshState.Success:
|
|
174
|
+
return props.text.success;
|
|
175
|
+
case RefreshState.Error:
|
|
176
|
+
return props.text.error;
|
|
177
|
+
default:
|
|
178
|
+
return props.text.pull;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
function isScrollAtBottom(threshold = 50) {
|
|
183
|
+
if (!contentRef.value) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
contentRef.value.scrollTop + contentRef.value.clientHeight >=
|
|
189
|
+
contentRef.value.scrollHeight - threshold
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function handleWheel(event: WheelEvent) {
|
|
194
|
+
if (!contentRef.value) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (event.deltaY > 0 && isScrollAtBottom()) {
|
|
199
|
+
emit('loadMore');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function handleScroll() {
|
|
204
|
+
if (!contentRef.value) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (isScrollAtBottom()) {
|
|
209
|
+
emit('loadMore');
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function checkIsAtTop() {
|
|
214
|
+
if (!contentRef.value) return true;
|
|
215
|
+
return contentRef.value.scrollTop === 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function onTouchStart(event: TouchEvent) {
|
|
219
|
+
if (props.disabled || refreshState.value === RefreshState.Loading) return;
|
|
220
|
+
if (!checkIsAtTop()) return;
|
|
221
|
+
|
|
222
|
+
isTouching.value = true;
|
|
223
|
+
startY.value = event.touches[0].clientY;
|
|
224
|
+
currentY.value = startY.value;
|
|
225
|
+
refreshState.value = RefreshState.Pulling;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function onTouchMove(event: TouchEvent) {
|
|
229
|
+
if (!isTouching.value || props.disabled || refreshState.value === RefreshState.Loading) return;
|
|
230
|
+
currentY.value = event.touches[0].clientY;
|
|
231
|
+
|
|
232
|
+
if (pullDistance.value > 0 && checkIsAtTop()) {
|
|
233
|
+
event.preventDefault();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
refreshState.value = pullDistance.value > props.threshold ? RefreshState.Releasing : RefreshState.Pulling;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function onTouchEnd() {
|
|
240
|
+
if (!isTouching.value || props.disabled) return;
|
|
241
|
+
isTouching.value = false;
|
|
242
|
+
|
|
243
|
+
if (refreshState.value === RefreshState.Loading) return;
|
|
244
|
+
|
|
245
|
+
if (refreshState.value === RefreshState.Releasing) {
|
|
246
|
+
startRefresh();
|
|
247
|
+
} else {
|
|
248
|
+
resetPullState();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function startRefresh() {
|
|
253
|
+
refreshState.value = RefreshState.Loading;
|
|
254
|
+
emit('refresh', completeRefresh);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function completeRefresh(success: boolean = true) {
|
|
258
|
+
refreshState.value = success ? RefreshState.Success : RefreshState.Error;
|
|
259
|
+
|
|
260
|
+
if (timer) {
|
|
261
|
+
clearTimeout(timer);
|
|
262
|
+
}
|
|
263
|
+
timer = setTimeout(() => {
|
|
264
|
+
resetPullState();
|
|
265
|
+
}, props.resultDuration) as unknown as number;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function resetPullState() {
|
|
269
|
+
startY.value = 0;
|
|
270
|
+
currentY.value = 0;
|
|
271
|
+
if (refreshState.value !== RefreshState.Loading) {
|
|
272
|
+
refreshState.value = RefreshState.Pulling;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
</script>
|
|
276
|
+
|
|
277
|
+
<style lang="scss" scoped>
|
|
278
|
+
.pull-to-refresh {
|
|
279
|
+
position: relative;
|
|
280
|
+
width: 100%;
|
|
281
|
+
height: 100%;
|
|
282
|
+
overflow: hidden;
|
|
283
|
+
touch-action: pan-y;
|
|
284
|
+
|
|
285
|
+
.refresh-indicator {
|
|
286
|
+
position: absolute;
|
|
287
|
+
top: 0;
|
|
288
|
+
left: 0;
|
|
289
|
+
width: 100%;
|
|
290
|
+
height: v-bind('props.threshold + "px"');
|
|
291
|
+
display: flex;
|
|
292
|
+
justify-content: center;
|
|
293
|
+
align-items: center;
|
|
294
|
+
color: #666;
|
|
295
|
+
font-size: 14px;
|
|
296
|
+
opacity: 0;
|
|
297
|
+
transition: opacity 0.2s;
|
|
298
|
+
background-color: transparent;
|
|
299
|
+
z-index: 10;
|
|
300
|
+
|
|
301
|
+
&.visible {
|
|
302
|
+
opacity: 1;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.refresh-arrow {
|
|
306
|
+
width: 16px;
|
|
307
|
+
height: 16px;
|
|
308
|
+
margin-right: 8px;
|
|
309
|
+
rotate: 180deg;
|
|
310
|
+
transition: transform 0.3s;
|
|
311
|
+
fill: currentColor;
|
|
312
|
+
|
|
313
|
+
&.releasing {
|
|
314
|
+
transform: rotate(180deg);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.refresh-loading {
|
|
319
|
+
width: 18px;
|
|
320
|
+
height: 18px;
|
|
321
|
+
margin-right: 8px;
|
|
322
|
+
border: 2px solid #e0e0e0;
|
|
323
|
+
border-top: 2px solid #007aff;
|
|
324
|
+
border-radius: 50%;
|
|
325
|
+
animation: spin 1s linear infinite;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.refresh-success {
|
|
329
|
+
width: 18px;
|
|
330
|
+
height: 18px;
|
|
331
|
+
margin-right: 8px;
|
|
332
|
+
color: #4caf50;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.refresh-error {
|
|
336
|
+
width: 18px;
|
|
337
|
+
height: 18px;
|
|
338
|
+
margin-right: 8px;
|
|
339
|
+
color: #f44336;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.refresh-text {
|
|
343
|
+
font-weight: 500;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.refresh-content {
|
|
348
|
+
transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
349
|
+
height: 100%;
|
|
350
|
+
overflow-y: auto;
|
|
351
|
+
-webkit-overflow-scrolling: touch;
|
|
352
|
+
scrollbar-width: none;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
@keyframes spin {
|
|
357
|
+
0% {
|
|
358
|
+
transform: rotate(0deg);
|
|
359
|
+
}
|
|
360
|
+
100% {
|
|
361
|
+
transform: rotate(360deg);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
</style>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script setup lang="ts">
|
|
35
|
-
import { ref, Ref, computed, watch, onMounted,
|
|
35
|
+
import { ref, Ref, computed, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
36
36
|
import { useDeviceState } from '../../states/DeviceState';
|
|
37
37
|
import { MediaSource } from '../../types';
|
|
38
38
|
import {
|
|
@@ -59,10 +59,6 @@ const props = defineProps<{
|
|
|
59
59
|
|
|
60
60
|
const emits = defineEmits(['addCameraMaterial', 'updateCameraMaterial', 'close']);
|
|
61
61
|
|
|
62
|
-
onUnmounted(async () => {
|
|
63
|
-
await previewTRTCCloud.stopCameraDeviceTest();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
62
|
const title = computed(() => {
|
|
67
63
|
return props.mediaSource ? t('Update Camera') : t('Add Camera');
|
|
68
64
|
});
|
|
@@ -103,6 +99,11 @@ onMounted(async () => {
|
|
|
103
99
|
await previewTRTCCloud.startCameraDeviceTest('video-preview');
|
|
104
100
|
});
|
|
105
101
|
|
|
102
|
+
onBeforeUnmount(async () => {
|
|
103
|
+
await previewTRTCCloud.stopCameraDeviceTest();
|
|
104
|
+
previewTRTCCloud.destroy();
|
|
105
|
+
});
|
|
106
|
+
|
|
106
107
|
watch(
|
|
107
108
|
() => props.mediaSource,
|
|
108
109
|
async (mediaSource: any) => {
|
|
@@ -39,7 +39,7 @@ import TUIRoomEngine, {
|
|
|
39
39
|
} from '@tencentcloud/tuiroom-engine-js';
|
|
40
40
|
import LiveSceneSelect from './LiveSceneSelect.vue';
|
|
41
41
|
import { TUIToast, TOAST_TYPE, useUIKit } from '@tencentcloud/uikit-base-component-vue3';
|
|
42
|
-
import {
|
|
42
|
+
import { onBeforeUnmount, ref, computed } from 'vue';
|
|
43
43
|
import CameraSettingDialog from './CameraSettingDialog.vue';
|
|
44
44
|
import MaterialRenameDialog from './MaterialRenameDialog.vue';
|
|
45
45
|
import MaterialItem from './MaterialItem.vue';
|
|
@@ -241,7 +241,7 @@ const updateCameraSetting = (material: MediaSource) => {
|
|
|
241
241
|
showCameraSettingDialog.value = true;
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
-
|
|
244
|
+
onBeforeUnmount(() => {
|
|
245
245
|
clearMediaSource();
|
|
246
246
|
})
|
|
247
247
|
</script>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
&__icon {
|
|
6
6
|
cursor: pointer;
|
|
7
|
+
display: flex;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
&__popup {
|
|
@@ -20,12 +21,15 @@
|
|
|
20
21
|
&--expanded {
|
|
21
22
|
display: flex;
|
|
22
23
|
flex-direction: row;
|
|
24
|
+
gap: 8px;
|
|
25
|
+
|
|
23
26
|
.attachment-picker__item {
|
|
24
27
|
padding: 4px;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
&__item {
|
|
32
|
+
outline: none !important;
|
|
29
33
|
border: none;
|
|
30
34
|
display: flex;
|
|
31
35
|
flex-direction: row;
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="[styles['attachment-picker']
|
|
2
|
+
<div :class="[styles['attachment-picker']]">
|
|
3
3
|
<template v-if="isCollapsed">
|
|
4
4
|
<PopoverRoot>
|
|
5
5
|
<PopoverTrigger as="span">
|
|
6
6
|
<IconPlus
|
|
7
7
|
:class="styles['attachment-picker__icon']"
|
|
8
|
-
size="
|
|
8
|
+
size="20"
|
|
9
9
|
/>
|
|
10
10
|
</PopoverTrigger>
|
|
11
11
|
<PopoverPortal>
|
|
12
12
|
<PopoverContent
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class="rounded-lg p-5 w-[260px] bg-white shadow-sm border will-change-[transform,opacity] data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade"
|
|
13
|
+
side="top"
|
|
14
|
+
align="start"
|
|
15
|
+
:side-offset="5"
|
|
17
16
|
>
|
|
18
|
-
<div class="
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/>
|
|
26
|
-
</div>
|
|
17
|
+
<div :class="styles['attachment-picker__popup']">
|
|
18
|
+
<component
|
|
19
|
+
:is="picker.Component"
|
|
20
|
+
v-for="(picker, index) in pickerItems"
|
|
21
|
+
:key="index"
|
|
22
|
+
v-bind="picker.props"
|
|
23
|
+
/>
|
|
27
24
|
</div>
|
|
28
25
|
</PopoverContent>
|
|
29
26
|
</PopoverPortal>
|
|
@@ -52,7 +49,6 @@ import ImagePicker from './ImagePicker.vue';
|
|
|
52
49
|
import VideoPicker from './VideoPicker.vue';
|
|
53
50
|
|
|
54
51
|
interface Props {
|
|
55
|
-
className?: string;
|
|
56
52
|
attachmentPickerMode?: 'collapsed' | 'expanded';
|
|
57
53
|
}
|
|
58
54
|
|
|
@@ -62,7 +58,6 @@ const ICON_SIZE = {
|
|
|
62
58
|
};
|
|
63
59
|
|
|
64
60
|
const props = withDefaults(defineProps<Props>(), {
|
|
65
|
-
className: '',
|
|
66
61
|
attachmentPickerMode: 'collapsed',
|
|
67
62
|
});
|
|
68
63
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<View>
|
|
3
3
|
<template v-if="label">
|
|
4
4
|
<button
|
|
5
5
|
:class="[styles['attachment-picker__item'], className]"
|
|
@@ -27,13 +27,14 @@
|
|
|
27
27
|
hidden
|
|
28
28
|
@change="handleFileInput"
|
|
29
29
|
>
|
|
30
|
-
</
|
|
30
|
+
</View>
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
34
|
import { ref } from 'vue';
|
|
35
35
|
import { IconFile } from '@tencentcloud/uikit-base-component-vue3';
|
|
36
36
|
import { MessageContentType, useMessageInputState } from '../../../states/MessageInputState';
|
|
37
|
+
import { View } from '../../../baseComp/View';
|
|
37
38
|
import styles from './AttachmentPicker.module.scss';
|
|
38
39
|
|
|
39
40
|
const PICKER_CONSTANTS = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<View>
|
|
3
3
|
<template v-if="label">
|
|
4
4
|
<button
|
|
5
5
|
:class="[styles['attachment-picker__item'], className]"
|
|
@@ -27,13 +27,14 @@
|
|
|
27
27
|
hidden
|
|
28
28
|
@change="handleFileInput"
|
|
29
29
|
>
|
|
30
|
-
</
|
|
30
|
+
</View>
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
34
|
import { ref } from 'vue';
|
|
35
35
|
import { IconImage } from '@tencentcloud/uikit-base-component-vue3';
|
|
36
36
|
import { MessageContentType, useMessageInputState } from '../../../states/MessageInputState';
|
|
37
|
+
import { View } from '../../../baseComp/View';
|
|
37
38
|
import styles from './AttachmentPicker.module.scss';
|
|
38
39
|
|
|
39
40
|
const PICKER_CONSTANTS = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<View>
|
|
3
3
|
<template v-if="label">
|
|
4
4
|
<button
|
|
5
5
|
:class="[styles['attachment-picker__item'], className]"
|
|
@@ -27,13 +27,14 @@
|
|
|
27
27
|
hidden
|
|
28
28
|
@change="handleFileInput"
|
|
29
29
|
>
|
|
30
|
-
</
|
|
30
|
+
</View>
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
34
|
import { ref } from 'vue';
|
|
35
35
|
import { IconVideo } from '@tencentcloud/uikit-base-component-vue3';
|
|
36
36
|
import { MessageContentType, useMessageInputState } from '../../../states/MessageInputState';
|
|
37
|
+
import { View } from '../../../baseComp/View';
|
|
37
38
|
import styles from './AttachmentPicker.module.scss';
|
|
38
39
|
|
|
39
40
|
const PICKER_CONSTANTS = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:class="[styles['message-input']
|
|
4
|
-
:style="style"
|
|
3
|
+
:class="[styles['message-input']]"
|
|
5
4
|
>
|
|
6
5
|
<slot name="headerToolbar">
|
|
7
6
|
<div :class="styles['message-input__toolbar']">
|
|
@@ -18,13 +17,21 @@
|
|
|
18
17
|
<div :class="styles['message-input__leftInline']">
|
|
19
18
|
<slot name="leftInline" />
|
|
20
19
|
</div>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
<slot name="textEditor">
|
|
21
|
+
<DefaultTextEditor
|
|
22
|
+
:autoFocus="autoFocus"
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
:placeholder="placeholder"
|
|
25
|
+
:key="disabled ? 'disabled-editor' : 'enabled-editor'"
|
|
26
|
+
>
|
|
27
|
+
<template #inputPrefix>
|
|
28
|
+
<slot name="inputPrefix" />
|
|
29
|
+
</template>
|
|
30
|
+
<template #inputSuffix>
|
|
31
|
+
<slot name="inputSuffix" />
|
|
32
|
+
</template>
|
|
33
|
+
</DefaultTextEditor>
|
|
34
|
+
</slot>
|
|
28
35
|
<div :class="styles['message-input__rightInline']">
|
|
29
36
|
<slot name="rightInline" />
|
|
30
37
|
</div>
|
|
@@ -34,7 +41,7 @@
|
|
|
34
41
|
<SendButton
|
|
35
42
|
v-if="!hideSendButton"
|
|
36
43
|
:class="styles['message-input__send-button']"
|
|
37
|
-
:disabled="
|
|
44
|
+
:disabled="props.disabled"
|
|
38
45
|
@click="sendInputMessage"
|
|
39
46
|
/>
|
|
40
47
|
</div>
|
|
@@ -50,8 +57,8 @@ import { EmojiPicker } from './EmojiPicker';
|
|
|
50
57
|
import styles from './MessageInput.module.scss';
|
|
51
58
|
import { QuotedMessagePreview } from './QuotedMessagePreview';
|
|
52
59
|
import { SendButton } from './SendButton';
|
|
53
|
-
import { TextEditor } from './TextEditor';
|
|
54
|
-
import type { CustomAction,
|
|
60
|
+
import { TextEditor as DefaultTextEditor } from './TextEditor';
|
|
61
|
+
import type { CustomAction, MessageInputProps } from './types';
|
|
55
62
|
|
|
56
63
|
const DEFAULT_ACTIONS = [
|
|
57
64
|
{ key: 'EmojiPicker', component: EmojiPicker },
|
|
@@ -61,16 +68,15 @@ const DEFAULT_ACTIONS = [
|
|
|
61
68
|
{ key: 'VideoPicker', component: VideoPicker },
|
|
62
69
|
];
|
|
63
70
|
|
|
64
|
-
const props = withDefaults(defineProps<
|
|
71
|
+
const props = withDefaults(defineProps<MessageInputProps>(), {
|
|
65
72
|
autoFocus: true,
|
|
66
73
|
disabled: false,
|
|
67
74
|
hideSendButton: false,
|
|
68
75
|
placeholder: '',
|
|
69
|
-
className: '',
|
|
70
|
-
style: () => ({}),
|
|
71
76
|
attachmentPickerMode: 'collapsed',
|
|
72
77
|
actions: () => ['EmojiPicker', 'ImagePicker', 'FilePicker', 'VideoPicker'],
|
|
73
78
|
});
|
|
79
|
+
|
|
74
80
|
const { inputRawValue, setContent, sendMessage } = useMessageInputState();
|
|
75
81
|
|
|
76
82
|
const pickProps = <T extends object, K extends keyof T>(
|