tuikit-atomicx-vue3 3.3.4 → 3.4.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/.eslintrc.cjs +33 -0
- package/dist/AudioRequestDialog.vue_vue_type_script_setup_true_lang-DESfuJPj.js +89 -0
- package/dist/DialogPortal-CvJcEAsn.js +417 -0
- package/dist/MaterialRenameDialog.vue_vue_type_script_setup_true_lang-C8oUv-KF.js +36 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D1G-LitO.js +116 -0
- package/dist/PopoverTrigger-L8abAry7.js +607 -0
- package/dist/PopperContent-XdhqL8Y2.js +1603 -0
- package/dist/Teleport-CSEuZbpM.js +913 -0
- package/dist/VideoRequestDialog.vue_vue_type_script_setup_true_lang-DlROoquV.js +89 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/baseComp/ActionSheep.js +41 -51
- package/dist/baseComp/AudioIcon.js +27 -37
- package/dist/baseComp/Avatar.js +16 -28
- package/dist/baseComp/Dialog/DialogH5.js +56 -82
- package/dist/baseComp/Dialog/DialogPC.js +76 -118
- package/dist/baseComp/Dialog/index.js +2 -2
- package/dist/baseComp/IconButton.js +43 -56
- package/dist/baseComp/Input/InputH5.js +85 -128
- package/dist/baseComp/Input/InputPC.js +85 -128
- package/dist/baseComp/Input/InputWX.js +88 -131
- package/dist/baseComp/Input/index.js +5 -5
- package/dist/baseComp/MessageBox/index.js +120 -150
- package/dist/baseComp/Modal/Modal.js +38 -45
- package/dist/baseComp/Modal/index.js +3 -3
- package/dist/baseComp/ObserverView/ObserverView.js +50 -86
- package/dist/baseComp/ObserverView/index.js +2 -2
- package/dist/baseComp/Option/OptionH5.js +29 -40
- package/dist/baseComp/Option/OptionPC.js +34 -46
- package/dist/baseComp/Option/OptionWX.js +30 -41
- package/dist/baseComp/Option/index.js +2 -2
- package/dist/baseComp/Select/SelectH5.js +54 -86
- package/dist/baseComp/Select/SelectPC.js +78 -120
- package/dist/baseComp/Select/SelectWX.js +48 -79
- package/dist/baseComp/Select/index.js +2 -2
- package/dist/baseComp/SvgIcon.js +17 -22
- package/dist/baseComp/TuiSwitch.js +15 -19
- package/dist/baseComp/View/View.js +2 -2
- package/dist/baseComp/View/index.js +19 -24
- package/dist/baseComp/index.js +2 -2
- package/dist/baseComp/useZIndex.js +7 -12
- package/dist/chat/index.d.ts +1421 -990
- package/dist/chat/index.js +57 -82
- package/dist/chat/server.js +60 -84
- package/dist/components/AudioSetting/AudioMediaControl.js +52 -78
- package/dist/components/AudioSetting/AudioRequestDialog.js +2 -2
- package/dist/components/AudioSetting/AudioSettingTab.js +72 -102
- package/dist/components/AudioSetting/MicrophoneSelect.js +45 -57
- package/dist/components/AudioSetting/SpeakerSelect.js +45 -57
- package/dist/components/AudioSetting/index.js +3 -3
- package/dist/components/AudioSettingPanel/i18n/en-US/index.js +2 -2
- package/dist/components/AudioSettingPanel/i18n/index.js +4 -4
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.js +2 -2
- package/dist/components/AudioSettingPanel/index.js +102 -147
- package/dist/components/Avatar/Avatar.js +88 -140
- package/dist/components/Avatar/Avatar.vue.d.ts +1 -1
- package/dist/components/Avatar/AvatarBadge/AvatarBadge.js +25 -31
- package/dist/components/Avatar/AvatarBadge/index.js +2 -2
- package/dist/components/Avatar/constants/avatar.js +7 -12
- package/dist/components/Avatar/index.js +9 -9
- package/dist/components/BarrageInput/BarrageInput.js +50 -67
- package/dist/components/BarrageInput/BarrageInputH5.js +80 -111
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +84 -97
- package/dist/components/BarrageInput/EmojiPicker/index.js +2 -2
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +34 -62
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +79 -90
- package/dist/components/BarrageInput/TextEditor/TextEditor.js +2 -2
- package/dist/components/BarrageInput/TextEditor/index.js +81 -125
- package/dist/components/BarrageInput/constants.js +2 -2
- package/dist/components/BarrageInput/i18n/en-US/index.js +2 -2
- package/dist/components/BarrageInput/i18n/index.js +4 -4
- package/dist/components/BarrageInput/i18n/zh-CN/index.js +2 -2
- package/dist/components/BarrageInput/index.js +11 -11
- package/dist/components/BarrageList/BarrageList.js +97 -173
- package/dist/components/BarrageList/BarrageListH5.js +96 -171
- package/dist/components/BarrageList/ClickAction/UserActionMenu.js +64 -94
- package/dist/components/BarrageList/Message/CustomMessage/CustomMessage.js +2 -2
- package/dist/components/BarrageList/Message/CustomMessage/index.js +5 -7
- package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.js +16 -21
- package/dist/components/BarrageList/Message/FaceMessage/index.js +2 -2
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.js +2 -2
- package/dist/components/BarrageList/Message/GroupTipMessage/index.js +13 -18
- package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.js +56 -80
- package/dist/components/BarrageList/Message/ImageMessage/index.js +2 -2
- package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.js +5 -5
- package/dist/components/BarrageList/Message/MergerMessage/index.js +2 -2
- package/dist/components/BarrageList/Message/Message.js +2 -2
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.js +28 -39
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/index.js +2 -2
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.js +93 -101
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.js +26 -32
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.js +19 -22
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.js +2 -2
- package/dist/components/BarrageList/Message/MessageLayout/index.js +2 -2
- package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.js +31 -39
- package/dist/components/BarrageList/Message/RecalledMessage/index.js +2 -2
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +67 -96
- package/dist/components/BarrageList/Message/TextMessage/index.js +2 -2
- package/dist/components/BarrageList/Message/index.js +11 -15
- package/dist/components/BarrageList/MessageForward/ForwardListItem.js +34 -43
- package/dist/components/BarrageList/MessageForward/MessageForward.js +158 -210
- package/dist/components/BarrageList/MessageForward/index.js +2 -2
- package/dist/components/BarrageList/MessageListContext.js +9 -10
- package/dist/components/BarrageList/MessageTimeDivider/MessageTimeDivider.js +20 -28
- package/dist/components/BarrageList/MessageTimeDivider/index.js +2 -2
- package/dist/components/BarrageList/i18n/en-US/index.js +3 -3
- package/dist/components/BarrageList/i18n/index.js +4 -4
- package/dist/components/BarrageList/i18n/zh-CN/index.js +3 -3
- package/dist/components/BarrageList/index.js +10 -10
- package/dist/components/CameraButton/index.js +34 -44
- package/dist/components/ChatSetting/C2CChatSetting/C2CChatSetting.js +92 -108
- package/dist/components/ChatSetting/C2CChatSetting/index.js +3 -3
- package/dist/components/ChatSetting/ChatSetting.js +17 -23
- package/dist/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.js +133 -163
- package/dist/components/ChatSetting/GroupChatSetting/GroupActions/index.js +2 -2
- package/dist/components/ChatSetting/GroupChatSetting/GroupChatSetting.js +179 -245
- package/dist/components/ChatSetting/GroupChatSetting/GroupInfo/GroupInfo.js +124 -181
- package/dist/components/ChatSetting/GroupChatSetting/GroupInfo/index.js +2 -2
- package/dist/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.js +195 -259
- package/dist/components/ChatSetting/GroupChatSetting/GroupManagement/index.js +2 -2
- package/dist/components/ChatSetting/GroupChatSetting/GroupManagementEntry/GroupManagementEntry.js +23 -32
- package/dist/components/ChatSetting/GroupChatSetting/GroupManagementEntry/index.js +2 -2
- package/dist/components/ChatSetting/GroupChatSetting/GroupMembers/GroupMembers.js +149 -212
- package/dist/components/ChatSetting/GroupChatSetting/GroupMembers/index.js +2 -2
- package/dist/components/ChatSetting/GroupChatSetting/PersonalSettings/PersonalSettings.js +35 -40
- package/dist/components/ChatSetting/GroupChatSetting/PersonalSettings/index.js +2 -2
- package/dist/components/ChatSetting/GroupChatSetting/index.js +2 -2
- package/dist/components/ChatSetting/SettingItem/SettingItem.js +201 -247
- package/dist/components/ChatSetting/SettingItem/index.js +2 -2
- package/dist/components/ChatSetting/i18n/en-US.js +2 -2
- package/dist/components/ChatSetting/i18n/index.js +6 -6
- package/dist/components/ChatSetting/i18n/zh-CN.js +2 -2
- package/dist/components/ChatSetting/index.js +7 -7
- package/dist/components/CoGuestPanel/CoGuestPanel.js +139 -180
- package/dist/components/CoGuestPanel/constants.js +2 -2
- package/dist/components/CoGuestPanel/i18n/en-US/index.js +9 -9
- package/dist/components/CoGuestPanel/i18n/index.js +4 -4
- package/dist/components/CoGuestPanel/i18n/zh-CN/index.js +9 -9
- package/dist/components/CoGuestPanel/index.js +8 -8
- package/dist/components/CoHostPanel/BattlePanel.js +196 -0
- package/dist/components/CoHostPanel/BattlePanel.vue.d.ts +19 -0
- package/dist/components/CoHostPanel/CoHostPanel.js +109 -0
- package/dist/components/CoHostPanel/CoHostPanel.vue.d.ts +19 -0
- package/dist/components/CoHostPanel/ConfigSettingPanel.js +110 -0
- package/dist/components/CoHostPanel/ConfigSettingPanel.vue.d.ts +33 -0
- package/dist/components/CoHostPanel/ConnectionPanel.js +273 -0
- package/dist/components/CoHostPanel/ConnectionPanel.vue.d.ts +19 -0
- package/dist/components/CoHostPanel/RecommendHostList.js +113 -0
- package/dist/components/CoHostPanel/RecommendHostList.vue.d.ts +13 -0
- package/dist/components/CoHostPanel/UserList.js +34 -0
- package/dist/components/CoHostPanel/UserList.vue.d.ts +28 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.d.ts +74 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.js +81 -0
- package/dist/components/CoHostPanel/i18n/index.d.ts +4 -0
- package/dist/components/CoHostPanel/i18n/index.js +6 -0
- package/dist/components/CoHostPanel/i18n/zh-CN/index.d.ts +75 -0
- package/dist/components/CoHostPanel/i18n/zh-CN/index.js +82 -0
- package/dist/components/CoHostPanel/index.d.ts +16 -0
- package/dist/components/CoHostPanel/index.js +10 -0
- package/dist/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.js +36 -51
- package/dist/components/ContactList/ContactInfo/BlacklistInfo/index.js +2 -2
- package/dist/components/ContactList/ContactInfo/ContactInfo.js +141 -196
- package/dist/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.js +39 -61
- package/dist/components/ContactList/ContactInfo/FriendApplicationInfo/index.js +2 -2
- package/dist/components/ContactList/ContactInfo/FriendInfo/FriendInfo.js +109 -160
- package/dist/components/ContactList/ContactInfo/FriendInfo/index.js +2 -2
- package/dist/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.js +58 -86
- package/dist/components/ContactList/ContactInfo/GroupApplicationInfo/index.js +2 -2
- package/dist/components/ContactList/ContactInfo/GroupInfo/GroupInfo.js +99 -133
- package/dist/components/ContactList/ContactInfo/GroupInfo/index.js +2 -2
- package/dist/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.js +86 -118
- package/dist/components/ContactList/ContactInfo/SearchGroupInfo/index.js +2 -2
- package/dist/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.js +72 -101
- package/dist/components/ContactList/ContactInfo/SearchUserInfo/index.js +2 -2
- package/dist/components/ContactList/ContactInfo/index.js +16 -16
- package/dist/components/ContactList/ContactList.js +164 -235
- package/dist/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.js +29 -38
- package/dist/components/ContactList/ContactListItem/BlacklistItem/index.js +2 -2
- package/dist/components/ContactList/ContactListItem/ContactListItem.js +2 -2
- package/dist/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.js +46 -61
- package/dist/components/ContactList/ContactListItem/FriendApplicationItem/index.js +2 -2
- package/dist/components/ContactList/ContactListItem/FriendItem/FriendItem.js +24 -31
- package/dist/components/ContactList/ContactListItem/FriendItem/index.js +2 -2
- package/dist/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.js +45 -64
- package/dist/components/ContactList/ContactListItem/GroupApplicationItem/index.js +2 -2
- package/dist/components/ContactList/ContactListItem/GroupItem/GroupItem.js +29 -38
- package/dist/components/ContactList/ContactListItem/GroupItem/index.js +2 -2
- package/dist/components/ContactList/ContactListItem/index.js +57 -66
- package/dist/components/ContactList/ContactSearch/ContactSearch.js +53 -73
- package/dist/components/ContactList/ContactSearch/index.js +2 -2
- package/dist/components/ContactList/constants/const.js +3 -4
- package/dist/components/ContactList/hooks/index.js +2 -2
- package/dist/components/ContactList/hooks/useContactList.js +11 -15
- package/dist/components/ContactList/i18n/en-US.js +21 -21
- package/dist/components/ContactList/i18n/index.js +4 -4
- package/dist/components/ContactList/i18n/zh-CN.js +21 -21
- package/dist/components/ContactList/index.js +12 -14
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +107 -150
- package/dist/components/ConversationList/ConversationActions/index.js +2 -2
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +116 -193
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateButton/ConversationCreateButton.js +65 -80
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.js +108 -126
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.js +40 -52
- package/dist/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.js +61 -79
- package/dist/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/index.js +4 -4
- package/dist/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/type.js +8 -8
- package/dist/components/ConversationList/ConversationCreate/index.js +12 -12
- package/dist/components/ConversationList/ConversationList.js +112 -154
- package/dist/components/ConversationList/ConversationList.vue.d.ts +72 -72
- package/dist/components/ConversationList/ConversationListContent/ConversationListContent.js +27 -33
- package/dist/components/ConversationList/ConversationListContent/index.js +2 -2
- package/dist/components/ConversationList/ConversationListHeader/ConversationListHeader.js +30 -39
- package/dist/components/ConversationList/ConversationListHeader/index.js +2 -2
- package/dist/components/ConversationList/ConversationPlaceHolder/ConversationPlaceHolder.js +65 -81
- package/dist/components/ConversationList/ConversationPlaceHolder/index.js +2 -2
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.js +2 -2
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +72 -72
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +40 -59
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +29 -47
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +25 -42
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +84 -111
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +18 -18
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +36 -51
- package/dist/components/ConversationList/ConversationPreview/index.js +55 -63
- package/dist/components/ConversationList/ConversationPreview/utils.js +36 -42
- package/dist/components/ConversationList/ConversationSearch/ConversationSearch.js +114 -160
- package/dist/components/ConversationList/ConversationSearch/index.js +2 -2
- package/dist/components/ConversationList/hooks/useConversation.js +12 -18
- package/dist/components/ConversationList/hooks/useConversationCreate.js +17 -18
- package/dist/components/ConversationList/i18n/en-US.js +32 -32
- package/dist/components/ConversationList/i18n/index.js +4 -4
- package/dist/components/ConversationList/i18n/zh-CN.js +32 -32
- package/dist/components/ConversationList/index.d.ts +989 -989
- package/dist/components/ConversationList/index.js +24 -32
- package/dist/components/LiveAudienceList/LiveAudienceList.js +85 -120
- package/dist/components/LiveAudienceList/LiveAudienceListH5.js +50 -72
- package/dist/components/LiveAudienceList/UserActionMenu.js +82 -124
- package/dist/components/LiveAudienceList/i18n/en-US/index.js +2 -2
- package/dist/components/LiveAudienceList/i18n/index.js +4 -4
- package/dist/components/LiveAudienceList/i18n/zh-CN/index.js +2 -2
- package/dist/components/LiveAudienceList/index.js +10 -10
- package/dist/components/LiveCoreView/CoreViewDecorate/BattleDecorate.js +152 -0
- package/dist/components/LiveCoreView/CoreViewDecorate/BattleDecorate.vue.d.ts +2 -0
- package/dist/components/LiveCoreView/CoreViewDecorate/BattleUserDecorate.js +66 -0
- package/dist/components/LiveCoreView/CoreViewDecorate/BattleUserDecorate.vue.d.ts +35 -0
- package/dist/components/LiveCoreView/CoreViewDecorate/CoHostDecorate.js +54 -0
- package/dist/components/LiveCoreView/CoreViewDecorate/CoHostDecorate.vue.d.ts +2 -0
- package/dist/components/LiveCoreView/CoreViewDecorate/LiveCoreDecorate.js +35 -0
- package/dist/components/LiveCoreView/CoreViewDecorate/LiveCoreDecorate.vue.d.ts +35 -0
- package/dist/components/LiveCoreView/DefaultStreamViewUI.js +101 -154
- package/dist/components/LiveCoreView/PlayerControl/AudioControl.js +113 -236
- package/dist/components/LiveCoreView/PlayerControl/MultiResolution.js +78 -0
- package/dist/components/LiveCoreView/PlayerControl/MultiResolution.vue.d.ts +2 -0
- package/dist/components/LiveCoreView/PlayerControl/PlayerControl.js +150 -261
- package/dist/components/LiveCoreView/PlayerControl/PlayerControlState.d.ts +11 -0
- package/dist/components/LiveCoreView/PlayerControl/PlayerControlState.js +234 -379
- package/dist/components/LiveCoreView/PlayerControl/index.js +6 -6
- package/dist/components/LiveCoreView/PlayerControl/utils/deviceDetection.js +37 -121
- package/dist/components/LiveCoreView/PlayerControl/utils/domHelpers.js +32 -53
- package/dist/components/LiveCoreView/PlayerControl/utils/fullscreenManager.js +107 -177
- package/dist/components/LiveCoreView/i18n/en-US/index.d.ts +6 -0
- package/dist/components/LiveCoreView/i18n/en-US/index.js +14 -8
- package/dist/components/LiveCoreView/i18n/index.js +4 -4
- package/dist/components/LiveCoreView/i18n/zh-CN/index.d.ts +6 -0
- package/dist/components/LiveCoreView/i18n/zh-CN/index.js +14 -8
- package/dist/components/LiveCoreView/index.js +176 -301
- package/dist/components/LiveList/LiveList.js +109 -165
- package/dist/components/LiveList/LiveList.vue.d.ts +15 -3
- package/dist/components/LiveList/LiveListH5.js +109 -169
- package/dist/components/LiveList/i18n/en-US/index.d.ts +1 -1
- package/dist/components/LiveList/i18n/en-US/index.js +4 -4
- package/dist/components/LiveList/i18n/index.js +4 -4
- package/dist/components/LiveList/i18n/zh-CN/index.d.ts +1 -1
- package/dist/components/LiveList/i18n/zh-CN/index.js +4 -4
- package/dist/components/LiveList/index.d.ts +17 -1
- package/dist/components/LiveList/index.js +10 -10
- package/dist/components/LiveList/pullToRefresh.js +88 -163
- package/dist/components/LiveMonitorView/LiveMonitorView.js +72 -110
- package/dist/components/LiveMonitorView/i18n/en-US/index.js +2 -2
- package/dist/components/LiveMonitorView/i18n/index.js +4 -4
- package/dist/components/LiveMonitorView/i18n/zh-CN/index.js +2 -2
- package/dist/components/LiveMonitorView/index.js +7 -7
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +126 -188
- package/dist/components/LiveScenePanel/LiveSceneSelect.js +79 -106
- package/dist/components/LiveScenePanel/MaterialDialog.js +78 -98
- package/dist/components/LiveScenePanel/MaterialItem.js +105 -142
- package/dist/components/LiveScenePanel/MaterialRenameDialog.js +2 -2
- package/dist/components/LiveScenePanel/i18n/en-US/index.js +2 -2
- package/dist/components/LiveScenePanel/i18n/index.js +4 -4
- package/dist/components/LiveScenePanel/i18n/zh-CN/index.js +2 -2
- package/dist/components/LiveScenePanel/icons/AddIcon.js +10 -11
- package/dist/components/LiveScenePanel/icons/CameraIcon.js +9 -10
- package/dist/components/LiveScenePanel/icons/CameraMirror.js +13 -14
- package/dist/components/LiveScenePanel/icons/CameraUnmirror.js +11 -12
- package/dist/components/LiveScenePanel/icons/ImageIcon.js +8 -9
- package/dist/components/LiveScenePanel/icons/MoreIcon.js +13 -14
- package/dist/components/LiveScenePanel/icons/ScreenIcon.js +8 -9
- package/dist/components/LiveScenePanel/index.js +142 -190
- package/dist/components/MessageInput/AttachmentPicker/AttachmentPicker.js +2 -2
- package/dist/components/MessageInput/AttachmentPicker/AttachmentPicker.vue.d.ts +10 -1
- package/dist/components/MessageInput/AttachmentPicker/FilePicker.js +63 -2
- package/dist/components/MessageInput/AttachmentPicker/FilePicker.vue.d.ts +14 -13
- package/dist/components/MessageInput/AttachmentPicker/ImagePicker.js +63 -2
- package/dist/components/MessageInput/AttachmentPicker/ImagePicker.vue.d.ts +14 -13
- package/dist/components/MessageInput/AttachmentPicker/VideoPicker.js +63 -2
- package/dist/components/MessageInput/AttachmentPicker/VideoPicker.vue.d.ts +14 -13
- package/dist/components/MessageInput/AttachmentPicker/index.js +70 -72
- package/dist/components/MessageInput/AudioCallPicker/AudioCallPicker.js +155 -0
- package/dist/components/MessageInput/AudioCallPicker/AudioCallPicker.vue.d.ts +45 -0
- package/dist/components/MessageInput/AudioCallPicker/index.d.ts +3 -0
- package/dist/components/MessageInput/AudioCallPicker/index.js +4 -0
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +108 -96
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.vue.d.ts +34 -6
- package/dist/components/MessageInput/EmojiPicker/index.js +2 -2
- package/dist/components/MessageInput/MessageInput.js +2 -2
- package/dist/components/MessageInput/QuotedMessagePreview/QuotedMessagePreview.js +2 -2
- package/dist/components/MessageInput/QuotedMessagePreview/index.js +60 -74
- package/dist/components/MessageInput/SendButton/SendButton.js +2 -2
- package/dist/components/MessageInput/SendButton/index.js +20 -25
- package/dist/components/MessageInput/TextEditor/EditorCore.js +72 -79
- package/dist/components/MessageInput/TextEditor/TextEditor.js +2 -2
- package/dist/components/MessageInput/TextEditor/index.js +60 -95
- package/dist/components/MessageInput/VideoCallPicker/VideoCallPicker.js +158 -0
- package/dist/components/MessageInput/VideoCallPicker/VideoCallPicker.vue.d.ts +45 -0
- package/dist/components/MessageInput/VideoCallPicker/index.d.ts +3 -0
- package/dist/components/MessageInput/VideoCallPicker/index.js +4 -0
- package/dist/components/MessageInput/i18n/en-US.d.ts +4 -0
- package/dist/components/MessageInput/i18n/en-US.js +7 -3
- package/dist/components/MessageInput/i18n/index.d.ts +4 -0
- package/dist/components/MessageInput/i18n/index.js +6 -6
- package/dist/components/MessageInput/i18n/zh-CN.js +2 -2
- package/dist/components/MessageInput/index.d.ts +462 -191
- package/dist/components/MessageInput/index.js +23 -25
- package/dist/components/MessageList/Message/AudioMessage/AudioMessage.js +50 -65
- package/dist/components/MessageList/Message/AudioMessage/PlayButton.js +31 -37
- package/dist/components/MessageList/Message/AudioMessage/WaveForm.js +37 -52
- package/dist/components/MessageList/Message/AudioMessage/index.js +2 -2
- package/dist/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.js +60 -0
- package/dist/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.vue.d.ts +16 -0
- package/dist/components/MessageList/Message/CustomMessage/CallMessage/index.d.ts +3 -0
- package/dist/components/MessageList/Message/CustomMessage/CallMessage/index.js +4 -0
- package/dist/components/MessageList/Message/CustomMessage/CustomMessage.js +49 -2
- package/dist/components/MessageList/Message/CustomMessage/CustomMessage.vue.d.ts +15 -1
- package/dist/components/MessageList/Message/CustomMessage/index.js +2 -10
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.js +16 -20
- package/dist/components/MessageList/Message/FaceMessage/index.js +2 -2
- package/dist/components/MessageList/Message/FileMessage/FileMessage.js +57 -70
- package/dist/components/MessageList/Message/FileMessage/index.js +2 -2
- package/dist/components/MessageList/Message/GroupTipMessage/GroupTipMessage.js +2 -2
- package/dist/components/MessageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +1 -1
- package/dist/components/MessageList/Message/GroupTipMessage/index.js +13 -23
- package/dist/components/MessageList/Message/GroupTipMessage/resolveGroupTipMessage.d.ts +1 -1
- package/dist/components/MessageList/Message/GroupTipMessage/resolveGroupTipMessage.js +41 -59
- package/dist/components/MessageList/Message/ImageMessage/ImageMessage.js +106 -169
- package/dist/components/MessageList/Message/ImageMessage/index.js +2 -2
- package/dist/components/MessageList/Message/LocationMessage/LocationMessage.js +7 -7
- package/dist/components/MessageList/Message/LocationMessage/index.js +2 -2
- package/dist/components/MessageList/Message/MergerMessage/MergerMessage.js +7 -7
- package/dist/components/MessageList/Message/MergerMessage/index.js +2 -2
- package/dist/components/MessageList/Message/Message.js +2 -2
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +800 -1074
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue.d.ts +1 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/index.js +2 -2
- package/dist/components/MessageList/Message/MessageLayout/MessageBubble/MessageBubble.js +36 -44
- package/dist/components/MessageList/Message/MessageLayout/MessageBubble/MessageBubble.vue.d.ts +1 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageBubble/index.js +2 -2
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +116 -123
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.vue.d.ts +1 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.js +47 -73
- package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.js +24 -27
- package/dist/components/MessageList/Message/MessageLayout/MessageMeta/index.js +2 -2
- package/dist/components/MessageList/Message/MessageLayout/index.js +2 -2
- package/dist/components/MessageList/Message/MessageLayout/useMessageLayoutClasses.js +23 -28
- package/dist/components/MessageList/Message/RecalledMessage/RecalledMessage.js +39 -48
- package/dist/components/MessageList/Message/RecalledMessage/index.js +2 -2
- package/dist/components/MessageList/Message/TextMessage/TextMessage.js +80 -102
- package/dist/components/MessageList/Message/TextMessage/index.js +2 -2
- package/dist/components/MessageList/Message/VideoMessage/VideoMessage.js +68 -92
- package/dist/components/MessageList/Message/VideoMessage/index.js +2 -2
- package/dist/components/MessageList/Message/index.js +18 -20
- package/dist/components/MessageList/MessageForward/ForwardListItem.js +46 -53
- package/dist/components/MessageList/MessageForward/MessageForward.js +102 -124
- package/dist/components/MessageList/MessageForward/index.js +2 -2
- package/dist/components/MessageList/MessageList.js +129 -204
- package/dist/components/MessageList/MessageListContext.js +9 -10
- package/dist/components/MessageList/MessageTimeDivider/MessageTimeDivider.js +20 -28
- package/dist/components/MessageList/MessageTimeDivider/index.js +2 -2
- package/dist/components/MessageList/ReadReceiptInfo/ReadReceiptInfo.js +294 -379
- package/dist/components/MessageList/ReadReceiptInfo/index.js +2 -2
- package/dist/components/MessageList/ScrollToBottom/ScrollToBottom.js +20 -25
- package/dist/components/MessageList/ScrollToBottom/index.js +2 -2
- package/dist/components/MessageList/i18n/en-US.d.ts +20 -1
- package/dist/components/MessageList/i18n/en-US.js +21 -2
- package/dist/components/MessageList/i18n/index.d.ts +134 -92
- package/dist/components/MessageList/i18n/index.js +6 -6
- package/dist/components/MessageList/i18n/zh-CN.d.ts +20 -1
- package/dist/components/MessageList/i18n/zh-CN.js +21 -2
- package/dist/components/MessageList/index.js +9 -10
- package/dist/components/MicButton/AudioIcon.js +27 -37
- package/dist/components/MicButton/index.js +37 -52
- package/dist/components/Search/Search.js +117 -156
- package/dist/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.js +378 -505
- package/dist/components/Search/SearchAdvanced/DateRangePicker/index.js +2 -2
- package/dist/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.js +147 -211
- package/dist/components/Search/SearchAdvanced/MessageAdvanced/index.js +2 -2
- package/dist/components/Search/SearchAdvanced/SearchAdvanced.js +46 -60
- package/dist/components/Search/SearchAdvanced/SearchTab/SearchTab.js +39 -51
- package/dist/components/Search/SearchAdvanced/SearchTab/index.js +2 -2
- package/dist/components/Search/SearchAdvanced/Slider/Slider.js +53 -82
- package/dist/components/Search/SearchAdvanced/Slider/index.js +2 -2
- package/dist/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.js +247 -317
- package/dist/components/Search/SearchAdvanced/UserAdvanced/index.js +2 -2
- package/dist/components/Search/SearchAdvanced/index.js +12 -12
- package/dist/components/Search/SearchBar/SearchBar.js +98 -122
- package/dist/components/Search/SearchBar/index.js +2 -2
- package/dist/components/Search/SearchResults/EmptyResult/EmptyResult.js +26 -37
- package/dist/components/Search/SearchResults/EmptyResult/index.js +2 -2
- package/dist/components/Search/SearchResults/Loading/Loading.js +13 -19
- package/dist/components/Search/SearchResults/Loading/index.js +2 -2
- package/dist/components/Search/SearchResults/SearchResults.js +233 -339
- package/dist/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.js +61 -83
- package/dist/components/Search/SearchResults/SearchResultsItem/Conversation/index.js +2 -2
- package/dist/components/Search/SearchResults/SearchResultsItem/Group/Group.js +40 -52
- package/dist/components/Search/SearchResults/SearchResultsItem/Group/index.js +2 -2
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +134 -181
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/index.js +2 -2
- package/dist/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.js +40 -46
- package/dist/components/Search/SearchResults/SearchResultsItem/User/User.js +56 -75
- package/dist/components/Search/SearchResults/SearchResultsItem/User/index.js +2 -2
- package/dist/components/Search/SearchResults/SearchResultsItem/index.js +11 -11
- package/dist/components/Search/SearchResults/SearchResultsItem/utils/highlightText.js +17 -36
- package/dist/components/Search/SearchResults/SearchResultsItem/utils/index.js +2 -2
- package/dist/components/Search/SearchResults/index.js +16 -16
- package/dist/components/Search/i18n/en-US/DateRangePicker.js +3 -3
- package/dist/components/Search/i18n/en-US/Search.js +3 -3
- package/dist/components/Search/i18n/en-US/index.js +7 -7
- package/dist/components/Search/i18n/index.js +4 -4
- package/dist/components/Search/i18n/zh-CN/DateRangePicker.js +3 -3
- package/dist/components/Search/i18n/zh-CN/Search.js +3 -3
- package/dist/components/Search/i18n/zh-CN/index.js +7 -7
- package/dist/components/Search/index.js +20 -26
- package/dist/components/StreamMixer/LocalMixer/MixerControl.js +68 -100
- package/dist/components/StreamMixer/LocalMixer/index.js +103 -171
- package/dist/components/StreamMixer/i18n/en-US/index.js +2 -2
- package/dist/components/StreamMixer/i18n/index.js +4 -4
- package/dist/components/StreamMixer/i18n/zh-CN/index.js +2 -2
- package/dist/components/StreamMixer/icons/CameraMirror.js +13 -14
- package/dist/components/StreamMixer/icons/Delete.js +13 -14
- package/dist/components/StreamMixer/icons/Down.js +10 -11
- package/dist/components/StreamMixer/icons/Rotation.js +11 -12
- package/dist/components/StreamMixer/icons/Up.js +10 -11
- package/dist/components/StreamMixer/index.js +19 -21
- package/dist/components/StreamView/Layout/CustomLayout.js +132 -209
- package/dist/components/StreamView/Layout/FloatLayout.js +136 -199
- package/dist/components/StreamView/Layout/GridLayout.js +117 -197
- package/dist/components/StreamView/Layout/MeetingLayout.js +129 -231
- package/dist/components/StreamView/Layout/MixLayout.js +70 -98
- package/dist/components/StreamView/common/ArrowStroke.js +26 -29
- package/dist/components/StreamView/common/LocalScreenView/index.js +82 -92
- package/dist/components/StreamView/common/StreamCover/index.js +33 -62
- package/dist/components/StreamView/common/StreamList/index.js +103 -163
- package/dist/components/StreamView/common/StreamPlay/index.js +58 -98
- package/dist/components/StreamView/common/StreamRegion/StreamRegionPC.js +58 -90
- package/dist/components/StreamView/common/StreamRegion/index.js +2 -2
- package/dist/components/StreamView/index.js +64 -66
- package/dist/components/StreamView/manager/mediaManager.js +125 -236
- package/dist/components/UserList/AllUserActions/index.js +2 -2
- package/dist/components/UserList/AllUserActions/indexH5.js +59 -69
- package/dist/components/UserList/AllUserActions/indexPC.js +61 -73
- package/dist/components/UserList/AllUserActions/useIndexHooks.js +32 -39
- package/dist/components/UserList/UserItem/UserAction/index.js +2 -2
- package/dist/components/UserList/UserItem/UserAction/indexH5.js +47 -61
- package/dist/components/UserList/UserItem/UserAction/indexPC.js +86 -130
- package/dist/components/UserList/UserItem/UserInfo/index.js +67 -117
- package/dist/components/UserList/UserItem/UserInvite/index.js +18 -21
- package/dist/components/UserList/UserItem/index.js +2 -2
- package/dist/components/UserList/UserItem/indexH5.js +42 -54
- package/dist/components/UserList/UserItem/indexPC.js +32 -37
- package/dist/components/UserList/UserListContent/index.js +30 -44
- package/dist/components/UserList/UserListSearch/index.js +20 -26
- package/dist/components/UserList/index.js +50 -63
- package/dist/components/UserPicker/UserPicker.js +110 -148
- package/dist/components/UserPicker/components/ListMode/ListMode.js +70 -96
- package/dist/components/UserPicker/components/ListMode/index.js +2 -2
- package/dist/components/UserPicker/components/SearchBar/SearchBar.js +43 -58
- package/dist/components/UserPicker/components/SearchBar/index.js +2 -2
- package/dist/components/UserPicker/components/SelectedPanel/SelectedPanel.js +69 -94
- package/dist/components/UserPicker/components/SelectedPanel/index.js +2 -2
- package/dist/components/UserPicker/components/TreeMode/TreeMode.js +33 -42
- package/dist/components/UserPicker/components/TreeMode/TreeNode.js +81 -106
- package/dist/components/UserPicker/components/TreeMode/index.js +2 -2
- package/dist/components/UserPicker/hooks/useSearchFilter.js +39 -80
- package/dist/components/UserPicker/hooks/useSelection.js +155 -313
- package/dist/components/UserPicker/hooks/useTreeState.js +17 -37
- package/dist/components/UserPicker/i18n/en-US.js +2 -2
- package/dist/components/UserPicker/i18n/index.js +6 -6
- package/dist/components/UserPicker/i18n/zh-CN.js +2 -2
- package/dist/components/UserPicker/index.js +7 -7
- package/dist/components/VideoSetting/CameraSelect.js +46 -58
- package/dist/components/VideoSetting/VideoMediaControl.js +45 -65
- package/dist/components/VideoSetting/VideoPreview.js +31 -40
- package/dist/components/VideoSetting/VideoProfile.js +38 -46
- package/dist/components/VideoSetting/VideoRequestDialog.js +2 -2
- package/dist/components/VideoSetting/VideoSettingTab.js +43 -55
- package/dist/components/VideoSetting/index.js +3 -3
- package/dist/components/VideoSettingPanel/CameraSelect.js +45 -57
- package/dist/components/VideoSettingPanel/VideoPreview.js +30 -39
- package/dist/components/VideoSettingPanel/VideoProfile.js +36 -44
- package/dist/components/VideoSettingPanel/i18n/en-US/index.js +5 -5
- package/dist/components/VideoSettingPanel/i18n/index.js +4 -4
- package/dist/components/VideoSettingPanel/i18n/zh-CN/index.js +5 -5
- package/dist/components/VideoSettingPanel/index.js +48 -63
- package/dist/constants/emoji.js +3 -4
- package/dist/directives/vClickOutside.js +9 -23
- package/dist/directives/vDblTouch.js +26 -51
- package/dist/directives/vTap.js +37 -68
- package/dist/directives/vTouchScale.js +83 -155
- package/dist/handler/index.js +4 -4
- package/dist/handler/translator.js +65 -97
- package/dist/handler/voiceConverter.js +21 -30
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/useAudioControl.js +44 -128
- package/dist/hooks/useLongPress.js +41 -75
- package/dist/hooks/useMessageActions.d.ts +1 -1
- package/dist/hooks/useMessageActions.js +46 -57
- package/dist/hooks/useMouseHover.js +16 -26
- package/dist/hooks/useReadReceipt/useReadReceipt.js +66 -114
- package/dist/hooks/useRoomActions/index.js +11 -14
- package/dist/hooks/useRoomActions/useRoomAudioAction.js +39 -44
- package/dist/hooks/useRoomActions/useRoomScreenAction.js +41 -48
- package/dist/hooks/useRoomActions/useRoomVideoAction.js +38 -44
- package/dist/hooks/useRoomEngine.js +14 -17
- package/dist/hooks/useScroll.js +52 -89
- package/dist/hooks/useUserActions/index.js +81 -117
- package/dist/hooks/useUserActions/useAdminAction.js +29 -35
- package/dist/hooks/useUserActions/useAudioAction.js +36 -40
- package/dist/hooks/useUserActions/useChangeNameCardAction/changeNameCardDialog.js +59 -69
- package/dist/hooks/useUserActions/useChangeNameCardAction/changeNameCardInput.js +40 -49
- package/dist/hooks/useUserActions/useChangeNameCardAction/index.js +43 -51
- package/dist/hooks/useUserActions/useChatAction.js +23 -25
- package/dist/hooks/useUserActions/useKickUserAction.js +27 -32
- package/dist/hooks/useUserActions/useMemberInviteAction.js +24 -40
- package/dist/hooks/useUserActions/useSeatAction.js +96 -108
- package/dist/hooks/useUserActions/useTransferOwnerAction.js +40 -47
- package/dist/hooks/useUserActions/useVideoAction.js +35 -38
- package/dist/hooks/useZIndex.js +7 -12
- package/dist/i18n/index.js +4 -4
- package/dist/index-CeQ4nl87.js +44 -0
- package/dist/index-D-KJvDvy.js +5125 -0
- package/dist/index-D88ja_7_.js +12047 -0
- package/dist/index-DPczIrgX.js +42 -0
- package/dist/index-DTq2ybsB.js +33 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +178 -159
- package/dist/index.vue_vue_type_script_setup_true_lang-DZIBxSQ7.js +32 -0
- package/dist/locales/en-US.js +31 -31
- package/dist/locales/index.js +29 -34
- package/dist/locales/zh-CN.js +31 -31
- package/dist/rtc/index.d.ts +34 -2
- package/dist/rtc/index.js +63 -86
- package/dist/rtc/server.js +62 -85
- package/dist/states/BarrageListState/BarrageListState.js +98 -183
- package/dist/states/BarrageListState/index.js +2 -2
- package/dist/states/BattleState.d.ts +46 -0
- package/dist/states/BattleState.js +117 -0
- package/dist/states/C2CSettingState/C2CSettingState.js +52 -92
- package/dist/states/C2CSettingState/index.js +2 -2
- package/dist/states/CoGuestState.d.ts +1 -1
- package/dist/states/CoGuestState.js +191 -291
- package/dist/states/CoHostState/CoHostState.d.ts +30 -0
- package/dist/states/CoHostState/CoHostState.js +209 -0
- package/dist/states/CoHostState/index.d.ts +1 -0
- package/dist/states/CoHostState/index.js +4 -0
- package/dist/states/ContactListState/ContactListState.js +175 -271
- package/dist/states/ContactListState/index.js +2 -2
- package/dist/states/ConversationListState/ConversationListState.js +61 -112
- package/dist/states/ConversationListState/index.js +2 -2
- package/dist/states/DeviceState.js +240 -389
- package/dist/states/GroupSettingState/GroupSettingState.js +220 -378
- package/dist/states/GroupSettingState/index.js +7 -7
- package/dist/states/GroupSettingState/permissions.js +240 -250
- package/dist/states/GroupSettingState/types.js +5 -41
- package/dist/states/LiveAudienceState.js +100 -132
- package/dist/states/LiveMonitorState/api/http.js +1245 -1910
- package/dist/states/LiveMonitorState/index.js +92 -148
- package/dist/states/LiveMonitorState/player/adapters/trtc.js +54 -106
- package/dist/states/LiveMonitorState/player/base/basePlayer.js +111 -169
- package/dist/states/LiveMonitorState/player/index.js +10 -10
- package/dist/states/LiveMonitorState/player/manager/playerManager.js +27 -33
- package/dist/states/LiveMonitorState/player/types/index.js +8 -8
- package/dist/states/LiveMonitorState/player/types/player.js +3 -13
- package/dist/states/LiveMonitorState/player/types/trtc.js +6 -20
- package/dist/states/LiveMonitorState/utils/index.js +17 -22
- package/dist/states/LiveSeatState/index.js +16 -16
- package/dist/states/LiveSeatState/seatEventManager.js +54 -75
- package/dist/states/LiveSeatState/seatManager.js +29 -36
- package/dist/states/LiveSeatState/store.js +18 -25
- package/dist/states/LiveSeatState/usePlayStream/MixStreamPlayer.js +43 -65
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamManager.js +55 -83
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamPlayer.js +59 -97
- package/dist/states/LiveSeatState/usePlayStream/index.js +44 -96
- package/dist/states/LiveSeatState/usePlayStream/useStreamPostion.js +43 -55
- package/dist/states/LiveState/index.js +190 -275
- package/dist/states/LoginState.js +48 -62
- package/dist/states/MessageActionState/MessageActionState.d.ts +6 -6
- package/dist/states/MessageActionState/MessageActionState.js +45 -56
- package/dist/states/MessageActionState/index.js +2 -2
- package/dist/states/MessageInputState/MessageInputState.js +90 -139
- package/dist/states/MessageInputState/index.js +4 -4
- package/dist/states/MessageInputState/type.js +2 -10
- package/dist/states/MessageInputState/utils.js +20 -21
- package/dist/states/MessageListState/MessageListState.js +65 -89
- package/dist/states/MessageListState/index.js +2 -2
- package/dist/states/RoomState.js +223 -332
- package/dist/states/SearchState.d.ts +2 -2
- package/dist/states/SearchState.js +229 -356
- package/dist/states/SeatStore.js +140 -213
- package/dist/states/UserState/index.js +31 -51
- package/dist/states/UserState/store.js +95 -147
- package/dist/states/UserState/userEventManager.js +85 -134
- package/dist/states/UserState/userManager.js +184 -232
- package/dist/states/VideoMixerState.js +181 -228
- package/dist/statistical/const.js +2 -6
- package/dist/statistical/index.js +4 -4
- package/dist/statistical/statistical.js +12 -12
- package/dist/styles/index.css +1 -13145
- package/dist/types/battle.d.ts +11 -0
- package/dist/types/battle.js +1 -0
- package/dist/types/call.d.ts +55 -0
- package/dist/types/call.js +4 -0
- package/dist/types/chatSetting.js +4 -4
- package/dist/types/coGuest.js +2 -8
- package/dist/types/coHost.d.ts +44 -4
- package/dist/types/coHost.js +4 -8
- package/dist/types/contact.js +3 -17
- package/dist/types/conversation.js +6 -36
- package/dist/types/device.d.ts +4 -0
- package/dist/types/device.js +8 -45
- package/dist/types/engine.d.ts +23 -7
- package/dist/types/engine.js +5 -23
- package/dist/types/index.d.ts +9 -6
- package/dist/types/index.js +92 -84
- package/dist/types/live.js +4 -21
- package/dist/types/message.js +4 -29
- package/dist/types/monitor.js +2 -6
- package/dist/types/room.js +3 -16
- package/dist/types/search.js +9 -15
- package/dist/types/seat.d.ts +4 -4
- package/dist/types/stream.js +3 -14
- package/dist/types/types.js +32 -329
- package/dist/types/user.d.ts +0 -3
- package/dist/types/user.js +8 -65
- package/dist/useId-CtirfF0W.js +12 -0
- package/dist/utils/call.d.ts +6 -2
- package/dist/utils/call.js +126 -11
- package/dist/utils/copyText.js +20 -33
- package/dist/utils/documentLink.js +2 -2
- package/dist/utils/domOperation.js +99 -122
- package/dist/utils/downFile.js +11 -19
- package/dist/utils/emoji.js +24 -31
- package/dist/utils/enableSampleTaskStatus.js +5 -8
- package/dist/utils/env.js +8 -13
- package/dist/utils/environment.js +14 -18
- package/dist/utils/index.js +36 -36
- package/dist/utils/json.js +34 -58
- package/dist/utils/lodash.js +63 -109
- package/dist/utils/riseInput.js +19 -36
- package/dist/utils/time.js +640 -934
- package/dist/utils/type-check.js +21 -46
- package/dist/utils/utils.js +131 -235
- package/dist/utils-DaB7eSu5.js +48 -0
- package/package.json +5 -4
- package/src/chat/index.ts +18 -0
- package/src/components/BarrageInput/TextEditor/Editor.scss +2 -2
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +1 -1
- package/src/components/ChatSetting/ChatSetting.vue +3 -3
- package/src/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.vue +3 -0
- package/src/components/ChatSetting/GroupChatSetting/GroupChatSetting.vue +1 -0
- package/src/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.vue +1 -0
- package/src/components/CoGuestPanel/CoGuestPanel.vue +2 -1
- package/src/components/CoHostPanel/BattlePanel.vue +271 -0
- package/src/components/CoHostPanel/CoHostPanel.vue +218 -0
- package/src/components/CoHostPanel/ConfigSettingPanel.vue +264 -0
- package/src/components/CoHostPanel/ConnectionPanel.vue +549 -0
- package/src/components/CoHostPanel/RecommendHostList.vue +306 -0
- package/src/components/CoHostPanel/UserList.vue +93 -0
- package/src/components/CoHostPanel/i18n/en-US/index.ts +78 -0
- package/src/components/CoHostPanel/i18n/index.ts +4 -0
- package/src/components/CoHostPanel/i18n/zh-CN/index.ts +79 -0
- package/src/components/CoHostPanel/index.ts +7 -0
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.vue +1 -0
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +1 -0
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.vue +1 -1
- package/src/components/ConversationList/ConversationSearch/ConversationSearch.vue +1 -0
- package/src/components/LiveCoreView/CoreViewDecorate/BattleDecorate.vue +420 -0
- package/src/components/LiveCoreView/CoreViewDecorate/BattleUserDecorate.vue +141 -0
- package/src/components/LiveCoreView/CoreViewDecorate/CoHostDecorate.vue +116 -0
- package/src/components/LiveCoreView/CoreViewDecorate/LiveCoreDecorate.vue +70 -0
- package/src/components/LiveCoreView/PlayerControl/MultiResolution.vue +130 -0
- package/src/components/LiveCoreView/PlayerControl/PlayerControl.vue +10 -8
- package/src/components/LiveCoreView/PlayerControl/PlayerControlState.ts +117 -1
- package/src/components/LiveCoreView/assets/img/defeat.png +0 -0
- package/src/components/LiveCoreView/assets/img/draw.png +0 -0
- package/src/components/LiveCoreView/assets/img/victory.png +0 -0
- package/src/components/LiveCoreView/assets/svg/BattleOrdinaryBadge.svg +20 -0
- package/src/components/LiveCoreView/assets/svg/BattleTopBadge.svg +16 -0
- package/src/components/LiveCoreView/assets/svg/blueBkg.svg +9 -0
- package/src/components/LiveCoreView/assets/svg/redBkg.svg +9 -0
- package/src/components/LiveCoreView/assets/svg/s.svg +17 -0
- package/src/components/LiveCoreView/assets/svg/v.svg +17 -0
- package/src/components/LiveCoreView/i18n/en-US/index.ts +6 -0
- package/src/components/LiveCoreView/i18n/zh-CN/index.ts +6 -0
- package/src/components/LiveCoreView/index.vue +4 -1
- package/src/components/LiveList/LiveList.vue +61 -106
- package/src/components/LiveList/LiveListH5.vue +1 -1
- package/src/components/LiveList/i18n/en-US/index.ts +1 -1
- package/src/components/LiveList/i18n/zh-CN/index.ts +1 -1
- package/src/components/MessageInput/AttachmentPicker/AttachmentPicker.vue +10 -8
- package/src/components/MessageInput/AttachmentPicker/FilePicker.vue +59 -31
- package/src/components/MessageInput/AttachmentPicker/ImagePicker.vue +58 -31
- package/src/components/MessageInput/AttachmentPicker/VideoPicker.vue +58 -31
- package/src/components/MessageInput/AudioCallPicker/AudioCallPicker.vue +240 -0
- package/src/components/MessageInput/AudioCallPicker/index.ts +3 -0
- package/src/components/MessageInput/EmojiPicker/EmojiPicker.vue +107 -18
- package/src/components/MessageInput/MessageInput.module.scss +1 -1
- package/src/components/MessageInput/MessageInput.vue +6 -2
- package/src/components/MessageInput/VideoCallPicker/VideoCallPicker.vue +246 -0
- package/src/components/MessageInput/VideoCallPicker/index.ts +3 -0
- package/src/components/MessageInput/i18n/en-US.ts +4 -0
- package/src/components/MessageInput/index.ts +10 -4
- package/src/components/MessageInput/types.d.ts +3 -1
- package/src/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.vue +67 -0
- package/src/components/MessageList/Message/CustomMessage/CallMessage/index.ts +3 -0
- package/src/components/MessageList/Message/CustomMessage/CustomMessage.vue +59 -2
- package/src/components/MessageList/Message/CustomMessage/index.ts +1 -1
- package/src/components/MessageList/Message/GroupTipMessage/GroupTipMessage.vue +9 -10
- package/src/components/MessageList/Message/GroupTipMessage/resolveGroupTipMessage.ts +1 -1
- package/src/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue +1 -1
- package/src/components/MessageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +1 -1
- package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +30 -18
- package/src/components/MessageList/i18n/en-US.ts +24 -1
- package/src/components/MessageList/i18n/index.ts +4 -4
- package/src/components/MessageList/i18n/zh-CN.ts +24 -1
- package/src/components/MessageList/index.ts +2 -2
- package/src/components/UserPicker/UserPicker.vue +0 -2
- package/src/hooks/index.ts +1 -2
- package/src/hooks/useMessageActions.ts +3 -3
- package/src/index.ts +2 -1
- package/src/rtc/index.ts +5 -0
- package/src/types/battle.ts +12 -0
- package/src/types/call.ts +62 -0
- package/src/types/coHost.ts +46 -4
- package/src/types/device.ts +5 -0
- package/src/types/engine.ts +45 -21
- package/src/types/index.ts +12 -6
- package/src/types/seat.ts +5 -5
- package/src/types/user.ts +0 -4
- package/src/utils/call.ts +233 -5
- package/src/utils/time.ts +1 -1
- package/dist/AttachmentPicker.module-BesmtGyl.js +0 -11
- package/dist/AudioRequestDialog.vue_vue_type_script_setup_true_lang-BmX-qsat.js +0 -108
- package/dist/DialogPortal-DWeT-J6v.js +0 -496
- package/dist/FilePicker.vue_vue_type_script_setup_true_lang-CdJ4DUzE.js +0 -76
- package/dist/ImagePicker.vue_vue_type_script_setup_true_lang-CbNUofpK.js +0 -76
- package/dist/MaterialRenameDialog.vue_vue_type_script_setup_true_lang-CVh4Regz.js +0 -43
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-wUJPjWbx.js +0 -128
- package/dist/PopoverTrigger-BKOIHfdS.js +0 -679
- package/dist/PopperContent-DtL7HVWz.js +0 -2227
- package/dist/Teleport-CMvGsENT.js +0 -1365
- package/dist/VideoPicker.vue_vue_type_script_setup_true_lang-CmxjbNDJ.js +0 -76
- package/dist/VideoRequestDialog.vue_vue_type_script_setup_true_lang-CnE-LwNh.js +0 -108
- package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
- package/dist/_plugin-vue_export-helper-1tPrXgE0.js +0 -10
- package/dist/index-BF6QB9jF.js +0 -63
- package/dist/index-BPFJrNlA.js +0 -15915
- package/dist/index-CX1Zs9En.js +0 -44
- package/dist/index-DRcLhqhU.js +0 -38
- package/dist/index-v15JHz0-.js +0 -7655
- package/dist/index.vue_vue_type_script_setup_true_lang-EcKm3pYY.js +0 -36
- package/dist/states/CoHostState.d.ts +0 -22
- package/dist/states/CoHostState.js +0 -178
- package/dist/useId-CsgLY8y3.js +0 -13
- package/dist/utils-KP1QpeUS.js +0 -59
- package/src/components/MessageInput/EmojiPicker/EmojiPicker.module.scss +0 -28
|
@@ -1,1365 +0,0 @@
|
|
|
1
|
-
import { inject, provide, Fragment, effectScope, getCurrentScope, onScopeDispose, onBeforeUnmount, getCurrentInstance, computed, shallowRef, watchEffect, readonly, customRef, toValue, watch, isRef, reactive, unref, toRefs, ref, nextTick, onMounted, toHandlerKey, camelize, onUnmounted, defineComponent, h, Comment, mergeProps, cloneVNode, createBlock, openBlock, normalizeStyle, withCtx, renderSlot, createCommentVNode, Teleport } from "vue";
|
|
2
|
-
function createContext(providerComponentName, contextName) {
|
|
3
|
-
const symbolDescription = typeof providerComponentName === "string" && !contextName ? `${providerComponentName}Context` : contextName;
|
|
4
|
-
const injectionKey = Symbol(symbolDescription);
|
|
5
|
-
const injectContext = (fallback) => {
|
|
6
|
-
const context2 = inject(injectionKey, fallback);
|
|
7
|
-
if (context2) return context2;
|
|
8
|
-
if (context2 === null) return context2;
|
|
9
|
-
throw new Error(`Injection \`${injectionKey.toString()}\` not found. Component must be used within ${Array.isArray(providerComponentName) ? `one of the following components: ${providerComponentName.join(", ")}` : `\`${providerComponentName}\``}`);
|
|
10
|
-
};
|
|
11
|
-
const provideContext = (contextValue) => {
|
|
12
|
-
provide(injectionKey, contextValue);
|
|
13
|
-
return contextValue;
|
|
14
|
-
};
|
|
15
|
-
return [injectContext, provideContext];
|
|
16
|
-
}
|
|
17
|
-
function getActiveElement() {
|
|
18
|
-
let activeElement = document.activeElement;
|
|
19
|
-
if (activeElement == null) return null;
|
|
20
|
-
while (activeElement != null && activeElement.shadowRoot != null && activeElement.shadowRoot.activeElement != null) activeElement = activeElement.shadowRoot.activeElement;
|
|
21
|
-
return activeElement;
|
|
22
|
-
}
|
|
23
|
-
function handleAndDispatchCustomEvent(name, handler, detail) {
|
|
24
|
-
const target = detail.originalEvent.target;
|
|
25
|
-
const event = new CustomEvent(name, {
|
|
26
|
-
bubbles: false,
|
|
27
|
-
cancelable: true,
|
|
28
|
-
detail
|
|
29
|
-
});
|
|
30
|
-
if (handler) target.addEventListener(name, handler, { once: true });
|
|
31
|
-
target.dispatchEvent(event);
|
|
32
|
-
}
|
|
33
|
-
function renderSlotFragments(children) {
|
|
34
|
-
if (!children) return [];
|
|
35
|
-
return children.flatMap((child) => {
|
|
36
|
-
if (child.type === Fragment) return renderSlotFragments(child.children);
|
|
37
|
-
return [child];
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
const [injectConfigProviderContext, provideConfigProviderContext] = createContext("ConfigProvider");
|
|
41
|
-
function computedEager(fn, options) {
|
|
42
|
-
var _a;
|
|
43
|
-
const result = shallowRef();
|
|
44
|
-
watchEffect(() => {
|
|
45
|
-
result.value = fn();
|
|
46
|
-
}, {
|
|
47
|
-
...options,
|
|
48
|
-
flush: (_a = void 0) != null ? _a : "sync"
|
|
49
|
-
});
|
|
50
|
-
return readonly(result);
|
|
51
|
-
}
|
|
52
|
-
function tryOnScopeDispose(fn) {
|
|
53
|
-
if (getCurrentScope()) {
|
|
54
|
-
onScopeDispose(fn);
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
function createGlobalState(stateFactory) {
|
|
60
|
-
let initialized = false;
|
|
61
|
-
let state;
|
|
62
|
-
const scope = effectScope(true);
|
|
63
|
-
return (...args) => {
|
|
64
|
-
if (!initialized) {
|
|
65
|
-
state = scope.run(() => stateFactory(...args));
|
|
66
|
-
initialized = true;
|
|
67
|
-
}
|
|
68
|
-
return state;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function createSharedComposable(composable) {
|
|
72
|
-
let subscribers = 0;
|
|
73
|
-
let state;
|
|
74
|
-
let scope;
|
|
75
|
-
const dispose = () => {
|
|
76
|
-
subscribers -= 1;
|
|
77
|
-
if (scope && subscribers <= 0) {
|
|
78
|
-
scope.stop();
|
|
79
|
-
state = void 0;
|
|
80
|
-
scope = void 0;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
return (...args) => {
|
|
84
|
-
subscribers += 1;
|
|
85
|
-
if (!scope) {
|
|
86
|
-
scope = effectScope(true);
|
|
87
|
-
state = scope.run(() => composable(...args));
|
|
88
|
-
}
|
|
89
|
-
tryOnScopeDispose(dispose);
|
|
90
|
-
return state;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function toReactive(objectRef) {
|
|
94
|
-
if (!isRef(objectRef))
|
|
95
|
-
return reactive(objectRef);
|
|
96
|
-
const proxy = new Proxy({}, {
|
|
97
|
-
get(_, p, receiver) {
|
|
98
|
-
return unref(Reflect.get(objectRef.value, p, receiver));
|
|
99
|
-
},
|
|
100
|
-
set(_, p, value) {
|
|
101
|
-
if (isRef(objectRef.value[p]) && !isRef(value))
|
|
102
|
-
objectRef.value[p].value = value;
|
|
103
|
-
else
|
|
104
|
-
objectRef.value[p] = value;
|
|
105
|
-
return true;
|
|
106
|
-
},
|
|
107
|
-
deleteProperty(_, p) {
|
|
108
|
-
return Reflect.deleteProperty(objectRef.value, p);
|
|
109
|
-
},
|
|
110
|
-
has(_, p) {
|
|
111
|
-
return Reflect.has(objectRef.value, p);
|
|
112
|
-
},
|
|
113
|
-
ownKeys() {
|
|
114
|
-
return Object.keys(objectRef.value);
|
|
115
|
-
},
|
|
116
|
-
getOwnPropertyDescriptor() {
|
|
117
|
-
return {
|
|
118
|
-
enumerable: true,
|
|
119
|
-
configurable: true
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
return reactive(proxy);
|
|
124
|
-
}
|
|
125
|
-
function reactiveComputed(fn) {
|
|
126
|
-
return toReactive(computed(fn));
|
|
127
|
-
}
|
|
128
|
-
function reactiveOmit(obj, ...keys) {
|
|
129
|
-
const flatKeys = keys.flat();
|
|
130
|
-
const predicate = flatKeys[0];
|
|
131
|
-
return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs(obj)).filter((e) => !flatKeys.includes(e[0]))));
|
|
132
|
-
}
|
|
133
|
-
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
134
|
-
const isDef = (val) => typeof val !== "undefined";
|
|
135
|
-
const toString = Object.prototype.toString;
|
|
136
|
-
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
137
|
-
const isIOS = /* @__PURE__ */ getIsIOS();
|
|
138
|
-
function getIsIOS() {
|
|
139
|
-
var _a, _b;
|
|
140
|
-
return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
141
|
-
}
|
|
142
|
-
function getLifeCycleTarget(target) {
|
|
143
|
-
return getCurrentInstance();
|
|
144
|
-
}
|
|
145
|
-
function toArray(value) {
|
|
146
|
-
return Array.isArray(value) ? value : [value];
|
|
147
|
-
}
|
|
148
|
-
function refAutoReset(defaultValue, afterMs = 1e4) {
|
|
149
|
-
return customRef((track, trigger) => {
|
|
150
|
-
let value = toValue(defaultValue);
|
|
151
|
-
let timer;
|
|
152
|
-
const resetAfter = () => setTimeout(() => {
|
|
153
|
-
value = toValue(defaultValue);
|
|
154
|
-
trigger();
|
|
155
|
-
}, toValue(afterMs));
|
|
156
|
-
tryOnScopeDispose(() => {
|
|
157
|
-
clearTimeout(timer);
|
|
158
|
-
});
|
|
159
|
-
return {
|
|
160
|
-
get() {
|
|
161
|
-
track();
|
|
162
|
-
return value;
|
|
163
|
-
},
|
|
164
|
-
set(newValue) {
|
|
165
|
-
value = newValue;
|
|
166
|
-
trigger();
|
|
167
|
-
clearTimeout(timer);
|
|
168
|
-
timer = resetAfter();
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
function tryOnBeforeUnmount(fn, target) {
|
|
174
|
-
const instance = getLifeCycleTarget();
|
|
175
|
-
if (instance)
|
|
176
|
-
onBeforeUnmount(fn, target);
|
|
177
|
-
}
|
|
178
|
-
function watchImmediate(source, cb, options) {
|
|
179
|
-
return watch(
|
|
180
|
-
source,
|
|
181
|
-
cb,
|
|
182
|
-
{
|
|
183
|
-
...options,
|
|
184
|
-
immediate: true
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
const defaultWindow = isClient ? window : void 0;
|
|
189
|
-
function unrefElement(elRef) {
|
|
190
|
-
var _a;
|
|
191
|
-
const plain = toValue(elRef);
|
|
192
|
-
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
193
|
-
}
|
|
194
|
-
function useEventListener(...args) {
|
|
195
|
-
const cleanups = [];
|
|
196
|
-
const cleanup = () => {
|
|
197
|
-
cleanups.forEach((fn) => fn());
|
|
198
|
-
cleanups.length = 0;
|
|
199
|
-
};
|
|
200
|
-
const register = (el, event, listener, options) => {
|
|
201
|
-
el.addEventListener(event, listener, options);
|
|
202
|
-
return () => el.removeEventListener(event, listener, options);
|
|
203
|
-
};
|
|
204
|
-
const firstParamTargets = computed(() => {
|
|
205
|
-
const test = toArray(toValue(args[0])).filter((e) => e != null);
|
|
206
|
-
return test.every((e) => typeof e !== "string") ? test : void 0;
|
|
207
|
-
});
|
|
208
|
-
const stopWatch = watchImmediate(
|
|
209
|
-
() => {
|
|
210
|
-
var _a, _b;
|
|
211
|
-
return [
|
|
212
|
-
(_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
|
|
213
|
-
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
|
|
214
|
-
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
|
|
215
|
-
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
216
|
-
toValue(firstParamTargets.value ? args[3] : args[2])
|
|
217
|
-
];
|
|
218
|
-
},
|
|
219
|
-
([raw_targets, raw_events, raw_listeners, raw_options]) => {
|
|
220
|
-
cleanup();
|
|
221
|
-
if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length))
|
|
222
|
-
return;
|
|
223
|
-
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
|
|
224
|
-
cleanups.push(
|
|
225
|
-
...raw_targets.flatMap(
|
|
226
|
-
(el) => raw_events.flatMap(
|
|
227
|
-
(event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
|
|
228
|
-
)
|
|
229
|
-
)
|
|
230
|
-
);
|
|
231
|
-
},
|
|
232
|
-
{ flush: "post" }
|
|
233
|
-
);
|
|
234
|
-
const stop = () => {
|
|
235
|
-
stopWatch();
|
|
236
|
-
cleanup();
|
|
237
|
-
};
|
|
238
|
-
tryOnScopeDispose(cleanup);
|
|
239
|
-
return stop;
|
|
240
|
-
}
|
|
241
|
-
function useMounted() {
|
|
242
|
-
const isMounted = shallowRef(false);
|
|
243
|
-
const instance = getCurrentInstance();
|
|
244
|
-
if (instance) {
|
|
245
|
-
onMounted(() => {
|
|
246
|
-
isMounted.value = true;
|
|
247
|
-
}, instance);
|
|
248
|
-
}
|
|
249
|
-
return isMounted;
|
|
250
|
-
}
|
|
251
|
-
function createKeyPredicate(keyFilter) {
|
|
252
|
-
if (typeof keyFilter === "function")
|
|
253
|
-
return keyFilter;
|
|
254
|
-
else if (typeof keyFilter === "string")
|
|
255
|
-
return (event) => event.key === keyFilter;
|
|
256
|
-
else if (Array.isArray(keyFilter))
|
|
257
|
-
return (event) => keyFilter.includes(event.key);
|
|
258
|
-
return () => true;
|
|
259
|
-
}
|
|
260
|
-
function onKeyStroke(...args) {
|
|
261
|
-
let key;
|
|
262
|
-
let handler;
|
|
263
|
-
let options = {};
|
|
264
|
-
if (args.length === 3) {
|
|
265
|
-
key = args[0];
|
|
266
|
-
handler = args[1];
|
|
267
|
-
options = args[2];
|
|
268
|
-
} else if (args.length === 2) {
|
|
269
|
-
if (typeof args[1] === "object") {
|
|
270
|
-
key = true;
|
|
271
|
-
handler = args[0];
|
|
272
|
-
options = args[1];
|
|
273
|
-
} else {
|
|
274
|
-
key = args[0];
|
|
275
|
-
handler = args[1];
|
|
276
|
-
}
|
|
277
|
-
} else {
|
|
278
|
-
key = true;
|
|
279
|
-
handler = args[0];
|
|
280
|
-
}
|
|
281
|
-
const {
|
|
282
|
-
target = defaultWindow,
|
|
283
|
-
eventName = "keydown",
|
|
284
|
-
passive = false,
|
|
285
|
-
dedupe = false
|
|
286
|
-
} = options;
|
|
287
|
-
const predicate = createKeyPredicate(key);
|
|
288
|
-
const listener = (e) => {
|
|
289
|
-
if (e.repeat && toValue(dedupe))
|
|
290
|
-
return;
|
|
291
|
-
if (predicate(e))
|
|
292
|
-
handler(e);
|
|
293
|
-
};
|
|
294
|
-
return useEventListener(target, eventName, listener, passive);
|
|
295
|
-
}
|
|
296
|
-
function cloneFnJSON(source) {
|
|
297
|
-
return JSON.parse(JSON.stringify(source));
|
|
298
|
-
}
|
|
299
|
-
function useVModel(props, key, emit, options = {}) {
|
|
300
|
-
var _a, _b, _c;
|
|
301
|
-
const {
|
|
302
|
-
clone = false,
|
|
303
|
-
passive = false,
|
|
304
|
-
eventName,
|
|
305
|
-
deep = false,
|
|
306
|
-
defaultValue,
|
|
307
|
-
shouldEmit
|
|
308
|
-
} = options;
|
|
309
|
-
const vm = getCurrentInstance();
|
|
310
|
-
const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));
|
|
311
|
-
let event = eventName;
|
|
312
|
-
if (!key) {
|
|
313
|
-
key = "modelValue";
|
|
314
|
-
}
|
|
315
|
-
event = event || `update:${key.toString()}`;
|
|
316
|
-
const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
|
|
317
|
-
const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;
|
|
318
|
-
const triggerEmit = (value) => {
|
|
319
|
-
if (shouldEmit) {
|
|
320
|
-
if (shouldEmit(value))
|
|
321
|
-
_emit(event, value);
|
|
322
|
-
} else {
|
|
323
|
-
_emit(event, value);
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
if (passive) {
|
|
327
|
-
const initialValue = getValue();
|
|
328
|
-
const proxy = ref(initialValue);
|
|
329
|
-
let isUpdating = false;
|
|
330
|
-
watch(
|
|
331
|
-
() => props[key],
|
|
332
|
-
(v) => {
|
|
333
|
-
if (!isUpdating) {
|
|
334
|
-
isUpdating = true;
|
|
335
|
-
proxy.value = cloneFn(v);
|
|
336
|
-
nextTick(() => isUpdating = false);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
);
|
|
340
|
-
watch(
|
|
341
|
-
proxy,
|
|
342
|
-
(v) => {
|
|
343
|
-
if (!isUpdating && (v !== props[key] || deep))
|
|
344
|
-
triggerEmit(v);
|
|
345
|
-
},
|
|
346
|
-
{ deep }
|
|
347
|
-
);
|
|
348
|
-
return proxy;
|
|
349
|
-
} else {
|
|
350
|
-
return computed({
|
|
351
|
-
get() {
|
|
352
|
-
return getValue();
|
|
353
|
-
},
|
|
354
|
-
set(value) {
|
|
355
|
-
triggerEmit(value);
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
function isPlainObject(value) {
|
|
361
|
-
if (value === null || typeof value !== "object") {
|
|
362
|
-
return false;
|
|
363
|
-
}
|
|
364
|
-
const prototype = Object.getPrototypeOf(value);
|
|
365
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
366
|
-
return false;
|
|
367
|
-
}
|
|
368
|
-
if (Symbol.iterator in value) {
|
|
369
|
-
return false;
|
|
370
|
-
}
|
|
371
|
-
if (Symbol.toStringTag in value) {
|
|
372
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
373
|
-
}
|
|
374
|
-
return true;
|
|
375
|
-
}
|
|
376
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
377
|
-
if (!isPlainObject(defaults)) {
|
|
378
|
-
return _defu(baseObject, {}, namespace, merger);
|
|
379
|
-
}
|
|
380
|
-
const object = Object.assign({}, defaults);
|
|
381
|
-
for (const key in baseObject) {
|
|
382
|
-
if (key === "__proto__" || key === "constructor") {
|
|
383
|
-
continue;
|
|
384
|
-
}
|
|
385
|
-
const value = baseObject[key];
|
|
386
|
-
if (value === null || value === void 0) {
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
if (merger && merger(object, key, value, namespace)) {
|
|
390
|
-
continue;
|
|
391
|
-
}
|
|
392
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
393
|
-
object[key] = [...value, ...object[key]];
|
|
394
|
-
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
395
|
-
object[key] = _defu(
|
|
396
|
-
value,
|
|
397
|
-
object[key],
|
|
398
|
-
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
399
|
-
merger
|
|
400
|
-
);
|
|
401
|
-
} else {
|
|
402
|
-
object[key] = value;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return object;
|
|
406
|
-
}
|
|
407
|
-
function createDefu(merger) {
|
|
408
|
-
return (...arguments_) => (
|
|
409
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
410
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
const defu = createDefu();
|
|
414
|
-
const useBodyLockStackCount = createSharedComposable(() => {
|
|
415
|
-
const map = ref(/* @__PURE__ */ new Map());
|
|
416
|
-
const initialOverflow = ref();
|
|
417
|
-
const locked = computed(() => {
|
|
418
|
-
for (const value of map.value.values()) if (value) return true;
|
|
419
|
-
return false;
|
|
420
|
-
});
|
|
421
|
-
const context2 = injectConfigProviderContext({ scrollBody: ref(true) });
|
|
422
|
-
let stopTouchMoveListener = null;
|
|
423
|
-
const resetBodyStyle = () => {
|
|
424
|
-
document.body.style.paddingRight = "";
|
|
425
|
-
document.body.style.marginRight = "";
|
|
426
|
-
document.body.style.pointerEvents = "";
|
|
427
|
-
document.documentElement.style.removeProperty("--scrollbar-width");
|
|
428
|
-
document.body.style.overflow = initialOverflow.value ?? "";
|
|
429
|
-
isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
|
|
430
|
-
initialOverflow.value = void 0;
|
|
431
|
-
};
|
|
432
|
-
watch(locked, (val, oldVal) => {
|
|
433
|
-
var _a;
|
|
434
|
-
if (!isClient) return;
|
|
435
|
-
if (!val) {
|
|
436
|
-
if (oldVal) resetBodyStyle();
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
if (initialOverflow.value === void 0) initialOverflow.value = document.body.style.overflow;
|
|
440
|
-
const verticalScrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
441
|
-
const defaultConfig = {
|
|
442
|
-
padding: verticalScrollbarWidth,
|
|
443
|
-
margin: 0
|
|
444
|
-
};
|
|
445
|
-
const config = ((_a = context2.scrollBody) == null ? void 0 : _a.value) ? typeof context2.scrollBody.value === "object" ? defu({
|
|
446
|
-
padding: context2.scrollBody.value.padding === true ? verticalScrollbarWidth : context2.scrollBody.value.padding,
|
|
447
|
-
margin: context2.scrollBody.value.margin === true ? verticalScrollbarWidth : context2.scrollBody.value.margin
|
|
448
|
-
}, defaultConfig) : defaultConfig : {
|
|
449
|
-
padding: 0,
|
|
450
|
-
margin: 0
|
|
451
|
-
};
|
|
452
|
-
if (verticalScrollbarWidth > 0) {
|
|
453
|
-
document.body.style.paddingRight = typeof config.padding === "number" ? `${config.padding}px` : String(config.padding);
|
|
454
|
-
document.body.style.marginRight = typeof config.margin === "number" ? `${config.margin}px` : String(config.margin);
|
|
455
|
-
document.documentElement.style.setProperty("--scrollbar-width", `${verticalScrollbarWidth}px`);
|
|
456
|
-
document.body.style.overflow = "hidden";
|
|
457
|
-
}
|
|
458
|
-
if (isIOS) stopTouchMoveListener = useEventListener(document, "touchmove", (e) => preventDefault(e), { passive: false });
|
|
459
|
-
nextTick(() => {
|
|
460
|
-
document.body.style.pointerEvents = "none";
|
|
461
|
-
document.body.style.overflow = "hidden";
|
|
462
|
-
});
|
|
463
|
-
}, {
|
|
464
|
-
immediate: true,
|
|
465
|
-
flush: "sync"
|
|
466
|
-
});
|
|
467
|
-
return map;
|
|
468
|
-
});
|
|
469
|
-
function useBodyScrollLock(initialState) {
|
|
470
|
-
const id = Math.random().toString(36).substring(2, 7);
|
|
471
|
-
const map = useBodyLockStackCount();
|
|
472
|
-
map.value.set(id, initialState ?? false);
|
|
473
|
-
const locked = computed({
|
|
474
|
-
get: () => map.value.get(id) ?? false,
|
|
475
|
-
set: (value) => map.value.set(id, value)
|
|
476
|
-
});
|
|
477
|
-
tryOnBeforeUnmount(() => {
|
|
478
|
-
map.value.delete(id);
|
|
479
|
-
});
|
|
480
|
-
return locked;
|
|
481
|
-
}
|
|
482
|
-
function checkOverflowScroll(ele) {
|
|
483
|
-
const style = window.getComputedStyle(ele);
|
|
484
|
-
if (style.overflowX === "scroll" || style.overflowY === "scroll" || style.overflowX === "auto" && ele.clientWidth < ele.scrollWidth || style.overflowY === "auto" && ele.clientHeight < ele.scrollHeight) return true;
|
|
485
|
-
else {
|
|
486
|
-
const parent = ele.parentNode;
|
|
487
|
-
if (!(parent instanceof Element) || parent.tagName === "BODY") return false;
|
|
488
|
-
return checkOverflowScroll(parent);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
function preventDefault(rawEvent) {
|
|
492
|
-
const e = rawEvent || window.event;
|
|
493
|
-
const _target = e.target;
|
|
494
|
-
if (_target instanceof Element && checkOverflowScroll(_target)) return false;
|
|
495
|
-
if (e.touches.length > 1) return true;
|
|
496
|
-
if (e.preventDefault && e.cancelable) e.preventDefault();
|
|
497
|
-
return false;
|
|
498
|
-
}
|
|
499
|
-
function useEmitAsProps(emit) {
|
|
500
|
-
const vm = getCurrentInstance();
|
|
501
|
-
const events = vm == null ? void 0 : vm.type.emits;
|
|
502
|
-
const result = {};
|
|
503
|
-
if (!(events == null ? void 0 : events.length)) console.warn(`No emitted event found. Please check component: ${vm == null ? void 0 : vm.type.__name}`);
|
|
504
|
-
events == null ? void 0 : events.forEach((ev) => {
|
|
505
|
-
result[toHandlerKey(camelize(ev))] = (...arg) => emit(ev, ...arg);
|
|
506
|
-
});
|
|
507
|
-
return result;
|
|
508
|
-
}
|
|
509
|
-
function useForwardExpose() {
|
|
510
|
-
const instance = getCurrentInstance();
|
|
511
|
-
const currentRef = ref();
|
|
512
|
-
const currentElement = computed(() => {
|
|
513
|
-
var _a, _b;
|
|
514
|
-
return ["#text", "#comment"].includes((_a = currentRef.value) == null ? void 0 : _a.$el.nodeName) ? (_b = currentRef.value) == null ? void 0 : _b.$el.nextElementSibling : unrefElement(currentRef);
|
|
515
|
-
});
|
|
516
|
-
const localExpose = Object.assign({}, instance.exposed);
|
|
517
|
-
const ret = {};
|
|
518
|
-
for (const key in instance.props) Object.defineProperty(ret, key, {
|
|
519
|
-
enumerable: true,
|
|
520
|
-
configurable: true,
|
|
521
|
-
get: () => instance.props[key]
|
|
522
|
-
});
|
|
523
|
-
if (Object.keys(localExpose).length > 0) for (const key in localExpose) Object.defineProperty(ret, key, {
|
|
524
|
-
enumerable: true,
|
|
525
|
-
configurable: true,
|
|
526
|
-
get: () => localExpose[key]
|
|
527
|
-
});
|
|
528
|
-
Object.defineProperty(ret, "$el", {
|
|
529
|
-
enumerable: true,
|
|
530
|
-
configurable: true,
|
|
531
|
-
get: () => instance.vnode.el
|
|
532
|
-
});
|
|
533
|
-
instance.exposed = ret;
|
|
534
|
-
function forwardRef(ref$1) {
|
|
535
|
-
currentRef.value = ref$1;
|
|
536
|
-
if (!ref$1) return;
|
|
537
|
-
Object.defineProperty(ret, "$el", {
|
|
538
|
-
enumerable: true,
|
|
539
|
-
configurable: true,
|
|
540
|
-
get: () => ref$1 instanceof Element ? ref$1 : ref$1.$el
|
|
541
|
-
});
|
|
542
|
-
instance.exposed = ret;
|
|
543
|
-
}
|
|
544
|
-
return {
|
|
545
|
-
forwardRef,
|
|
546
|
-
currentRef,
|
|
547
|
-
currentElement
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
var getDefaultParent = function(originalTarget) {
|
|
551
|
-
if (typeof document === "undefined") {
|
|
552
|
-
return null;
|
|
553
|
-
}
|
|
554
|
-
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
555
|
-
return sampleTarget.ownerDocument.body;
|
|
556
|
-
};
|
|
557
|
-
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
558
|
-
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
559
|
-
var markerMap = {};
|
|
560
|
-
var lockCount = 0;
|
|
561
|
-
var unwrapHost = function(node) {
|
|
562
|
-
return node && (node.host || unwrapHost(node.parentNode));
|
|
563
|
-
};
|
|
564
|
-
var correctTargets = function(parent, targets) {
|
|
565
|
-
return targets.map(function(target) {
|
|
566
|
-
if (parent.contains(target)) {
|
|
567
|
-
return target;
|
|
568
|
-
}
|
|
569
|
-
var correctedTarget = unwrapHost(target);
|
|
570
|
-
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
571
|
-
return correctedTarget;
|
|
572
|
-
}
|
|
573
|
-
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
574
|
-
return null;
|
|
575
|
-
}).filter(function(x) {
|
|
576
|
-
return Boolean(x);
|
|
577
|
-
});
|
|
578
|
-
};
|
|
579
|
-
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
580
|
-
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
581
|
-
if (!markerMap[markerName]) {
|
|
582
|
-
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
583
|
-
}
|
|
584
|
-
var markerCounter = markerMap[markerName];
|
|
585
|
-
var hiddenNodes = [];
|
|
586
|
-
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
587
|
-
var elementsToStop = new Set(targets);
|
|
588
|
-
var keep = function(el) {
|
|
589
|
-
if (!el || elementsToKeep.has(el)) {
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
elementsToKeep.add(el);
|
|
593
|
-
keep(el.parentNode);
|
|
594
|
-
};
|
|
595
|
-
targets.forEach(keep);
|
|
596
|
-
var deep = function(parent) {
|
|
597
|
-
if (!parent || elementsToStop.has(parent)) {
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
Array.prototype.forEach.call(parent.children, function(node) {
|
|
601
|
-
if (elementsToKeep.has(node)) {
|
|
602
|
-
deep(node);
|
|
603
|
-
} else {
|
|
604
|
-
try {
|
|
605
|
-
var attr = node.getAttribute(controlAttribute);
|
|
606
|
-
var alreadyHidden = attr !== null && attr !== "false";
|
|
607
|
-
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
608
|
-
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
609
|
-
counterMap.set(node, counterValue);
|
|
610
|
-
markerCounter.set(node, markerValue);
|
|
611
|
-
hiddenNodes.push(node);
|
|
612
|
-
if (counterValue === 1 && alreadyHidden) {
|
|
613
|
-
uncontrolledNodes.set(node, true);
|
|
614
|
-
}
|
|
615
|
-
if (markerValue === 1) {
|
|
616
|
-
node.setAttribute(markerName, "true");
|
|
617
|
-
}
|
|
618
|
-
if (!alreadyHidden) {
|
|
619
|
-
node.setAttribute(controlAttribute, "true");
|
|
620
|
-
}
|
|
621
|
-
} catch (e) {
|
|
622
|
-
console.error("aria-hidden: cannot operate on ", node, e);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
});
|
|
626
|
-
};
|
|
627
|
-
deep(parentNode);
|
|
628
|
-
elementsToKeep.clear();
|
|
629
|
-
lockCount++;
|
|
630
|
-
return function() {
|
|
631
|
-
hiddenNodes.forEach(function(node) {
|
|
632
|
-
var counterValue = counterMap.get(node) - 1;
|
|
633
|
-
var markerValue = markerCounter.get(node) - 1;
|
|
634
|
-
counterMap.set(node, counterValue);
|
|
635
|
-
markerCounter.set(node, markerValue);
|
|
636
|
-
if (!counterValue) {
|
|
637
|
-
if (!uncontrolledNodes.has(node)) {
|
|
638
|
-
node.removeAttribute(controlAttribute);
|
|
639
|
-
}
|
|
640
|
-
uncontrolledNodes.delete(node);
|
|
641
|
-
}
|
|
642
|
-
if (!markerValue) {
|
|
643
|
-
node.removeAttribute(markerName);
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
lockCount--;
|
|
647
|
-
if (!lockCount) {
|
|
648
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
649
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
650
|
-
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
651
|
-
markerMap = {};
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
};
|
|
655
|
-
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
656
|
-
if (markerName === void 0) {
|
|
657
|
-
markerName = "data-aria-hidden";
|
|
658
|
-
}
|
|
659
|
-
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
660
|
-
var activeParentNode = getDefaultParent(originalTarget);
|
|
661
|
-
if (!activeParentNode) {
|
|
662
|
-
return function() {
|
|
663
|
-
return null;
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
667
|
-
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
668
|
-
};
|
|
669
|
-
function useHideOthers(target) {
|
|
670
|
-
let undo;
|
|
671
|
-
watch(() => unrefElement(target), (el) => {
|
|
672
|
-
if (el) undo = hideOthers(el);
|
|
673
|
-
else if (undo) undo();
|
|
674
|
-
});
|
|
675
|
-
onUnmounted(() => {
|
|
676
|
-
if (undo) undo();
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
function useStateMachine(initialState, machine) {
|
|
680
|
-
const state = ref(initialState);
|
|
681
|
-
function reducer(event) {
|
|
682
|
-
const nextState = machine[state.value][event];
|
|
683
|
-
return nextState ?? state.value;
|
|
684
|
-
}
|
|
685
|
-
const dispatch = (event) => {
|
|
686
|
-
state.value = reducer(event);
|
|
687
|
-
};
|
|
688
|
-
return {
|
|
689
|
-
state,
|
|
690
|
-
dispatch
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
function usePresence(present, node) {
|
|
694
|
-
var _a;
|
|
695
|
-
const stylesRef = ref({});
|
|
696
|
-
const prevAnimationNameRef = ref("none");
|
|
697
|
-
const prevPresentRef = ref(present);
|
|
698
|
-
const initialState = present.value ? "mounted" : "unmounted";
|
|
699
|
-
let timeoutId;
|
|
700
|
-
const ownerWindow = ((_a = node.value) == null ? void 0 : _a.ownerDocument.defaultView) ?? defaultWindow;
|
|
701
|
-
const { state, dispatch } = useStateMachine(initialState, {
|
|
702
|
-
mounted: {
|
|
703
|
-
UNMOUNT: "unmounted",
|
|
704
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
705
|
-
},
|
|
706
|
-
unmountSuspended: {
|
|
707
|
-
MOUNT: "mounted",
|
|
708
|
-
ANIMATION_END: "unmounted"
|
|
709
|
-
},
|
|
710
|
-
unmounted: { MOUNT: "mounted" }
|
|
711
|
-
});
|
|
712
|
-
const dispatchCustomEvent = (name) => {
|
|
713
|
-
var _a2;
|
|
714
|
-
if (isClient) {
|
|
715
|
-
const customEvent = new CustomEvent(name, {
|
|
716
|
-
bubbles: false,
|
|
717
|
-
cancelable: false
|
|
718
|
-
});
|
|
719
|
-
(_a2 = node.value) == null ? void 0 : _a2.dispatchEvent(customEvent);
|
|
720
|
-
}
|
|
721
|
-
};
|
|
722
|
-
watch(present, async (currentPresent, prevPresent) => {
|
|
723
|
-
var _a2;
|
|
724
|
-
const hasPresentChanged = prevPresent !== currentPresent;
|
|
725
|
-
await nextTick();
|
|
726
|
-
if (hasPresentChanged) {
|
|
727
|
-
const prevAnimationName = prevAnimationNameRef.value;
|
|
728
|
-
const currentAnimationName = getAnimationName(node.value);
|
|
729
|
-
if (currentPresent) {
|
|
730
|
-
dispatch("MOUNT");
|
|
731
|
-
dispatchCustomEvent("enter");
|
|
732
|
-
if (currentAnimationName === "none") dispatchCustomEvent("after-enter");
|
|
733
|
-
} else if (currentAnimationName === "none" || currentAnimationName === "undefined" || ((_a2 = stylesRef.value) == null ? void 0 : _a2.display) === "none") {
|
|
734
|
-
dispatch("UNMOUNT");
|
|
735
|
-
dispatchCustomEvent("leave");
|
|
736
|
-
dispatchCustomEvent("after-leave");
|
|
737
|
-
} else {
|
|
738
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
739
|
-
if (prevPresent && isAnimating) {
|
|
740
|
-
dispatch("ANIMATION_OUT");
|
|
741
|
-
dispatchCustomEvent("leave");
|
|
742
|
-
} else {
|
|
743
|
-
dispatch("UNMOUNT");
|
|
744
|
-
dispatchCustomEvent("after-leave");
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
}, { immediate: true });
|
|
749
|
-
const handleAnimationEnd = (event) => {
|
|
750
|
-
const currentAnimationName = getAnimationName(node.value);
|
|
751
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
752
|
-
const directionName = state.value === "mounted" ? "enter" : "leave";
|
|
753
|
-
if (event.target === node.value && isCurrentAnimation) {
|
|
754
|
-
dispatchCustomEvent(`after-${directionName}`);
|
|
755
|
-
dispatch("ANIMATION_END");
|
|
756
|
-
if (!prevPresentRef.value) {
|
|
757
|
-
const currentFillMode = node.value.style.animationFillMode;
|
|
758
|
-
node.value.style.animationFillMode = "forwards";
|
|
759
|
-
timeoutId = ownerWindow == null ? void 0 : ownerWindow.setTimeout(() => {
|
|
760
|
-
var _a2;
|
|
761
|
-
if (((_a2 = node.value) == null ? void 0 : _a2.style.animationFillMode) === "forwards") node.value.style.animationFillMode = currentFillMode;
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
if (event.target === node.value && currentAnimationName === "none") dispatch("ANIMATION_END");
|
|
766
|
-
};
|
|
767
|
-
const handleAnimationStart = (event) => {
|
|
768
|
-
if (event.target === node.value) prevAnimationNameRef.value = getAnimationName(node.value);
|
|
769
|
-
};
|
|
770
|
-
const watcher = watch(node, (newNode, oldNode) => {
|
|
771
|
-
if (newNode) {
|
|
772
|
-
stylesRef.value = getComputedStyle(newNode);
|
|
773
|
-
newNode.addEventListener("animationstart", handleAnimationStart);
|
|
774
|
-
newNode.addEventListener("animationcancel", handleAnimationEnd);
|
|
775
|
-
newNode.addEventListener("animationend", handleAnimationEnd);
|
|
776
|
-
} else {
|
|
777
|
-
dispatch("ANIMATION_END");
|
|
778
|
-
if (timeoutId !== void 0) ownerWindow == null ? void 0 : ownerWindow.clearTimeout(timeoutId);
|
|
779
|
-
oldNode == null ? void 0 : oldNode.removeEventListener("animationstart", handleAnimationStart);
|
|
780
|
-
oldNode == null ? void 0 : oldNode.removeEventListener("animationcancel", handleAnimationEnd);
|
|
781
|
-
oldNode == null ? void 0 : oldNode.removeEventListener("animationend", handleAnimationEnd);
|
|
782
|
-
}
|
|
783
|
-
}, { immediate: true });
|
|
784
|
-
const stateWatcher = watch(state, () => {
|
|
785
|
-
const currentAnimationName = getAnimationName(node.value);
|
|
786
|
-
prevAnimationNameRef.value = state.value === "mounted" ? currentAnimationName : "none";
|
|
787
|
-
});
|
|
788
|
-
onUnmounted(() => {
|
|
789
|
-
watcher();
|
|
790
|
-
stateWatcher();
|
|
791
|
-
});
|
|
792
|
-
const isPresent = computed(() => ["mounted", "unmountSuspended"].includes(state.value));
|
|
793
|
-
return { isPresent };
|
|
794
|
-
}
|
|
795
|
-
function getAnimationName(node) {
|
|
796
|
-
return node ? getComputedStyle(node).animationName || "none" : "none";
|
|
797
|
-
}
|
|
798
|
-
var Presence_default = defineComponent({
|
|
799
|
-
name: "Presence",
|
|
800
|
-
props: {
|
|
801
|
-
present: {
|
|
802
|
-
type: Boolean,
|
|
803
|
-
required: true
|
|
804
|
-
},
|
|
805
|
-
forceMount: { type: Boolean }
|
|
806
|
-
},
|
|
807
|
-
slots: {},
|
|
808
|
-
setup(props, { slots, expose }) {
|
|
809
|
-
var _a;
|
|
810
|
-
const { present, forceMount } = toRefs(props);
|
|
811
|
-
const node = ref();
|
|
812
|
-
const { isPresent } = usePresence(present, node);
|
|
813
|
-
expose({ present: isPresent });
|
|
814
|
-
let children = slots.default({ present: isPresent.value });
|
|
815
|
-
children = renderSlotFragments(children || []);
|
|
816
|
-
const instance = getCurrentInstance();
|
|
817
|
-
if (children && (children == null ? void 0 : children.length) > 1) {
|
|
818
|
-
const componentName = ((_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.type.name) ? `<${instance.parent.type.name} />` : "component";
|
|
819
|
-
throw new Error([
|
|
820
|
-
`Detected an invalid children for \`${componentName}\` for \`Presence\` component.`,
|
|
821
|
-
"",
|
|
822
|
-
"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",
|
|
823
|
-
"You can apply a few solutions:",
|
|
824
|
-
["Provide a single child element so that `presence` directive attach correctly.", "Ensure the first child is an actual element instead of a raw text node or comment node."].map((line) => ` - ${line}`).join("\n")
|
|
825
|
-
].join("\n"));
|
|
826
|
-
}
|
|
827
|
-
return () => {
|
|
828
|
-
if (forceMount.value || present.value || isPresent.value) return h(slots.default({ present: isPresent.value })[0], { ref: (v) => {
|
|
829
|
-
const el = unrefElement(v);
|
|
830
|
-
if (typeof (el == null ? void 0 : el.hasAttribute) === "undefined") return el;
|
|
831
|
-
if (el == null ? void 0 : el.hasAttribute("data-reka-popper-content-wrapper")) node.value = el.firstElementChild;
|
|
832
|
-
else node.value = el;
|
|
833
|
-
return el;
|
|
834
|
-
} });
|
|
835
|
-
else return null;
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
});
|
|
839
|
-
const Slot = defineComponent({
|
|
840
|
-
name: "PrimitiveSlot",
|
|
841
|
-
inheritAttrs: false,
|
|
842
|
-
setup(_, { attrs, slots }) {
|
|
843
|
-
return () => {
|
|
844
|
-
var _a;
|
|
845
|
-
if (!slots.default) return null;
|
|
846
|
-
const children = renderSlotFragments(slots.default());
|
|
847
|
-
const firstNonCommentChildrenIndex = children.findIndex((child) => child.type !== Comment);
|
|
848
|
-
if (firstNonCommentChildrenIndex === -1) return children;
|
|
849
|
-
const firstNonCommentChildren = children[firstNonCommentChildrenIndex];
|
|
850
|
-
(_a = firstNonCommentChildren.props) == null ? true : delete _a.ref;
|
|
851
|
-
const mergedProps = firstNonCommentChildren.props ? mergeProps(attrs, firstNonCommentChildren.props) : attrs;
|
|
852
|
-
const cloned = cloneVNode({
|
|
853
|
-
...firstNonCommentChildren,
|
|
854
|
-
props: {}
|
|
855
|
-
}, mergedProps);
|
|
856
|
-
if (children.length === 1) return cloned;
|
|
857
|
-
children[firstNonCommentChildrenIndex] = cloned;
|
|
858
|
-
return children;
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
});
|
|
862
|
-
const SELF_CLOSING_TAGS = [
|
|
863
|
-
"area",
|
|
864
|
-
"img",
|
|
865
|
-
"input"
|
|
866
|
-
];
|
|
867
|
-
const Primitive = defineComponent({
|
|
868
|
-
name: "Primitive",
|
|
869
|
-
inheritAttrs: false,
|
|
870
|
-
props: {
|
|
871
|
-
asChild: {
|
|
872
|
-
type: Boolean,
|
|
873
|
-
default: false
|
|
874
|
-
},
|
|
875
|
-
as: {
|
|
876
|
-
type: [String, Object],
|
|
877
|
-
default: "div"
|
|
878
|
-
}
|
|
879
|
-
},
|
|
880
|
-
setup(props, { attrs, slots }) {
|
|
881
|
-
const asTag = props.asChild ? "template" : props.as;
|
|
882
|
-
if (typeof asTag === "string" && SELF_CLOSING_TAGS.includes(asTag)) return () => h(asTag, attrs);
|
|
883
|
-
if (asTag !== "template") return () => h(props.as, attrs, { default: slots.default });
|
|
884
|
-
return () => h(Slot, attrs, { default: slots.default });
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
const POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
888
|
-
const FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
889
|
-
function isLayerExist(layerElement, targetElement) {
|
|
890
|
-
const targetLayer = targetElement.closest("[data-dismissable-layer]");
|
|
891
|
-
const mainLayer = layerElement.dataset.dismissableLayer === "" ? layerElement : layerElement.querySelector("[data-dismissable-layer]");
|
|
892
|
-
const nodeList = Array.from(layerElement.ownerDocument.querySelectorAll("[data-dismissable-layer]"));
|
|
893
|
-
if (targetLayer && (mainLayer === targetLayer || nodeList.indexOf(mainLayer) < nodeList.indexOf(targetLayer))) return true;
|
|
894
|
-
else return false;
|
|
895
|
-
}
|
|
896
|
-
function usePointerDownOutside(onPointerDownOutside, element, enabled = true) {
|
|
897
|
-
var _a;
|
|
898
|
-
const ownerDocument = ((_a = element == null ? void 0 : element.value) == null ? void 0 : _a.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
|
|
899
|
-
const isPointerInsideDOMTree = ref(false);
|
|
900
|
-
const handleClickRef = ref(() => {
|
|
901
|
-
});
|
|
902
|
-
watchEffect((cleanupFn) => {
|
|
903
|
-
if (!isClient || !toValue(enabled)) return;
|
|
904
|
-
const handlePointerDown = async (event) => {
|
|
905
|
-
const target = event.target;
|
|
906
|
-
if (!(element == null ? void 0 : element.value) || !target) return;
|
|
907
|
-
if (isLayerExist(element.value, target)) {
|
|
908
|
-
isPointerInsideDOMTree.value = false;
|
|
909
|
-
return;
|
|
910
|
-
}
|
|
911
|
-
if (event.target && !isPointerInsideDOMTree.value) {
|
|
912
|
-
let handleAndDispatchPointerDownOutsideEvent = function() {
|
|
913
|
-
handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, onPointerDownOutside, eventDetail);
|
|
914
|
-
};
|
|
915
|
-
const eventDetail = { originalEvent: event };
|
|
916
|
-
if (event.pointerType === "touch") {
|
|
917
|
-
ownerDocument.removeEventListener("click", handleClickRef.value);
|
|
918
|
-
handleClickRef.value = handleAndDispatchPointerDownOutsideEvent;
|
|
919
|
-
ownerDocument.addEventListener("click", handleClickRef.value, { once: true });
|
|
920
|
-
} else handleAndDispatchPointerDownOutsideEvent();
|
|
921
|
-
} else ownerDocument.removeEventListener("click", handleClickRef.value);
|
|
922
|
-
isPointerInsideDOMTree.value = false;
|
|
923
|
-
};
|
|
924
|
-
const timerId = window.setTimeout(() => {
|
|
925
|
-
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
926
|
-
}, 0);
|
|
927
|
-
cleanupFn(() => {
|
|
928
|
-
window.clearTimeout(timerId);
|
|
929
|
-
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
930
|
-
ownerDocument.removeEventListener("click", handleClickRef.value);
|
|
931
|
-
});
|
|
932
|
-
});
|
|
933
|
-
return { onPointerDownCapture: () => {
|
|
934
|
-
if (!toValue(enabled)) return;
|
|
935
|
-
isPointerInsideDOMTree.value = true;
|
|
936
|
-
} };
|
|
937
|
-
}
|
|
938
|
-
function useFocusOutside(onFocusOutside, element, enabled = true) {
|
|
939
|
-
var _a;
|
|
940
|
-
const ownerDocument = ((_a = element == null ? void 0 : element.value) == null ? void 0 : _a.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
|
|
941
|
-
const isFocusInsideDOMTree = ref(false);
|
|
942
|
-
watchEffect((cleanupFn) => {
|
|
943
|
-
if (!isClient || !toValue(enabled)) return;
|
|
944
|
-
const handleFocus = async (event) => {
|
|
945
|
-
if (!(element == null ? void 0 : element.value)) return;
|
|
946
|
-
await nextTick();
|
|
947
|
-
await nextTick();
|
|
948
|
-
const target = event.target;
|
|
949
|
-
if (!element.value || !target || isLayerExist(element.value, target)) return;
|
|
950
|
-
if (event.target && !isFocusInsideDOMTree.value) {
|
|
951
|
-
const eventDetail = { originalEvent: event };
|
|
952
|
-
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, onFocusOutside, eventDetail);
|
|
953
|
-
}
|
|
954
|
-
};
|
|
955
|
-
ownerDocument.addEventListener("focusin", handleFocus);
|
|
956
|
-
cleanupFn(() => ownerDocument.removeEventListener("focusin", handleFocus));
|
|
957
|
-
});
|
|
958
|
-
return {
|
|
959
|
-
onFocusCapture: () => {
|
|
960
|
-
if (!toValue(enabled)) return;
|
|
961
|
-
isFocusInsideDOMTree.value = true;
|
|
962
|
-
},
|
|
963
|
-
onBlurCapture: () => {
|
|
964
|
-
if (!toValue(enabled)) return;
|
|
965
|
-
isFocusInsideDOMTree.value = false;
|
|
966
|
-
}
|
|
967
|
-
};
|
|
968
|
-
}
|
|
969
|
-
const context = reactive({
|
|
970
|
-
layersRoot: /* @__PURE__ */ new Set(),
|
|
971
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
972
|
-
branches: /* @__PURE__ */ new Set()
|
|
973
|
-
});
|
|
974
|
-
var DismissableLayer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
975
|
-
__name: "DismissableLayer",
|
|
976
|
-
props: {
|
|
977
|
-
disableOutsidePointerEvents: {
|
|
978
|
-
type: Boolean,
|
|
979
|
-
required: false,
|
|
980
|
-
default: false
|
|
981
|
-
},
|
|
982
|
-
asChild: {
|
|
983
|
-
type: Boolean,
|
|
984
|
-
required: false
|
|
985
|
-
},
|
|
986
|
-
as: {
|
|
987
|
-
type: null,
|
|
988
|
-
required: false
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
emits: [
|
|
992
|
-
"escapeKeyDown",
|
|
993
|
-
"pointerDownOutside",
|
|
994
|
-
"focusOutside",
|
|
995
|
-
"interactOutside",
|
|
996
|
-
"dismiss"
|
|
997
|
-
],
|
|
998
|
-
setup(__props, { emit: __emit }) {
|
|
999
|
-
const props = __props;
|
|
1000
|
-
const emits = __emit;
|
|
1001
|
-
const { forwardRef, currentElement: layerElement } = useForwardExpose();
|
|
1002
|
-
const ownerDocument = computed(() => {
|
|
1003
|
-
var _a;
|
|
1004
|
-
return ((_a = layerElement.value) == null ? void 0 : _a.ownerDocument) ?? globalThis.document;
|
|
1005
|
-
});
|
|
1006
|
-
const layers = computed(() => context.layersRoot);
|
|
1007
|
-
const index = computed(() => {
|
|
1008
|
-
return layerElement.value ? Array.from(layers.value).indexOf(layerElement.value) : -1;
|
|
1009
|
-
});
|
|
1010
|
-
const isBodyPointerEventsDisabled = computed(() => {
|
|
1011
|
-
return context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
1012
|
-
});
|
|
1013
|
-
const isPointerEventsEnabled = computed(() => {
|
|
1014
|
-
const localLayers = Array.from(layers.value);
|
|
1015
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
1016
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = localLayers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
1017
|
-
return index.value >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
1018
|
-
});
|
|
1019
|
-
const pointerDownOutside = usePointerDownOutside(async (event) => {
|
|
1020
|
-
const isPointerDownOnBranch = [...context.branches].some((branch) => branch == null ? void 0 : branch.contains(event.target));
|
|
1021
|
-
if (!isPointerEventsEnabled.value || isPointerDownOnBranch) return;
|
|
1022
|
-
emits("pointerDownOutside", event);
|
|
1023
|
-
emits("interactOutside", event);
|
|
1024
|
-
await nextTick();
|
|
1025
|
-
if (!event.defaultPrevented) emits("dismiss");
|
|
1026
|
-
}, layerElement);
|
|
1027
|
-
const focusOutside = useFocusOutside((event) => {
|
|
1028
|
-
const isFocusInBranch = [...context.branches].some((branch) => branch == null ? void 0 : branch.contains(event.target));
|
|
1029
|
-
if (isFocusInBranch) return;
|
|
1030
|
-
emits("focusOutside", event);
|
|
1031
|
-
emits("interactOutside", event);
|
|
1032
|
-
if (!event.defaultPrevented) emits("dismiss");
|
|
1033
|
-
}, layerElement);
|
|
1034
|
-
onKeyStroke("Escape", (event) => {
|
|
1035
|
-
const isHighestLayer = index.value === layers.value.size - 1;
|
|
1036
|
-
if (!isHighestLayer) return;
|
|
1037
|
-
emits("escapeKeyDown", event);
|
|
1038
|
-
if (!event.defaultPrevented) emits("dismiss");
|
|
1039
|
-
});
|
|
1040
|
-
let originalBodyPointerEvents;
|
|
1041
|
-
watchEffect((cleanupFn) => {
|
|
1042
|
-
if (!layerElement.value) return;
|
|
1043
|
-
if (props.disableOutsidePointerEvents) {
|
|
1044
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
1045
|
-
originalBodyPointerEvents = ownerDocument.value.body.style.pointerEvents;
|
|
1046
|
-
ownerDocument.value.body.style.pointerEvents = "none";
|
|
1047
|
-
}
|
|
1048
|
-
context.layersWithOutsidePointerEventsDisabled.add(layerElement.value);
|
|
1049
|
-
}
|
|
1050
|
-
layers.value.add(layerElement.value);
|
|
1051
|
-
cleanupFn(() => {
|
|
1052
|
-
if (props.disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.value.body.style.pointerEvents = originalBodyPointerEvents;
|
|
1053
|
-
});
|
|
1054
|
-
});
|
|
1055
|
-
watchEffect((cleanupFn) => {
|
|
1056
|
-
cleanupFn(() => {
|
|
1057
|
-
if (!layerElement.value) return;
|
|
1058
|
-
layers.value.delete(layerElement.value);
|
|
1059
|
-
context.layersWithOutsidePointerEventsDisabled.delete(layerElement.value);
|
|
1060
|
-
});
|
|
1061
|
-
});
|
|
1062
|
-
return (_ctx, _cache) => {
|
|
1063
|
-
return openBlock(), createBlock(unref(Primitive), {
|
|
1064
|
-
ref: unref(forwardRef),
|
|
1065
|
-
"as-child": _ctx.asChild,
|
|
1066
|
-
as: _ctx.as,
|
|
1067
|
-
"data-dismissable-layer": "",
|
|
1068
|
-
style: normalizeStyle({ pointerEvents: isBodyPointerEventsDisabled.value ? isPointerEventsEnabled.value ? "auto" : "none" : void 0 }),
|
|
1069
|
-
onFocusCapture: unref(focusOutside).onFocusCapture,
|
|
1070
|
-
onBlurCapture: unref(focusOutside).onBlurCapture,
|
|
1071
|
-
onPointerdownCapture: unref(pointerDownOutside).onPointerDownCapture
|
|
1072
|
-
}, {
|
|
1073
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1074
|
-
_: 3
|
|
1075
|
-
}, 8, [
|
|
1076
|
-
"as-child",
|
|
1077
|
-
"as",
|
|
1078
|
-
"style",
|
|
1079
|
-
"onFocusCapture",
|
|
1080
|
-
"onBlurCapture",
|
|
1081
|
-
"onPointerdownCapture"
|
|
1082
|
-
]);
|
|
1083
|
-
};
|
|
1084
|
-
}
|
|
1085
|
-
});
|
|
1086
|
-
var DismissableLayer_default = DismissableLayer_vue_vue_type_script_setup_true_lang_default;
|
|
1087
|
-
const useFocusStackState = createGlobalState(() => {
|
|
1088
|
-
const stack = ref([]);
|
|
1089
|
-
return stack;
|
|
1090
|
-
});
|
|
1091
|
-
function createFocusScopesStack() {
|
|
1092
|
-
const stack = useFocusStackState();
|
|
1093
|
-
return {
|
|
1094
|
-
add(focusScope) {
|
|
1095
|
-
const activeFocusScope = stack.value[0];
|
|
1096
|
-
if (focusScope !== activeFocusScope) activeFocusScope == null ? void 0 : activeFocusScope.pause();
|
|
1097
|
-
stack.value = arrayRemove(stack.value, focusScope);
|
|
1098
|
-
stack.value.unshift(focusScope);
|
|
1099
|
-
},
|
|
1100
|
-
remove(focusScope) {
|
|
1101
|
-
var _a;
|
|
1102
|
-
stack.value = arrayRemove(stack.value, focusScope);
|
|
1103
|
-
(_a = stack.value[0]) == null ? void 0 : _a.resume();
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
function arrayRemove(array, item) {
|
|
1108
|
-
const updatedArray = [...array];
|
|
1109
|
-
const index = updatedArray.indexOf(item);
|
|
1110
|
-
if (index !== -1) updatedArray.splice(index, 1);
|
|
1111
|
-
return updatedArray;
|
|
1112
|
-
}
|
|
1113
|
-
function removeLinks(items) {
|
|
1114
|
-
return items.filter((item) => item.tagName !== "A");
|
|
1115
|
-
}
|
|
1116
|
-
const AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
1117
|
-
const AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
1118
|
-
const EVENT_OPTIONS = {
|
|
1119
|
-
bubbles: false,
|
|
1120
|
-
cancelable: true
|
|
1121
|
-
};
|
|
1122
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
1123
|
-
const previouslyFocusedElement = getActiveElement();
|
|
1124
|
-
for (const candidate of candidates) {
|
|
1125
|
-
focus(candidate, { select });
|
|
1126
|
-
if (getActiveElement() !== previouslyFocusedElement) return true;
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
function getTabbableEdges(container) {
|
|
1130
|
-
const candidates = getTabbableCandidates(container);
|
|
1131
|
-
const first = findVisible(candidates, container);
|
|
1132
|
-
const last = findVisible(candidates.reverse(), container);
|
|
1133
|
-
return [first, last];
|
|
1134
|
-
}
|
|
1135
|
-
function getTabbableCandidates(container) {
|
|
1136
|
-
const nodes = [];
|
|
1137
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {
|
|
1138
|
-
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
1139
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
1140
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
1141
|
-
} });
|
|
1142
|
-
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
1143
|
-
return nodes;
|
|
1144
|
-
}
|
|
1145
|
-
function findVisible(elements, container) {
|
|
1146
|
-
for (const element of elements) if (!isHidden(element, { upTo: container })) return element;
|
|
1147
|
-
}
|
|
1148
|
-
function isHidden(node, { upTo }) {
|
|
1149
|
-
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
1150
|
-
while (node) {
|
|
1151
|
-
if (upTo !== void 0 && node === upTo) return false;
|
|
1152
|
-
if (getComputedStyle(node).display === "none") return true;
|
|
1153
|
-
node = node.parentElement;
|
|
1154
|
-
}
|
|
1155
|
-
return false;
|
|
1156
|
-
}
|
|
1157
|
-
function isSelectableInput(element) {
|
|
1158
|
-
return element instanceof HTMLInputElement && "select" in element;
|
|
1159
|
-
}
|
|
1160
|
-
function focus(element, { select = false } = {}) {
|
|
1161
|
-
if (element && element.focus) {
|
|
1162
|
-
const previouslyFocusedElement = getActiveElement();
|
|
1163
|
-
element.focus({ preventScroll: true });
|
|
1164
|
-
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
var FocusScope_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1168
|
-
__name: "FocusScope",
|
|
1169
|
-
props: {
|
|
1170
|
-
loop: {
|
|
1171
|
-
type: Boolean,
|
|
1172
|
-
required: false,
|
|
1173
|
-
default: false
|
|
1174
|
-
},
|
|
1175
|
-
trapped: {
|
|
1176
|
-
type: Boolean,
|
|
1177
|
-
required: false,
|
|
1178
|
-
default: false
|
|
1179
|
-
},
|
|
1180
|
-
asChild: {
|
|
1181
|
-
type: Boolean,
|
|
1182
|
-
required: false
|
|
1183
|
-
},
|
|
1184
|
-
as: {
|
|
1185
|
-
type: null,
|
|
1186
|
-
required: false
|
|
1187
|
-
}
|
|
1188
|
-
},
|
|
1189
|
-
emits: ["mountAutoFocus", "unmountAutoFocus"],
|
|
1190
|
-
setup(__props, { emit: __emit }) {
|
|
1191
|
-
const props = __props;
|
|
1192
|
-
const emits = __emit;
|
|
1193
|
-
const { currentRef, currentElement } = useForwardExpose();
|
|
1194
|
-
const lastFocusedElementRef = ref(null);
|
|
1195
|
-
const focusScopesStack = createFocusScopesStack();
|
|
1196
|
-
const focusScope = reactive({
|
|
1197
|
-
paused: false,
|
|
1198
|
-
pause() {
|
|
1199
|
-
this.paused = true;
|
|
1200
|
-
},
|
|
1201
|
-
resume() {
|
|
1202
|
-
this.paused = false;
|
|
1203
|
-
}
|
|
1204
|
-
});
|
|
1205
|
-
watchEffect((cleanupFn) => {
|
|
1206
|
-
if (!isClient) return;
|
|
1207
|
-
const container = currentElement.value;
|
|
1208
|
-
if (!props.trapped) return;
|
|
1209
|
-
function handleFocusIn(event) {
|
|
1210
|
-
if (focusScope.paused || !container) return;
|
|
1211
|
-
const target = event.target;
|
|
1212
|
-
if (container.contains(target)) lastFocusedElementRef.value = target;
|
|
1213
|
-
else focus(lastFocusedElementRef.value, { select: true });
|
|
1214
|
-
}
|
|
1215
|
-
function handleFocusOut(event) {
|
|
1216
|
-
if (focusScope.paused || !container) return;
|
|
1217
|
-
const relatedTarget = event.relatedTarget;
|
|
1218
|
-
if (relatedTarget === null) return;
|
|
1219
|
-
if (!container.contains(relatedTarget)) focus(lastFocusedElementRef.value, { select: true });
|
|
1220
|
-
}
|
|
1221
|
-
function handleMutations(mutations) {
|
|
1222
|
-
const isLastFocusedElementExist = container.contains(lastFocusedElementRef.value);
|
|
1223
|
-
if (!isLastFocusedElementExist) focus(container);
|
|
1224
|
-
}
|
|
1225
|
-
document.addEventListener("focusin", handleFocusIn);
|
|
1226
|
-
document.addEventListener("focusout", handleFocusOut);
|
|
1227
|
-
const mutationObserver = new MutationObserver(handleMutations);
|
|
1228
|
-
if (container) mutationObserver.observe(container, {
|
|
1229
|
-
childList: true,
|
|
1230
|
-
subtree: true
|
|
1231
|
-
});
|
|
1232
|
-
cleanupFn(() => {
|
|
1233
|
-
document.removeEventListener("focusin", handleFocusIn);
|
|
1234
|
-
document.removeEventListener("focusout", handleFocusOut);
|
|
1235
|
-
mutationObserver.disconnect();
|
|
1236
|
-
});
|
|
1237
|
-
});
|
|
1238
|
-
watchEffect(async (cleanupFn) => {
|
|
1239
|
-
const container = currentElement.value;
|
|
1240
|
-
await nextTick();
|
|
1241
|
-
if (!container) return;
|
|
1242
|
-
focusScopesStack.add(focusScope);
|
|
1243
|
-
const previouslyFocusedElement = getActiveElement();
|
|
1244
|
-
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
1245
|
-
if (!hasFocusedCandidate) {
|
|
1246
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
1247
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT, (ev) => emits("mountAutoFocus", ev));
|
|
1248
|
-
container.dispatchEvent(mountEvent);
|
|
1249
|
-
if (!mountEvent.defaultPrevented) {
|
|
1250
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
1251
|
-
if (getActiveElement() === previouslyFocusedElement) focus(container);
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
cleanupFn(() => {
|
|
1255
|
-
container.removeEventListener(AUTOFOCUS_ON_MOUNT, (ev) => emits("mountAutoFocus", ev));
|
|
1256
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
1257
|
-
const unmountEventHandler = (ev) => {
|
|
1258
|
-
emits("unmountAutoFocus", ev);
|
|
1259
|
-
};
|
|
1260
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);
|
|
1261
|
-
container.dispatchEvent(unmountEvent);
|
|
1262
|
-
setTimeout(() => {
|
|
1263
|
-
if (!unmountEvent.defaultPrevented) focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
1264
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);
|
|
1265
|
-
focusScopesStack.remove(focusScope);
|
|
1266
|
-
}, 0);
|
|
1267
|
-
});
|
|
1268
|
-
});
|
|
1269
|
-
function handleKeyDown(event) {
|
|
1270
|
-
if (!props.loop && !props.trapped) return;
|
|
1271
|
-
if (focusScope.paused) return;
|
|
1272
|
-
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
1273
|
-
const focusedElement = getActiveElement();
|
|
1274
|
-
if (isTabKey && focusedElement) {
|
|
1275
|
-
const container = event.currentTarget;
|
|
1276
|
-
const [first, last] = getTabbableEdges(container);
|
|
1277
|
-
const hasTabbableElementsInside = first && last;
|
|
1278
|
-
if (!hasTabbableElementsInside) {
|
|
1279
|
-
if (focusedElement === container) event.preventDefault();
|
|
1280
|
-
} else if (!event.shiftKey && focusedElement === last) {
|
|
1281
|
-
event.preventDefault();
|
|
1282
|
-
if (props.loop) focus(first, { select: true });
|
|
1283
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
1284
|
-
event.preventDefault();
|
|
1285
|
-
if (props.loop) focus(last, { select: true });
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
return (_ctx, _cache) => {
|
|
1290
|
-
return openBlock(), createBlock(unref(Primitive), {
|
|
1291
|
-
ref_key: "currentRef",
|
|
1292
|
-
ref: currentRef,
|
|
1293
|
-
tabindex: "-1",
|
|
1294
|
-
"as-child": _ctx.asChild,
|
|
1295
|
-
as: _ctx.as,
|
|
1296
|
-
onKeydown: handleKeyDown
|
|
1297
|
-
}, {
|
|
1298
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1299
|
-
_: 3
|
|
1300
|
-
}, 8, ["as-child", "as"]);
|
|
1301
|
-
};
|
|
1302
|
-
}
|
|
1303
|
-
});
|
|
1304
|
-
var FocusScope_default = FocusScope_vue_vue_type_script_setup_true_lang_default;
|
|
1305
|
-
var Teleport_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1306
|
-
__name: "Teleport",
|
|
1307
|
-
props: {
|
|
1308
|
-
to: {
|
|
1309
|
-
type: null,
|
|
1310
|
-
required: false,
|
|
1311
|
-
default: "body"
|
|
1312
|
-
},
|
|
1313
|
-
disabled: {
|
|
1314
|
-
type: Boolean,
|
|
1315
|
-
required: false
|
|
1316
|
-
},
|
|
1317
|
-
defer: {
|
|
1318
|
-
type: Boolean,
|
|
1319
|
-
required: false
|
|
1320
|
-
},
|
|
1321
|
-
forceMount: {
|
|
1322
|
-
type: Boolean,
|
|
1323
|
-
required: false
|
|
1324
|
-
}
|
|
1325
|
-
},
|
|
1326
|
-
setup(__props) {
|
|
1327
|
-
const isMounted = useMounted();
|
|
1328
|
-
return (_ctx, _cache) => {
|
|
1329
|
-
return unref(isMounted) || _ctx.forceMount ? (openBlock(), createBlock(Teleport, {
|
|
1330
|
-
key: 0,
|
|
1331
|
-
to: _ctx.to,
|
|
1332
|
-
disabled: _ctx.disabled,
|
|
1333
|
-
defer: _ctx.defer
|
|
1334
|
-
}, [renderSlot(_ctx.$slots, "default")], 8, [
|
|
1335
|
-
"to",
|
|
1336
|
-
"disabled",
|
|
1337
|
-
"defer"
|
|
1338
|
-
])) : createCommentVNode("v-if", true);
|
|
1339
|
-
};
|
|
1340
|
-
}
|
|
1341
|
-
});
|
|
1342
|
-
var Teleport_default = Teleport_vue_vue_type_script_setup_true_lang_default;
|
|
1343
|
-
export {
|
|
1344
|
-
DismissableLayer_default as D,
|
|
1345
|
-
FocusScope_default as F,
|
|
1346
|
-
Presence_default as P,
|
|
1347
|
-
Slot as S,
|
|
1348
|
-
Teleport_default as T,
|
|
1349
|
-
useForwardExpose as a,
|
|
1350
|
-
useBodyScrollLock as b,
|
|
1351
|
-
createContext as c,
|
|
1352
|
-
useHideOthers as d,
|
|
1353
|
-
Primitive as e,
|
|
1354
|
-
useEmitAsProps as f,
|
|
1355
|
-
getActiveElement as g,
|
|
1356
|
-
isClient as h,
|
|
1357
|
-
injectConfigProviderContext as i,
|
|
1358
|
-
unrefElement as j,
|
|
1359
|
-
computedEager as k,
|
|
1360
|
-
refAutoReset as l,
|
|
1361
|
-
createSharedComposable as m,
|
|
1362
|
-
useEventListener as n,
|
|
1363
|
-
reactiveOmit as r,
|
|
1364
|
-
useVModel as u
|
|
1365
|
-
};
|