@aochuang/client-sdk 1.0.278
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/README.md +93 -0
- package/common/avatar/avatar.vue +86 -0
- package/common/avatar/index.js +3 -0
- package/common/badge/badge.vue +105 -0
- package/common/badge/index.js +3 -0
- package/common/context-menu/context-menu-box.vue +61 -0
- package/common/context-menu/context-menu-group.vue +162 -0
- package/common/context-menu/context-menu-item.vue +179 -0
- package/common/context-menu/context-menu.vue +201 -0
- package/common/context-menu/index.js +3 -0
- package/common/context-menu/utils.js +138 -0
- package/common/friend-avatar/default.svg +1 -0
- package/common/friend-avatar/friend-avatar.vue +29 -0
- package/common/friend-avatar/index.js +3 -0
- package/common/image/index.js +3 -0
- package/common/index.js +17 -0
- package/common/room-avatar/default.svg +6 -0
- package/common/room-avatar/index.js +3 -0
- package/common/room-avatar/room-avatar.vue +29 -0
- package/common/scroll-load-more/index.js +3 -0
- package/common/scroll-load-more/scroll-load-more.vue +195 -0
- package/common/user-avatar/default.svg +1 -0
- package/common/user-avatar/index.js +3 -0
- package/common/user-avatar/user-avatar.vue +29 -0
- package/components/account-select/account-select-skeleton.vue +56 -0
- package/components/account-select/account-select.vue +205 -0
- package/components/account-select/all.svg +1 -0
- package/components/account-select/index.js +3 -0
- package/components/chat-editor/MENTION_TOKEN_SUMMARY.md +74 -0
- package/components/chat-editor/chat-editor-button/chat-editor-button.vue +78 -0
- package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +329 -0
- package/components/chat-editor/chat-editor-toolbar/chat-editor-toolbar-item.vue +28 -0
- package/components/chat-editor/chat-editor-toolbar/chat-editor-toolbar.vue +17 -0
- package/components/chat-editor/chat-editor.vue +933 -0
- package/components/chat-editor/index.js +12 -0
- package/components/chat-editor/utils.js +189 -0
- package/components/chat-friend-profile/chat-friend-profile.vue +118 -0
- package/components/chat-friend-profile/index.js +3 -0
- package/components/chat-layout/chat-layout.vue +71 -0
- package/components/chat-layout/index.js +3 -0
- package/components/chat-panel/chat-panel-box.vue +350 -0
- package/components/chat-panel/chat-panel-chat.vue +121 -0
- package/components/chat-panel/chat-panel-chats.vue +674 -0
- package/components/chat-panel/chat-panel-empty.vue +32 -0
- package/components/chat-panel/chat-panel-increment.vue +80 -0
- package/components/chat-panel/chat-panel-inner-msg.vue +25 -0
- package/components/chat-panel/chat-panel-loading.vue +29 -0
- package/components/chat-panel/chat-panel-nearest.vue +136 -0
- package/components/chat-panel/chat-panel.vue +292 -0
- package/components/chat-panel/index.js +3 -0
- package/components/chat-panel/util.js +83 -0
- package/components/chat-room-profile/chat-room-profile.vue +103 -0
- package/components/chat-room-profile/index.js +3 -0
- package/components/contacts-friend-select/contacts-friend-select-skeleton.vue +41 -0
- package/components/contacts-friend-select/contacts-friend-select.vue +204 -0
- package/components/contacts-friend-select/index.js +3 -0
- package/components/contacts-group-select/contacts-group-select-item.vue +98 -0
- package/components/contacts-group-select/contacts-group-select-skeleton.vue +81 -0
- package/components/contacts-group-select/contacts-group-select.vue +396 -0
- package/components/contacts-group-select/index.js +3 -0
- package/components/contacts-room-select/contacts-room-select-skeleton.vue +41 -0
- package/components/contacts-room-select/contacts-room-select.vue +208 -0
- package/components/contacts-room-select/index.js +3 -0
- package/components/index.js +43 -0
- package/components/layout/index.js +3 -0
- package/components/layout/layout.vue +70 -0
- package/components/session-select/index.js +11 -0
- package/components/session-select/session-select-item-skeleton.vue +59 -0
- package/components/session-select/session-select-item.vue +190 -0
- package/components/session-select/session-select.vue +386 -0
- package/components/wechat-chat-control/calling/calling.vue +227 -0
- package/components/wechat-chat-control/calling/phone-fill.svg +1 -0
- package/components/wechat-chat-control/calling/vidicon-fill.svg +1 -0
- package/components/wechat-chat-control/channel-live/channel-live.vue +198 -0
- package/components/wechat-chat-control/channel-live/quote-icon.svg +1 -0
- package/components/wechat-chat-control/channel-video/channel-video.vue +180 -0
- package/components/wechat-chat-control/channel-video/quote-icon.svg +1 -0
- package/components/wechat-chat-control/channel-video-card/channel-video-card.vue +139 -0
- package/components/wechat-chat-control/channel-video-card/quote-icon.svg +1 -0
- package/components/wechat-chat-control/company-card/company-card.vue +136 -0
- package/components/wechat-chat-control/company-card/quote-icon.svg +1 -0
- package/components/wechat-chat-control/custom-expression/custom-expression.vue +45 -0
- package/components/wechat-chat-control/empty/empty.vue +27 -0
- package/components/wechat-chat-control/file-url/file-url.vue +307 -0
- package/components/wechat-chat-control/file-url/icons/file-excel-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-info-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-music-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-pdf-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-ppt-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-settings-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-text-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-unknow-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-word-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/file-zip-line.svg +1 -0
- package/components/wechat-chat-control/file-url/icons/index.js +24 -0
- package/components/wechat-chat-control/image/image.vue +344 -0
- package/components/wechat-chat-control/image/index.js +1 -0
- package/components/wechat-chat-control/image/util.js +29 -0
- package/components/wechat-chat-control/index.js +104 -0
- package/components/wechat-chat-control/jx-sys-text/jx-sys-text.vue +28 -0
- package/components/wechat-chat-control/location/location.vue +179 -0
- package/components/wechat-chat-control/location/offline-bg.png +0 -0
- package/components/wechat-chat-control/member-change/member-change.vue +37 -0
- package/components/wechat-chat-control/music/icons/163.png +0 -0
- package/components/wechat-chat-control/music/icons/163.svg +12 -0
- package/components/wechat-chat-control/music/icons/default.png +0 -0
- package/components/wechat-chat-control/music/icons/default.svg +1 -0
- package/components/wechat-chat-control/music/icons/kuwo.png +0 -0
- package/components/wechat-chat-control/music/icons/qq.png +0 -0
- package/components/wechat-chat-control/music/icons/qq.svg +1 -0
- package/components/wechat-chat-control/music/music.vue +156 -0
- package/components/wechat-chat-control/music/utils.js +30 -0
- package/components/wechat-chat-control/quote-message/quote-message.vue +257 -0
- package/components/wechat-chat-control/real-time-position/icon.svg +1 -0
- package/components/wechat-chat-control/real-time-position/real-time-position.vue +57 -0
- package/components/wechat-chat-control/red-envelopes/quote-icon.svg +1 -0
- package/components/wechat-chat-control/red-envelopes/red-envelope.svg +1 -0
- package/components/wechat-chat-control/red-envelopes/red-envelopes.vue +168 -0
- package/components/wechat-chat-control/revoke-me-message/revoke-me-message.vue +41 -0
- package/components/wechat-chat-control/revoke-other-message/revoke-other-message.vue +41 -0
- package/components/wechat-chat-control/revoke-you-message/revoke-you-message.vue +41 -0
- package/components/wechat-chat-control/room-calling/phone-fill.svg +1 -0
- package/components/wechat-chat-control/room-calling/room-calling.vue +52 -0
- package/components/wechat-chat-control/room-calling/vidicon-fill.svg +1 -0
- package/components/wechat-chat-control/share-card/quote-icon.svg +1 -0
- package/components/wechat-chat-control/share-card/share-card.vue +140 -0
- package/components/wechat-chat-control/system/system.vue +122 -0
- package/components/wechat-chat-control/system-batch-message/system-batch-message.vue +28 -0
- package/components/wechat-chat-control/system-money/system-money.vue +39 -0
- package/components/wechat-chat-control/text/icons/icon.svg +6 -0
- package/components/wechat-chat-control/text/text.vue +164 -0
- package/components/wechat-chat-control/text-with-at/text-with-at.vue +88 -0
- package/components/wechat-chat-control/transfer/collection.svg +1 -0
- package/components/wechat-chat-control/transfer/quote-icon.svg +1 -0
- package/components/wechat-chat-control/transfer/red-transfer.svg +1 -0
- package/components/wechat-chat-control/transfer/refund.svg +1 -0
- package/components/wechat-chat-control/transfer/transfer.svg +1 -0
- package/components/wechat-chat-control/transfer/transfer.vue +263 -0
- package/components/wechat-chat-control/unknow/unknow.vue +21 -0
- package/components/wechat-chat-control/url/icons/link.svg +1 -0
- package/components/wechat-chat-control/url/icons/video.svg +6 -0
- package/components/wechat-chat-control/url/miniprogram.svg +1 -0
- package/components/wechat-chat-control/url/url-file.vue +47 -0
- package/components/wechat-chat-control/url/url-link.vue +169 -0
- package/components/wechat-chat-control/url/url-merge.vue +164 -0
- package/components/wechat-chat-control/url/url-miniprogram.vue +259 -0
- package/components/wechat-chat-control/url/url.vue +116 -0
- package/components/wechat-chat-control/util.js +234 -0
- package/components/wechat-chat-control/video/icons/video.svg +1 -0
- package/components/wechat-chat-control/video/video.vue +304 -0
- package/components/wechat-chat-control/voice/icons/voice.svg +1 -0
- package/components/wechat-chat-control/voice/voice.vue +464 -0
- package/components/wechat-chat-control/wechat-chat-control-config-item.vue +24 -0
- package/components/wechat-chat-control/wechat-chat-control-config-msg.vue +21 -0
- package/components/wechat-chat-control/wechat-chat-control-config.vue +57 -0
- package/components/wechat-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +69 -0
- package/components/wechat-chat-panel/chat-panel-item.vue +695 -0
- package/components/wechat-chat-panel/chat-panel.vue +257 -0
- package/components/wechat-chat-panel/index.js +3 -0
- package/components/wework-chat-control/calling/calling.vue +223 -0
- package/components/wework-chat-control/calling/phone-fill.svg +1 -0
- package/components/wework-chat-control/calling/vidicon-fill.svg +1 -0
- package/components/wework-chat-control/channel-live/channel-live.vue +198 -0
- package/components/wework-chat-control/channel-live/quote-icon.svg +1 -0
- package/components/wework-chat-control/channel-video/channel-video.vue +180 -0
- package/components/wework-chat-control/channel-video/quote-icon.svg +1 -0
- package/components/wework-chat-control/company-card/company-card.vue +136 -0
- package/components/wework-chat-control/company-card/quote-icon.svg +1 -0
- package/components/wework-chat-control/custom-expression/custom-expression.vue +34 -0
- package/components/wework-chat-control/empty/empty.vue +27 -0
- package/components/wework-chat-control/expression/expression.vue +53 -0
- package/components/wework-chat-control/file-url/file-url.vue +247 -0
- package/components/wework-chat-control/file-url/icons/file-excel-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-info-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-music-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-pdf-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-ppt-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-settings-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-text-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-unknow-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-word-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/file-zip-line.svg +1 -0
- package/components/wework-chat-control/file-url/icons/index.js +24 -0
- package/components/wework-chat-control/image/image.vue +296 -0
- package/components/wework-chat-control/image/index.js +1 -0
- package/components/wework-chat-control/image/util.js +21 -0
- package/components/wework-chat-control/index.js +105 -0
- package/components/wework-chat-control/jx-sys-text/jx-sys-text.vue +28 -0
- package/components/wework-chat-control/link/link.vue +100 -0
- package/components/wework-chat-control/location/location.vue +181 -0
- package/components/wework-chat-control/location/offline-bg.png +0 -0
- package/components/wework-chat-control/red-envelopes/quote-icon.svg +1 -0
- package/components/wework-chat-control/red-envelopes/red-envelope.svg +1 -0
- package/components/wework-chat-control/red-envelopes/red-envelopes.vue +168 -0
- package/components/wework-chat-control/share-card/quote-icon.svg +1 -0
- package/components/wework-chat-control/share-card/share-card.vue +140 -0
- package/components/wework-chat-control/text/icons/icon.svg +6 -0
- package/components/wework-chat-control/text/text.vue +157 -0
- package/components/wework-chat-control/unknow/unknow.vue +21 -0
- package/components/wework-chat-control/url/icons/link.svg +1 -0
- package/components/wework-chat-control/url/icons/video.svg +6 -0
- package/components/wework-chat-control/url/miniprogram.svg +1 -0
- package/components/wework-chat-control/url/url-file.vue +37 -0
- package/components/wework-chat-control/url/url-link.vue +169 -0
- package/components/wework-chat-control/url/url-merge.vue +164 -0
- package/components/wework-chat-control/url/url-miniprogram.vue +248 -0
- package/components/wework-chat-control/url/url.vue +103 -0
- package/components/wework-chat-control/util.js +223 -0
- package/components/wework-chat-control/video/icons/video.svg +1 -0
- package/components/wework-chat-control/video/video.vue +304 -0
- package/components/wework-chat-control/voice/icons/voice.svg +1 -0
- package/components/wework-chat-control/voice/voice.vue +464 -0
- package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
- package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
- package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
- package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
- package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
- package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
- package/components/wework-chat-panel/chat-panel-item.vue +650 -0
- package/components/wework-chat-panel/chat-panel.vue +163 -0
- package/components/wework-chat-panel/index.js +3 -0
- package/package.json +23 -0
- package/services/client-chat/client-chat-wechat/client-chat-account.js +426 -0
- package/services/client-chat/client-chat-wechat/client-chat-concats.js +1029 -0
- package/services/client-chat/client-chat-wechat/client-chat-draft.js +92 -0
- package/services/client-chat/client-chat-wechat/client-chat-message.js +588 -0
- package/services/client-chat/client-chat-wechat/client-chat-session-manage.js +67 -0
- package/services/client-chat/client-chat-wechat/client-chat-session.js +1048 -0
- package/services/client-chat/client-chat-wechat/client-chat-socket.js +215 -0
- package/services/client-chat/client-chat-wechat/client-chat.js +1065 -0
- package/services/client-chat/client-chat-wechat/index.js +3 -0
- package/services/client-chat/client-chat-wechat/utils.js +82 -0
- package/services/client-chat/client-chat-wework/client-chat-account.js +310 -0
- package/services/client-chat/client-chat-wework/client-chat-concats.js +772 -0
- package/services/client-chat/client-chat-wework/client-chat-message.js +278 -0
- package/services/client-chat/client-chat-wework/client-chat-session.js +929 -0
- package/services/client-chat/client-chat-wework/client-chat-socket.js +64 -0
- package/services/client-chat/client-chat-wework/client-chat.js +330 -0
- package/services/client-chat/client-chat-wework/index.js +3 -0
- package/services/client-chat/client-chat-wework/utils.js +82 -0
- package/services/index.js +10 -0
- package/services/socket/index.js +5 -0
- package/services/socket/socket.js +797 -0
- package/services/socket/utils.js +7 -0
- package/uni-common/account-portray/account-portray.vue +51 -0
- package/uni-common/account-select/account-select-item.vue +172 -0
- package/uni-common/account-select/account-select.vue +252 -0
- package/uni-common/all-friend-avatar/all-friend-avatar.vue +49 -0
- package/uni-common/friend-avatar/default.svg +1 -0
- package/uni-common/friend-avatar/friend-avatar.vue +27 -0
- package/uni-common/friend-avatar/index.js +3 -0
- package/uni-common/friend-loader/friend-loader.vue +53 -0
- package/uni-common/friend-portray/friend-portray.vue +56 -0
- package/uni-common/group-avatar/default.svg +1 -0
- package/uni-common/group-avatar/group-avatar.vue +18 -0
- package/uni-common/group-avatar/index.js +3 -0
- package/uni-common/room-avatar/default.svg +6 -0
- package/uni-common/room-avatar/index.js +3 -0
- package/uni-common/room-avatar/room-avatar.vue +27 -0
- package/uni-common/room-loader/room-loader.vue +53 -0
- package/uni-common/room-portray/room-portray.vue +56 -0
- package/uni-components/chat-control/calling/calling.vue +91 -0
- package/uni-components/chat-control/calling/phone-fill.svg +1 -0
- package/uni-components/chat-control/calling/vidicon-fill.svg +1 -0
- package/uni-components/chat-control/channel-video/channel-video.vue +89 -0
- package/uni-components/chat-control/channel-video-card/channel-video-card.vue +105 -0
- package/uni-components/chat-control/channel-video-live/channel-video-live.vue +92 -0
- package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +20 -0
- package/uni-components/chat-control/chat-control-config-item/index.js +3 -0
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +25 -0
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +21 -0
- package/uni-components/chat-control/chat-control-config.vue +59 -0
- package/uni-components/chat-control/chat-control.vue +218 -0
- package/uni-components/chat-control/company-card/company-card.vue +123 -0
- package/uni-components/chat-control/const.js +28 -0
- package/uni-components/chat-control/expression/expression.vue +41 -0
- package/uni-components/chat-control/image/image.vue +68 -0
- package/uni-components/chat-control/index.js +89 -0
- package/uni-components/chat-control/location/location.vue +110 -0
- package/uni-components/chat-control/member-change/member-change.vue +32 -0
- package/uni-components/chat-control/quote-message/quote-message.vue +216 -0
- package/uni-components/chat-control/real-time-position/real-time-position.vue +62 -0
- package/uni-components/chat-control/redpacket/red-envelope.svg +1 -0
- package/uni-components/chat-control/redpacket/redpacket.vue +75 -0
- package/uni-components/chat-control/share-card/share-card.vue +101 -0
- package/uni-components/chat-control/system/system.vue +69 -0
- package/uni-components/chat-control/system-batch-message/system-batch-message.vue +30 -0
- package/uni-components/chat-control/system-text/system-text.vue +32 -0
- package/uni-components/chat-control/text/text.vue +67 -0
- package/uni-components/chat-control/text-with-at/text-with-at.vue +51 -0
- package/uni-components/chat-control/transfer/red-transfer.svg +1 -0
- package/uni-components/chat-control/transfer/transfer.vue +80 -0
- package/uni-components/chat-control/unkonw/unkonw.vue +37 -0
- package/uni-components/chat-control/url/icons/file-excel-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-info-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-music-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-pdf-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-ppt-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-settings-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-text-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-unknow-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-word-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-zip-line.svg +1 -0
- package/uni-components/chat-control/url/icons/index.js +24 -0
- package/uni-components/chat-control/url/miniprogram.svg +1 -0
- package/uni-components/chat-control/url/url-miniprogram.vue +116 -0
- package/uni-components/chat-control/url/url.vue +306 -0
- package/uni-components/chat-control/url-new/icons/file-excel-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-info-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-music-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-settings-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-text-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-word-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-zip-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/index.js +24 -0
- package/uni-components/chat-control/url-new/url-new.vue +110 -0
- package/uni-components/chat-control/utils.js +12 -0
- package/uni-components/chat-control/video/video.vue +156 -0
- package/uni-components/chat-control/voice/voice.vue +166 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +84 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +28 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +85 -0
- package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +157 -0
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +158 -0
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +61 -0
- package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +58 -0
- package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +54 -0
- package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +42 -0
- package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +42 -0
- package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +25 -0
- package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +158 -0
- package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +75 -0
- package/uni-components/chat-editor/chat-editor.vue +257 -0
- package/uni-components/chat-editor/index.js +10 -0
- package/uni-components/chat-editor/util.js +65 -0
- package/uni-components/chat-panel/chat-panel-chats-box.vue +238 -0
- package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +273 -0
- package/uni-components/chat-panel/chat-panel-chats-item.vue +578 -0
- package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +71 -0
- package/uni-components/chat-panel/chat-panel-chats.vue +368 -0
- package/uni-components/chat-panel/chat-panel.vue +227 -0
- package/uni-components/contacts-group-select/contacts-group-select-item.vue +85 -0
- package/uni-components/contacts-group-select/contacts-group-select-panel.vue +119 -0
- package/uni-components/contacts-group-select/contacts-group-select.vue +150 -0
- package/utils/color.js +178 -0
- package/utils/data.js +11 -0
- package/utils/date.js +107 -0
- package/utils/event.js +3 -0
- package/utils/file.js +26 -0
- package/utils/index.js +5 -0
- package/utils/json.js +40 -0
- package/utils/log.js +243 -0
- package/utils/queue.js +97 -0
- package/utils/regexp.js +9 -0
- package/utils/string.js +66 -0
- package/utils/url.js +48 -0
- package/utils/util.js +130 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sdk-account-select-skeleton">
|
|
3
|
+
<div
|
|
4
|
+
class="sdk-account-select-skeleton__item"
|
|
5
|
+
v-for="index in 30"
|
|
6
|
+
:key="index"
|
|
7
|
+
>
|
|
8
|
+
<div class="sdk-account-select-skeleton__avatar">
|
|
9
|
+
<ui-skeleton width="32px" height="32px" radius="4px"></ui-skeleton>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="sdk-account-select-skeleton__main">
|
|
12
|
+
<div class="sdk-account-select-skeleton__name">
|
|
13
|
+
<ui-skeleton width="85%" height="18px"></ui-skeleton>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import UiSkeleton from '@aochuang/common/components/skeleton'
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'SdkAccountSelectSkeleton',
|
|
24
|
+
components: {
|
|
25
|
+
UiSkeleton
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
<style>
|
|
30
|
+
.sdk-account-select-skeleton{
|
|
31
|
+
height: 100%;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
.sdk-account-select-skeleton:after {
|
|
35
|
+
content: '';
|
|
36
|
+
position: absolute;
|
|
37
|
+
left: 0;
|
|
38
|
+
top: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: 0;
|
|
41
|
+
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(225,224,212,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
|
42
|
+
}
|
|
43
|
+
.sdk-account-select-skeleton__item{
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
align-items: center;
|
|
47
|
+
padding: 6px 12px;
|
|
48
|
+
}
|
|
49
|
+
.sdk-account-select-skeleton__avatar{
|
|
50
|
+
margin-right: 12px;
|
|
51
|
+
}
|
|
52
|
+
.sdk-account-select-skeleton__main{
|
|
53
|
+
flex: 1;
|
|
54
|
+
min-height: 0;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sdk-account-select">
|
|
3
|
+
<template v-if="loading">
|
|
4
|
+
<account-select-skeleton></account-select-skeleton>
|
|
5
|
+
</template>
|
|
6
|
+
<template v-else>
|
|
7
|
+
<template v-if="allowAllAccount">
|
|
8
|
+
<div
|
|
9
|
+
class="sdk-account-select__item is-all" :class="{'is-active': !value}"
|
|
10
|
+
@click="handleAccountItemClick(null)"
|
|
11
|
+
>
|
|
12
|
+
<div class="sdk-account-select__item-avatar">
|
|
13
|
+
<svg t="1744099218020" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11301" width="200" height="200"><path d="M382.62258422 539.16358718l5.87182835-1.378603 0.61271229-0.2042379a38.65194652 38.65194652 0 0 0 26.60193435-36.20109595 38.2945309 38.2945309 0 0 0-24.81485624-35.4862654 85.67763005 85.67763005 0 0 1-48.60852444-77.61024921c0-38.75406546 33.18859325-70.10452116 65.96871142-80.92910803l3.52309744-1.22542527 1.17436512-3.62521569c6.02500608-19.09620632 15.11357503-36.96698736 27.06146892-52.99963083l0.40847441-0.66377175a216.49174726 216.49174726 0 0 1 6.53560012-10.31399354l7.40360909-11.02882477-13.02014008-0.66377177a22.26188742 22.26188742 0 0 1-2.55296882-0.30635614 33.95448399 33.95448399 0 0 0-5.10593763-0.4084751C346.67678494 226.06750336 275.80637307 298.82711158 275.80637307 388.23207626c0 37.06910562 12.40742778 72.75960822 35.1288498 101.65921473C233.27391419 534.82354026 185.22704258 619.7352803 185.43128049 711.64215359v47.84263442c0 21.18964057 16.7474747 38.39664984 37.32440227 38.39664915H283.97587287v-7.45466855c0-20.01527477 1.83813758-32.57588098 5.92288782-53.25492751l1.78707812-8.98644999h-39.82631233v-16.54323752c0.10211896-81.69499874 54.02081822-152.87176677 130.81411721-172.47856641h-0.05105948z m535.20436276-49.2722962a164.30906663 164.30906663 0 0 0 35.07779032-101.60815526c0-89.45602415-70.87041188-162.21563237-157.92664561-162.21563236a33.85236503 33.85236503 0 0 0-5.10593695 0.51059403 28.59324967 28.59324967 0 0 1-2.55296882 0.25529668l-12.96908131 0.66377177 7.40360909 11.07988424c2.34873091 3.47203727 4.54428412 6.89301575 6.53560013 10.26293406l0.40847509 0.71483125c11.94789391 16.03264347 21.03646216 33.85236503 27.06146824 52.99963082l1.1743658 3.57415621 3.52309675 1.22542528c34.36295908 11.38624039 70.97253011 43.60470574 70.97253081 80.87804856a85.67763005 85.67763005 0 0 1-48.65958389 77.61024919 38.2945309 38.2945309 0 0 0-24.81485628 35.4862654c0 16.18582188 10.72246863 30.73774339 26.5508749 36.20109664l6.43348116 1.63389969c76.793299 19.60679969 130.71199826 90.78356769 130.8651767 172.47856642v16.5432375h-44.83013103l1.78707811 8.98645c4.03369077 20.16845317 5.92288713 33.2907122 5.92288784 53.30598698v7.45466856h61.22018939c20.52586881 0 37.27334351-17.1559498 37.324403-38.39664985v-47.84263372c0.25529667-92.00899296-47.74051477-176.9207323-125.40182344-221.80192209z" fill="currentColor" p-id="11302"></path><path d="M744.78672704 486.11289688A186.21353843 186.21353843 0 0 0 810.39802285 344.52525227C810.34696336 239.85353413 722.42272064 154.5843792 614.33002544 154.5843792 506.28838902 154.5843792 418.3641463 239.85353413 418.3641463 344.57631104c0 54.4292933 23.69154991 105.38654865 65.50917756 141.53658583a320.29545571 320.29545571 0 0 0-134.28615448 107.93951749 302.42467466 302.42467466 0 0 0-56.93120267 176.66543562v60.86277448c0 20.83222497 17.51336542 37.83499633 38.95830266 37.83499634h565.48257161c21.44493724 0 38.80512424-16.84959365 38.90724319-37.78393684v-60.91383398c0-63.46680209-19.70891861-124.58487324-56.93120266-176.66543562a320.29545571 320.29545571 0 0 0-134.28615448-107.93951748z m-130.4567016 42.37928116c143.06836725 0 259.38162176 112.6880395 259.38162177 251.26318142v25.01909345H354.94840371v-25.01909346c0-138.57514193 116.36431396-251.26318143 259.43268121-251.26318141H614.33002544zM485.50722353 344.32101436c0-68.77697762 57.79921162-124.78911114 128.82280191-124.78911112 71.02358959 0 128.87386068 55.96107405 128.87386069 124.78911112 0 68.8280364-57.85027109 124.78911114-128.87386068 124.78911114-70.97253011 0-128.8228019-55.96107405-128.82280192-124.78911114z" fill="currentColor" p-id="11303"></path></svg>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="sdk-account-select__item-main">
|
|
16
|
+
<div class="sdk-account-select__item-main-row">
|
|
17
|
+
<span class="sdk-account-select__item-name">全部微号</span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<slot name="all"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
<template v-if="data && data.length">
|
|
24
|
+
<div
|
|
25
|
+
class="sdk-account-select__item"
|
|
26
|
+
:class="{'is-active': value === item.id}"
|
|
27
|
+
v-for="item in data"
|
|
28
|
+
:key="item.id"
|
|
29
|
+
@click="handleAccountItemClick(item)"
|
|
30
|
+
@contextmenu="handleAccountItemContext(item, $event)"
|
|
31
|
+
>
|
|
32
|
+
<div class="sdk-account-select__item-avatar">
|
|
33
|
+
<ui-image class="sdk-account-select__item-avatar-image" :src="item[avatarField]"></ui-image>
|
|
34
|
+
<span class="sdk-account-select__item-network" :class="[{'is-online': item[aliveField], 'is-offline': !item[aliveField]}]" :title="item[aliveField] ? '在线' : '离线'"></span>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="sdk-account-select__item-main">
|
|
37
|
+
<div class="sdk-account-select__item-main-row">
|
|
38
|
+
<span class="sdk-account-select__item-name">
|
|
39
|
+
<slot name="name" :item="item">{{ item[nameField] }}</slot>
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<slot name="addon" :item="item"></slot>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<template v-else>
|
|
47
|
+
<span class="sdk-account-select__empty">暂无数据</span>
|
|
48
|
+
</template>
|
|
49
|
+
</template>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
<script>
|
|
53
|
+
import UiImage from '../../common/image'
|
|
54
|
+
import AccountSelectSkeleton from './account-select-skeleton.vue'
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
name: 'SdkAccountSelect',
|
|
58
|
+
components: {
|
|
59
|
+
UiImage,
|
|
60
|
+
AccountSelectSkeleton
|
|
61
|
+
},
|
|
62
|
+
props: {
|
|
63
|
+
data: {
|
|
64
|
+
type: Array
|
|
65
|
+
},
|
|
66
|
+
allowAllAccount: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: true
|
|
69
|
+
},
|
|
70
|
+
avatarField: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: 'avatar'
|
|
73
|
+
},
|
|
74
|
+
nameField: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'name'
|
|
77
|
+
},
|
|
78
|
+
aliveField: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: 'wechatAlive'
|
|
81
|
+
},
|
|
82
|
+
value: {
|
|
83
|
+
type: String
|
|
84
|
+
},
|
|
85
|
+
queryMethod: {
|
|
86
|
+
type: Function
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
data () {
|
|
90
|
+
return {
|
|
91
|
+
loading: false
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
created () {
|
|
95
|
+
this.reload()
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
reload () {
|
|
99
|
+
return this.loadData()
|
|
100
|
+
},
|
|
101
|
+
loadData () {
|
|
102
|
+
if (!this.queryMethod) {
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
this.loading = true
|
|
106
|
+
return this.queryMethod().finally(() => {
|
|
107
|
+
this.loading = false
|
|
108
|
+
})
|
|
109
|
+
},
|
|
110
|
+
handleAccountItemContext (item, evt) {
|
|
111
|
+
this.$emit('item-contextmenu', item, evt)
|
|
112
|
+
},
|
|
113
|
+
handleAccountItemClick (item) {
|
|
114
|
+
this.$emit('input', item ? item.id : null)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</script>
|
|
119
|
+
<style>
|
|
120
|
+
.sdk-account-select{
|
|
121
|
+
padding: 6px 0;
|
|
122
|
+
overflow: auto;
|
|
123
|
+
height: 100%;
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
word-break: break-all;
|
|
128
|
+
}
|
|
129
|
+
.sdk-account-select__item{
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: row;
|
|
132
|
+
align-items: center;
|
|
133
|
+
padding: 6px;
|
|
134
|
+
border-radius: 3px;
|
|
135
|
+
margin: 0 6px;
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
transition: all .25s;
|
|
138
|
+
position: relative;
|
|
139
|
+
}
|
|
140
|
+
.sdk-account-select__item:not(:last-child) {
|
|
141
|
+
margin-bottom: 2px;
|
|
142
|
+
}
|
|
143
|
+
.sdk-account-select__item-network{
|
|
144
|
+
position: absolute;
|
|
145
|
+
right: -3px;
|
|
146
|
+
bottom: -3px;
|
|
147
|
+
width: 8px;
|
|
148
|
+
height: 8px;
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
border: 1px solid #fff;
|
|
151
|
+
box-sizing: content-box;
|
|
152
|
+
}
|
|
153
|
+
.sdk-account-select__item-network.is-online {
|
|
154
|
+
background-color: #08bb07;
|
|
155
|
+
}
|
|
156
|
+
.sdk-account-select__item-network.is-offline {
|
|
157
|
+
background-color: #ddd;
|
|
158
|
+
}
|
|
159
|
+
.sdk-account-select__item:hover {
|
|
160
|
+
background-color: rgba(0,0,0,.06);
|
|
161
|
+
}
|
|
162
|
+
.sdk-account-select__item.is-active {
|
|
163
|
+
background: linear-gradient(to right, rgba(56,120,232,1) 0%,rgba(79,160,242,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
|
164
|
+
color: #fff;
|
|
165
|
+
}
|
|
166
|
+
.sdk-account-select__item.is-all .sdk-account-select__item-avatar{
|
|
167
|
+
background-color: #f1f4f8;
|
|
168
|
+
color: #666;
|
|
169
|
+
}
|
|
170
|
+
.sdk-account-select__item-avatar{
|
|
171
|
+
width: 32px;
|
|
172
|
+
height: 32px;
|
|
173
|
+
min-width: 32px;
|
|
174
|
+
border-radius: 3px;
|
|
175
|
+
margin-right: 6px;
|
|
176
|
+
position: relative;
|
|
177
|
+
}
|
|
178
|
+
.sdk-account-select__item-avatar svg {
|
|
179
|
+
width: 100%;
|
|
180
|
+
height: 100%;
|
|
181
|
+
}
|
|
182
|
+
.sdk-account-select__item-avatar-image{
|
|
183
|
+
width: 100%;
|
|
184
|
+
height: 100%;
|
|
185
|
+
border-radius: 3px;
|
|
186
|
+
}
|
|
187
|
+
.sdk-account-select__empty{
|
|
188
|
+
color: #999;
|
|
189
|
+
font-size: 12px;
|
|
190
|
+
text-align: center;
|
|
191
|
+
display: block;
|
|
192
|
+
flex: 1;
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
}
|
|
198
|
+
.sdk-account-select__item-name{
|
|
199
|
+
display: -webkit-box;
|
|
200
|
+
-webkit-box-orient: vertical;
|
|
201
|
+
-webkit-line-clamp: 2;
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
text-overflow: ellipsis;
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1744098731580" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11146" xmlns:xlink="http://www.w3.org/1999/xlink" width="242.7734375" height="200"><path d="M282.479177 550.912l8.411429-1.974857 0.877714-0.292572a55.369143 55.369143 0 0 0 38.107429-51.858285 54.857143 54.857143 0 0 0-35.547429-50.834286 122.733714 122.733714 0 0 1-69.632-111.177143c0-55.515429 47.542857-100.425143 94.500571-115.931428l5.046858-1.755429 1.682285-5.193143c8.630857-27.355429 21.650286-52.955429 38.765715-75.922286l0.585142-0.950857a310.125714 310.125714 0 0 1 9.362286-14.774857l10.605714-15.798857-18.651428-0.950857a31.890286 31.890286 0 0 1-3.657143-0.438857 48.64 48.64 0 0 0-7.314286-0.585143C230.986606 102.4 129.46432 206.628571 129.46432 334.701714c0 53.101714 17.773714 104.228571 50.322286 145.627429C68.53632 544.694857-0.291109 666.331429 0.001463 797.988571v68.534858c0 30.354286 23.990857 55.003429 53.467428 55.003428H141.167177v-10.678857c0-28.672 2.633143-46.665143 8.484572-76.288l2.56-12.873143h-57.051429v-23.698286c0.146286-117.028571 77.385143-218.989714 187.392-247.076571h-0.073143z m766.683429-70.582857a235.373714 235.373714 0 0 0 50.249143-145.554286c0-128.146286-101.522286-232.374857-226.230858-232.374857a48.493714 48.493714 0 0 0-7.314285 0.731429 40.96 40.96 0 0 1-3.657143 0.365714l-18.578286 0.950857 10.605714 15.872c3.364571 4.973714 6.509714 9.874286 9.362286 14.701714l0.585143 1.024c17.115429 22.966857 30.134857 48.493714 38.765714 75.922286l1.682286 5.12 5.046857 1.755429c49.225143 16.310857 101.668571 62.464 101.668572 115.858285a122.733714 122.733714 0 0 1-69.705143 111.177143 54.857143 54.857143 0 0 0-35.547429 50.834286c0 23.186286 15.36 44.032 38.034286 51.858286l9.216 2.340571c110.006857 28.086857 187.245714 130.048 187.465143 247.076571v23.698286h-64.219429l2.56 12.873143c5.778286 28.891429 8.484571 47.689143 8.484572 76.361143v10.678857h87.698285c29.403429 0 53.394286-24.576 53.467429-55.003429v-68.534857c0.365714-131.803429-68.388571-253.44-179.638857-317.732571z" fill="currentColor" p-id="11147"></path><path d="M801.281463 474.916571A266.752 266.752 0 0 0 895.270034 272.091429C895.196891 122.148571 769.244891 0 614.401463 0 459.631177 0 333.679177 122.148571 333.679177 272.164571c0 77.970286 33.938286 150.966857 93.842286 202.752a458.825143 458.825143 0 0 0-192.365714 154.624 433.225143 433.225143 0 0 0-81.554286 253.074286v87.186286c0 29.842286 25.088 54.198857 55.808 54.198857h810.057143c30.72 0 55.588571-24.137143 55.734857-54.125714v-87.259429c0-90.916571-28.233143-178.468571-81.554286-253.074286a458.825143 458.825143 0 0 0-192.365714-154.624z m-186.88 60.708572c204.946286 0 371.565714 161.426286 371.565714 359.936v35.84H242.835749v-35.84c0-198.509714 166.692571-359.936 371.638857-359.936H614.401463zM429.862034 271.798857c0-98.523429 82.797714-178.761143 184.539429-178.761143 101.741714 0 184.612571 80.164571 184.612571 178.761143 0 98.596571-82.870857 178.761143-184.612571 178.761143-101.668571 0-184.539429-80.164571-184.539429-178.761143z" fill="currentColor" p-id="11148"></path></svg>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @ 群成员 Token 改造总结
|
|
2
|
+
|
|
3
|
+
## 背景
|
|
4
|
+
|
|
5
|
+
群聊 @ 成员原来只在输入框里保存普通文本,例如 `@张三 `。
|
|
6
|
+
当群里存在多个同名成员时,发送前只能按昵称从成员列表里反查 ID,
|
|
7
|
+
最终可能把消息 @ 到错误的人。
|
|
8
|
+
|
|
9
|
+
## 最终方案
|
|
10
|
+
|
|
11
|
+
将编辑器从纯文本 textarea 改为 `contenteditable` 编辑器,并把 @ 成员做成
|
|
12
|
+
不可拆分的 DOM token:
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<span data-mention-id="xxx" contenteditable="false">@张三</span>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
用户看到的仍然是 `@张三`,但发送时不再靠昵称匹配,而是直接从 token 的
|
|
19
|
+
`data-mention-id` 读取真实成员 ID。
|
|
20
|
+
|
|
21
|
+
## 核心改动
|
|
22
|
+
|
|
23
|
+
- 将 `components/chat-editor/chat-editor.vue` 的输入区从 `ui-textarea` 改为 `contenteditable`。
|
|
24
|
+
- 新增 @ 实体相关 API:
|
|
25
|
+
- `insertMention(mention)`
|
|
26
|
+
- `getMentions()`
|
|
27
|
+
- `clearMentions()`
|
|
28
|
+
- 保持原有文本接口兼容:
|
|
29
|
+
- `setInputText(text)`
|
|
30
|
+
- `getInputText()`
|
|
31
|
+
- `insertInputText(text)`
|
|
32
|
+
- `insertSuggestionsText(text)`
|
|
33
|
+
- `focus()`
|
|
34
|
+
- 群聊发送逻辑优先从 mention token 中读取 `atIds`。
|
|
35
|
+
- 手动输入的 @ 文本仍做兼容,但只对昵称唯一的成员生效;同名昵称不再猜测。
|
|
36
|
+
|
|
37
|
+
## 安全处理
|
|
38
|
+
|
|
39
|
+
- 不允许把任意 HTML 直接粘贴进 `contenteditable`。
|
|
40
|
+
- 粘贴时只白名单恢复本编辑器生成的 mention token。
|
|
41
|
+
- 其他 HTML 内容全部降级为纯文本。
|
|
42
|
+
- mention 文本通过 `textContent` 写入,不使用 `innerHTML`,避免 XSS 注入。
|
|
43
|
+
|
|
44
|
+
## 编辑行为
|
|
45
|
+
|
|
46
|
+
- mention token 使用 `contenteditable="false"`,浏览器删除、复制时会把一个 @ 成员当成整体。
|
|
47
|
+
- 同名成员也能区分,因为每个 token 都带有自己的 `data-mention-id`。
|
|
48
|
+
- 在本编辑器内复制粘贴 @ 成员时,可以保留成员 ID。
|
|
49
|
+
- 从外部来源复制的内容会按普通文本处理,不信任外部 HTML。
|
|
50
|
+
|
|
51
|
+
## 兼容点
|
|
52
|
+
|
|
53
|
+
- `disabled` 不再依赖 textarea 原生能力,改为:
|
|
54
|
+
- `contenteditable=false`
|
|
55
|
+
- 事件入口统一 guard
|
|
56
|
+
- 保留原 disabled 遮罩样式
|
|
57
|
+
- `maxlength` 需要手动实现,因为 `contenteditable` 没有 textarea 原生 maxlength:
|
|
58
|
+
- `beforeinput` 拦截超长输入
|
|
59
|
+
- 粘贴和程序插入按剩余长度裁剪
|
|
60
|
+
- 输入后做兜底截断
|
|
61
|
+
- 快捷语自动完成继续复用原来的 nearest-word 逻辑。
|
|
62
|
+
- @ 成员自动完成会从最近的 `@` 开始替换,避免留下半截输入内容。
|
|
63
|
+
|
|
64
|
+
## 涉及文件
|
|
65
|
+
|
|
66
|
+
- `components/chat-editor/chat-editor.vue`
|
|
67
|
+
- `src/entries/chat/views/chat/chat-panel/chat-panel-editor/chat-panel-editor.vue`
|
|
68
|
+
- `src/entries/chat/views/chat/chat-panel/chat-panel-room.vue`
|
|
69
|
+
|
|
70
|
+
## 验证情况
|
|
71
|
+
|
|
72
|
+
- Vue SFC script/template 解析通过。
|
|
73
|
+
- `git diff --check` 通过。
|
|
74
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-tooltip :disabled="!tips" :content="tips">
|
|
3
|
+
<div class="sdk-chat-editor-button" :class="{'is-active': active}" @click.stop="handleClick">
|
|
4
|
+
<template v-if="loading">
|
|
5
|
+
<ui-loading size="mini"></ui-loading>
|
|
6
|
+
</template>
|
|
7
|
+
<template v-else>
|
|
8
|
+
<template v-if="icon">
|
|
9
|
+
<span class="sdk-chat-editor-button__icon" v-html="icon"></span>
|
|
10
|
+
</template>
|
|
11
|
+
<template v-else-if="$slots.icon">
|
|
12
|
+
<slot name="icon"></slot>
|
|
13
|
+
</template>
|
|
14
|
+
</template>
|
|
15
|
+
<span class="sdk-chat-editor-button__text" v-if="text">{{ text }}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</ui-tooltip>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import { Tooltip as UiTooltip, Loading as UiLoading } from '@aochuang/common/components'
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'SdkChatEditorButton',
|
|
24
|
+
components: {
|
|
25
|
+
UiLoading,
|
|
26
|
+
UiTooltip
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
tips: {
|
|
30
|
+
type: String
|
|
31
|
+
},
|
|
32
|
+
icon: {
|
|
33
|
+
type: String
|
|
34
|
+
},
|
|
35
|
+
text: {
|
|
36
|
+
type: String
|
|
37
|
+
},
|
|
38
|
+
loading: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
active: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
handleClick (evt) {
|
|
49
|
+
if (this.loading) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
this.$emit('click', evt)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
<style>
|
|
58
|
+
.sdk-chat-editor-button{
|
|
59
|
+
color: #999;
|
|
60
|
+
transition: all .25s;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
.sdk-chat-editor-button.is-active,
|
|
64
|
+
.sdk-chat-editor-button:hover {
|
|
65
|
+
color: #0052CC;
|
|
66
|
+
}
|
|
67
|
+
.sdk-chat-editor-button__icon{
|
|
68
|
+
display: inline-block;
|
|
69
|
+
width: 24px;
|
|
70
|
+
height: 24px;
|
|
71
|
+
border-radius: 3px;
|
|
72
|
+
}
|
|
73
|
+
.sdk-chat-editor-button__icon svg {
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
vertical-align: top;
|
|
77
|
+
}
|
|
78
|
+
</style>
|