@tencentcloud/chat-uikit-react 1.2.1 → 1.2.2
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/CHANGELOG.md +1 -1
- package/dist/cjs/components/Checkbox/index.d.ts +1 -2
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +1 -2
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +1 -2
- package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +1 -2
- package/dist/cjs/components/Icon/Icon.d.ts +1 -2
- package/dist/cjs/components/Switch/Switch.d.ts +1 -2
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +1 -3
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/context/ComponentContext.d.ts +1 -2
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/index.d.ts +6 -0
- package/dist/cjs/locales/index.js +1 -1
- package/dist/esm/components/Checkbox/index.d.ts +1 -2
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +1 -2
- package/dist/esm/components/ConversationSearch/ConversationSearchInput.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +1 -2
- package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +1 -2
- package/dist/esm/components/Icon/Icon.d.ts +1 -2
- package/dist/esm/components/Switch/Switch.d.ts +1 -2
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIContact/TUIContact.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +1 -3
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/context/ComponentContext.d.ts +1 -2
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/index.d.ts +6 -0
- package/dist/esm/locales/index.js +1 -1
- package/package.json +3 -3
- package/rollup.config.js +1 -1
- package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/locales/index.ts +4 -3
- package/dist/cjs/_virtual/extends.js +0 -1
- package/dist/esm/_virtual/extends.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import r,{useState as a}from"react";import{useTranslation as m}from"react-i18next";import l from"./hooks/useContactInfo.js";import{BasicInfo as s}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function f(r){var f=this,u=r.profile,h=u.userID,v=m().t,p=a(""),N=p[0],b=p[1],x=a(""),I=x[0],g=x[1],k=a(""),C=k[0],j=k[1],w=a(!1),D=w[0],E=w[1],T=l().addFriend;return i(o,{children:[c(s,{profile:u}),D?c("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.verification info")})),c("p",t({className:"content-item-text"},{children:C}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.Enter the verification info")})),c("textarea",{className:"content-item-wording-text",value:C,onChange:function(t){j(t.target.value)}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.remark")})),c(d,{name:"remark",className:"content-item-text",value:I,type:"text",toggle:function(){b("remark")},isEdit:"remark"===N,confirm:function(t){g(null==t?void 0:t.value),b("")},close:function(){b("")}})]})),c("div",t({className:"content-btn-container"},{children:c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(f,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,T({userID:h,remark:I,wording:C})];case 1:return t.sent(),E(!0),[2]}}))}))}},{children:v("TUIContact.Send application")}))}))]}))]})}var u=r.memo(f);export{u as AddFriendInfo,f as UnMemoizedAddFriendInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as a}from"tslib";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"react";import{useTranslation as i}from"react-i18next";import{Avatar as n}from"../../Avatar/Avatar.js";import{defaultUserAvatar as c}from"../../Avatar/default.js";function o(t){var o=t.profile,m=i().t,d=o.userID,s=o.nick,l=o.selfSignature,v=o.avatar;return e("div",a({className:"tui-contact-info-header"},{children:r("div",a({className:"header-container"},{children:[r("div",a({className:"header-container-avatar"},{children:[e(n,{size:60,image:v||c}),e("div",a({className:"header-container-name"},{children:s||d}))]})),e("div",a({className:"header-container-text"},{children:"ID:".concat(d)})),r("div",a({className:"header-container-text"},{children:[m("TUIContact.Signature"),":",l||""]}))]}))}))}var m=t.memo(o);export{m as BasicInfo,o as UnMemoizedBasicInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as
|
|
1
|
+
import{__assign as t,__awaiter as o,__generator as e}from"tslib";import{jsxs as n,Fragment as r,jsx as c}from"react/jsx-runtime";import i,{useState as m,useEffect as s}from"react";import{useTranslation as a}from"react-i18next";import{useTUIKitContext as f}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as l}from"./basicInfo.js";import{Switch as u}from"../../Switch/Switch.js";import p from"./hooks/useContactInfo.js";function h(i){var h=this,d=i.profile,v=f("TUIContact"),x=v.contactData,C=v.setActiveContact,I=a().t,j=m(!1),b=j[0],k=j[1],N=p().removeFromBlocklist;s((function(){k(!0)}),[x]);return n(r,{children:[c(l,{profile:d}),c("div",t({className:"tui-contact-info-content"},{children:n("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:I("TUIContact.block")})),c(u,{className:"content-item-text",onChange:function(){return o(h,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,N(d.userID)];case 1:return t.sent(),k(!1),C(),[2]}}))}))},checked:b})]}))}))]})}var d=i.memo(h);export{d as BlockInfo,h as UnMemoizedBlockInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as i}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as i}from"react/jsx-runtime";import a from"react";import{useTranslation as c}from"react-i18next";import o from"@tencentcloud/chat";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{Avatar as m}from"../../Avatar/Avatar.js";import{defaultUserAvatar as s}from"../../Avatar/default.js";import l from"./hooks/useContactInfo.js";function d(a){var d=r("TUIContact").setActiveContact,f=c().t,h=a.application,p=h.userID,v=h.nick,u=h.avatar,N=h.type,I=h.wording,b=l(),x=b.acceptFriendApplication,C=b.refuseFriendApplication;return e(n,{children:[i("div",t({className:"tui-contact-info-header"},{children:e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[i(m,{size:60,image:u||s}),i("div",t({className:"header-container-name"},{children:v||p}))]})),i("div",t({className:"header-container-text"},{children:"ID:".concat(p)}))]}))})),i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-item"},{children:[i("p",t({className:"content-item-label"},{children:f("TUIContact.verification info")})),i("p",t({className:"content-item-text"},{children:I}))]}))})),N===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-btn-container"},{children:[i("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){d(),C(p)}},{children:f("TUIContact.Refuse")})),i("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){d(),x(p)}},{children:f("TUIContact.Agree")}))]}))}))]})}var f=a.memo(d);export{f as FriendApplicationInfo,d as UnMemoizedFriendApplication};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as l}from"react-i18next";import{useTUIKitContext as m}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as u}from"./basicInfo.js";import{Switch as d}from"../../Switch/Switch.js";import f from"./hooks/useContactInfo.js";import{DivWithEdit as v}from"../../DivWithEdit/DivWithEdit.js";import{useConversation as h}from"../../../hooks/useConversation.js";function p(c){var p=this,C=m("TUIContact"),b=C.chat,k=C.contactData,I=C.setActiveContact,x=C.setActiveConversation,N=l().t,j=c.friend,T=c.openChat,U=j.userID,D=j.profile,g=j.remark,w=a(""),E=w[0],S=w[1],A=a(""),F=A[0],M=A[1],W=a(!1),y=W[0],B=W[1],K=f(),q=K.addToBlocklist,z=K.deleteFriend,G=h(b).createConversation;s((function(){B(!1),M(g)}),[k,g]);return o(i,{children:[r(u,{profile:D}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:N("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:F,type:"text",toggle:function(){S("remark")},isEdit:"remark"===E,confirm:function(t){b.updateFriend({userID:U,remark:null==t?void 0:t.value}),M(null==t?void 0:t.value),S("")},close:function(){S("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:N("TUIContact.block")})),r(d,{className:"content-item-text",onChange:function(){return e(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,q(U)];case 1:return t.sent(),B(!0),I(),[2]}}))}))},checked:y})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(U)];case 1:return t.sent(),I(),[2]}}))}))}},{children:N("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(p,void 0,void 0,(function(){var t;return n(this,(function(e){switch(e.label){case 0:return[4,G("C2C".concat(U))];case 1:return t=e.sent(),x(t),T(),[2]}}))}))}},{children:N("TUIContact.Send Message")}))]}))]}))]})}var C=c.memo(p);export{C as FriendInfo,p as UnMemoizedFriendInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as i,jsx as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{useTUIKitContext as s}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as r}from"../../../context/TUIContactContext.js";import l from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as m}from"../../Avatar/Avatar.js";import{defaultUserAvatar as d}from"../../Avatar/default.js";import u from"../../Icon/images/right-arrow.svg.js";import p from"../../Icon/images/down-arrow.png.js";function f(){var c=s().setActiveContact,f=e().t,v=r("TUIContactList"),N=v.isShowContactList,I=v.friendList,h=v.blocklistProfile,C=v.friendApplicationList,x=l().acceptFriendApplication,b=a(!1),g=b[0],T=b[1],k=a(!1),A=k[0],U=k[1],j=a(!1),P=j[0],S=j[1];return N&&i("div",t({className:"tui-contacts-list"},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return T(!g)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:f("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:g?p:u,alt:""})}))]})),g&&C.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,u=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(m,{size:30,image:r||d}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==u&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:u}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:f("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),x(i),c()}(t,s)}},{children:f("TUIContact.Agree")}))]}))]}),s)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return S(!P)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:f("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:P?p:u,alt:""})}))]})),P&&h.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(m,{size:30,image:s||d}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!A)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:f("TUIContact.Friend")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:A?p:u,alt:""})}))]})),A&&I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(m,{size:30,image:r||d}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)}))]}))}var v=c.memo(f);export{v as TUIContactList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import a,{useState as i}from"react";import{useTranslation as c}from"react-i18next";import{useTUIKitContext as s}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as h}from"../Input/Input.js";function p(){var a=this,p=s("TUIContactSearch");p.chat;var I=p.setActiveContact,C=c().t,x=u("TUIContactList"),j=x.friendList,g=x.setShowContactList,U=i(!1),T=U[0],b=U[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=i(""),w=D[0],S=D[1],F=i([]),L=F[0],B=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(h,{className:"tui-contact-search-input",placeholder:C("TUIContact.Enter a userID"),clearable:!0,value:w,onBlur:function(t){var e;S(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){I()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g(!0),b(!1),void B([]);b(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),g(!1)},onKeyDown:function(){return e(a,void 0,void 0,(function(){return r(this,(function(t){return w&&A(w).then((function(t){var e=t.data;B(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),T&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:C("TUIContact.No Result")})):L.map((function(i,c){var s=i.userID,u=i.avatar,m=i.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=i,e(a,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?(e=j.find((function(t){return t.userID===w})),I({type:"friend",data:e}),[2]):N(t.userID)?(I({type:"block",data:t}),[2]):(I({type:"addFriend",data:t}),[2])}}))}))}},{children:[o(v,{size:30,image:u||f}),o("div",t({className:"search-item-name"},{children:m||s}))]}),s)}))]}))}var I=a.memo(p);export{I as TUIContactSearch,p as UnMemoizedTUIContactSearch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as i,useRef as s}from"react";import{useTranslation as a}from"react-i18next";import{useTUIKitContext as v}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import c from"./hooks/useConversationList.js";import{ConversationPreview as l}from"../ConversationPreview/ConversationPreview.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as C}from"../Icon/type.js";import"@tencentcloud/chat";import{useTUIConversationContext as u}from"../../context/TUIConversationContext.js";import{ConversationListContainer as f}from"../ConversationPreview/ConversationListContainer.js";import{ConversationSearchInput as p}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as d}from"../ConversationSearch/ConversationSearchResult.js";import{ConversationCreate as h}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import{getDisplayTitle as j}from"../ConversationPreview/utils.js";import{useConversationUpdate as I}from"./hooks/useConversationUpdate.js";function L(r){var L=r.Preview,w=r.Container,g=void 0===w?f:w,T=r.onConversationListUpdated,U=r.filterConversation,x=a().t,P=v("TUIConversationList"),N=P.chat,S=P.customClasses,y=P.conversation,k=P.setActiveConversation;P.setTUIProfileShow;var A=u("TUIConversationList").filterConversation,E=U||A,R=i(0),b=R[0],F=R[1],D=c(N,(function(o,e){o.length&&k(y)}),E),G=D.conversationList,K=D.setConversationList;I(K,T,(function(){return F((function(o){return o+1}))}),E);var M=i(""),O=M[0],V=M[1],q=i(G),z=q[0],B=q[1],H=i(!1),J=H[0],Q=H[1],W=s(null);return e("div",o({className:"tui-conversation ".concat(S||""),ref:W},{children:J?e(h,{conversationList:G,setConversationCreated:Q}):t(n,{children:[t("div",o({className:"tui-conversation-header"},{children:[e(p,{value:O,clearable:!0,onChange:function(o){var e,t;if(V(null===(e=o.target)||void 0===e?void 0:e.value),null===(t=o.target)||void 0===t?void 0:t.value){var n=G.filter((function(e){var t;return j(e).toLocaleLowerCase().includes(null===(t=o.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));B(n)}else B([])}}),e("div",o({className:"tui-conversation-create-icon"},{children:e(m,{onClick:function(){V(""),Q(!0)},type:C.CREATE,height:24,width:24})}))]})),e(g,o({setConversationList:K},{children:0===G.length?t("div",o({className:"no-result"},{children:[e(m,{className:"no-result-icon",type:C.EFFORT,width:42,height:42}),e("div",o({className:"no-result-message"},{children:x("TUIConversation.No conversation")}))]})):O?e(d,{Preview:L,searchValue:O,result:z}):G.map((function(t){return e(l,o({},{activeConversation:y,conversation:t,setActiveConversation:k,Preview:L,conversationUpdateCount:b}),t.conversationID)}))}))]})}))}var w=r.memo(L);export{w as TUIConversationList,L as UnMemoTUIConversationList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as n,__generator as t}from"tslib";import{useState as o,useEffect as e,useCallback as a}from"react";import{useTranslation as i}from"react-i18next";var r=function(r){var c=r.chat,s=r.activeConversation,v=r.language,u=i().i18n,f=o(s),l=f[0],g=f[1],h=o(),I=h[0],d=h[1],m=o(!1),w=m[0],D=m[1],p=o(!1),M=p[0],P=p[1],S=o(),T=S[0],U=S[1];e((function(){u.changeLanguage(v);n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,null==c?void 0:c.getMyProfile()];case 1:return n=t.sent(),d(null==n?void 0:n.data),[2]}}))}))}),[c,v]);var C=a((function(n){n&&(null==c||c.setMessageRead({conversationID:n.conversationID})),l&&n.conversationID!==l.conversationID&&D(!1),g(n)}),[c]);return e((function(){g(s)}),[s]),{conversation:l,contactData:T,setActiveConversation:C,myProfile:I,TUIManageShow:w,setTUIManageShow:D,TUIProfileShow:M,setTUIProfileShow:P,setActiveContact:function(n){U(n)}}};export{r as useTUIKit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useEffect as a}from"react";import{useTranslation as t}from"react-i18next";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as c,defaultUserAvatar as m}from"../Avatar/default.js";import{Switch as d}from"../Switch/Switch.js";import{useTUIKitContext as v}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{getMessageProfile as h}from"../ConversationPreview/utils.js";import{useConversationUpdate as u}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as f}from"../../hooks/useConversation.js";function p(){var p=t().t,g=o(null),I=g[0],C=g[1],N=o(null),j=N[0],U=N[1],x=o(!1),T=x[0],k=x[1],D=o(0),w=D[0],A=D[1],M=v("TUIManage"),P=M.conversation,S=M.setActiveConversation,b=M.chat,y=M.TUIManageShow,L=M.setTUIManageShow;u(null,(function(){A((function(n){return n+1}))}));var z=f(b),E=z.pinConversation,K=z.deleteConversation;return a((function(){C(P),U(h(P)),k(!!P&&P.isPinned)}),[P,w]),y&&P&&e("div",n({className:"tui-manage"},{children:[e("div",n({className:"tui-manage-title"},{children:[i(r,{type:s.CANCEL,width:16,height:16,onClick:function(){L(!1)}}),i("span",{children:p("TUIConversation.Conversation Information")})]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(l,{size:64,image:(null==j?void 0:j.avatar)||((null==j?void 0:j.groupID)?c:m)})})),i("div",n({className:"info-name"},{children:(null==j?void 0:j.nick)||(null==j?void 0:j.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==j?void 0:j.userID)||(null==j?void 0:j.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:p("TUIConversation.Pin")})),i(d,{onChange:function(n){k(n.target.checked),E({conversationID:I.conversationID,isPinned:n.target.checked})},checked:T})]})),i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){K(I.conversationID),S(null)}},{children:i("div",n({className:"manage-handle-title red"},{children:p("TUIConversation.Delete")}))}))]}))]}))]}))}export{p as TUIManage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import s from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as E}from"./MessageFace.js";import{MessageFile as M}from"./MessageFile.js";import{MessageImage as S}from"./MessageImage.js";import{MessageLocation as i}from"./MessageLocation.js";import{MessageMerger as a}from"./MessageMerger.js";import{MessageText as n}from"./MessageText.js";import{MessageVideo as T}from"./MessageVideo.js";import"react-i18next";import"../../constants.js";import{useTUIMessageContext as G}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as g}from"./hooks/useMessageContextHandler.js";import{MessageStatus as p}from"./MessageStatus.js";var l,f=((l={})[s.TYPES.MSG_TEXT]=n,l[s.TYPES.MSG_FACE]=E,l[s.TYPES.MSG_IMAGE]=S,l[s.TYPES.MSG_AUDIO]=m,l[s.TYPES.MSG_VIDEO]=T,l[s.TYPES.MSG_FILE]=M,l[s.TYPES.MSG_CUSTOM]=r,l[s.TYPES.MSG_MERGER]=a,l[s.TYPES.MSG_LOCATION]=i,l);function P(o){var m,r=o.message,E=g({message:r}).context,M=G("MessageCustom"),S=M.CustemElement,i=M.TextElement,a=M.FaceElement,n=M.ImageElement,T=M.AudioElement,l=M.VideoElement,P=M.FileElement,Y=M.MergerElement,_=M.LocationElement,c=((m={})[s.TYPES.MSG_TEXT]=i,m[s.TYPES.MSG_FACE]=a,m[s.TYPES.MSG_IMAGE]=n,m[s.TYPES.MSG_AUDIO]=T,m[s.TYPES.MSG_VIDEO]=l,m[s.TYPES.MSG_FILE]=P,m[s.TYPES.MSG_CUSTOM]=S,m[s.TYPES.MSG_MERGER]=Y,m[s.TYPES.MSG_LOCATION]=_,m)[null==r?void 0:r.type]||f[null==r?void 0:r.type];return c&&t(c,e({context:E,message:r},{children:t(p,{message:r})}))}var Y=o.memo(P);function _(o){return t(Y,e({},o))}export{_ as MessageContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as s,jsx as o}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as s,jsx as o}from"react/jsx-runtime";import{useState as l,useRef as i}from"react";import{useTranslation as t}from"react-i18next";import n from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as h}from"../../context/TUIMessageContext.js";import{useMessageHandler as u}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as g,MESSAGE_FLOW as p}from"../../constants.js";import"date-fns";import"date-fns/locale";import{useMessagePluginElement as m}from"./hooks/useMessagePluginElement.js";var v;function f(v){var f,S,w,y,M,C,T=v.plugins,U=v.showNumber,x=v.MoreIcon,E=v.config,I=t().t,N=l(""),R=N[0];N[1];var k=l({}),j=k[0],b=k[1],q=i(null),O=h("MessagePlugins"),P=O.message,D=O.plugin,F=c("MessageBubbleWithContext").messageListRef,L=u({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==E?void 0:E.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==E?void 0:E.forward),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.forward),copy:e(e({isShow:!0,relateMessageType:[n.TYPES.MSG_TEXT]},null==E?void 0:E.copy),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.copy),delete:e(e({isShow:!0},null==E?void 0:E.delete),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.delete),revoke:e(e({isShow:!0},null==E?void 0:E.revoke),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.revoke),resend:e(e({isShow:!0},null==E?void 0:E.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Recall")}),o(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===g.SUCCESS&&P.flow===p.OUT,relateMessageType:H.revoke.relateMessageType}),X=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",e({className:"del"},{children:I("TUIChat.Delete")})),o(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Reference")}),o(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Copy")}),o(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Resend")}),o(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){q.current.closeMore(),B(e)},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==g.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=[Q,_,m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Forward")}),o(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.forward.relateMessageType}),X,J,z],Z=(T||(null==D?void 0:D.plugins)||K).filter((function(e){return e})),$=x||(null==D?void 0:D.MoreIcon)||o(a,{className:"icon-more",width:16,height:16,type:d.MORE}),ee=U||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==g.UNSEND&&o(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:Z,showNumber:ee,MoreIcon:$,root:null==F?void 0:F.current,handleVisible:function(e){e.x&&e.y&&b({position:"fixed",left:"".concat(e.left?e.x:e.x-e.width,"px"),top:"".concat(e.top?e.y:e.y-e.height,"px")})}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(v||(v={}));export{f as MessagePlugins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import n,{useCallback as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,d=i().t,u=m().operateMessage,p=r((function(){var e;u(((e={})[l.REVOKE]=c,e))}),[u]);return o("div",e({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&t("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&t("span",{children:d("TUIChat.You")}),t("span",{children:d("TUIChat.recalled a message")}),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&t("span",e({className:"edit",role:"button",tabIndex:0,onClick:p},{children:d("TUIChat.Re-edit")}))]}))}var d=n.memo(c);function u(o){return t(d,e({},o))}export{u as MessageRevoke};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import r from"react";import"react-i18next";import"../../constants.js";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as s}from"./hooks/useMessageContextHandler.js";function o(r){var o=r.message,m=s({message:o}).context;return t("div",e({className:"bubble message-system"},{children:t("div",{children:m})}))}var m=r.memo(o);function n(r){return t(m,e({},r))}export{n as MessageSystem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import r from"react";import"react-i18next";import"../../constants.js";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as o}from"./hooks/useMessageContextHandler.js";function s(r){var s=r.message,m=o({message:s}).context;return e("div",t({className:"bubble message-tip"},{children:m.text}))}var m=r.memo(s);function n(r){return e(m,t({},r))}export{n as MessageTip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import
|
|
1
|
+
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import{useTranslation as n}from"react-i18next";import{MESSAGE_FLOW as o,MESSAGE_OPERATE as a}from"../../../constants.js";import{useTUIKitContext as s}from"../../../context/TUIKitContext.js";import"react/jsx-runtime";import{useTUIChatActionContext as i}from"../../../context/TUIChatActionContext.js";import"../../../context/TUIMessageContext.js";import{Toast as u}from"../../Toast/index.js";var l=function(l){var c=l.message,d=l.handleError,v=i(),f=v.removeMessage,m=v.editLocalMessage,p=v.operateMessage,h=v.revokeMessage,g=n().t,x=s("useDeleteHandler").chat,M=r((function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(r.preventDefault(),!(null==c?void 0:c.ID)||!x||!f)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,x.deleteMessage([c])];case 2:return t.sent(),f(c),[3,4];case 3:if(e=t.sent(),!d)throw u({text:g("TUIChat.Error deleting message"),type:"error"}),new Error(e);return d({functionName:"deleteMessage",error:e}),[3,4];case 4:return[2]}}))}))}),[c]),y=r((function(r){return e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:if(r.preventDefault(),!(null==c?void 0:c.ID)||!x||!m)return[2];t.label=1;case 1:return t.trys.push([1,6,,7]),h?[4,h(c)]:[3,3];case 2:return t.sent(),[3,5];case 3:return[4,x.revokeMessage(c)];case 4:t.sent(),t.label=5;case 5:return m(c),[3,7];case 6:if(e=t.sent(),!d)throw n=c.flow===o.OUT?g("TUIChat.The message recall exceeded the time limit (default 2 minutes)"):g("TUIChat.Error revoke Message"),u({text:n,type:"error"}),new Error(e);return d({functionName:"revokeMessage",error:e}),[3,7];case 7:return[2]}}))}))}),[c]),D=r((function(e){var t;e.preventDefault(),(null==c?void 0:c.ID)&&x&&p&&p(((t={})[a.QUOTE]=c,t))}),[c]),b=r((function(e){if(e.preventDefault(),navigator.clipboard)navigator.clipboard.writeText(c.payload.text);else{var t=document.createElement("textarea");document.body.appendChild(t),t.style.position="fixed",t.style.clip="rect(0 0 0 0)",t.style.top="10px",t.value=c.payload.text,t.select(),document.execCommand("copy",!0),document.body.removeChild(t)}}),[c]),w=r((function(r){return e(void 0,void 0,void 0,(function(){var e,r,n;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,x.resendMessage(c)];case 1:return e=t.sent(),m(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.message),[3,3];case 2:if(r=t.sent(),!d)throw u({text:r,type:"error"}),new Error(r);return d({functionName:"resendMessage",error:r}),[3,3];case 3:return[2]}}))}))}),[c]),C=r((function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){return r.preventDefault(),(null==c?void 0:c.ID)&&x&&p?(p(((e={})[a.FORWARD]=c,e)),[2]):[2]}))}))}),[c]);return{handleDelMessage:M,handleRevokeMessage:y,handleReplyMessage:D,handleCopyMessage:b,handleResendMessage:w,handleForWardMessage:C}};export{l as useMessageHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as i,__spreadArray as
|
|
1
|
+
import{__assign as i,__spreadArray as o}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useRef as l}from"react";import{useTranslation as t}from"react-i18next";import{EmojiPicker as r}from"./EmojiPicker.js";import{Plugins as u}from"../Plugins/index.js";import{useUploadElement as s}from"./hooks/useUploadElement.js";import{MESSAGE_TYPE_NAME as c}from"../../constants.js";import{useTUIMessageInputContext as d}from"../../context/TUIMessageInputContext.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";function g(){var g,f,v,h,I,C,M,j=d("TUIMessageInputDefault"),U=j.sendUploadMessage,k=j.pluginConfig,x=t().t,E=a("TUIMessageInput").TUIMessageInputConfig,P=(null==k?void 0:k.plugins)||(null===(g=null==E?void 0:E.pluginConfig)||void 0===g?void 0:g.plugins)||[],T=(null==k?void 0:k.showNumber)||(null===(f=null==E?void 0:E.pluginConfig)||void 0===f?void 0:f.showNumber)||1,y=(null==k?void 0:k.MoreIcon)||(null===(v=null==E?void 0:E.pluginConfig)||void 0===v?void 0:v.MoreIcon),N=function(i,o,e){return"boolean"==typeof i?i:"boolean"==typeof o?o:e},b=N(null==k?void 0:k.isEmojiPicker,null===(h=null==E?void 0:E.pluginConfig)||void 0===h?void 0:h.isEmojiPicker,!0),w=N(null==k?void 0:k.isImagePicker,null===(I=null==E?void 0:E.pluginConfig)||void 0===I?void 0:I.isImagePicker,!0),V=N(null==k?void 0:k.isVideoPicker,null===(C=null==E?void 0:E.pluginConfig)||void 0===C?void 0:C.isVideoPicker,!0),D=N(null==k?void 0:k.isFilePicker,null===(M=null==E?void 0:E.pluginConfig)||void 0===M?void 0:M.isFilePicker,!0),F=l(null),O=w&&s({children:e("div",i({className:"input-plugin-item"},{children:[n(p,{width:20,height:20,type:m.IMAGE}),n("span",{children:x("TUIChat.Image")})]})),type:"image",accept:"image/*",onChange:function(i){F.current.closeMore(),U({file:i},c.IMAGE)}}),A=V&&s({children:e("div",i({className:"input-plugin-item"},{children:[n(p,{width:20,height:20,type:m.VIDEO}),n("span",{children:x("TUIChat.Video")})]})),type:"video",accept:"video/*",onChange:function(i){F.current.closeMore(),U({file:i},c.VIDEO)}}),G=D&&s({children:e("div",i({className:"input-plugin-item"},{children:[n(p,{width:20,height:20,type:m.DOCUMENT}),n("span",{children:x("TUIChat.File")})]})),type:"file",accept:"file/*",onChange:function(i){F.current.closeMore(),U({file:i},c.FILE)}}),L=o([b&&n(r,{}),O,A,G],P,!0).filter((function(i){return i}));return n(u,{ref:F,plugins:L,showNumber:T,MoreIcon:y})}export{g as InputPluginsDefalut};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as t}from"tslib";import{jsx as
|
|
1
|
+
import{__assign as e,__spreadArray as t}from"tslib";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{useState as a,useCallback as i,useEffect as n}from"react";import{useTranslation as l}from"react-i18next";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Model as c}from"../Model/index.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Input as u}from"../Input/Input.js";import{Checkbox as h}from"../Checkbox/index.js";import{Avatar as f}from"../Avatar/Avatar.js";import{getDisplayImage as v,getDisplayTitle as p}from"../ConversationPreview/utils.js";import{MESSAGE_OPERATE as g}from"../../constants.js";import"./hooks/useHandleQuoteMessage.js";import{useHandleForwardMessage as w}from"./hooks/useHandleForwardMessage.js";function C(C){var N,I=C.handleForward,j=l().t,x=a([]),b=x[0],k=x[1],F=a([]),D=F[0],A=F[1],L=a(""),M=L[0],T=L[1],U=s().operateMessage,R=w(),y=R.message,S=R.sendForwardMessage,H=R.conversationList,z=void 0===H?[]:H,E=i((function(e){var t;U(((t={})[g.FORWARD]=null,t))}),[U]),P=z,O=function(e){e.checked?k(t(t([],b,!0),[e.value],!1)):k(b.filter((function(t){return t!==e.value})))};return n((function(){k([]),A([]),T("")}),[y]),y&&z.length>0&&r(c,e({onClick:E},{children:o("div",e({role:"button",tabIndex:0,className:"tui-forward",onClick:function(e){e.stopPropagation()}},{children:[o("header",e({className:"tui-forward-header"},{children:[r(d,{type:m.CANCEL,width:16,height:16,onClick:E}),r("h2",e({className:"tui-forward-title"},{children:j("TUIChat.Forward to")}))]})),r("div",e({className:"tui-forward-search"},{children:r(u,{className:"tui-forward-search-input",placeholder:"Search",clearable:!0,value:M,onChange:function(e){var t,r;if(T(null===(t=e.target)||void 0===t?void 0:t.value),null===(r=e.target)||void 0===r?void 0:r.value){var o=z.filter((function(t){var r,o=p(t).toLocaleLowerCase(),a=null===(r=e.target)||void 0===r?void 0:r.value.toLocaleLowerCase();return o.includes(a)}));A(o)}else A([])},prefix:r(d,{type:m.SEARCH,height:16,width:16})})})),o("main",e({className:"tui-forward-main"},{children:[M&&o("ul",e({className:"tui-forward-list"},{children:[r("h3",e({className:"tui-forward-list-title"},{children:j("TUIChat.Search Result")})),D.length>0&&D.map((function(t){return o("li",e({className:"tui-forward-list-item"},{children:[o("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[r(f,{image:v(t),size:40}),r("div",e({className:"info-nick"},{children:p(t)}))]})),r(h,{onChange:O,id:"".concat(t.conversationID),value:t})]}),t.conversationID)})),0===D.length&&r("p",e({className:"no-result"},{children:j("TUIChat.No Result")}))]})),!M&&P.length>0&&r("ul",e({className:"tui-forward-list"},{children:P.map((function(t){return o("li",e({className:"tui-forward-list-item"},{children:[o("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[r(f,{image:v(t),size:40}),r("div",e({className:"info-nick"},{children:p(t)}))]})),r(h,{onChange:O,id:"".concat(t.conversationID),value:t})]}),t.conversationID)}))}))]})),o("footer",e({className:"tui-forward-footer"},{children:[r("div",e({className:"tui-forward-footer-name"},{children:b.length>0&&(N=b,(null==N?void 0:N.map((function(e){return p(e)}))).toString())})),r("button",e({type:"button",className:"button",onClick:function(){var e;e=b,I?I({list:b,message:y}):S(b),E(e)},disabled:0===b.length},{children:j("TUIChat.Forward")}))]}))]}))}))}export{C as TUIForward};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import s from"react";import n from"@tencentcloud/chat";import{TUIMessageInputContextProvider as r}from"../../context/TUIMessageInputContext.js";import{useCreateMessageInputContext as a}from"./hooks/useCreateMessageInputContext.js";import{useMessageInputState as i}from"./hooks/useMessageInputState.js";import"../../constants.js";import{useTUIChatStateContext as u}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as m}from"../../context/ComponentContext.js";import"./hooks/useHandleQuoteMessage.js";import"react-i18next";import{EmptyStateIndicator as p}from"../EmptyStateIndicator/EmptyStateIndicator.js";import{InputQuoteDefalut as l}from"./InputQuoteDefalut.js";import{TUIMessageInputDefault as c}from"./TUIMessageInputDefault.js";import{InputPluginsDefalut as f}from"./InputPluginsDefalut.js";import{TUIForward as I}from"./TUIForward.js";import{Transmitter as d}from"./Transmitter.js";function g(o){var s=o.children,m=o.disabled,p=o.focus,l=o.pluginConfig,c=o.textareaRef,f=i(o),I=u("TUIMessageInput"),d=I.textareaRef,g=I.conversation,x=(null==g?void 0:g.type)===n.TYPES.CONV_SYSTEM,T=u("TUIMessageInput").TUIMessageInputConfig,j=p||(null==T?void 0:T.focus),v=a(t(t(t({},f),o),{textareaRef:c||(null==T?void 0:T.textareaRef)||d,disabled:m||(null==T?void 0:T.disabled)||x,focus:"boolean"!=typeof j||j,pluginConfig:l}));return e(r,t({value:v},{children:s}))}function x(s){var n=s.TUIMessageInput,r=s.InputPlugins,a=s.InputQuote,i=s.isTransmitter,x=s.className,T=u("TUIMessageInput").TUIMessageInputConfig,j=x||(null==T?void 0:T.className),v=i||(null==T?void 0:T.isTransmitter)||!1,M=m(),C=M.TUIMessageInput,U=M.InputPlugins,h=M.InputQuote,S=n||C||c,b=r||U||f||p,N=a||h||l;return e("div",t({className:"tui-message-input ".concat(j)},{children:o(g,t({},s,{children:[e(I,{}),e(N,{}),o("div",t({className:"tui-message-input-main"},{children:[o("div",t({className:"tui-message-input-box"},{children:[e(b,{}),e(S,{})]})),v&&e(d,{})]}))]}))}))}var T=s.memo(x);export{T as TUIMessageInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useEffect as o,useState as r}from"react";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useEffect as o,useState as r}from"react";import{useTranslation as a}from"react-i18next";import{MESSAGE_OPERATE as i}from"../../constants.js";import{useTUIChatStateContext as s}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useTUIMessageInputContext as u}from"../../context/TUIMessageInputContext.js";import{formatEmojiString as c}from"../TUIMessage/utils/emojiMap.js";function l(){var l=u("TUIMessageInputDefault"),d=l.text,m=l.disabled,p=l.handleChange,f=l.handleKeyDown,v=l.handlePasete,x=l.textareaRef,g=l.focus,h=l.setText,I=l.setCursorPos,b=a().t,C=s("TUIMessageInputDefault").operateData;o((function(){C[i.REVOKE]&&h(c(C[i.REVOKE].payload.text,1))}),[C]),o((function(){var t,e;return g&&x.current&&(x.current.autofocus=!0,null===(t=null==x?void 0:x.current)||void 0===t||t.focus(),null===(e=null==x?void 0:x.current)||void 0===e||e.addEventListener("paste",v)),function(){var t;null===(t=null==x?void 0:x.current)||void 0===t||t.removeEventListener("paste",v)}}),[g]);var E=r(!1),T=E[0],j=E[1];return e("div",t({className:"input-box ".concat(m?"disabled":""," ").concat(T?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[n("div",t({className:"input-visibility-content"},{children:d})),!m&&n("textarea",{placeholder:b("TUIChat.Enter a message"),rows:1,value:d,ref:x,onChange:p,onKeyDown:f,onFocus:function(t){j(!0)},onBlur:function(t){I({start:t.target.selectionStart,end:t.target.selectionEnd}),j(!1)}})]}))}export{l as TUIMessageInputDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as t}from"react";import{useTranslation as e}from"react-i18next";import"tslib";import"react/jsx-runtime";import{useTUIChatActionContext as a}from"../../../context/TUIChatActionContext.js";import"../../../context/TUIMessageContext.js";import{emojiEnKey as o}from"../../TUIMessage/utils/emojiMap.js";function r(r){r.textareaRef;var n=r.insertText,i=e().i18n,s=a(),m=s.sendMessage,c=s.createFaceMessage;return{onSelectEmoji:function(t){"zh"===i.language?n(t.data):n(o[t.data])},sendFaceMessage:t((function(t){var e=c({payload:t});m(e)}),[])}}export{r as useEmojiPicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as s,jsxs as o}from"react/jsx-runtime";import n,{useState as l,useEffect as r}from"react";import{useTranslation as a}from"react-i18next";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as c}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as d}from"../../context/ComponentContext.js";import h from"./hooks/useEnrichedMessageList.js";import g from"./hooks/useMessageListElement.js";import{InfiniteScroll as u}from"../InfiniteScrollPaginator/InfiniteScroll.js";import{EmptyStateIndicator as f}from"../EmptyStateIndicator/EmptyStateIndicator.js";function v(n){var v=this,p=n.messageList,I=n.highlightedMessageId,M=n.loadMore,T=n.intervalsTimer,L=n.className,x=a().t,C=l(null),j=C[0],S=C[1],U=l(!1),E=U[0],b=U[1],y=m("TUIMessageList"),N=y.messageList,k=y.highlightedMessageId,w=y.isCompleted,H=y.isSameLastMessageID,V=y.messageListRef,q=y.noMore,A=y.TUIMessageListConfig,D=c(),P=D.loadMore,R=D.setHighlightedMessageId,z=d(),B=z.TUIMessage,F=z.EmptyStateIndicator,G=void 0===F?f:F,J=I||(null==A?void 0:A.highlightedMessageId)||k,K=60*(T||(null==A?void 0:A.intervalsTimer)||30),O=h({messageList:p||(null==A?void 0:A.messageList)||N}).messageList,Q=M||(null==A?void 0:A.loadMore)||P,W=g({enrichedMessageList:O,TUIMessage:B,intervalsTimer:K});return r((function(){t(v,void 0,void 0,(function(){var e,t,s,o,n;return i(this,(function(i){switch(i.label){case 0:return e=null===(n=null==j?void 0:j.parentElement)||void 0===n?void 0:n.parentElement,!w&&(null==e?void 0:e.clientHeight)>=(null==j?void 0:j.clientHeight)?[4,Q()]:[3,2];case 1:i.sent(),i.label=2;case 2:return!(null==j?void 0:j.children)||E&&H||(t=(null==j?void 0:j.children)||[],s=t[t.length-1],o=setTimeout((function(){null==s||s.scrollIntoView({block:"end"}),b(!0),clearTimeout(o)}),100)),[2]}}))}))}),[W,E]),r((function(){if(J){var e=null==j?void 0:j.querySelector("[data-message-id='".concat(J,"']"));if(!e)return;var t=e.children;t[t.length-1].classList.add("high-lighted"),null==e||e.scrollIntoView({block:"center"});var i=setTimeout((function(){t[t.length-1].classList.remove("high-lighted"),clearTimeout(i),R("")}),1e3)}}),[J]),o("div",e({className:"message-list ".concat(L," ").concat(E?"":"hide"),ref:V},{children:[q,q&&s("p",e({className:"no-more"},{children:x("TUIChat.No More")})),s(u,e({className:"message-list-infinite-scroll",hasMore:!0,loadMore:Q,threshold:1},{children:s("ul",e({ref:S},{children:(null==W?void 0:W.length)>0?W:s(G,{listType:"message"})}))}))]}))}var p=n.memo(v);function I(t){return s(p,e({},t))}export{I as TUIMessageList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as l,jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as l,jsxs as a}from"react/jsx-runtime";import t,{useState as i}from"react";import{useTranslation as n}from"react-i18next";import o from"react-date-picker";import r from"@tencentcloud/chat";import{useTUIKitContext as c}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{Avatar as u}from"../Avatar/Avatar.js";import{DivWithEdit as d}from"../DivWithEdit/DivWithEdit.js";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{handleDisplayAvatar as v}from"../untils.js";var p,f,h=((p={})[r.TYPES.GENDER_UNKNOWN]="unknow",p[r.TYPES.GENDER_MALE]="male",p[r.TYPES.GENDER_FEMALE]="female",p),E=((f={})[r.TYPES.ALLOW_TYPE_ALLOW_ANY]="allowAny",f[r.TYPES.ALLOW_TYPE_NEED_CONFIRM]="needConfirm",f[r.TYPES.ALLOW_TYPE_DENY_ANY]="denyAny",f),N=["https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_1.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_2.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_4.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_5.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_6.png"],g=[{label:"Male",value:r.TYPES.GENDER_MALE},{label:"Female",value:r.TYPES.GENDER_FEMALE}],T=[{label:"AllowAny",value:r.TYPES.ALLOW_TYPE_ALLOW_ANY},{label:"NeedConfirm",value:r.TYPES.ALLOW_TYPE_NEED_CONFIRM},{label:"DenyAny",value:r.TYPES.ALLOW_TYPE_DENY_ANY}];function _(t){var r,p,f,_,y,P,k=t.userInfo,A=t.className,Y=t.update,L=n().t,b=c("TUIProfileDefault").setTUIProfileShow,D=i(""),I=D[0],w=D[1],S=[{name:"Signature",value:null==k?void 0:k.selfSignature,type:"text",children:null},{name:"Gender",value:L((null===(r=h[null==k?void 0:k.gender])||void 0===r?void 0:r.replace(h[null==k?void 0:k.gender][0],null===(p=h[null==k?void 0:k.gender][0])||void 0===p?void 0:p.toLocaleUpperCase()))?"TUIProfile.".concat(null===(f=h[null==k?void 0:k.gender])||void 0===f?void 0:f.replace(h[null==k?void 0:k.gender][0],null===(_=h[null==k?void 0:k.gender][0])||void 0===_?void 0:_.toLocaleUpperCase())):""),type:"select",children:l("ul",e({className:"select-list"},{children:null==g?void 0:g.map((function(a,t){var i="".concat(a.value).concat(t);return l("li",e({className:"select-list-item",role:"menuitem",tabIndex:t,onClick:function(){O(a)}},{children:L("TUIProfile.".concat(a.label))}),i)}))}))},{name:"AllowType",value:L("TUIProfile.".concat(null===(y=E[null==k?void 0:k.allowType])||void 0===y?void 0:y.replace(E[null==k?void 0:k.allowType][0],null===(P=E[null==k?void 0:k.allowType][0])||void 0===P?void 0:P.toLocaleUpperCase()))),type:"select",children:l("ul",e({className:"select-list"},{children:null==T?void 0:T.map((function(a,t){var i="".concat(a.value).concat(t);return l("li",e({className:"select-list-item",role:"menuitem",tabIndex:t,onClick:function(){x(a)}},{children:L("TUIProfile.".concat(a.label))}),i)}))}))},{name:"Birthday",value:"".concat(null==k?void 0:k.birthday),type:"select",children:l(o,{className:"tui-profile-birthday",calendarClassName:"tui-profile-birthday-calendar",isOpen:!0,format:"y-MM-dd",onChange:function(e){W(e)},value:function(e){if(8===(null==e?void 0:e.length)){var l=Number(e.slice(0,4)),a=Number(e.slice(4,6)),t=Number(e.slice(-2));return new Date(l,a-1,t)}return new Date}("".concat(null==k?void 0:k.birthday))})}],C=function(e){w(e)},U=function(e){Y(e),w("")},M=function(e){var l,a="";switch(null==e?void 0:e.name){case"nick":a="nick";break;case"Signature":a="selfSignature";break;default:return void w("")}var t=((l={})[a]=e.value,l);U(t)},O=function(e){U({gender:e.value})},x=function(e){U({allowType:e.value})},W=function(e){var l,a,t,i;U({birthday:Number((l=e,a=l.getDate()>9?l.getDate():"0".concat(l.getDate()),t=l.getMonth()>8?l.getMonth()+1:"0".concat(l.getMonth()+1),i=l.getFullYear(),"".concat(i).concat(t).concat(a)))})};return a("div",e({className:"".concat(A," tui-profile")},{children:[a("header",e({className:"tui-profile-header"},{children:[l(s,{width:9,height:16,type:m.BACK,onClick:function(){b(!1)}}),l("h1",{children:L("TUIProfile.Personal information")})]})),a("main",e({className:"tui-profile-main"},{children:[l("div",e({className:"tui-profile-avatar"},{children:l(u,{image:v(null==k?void 0:k.avatar),size:94,update:function(e){U({avatar:e})},list:N})})),l(d,{name:"nick",className:"tui-profile-nick",value:null==k?void 0:k.nick,type:"text",toggle:C,isEdit:"nick"===I,confirm:M,close:function(){w("")}}),a("div",e({className:"tui-profile-ID"},{children:[l("h5",{children:"ID:"}),l("span",{children:null==k?void 0:k.userID})]}))]})),l("ul",e({className:"tui-profile-list"},{children:S.map((function(t){var i="".concat(t.name);return a("li",e({className:"tui-profile-list-item"},{children:[l("h4",{children:L("TUIProfile.".concat(t.name))}),l(d,e({className:"tui-profile-div-with-edit",classEditName:"tui-profile-edit",name:t.name,value:null==t?void 0:t.value,type:t.type,toggle:C,isEdit:I===t.name,confirm:M,close:function(){w("")}},{children:null==t?void 0:t.children}))]}),i)}))}))]}))}var y=t.memo(_);function P(a){var t=e({},a);return l(y,e({},t))}export{P as TUIProfileDefault};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import React, { PropsWithChildren } from 'react';
|
|
3
2
|
import { EmptyStateIndicatorProps } from '../components/EmptyStateIndicator/EmptyStateIndicator.js';
|
|
4
3
|
import { TUIMessageProps } from '../components/TUIMessage/TUIMessage.js';
|
|
@@ -21,7 +20,7 @@ interface ComponentContextValue {
|
|
|
21
20
|
declare const ComponentContext: React.Context<ComponentContextValue>;
|
|
22
21
|
declare function ComponentProvider({ children, value, }: PropsWithChildren<{
|
|
23
22
|
value: ComponentContextValue;
|
|
24
|
-
}>):
|
|
23
|
+
}>): JSX.Element;
|
|
25
24
|
declare function useComponentContext(componentName?: string): ComponentContextValue;
|
|
26
25
|
|
|
27
26
|
export { ComponentContext, ComponentContextValue, ComponentProvider, UnknowPorps, useComponentContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e}from"react/jsx-runtime";import t,{useContext as s}from"react";import"react-i18next";import{TUIConversationList as n}from"../components/TUIConversationList/TUIConversationList.js";import"@tencentcloud/chat";import"../components/Icon/config.js";import"../components/Icon/type.js";import"./TUIMessageContext.js";import"../components/TUIProfile/TUIProfileDefault.js";import"../constants.js";import"date-fns";import"date-fns/locale";import"../components/TUIMessage/hooks/useMessageReply.js";import"../components/TUIMessage/MessagePlugins.js";import"../components/TUIMessage/MessageContext.js";import"../components/TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../components/Switch/Switch.js";import"../locales/index.js";var r=t.createContext(void 0);function i(t){var s=t.children,i=t.value;return e(r.Provider,o({value:i},{children:s||e(n,{})}))}var m=function(o){var e=s(r);return!e&&o?{}:e};export{r as TUIConversationContext,i as TUIConversationProvider,m as useTUIConversationContext};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -45,3 +45,5 @@ export { TUIContactInfo, UnMemoizedTUIContactInfo } from './components/TUIContac
|
|
|
45
45
|
export { TUIContact, UnMemoizedTUIContact } from './components/TUIContact/TUIContact.js';
|
|
46
46
|
export { CreateGroupConversationParams, useConversation } from './hooks/useConversation.js';
|
|
47
47
|
export { useProfile } from './hooks/useProfile.js';
|
|
48
|
+
export { t } from './locales/index.js';
|
|
49
|
+
export { default as i18next } from 'i18next';
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{TUIKit}from"./components/TUIKit/TUIKit.js";export{useTUIKit}from"./components/TUIKit/hooks/useTUIKit.js";export{useCreateTUIKitContext}from"./components/TUIKit/hooks/useCreateTUIKitContext.js";export{TUIConversation,UnMemoizedTUIConversation}from"./components/TUIConversation/TUIConversation.js";export{TUIConversationList,UnMemoTUIConversationList}from"./components/TUIConversationList/TUIConversationList.js";import"tslib";import"react";import"@tencentcloud/chat";export{TUIChat}from"./components/TUIChat/TUIChat.js";export{ConversationPreview}from"./components/ConversationPreview/ConversationPreview.js";export{ConversationPreviewContent,unMemoConversationPreviewContent}from"./components/ConversationPreview/ConversationPreviewContent.js";export{TUIChatHeader}from"./components/TUIChatHeader/TUIChatHeader.js";export{TUIChatHeaderDefault}from"./components/TUIChatHeader/TUIChatHeaderDefault.js";export{TUIMessageList}from"./components/TUIMessageList/TUIMessageList.js";export{TUIMessage}from"./components/TUIMessage/TUIMessage.js";export{MessagePlugins}from"./components/TUIMessage/MessagePlugins.js";export{MessageContext}from"./components/TUIMessage/MessageContext.js";export{TUIMessageInput}from"./components/TUIMessageInput/TUIMessageInput.js";export{TUIMessageInputDefault}from"./components/TUIMessageInput/TUIMessageInputDefault.js";export{InputPluginsDefalut}from"./components/TUIMessageInput/InputPluginsDefalut.js";export{TUIProfile}from"./components/TUIProfile/TUIProfile.js";export{TUIProfileDefault}from"./components/TUIProfile/TUIProfileDefault.js";export{Avatar}from"./components/Avatar/Avatar.js";export{defaultGroupAvatarAVChatRoom,defaultGroupAvatarMeeting,defaultGroupAvatarPublic,defaultGroupAvatarWork,defaultUserAvatar}from"./components/Avatar/default.js";export{ConversationSearchInput}from"./components/ConversationSearch/ConversationSearchInput.js";export{ConversationSearchResult}from"./components/ConversationSearch/ConversationSearchResult.js";export{TUIManage}from"./components/TUIManage/TUIManage.js";export{Popup}from"./components/Popup/index.js";export{Checkbox}from"./components/Checkbox/index.js";export{DivWithEdit}from"./components/DivWithEdit/DivWithEdit.js";export{Icon,changeTypeToIconClassName}from"./components/Icon/Icon.js";export{IconTypes}from"./components/Icon/type.js";export{EmptyStateIndicator}from"./components/EmptyStateIndicator/EmptyStateIndicator.js";export{Input}from"./components/Input/Input.js";export{Model}from"./components/Model/index.js";export{Plugins}from"./components/Plugins/index.js";export{Switch}from"./components/Switch/Switch.js";export{Toast}from"./components/Toast/index.js";export{TUIContactList}from"./components/TUIContact/TUIContactList/TUIContactList.js";export{TUIContactInfo,UnMemoizedTUIContactInfo}from"./components/TUIContact/TUIContactInfo/TUIContactInfo.js";export{TUIContact,UnMemoizedTUIContact}from"./components/TUIContact/TUIContact.js";export{TUIKitContext,TUIKitProvider,useTUIKitContext}from"./context/TUIKitContext.js";export{TUIChatStateContext,TUIChatStateContextProvider,useTUIChatStateContext}from"./context/TUIChatStateContext.js";export{TUIChatActionContext,TUIChatActionProvider,useTUIChatActionContext}from"./context/TUIChatActionContext.js";export{TUIMessageContext,TUIMessageContextProvider,messageShowType,useTUIMessageContext}from"./context/TUIMessageContext.js";export{ComponentContext,ComponentProvider,useComponentContext}from"./context/ComponentContext.js";export{TUIMessageInputContext,TUIMessageInputContextProvider,useTUIMessageInputContext}from"./context/TUIMessageInputContext.js";export{TUIContactContext,TUIContactContextProvider,useTUIContactContext}from"./context/TUIContactContext.js";export{useConversation}from"./hooks/useConversation.js";export{useProfile}from"./hooks/useProfile.js";
|
|
1
|
+
export{TUIKit}from"./components/TUIKit/TUIKit.js";export{useTUIKit}from"./components/TUIKit/hooks/useTUIKit.js";export{useCreateTUIKitContext}from"./components/TUIKit/hooks/useCreateTUIKitContext.js";export{TUIConversation,UnMemoizedTUIConversation}from"./components/TUIConversation/TUIConversation.js";export{TUIConversationList,UnMemoTUIConversationList}from"./components/TUIConversationList/TUIConversationList.js";import"tslib";import"react";import"@tencentcloud/chat";export{TUIChat}from"./components/TUIChat/TUIChat.js";export{ConversationPreview}from"./components/ConversationPreview/ConversationPreview.js";export{ConversationPreviewContent,unMemoConversationPreviewContent}from"./components/ConversationPreview/ConversationPreviewContent.js";export{TUIChatHeader}from"./components/TUIChatHeader/TUIChatHeader.js";export{TUIChatHeaderDefault}from"./components/TUIChatHeader/TUIChatHeaderDefault.js";export{TUIMessageList}from"./components/TUIMessageList/TUIMessageList.js";export{TUIMessage}from"./components/TUIMessage/TUIMessage.js";export{MessagePlugins}from"./components/TUIMessage/MessagePlugins.js";export{MessageContext}from"./components/TUIMessage/MessageContext.js";export{TUIMessageInput}from"./components/TUIMessageInput/TUIMessageInput.js";export{TUIMessageInputDefault}from"./components/TUIMessageInput/TUIMessageInputDefault.js";export{InputPluginsDefalut}from"./components/TUIMessageInput/InputPluginsDefalut.js";export{TUIProfile}from"./components/TUIProfile/TUIProfile.js";export{TUIProfileDefault}from"./components/TUIProfile/TUIProfileDefault.js";export{Avatar}from"./components/Avatar/Avatar.js";export{defaultGroupAvatarAVChatRoom,defaultGroupAvatarMeeting,defaultGroupAvatarPublic,defaultGroupAvatarWork,defaultUserAvatar}from"./components/Avatar/default.js";export{ConversationSearchInput}from"./components/ConversationSearch/ConversationSearchInput.js";export{ConversationSearchResult}from"./components/ConversationSearch/ConversationSearchResult.js";export{TUIManage}from"./components/TUIManage/TUIManage.js";export{Popup}from"./components/Popup/index.js";export{Checkbox}from"./components/Checkbox/index.js";export{DivWithEdit}from"./components/DivWithEdit/DivWithEdit.js";export{Icon,changeTypeToIconClassName}from"./components/Icon/Icon.js";export{IconTypes}from"./components/Icon/type.js";export{EmptyStateIndicator}from"./components/EmptyStateIndicator/EmptyStateIndicator.js";export{Input}from"./components/Input/Input.js";export{Model}from"./components/Model/index.js";export{Plugins}from"./components/Plugins/index.js";export{Switch}from"./components/Switch/Switch.js";export{Toast}from"./components/Toast/index.js";export{TUIContactList}from"./components/TUIContact/TUIContactList/TUIContactList.js";export{TUIContactInfo,UnMemoizedTUIContactInfo}from"./components/TUIContact/TUIContactInfo/TUIContactInfo.js";export{TUIContact,UnMemoizedTUIContact}from"./components/TUIContact/TUIContact.js";export{TUIKitContext,TUIKitProvider,useTUIKitContext}from"./context/TUIKitContext.js";export{TUIChatStateContext,TUIChatStateContextProvider,useTUIChatStateContext}from"./context/TUIChatStateContext.js";export{TUIChatActionContext,TUIChatActionProvider,useTUIChatActionContext}from"./context/TUIChatActionContext.js";export{TUIMessageContext,TUIMessageContextProvider,messageShowType,useTUIMessageContext}from"./context/TUIMessageContext.js";export{ComponentContext,ComponentProvider,useComponentContext}from"./context/ComponentContext.js";export{TUIMessageInputContext,TUIMessageInputContextProvider,useTUIMessageInputContext}from"./context/TUIMessageInputContext.js";export{TUIContactContext,TUIContactContextProvider,useTUIContactContext}from"./context/TUIContactContext.js";export{useConversation}from"./hooks/useConversation.js";export{useProfile}from"./hooks/useProfile.js";export{t}from"./locales/index.js";export{default as i18next}from"i18next";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"
|
|
1
|
+
import e from"i18next";export{default as i18next}from"i18next";import{initReactI18next as t}from"react-i18next";import{message as r}from"./en/index.js";import{message as n}from"./zh_cn/index.js";var i={en:{translation:r},zh:{translation:n}};e.use(t).init({resources:i,lng:"zh",interpolation:{escapeValue:!1}});var o=e.t;export{o as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencentcloud/chat-uikit-react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"date-fns": "^2.29.3",
|
|
63
|
-
"i18next": "^23.7.11",
|
|
64
63
|
"react-date-picker": "^9.0.0",
|
|
65
64
|
"react-dom": "^18.2.0",
|
|
66
|
-
"react-i18next": "^13.5.0",
|
|
67
65
|
"tim-upload-plugin": "^1.0.5"
|
|
68
66
|
},
|
|
69
67
|
"peerDependencies": {
|
|
70
68
|
"@tencentcloud/chat": "^3.2.0",
|
|
69
|
+
"i18next": "^23.7.11",
|
|
70
|
+
"react-i18next": "^13.5.0",
|
|
71
71
|
"date-fns": "^2.29.3",
|
|
72
72
|
"react": "^18.2.0",
|
|
73
73
|
"react-date-picker": "^9.0.0",
|
package/rollup.config.js
CHANGED