2 lines
3.2 KiB
JavaScript
2 lines
3.2 KiB
JavaScript
"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const n=require("../../../../common/assets.js"),o=require("../../../utils/env.js"),t=require("../utils/sendMessage.js"),u=require("../config.js");Math||(i+l+a+s+r)();const l=()=>"./message-input-editor.js",a=()=>"./message-input-at/index.js",i=()=>"./message-input-audio.js",r=()=>"./message-input-quote/index.js",s=()=>"../../common/Icon.js",p=e.defineComponent({__name:"index",props:{placeholder:{default:"this is placeholder"},isMuted:{type:Boolean,default:!0},muteText:{default:""},enableInput:{type:Boolean,default:!0},enableAt:{type:Boolean,default:!0},enableTyping:{type:Boolean,default:!0},replyOrReference:{default:()=>({})},inputToolbarDisplayType:{default:"none"}},emits:["changeToolbarDisplayType"],setup(l,{expose:a,emit:i}){const r=i,s=l,p=e.ref(),d=e.ref(),f=e.ref(),c=e.ref(!1),v=e.ref("editor"),m=u.ChatConfig.getFeatureConfig(),g=e.ref(m.InputVoice),y=e.ref(m.InputEmoji||m.InputStickers),b=e.ref(m.InputImage||m.InputVideo||m.InputEvaluation||m.InputQuickReplies);function T(e){v.value=e,"audio"===e&&r("changeToolbarDisplayType","none")}function h(e){r("changeToolbarDisplayType",e)}e.onMounted((()=>{e.Jt.watch(e.o.CONV,{currentConversation:q}),e.Jt.watch(e.o.CHAT,{quoteMessage:E})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.CONV,{currentConversation:q}),e.Jt.unwatch(e.o.CHAT,{quoteMessage:E})})),e.watch((()=>s.inputToolbarDisplayType),(e=>{"none"!==e&&T("editor")}));const j=(e,n)=>{t.sendTyping(e,n)},A=e=>{var n;null==(n=null==d?void 0:d.value)||n.toggleAtList(e)},C=()=>{o.isH5&&r("changeToolbarDisplayType","none")},I=e=>{var n,o;(null==(n=null==p?void 0:p.value)?void 0:n.insertAt)&&(null==(o=null==p?void 0:p.value)||o.insertAt(e))},x=()=>{var e,n;(null==(e=null==p?void 0:p.value)?void 0:e.blur)&&(null==(n=null==p?void 0:p.value)||n.blur())};function q(n){var o;f.value=n,c.value=(null==(o=f.value)?void 0:o.type)===e.qt.TYPES.CONV_GROUP}function E(e){(null==e?void 0:e.message)&&"quote"===(null==e?void 0:e.type)&&T("editor")}return a({insertEmoji:e=>{var n,o;(null==(n=null==p?void 0:p.value)?void 0:n.addEmoji)&&(null==(o=null==p?void 0:p.value)||o.addEmoji(e))},reEdit:e=>{var n,o;null==(n=null==p?void 0:p.value)||n.resetEditor(),null==(o=null==p?void 0:p.value)||o.setEditorContent(e)}}),(t,u)=>e.e({a:(e.unref(o.isWeChat)||e.unref(o.isApp))&&e.unref(g)},(e.unref(o.isWeChat)||e.unref(o.isApp))&&e.unref(g)?{b:"audio"===e.unref(v)?1:"",c:e.o$1(T),d:e.p({isEnableAudio:"audio"===e.unref(v)})}:{},{e:e.sr(p,"eab7c992-1",{k:"editor"}),f:"editor"===e.unref(v),g:e.o$1(j),h:e.o$1(A),i:e.o$1(C),j:e.p({placeholder:s.placeholder,isMuted:s.isMuted,muteText:s.muteText,enableInput:s.enableInput,enableAt:s.enableAt,enableTyping:s.enableTyping,isGroup:e.unref(c)}),k:s.enableAt},s.enableAt?{l:e.sr(d,"eab7c992-2",{k:"messageInputAtRef"}),m:e.o$1(I),n:e.o$1(x)}:{},{o:e.unref(y)},e.unref(y)?{p:e.o$1((e=>h("emojiPicker"))),q:e.p({file:e.unref(n.faceIcon),size:"23px",hotAreaSize:"3px"})}:{},{r:e.unref(b)},e.unref(b)?{s:e.o$1((e=>h("tools"))),t:e.p({file:e.unref(n.moreIcon),size:"23px",hotAreaSize:"3px"})}:{},{v:e.p({displayType:e.unref(v)}),w:e.n(!e.unref(o.isPC)&&"message-input-h5")})}}),d=e._export_sfc(p,[["__scopeId","data-v-eab7c992"]]);wx.createComponent(d);
|