@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,141 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['chat-header', !isPC && 'chat-header-h5']">
|
|
3
|
+
<div
|
|
4
|
+
v-if="!isPC && props.canCloseChat"
|
|
5
|
+
:class="['chat-header-back', !isPC && 'chat-header-h5-back']"
|
|
6
|
+
@click="closeChat(currentConversation.conversationID)"
|
|
7
|
+
>
|
|
8
|
+
<Icon :file="backSVG" />
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
<div class="chat-header-container">
|
|
12
|
+
<Icon v-if="!isPC" style="width:32px;" :file="customerAvatarMobile" />
|
|
13
|
+
<div :class="['chat-header-content', !isPC && 'chat-header-h5-content']">
|
|
14
|
+
{{ isPC? currentConversationName :'Hi,我是'+ currentConversationName }}
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import vue from '../../../adapter-vue';
|
|
21
|
+
import {
|
|
22
|
+
TUIStore,
|
|
23
|
+
StoreName,
|
|
24
|
+
TUITranslateService,
|
|
25
|
+
IConversationModel,
|
|
26
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
27
|
+
import Icon from '../../common/Icon.vue';
|
|
28
|
+
import backSVG from '../../../assets/back.svg';
|
|
29
|
+
import customerAvatarMobile from '../../../assets/customer_avatar_mobile.png';
|
|
30
|
+
import { isPC } from '../../../utils/env';
|
|
31
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
32
|
+
|
|
33
|
+
interface IProps {
|
|
34
|
+
canCloseChat: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const emits = defineEmits(['closeChat']);
|
|
38
|
+
const currentConversation = ref<IConversationModel>();
|
|
39
|
+
const currentConversationName = ref('');
|
|
40
|
+
const typingStatus = ref(false);
|
|
41
|
+
|
|
42
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
43
|
+
canCloseChat: true,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
TUIStore.watch(StoreName.CONV, {
|
|
48
|
+
currentConversation: onCurrentConversationUpdated,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
TUIStore.watch(StoreName.CHAT, {
|
|
52
|
+
typingStatus: onTypingStatusUpdated,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
onUnmounted(() => {
|
|
57
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
58
|
+
currentConversation: onCurrentConversationUpdated,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
TUIStore.unwatch(StoreName.CHAT, {
|
|
62
|
+
typingStatus: onTypingStatusUpdated,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const closeChat = (conversationID: string | undefined) => {
|
|
67
|
+
emits('closeChat', conversationID);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
function onCurrentConversationUpdated(conversation: IConversationModel) {
|
|
71
|
+
currentConversation.value = conversation;
|
|
72
|
+
currentConversationName.value = currentConversation?.value?.getShowName();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function onTypingStatusUpdated(status: boolean) {
|
|
76
|
+
typingStatus.value = status;
|
|
77
|
+
if (typingStatus.value) {
|
|
78
|
+
currentConversationName.value
|
|
79
|
+
= TUITranslateService.t('TUIChat.对方正在输入');
|
|
80
|
+
} else {
|
|
81
|
+
currentConversationName.value
|
|
82
|
+
= currentConversation.value?.getShowName() || '';
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
<style lang="scss" scoped>
|
|
87
|
+
.chat-header {
|
|
88
|
+
display: flex;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
flex-direction: row;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
border-bottom:1px solid #f3f4f7;
|
|
94
|
+
|
|
95
|
+
&-container {
|
|
96
|
+
display: flex;
|
|
97
|
+
min-width: 0;
|
|
98
|
+
flex-direction: row;
|
|
99
|
+
justify-content: flex-start;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-content {
|
|
103
|
+
margin-right: 20px;
|
|
104
|
+
flex: 1;
|
|
105
|
+
font-size: 16px;
|
|
106
|
+
line-height: 30px;
|
|
107
|
+
font-family: PingFangSC-Medium;
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
color: #000;
|
|
110
|
+
letter-spacing: 0;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
text-overflow: ellipsis;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&-back,
|
|
117
|
+
&-setting {
|
|
118
|
+
width: 27px;
|
|
119
|
+
height: 27px;
|
|
120
|
+
|
|
121
|
+
.icon {
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.chat-header-h5 {
|
|
129
|
+
border:none;
|
|
130
|
+
justify-content: flex-start;
|
|
131
|
+
&-back {
|
|
132
|
+
display: flex;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
align-items: center;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&-content {
|
|
138
|
+
text-align: center;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IEmojiGroupList } from '../../../interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Custom big emoji
|
|
5
|
+
*/
|
|
6
|
+
export const CUSTOM_BIG_EMOJI_URL: string = '';
|
|
7
|
+
|
|
8
|
+
export const CUSTOM_BIG_EMOJI_GROUP_LIST: IEmojiGroupList = [];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Custom basic emoji
|
|
12
|
+
*/
|
|
13
|
+
export const CUSTOM_BASIC_EMOJI_URL: string = '';
|
|
14
|
+
|
|
15
|
+
export const CUSTOM_BASIC_EMOJI_URL_MAPPING: Record<string, string> = {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emoji input interface in the chat screen.
|
|
3
|
+
* In respect for the copyright of the emoji design, the Chat Demo/TUIKit project does not include the cutouts of large emoji elements.
|
|
4
|
+
* Please replace them with your own designed or copyrighted emoji packs before the official launch for commercial use.
|
|
5
|
+
* The default small yellow face emoji pack is copyrighted by Tencent Cloud and can be authorized for a fee.
|
|
6
|
+
* If you wish to obtain authorization, please submit a ticket to contact us.
|
|
7
|
+
*
|
|
8
|
+
* submit a ticket url:https://console.tencentcloud.com/workorder/category?level1_id=29&level2_id=40&source=14&data_title=Chat&step=1
|
|
9
|
+
*/
|
|
10
|
+
import { default as emojiCNLocales } from './locales/zh_cn';
|
|
11
|
+
import { default as emojiENLocales } from './locales/en';
|
|
12
|
+
import { EMOJI_TYPE } from '../../../constant';
|
|
13
|
+
import { IEmojiGroupList } from '../../../interface';
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_BASIC_EMOJI_URL = 'https://web.sdk.qcloud.com/im/assets/emoji-plugin/';
|
|
16
|
+
export const DEFAULT_BIG_EMOJI_URL = 'https://web.sdk.qcloud.com/im/assets/face-elem/';
|
|
17
|
+
|
|
18
|
+
export const DEFAULT_BASIC_EMOJI_URL_MAPPING: Record<string, string> = {
|
|
19
|
+
'[TUIEmoji_Expect]': 'emoji_0@2x.png',
|
|
20
|
+
'[TUIEmoji_Blink]': 'emoji_1@2x.png',
|
|
21
|
+
'[TUIEmoji_Guffaw]': 'emoji_2@2x.png',
|
|
22
|
+
'[TUIEmoji_KindSmile]': 'emoji_3@2x.png',
|
|
23
|
+
'[TUIEmoji_Haha]': 'emoji_4@2x.png',
|
|
24
|
+
'[TUIEmoji_Cheerful]': 'emoji_5@2x.png',
|
|
25
|
+
'[TUIEmoji_Smile]': 'emoji_6@2x.png',
|
|
26
|
+
'[TUIEmoji_Sorrow]': 'emoji_7@2x.png',
|
|
27
|
+
'[TUIEmoji_Speechless]': 'emoji_8@2x.png',
|
|
28
|
+
'[TUIEmoji_Amazed]': 'emoji_9@2x.png',
|
|
29
|
+
'[TUIEmoji_Complacent]': 'emoji_10@2x.png',
|
|
30
|
+
'[TUIEmoji_Lustful]': 'emoji_11@2x.png',
|
|
31
|
+
'[TUIEmoji_Stareyes]': 'emoji_12@2x.png',
|
|
32
|
+
'[TUIEmoji_Giggle]': 'emoji_13@2x.png',
|
|
33
|
+
'[TUIEmoji_Daemon]': 'emoji_14@2x.png',
|
|
34
|
+
'[TUIEmoji_Rage]': 'emoji_15@2x.png',
|
|
35
|
+
'[TUIEmoji_Yawn]': 'emoji_16@2x.png',
|
|
36
|
+
'[TUIEmoji_TearsLaugh]': 'emoji_17@2x.png',
|
|
37
|
+
'[TUIEmoji_Silly]': 'emoji_18@2x.png',
|
|
38
|
+
'[TUIEmoji_Wail]': 'emoji_19@2x.png',
|
|
39
|
+
'[TUIEmoji_Kiss]': 'emoji_20@2x.png',
|
|
40
|
+
'[TUIEmoji_Trapped]': 'emoji_21@2x.png',
|
|
41
|
+
'[TUIEmoji_Fear]': 'emoji_22@2x.png',
|
|
42
|
+
'[TUIEmoji_BareTeeth]': 'emoji_23@2x.png',
|
|
43
|
+
'[TUIEmoji_FlareUp]': 'emoji_24@2x.png',
|
|
44
|
+
'[TUIEmoji_Tact]': 'emoji_25@2x.png',
|
|
45
|
+
'[TUIEmoji_Shit]': 'emoji_26@2x.png',
|
|
46
|
+
'[TUIEmoji_ShutUp]': 'emoji_27@2x.png',
|
|
47
|
+
'[TUIEmoji_Sigh]': 'emoji_28@2x.png',
|
|
48
|
+
'[TUIEmoji_Hehe]': 'emoji_29@2x.png',
|
|
49
|
+
'[TUIEmoji_Silent]': 'emoji_30@2x.png',
|
|
50
|
+
'[TUIEmoji_Skull]': 'emoji_31@2x.png',
|
|
51
|
+
'[TUIEmoji_Mask]': 'emoji_32@2x.png',
|
|
52
|
+
'[TUIEmoji_Beer]': 'emoji_33@2x.png',
|
|
53
|
+
'[TUIEmoji_Cake]': 'emoji_34@2x.png',
|
|
54
|
+
'[TUIEmoji_RedPacket]': 'emoji_35@2x.png',
|
|
55
|
+
'[TUIEmoji_Bombs]': 'emoji_36@2x.png',
|
|
56
|
+
'[TUIEmoji_Ai]': 'emoji_37@2x.png',
|
|
57
|
+
'[TUIEmoji_Celebrate]': 'emoji_38@2x.png',
|
|
58
|
+
'[TUIEmoji_Bless]': 'emoji_39@2x.png',
|
|
59
|
+
'[TUIEmoji_Flower]': 'emoji_40@2x.png',
|
|
60
|
+
'[TUIEmoji_Watermelon]': 'emoji_41@2x.png',
|
|
61
|
+
'[TUIEmoji_Cow]': 'emoji_42@2x.png',
|
|
62
|
+
'[TUIEmoji_Fool]': 'emoji_43@2x.png',
|
|
63
|
+
'[TUIEmoji_Surprised]': 'emoji_44@2x.png',
|
|
64
|
+
'[TUIEmoji_Askance]': 'emoji_45@2x.png',
|
|
65
|
+
'[TUIEmoji_Monster]': 'emoji_46@2x.png',
|
|
66
|
+
'[TUIEmoji_Pig]': 'emoji_47@2x.png',
|
|
67
|
+
'[TUIEmoji_Coffee]': 'emoji_48@2x.png',
|
|
68
|
+
'[TUIEmoji_Ok]': 'emoji_49@2x.png',
|
|
69
|
+
'[TUIEmoji_Heart]': 'emoji_50@2x.png',
|
|
70
|
+
'[TUIEmoji_Sun]': 'emoji_51@2x.png',
|
|
71
|
+
'[TUIEmoji_Moon]': 'emoji_52@2x.png',
|
|
72
|
+
'[TUIEmoji_Star]': 'emoji_53@2x.png',
|
|
73
|
+
'[TUIEmoji_Rich]': 'emoji_54@2x.png',
|
|
74
|
+
'[TUIEmoji_Fortune]': 'emoji_55@2x.png',
|
|
75
|
+
'[TUIEmoji_857]': 'emoji_56@2x.png',
|
|
76
|
+
'[TUIEmoji_666]': 'emoji_57@2x.png',
|
|
77
|
+
'[TUIEmoji_Prohibit]': 'emoji_58@2x.png',
|
|
78
|
+
'[TUIEmoji_Convinced]': 'emoji_59@2x.png',
|
|
79
|
+
'[TUIEmoji_Knife]': 'emoji_60@2x.png',
|
|
80
|
+
'[TUIEmoji_Like]': 'emoji_61@2x.png',
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const BIG_EMOJI_GROUP_LIST: IEmojiGroupList = [
|
|
84
|
+
{
|
|
85
|
+
emojiGroupID: 1,
|
|
86
|
+
type: EMOJI_TYPE.BIG,
|
|
87
|
+
url: DEFAULT_BIG_EMOJI_URL,
|
|
88
|
+
list: ['yz00', 'yz01', 'yz02', 'yz03', 'yz04', 'yz05', 'yz06', 'yz07', 'yz08',
|
|
89
|
+
'yz09', 'yz10', 'yz11', 'yz12', 'yz13', 'yz14', 'yz15', 'yz16', 'yz17'],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
emojiGroupID: 2,
|
|
93
|
+
type: EMOJI_TYPE.BIG,
|
|
94
|
+
url: DEFAULT_BIG_EMOJI_URL,
|
|
95
|
+
list: ['ys00', 'ys01', 'ys02', 'ys03', 'ys04', 'ys05', 'ys06', 'ys07', 'ys08',
|
|
96
|
+
'ys09', 'ys10', 'ys11', 'ys12', 'ys13', 'ys14', 'ys15'],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
emojiGroupID: 3,
|
|
100
|
+
type: EMOJI_TYPE.BIG,
|
|
101
|
+
url: DEFAULT_BIG_EMOJI_URL,
|
|
102
|
+
list: ['gcs00', 'gcs01', 'gcs02', 'gcs03', 'gcs04', 'gcs05', 'gcs06', 'gcs07',
|
|
103
|
+
'gcs08', 'gcs09', 'gcs10', 'gcs11', 'gcs12', 'gcs13', 'gcs14', 'gcs15', 'gcs16'],
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
export const BASIC_EMOJI_NAME_TO_KEY_MAPPING = {
|
|
108
|
+
...Object.fromEntries(
|
|
109
|
+
Object.entries(emojiCNLocales)?.map(([key, val]) => [val, key]),
|
|
110
|
+
),
|
|
111
|
+
...Object.fromEntries(
|
|
112
|
+
Object.entries(emojiENLocales)?.map(([key, val]) => [val, key]),
|
|
113
|
+
),
|
|
114
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
|
2
|
+
import { CUSTOM_BASIC_EMOJI_URL, CUSTOM_BIG_EMOJI_URL, CUSTOM_BASIC_EMOJI_URL_MAPPING, CUSTOM_BIG_EMOJI_GROUP_LIST } from './custom-emoji';
|
|
3
|
+
import { DEFAULT_BASIC_EMOJI_URL, BIG_EMOJI_GROUP_LIST, DEFAULT_BASIC_EMOJI_URL_MAPPING, BASIC_EMOJI_NAME_TO_KEY_MAPPING, DEFAULT_BIG_EMOJI_URL } from './default-emoji';
|
|
4
|
+
import { default as emojiCNLocales } from './locales/zh_cn';
|
|
5
|
+
import { IEmojiGroupList } from '../../../interface';
|
|
6
|
+
import { EMOJI_TYPE } from '../../../constant';
|
|
7
|
+
import { isWeChat } from '../../../utils/env';
|
|
8
|
+
|
|
9
|
+
const hasCustomBasicEmoji = CUSTOM_BASIC_EMOJI_URL && Object.keys(CUSTOM_BASIC_EMOJI_URL_MAPPING).length;
|
|
10
|
+
|
|
11
|
+
const BASIC_EMOJI_URL = hasCustomBasicEmoji ? CUSTOM_BASIC_EMOJI_URL : DEFAULT_BASIC_EMOJI_URL;
|
|
12
|
+
|
|
13
|
+
const BASIC_EMOJI_URL_MAPPING = hasCustomBasicEmoji ? CUSTOM_BASIC_EMOJI_URL_MAPPING : DEFAULT_BASIC_EMOJI_URL_MAPPING;
|
|
14
|
+
|
|
15
|
+
const EMOJI_GROUP_LIST: IEmojiGroupList = [
|
|
16
|
+
{
|
|
17
|
+
emojiGroupID: 0,
|
|
18
|
+
type: EMOJI_TYPE.BASIC,
|
|
19
|
+
url: BASIC_EMOJI_URL,
|
|
20
|
+
list: Object.keys(BASIC_EMOJI_URL_MAPPING),
|
|
21
|
+
},
|
|
22
|
+
...BIG_EMOJI_GROUP_LIST,
|
|
23
|
+
...CUSTOM_BIG_EMOJI_GROUP_LIST,
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Converts a basic emoji key into its corresponding name.
|
|
28
|
+
* Example:
|
|
29
|
+
* '[Smile]' => '[TUIEmoji_Smile]'
|
|
30
|
+
* @param {string} key - The emoji key.
|
|
31
|
+
* @return {string} The corresponding emoji name.
|
|
32
|
+
*/
|
|
33
|
+
const convertKeyToEmojiName = (key: string): string => {
|
|
34
|
+
// WeChat does not support emoji translation
|
|
35
|
+
return isWeChat ? emojiCNLocales[key] : TUITranslateService.t(`Emoji.${key}`);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Transforms a text containing emoji keys into a text with Chinese or English basic emoji names
|
|
40
|
+
* Example:
|
|
41
|
+
* 'hello[TUIEmoji_Smile]!' => 'hello[Smile]!''
|
|
42
|
+
* @param {string} text - The text containing emoji keys.
|
|
43
|
+
* @return {string} The transformed text with emoji keys replaced by emoji names.
|
|
44
|
+
*/
|
|
45
|
+
const transformTextWithKeysToEmojiNames = (text: string): string => {
|
|
46
|
+
if (!text) {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
const reg = /(\[.+?\])/g;
|
|
50
|
+
let txt: string = text;
|
|
51
|
+
if (reg.test(text)) {
|
|
52
|
+
txt = text.replace(reg, match => BASIC_EMOJI_URL_MAPPING[match] ? convertKeyToEmojiName(match) : match);
|
|
53
|
+
}
|
|
54
|
+
return txt;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Transforms a text containing Chinese or English basic emoji names into a text with emoji keys.
|
|
59
|
+
* Example:
|
|
60
|
+
* 'hello[Smile]!' => 'hello[TUIEmoji_Smile]!'
|
|
61
|
+
* @param {string} text - The text containing emoji names.
|
|
62
|
+
* @return {string} The transformed text with emoji names replaced by emoji keys.
|
|
63
|
+
*/
|
|
64
|
+
const transformTextWithEmojiNamesToKeys = (text: string) => {
|
|
65
|
+
if (!text) {
|
|
66
|
+
return '';
|
|
67
|
+
}
|
|
68
|
+
const reg = /(\[.+?\])/g;
|
|
69
|
+
let txt: string = text;
|
|
70
|
+
if (reg.test(text)) {
|
|
71
|
+
txt = text.replace(reg, match => BASIC_EMOJI_NAME_TO_KEY_MAPPING[match] || match);
|
|
72
|
+
}
|
|
73
|
+
return txt;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The configuration aims to provide compatibility with versions prior to 2.2.0
|
|
78
|
+
*/
|
|
79
|
+
const emojiConfig = {
|
|
80
|
+
emojiBaseUrl: BASIC_EMOJI_URL,
|
|
81
|
+
emojiUrlMapping: BASIC_EMOJI_URL_MAPPING,
|
|
82
|
+
emojiNameMapping: {
|
|
83
|
+
...emojiCNLocales,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Transform text message to renderable array contains image and text.
|
|
89
|
+
* Example: hello[TUIEmoji_Smile], I am happy.
|
|
90
|
+
* -> [{type: 'text', content: 'hello'}, {type: 'image', content: 'https://.../smile.png'}, {type: 'text', content: ', I am happy.'}]
|
|
91
|
+
* @param text
|
|
92
|
+
* @returns Array<{ type: 'text' | 'image'; content: string; emojiKey?: string; }>
|
|
93
|
+
*/
|
|
94
|
+
const parseTextToRenderArray = (text: string): Array<{ type: 'text' | 'image'; content: string; emojiKey?: string }> => {
|
|
95
|
+
const emojiRegex = /\[([^\]]+)\]/g;
|
|
96
|
+
const result: any[] = [];
|
|
97
|
+
|
|
98
|
+
let match: RegExpExecArray | null;
|
|
99
|
+
let lastIndex = 0;
|
|
100
|
+
|
|
101
|
+
while ((match = emojiRegex.exec(text)) !== null) {
|
|
102
|
+
const startIndex = match.index;
|
|
103
|
+
const endIndex = emojiRegex.lastIndex;
|
|
104
|
+
const emojiKey = match[0];
|
|
105
|
+
|
|
106
|
+
if (startIndex > lastIndex) {
|
|
107
|
+
result.push({ type: 'text', content: text.substring(lastIndex, startIndex) });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const emojiUrl = BASIC_EMOJI_URL + BASIC_EMOJI_URL_MAPPING[emojiKey];
|
|
111
|
+
if (emojiUrl) {
|
|
112
|
+
result.push({ type: 'image', content: emojiUrl, emojiKey });
|
|
113
|
+
} else {
|
|
114
|
+
result.push({ type: 'text', content: emojiKey });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
lastIndex = endIndex;
|
|
118
|
+
emojiRegex.lastIndex = lastIndex;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (lastIndex < text.length) {
|
|
122
|
+
result.push({ type: 'text', content: text.substring(lastIndex) });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return result;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
EMOJI_GROUP_LIST,
|
|
130
|
+
CUSTOM_BIG_EMOJI_URL,
|
|
131
|
+
DEFAULT_BIG_EMOJI_URL,
|
|
132
|
+
CUSTOM_BASIC_EMOJI_URL,
|
|
133
|
+
BASIC_EMOJI_URL_MAPPING,
|
|
134
|
+
CUSTOM_BASIC_EMOJI_URL_MAPPING,
|
|
135
|
+
convertKeyToEmojiName,
|
|
136
|
+
parseTextToRenderArray,
|
|
137
|
+
transformTextWithKeysToEmojiNames,
|
|
138
|
+
transformTextWithEmojiNamesToKeys,
|
|
139
|
+
emojiConfig,
|
|
140
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const Emoji = {
|
|
2
|
+
'[TUIEmoji_Smile]': '[Smile]',
|
|
3
|
+
'[TUIEmoji_Expect]': '[Expect]',
|
|
4
|
+
'[TUIEmoji_Blink]': '[Blink]',
|
|
5
|
+
'[TUIEmoji_Guffaw]': '[Guffaw]',
|
|
6
|
+
'[TUIEmoji_KindSmile]': '[KindSmile]',
|
|
7
|
+
'[TUIEmoji_Haha]': '[Haha]',
|
|
8
|
+
'[TUIEmoji_Cheerful]': '[Cheerful]',
|
|
9
|
+
'[TUIEmoji_Speechless]': '[Speechless]',
|
|
10
|
+
'[TUIEmoji_Amazed]': '[Amazed]',
|
|
11
|
+
'[TUIEmoji_Sorrow]': '[Sorrow]',
|
|
12
|
+
'[TUIEmoji_Complacent]': '[Complacent]',
|
|
13
|
+
'[TUIEmoji_Silly]': '[Silly]',
|
|
14
|
+
'[TUIEmoji_Lustful]': '[Lustful]',
|
|
15
|
+
'[TUIEmoji_Giggle]': '[Giggle]',
|
|
16
|
+
'[TUIEmoji_Kiss]': '[Kiss]',
|
|
17
|
+
'[TUIEmoji_Wail]': '[Wail]',
|
|
18
|
+
'[TUIEmoji_TearsLaugh]': '[TearsLaugh]',
|
|
19
|
+
'[TUIEmoji_Trapped]': '[Trapped]',
|
|
20
|
+
'[TUIEmoji_Mask]': '[Mask]',
|
|
21
|
+
'[TUIEmoji_Fear]': '[Fear]',
|
|
22
|
+
'[TUIEmoji_BareTeeth]': '[BareTeeth]',
|
|
23
|
+
'[TUIEmoji_FlareUp]': '[FlareUp]',
|
|
24
|
+
'[TUIEmoji_Yawn]': '[Yawn]',
|
|
25
|
+
'[TUIEmoji_Tact]': '[Tact]',
|
|
26
|
+
'[TUIEmoji_Stareyes]': '[StarEyes]',
|
|
27
|
+
'[TUIEmoji_ShutUp]': '[ShutUp]',
|
|
28
|
+
'[TUIEmoji_Sigh]': '[Sigh]',
|
|
29
|
+
'[TUIEmoji_Hehe]': '[Hehe]',
|
|
30
|
+
'[TUIEmoji_Silent]': '[Silent]',
|
|
31
|
+
'[TUIEmoji_Surprised]': '[Surprised]',
|
|
32
|
+
'[TUIEmoji_Askance]': '[Askance]]',
|
|
33
|
+
'[TUIEmoji_Ok]': '[OK]',
|
|
34
|
+
'[TUIEmoji_Shit]': '[Shit]',
|
|
35
|
+
'[TUIEmoji_Monster]': '[Monster]',
|
|
36
|
+
'[TUIEmoji_Daemon]': '[Daemon]',
|
|
37
|
+
'[TUIEmoji_Rage]': '[Rage]',
|
|
38
|
+
'[TUIEmoji_Fool]': '[Fool]',
|
|
39
|
+
'[TUIEmoji_Pig]': '[Pig]',
|
|
40
|
+
'[TUIEmoji_Cow]': '[Cow]',
|
|
41
|
+
'[TUIEmoji_Ai]': '[AI]',
|
|
42
|
+
'[TUIEmoji_Skull]': '[Skull]',
|
|
43
|
+
'[TUIEmoji_Bombs]': '[Bombs]',
|
|
44
|
+
'[TUIEmoji_Coffee]': '[Coffee]',
|
|
45
|
+
'[TUIEmoji_Cake]': '[Cake]',
|
|
46
|
+
'[TUIEmoji_Beer]': '[Beer]',
|
|
47
|
+
'[TUIEmoji_Flower]': '[Flower]',
|
|
48
|
+
'[TUIEmoji_Watermelon]': '[Watermelon]',
|
|
49
|
+
'[TUIEmoji_Rich]': '[Rich]',
|
|
50
|
+
'[TUIEmoji_Heart]': '[Heart]',
|
|
51
|
+
'[TUIEmoji_Moon]': '[Moon]',
|
|
52
|
+
'[TUIEmoji_Sun]': '[Sun]',
|
|
53
|
+
'[TUIEmoji_Star]': '[Star]',
|
|
54
|
+
'[TUIEmoji_RedPacket]': '[RedPacket]',
|
|
55
|
+
'[TUIEmoji_Celebrate]': '[Celebrate]',
|
|
56
|
+
'[TUIEmoji_Bless]': '[Bless]',
|
|
57
|
+
'[TUIEmoji_Fortune]': '[Fortune]',
|
|
58
|
+
'[TUIEmoji_Convinced]': '[Convinced]',
|
|
59
|
+
'[TUIEmoji_Prohibit]': '[Prohibit]',
|
|
60
|
+
'[TUIEmoji_666]': '[666]',
|
|
61
|
+
'[TUIEmoji_857]': '[857]',
|
|
62
|
+
'[TUIEmoji_Knife]': '[Knife]',
|
|
63
|
+
'[TUIEmoji_Like]': '[Like]',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default Emoji;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const Emoji: Record<string, string> = {
|
|
2
|
+
'[TUIEmoji_Smile]': '[微笑]',
|
|
3
|
+
'[TUIEmoji_Expect]': '[期待]',
|
|
4
|
+
'[TUIEmoji_Blink]': '[眨眼]',
|
|
5
|
+
'[TUIEmoji_Guffaw]': '[大笑]',
|
|
6
|
+
'[TUIEmoji_KindSmile]': '[姨母笑]',
|
|
7
|
+
'[TUIEmoji_Haha]': '[哈哈哈]',
|
|
8
|
+
'[TUIEmoji_Cheerful]': '[愉快]',
|
|
9
|
+
'[TUIEmoji_Speechless]': '[无语]',
|
|
10
|
+
'[TUIEmoji_Amazed]': '[惊讶]',
|
|
11
|
+
'[TUIEmoji_Sorrow]': '[悲伤]',
|
|
12
|
+
'[TUIEmoji_Complacent]': '[得意]',
|
|
13
|
+
'[TUIEmoji_Silly]': '[傻了]',
|
|
14
|
+
'[TUIEmoji_Lustful]': '[色]',
|
|
15
|
+
'[TUIEmoji_Giggle]': '[憨笑]',
|
|
16
|
+
'[TUIEmoji_Kiss]': '[亲亲]',
|
|
17
|
+
'[TUIEmoji_Wail]': '[大哭]',
|
|
18
|
+
'[TUIEmoji_TearsLaugh]': '[哭笑]',
|
|
19
|
+
'[TUIEmoji_Trapped]': '[困]',
|
|
20
|
+
'[TUIEmoji_Mask]': '[口罩]',
|
|
21
|
+
'[TUIEmoji_Fear]': '[恐惧]',
|
|
22
|
+
'[TUIEmoji_BareTeeth]': '[龇牙]',
|
|
23
|
+
'[TUIEmoji_FlareUp]': '[发怒]',
|
|
24
|
+
'[TUIEmoji_Yawn]': '[打哈欠]',
|
|
25
|
+
'[TUIEmoji_Tact]': '[机智]',
|
|
26
|
+
'[TUIEmoji_Stareyes]': '[星星眼]',
|
|
27
|
+
'[TUIEmoji_ShutUp]': '[闭嘴]',
|
|
28
|
+
'[TUIEmoji_Sigh]': '[叹气]',
|
|
29
|
+
'[TUIEmoji_Hehe]': '[呵呵]',
|
|
30
|
+
'[TUIEmoji_Silent]': '[收声]',
|
|
31
|
+
'[TUIEmoji_Surprised]': '[惊喜]',
|
|
32
|
+
'[TUIEmoji_Askance]': '[白眼]',
|
|
33
|
+
'[TUIEmoji_Ok]': '[OK]',
|
|
34
|
+
'[TUIEmoji_Shit]': '[便便]',
|
|
35
|
+
'[TUIEmoji_Monster]': '[怪兽]',
|
|
36
|
+
'[TUIEmoji_Daemon]': '[恶魔]',
|
|
37
|
+
'[TUIEmoji_Rage]': '[恶魔怒]',
|
|
38
|
+
'[TUIEmoji_Fool]': '[衰]',
|
|
39
|
+
'[TUIEmoji_Pig]': '[猪]',
|
|
40
|
+
'[TUIEmoji_Cow]': '[牛]',
|
|
41
|
+
'[TUIEmoji_Ai]': '[AI]',
|
|
42
|
+
'[TUIEmoji_Skull]': '[骷髅]',
|
|
43
|
+
'[TUIEmoji_Bombs]': '[炸弹]',
|
|
44
|
+
'[TUIEmoji_Coffee]': '[咖啡]',
|
|
45
|
+
'[TUIEmoji_Cake]': '[蛋糕]',
|
|
46
|
+
'[TUIEmoji_Beer]': '[啤酒]',
|
|
47
|
+
'[TUIEmoji_Flower]': '[花]',
|
|
48
|
+
'[TUIEmoji_Watermelon]': '[瓜]',
|
|
49
|
+
'[TUIEmoji_Rich]': '[壕]',
|
|
50
|
+
'[TUIEmoji_Heart]': '[爱心]',
|
|
51
|
+
'[TUIEmoji_Moon]': '[月亮]',
|
|
52
|
+
'[TUIEmoji_Sun]': '[太阳]',
|
|
53
|
+
'[TUIEmoji_Star]': '[星星]',
|
|
54
|
+
'[TUIEmoji_RedPacket]': '[红包]',
|
|
55
|
+
'[TUIEmoji_Celebrate]': '[庆祝]',
|
|
56
|
+
'[TUIEmoji_Bless]': '[福]',
|
|
57
|
+
'[TUIEmoji_Fortune]': '[发]',
|
|
58
|
+
'[TUIEmoji_Convinced]': '[服]',
|
|
59
|
+
'[TUIEmoji_Prohibit]': '[禁]',
|
|
60
|
+
'[TUIEmoji_666]': '[666]',
|
|
61
|
+
'[TUIEmoji_857]': '[857]',
|
|
62
|
+
'[TUIEmoji_Knife]': '[刀]',
|
|
63
|
+
'[TUIEmoji_Like]': '[赞]',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default Emoji;
|