@tencentcloud/ai-desk-customer-vue 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.code.yml +17 -0
- package/.eslintignore +6 -0
- package/.stylelintrc.json +40 -0
- package/CHANGELOG.md +5 -0
- package/README.md +12 -0
- package/adapter-vue-web.ts +73 -0
- package/adapter-vue.ts +10 -0
- package/assets/audio-before-delete.svg +4 -0
- package/assets/audio-blue.png +0 -0
- package/assets/audio-bubble-blue.svg +3 -0
- package/assets/audio-bubble-red.svg +3 -0
- package/assets/audio-delete.svg +10 -0
- package/assets/audio.svg +6 -0
- package/assets/back.svg +16 -0
- package/assets/background_mobile.png +0 -0
- package/assets/camera-uni.png +0 -0
- package/assets/close-quote-icon.svg +3 -0
- package/assets/customer_avatar.png +0 -0
- package/assets/customer_avatar_mobile.png +0 -0
- package/assets/dialog-close.png +0 -0
- package/assets/double-arrow.svg +1 -0
- package/assets/download.svg +6 -0
- package/assets/emoji.png +0 -0
- package/assets/face-uni.png +0 -0
- package/assets/face.png +0 -0
- package/assets/file-h5.png +0 -0
- package/assets/files.png +0 -0
- package/assets/form-dialog-bg.png +0 -0
- package/assets/icon-arrow-left.svg +7 -0
- package/assets/icon-close.svg +6 -0
- package/assets/iconRight.svg +3 -0
- package/assets/icon_form.png +0 -0
- package/assets/icon_form_filled.png +0 -0
- package/assets/icon_question.png +0 -0
- package/assets/icon_refresh.png +0 -0
- package/assets/icon_success.png +0 -0
- package/assets/imRobotGuess.svg +4 -0
- package/assets/image-uni.png +0 -0
- package/assets/image.png +0 -0
- package/assets/keyboard_icon.png +0 -0
- package/assets/loading.png +0 -0
- package/assets/more-uni.png +0 -0
- package/assets/more_tools.png +0 -0
- package/assets/msg-audio.svg +1 -0
- package/assets/msg-copy.svg +30 -0
- package/assets/msg-del.svg +33 -0
- package/assets/msg-quote.svg +8 -0
- package/assets/msg-revoke.svg +29 -0
- package/assets/radio-check.png +0 -0
- package/assets/radio-uncheck.png +0 -0
- package/assets/radio.svg +6 -0
- package/assets/refresh.svg +4 -0
- package/assets/rotate-left.svg +7 -0
- package/assets/rotate-right.svg +7 -0
- package/assets/star.png +0 -0
- package/assets/starLine.png +0 -0
- package/assets/translate.svg +12 -0
- package/assets/video-play.png +0 -0
- package/assets/video-uni.png +0 -0
- package/assets/video.png +0 -0
- package/assets/zoom-in.svg +9 -0
- package/assets/zoom-out.svg +9 -0
- package/components/CustomerServiceChat/chat-header/index-web.vue +141 -0
- package/components/CustomerServiceChat/emoji-config/custom-emoji.ts +15 -0
- package/components/CustomerServiceChat/emoji-config/default-emoji.ts +114 -0
- package/components/CustomerServiceChat/emoji-config/index.ts +140 -0
- package/components/CustomerServiceChat/emoji-config/locales/en.ts +66 -0
- package/components/CustomerServiceChat/emoji-config/locales/zh_cn.ts +66 -0
- package/components/CustomerServiceChat/index-web.vue +250 -0
- package/components/CustomerServiceChat/message-input/index-web.vue +214 -0
- package/components/CustomerServiceChat/message-input/index.ts +2 -0
- package/components/CustomerServiceChat/message-input/message-input-button.vue +95 -0
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +884 -0
- package/components/CustomerServiceChat/message-input/message-input-file-web.ts +38 -0
- package/components/CustomerServiceChat/message-input/message-input-quote/index.vue +204 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-dialog-mobile/emoji-dialog-mobile.vue +145 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue +180 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/index.vue +90 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/style/h5.scss +26 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/style/index.scss +4 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/style/web.scss +55 -0
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +77 -0
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +185 -0
- package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +191 -0
- package/components/CustomerServiceChat/message-input-toolbar/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/style/uni.scss +111 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/index.vue +149 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/color.scss +6 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/h5.scss +20 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/index.scss +5 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/uni.scss +36 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/web.scss +19 -0
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +146 -0
- package/components/CustomerServiceChat/message-list/index-web.vue +712 -0
- package/components/CustomerServiceChat/message-list/link/index.ts +23 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-audio-web.vue +223 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +504 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-custom.vue +5 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-face.vue +45 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-file.vue +151 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-image-web.vue +97 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-location.vue +34 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-quote/index-web.vue +286 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-quote/interface.ts +60 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-record/index.vue +139 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-text.vue +94 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-timestamp.vue +76 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-video-web.vue +319 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/index.ts +9 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-customer/index.ts +5 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-customer/message-customer-service.vue +22 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-plugin-layout-web.vue +133 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-plugin-web.vue +83 -0
- package/components/CustomerServiceChat/message-list/message-elements/read-status/index.vue +193 -0
- package/components/CustomerServiceChat/message-list/message-elements/simple-message-list/index.vue +462 -0
- package/components/CustomerServiceChat/message-list/message-elements/simple-message-list/message-container.vue +105 -0
- package/components/CustomerServiceChat/message-list/message-elements/video-play.vue +59 -0
- package/components/CustomerServiceChat/message-list/message-tool/index-web.vue +312 -0
- package/components/CustomerServiceChat/message-list/message-tool/message-revoked.vue +63 -0
- package/components/CustomerServiceChat/message-list/scroll-button/index.vue +201 -0
- package/components/CustomerServiceChat/message-list/style/color.scss +32 -0
- package/components/CustomerServiceChat/message-list/style/h5.scss +16 -0
- package/components/CustomerServiceChat/message-list/style/index.scss +11 -0
- package/components/CustomerServiceChat/message-list/style/web.scss +180 -0
- package/components/CustomerServiceChat/style/common.scss +59 -0
- package/components/CustomerServiceChat/style/h5.scss +51 -0
- package/components/CustomerServiceChat/style/index.scss +12 -0
- package/components/CustomerServiceChat/style/uni.scss +13 -0
- package/components/CustomerServiceChat/style/web.scss +46 -0
- package/components/CustomerServiceChat/style/wx.scss +5 -0
- package/components/CustomerServiceChat/utils/conversationDraft.ts +86 -0
- package/components/CustomerServiceChat/utils/sendMessage.ts +140 -0
- package/components/common/Avatar/index.vue +148 -0
- package/components/common/BottomPopup/index.ts +3 -0
- package/components/common/BottomPopup/index.vue +160 -0
- package/components/common/BottomPopup/style/h5.scss +62 -0
- package/components/common/BottomPopup/style/index.scss +3 -0
- package/components/common/BottomPopup/style/modal.scss +5 -0
- package/components/common/Dialog/index.ts +3 -0
- package/components/common/Dialog/index.vue +120 -0
- package/components/common/Dialog/style/color.scss +43 -0
- package/components/common/Dialog/style/dialog.scss +4 -0
- package/components/common/Dialog/style/h5.scss +56 -0
- package/components/common/Dialog/style/web.scss +61 -0
- package/components/common/Drawer/index.vue +164 -0
- package/components/common/Icon.vue +83 -0
- package/components/common/ImagePreviewer/image-item-web.vue +42 -0
- package/components/common/ImagePreviewer/index-web.vue +682 -0
- package/components/common/ImagePreviewer/index.ts +3 -0
- package/components/common/Overlay/index.vue +126 -0
- package/components/common/ProgressMessage/index.vue +95 -0
- package/components/common/RadioSelect/index.vue +59 -0
- package/components/common/RichText/LICENSE +21 -0
- package/components/common/RichText/README.md +244 -0
- package/components/common/RichText/dist/mp-alipay/index.acss +1 -0
- package/components/common/RichText/dist/mp-alipay/index.axml +1 -0
- package/components/common/RichText/dist/mp-alipay/index.js +8 -0
- package/components/common/RichText/dist/mp-alipay/index.json +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.acss +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.axml +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.js +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.json +1 -0
- package/components/common/RichText/dist/mp-alipay/parser.js +1 -0
- package/components/common/RichText/dist/mp-baidu/index.css +1 -0
- package/components/common/RichText/dist/mp-baidu/index.js +8 -0
- package/components/common/RichText/dist/mp-baidu/index.json +1 -0
- package/components/common/RichText/dist/mp-baidu/index.swan +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.css +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.js +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.json +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.swan +1 -0
- package/components/common/RichText/dist/mp-baidu/parser.js +1 -0
- package/components/common/RichText/dist/mp-qq/index.js +8 -0
- package/components/common/RichText/dist/mp-qq/index.json +1 -0
- package/components/common/RichText/dist/mp-qq/index.qml +1 -0
- package/components/common/RichText/dist/mp-qq/index.qss +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.js +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.json +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.qml +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.qss +1 -0
- package/components/common/RichText/dist/mp-qq/parser.js +1 -0
- package/components/common/RichText/dist/mp-toutiao/index.js +8 -0
- package/components/common/RichText/dist/mp-toutiao/index.json +1 -0
- package/components/common/RichText/dist/mp-toutiao/index.ttml +1 -0
- package/components/common/RichText/dist/mp-toutiao/index.ttss +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.js +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.json +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.ttml +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.ttss +1 -0
- package/components/common/RichText/dist/mp-toutiao/parser.js +1 -0
- package/components/common/RichText/dist/mp-weixin/index.js +8 -0
- package/components/common/RichText/dist/mp-weixin/index.json +1 -0
- package/components/common/RichText/dist/mp-weixin/index.wxml +1 -0
- package/components/common/RichText/dist/mp-weixin/index.wxss +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.js +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.json +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.wxml +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.wxss +1 -0
- package/components/common/RichText/dist/mp-weixin/parser.js +1 -0
- package/components/common/RichText/dist/uni-app/components/mp-html/mp-html.vue +498 -0
- package/components/common/RichText/dist/uni-app/components/mp-html/node/node.vue +587 -0
- package/components/common/RichText/dist/uni-app/components/mp-html/parser.js +1393 -0
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/handler.js +1 -0
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +1 -0
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/local.html +1 -0
- package/components/common/RichText/docs/.nojekyll +0 -0
- package/components/common/RichText/docs/index.html +50 -0
- package/components/common/RichText/docs/lib/docsify.min.js +1 -0
- package/components/common/RichText/docs/lib/prism-bash.min.js +1 -0
- package/components/common/RichText/docs/lib/search.min.js +1 -0
- package/components/common/RichText/docs/lib/vue.css +858 -0
- package/components/common/RichText/gulpfile.js +113 -0
- package/components/common/RichText/lint.js +63 -0
- package/components/common/RichText/package.json +74 -0
- package/components/common/RichText/plugins/README.md +2 -0
- package/components/common/RichText/plugins/audio/README.md +25 -0
- package/components/common/RichText/plugins/audio/build.js +11 -0
- package/components/common/RichText/plugins/audio/context.js +7 -0
- package/components/common/RichText/plugins/audio/index.js +34 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.js +189 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.json +3 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxml +17 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxss +127 -0
- package/components/common/RichText/plugins/audio/miniprogram/build.js +3 -0
- package/components/common/RichText/plugins/audio/uni-app/audio.vue +269 -0
- package/components/common/RichText/plugins/audio/uni-app/build.js +3 -0
- package/components/common/RichText/plugins/card/README.md +30 -0
- package/components/common/RichText/plugins/card/build.js +14 -0
- package/components/common/RichText/plugins/card/index.js +7 -0
- package/components/common/RichText/plugins/card/miniprogram/build.js +3 -0
- package/components/common/RichText/plugins/card/miniprogram/card.js +26 -0
- package/components/common/RichText/plugins/card/miniprogram/card.json +3 -0
- package/components/common/RichText/plugins/card/miniprogram/card.wxml +9 -0
- package/components/common/RichText/plugins/card/miniprogram/card.wxss +55 -0
- package/components/common/RichText/plugins/card/uni-app/build.js +3 -0
- package/components/common/RichText/plugins/card/uni-app/card.vue +122 -0
- package/components/common/RichText/plugins/editable/README.md +137 -0
- package/components/common/RichText/plugins/editable/config.js +15 -0
- package/components/common/RichText/plugins/editable/miniprogram/build.js +813 -0
- package/components/common/RichText/plugins/editable/miniprogram/index.js +551 -0
- package/components/common/RichText/plugins/editable/uni-app/build.js +744 -0
- package/components/common/RichText/plugins/editable/uni-app/index.js +553 -0
- package/components/common/RichText/plugins/emoji/README.md +15 -0
- package/components/common/RichText/plugins/emoji/index.js +203 -0
- package/components/common/RichText/plugins/highlight/README.md +26 -0
- package/components/common/RichText/plugins/highlight/config.js +5 -0
- package/components/common/RichText/plugins/highlight/index.js +96 -0
- package/components/common/RichText/plugins/highlight/miniprogram/build.js +88 -0
- package/components/common/RichText/plugins/highlight/prism.css +125 -0
- package/components/common/RichText/plugins/highlight/prism.min.js +7 -0
- package/components/common/RichText/plugins/highlight/uni-app/build.js +88 -0
- package/components/common/RichText/plugins/img-cache/README.md +24 -0
- package/components/common/RichText/plugins/img-cache/build.js +16 -0
- package/components/common/RichText/plugins/img-cache/index.js +138 -0
- package/components/common/RichText/plugins/latex/README.md +16 -0
- package/components/common/RichText/plugins/latex/build.js +14 -0
- package/components/common/RichText/plugins/latex/index.js +77 -0
- package/components/common/RichText/plugins/latex/katex.css +1070 -0
- package/components/common/RichText/plugins/latex/katex.min.js +1 -0
- package/components/common/RichText/plugins/markdown/README.md +17 -0
- package/components/common/RichText/plugins/markdown/index.js +34 -0
- package/components/common/RichText/plugins/markdown/marked.min.js +6 -0
- package/components/common/RichText/plugins/markdown/miniprogram/build.js +70 -0
- package/components/common/RichText/plugins/markdown/uni-app/build.js +68 -0
- package/components/common/RichText/plugins/search/README.md +46 -0
- package/components/common/RichText/plugins/search/miniprogram/index.js +137 -0
- package/components/common/RichText/plugins/search/uni-app/index.js +132 -0
- package/components/common/RichText/plugins/style/README.md +30 -0
- package/components/common/RichText/plugins/style/index.js +129 -0
- package/components/common/RichText/plugins/style/parser.js +175 -0
- package/components/common/RichText/plugins/template/README.md +2 -0
- package/components/common/RichText/plugins/template/build.js +65 -0
- package/components/common/RichText/plugins/template/index.js +67 -0
- package/components/common/RichText/plugins/txv-video/README.md +18 -0
- package/components/common/RichText/plugins/txv-video/build.js +3 -0
- package/components/common/RichText/plugins/txv-video/index.js +46 -0
- package/components/common/RichText/plugins/txv-video/miniprogram/build.js +6 -0
- package/components/common/RichText/plugins/txv-video/uni-app/build.js +3 -0
- package/components/common/RichText/src/miniprogram/index.js +396 -0
- package/components/common/RichText/src/miniprogram/index.json +6 -0
- package/components/common/RichText/src/miniprogram/index.wxml +7 -0
- package/components/common/RichText/src/miniprogram/index.wxss +13 -0
- package/components/common/RichText/src/miniprogram/node/node.js +247 -0
- package/components/common/RichText/src/miniprogram/node/node.json +6 -0
- package/components/common/RichText/src/miniprogram/node/node.wxml +112 -0
- package/components/common/RichText/src/miniprogram/node/node.wxss +164 -0
- package/components/common/RichText/src/miniprogram/parser.js +1269 -0
- package/components/common/RichText/src/uni-app/components/mp-html/mp-html.vue +498 -0
- package/components/common/RichText/src/uni-app/components/mp-html/node/node.vue +585 -0
- package/components/common/RichText/src/uni-app/components/mp-html/parser.js +1393 -0
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/handler.js +254 -0
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +1 -0
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/local.html +33 -0
- package/components/common/RichText/tools/config.js +82 -0
- package/components/common/RichText/tools/converter.js +205 -0
- package/components/common/RichText/tools/ifdef.js +115 -0
- package/components/common/RichText/tools/minifier.js +40 -0
- package/components/common/RichText/tools/plugin.js +248 -0
- package/components/common/Toast/index-web.ts +122 -0
- package/components/common/Toast/index-web.vue +178 -0
- package/components/common/Toast/type.ts +8 -0
- package/components/common/common.scss +59 -0
- package/components/customer-icon.vue +56 -0
- package/components/message-branch.vue +120 -0
- package/components/message-customer-service.vue +114 -0
- package/components/message-form/form-branch.vue +68 -0
- package/components/message-form/form-input.vue +242 -0
- package/components/message-form/index.vue +80 -0
- package/components/message-multi-branch/branch-pc.vue +79 -0
- package/components/message-multi-branch/index.vue +60 -0
- package/components/message-multi-form/component-mobile/form-popup.vue +37 -0
- package/components/message-multi-form/component-mobile/input-mobile.vue +102 -0
- package/components/message-multi-form/component-mobile/label-mobile.vue +32 -0
- package/components/message-multi-form/component-mobile/radios-mobile.vue +161 -0
- package/components/message-multi-form/component-pc/input-pc.vue +93 -0
- package/components/message-multi-form/component-pc/label-pc.vue +33 -0
- package/components/message-multi-form/component-pc/radio-pc.vue +98 -0
- package/components/message-multi-form/form-mobile.vue +385 -0
- package/components/message-multi-form/form-pc.vue +184 -0
- package/components/message-multi-form/index.vue +61 -0
- package/components/message-product-card.vue +129 -0
- package/components/message-rating/index.vue +56 -0
- package/components/message-rating/message-rating-number.vue +247 -0
- package/components/message-rating/message-rating-star.vue +237 -0
- package/components/message-rich-text.vue +155 -0
- package/components/message-robot-welcome.vue +181 -0
- package/components/message-stream.vue +109 -0
- package/constant.ts +122 -0
- package/excluded-list.txt +6 -0
- package/index.ts +30 -0
- package/index.vue +60 -0
- package/interface.ts +176 -0
- package/logger/index.ts +12 -0
- package/logger/main.ts +120 -0
- package/package.json +62 -0
- package/script/fileCopy.js +60 -0
- package/script/syncVersion.js +35 -0
- package/server.ts +128 -0
- package/styles/common.scss +116 -0
- package/tsconfig.json +34 -0
- package/typings.d.ts +20 -0
- package/utils/chatStorage.ts +70 -0
- package/utils/copy-web.ts +141 -0
- package/utils/enableSampleTaskStatus.ts +8 -0
- package/utils/env.ts +15 -0
- package/utils/index.ts +59 -0
- package/utils/utils.ts +162 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Image from '@tiptap/extension-image';
|
|
2
|
+
|
|
3
|
+
export default Image.extend({
|
|
4
|
+
name: 'custom-image',
|
|
5
|
+
|
|
6
|
+
addAttributes() {
|
|
7
|
+
return {
|
|
8
|
+
...(Image.config as any).addAttributes(),
|
|
9
|
+
class: {
|
|
10
|
+
default: 'image',
|
|
11
|
+
rendered: false,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
addCommands() {
|
|
17
|
+
return {
|
|
18
|
+
setImage: options => ({ tr, commands }) => {
|
|
19
|
+
if ((tr.selection as any)?.node?.type?.name == 'custom-image') {
|
|
20
|
+
return commands.updateAttributes('custom-image', options);
|
|
21
|
+
} else {
|
|
22
|
+
return commands.insertContent({
|
|
23
|
+
type: this.name,
|
|
24
|
+
attrs: options,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
32
|
+
HTMLAttributes.class = (node.attrs.class?.includes('custom-image-') ? '' : 'custom-image-') + node.attrs.class;
|
|
33
|
+
return [
|
|
34
|
+
'img',
|
|
35
|
+
HTMLAttributes,
|
|
36
|
+
];
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="Boolean(quoteMessage) && props.displayType !== 'audio'"
|
|
4
|
+
:class="{
|
|
5
|
+
'input-quote-container': true,
|
|
6
|
+
// 'input-quote-container-uni': isUniFrameWork,
|
|
7
|
+
'input-quote-container-h5': isH5 || isUniFrameWork,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<div :class="(!isPC) ? 'input-quote-content-h5' :'input-quote-content'">
|
|
11
|
+
<div>
|
|
12
|
+
<div v-if="isUniFrameWork" class="input-quote-sender-h5">
|
|
13
|
+
{{ quoteMessage.nick || quoteMessage.from }}
|
|
14
|
+
</div>
|
|
15
|
+
<div class="max-one-line">
|
|
16
|
+
{{ isUniFrameWork? quoteContentText : (quoteMessage.nick || quoteMessage.from)+ ': ' + quoteContentText }}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<Icon
|
|
20
|
+
class="input-quote-close-icon"
|
|
21
|
+
:file="closeIcon"
|
|
22
|
+
width="11px"
|
|
23
|
+
height="11px"
|
|
24
|
+
@onClick="cancelQuote"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import vue from '../../../../adapter-vue';
|
|
34
|
+
import TUIChatEngine, {
|
|
35
|
+
TUIStore,
|
|
36
|
+
StoreName,
|
|
37
|
+
TUITranslateService,
|
|
38
|
+
IMessageModel,
|
|
39
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
40
|
+
import Icon from '../../../common/Icon.vue';
|
|
41
|
+
import closeIcon from '../../../../assets/close-quote-icon.svg';
|
|
42
|
+
import { isPC,isH5, isUniFrameWork } from '../../../../utils/env';
|
|
43
|
+
import { transformTextWithKeysToEmojiNames } from '../../emoji-config';
|
|
44
|
+
import { InputDisplayType } from '../../../../interface';
|
|
45
|
+
const { ref, computed, onMounted, onUnmounted } = vue;
|
|
46
|
+
|
|
47
|
+
interface IProps {
|
|
48
|
+
displayType?: InputDisplayType;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
52
|
+
displayType: 'editor',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const TYPES = TUIChatEngine.TYPES;
|
|
56
|
+
const quoteMessage = ref<IMessageModel>();
|
|
57
|
+
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
TUIStore.watch(StoreName.CHAT, {
|
|
60
|
+
quoteMessage: onQuoteMessageUpdated,
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
onUnmounted(() => {
|
|
65
|
+
TUIStore.unwatch(StoreName.CHAT, {
|
|
66
|
+
quoteMessage: onQuoteMessageUpdated,
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const quoteContentText = computed(() => {
|
|
71
|
+
let _quoteContentText;
|
|
72
|
+
switch (quoteMessage.value?.type) {
|
|
73
|
+
case TYPES.MSG_TEXT:
|
|
74
|
+
_quoteContentText = transformTextWithKeysToEmojiNames(
|
|
75
|
+
quoteMessage.value.payload?.text,
|
|
76
|
+
);
|
|
77
|
+
break;
|
|
78
|
+
case TYPES.MSG_IMAGE:
|
|
79
|
+
_quoteContentText = TUITranslateService.t('TUIChat.图片');
|
|
80
|
+
break;
|
|
81
|
+
case TYPES.MSG_AUDIO:
|
|
82
|
+
_quoteContentText = TUITranslateService.t('TUIChat.语音');
|
|
83
|
+
break;
|
|
84
|
+
case TYPES.MSG_VIDEO:
|
|
85
|
+
_quoteContentText = TUITranslateService.t('TUIChat.视频');
|
|
86
|
+
break;
|
|
87
|
+
case TYPES.MSG_FILE:
|
|
88
|
+
_quoteContentText = TUITranslateService.t('TUIChat.文件');
|
|
89
|
+
break;
|
|
90
|
+
case TYPES.MSG_CUSTOM:
|
|
91
|
+
_quoteContentText = TUITranslateService.t('TUIChat.自定义');
|
|
92
|
+
break;
|
|
93
|
+
case TYPES.MSG_FACE:
|
|
94
|
+
_quoteContentText = TUITranslateService.t('TUIChat.表情');
|
|
95
|
+
break;
|
|
96
|
+
case TYPES.MSG_MERGER:
|
|
97
|
+
_quoteContentText = TUITranslateService.t('TUIChat.聊天记录');
|
|
98
|
+
break;
|
|
99
|
+
default:
|
|
100
|
+
_quoteContentText = TUITranslateService.t('TUIChat.消息');
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
return _quoteContentText;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
function cancelQuote() {
|
|
107
|
+
TUIStore.update(StoreName.CHAT, 'quoteMessage', {
|
|
108
|
+
message: undefined,
|
|
109
|
+
type: 'quote',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function onQuoteMessageUpdated(options?: {
|
|
114
|
+
message: IMessageModel;
|
|
115
|
+
type: string;
|
|
116
|
+
}) {
|
|
117
|
+
if (options?.message && options?.type === 'quote') {
|
|
118
|
+
quoteMessage.value = options.message;
|
|
119
|
+
} else {
|
|
120
|
+
quoteMessage.value = undefined;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style lang="scss" scoped>
|
|
126
|
+
%common-container-style {
|
|
127
|
+
margin: 5px 100px 5px 8px;
|
|
128
|
+
display: flex;
|
|
129
|
+
flex: 0 1 auto;
|
|
130
|
+
|
|
131
|
+
.input-quote-content {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex: 0 1 auto;
|
|
134
|
+
background-color: #fafafa;
|
|
135
|
+
border-radius: 8px;
|
|
136
|
+
padding: 12px;
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
align-items: center;
|
|
139
|
+
line-height: 16px;
|
|
140
|
+
max-width: 100%;
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
min-width: 0;
|
|
143
|
+
|
|
144
|
+
.max-one-line {
|
|
145
|
+
flex: 0 1 auto;
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
font-family: PingFangSC-Regular;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
.input-quote-content-h5 {
|
|
153
|
+
display: flex;
|
|
154
|
+
justify-content: space-between;
|
|
155
|
+
background-color: #fafafa;
|
|
156
|
+
padding: 12px;
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
align-items: center;
|
|
159
|
+
line-height: 16px;
|
|
160
|
+
max-width: 100%;
|
|
161
|
+
box-sizing: border-box;
|
|
162
|
+
width:100%;
|
|
163
|
+
|
|
164
|
+
.max-one-line {
|
|
165
|
+
flex: 0 1 auto;
|
|
166
|
+
overflow: hidden;
|
|
167
|
+
text-overflow: ellipsis;
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
font-family: PingFangSC-Regular;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.input-quote-sender-h5 {
|
|
173
|
+
font-size: 10px;
|
|
174
|
+
color:#00000080;
|
|
175
|
+
font-family: PingFangSC-Regular;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.input-quote-close-icon {
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.input-quote-container {
|
|
185
|
+
@extend %common-container-style;
|
|
186
|
+
|
|
187
|
+
max-width: 500px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.input-quote-container-uni {
|
|
191
|
+
@extend %common-container-style;
|
|
192
|
+
|
|
193
|
+
width: fit-content;
|
|
194
|
+
max-width: 250px;
|
|
195
|
+
margin: 5px 60px 0 30px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.input-quote-container-h5 {
|
|
199
|
+
@extend %common-container-style;
|
|
200
|
+
width:100%;
|
|
201
|
+
// max-width: 250px;
|
|
202
|
+
margin: 5px 0 5px 0;
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<div class="emojiDialog">
|
|
4
|
+
<ul ref="emojiPickerListRef" class="emojiDialogList">
|
|
5
|
+
<li
|
|
6
|
+
v-for="(childrenItem, childrenIndex) in currentEmojiList"
|
|
7
|
+
:key="childrenIndex"
|
|
8
|
+
class="emojiDialogList-item"
|
|
9
|
+
@click="select(childrenItem, childrenIndex)"
|
|
10
|
+
>
|
|
11
|
+
<img
|
|
12
|
+
v-if="currentTabItem.type === EMOJI_TYPE.BASIC"
|
|
13
|
+
class="emoji"
|
|
14
|
+
:src="currentTabItem.url + BASIC_EMOJI_URL_MAPPING[childrenItem]"
|
|
15
|
+
>
|
|
16
|
+
</li>
|
|
17
|
+
</ul>
|
|
18
|
+
<div class="sendButtonContainer">
|
|
19
|
+
<div class="sendButton" @click="sendMessage">
|
|
20
|
+
发送
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
</template>
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import vue from '../../../../adapter-vue';
|
|
28
|
+
import { IEmojiGroupList, IEmojiGroup } from '../../../../interface';
|
|
29
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
30
|
+
import {
|
|
31
|
+
TUIChatService,
|
|
32
|
+
TUIStore,
|
|
33
|
+
StoreName,
|
|
34
|
+
IConversationModel,
|
|
35
|
+
SendMessageParams,
|
|
36
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
37
|
+
import {
|
|
38
|
+
EMOJI_GROUP_LIST,
|
|
39
|
+
BASIC_EMOJI_URL_MAPPING,
|
|
40
|
+
convertKeyToEmojiName,
|
|
41
|
+
} from '../../emoji-config';
|
|
42
|
+
import { EMOJI_TYPE } from '.././../../../constant';
|
|
43
|
+
import { isPC, isUniFrameWork,isH5 } from '../../../../utils/env';
|
|
44
|
+
|
|
45
|
+
const emits = defineEmits(['insertEmoji', 'onClose', 'sendMessage']);
|
|
46
|
+
const list = ref<IEmojiGroupList>(initEmojiList());
|
|
47
|
+
const currentConversation = ref();
|
|
48
|
+
const emojiPickerListRef = ref();
|
|
49
|
+
const currentTabIndex = ref<number>(0);
|
|
50
|
+
const currentEmojiList = ref<string[]>(list?.value[0]?.list);
|
|
51
|
+
const currentTabItem = ref<IEmojiGroup>(list?.value[0]);
|
|
52
|
+
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
TUIStore.watch(StoreName.CONV, {
|
|
55
|
+
currentConversation: onCurrentConversationUpdate,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
onUnmounted(() => {
|
|
60
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
61
|
+
currentConversation: onCurrentConversationUpdate,
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const select = (item: any, index: number) => {
|
|
66
|
+
const options: any = {
|
|
67
|
+
emoji: { key: item, name: convertKeyToEmojiName(item) },
|
|
68
|
+
type: currentTabItem?.value?.type,
|
|
69
|
+
};
|
|
70
|
+
switch (currentTabItem?.value?.type) {
|
|
71
|
+
case EMOJI_TYPE.BASIC:
|
|
72
|
+
options.url = currentTabItem?.value?.url + BASIC_EMOJI_URL_MAPPING[item];
|
|
73
|
+
if (isUniFrameWork) {
|
|
74
|
+
uni.$emit('insert-emoji', options);
|
|
75
|
+
} else {
|
|
76
|
+
emits('insertEmoji', options);
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
case EMOJI_TYPE.BIG:
|
|
80
|
+
// sendFaceMessage(index, currentTabItem.value);
|
|
81
|
+
break;
|
|
82
|
+
case EMOJI_TYPE.CUSTOM:
|
|
83
|
+
// sendFaceMessage(index, currentTabItem.value);
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
isPC && emits('onClose');
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
function sendMessage(){
|
|
92
|
+
emits('sendMessage');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function onCurrentConversationUpdate(conversation: IConversationModel) {
|
|
96
|
+
currentConversation.value = conversation;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function initEmojiList() {
|
|
100
|
+
return EMOJI_GROUP_LIST;
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
103
|
+
<style lang="scss" scoped>
|
|
104
|
+
.emojiDialog {
|
|
105
|
+
height: 25vh;
|
|
106
|
+
position:relative;
|
|
107
|
+
.emojiDialogList {
|
|
108
|
+
width: 100%;
|
|
109
|
+
display:flex;
|
|
110
|
+
flex-wrap: wrap;
|
|
111
|
+
overflow-y: auto;
|
|
112
|
+
margin:2px;
|
|
113
|
+
justify-content: space-between;
|
|
114
|
+
.emojiDialogList-item {
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
padding: 5px;
|
|
117
|
+
.emoji {
|
|
118
|
+
width: 30px;
|
|
119
|
+
height: 30px;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
.emojiDialogList::after{
|
|
124
|
+
content: "";
|
|
125
|
+
display: block;
|
|
126
|
+
flex: 1 1 auto;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
.sendButtonContainer {
|
|
130
|
+
display:flex;
|
|
131
|
+
justify-content: flex-end;
|
|
132
|
+
width: 100%;
|
|
133
|
+
height: 45px;
|
|
134
|
+
margin-top:5px;
|
|
135
|
+
.sendButton {
|
|
136
|
+
background-color: #1C66E5;
|
|
137
|
+
color: white;
|
|
138
|
+
border-radius: 5px;
|
|
139
|
+
margin-right: 10px;
|
|
140
|
+
align-self: center;
|
|
141
|
+
padding: 5px 10px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
</style>
|
package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="emojiPickerDialog"
|
|
4
|
+
:class="{
|
|
5
|
+
'emoji-picker': true,
|
|
6
|
+
'emoji-picker-h5': !isPC,
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<ul
|
|
10
|
+
ref="emojiPickerListRef"
|
|
11
|
+
:class="['emoji-picker-list', !isPC && 'emoji-picker-h5-list']"
|
|
12
|
+
>
|
|
13
|
+
<li
|
|
14
|
+
v-for="(childrenItem, childrenIndex) in currentEmojiList"
|
|
15
|
+
:key="childrenIndex"
|
|
16
|
+
class="emoji-picker-list-item"
|
|
17
|
+
@click="select(childrenItem, childrenIndex)"
|
|
18
|
+
>
|
|
19
|
+
<img
|
|
20
|
+
v-if="currentTabItem.type === EMOJI_TYPE.BASIC"
|
|
21
|
+
class="emoji"
|
|
22
|
+
:src="currentTabItem.url + BASIC_EMOJI_URL_MAPPING[childrenItem]"
|
|
23
|
+
>
|
|
24
|
+
<img
|
|
25
|
+
v-else-if="currentTabItem.type === EMOJI_TYPE.BIG"
|
|
26
|
+
class="emoji-big"
|
|
27
|
+
:src="currentTabItem.url + childrenItem + '@2x.png'"
|
|
28
|
+
>
|
|
29
|
+
<img
|
|
30
|
+
v-else
|
|
31
|
+
class="emoji-custom emoji-big"
|
|
32
|
+
:src="currentTabItem.url + childrenItem"
|
|
33
|
+
>
|
|
34
|
+
</li>
|
|
35
|
+
</ul>
|
|
36
|
+
<ul class="emoji-picker-tab">
|
|
37
|
+
<li
|
|
38
|
+
v-for="(item, index) in list"
|
|
39
|
+
:key="index"
|
|
40
|
+
class="emoji-picker-tab-item"
|
|
41
|
+
@click="toggleEmojiTab(index)"
|
|
42
|
+
>
|
|
43
|
+
<Icon
|
|
44
|
+
v-if="item.type === EMOJI_TYPE.BASIC"
|
|
45
|
+
class="icon"
|
|
46
|
+
:file="faceIcon"
|
|
47
|
+
/>
|
|
48
|
+
<img
|
|
49
|
+
v-else-if="item.type === EMOJI_TYPE.BIG"
|
|
50
|
+
class="icon-big"
|
|
51
|
+
:src="item.url + item.list[0] + '@2x.png'"
|
|
52
|
+
>
|
|
53
|
+
<img
|
|
54
|
+
v-else
|
|
55
|
+
class="icon-custom icon-big"
|
|
56
|
+
:src="item.url + item.list[0]"
|
|
57
|
+
>
|
|
58
|
+
</li>
|
|
59
|
+
<li
|
|
60
|
+
v-if="isUniFrameWork || isH5"
|
|
61
|
+
class="send-btn"
|
|
62
|
+
@click="sendMessage"
|
|
63
|
+
>
|
|
64
|
+
发送
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<script lang="ts" setup>
|
|
70
|
+
import vue from '../../../../adapter-vue';
|
|
71
|
+
import {
|
|
72
|
+
TUIChatService,
|
|
73
|
+
TUIStore,
|
|
74
|
+
StoreName,
|
|
75
|
+
IConversationModel,
|
|
76
|
+
SendMessageParams,
|
|
77
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
78
|
+
import Icon from '../../../common/Icon.vue';
|
|
79
|
+
import faceIcon from '../../../../assets/face.png';
|
|
80
|
+
import { EMOJI_TYPE } from '.././../../../constant';
|
|
81
|
+
import { isPC, isUniFrameWork,isH5 } from '../../../../utils/env';
|
|
82
|
+
import { IEmojiGroupList, IEmojiGroup } from '../../../../interface';
|
|
83
|
+
import { isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
84
|
+
import {
|
|
85
|
+
EMOJI_GROUP_LIST,
|
|
86
|
+
BASIC_EMOJI_URL_MAPPING,
|
|
87
|
+
convertKeyToEmojiName,
|
|
88
|
+
} from '../../emoji-config';
|
|
89
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
90
|
+
|
|
91
|
+
const emits = defineEmits(['insertEmoji', 'onClose', 'sendMessage']);
|
|
92
|
+
const currentTabIndex = ref<number>(0);
|
|
93
|
+
const currentConversation = ref();
|
|
94
|
+
const emojiPickerDialog = ref();
|
|
95
|
+
const emojiPickerListRef = ref();
|
|
96
|
+
const list = ref<IEmojiGroupList>(initEmojiList());
|
|
97
|
+
const currentTabItem = ref<IEmojiGroup>(list?.value[0]);
|
|
98
|
+
const currentEmojiList = ref<string[]>(list?.value[0]?.list);
|
|
99
|
+
|
|
100
|
+
onMounted(() => {
|
|
101
|
+
TUIStore.watch(StoreName.CONV, {
|
|
102
|
+
currentConversation: onCurrentConversationUpdate,
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
onUnmounted(() => {
|
|
107
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
108
|
+
currentConversation: onCurrentConversationUpdate,
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const toggleEmojiTab = (index: number) => {
|
|
113
|
+
currentTabIndex.value = index;
|
|
114
|
+
currentTabItem.value = list?.value[index];
|
|
115
|
+
currentEmojiList.value = list?.value[index]?.list;
|
|
116
|
+
// web & h5 side scroll to top
|
|
117
|
+
if (!isUniFrameWork) {
|
|
118
|
+
emojiPickerListRef?.value && (emojiPickerListRef.value.scrollTop = 0);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const select = (item: any, index: number) => {
|
|
123
|
+
const options: any = {
|
|
124
|
+
emoji: { key: item, name: convertKeyToEmojiName(item) },
|
|
125
|
+
type: currentTabItem?.value?.type,
|
|
126
|
+
};
|
|
127
|
+
switch (currentTabItem?.value?.type) {
|
|
128
|
+
case EMOJI_TYPE.BASIC:
|
|
129
|
+
options.url = currentTabItem?.value?.url + BASIC_EMOJI_URL_MAPPING[item];
|
|
130
|
+
if (isUniFrameWork) {
|
|
131
|
+
uni.$emit('insert-emoji', options);
|
|
132
|
+
} else {
|
|
133
|
+
emits('insertEmoji', options);
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
case EMOJI_TYPE.BIG:
|
|
137
|
+
sendFaceMessage(index, currentTabItem.value);
|
|
138
|
+
break;
|
|
139
|
+
case EMOJI_TYPE.CUSTOM:
|
|
140
|
+
sendFaceMessage(index, currentTabItem.value);
|
|
141
|
+
break;
|
|
142
|
+
default:
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
isPC && emits('onClose');
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const sendFaceMessage = (index: number, listItem: IEmojiGroup) => {
|
|
149
|
+
const options = {
|
|
150
|
+
to:
|
|
151
|
+
currentConversation?.value?.groupProfile?.groupID
|
|
152
|
+
|| currentConversation?.value?.userProfile?.userID,
|
|
153
|
+
conversationType: currentConversation?.value?.type,
|
|
154
|
+
payload: {
|
|
155
|
+
index: listItem.emojiGroupID,
|
|
156
|
+
data: listItem.list[index],
|
|
157
|
+
},
|
|
158
|
+
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
|
159
|
+
} as SendMessageParams;
|
|
160
|
+
TUIChatService.sendFaceMessage(options);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
function sendMessage() {
|
|
164
|
+
if (isUniFrameWork) {
|
|
165
|
+
uni.$emit('send-message-in-emoji-picker');
|
|
166
|
+
}else{
|
|
167
|
+
emits('sendMessage');
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function onCurrentConversationUpdate(conversation: IConversationModel) {
|
|
172
|
+
currentConversation.value = conversation;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function initEmojiList() {
|
|
176
|
+
return EMOJI_GROUP_LIST;
|
|
177
|
+
}
|
|
178
|
+
</script>
|
|
179
|
+
|
|
180
|
+
<style lang="scss" scoped src="./style/index.scss"></style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ToolbarItemContainer
|
|
3
|
+
ref="container"
|
|
4
|
+
:iconFile="faceIcon"
|
|
5
|
+
title="表情"
|
|
6
|
+
@onDialogShow="onDialogShow"
|
|
7
|
+
@onDialogClose="onDialogClose"
|
|
8
|
+
:isH5EmojiShow="props.isH5EmojiShow"
|
|
9
|
+
:isH5Emoji="isH5"
|
|
10
|
+
>
|
|
11
|
+
<EmojiPickerDialog
|
|
12
|
+
@insertEmoji="insertEmoji"
|
|
13
|
+
@sendMessage="sendMessage"
|
|
14
|
+
@onClose="onClose"
|
|
15
|
+
/>
|
|
16
|
+
</ToolbarItemContainer>
|
|
17
|
+
</template>
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import {
|
|
20
|
+
TUIStore,
|
|
21
|
+
StoreName,
|
|
22
|
+
IConversationModel,
|
|
23
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
24
|
+
import vue from '../../../../adapter-vue';
|
|
25
|
+
import faceIcon from '../../../../assets/face.png';
|
|
26
|
+
import EmojiPickerDialog from './emoji-picker-dialog.vue';
|
|
27
|
+
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
28
|
+
import { isH5 } from '../../../../utils/env';
|
|
29
|
+
import { ToolbarDisplayType } from '../../../../interface';
|
|
30
|
+
const { ref } = vue;
|
|
31
|
+
|
|
32
|
+
interface IProps {
|
|
33
|
+
isH5EmojiShow:boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface IEmits {
|
|
37
|
+
(e: 'sendMessage'): void;
|
|
38
|
+
(e: 'toggleComponent'): void;
|
|
39
|
+
(e: 'insertEmoji', emoji: any): void;
|
|
40
|
+
(e: 'dialogShowInH5', dialogRef: HTMLElement): void;
|
|
41
|
+
(e: 'dialogCloseInH5', dialogRef: HTMLElement): void;
|
|
42
|
+
(e: 'changeToolbarDisplayType', type: ToolbarDisplayType): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const emits = defineEmits<IEmits>();
|
|
46
|
+
const currentConversation = ref();
|
|
47
|
+
const container = ref<InstanceType<typeof ToolbarItemContainer>>();
|
|
48
|
+
|
|
49
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
50
|
+
isH5EmojiShow: false,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
TUIStore.watch(StoreName.CONV, {
|
|
55
|
+
currentConversation: (conversation: IConversationModel) => {
|
|
56
|
+
currentConversation.value = conversation;
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const onDialogShow = (dialogRef: any) => {
|
|
61
|
+
if (!isH5) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
emits('changeToolbarDisplayType', 'emojiPicker');
|
|
65
|
+
emits('dialogShowInH5', dialogRef.value);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const onDialogClose = (dialogRef: any) => {
|
|
69
|
+
if (!isH5) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
emits('changeToolbarDisplayType', 'none');
|
|
73
|
+
emits('dialogCloseInH5', dialogRef.value);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const insertEmoji = (emojiObj) => {
|
|
77
|
+
emits('insertEmoji', emojiObj);
|
|
78
|
+
};
|
|
79
|
+
const sendMessage = () => {
|
|
80
|
+
emits('sendMessage');
|
|
81
|
+
};
|
|
82
|
+
const onClose = () => {
|
|
83
|
+
container.value?.toggleDialogDisplay(false);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
defineExpose({
|
|
87
|
+
closeEmojiPicker: onClose,
|
|
88
|
+
});
|
|
89
|
+
</script>
|
|
90
|
+
<style lang="scss" scoped src="./style/index.scss"></style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.emoji-picker-h5 {
|
|
2
|
+
width: 100%;
|
|
3
|
+
|
|
4
|
+
&-list {
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&-list::after {
|
|
9
|
+
content: "";
|
|
10
|
+
display: block;
|
|
11
|
+
flex: 1 1 auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.send-btn {
|
|
15
|
+
width: 50px;
|
|
16
|
+
height: 30px;
|
|
17
|
+
background-color: #1c66e5;
|
|
18
|
+
border-radius: 5px;
|
|
19
|
+
position: absolute;
|
|
20
|
+
right: 10px;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
color: #fff;
|
|
23
|
+
text-align: center;
|
|
24
|
+
line-height: 30px;
|
|
25
|
+
}
|
|
26
|
+
}
|