@tencentcloud/chat-uikit-react 1.2.0 → 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.
Files changed (100) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/cjs/components/Checkbox/index.d.ts +1 -2
  3. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  4. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  5. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  6. package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  7. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  8. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  9. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +1 -2
  10. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.js +1 -1
  11. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  12. package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +1 -2
  13. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +1 -2
  14. package/dist/cjs/components/Icon/Icon.d.ts +1 -2
  15. package/dist/cjs/components/Switch/Switch.d.ts +1 -2
  16. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  17. package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
  18. package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  19. package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  20. package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
  21. package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
  22. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  23. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  24. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
  25. package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
  26. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
  27. package/dist/cjs/components/TUIManage/TUIManage.d.ts +1 -3
  28. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  29. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
  30. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  31. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  32. package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
  33. package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
  34. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  35. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  36. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  37. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
  38. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  39. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  40. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  41. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  42. package/dist/cjs/context/ComponentContext.d.ts +1 -2
  43. package/dist/cjs/context/TUIConversationContext.js +1 -1
  44. package/dist/cjs/index.d.ts +2 -0
  45. package/dist/cjs/index.js +1 -1
  46. package/dist/cjs/locales/index.d.ts +6 -0
  47. package/dist/cjs/locales/index.js +1 -1
  48. package/dist/esm/components/Checkbox/index.d.ts +1 -2
  49. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  50. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  51. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  52. package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  53. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  54. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  55. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +1 -2
  56. package/dist/esm/components/ConversationSearch/ConversationSearchInput.js +1 -1
  57. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  58. package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +1 -2
  59. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +1 -2
  60. package/dist/esm/components/Icon/Icon.d.ts +1 -2
  61. package/dist/esm/components/Switch/Switch.d.ts +1 -2
  62. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  63. package/dist/esm/components/TUIContact/TUIContact.js +1 -1
  64. package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  65. package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  66. package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
  67. package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
  68. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  69. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  70. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
  71. package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
  72. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
  73. package/dist/esm/components/TUIManage/TUIManage.d.ts +1 -3
  74. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  75. package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
  76. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  77. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  78. package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
  79. package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
  80. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  81. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  82. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  83. package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
  84. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  85. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  86. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  87. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  88. package/dist/esm/context/ComponentContext.d.ts +1 -2
  89. package/dist/esm/context/TUIConversationContext.js +1 -1
  90. package/dist/esm/index.d.ts +2 -0
  91. package/dist/esm/index.js +1 -1
  92. package/dist/esm/locales/index.d.ts +6 -0
  93. package/dist/esm/locales/index.js +1 -1
  94. package/package.json +3 -3
  95. package/rollup.config.js +1 -1
  96. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +1 -1
  97. package/src/index.ts +1 -0
  98. package/src/locales/index.ts +4 -3
  99. package/dist/cjs/_virtual/extends.js +0 -1
  100. 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 r}from"react/jsx-runtime";import a,{useState as c}from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as s}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import m from"./hooks/useContactInfo.js";import{BasicInfo as l}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function u(a){var u=this,f=a.profile,h=f.userID,p=s().t,v=c(""),b=v[0],N=v[1],x=c(""),g=x[0],I=x[1],j=c(""),k=j[0],C=j[1],T=c(!1),w=T[0],D=T[1],E=m().addFriend;return i(o,{children:[r(l,{profile:f}),w?r("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:p("TUIContact.verification info")})),r("p",t({className:"content-item-text"},{children:k}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[r("p",t({className:"content-item-label"},{children:p("TUIContact.Enter the verification info")})),r("textarea",{className:"content-item-wording-text",value:k,onChange:function(t){C(t.target.value)}})]})),i("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:p("TUIContact.remark")})),r(d,{name:"remark",className:"content-item-text",value:g,type:"text",toggle:function(){N("remark")},isEdit:"remark"===b,confirm:function(t){I(null==t?void 0:t.value),N("")},close:function(){N("")}})]})),r("div",t({className:"content-btn-container"},{children:r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(u,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,E({userID:h,remark:g,wording:k})];case 1:return t.sent(),D(!0),[2]}}))}))}},{children:p("TUIContact.Send application")}))}))]}))]})}var f=a.memo(u);export{f as AddFriendInfo,u as UnMemoizedAddFriendInfo};
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 e}from"tslib";import{jsx as r,jsxs as t}from"react/jsx-runtime";import a from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as i}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import{Avatar as n}from"../../Avatar/Avatar.js";import{defaultUserAvatar as s}from"../../Avatar/default.js";function o(a){var o=a.profile,m=i().t,d=o.userID,c=o.nick,l=o.selfSignature,h=o.avatar;return r("div",e({className:"tui-contact-info-header"},{children:t("div",e({className:"header-container"},{children:[t("div",e({className:"header-container-avatar"},{children:[r(n,{size:60,image:h||s}),r("div",e({className:"header-container-name"},{children:c||d}))]})),r("div",e({className:"header-container-text"},{children:"ID:".concat(d)})),t("div",e({className:"header-container-text"},{children:[m("TUIContact.Signature"),":",l||""]}))]}))}))}var m=a.memo(o);export{m as BasicInfo,o as UnMemoizedBasicInfo};
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 e,__generator as o}from"tslib";import{jsxs as n,Fragment as i,jsx as r}from"react/jsx-runtime";import s,{useState as c,useEffect as m}from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as a}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import{useTUIKitContext as l}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}from"./basicInfo.js";import{Switch as f}from"../../Switch/Switch.js";import u from"./hooks/useContactInfo.js";function p(s){var p=this,h=s.profile,x=l("TUIContact"),j=x.contactData,v=x.setActiveContact,b=a().t,C=c(!1),I=C[0],T=C[1],g=u().removeFromBlocklist;m((function(){T(!0)}),[j]);return n(i,{children:[r(d,{profile:h}),r("div",t({className:"tui-contact-info-content"},{children:n("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:b("TUIContact.block")})),r(f,{className:"content-item-text",onChange:function(){return e(p,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,g(h.userID)];case 1:return t.sent(),T(!1),v(),[2]}}))}))},checked:I})]}))}))]})}var h=s.memo(p);export{h as BlockInfo,p as UnMemoizedBlockInfo};
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 o from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as a}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import c from"@tencentcloud/chat";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{Avatar as s}from"../../Avatar/Avatar.js";import{defaultUserAvatar as m}from"../../Avatar/default.js";import d from"./hooks/useContactInfo.js";function l(o){var l=r("TUIContact").setActiveContact,p=a().t,f=o.application,h=f.userID,u=f.nick,v=f.avatar,N=f.type,x=f.wording,b=d(),I=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(s,{size:60,image:v||m}),i("div",t({className:"header-container-name"},{children:u||h}))]})),i("div",t({className:"header-container-text"},{children:"ID:".concat(h)}))]}))})),i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-item"},{children:[i("p",t({className:"content-item-label"},{children:p("TUIContact.verification info")})),i("p",t({className:"content-item-text"},{children:x}))]}))})),N===c.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(){l(),C(h)}},{children:p("TUIContact.Refuse")})),i("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){l(),I(h)}},{children:p("TUIContact.Agree")}))]}))}))]})}var p=o.memo(l);export{p as FriendApplicationInfo,l as UnMemoizedFriendApplication};
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 s,useEffect as a}from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as m}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import{useTUIKitContext as l}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}from"./basicInfo.js";import{Switch as u}from"../../Switch/Switch.js";import f from"./hooks/useContactInfo.js";import{DivWithEdit as h}from"../../DivWithEdit/DivWithEdit.js";import{useConversation as v}from"../../../hooks/useConversation.js";function p(c){var p=this,b=l("TUIContact"),C=b.chat,x=b.contactData,k=b.setActiveContact,I=b.setActiveConversation,j=m().t,N=c.friend,T=c.openChat,g=N.userID,U=N.profile,D=N.remark,w=s(""),_=w[0],y=w[1],E=s(""),S=E[0],A=E[1],F=s(!1),M=F[0],W=F[1],B=f(),K=B.addToBlocklist,q=B.deleteFriend,z=v(C).createConversation;a((function(){W(!1),A(D)}),[x,D]);return o(i,{children:[r(d,{profile:U}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(h,{name:"remark",className:"content-item-text",value:S,type:"text",toggle:function(){y("remark")},isEdit:"remark"===_,confirm:function(t){C.updateFriend({userID:g,remark:null==t?void 0:t.value}),A(null==t?void 0:t.value),y("")},close:function(){y("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(u,{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,K(g)];case 1:return t.sent(),W(!0),k(),[2]}}))}))},checked:M})]})),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,q(g)];case 1:return t.sent(),k(),[2]}}))}))}},{children:j("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,z("C2C".concat(g))];case 1:return t=e.sent(),I(t),T(),[2]}}))}))}},{children:j("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(p);export{b as FriendInfo,p as UnMemoizedFriendInfo};
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 e}from"react/jsx-runtime";import n,{useState as a}from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as c}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import s from"@tencentcloud/chat";import{useTUIKitContext as o}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 n=o().setActiveContact,f=c().t,v=r("TUIContactList"),h=v.isShowContactList,N=v.friendList,I=v.blocklistProfile,x=v.friendApplicationList,C=l().acceptFriendApplication,b=a(!1),g=b[0],T=b[1],k=a(!1),j=k[0],A=k[1],_=a(!1),U=_[0],P=_[1];return h&&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:[e("p",t({className:"tui-contacts-list-title"},{children:f("TUIContact.New Contacts")})),e("div",t({className:"tui-contacts-list-icon"},{children:e("img",{src:g?p:u,alt:""})}))]})),g&&x.map((function(a,c){var o=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(),n({type:"friendApplication",data:a})}},{children:[e(m,{size:30,image:r||d}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[e("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||o})),""!==u&&e("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:u}))]}),p===s.TYPES.SNS_APPLICATION_SENT_BY_ME&&e("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:f("TUIContact.waiting for verification")})),p===s.TYPES.SNS_APPLICATION_SENT_TO_ME&&e("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),C(i),n()}(t,o)}},{children:f("TUIContact.Agree")}))]}))]}),o)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return P(!U)}},{children:[e("div",t({className:"tui-contacts-list-title"},{children:f("TUIContact.Blocked List")})),e("div",t({className:"tui-contacts-list-icon"},{children:e("img",{src:U?p:u,alt:""})}))]})),U&&I.map((function(a,c){var s=a.userID,o=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){n({type:"block",data:a})}},{children:[e(m,{size:30,image:o||d}),e("div",t({className:"tui-contacts-list-item-container"},{children:e("p",t({className:"tui-contacts-list-item-name"},{children:r||s}))}))]}),s)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return A(!j)}},{children:[e("div",t({className:"tui-contacts-list-title"},{children:f("TUIContact.Friend")})),e("div",t({className:"tui-contacts-list-icon"},{children:e("img",{src:j?p:u,alt:""})}))]})),j&&N.map((function(a,c){var s=a.profile,o=s.userID,r=s.avatar,l=s.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){n({type:"friend",data:a})}},{children:[e(m,{size:30,image:r||d}),e("div",t({className:"tui-contacts-list-item-container"},{children:e("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||o}))}))]}),o)}))]}))}var v=n.memo(f);export{v as TUIContactList};
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 o,jsx as n}from"react/jsx-runtime";import i,{useState as a}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as s}from"../../node_modules/react-i18next/dist/es/useTranslation.js";import{useTUIKitContext as c}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 d}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";import{Avatar as f}from"../Avatar/Avatar.js";import{defaultUserAvatar as v}from"../Avatar/default.js";import{Input as p}from"../Input/Input.js";function h(){var i=this,h=c("TUIContactSearch");h.chat;var I=h.setActiveContact,j=s().t,x=u("TUIContactList"),C=x.friendList,g=x.setShowContactList,b=a(!1),y=b[0],T=b[1],U=m(),k=U.checkFriend,N=U.isBlock,A=U.getUserProfile,D=a(""),w=D[0],S=D[1],_=a([]),F=_[0],L=_[1];return o("div",t({className:"tui-contact-search"},{children:[n(p,{className:"tui-contact-search-input",placeholder:j("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),T(!1),void L([]);T(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),g(!1)},onKeyDown:function(){return e(i,void 0,void 0,(function(){return r(this,(function(t){return w&&A(w).then((function(t){var e=t.data;L(e)})),[2]}))}))},prefix:n(d,{type:l.SEARCH,height:16,width:16})}),y&&0===F.length?n("div",t({className:"tui-contact-search-item"},{children:j("TUIContact.No Result")})):F.map((function(a,s){var c=a.userID,u=a.avatar,m=a.nick;return o("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=a,e(i,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,k(t)];case 1:return r.sent()?(e=C.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:[n(f,{size:30,image:u||v}),n("div",t({className:"search-item-name"},{children:m||c}))]}),c)}))]}))}var I=i.memo(h);export{I as TUIContactSearch,h as UnMemoizedTUIContactSearch};
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 e}from"tslib";import{jsx as o,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as i,useRef as s}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as a}from"../../node_modules/react-i18next/dist/es/useTranslation.js";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 u}from"../Icon/type.js";import"@tencentcloud/chat";import{useTUIConversationContext as C}from"../../context/TUIConversationContext.js";import{ConversationListContainer as d}from"../ConversationPreview/ConversationListContainer.js";import{ConversationSearchInput as p}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as f}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,g=r.Container,w=void 0===g?d:g,x=r.onConversationListUpdated,T=r.filterConversation,U=a().t,P=v("TUIConversationList"),N=P.chat,y=P.customClasses,S=P.conversation,b=P.setActiveConversation;P.setTUIProfileShow;var _=C("TUIConversationList").filterConversation,k=T||_,A=i(0),E=A[0],R=A[1],F=c(N,(function(e,o){e.length&&b(S)}),k),D=F.conversationList,G=F.setConversationList;I(G,x,(function(){return R((function(e){return e+1}))}),k);var K=i(""),M=K[0],O=K[1],V=i(D),q=V[0],z=V[1],B=i(!1),H=B[0],J=B[1],Q=s(null);return o("div",e({className:"tui-conversation ".concat(y||""),ref:Q},{children:H?o(h,{conversationList:D,setConversationCreated:J}):t(n,{children:[t("div",e({className:"tui-conversation-header"},{children:[o(p,{value:M,clearable:!0,onChange:function(e){var o,t;if(O(null===(o=e.target)||void 0===o?void 0:o.value),null===(t=e.target)||void 0===t?void 0:t.value){var n=D.filter((function(o){var t;return j(o).toLocaleLowerCase().includes(null===(t=e.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));z(n)}else z([])}}),o("div",e({className:"tui-conversation-create-icon"},{children:o(m,{onClick:function(){O(""),J(!0)},type:u.CREATE,height:24,width:24})}))]})),o(w,e({setConversationList:G},{children:0===D.length?t("div",e({className:"no-result"},{children:[o(m,{className:"no-result-icon",type:u.EFFORT,width:42,height:42}),o("div",e({className:"no-result-message"},{children:U("TUIConversation.No conversation")}))]})):M?o(f,{Preview:L,searchValue:M,result:q}):D.map((function(t){return o(l,e({},{activeConversation:S,conversation:t,setActiveConversation:b,Preview:L,conversationUpdateCount:E}),t.conversationID)}))}))]})}))}var g=r.memo(L);export{g as TUIConversationList,L as UnMemoTUIConversationList};
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 e,__generator as t}from"tslib";import{useState as n,useEffect as o,useCallback as i}from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as r}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";var a=function(a){var s=a.chat,c=a.activeConversation,l=a.language,u=r().i18n,d=n(c),v=d[0],m=d[1],f=n(),g=f[0],h=f[1],p=n(!1),I=p[0],w=p[1],x=n(!1),D=x[0],T=x[1],b=n(),j=b[0],y=b[1];o((function(){u.changeLanguage(l);e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,null==s?void 0:s.getMyProfile()];case 1:return e=t.sent(),h(null==e?void 0:e.data),[2]}}))}))}),[s,l]);var M=i((function(e){e&&(null==s||s.setMessageRead({conversationID:e.conversationID})),v&&e.conversationID!==v.conversationID&&w(!1),m(e)}),[s]);return o((function(){m(c)}),[c]),{conversation:v,contactData:j,setActiveConversation:M,myProfile:g,TUIManageShow:I,setTUIManageShow:w,TUIProfileShow:D,setTUIProfileShow:T,setActiveContact:function(e){y(e)}}};export{a as useTUIKit};
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,5 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- declare function TUIManage(): react_jsx_runtime.JSX.Element;
1
+ declare function TUIManage(): JSX.Element;
4
2
 
5
3
  export { TUIManage };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as a}from"../../node_modules/react-i18next/dist/es/useTranslation.js";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 m,defaultUserAvatar as c}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 u}from"../ConversationPreview/utils.js";import{useConversationUpdate as h}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as p}from"../../hooks/useConversation.js";function f(){var f=a().t,g=o(null),I=g[0],C=g[1],j=o(null),N=j[0],x=j[1],T=o(!1),U=T[0],k=T[1],D=o(0),w=D[0],b=D[1],A=v("TUIManage"),y=A.conversation,M=A.setActiveConversation,P=A.chat,S=A.TUIManageShow,_=A.setTUIManageShow;h(null,(function(){b((function(e){return e+1}))}));var L=p(P),z=L.pinConversation,E=L.deleteConversation;return t((function(){C(y),x(u(y)),k(!!y&&y.isPinned)}),[y,w]),S&&y&&n("div",e({className:"tui-manage"},{children:[n("div",e({className:"tui-manage-title"},{children:[i(r,{type:s.CANCEL,width:16,height:16,onClick:function(){_(!1)}}),i("span",{children:f("TUIConversation.Conversation Information")})]})),n("div",e({className:"tui-manage-container"},{children:[n("div",e({className:"tui-manage-info"},{children:[i("div",e({className:"info-avatar"},{children:i(l,{size:64,image:(null==N?void 0:N.avatar)||((null==N?void 0:N.groupID)?m:c)})})),i("div",e({className:"info-name"},{children:(null==N?void 0:N.nick)||(null==N?void 0:N.name)})),n("div",e({className:"info-id"},{children:["ID:",(null==N?void 0:N.userID)||(null==N?void 0:N.groupID)]}))]})),n("div",e({className:"tui-manage-handle"},{children:[n("div",e({className:"manage-handle-box"},{children:[i("div",e({className:"manage-handle-title"},{children:f("TUIConversation.Pin")})),i(d,{onChange:function(e){k(e.target.checked),z({conversationID:I.conversationID,isPinned:e.target.checked})},checked:U})]})),i("div",e({className:"manage-handle-box",role:"presentation",onClick:function(){E(I.conversationID),M(null)}},{children:i("div",e({className:"manage-handle-title red"},{children:f("TUIConversation.Delete")}))}))]}))]}))]}))}export{f as TUIManage};
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 s from"react";import o from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as E}from"./MessageFile.js";import{MessageImage as n}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as T}from"./MessageVideo.js";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import"../../constants.js";import{useTUIMessageContext as l}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as p}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var G,_=((G={})[o.TYPES.MSG_TEXT]=a,G[o.TYPES.MSG_FACE]=i,G[o.TYPES.MSG_IMAGE]=n,G[o.TYPES.MSG_AUDIO]=m,G[o.TYPES.MSG_VIDEO]=T,G[o.TYPES.MSG_FILE]=E,G[o.TYPES.MSG_CUSTOM]=r,G[o.TYPES.MSG_MERGER]=S,G[o.TYPES.MSG_LOCATION]=M,G);function f(s){var m,r=s.message,i=p({message:r}).context,E=l("MessageCustom"),n=E.CustemElement,M=E.TextElement,S=E.FaceElement,a=E.ImageElement,T=E.AudioElement,G=E.VideoElement,f=E.FileElement,u=E.MergerElement,c=E.LocationElement,d=((m={})[o.TYPES.MSG_TEXT]=M,m[o.TYPES.MSG_FACE]=S,m[o.TYPES.MSG_IMAGE]=a,m[o.TYPES.MSG_AUDIO]=T,m[o.TYPES.MSG_VIDEO]=G,m[o.TYPES.MSG_FILE]=f,m[o.TYPES.MSG_CUSTOM]=n,m[o.TYPES.MSG_MERGER]=u,m[o.TYPES.MSG_LOCATION]=c,m)[null==r?void 0:r.type]||_[null==r?void 0:r.type];return d&&t(d,e({context:i,message:r},{children:t(g,{message:r})}))}var u=s.memo(f);function c(s){return t(u,e({},s))}export{c as MessageContext};
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 i,useRef as t}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as l}from"../../node_modules/react-i18next/dist/es/useTranslation.js";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 u}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as m,MESSAGE_FLOW as p}from"../../constants.js";import"date-fns";import"date-fns/locale";import{useMessagePluginElement as g}from"./hooks/useMessagePluginElement.js";var v;function f(v){var f,S,w,y,M,T,C=v.plugins,x=v.showNumber,U=v.MoreIcon,E=v.config,I=l().t,N=i(""),j=N[0];N[1];var R=i({}),k=R[0],b=R[1],q=t(null),O=c("MessagePlugins"),P=O.message,D=O.plugin,_=u("MessageBubbleWithContext").messageListRef,F=h({message:P}),L=F.handleDelMessage,W=F.handleRevokeMessage,Y=F.handleReplyMessage,A=F.handleCopyMessage,V=F.handleResendMessage,B=F.handleForWardMessage,G={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===(T=null==D?void 0:D.config)||void 0===T?void 0:T.resend)},H=g({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(),W(e)},message:P,isShow:G.revoke.isShow&&(null==P?void 0:P.status)===m.SUCCESS&&P.flow===p.OUT,relateMessageType:G.revoke.relateMessageType}),Q=g({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(),L(e)},message:P,isShow:G.delete.isShow&&(null==P?void 0:P.status)===m.SUCCESS,relateMessageType:G.delete.relateMessageType}),X=g({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(),Y(e)},message:P,isShow:G.quote.isShow&&(null==P?void 0:P.status)===m.SUCCESS,relateMessageType:G.quote.relateMessageType}),z=g({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(),A(e)},message:P,isShow:G.copy.isShow&&(null==P?void 0:P.status)===m.SUCCESS,relateMessageType:G.copy.relateMessageType}),J=g({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(),V(e)},message:P,isShow:G.resend.isShow&&(null==P?void 0:P.status)!==m.SUCCESS,relateMessageType:G.resend.relateMessageType}),K=[H,X,g({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(),B(e)},message:P,isShow:G.forward.isShow&&(null==P?void 0:P.status)===m.SUCCESS,relateMessageType:G.forward.relateMessageType}),Q,J,z],Z=(C||(null==D?void 0:D.plugins)||K).filter((function(e){return e})),$=U||(null==D?void 0:D.MoreIcon)||o(a,{className:"icon-more",width:16,height:16,type:d.MORE}),ee=x||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==m.UNSEND&&o(r,{className:"message-plugin",customClass:j,style:k,ref:q,plugins:Z,showNumber:ee,MoreIcon:$,root:null==_?void 0:_.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
+ 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 s}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as r}from"../../node_modules/react-i18next/dist/es/useTranslation.js";import i from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as a}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function d(n){var d=n.message,c=r().t,u=m().operateMessage,p=s((function(){var e;u(((e={})[l.REVOKE]=d,e))}),[u]);return o("div",e({className:"bubble message-system message-revoke"},{children:[(null==d?void 0:d.flow)===a.IN&&t("span",{children:(null==d?void 0:d.nick)||(null==d?void 0:d.from)}),(null==d?void 0:d.flow)!==a.IN&&t("span",{children:c("TUIChat.You")}),t("span",{children:c("TUIChat.recalled a message")}),(null==d?void 0:d.flow)===a.OUT&&(null==d?void 0:d.type)===i.TYPES.MSG_TEXT&&t("span",e({className:"edit",role:"button",tabIndex:0,onClick:p},{children:c("TUIChat.Re-edit")}))]}))}var c=n.memo(d);function u(o){return t(c,e({},o))}export{u as MessageRevoke};
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 s from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import"../../constants.js";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function o(s){var o=s.message,m=r({message:o}).context;return t("div",e({className:"bubble message-system"},{children:t("div",{children:m})}))}var m=s.memo(o);function i(s){return t(m,e({},s))}export{i as MessageSystem};
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 e}from"tslib";import{jsx as t}from"react/jsx-runtime";import s from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import"../../constants.js";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function o(s){var o=s.message,m=r({message:o}).context;return t("div",e({className:"bubble message-tip"},{children:m.text}))}var m=s.memo(o);function i(s){return t(m,e({},s))}export{i as MessageTip};
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"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as n}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import{MESSAGE_FLOW as s,MESSAGE_OPERATE as o}from"../../../constants.js";import{useTUIKitContext as a}from"../../../context/TUIKitContext.js";import"react/jsx-runtime";import{useTUIChatActionContext as i}from"../../../context/TUIChatActionContext.js";import"../../../context/TUIMessageContext.js";import{Toast as l}from"../../Toast/index.js";var u=function(u){var d=u.message,c=u.handleError,m=i(),v=m.removeMessage,f=m.editLocalMessage,p=m.operateMessage,h=m.revokeMessage,g=n().t,x=a("useDeleteHandler").chat,y=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==d?void 0:d.ID)||!x||!v)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,x.deleteMessage([d])];case 2:return t.sent(),v(d),[3,4];case 3:if(e=t.sent(),!c)throw l({text:g("TUIChat.Error deleting message"),type:"error"}),new Error(e);return c({functionName:"deleteMessage",error:e}),[3,4];case 4:return[2]}}))}))}),[d]),M=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==d?void 0:d.ID)||!x||!f)return[2];t.label=1;case 1:return t.trys.push([1,6,,7]),h?[4,h(d)]:[3,3];case 2:return t.sent(),[3,5];case 3:return[4,x.revokeMessage(d)];case 4:t.sent(),t.label=5;case 5:return f(d),[3,7];case 6:if(e=t.sent(),!c)throw n=d.flow===s.OUT?g("TUIChat.The message recall exceeded the time limit (default 2 minutes)"):g("TUIChat.Error revoke Message"),l({text:n,type:"error"}),new Error(e);return c({functionName:"revokeMessage",error:e}),[3,7];case 7:return[2]}}))}))}),[d]),b=r((function(e){var t;e.preventDefault(),(null==d?void 0:d.ID)&&x&&p&&p(((t={})[o.QUOTE]=d,t))}),[d]),D=r((function(e){if(e.preventDefault(),navigator.clipboard)navigator.clipboard.writeText(d.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=d.payload.text,t.select(),document.execCommand("copy",!0),document.body.removeChild(t)}}),[d]),T=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(d)];case 1:return e=t.sent(),f(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.message),[3,3];case 2:if(r=t.sent(),!c)throw l({text:r,type:"error"}),new Error(r);return c({functionName:"resendMessage",error:r}),[3,3];case 3:return[2]}}))}))}),[d]),w=r((function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){return r.preventDefault(),(null==d?void 0:d.ID)&&x&&p?(p(((e={})[o.FORWARD]=d,e)),[2]):[2]}))}))}),[d]);return{handleDelMessage:y,handleRevokeMessage:M,handleReplyMessage:b,handleCopyMessage:D,handleResendMessage:T,handleForWardMessage:w}};export{u as useMessageHandler};
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 e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as t}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as l}from"../../node_modules/react-i18next/dist/es/useTranslation.js";import{EmojiPicker as r}from"./EmojiPicker.js";import{Plugins as s}from"../Plugins/index.js";import{useUploadElement as u}from"./hooks/useUploadElement.js";import{MESSAGE_TYPE_NAME as d}from"../../constants.js";import{useTUIMessageInputContext as p}from"../../context/TUIMessageInputContext.js";import{Icon as c}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,j,M=p("TUIMessageInputDefault"),x=M.sendUploadMessage,U=M.pluginConfig,y=l().t,T=a("TUIMessageInput").TUIMessageInputConfig,k=(null==U?void 0:U.plugins)||(null===(g=null==T?void 0:T.pluginConfig)||void 0===g?void 0:g.plugins)||[],E=(null==U?void 0:U.showNumber)||(null===(f=null==T?void 0:T.pluginConfig)||void 0===f?void 0:f.showNumber)||1,P=(null==U?void 0:U.MoreIcon)||(null===(v=null==T?void 0:T.pluginConfig)||void 0===v?void 0:v.MoreIcon),b=function(i,e,o){return"boolean"==typeof i?i:"boolean"==typeof e?e:o},N=b(null==U?void 0:U.isEmojiPicker,null===(h=null==T?void 0:T.pluginConfig)||void 0===h?void 0:h.isEmojiPicker,!0),w=b(null==U?void 0:U.isImagePicker,null===(I=null==T?void 0:T.pluginConfig)||void 0===I?void 0:I.isImagePicker,!0),V=b(null==U?void 0:U.isVideoPicker,null===(C=null==T?void 0:T.pluginConfig)||void 0===C?void 0:C.isVideoPicker,!0),D=b(null==U?void 0:U.isFilePicker,null===(j=null==T?void 0:T.pluginConfig)||void 0===j?void 0:j.isFilePicker,!0),F=t(null),_=w&&u({children:o("div",i({className:"input-plugin-item"},{children:[n(c,{width:20,height:20,type:m.IMAGE}),n("span",{children:y("TUIChat.Image")})]})),type:"image",accept:"image/*",onChange:function(i){F.current.closeMore(),x({file:i},d.IMAGE)}}),O=V&&u({children:o("div",i({className:"input-plugin-item"},{children:[n(c,{width:20,height:20,type:m.VIDEO}),n("span",{children:y("TUIChat.Video")})]})),type:"video",accept:"video/*",onChange:function(i){F.current.closeMore(),x({file:i},d.VIDEO)}}),A=D&&u({children:o("div",i({className:"input-plugin-item"},{children:[n(c,{width:20,height:20,type:m.DOCUMENT}),n("span",{children:y("TUIChat.File")})]})),type:"file",accept:"file/*",onChange:function(i){F.current.closeMore(),x({file:i},d.FILE)}}),G=e([N&&n(r,{}),_,O,A],k,!0).filter((function(i){return i}));return n(s,{ref:F,plugins:G,showNumber:E,MoreIcon:P})}export{g as InputPluginsDefalut};
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 o,jsxs as r}from"react/jsx-runtime";import{useState as i,useCallback as a,useEffect as n}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as s}from"../../node_modules/react-i18next/dist/es/useTranslation.js";import{useTUIChatActionContext as l}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 p,getDisplayTitle as v}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=s().t,x=i([]),b=x[0],k=x[1],F=i([]),D=F[0],T=F[1],y=i(""),A=y[0],L=y[1],M=l().operateMessage,U=w(),R=U.message,S=U.sendForwardMessage,_=U.conversationList,H=void 0===_?[]:_,z=a((function(e){var t;M(((t={})[g.FORWARD]=null,t))}),[M]),E=H,P=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([]),T([]),L("")}),[R]),R&&H.length>0&&o(c,e({onClick:z},{children:r("div",e({role:"button",tabIndex:0,className:"tui-forward",onClick:function(e){e.stopPropagation()}},{children:[r("header",e({className:"tui-forward-header"},{children:[o(d,{type:m.CANCEL,width:16,height:16,onClick:z}),o("h2",e({className:"tui-forward-title"},{children:j("TUIChat.Forward to")}))]})),o("div",e({className:"tui-forward-search"},{children:o(u,{className:"tui-forward-search-input",placeholder:"Search",clearable:!0,value:A,onChange:function(e){var t,o;if(L(null===(t=e.target)||void 0===t?void 0:t.value),null===(o=e.target)||void 0===o?void 0:o.value){var r=H.filter((function(t){var o,r=v(t).toLocaleLowerCase(),i=null===(o=e.target)||void 0===o?void 0:o.value.toLocaleLowerCase();return r.includes(i)}));T(r)}else T([])},prefix:o(d,{type:m.SEARCH,height:16,width:16})})})),r("main",e({className:"tui-forward-main"},{children:[A&&r("ul",e({className:"tui-forward-list"},{children:[o("h3",e({className:"tui-forward-list-title"},{children:j("TUIChat.Search Result")})),D.length>0&&D.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:P,id:"".concat(t.conversationID),value:t})]}),t.conversationID)})),0===D.length&&o("p",e({className:"no-result"},{children:j("TUIChat.No Result")}))]})),!A&&E.length>0&&o("ul",e({className:"tui-forward-list"},{children:E.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:P,id:"".concat(t.conversationID),value:t})]}),t.conversationID)}))}))]})),r("footer",e({className:"tui-forward-footer"},{children:[o("div",e({className:"tui-forward-footer-name"},{children:b.length>0&&(N=b,(null==N?void 0:N.map((function(e){return v(e)}))).toString())})),o("button",e({type:"button",className:"button",onClick:function(){var e;e=b,I?I({list:b,message:R}):S(b),z(e)},disabled:0===b.length},{children:j("TUIChat.Forward")}))]}))]}))}))}export{C as TUIForward};
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 s}from"react/jsx-runtime";import o from"react";import n from"@tencentcloud/chat";import{TUIMessageInputContextProvider as r}from"../../context/TUIMessageInputContext.js";import{useCreateMessageInputContext as i}from"./hooks/useCreateMessageInputContext.js";import{useMessageInputState as a}from"./hooks/useMessageInputState.js";import"../../constants.js";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";import"./hooks/useHandleQuoteMessage.js";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{EmptyStateIndicator as p}from"../EmptyStateIndicator/EmptyStateIndicator.js";import{InputQuoteDefalut as l}from"./InputQuoteDefalut.js";import{TUIMessageInputDefault as d}from"./TUIMessageInputDefault.js";import{InputPluginsDefalut as f}from"./InputPluginsDefalut.js";import{TUIForward as c}from"./TUIForward.js";import{Transmitter as I}from"./Transmitter.js";function g(s){var o=s.children,u=s.disabled,p=s.focus,l=s.pluginConfig,d=s.textareaRef,f=a(s),c=m("TUIMessageInput"),I=c.textareaRef,g=c.conversation,x=(null==g?void 0:g.type)===n.TYPES.CONV_SYSTEM,j=m("TUIMessageInput").TUIMessageInputConfig,T=p||(null==j?void 0:j.focus),h=i(t(t(t({},f),s),{textareaRef:d||(null==j?void 0:j.textareaRef)||I,disabled:u||(null==j?void 0:j.disabled)||x,focus:"boolean"!=typeof T||T,pluginConfig:l}));return e(r,t({value:h},{children:o}))}function x(o){var n=o.TUIMessageInput,r=o.InputPlugins,i=o.InputQuote,a=o.isTransmitter,x=o.className,j=m("TUIMessageInput").TUIMessageInputConfig,T=x||(null==j?void 0:j.className),h=a||(null==j?void 0:j.isTransmitter)||!1,v=u(),M=v.TUIMessageInput,C=v.InputPlugins,U=v.InputQuote,b=n||M||d,S=r||C||f||p,y=i||U||l;return e("div",t({className:"tui-message-input ".concat(T)},{children:s(g,t({},o,{children:[e(c,{}),e(y,{}),s("div",t({className:"tui-message-input-main"},{children:[s("div",t({className:"tui-message-input-box"},{children:[e(S,{}),e(b,{})]})),h&&e(I,{})]}))]}))}))}var j=o.memo(x);export{j as TUIMessageInput};
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"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as s}from"../../node_modules/react-i18next/dist/es/useTranslation.js";import{MESSAGE_OPERATE as i}from"../../constants.js";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useTUIMessageInputContext as u}from"../../context/TUIMessageInputContext.js";import{formatEmojiString as l}from"../TUIMessage/utils/emojiMap.js";function c(){var c=u("TUIMessageInputDefault"),d=c.text,m=c.disabled,p=c.handleChange,f=c.handleKeyDown,x=c.handlePasete,v=c.textareaRef,h=c.focus,g=c.setText,j=c.setCursorPos,b=s().t,I=a("TUIMessageInputDefault").operateData;o((function(){I[i.REVOKE]&&g(l(I[i.REVOKE].payload.text,1))}),[I]),o((function(){var t,e;return h&&v.current&&(v.current.autofocus=!0,null===(t=null==v?void 0:v.current)||void 0===t||t.focus(),null===(e=null==v?void 0:v.current)||void 0===e||e.addEventListener("paste",x)),function(){var t;null===(t=null==v?void 0:v.current)||void 0===t||t.removeEventListener("paste",x)}}),[h]);var T=r(!1),C=T[0],E=T[1];return e("div",t({className:"input-box ".concat(m?"disabled":""," ").concat(C?"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:v,onChange:p,onKeyDown:f,onFocus:function(t){E(!0)},onBlur:function(t){j({start:t.target.selectionStart,end:t.target.selectionEnd}),E(!1)}})]}))}export{c as TUIMessageInputDefault};
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 e}from"react";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as t}from"../../../node_modules/react-i18next/dist/es/useTranslation.js";import"tslib";import"react/jsx-runtime";import{useTUIChatActionContext as s}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=t().i18n,a=s(),m=a.sendMessage,d=a.createFaceMessage;return{onSelectEmoji:function(e){"en"===i.language?n(e.data):n(o[e.data])},sendFaceMessage:e((function(e){var t=d({payload:e});m(t)}),[])}}export{r as useEmojiPicker};
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 s}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import n,{useState as l,useEffect as r}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as a}from"../../node_modules/react-i18next/dist/es/useTranslation.js";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as d}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as c}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 p(n){var p=this,v=n.messageList,I=n.highlightedMessageId,M=n.loadMore,T=n.intervalsTimer,x=n.className,L=a().t,j=l(null),C=j[0],S=j[1],U=l(!1),b=U[0],y=U[1],E=m("TUIMessageList"),N=E.messageList,k=E.highlightedMessageId,_=E.isCompleted,w=E.isSameLastMessageID,H=E.messageListRef,V=E.noMore,q=E.TUIMessageListConfig,A=d(),D=A.loadMore,P=A.setHighlightedMessageId,R=c(),z=R.TUIMessage,B=R.EmptyStateIndicator,F=void 0===B?f:B,G=I||(null==q?void 0:q.highlightedMessageId)||k,J=60*(T||(null==q?void 0:q.intervalsTimer)||30),K=h({messageList:v||(null==q?void 0:q.messageList)||N}).messageList,O=M||(null==q?void 0:q.loadMore)||D,Q=g({enrichedMessageList:K,TUIMessage:z,intervalsTimer:J});return r((function(){t(p,void 0,void 0,(function(){var e,t,i,o,n;return s(this,(function(s){switch(s.label){case 0:return e=null===(n=null==C?void 0:C.parentElement)||void 0===n?void 0:n.parentElement,!_&&(null==e?void 0:e.clientHeight)>=(null==C?void 0:C.clientHeight)?[4,O()]:[3,2];case 1:s.sent(),s.label=2;case 2:return!(null==C?void 0:C.children)||b&&w||(t=(null==C?void 0:C.children)||[],i=t[t.length-1],o=setTimeout((function(){null==i||i.scrollIntoView({block:"end"}),y(!0),clearTimeout(o)}),100)),[2]}}))}))}),[Q,b]),r((function(){if(G){var e=null==C?void 0:C.querySelector("[data-message-id='".concat(G,"']"));if(!e)return;var t=e.children;t[t.length-1].classList.add("high-lighted"),null==e||e.scrollIntoView({block:"center"});var s=setTimeout((function(){t[t.length-1].classList.remove("high-lighted"),clearTimeout(s),P("")}),1e3)}}),[G]),o("div",e({className:"message-list ".concat(x," ").concat(b?"":"hide"),ref:H},{children:[V,V&&i("p",e({className:"no-more"},{children:L("TUIChat.No More")})),i(u,e({className:"message-list-infinite-scroll",hasMore:!0,loadMore:O,threshold:1},{children:i("ul",e({ref:S},{children:(null==Q?void 0:Q.length)>0?Q:i(F,{listType:"message"})}))}))]}))}var v=n.memo(p);function I(t){return i(v,e({},t))}export{I as TUIMessageList};
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 t}from"react/jsx-runtime";import a,{useState as i}from"react";import"../../node_modules/@babel/runtime/helpers/extends.js";import"../../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../../node_modules/react-i18next/dist/es/context.js";import{useTranslation as n}from"../../node_modules/react-i18next/dist/es/useTranslation.js";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 d}from"../Avatar/Avatar.js";import{DivWithEdit as u}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 _(a){var r,p,f,_,y,P,k=a.userInfo,A=a.className,Y=a.update,b=n().t,L=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:b((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(t,a){var i="".concat(t.value).concat(a);return l("li",e({className:"select-list-item",role:"menuitem",tabIndex:a,onClick:function(){M(t)}},{children:b("TUIProfile.".concat(t.label))}),i)}))}))},{name:"AllowType",value:b("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(t,a){var i="".concat(t.value).concat(a);return l("li",e({className:"select-list-item",role:"menuitem",tabIndex:a,onClick:function(){j(t)}},{children:b("TUIProfile.".concat(t.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){O(e)},value:function(e){if(8===(null==e?void 0:e.length)){var l=Number(e.slice(0,4)),t=Number(e.slice(4,6)),a=Number(e.slice(-2));return new Date(l,t-1,a)}return new Date}("".concat(null==k?void 0:k.birthday))})}],C=function(e){w(e)},x=function(e){Y(e),w("")},U=function(e){var l,t="";switch(null==e?void 0:e.name){case"nick":t="nick";break;case"Signature":t="selfSignature";break;default:return void w("")}var a=((l={})[t]=e.value,l);x(a)},M=function(e){x({gender:e.value})},j=function(e){x({allowType:e.value})},O=function(e){var l,t,a,i;x({birthday:Number((l=e,t=l.getDate()>9?l.getDate():"0".concat(l.getDate()),a=l.getMonth()>8?l.getMonth()+1:"0".concat(l.getMonth()+1),i=l.getFullYear(),"".concat(i).concat(a).concat(t)))})};return t("div",e({className:"".concat(A," tui-profile")},{children:[t("header",e({className:"tui-profile-header"},{children:[l(s,{width:9,height:16,type:m.BACK,onClick:function(){L(!1)}}),l("h1",{children:b("TUIProfile.Personal information")})]})),t("main",e({className:"tui-profile-main"},{children:[l("div",e({className:"tui-profile-avatar"},{children:l(d,{image:v(null==k?void 0:k.avatar),size:94,update:function(e){x({avatar:e})},list:N})})),l(u,{name:"nick",className:"tui-profile-nick",value:null==k?void 0:k.nick,type:"text",toggle:C,isEdit:"nick"===I,confirm:U,close:function(){w("")}}),t("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(a){var i="".concat(a.name);return t("li",e({className:"tui-profile-list-item"},{children:[l("h4",{children:b("TUIProfile.".concat(a.name))}),l(u,e({className:"tui-profile-div-with-edit",classEditName:"tui-profile-edit",name:a.name,value:null==a?void 0:a.value,type:a.type,toggle:C,isEdit:I===a.name,confirm:U,close:function(){w("")}},{children:null==a?void 0:a.children}))]}),i)}))}))]}))}var y=a.memo(_);function P(t){var a=e({},t);return l(y,e({},a))}export{P as TUIProfileDefault};
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
- }>): react_jsx_runtime.JSX.Element;
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 e}from"tslib";import{jsx as o}from"react/jsx-runtime";import t,{useContext as s}from"react";import"../node_modules/@babel/runtime/helpers/extends.js";import"../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../node_modules/react-i18next/dist/es/context.js";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 o(r.Provider,e({value:i},{children:s||o(n,{})}))}var m=function(e){var o=s(r);return!o&&e?{}:o};export{r as TUIConversationContext,i as TUIConversationProvider,m as useTUIConversationContext};
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};
@@ -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";
@@ -0,0 +1,6 @@
1
+ import i18next from 'i18next';
2
+ export { default as i18next } from 'i18next';
3
+
4
+ declare const t: i18next.TFunction<["translation", ...string[]], undefined>;
5
+
6
+ export { t };
@@ -1 +1 @@
1
- import e from"../node_modules/i18next/dist/esm/i18next.js";export{default}from"../node_modules/i18next/dist/esm/i18next.js";import"react";import"../node_modules/@babel/runtime/helpers/extends.js";import"../node_modules/html-parse-stringify/dist/html-parse-stringify.js";import"../node_modules/react-i18next/dist/es/context.js";import{initReactI18next as t}from"../node_modules/react-i18next/dist/es/initReactI18next.js";import{message as s}from"./en/index.js";import{message as i}from"./zh_cn/index.js";var n={en:{translation:s},zh:{translation:i}};e.use(t).init({resources:n,lng:"zh",interpolation:{escapeValue:!1}});
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.0",
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
@@ -51,7 +51,7 @@ export default [
51
51
  typescript(),
52
52
  terser(),
53
53
  ],
54
- external: ['react', 'date-fns', 'tslib', 'react-date-picker'],
54
+ external: ['react', 'date-fns', 'tslib', 'react-date-picker', 'i18next', 'react-i18next'],
55
55
  },
56
56
  {
57
57
  ...baseConfig,