@tencentcloud/chat-uikit-react 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.0.3] (2023-05-25)
2
+
3
+ #### fix
4
+ * fix: TUIMessageList className
5
+ * fix: DatePicker onchange value type
6
+ * fix: github demo start
7
+
1
8
  ## [1.0.2] (2023-03-13)
2
9
 
3
10
  #### feat
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),a=require("../Input/Input.js"),s=require("../Icon/Icon.js"),n=require("../Icon/type.js"),i=require("../Avatar/Avatar.js"),o=require("../Avatar/default.js"),u=require("./ConversationCreate.js"),c=require("./ConversationGroupTypeInfo.js"),p=require("../../context/TUIKitContext.js");require("../../context/TUIMessageContext.js"),exports.ConversationCreatGroupDetail=function(l){var d=this,g=l.profileList,v=l.pageState,x=l.setPageState,_=l.createConversation,m=l.setConversationCreated,f=p.useTUIKitContext(),h=f.setActiveConversation,j=f.myProfile,C=e.__spreadArray([],g,!0);C.unshift(j);var I=C.map((function(e){return e.nick||e.userID})).toString(),y=r.useState(I.length>=15?"".concat(I.slice(0,12),"..."):I),b=y[0],N=y[1],G=r.useState(""),A=G[0],T=G[1],q=r.useState("Work"),P=q[0],k=q[1],S=function(e,t){var r=e.target.value;switch(t){case"name":N(r);break;case"id":T(r);break;case"type":k(r)}};return v!==u.PageStateTypes.GROUP_TYPE?t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:"tui-conversation-create-group-detail"},{children:[t.jsx("div",e.__assign({className:"create-group-box create-group-name"},{children:t.jsx(a.Input,{maxLength:15,value:b,onChange:function(e){S(e,"name")},border:"bottom",customClassName:"input-group-name",clearable:!0,prefix:t.jsx("div",e.__assign({className:"input-group-title"},{children:"Group Name"}))})})),t.jsx("div",e.__assign({className:"create-group-box create-group-id"},{children:t.jsx(a.Input,{border:"bottom",customClassName:"input-group-text",clearable:!0,value:A,onChange:function(e){S(e,"id")},prefix:t.jsx("div",e.__assign({className:"input-group-title"},{children:"Group ID"}))})})),t.jsx("div",e.__assign({className:"create-group-box create-group-type"},{children:t.jsx(a.Input,{disabled:!0,border:"bottom",customClassName:"input-group-text",prefix:t.jsx("div",e.__assign({className:"input-group-title"},{children:"Group of type"})),suffix:t.jsx(s.Icon,{onClick:function(){x(u.PageStateTypes.GROUP_TYPE)},type:n.IconTypes.ARROW_RIGHT,width:7,height:12}),value:P,onChange:function(e){S(e,"type")}})})),t.jsx("div",e.__assign({className:"create-group-illustrate"},{children:c.typeInfoList.find((function(e){return e.type===P})).des})),t.jsxs("div",e.__assign({className:"create-group-portrait"},{children:[t.jsx("div",e.__assign({className:"create-group-portrait-title"},{children:"Participants"})),t.jsx("div",e.__assign({className:"create-group-portrait-info-container"},{children:g.map((function(r){var a=r.avatar,s=r.userID,n=r.nick;return t.jsxs("div",e.__assign({className:"create-group-portrait-info"},{children:[t.jsx(i.Avatar,{shape:"square",size:50,image:a||o.defaultUserAvatar}),t.jsx("div",e.__assign({className:"create-group-portrait-info-nick"},{children:n}))]}),s)}))}))]}))]})),t.jsx("div",e.__assign({className:"tui-conversation-create-next-container"},{children:t.jsx("div",e.__assign({role:"presentation",className:"tui-conversation-create-next",onClick:function(){return e.__awaiter(d,void 0,void 0,(function(){var t,r;return e.__generator(this,(function(e){switch(e.label){case 0:return t=function(e){switch(e){case"Work":return o.defaultGroupAvatarWork;case"Public":return o.defaultGroupAvatarPublic;case"Meeting":return o.defaultGroupAvatarMeeting;case"AVChatRoom":return o.defaultGroupAvatarAVChatRoom;default:return""}}(P),[4,_({name:b,type:c.GroupType[P],groupID:A,avatar:t})];case 1:return r=e.sent(),h(r),m(!1),[2]}}))}))}},{children:"Create"}))}))]}):t.jsx(c.ConversationGroupTypeInfo,{groupType:P,setGroupType:k,setPageState:x})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),a=require("../Input/Input.js"),s=require("../Icon/Icon.js"),n=require("../Icon/type.js"),i=require("../Avatar/Avatar.js"),o=require("../Avatar/default.js"),u=require("./ConversationCreate.js"),c=require("./ConversationGroupTypeInfo.js"),p=require("../../context/TUIKitContext.js");require("../../context/TUIMessageContext.js"),exports.ConversationCreatGroupDetail=function(l){var d=this,g=l.profileList,v=l.pageState,m=l.setPageState,x=l.createConversation,_=l.setConversationCreated,f=p.useTUIKitContext(),h=f.setActiveConversation,j=f.myProfile,C=e.__spreadArray([],g,!0);C.unshift(j);var I=C.map((function(e){return e.nick||e.userID})).toString(),b=r.useState(I.length>=15?"".concat(I.slice(0,12),"..."):I),y=b[0],N=b[1],G=r.useState(""),A=G[0],T=G[1],q=r.useState("Work"),P=q[0],k=q[1],S=function(e,t){var r=e.target.value;switch(t){case"name":N(r);break;case"id":T(r);break;case"type":k(r)}};return v!==u.PageStateTypes.GROUP_TYPE?t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:"tui-conversation-create-group-detail"},{children:[t.jsx("div",e.__assign({className:"create-group-box create-group-name"},{children:t.jsx(a.Input,{maxLength:15,value:y,onChange:function(e){S(e,"name")},border:"bottom",customClassName:"input-group-name",clearable:!0,prefix:t.jsx("div",e.__assign({className:"input-group-title"},{children:"Group Name"}))})})),t.jsx("div",e.__assign({className:"create-group-box create-group-id"},{children:t.jsx(a.Input,{border:"bottom",customClassName:"input-group-text",clearable:!0,value:A,onChange:function(e){S(e,"id")},prefix:t.jsx("div",e.__assign({className:"input-group-title"},{children:"Group ID"}))})})),t.jsx("div",e.__assign({className:"create-group-box create-group-type"},{children:t.jsx(a.Input,{disabled:!0,border:"bottom",customClassName:"input-group-text",prefix:t.jsx("div",e.__assign({className:"input-group-title"},{children:"Group of type"})),suffix:t.jsx(s.Icon,{onClick:function(){m(u.PageStateTypes.GROUP_TYPE)},type:n.IconTypes.ARROW_RIGHT,width:7,height:12}),value:P,onChange:function(e){S(e,"type")}})})),t.jsx("div",e.__assign({className:"create-group-illustrate"},{children:c.typeInfoList.find((function(e){return e.type===P})).des})),t.jsxs("div",e.__assign({className:"create-group-portrait"},{children:[t.jsx("div",e.__assign({className:"create-group-portrait-title"},{children:"Participants"})),t.jsx("div",e.__assign({className:"create-group-portrait-info-container"},{children:g.map((function(r){var a=r.avatar,s=r.userID,n=r.nick;return t.jsxs("div",e.__assign({className:"create-group-portrait-info"},{children:[t.jsx(i.Avatar,{shape:"square",size:50,image:a||o.defaultUserAvatar}),t.jsx("div",e.__assign({className:"create-group-portrait-info-nick"},{children:n}))]}),s)}))}))]}))]})),t.jsx("div",e.__assign({className:"tui-conversation-create-next-container"},{children:t.jsx("div",e.__assign({role:"presentation",className:"tui-conversation-create-next",onClick:function(){return e.__awaiter(d,void 0,void 0,(function(){var t,r,a;return e.__generator(this,(function(e){switch(e.label){case 0:return t=g.map((function(e){return{userID:e.userID}})),r=function(e){switch(e){case"Work":return o.defaultGroupAvatarWork;case"Public":return o.defaultGroupAvatarPublic;case"Meeting":return o.defaultGroupAvatarMeeting;case"AVChatRoom":return o.defaultGroupAvatarAVChatRoom;default:return""}}(P),[4,x({name:y,type:c.GroupType[P],groupID:A,avatar:r,memberList:t})];case 1:return a=e.sent(),h(a),_(!1),[2]}}))}))}},{children:"Create"}))}))]}):t.jsx(c.ConversationGroupTypeInfo,{groupType:P,setGroupType:k,setPageState:m})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("react"),i=require("../../context/TUIChatStateContext.js"),n=require("../../context/TUIChatActionContext.js");require("../../context/TUIMessageContext.js");var r=require("../../context/ComponentContext.js"),l=require("./hooks/useEnrichedMessageList.js"),a=require("./hooks/useMessageListElement.js"),o=require("../InfiniteScrollPaginator/InfiniteScroll.js"),u=require("../EmptyStateIndicator/EmptyStateIndicator.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(c){var d=this,g=c.messageList,h=c.highlightedMessageId,m=c.loadMore,v=c.intervalsTimer,f=s.useState(null),I=f[0],M=f[1],x=s.useState(!1),T=x[0],j=x[1],_=i.useTUIChatStateContext("TUIMessageList"),p=_.messageList,C=_.highlightedMessageId,L=_.isCompleted,S=_.isSameLastMessageID,q=_.messageListRef,E=_.noMore,U=_.TUIMessageListConfig,y=n.useTUIChatActionContext(),b=y.loadMore,k=y.setHighlightedMessageId,w=r.useComponentContext(),N=w.TUIMessage,H=w.EmptyStateIndicator,A=void 0===H?u.EmptyStateIndicator:H,P=h||(null==U?void 0:U.highlightedMessageId)||C,V=60*(v||(null==U?void 0:U.intervalsTimer)||30),D=l({messageList:g||(null==U?void 0:U.messageList)||p}).messageList,O=m||(null==U?void 0:U.loadMore)||b,R=a({enrichedMessageList:D,TUIMessage:N,intervalsTimer:V});return s.useEffect((function(){e.__awaiter(d,void 0,void 0,(function(){var t,s,i,n,r;return e.__generator(this,(function(e){switch(e.label){case 0:return t=null===(r=null==I?void 0:I.parentElement)||void 0===r?void 0:r.parentElement,!L&&(null==t?void 0:t.clientHeight)>=(null==I?void 0:I.clientHeight)?[4,O()]:[3,2];case 1:e.sent(),e.label=2;case 2:return!(null==I?void 0:I.children)||T&&S||(s=(null==I?void 0:I.children)||[],i=s[s.length-1],n=setTimeout((function(){null==i||i.scrollIntoView({block:"end"}),j(!0),clearTimeout(n)}),100)),[2]}}))}))}),[R,T]),s.useEffect((function(){if(P){var e=null==I?void 0:I.querySelector("[data-message-id='".concat(P,"']"));if(!e)return;var t=e.children[1].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),k("")}),1e3)}}),[P]),t.jsxs("div",e.__assign({className:"message-list ".concat(T?"":"hide"),ref:q},{children:[E,E&&t.jsx("p",e.__assign({className:"no-more"},{children:"No More"})),t.jsx(o.InfiniteScroll,e.__assign({className:"message-list-infinite-scroll",hasMore:!0,loadMore:O,threshold:1},{children:t.jsx("ul",e.__assign({ref:M},{children:(null==R?void 0:R.length)>0?R:t.jsx(A,{listType:"message"})}))}))]}))}var g=c(s).default.memo(d);exports.TUIMessageList=function(s){return t.jsx(g,e.__assign({},s))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("react"),i=require("../../context/TUIChatStateContext.js"),n=require("../../context/TUIChatActionContext.js");require("../../context/TUIMessageContext.js");var r=require("../../context/ComponentContext.js"),a=require("./hooks/useEnrichedMessageList.js"),l=require("./hooks/useMessageListElement.js"),o=require("../InfiniteScrollPaginator/InfiniteScroll.js"),c=require("../EmptyStateIndicator/EmptyStateIndicator.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(u){var d=this,g=u.messageList,h=u.highlightedMessageId,m=u.loadMore,v=u.intervalsTimer,f=u.className,I=s.useState(null),M=I[0],x=I[1],T=s.useState(!1),j=T[0],_=T[1],p=i.useTUIChatStateContext("TUIMessageList"),C=p.messageList,L=p.highlightedMessageId,S=p.isCompleted,q=p.isSameLastMessageID,E=p.messageListRef,U=p.noMore,y=p.TUIMessageListConfig,b=n.useTUIChatActionContext(),N=b.loadMore,k=b.setHighlightedMessageId,w=r.useComponentContext(),H=w.TUIMessage,A=w.EmptyStateIndicator,P=void 0===A?c.EmptyStateIndicator:A,V=h||(null==y?void 0:y.highlightedMessageId)||L,D=60*(v||(null==y?void 0:y.intervalsTimer)||30),O=a({messageList:g||(null==y?void 0:y.messageList)||C}).messageList,R=m||(null==y?void 0:y.loadMore)||N,z=l({enrichedMessageList:O,TUIMessage:H,intervalsTimer:D});return s.useEffect((function(){e.__awaiter(d,void 0,void 0,(function(){var t,s,i,n,r;return e.__generator(this,(function(e){switch(e.label){case 0:return t=null===(r=null==M?void 0:M.parentElement)||void 0===r?void 0:r.parentElement,!S&&(null==t?void 0:t.clientHeight)>=(null==M?void 0:M.clientHeight)?[4,R()]:[3,2];case 1:e.sent(),e.label=2;case 2:return!(null==M?void 0:M.children)||j&&q||(s=(null==M?void 0:M.children)||[],i=s[s.length-1],n=setTimeout((function(){null==i||i.scrollIntoView({block:"end"}),_(!0),clearTimeout(n)}),100)),[2]}}))}))}),[z,j]),s.useEffect((function(){if(V){var e=null==M?void 0:M.querySelector("[data-message-id='".concat(V,"']"));if(!e)return;var t=e.children[1].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),k("")}),1e3)}}),[V]),t.jsxs("div",e.__assign({className:"message-list ".concat(f," ").concat(j?"":"hide"),ref:E},{children:[U,U&&t.jsx("p",e.__assign({className:"no-more"},{children:"No More"})),t.jsx(o.InfiniteScroll,e.__assign({className:"message-list-infinite-scroll",hasMore:!0,loadMore:R,threshold:1},{children:t.jsx("ul",e.__assign({ref:x},{children:(null==z?void 0:z.length)>0?z:t.jsx(P,{listType:"message"})}))}))]}))}var g=u(s).default.memo(d);exports.TUIMessageList=function(s){return t.jsx(g,e.__assign({},s))};
@@ -1 +1 @@
1
- import{__spreadArray as e,__assign as t,__awaiter as r,__generator as a}from"tslib";import{jsxs as o,Fragment as i,jsx as n}from"react/jsx-runtime";import{useState as c}from"react";import{Input as s}from"../Input/Input.js";import{Icon as u}from"../Icon/Icon.js";import{IconTypes as p}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultUserAvatar as m,defaultGroupAvatarAVChatRoom as d,defaultGroupAvatarMeeting as f,defaultGroupAvatarPublic as v,defaultGroupAvatarWork as g}from"../Avatar/default.js";import{PageStateTypes as h}from"./ConversationCreate.js";import{ConversationGroupTypeInfo as C,typeInfoList as N,GroupType as x}from"./ConversationGroupTypeInfo.js";import{useTUIKitContext as b}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function I(I){var y=this,j=I.profileList,k=I.pageState,P=I.setPageState,G=I.createConversation,T=I.setConversationCreated,A=b(),R=A.setActiveConversation,w=A.myProfile,D=e([],j,!0);D.unshift(w);var S=D.map((function(e){return e.nick||e.userID})).toString(),U=c(S.length>=15?"".concat(S.slice(0,12),"..."):S),O=U[0],W=U[1],_=c(""),E=_[0],L=_[1],M=c("Work"),Y=M[0],q=M[1],z=function(e,t){var r=e.target.value;switch(t){case"name":W(r);break;case"id":L(r);break;case"type":q(r)}};return k!==h.GROUP_TYPE?o(i,{children:[o("div",t({className:"tui-conversation-create-group-detail"},{children:[n("div",t({className:"create-group-box create-group-name"},{children:n(s,{maxLength:15,value:O,onChange:function(e){z(e,"name")},border:"bottom",customClassName:"input-group-name",clearable:!0,prefix:n("div",t({className:"input-group-title"},{children:"Group Name"}))})})),n("div",t({className:"create-group-box create-group-id"},{children:n(s,{border:"bottom",customClassName:"input-group-text",clearable:!0,value:E,onChange:function(e){z(e,"id")},prefix:n("div",t({className:"input-group-title"},{children:"Group ID"}))})})),n("div",t({className:"create-group-box create-group-type"},{children:n(s,{disabled:!0,border:"bottom",customClassName:"input-group-text",prefix:n("div",t({className:"input-group-title"},{children:"Group of type"})),suffix:n(u,{onClick:function(){P(h.GROUP_TYPE)},type:p.ARROW_RIGHT,width:7,height:12}),value:Y,onChange:function(e){z(e,"type")}})})),n("div",t({className:"create-group-illustrate"},{children:N.find((function(e){return e.type===Y})).des})),o("div",t({className:"create-group-portrait"},{children:[n("div",t({className:"create-group-portrait-title"},{children:"Participants"})),n("div",t({className:"create-group-portrait-info-container"},{children:j.map((function(e){var r=e.avatar,a=e.userID,i=e.nick;return o("div",t({className:"create-group-portrait-info"},{children:[n(l,{shape:"square",size:50,image:r||m}),n("div",t({className:"create-group-portrait-info-nick"},{children:i}))]}),a)}))}))]}))]})),n("div",t({className:"tui-conversation-create-next-container"},{children:n("div",t({role:"presentation",className:"tui-conversation-create-next",onClick:function(){return r(y,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=function(e){switch(e){case"Work":return g;case"Public":return v;case"Meeting":return f;case"AVChatRoom":return d;default:return""}}(Y),[4,G({name:O,type:x[Y],groupID:E,avatar:e})];case 1:return t=r.sent(),R(t),T(!1),[2]}}))}))}},{children:"Create"}))}))]}):n(C,{groupType:Y,setGroupType:q,setPageState:P})}export{I as ConversationCreatGroupDetail};
1
+ import{__spreadArray as e,__assign as t,__awaiter as r,__generator as a}from"tslib";import{jsxs as i,Fragment as o,jsx as n}from"react/jsx-runtime";import{useState as c}from"react";import{Input as s}from"../Input/Input.js";import{Icon as u}from"../Icon/Icon.js";import{IconTypes as p}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultUserAvatar as m,defaultGroupAvatarAVChatRoom as d,defaultGroupAvatarMeeting as f,defaultGroupAvatarPublic as v,defaultGroupAvatarWork as g}from"../Avatar/default.js";import{PageStateTypes as h}from"./ConversationCreate.js";import{ConversationGroupTypeInfo as C,typeInfoList as N,GroupType as b}from"./ConversationGroupTypeInfo.js";import{useTUIKitContext as x}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function I(I){var y=this,j=I.profileList,k=I.pageState,P=I.setPageState,G=I.createConversation,T=I.setConversationCreated,A=x(),D=A.setActiveConversation,R=A.myProfile,w=e([],j,!0);w.unshift(R);var S=w.map((function(e){return e.nick||e.userID})).toString(),U=c(S.length>=15?"".concat(S.slice(0,12),"..."):S),L=U[0],O=U[1],W=c(""),_=W[0],E=W[1],M=c("Work"),Y=M[0],q=M[1],z=function(e,t){var r=e.target.value;switch(t){case"name":O(r);break;case"id":E(r);break;case"type":q(r)}};return k!==h.GROUP_TYPE?i(o,{children:[i("div",t({className:"tui-conversation-create-group-detail"},{children:[n("div",t({className:"create-group-box create-group-name"},{children:n(s,{maxLength:15,value:L,onChange:function(e){z(e,"name")},border:"bottom",customClassName:"input-group-name",clearable:!0,prefix:n("div",t({className:"input-group-title"},{children:"Group Name"}))})})),n("div",t({className:"create-group-box create-group-id"},{children:n(s,{border:"bottom",customClassName:"input-group-text",clearable:!0,value:_,onChange:function(e){z(e,"id")},prefix:n("div",t({className:"input-group-title"},{children:"Group ID"}))})})),n("div",t({className:"create-group-box create-group-type"},{children:n(s,{disabled:!0,border:"bottom",customClassName:"input-group-text",prefix:n("div",t({className:"input-group-title"},{children:"Group of type"})),suffix:n(u,{onClick:function(){P(h.GROUP_TYPE)},type:p.ARROW_RIGHT,width:7,height:12}),value:Y,onChange:function(e){z(e,"type")}})})),n("div",t({className:"create-group-illustrate"},{children:N.find((function(e){return e.type===Y})).des})),i("div",t({className:"create-group-portrait"},{children:[n("div",t({className:"create-group-portrait-title"},{children:"Participants"})),n("div",t({className:"create-group-portrait-info-container"},{children:j.map((function(e){var r=e.avatar,a=e.userID,o=e.nick;return i("div",t({className:"create-group-portrait-info"},{children:[n(l,{shape:"square",size:50,image:r||m}),n("div",t({className:"create-group-portrait-info-nick"},{children:o}))]}),a)}))}))]}))]})),n("div",t({className:"tui-conversation-create-next-container"},{children:n("div",t({role:"presentation",className:"tui-conversation-create-next",onClick:function(){return r(y,void 0,void 0,(function(){var e,t,r;return a(this,(function(a){switch(a.label){case 0:return e=j.map((function(e){return{userID:e.userID}})),t=function(e){switch(e){case"Work":return g;case"Public":return v;case"Meeting":return f;case"AVChatRoom":return d;default:return""}}(Y),[4,G({name:L,type:b[Y],groupID:_,avatar:t,memberList:e})];case 1:return r=a.sent(),D(r),T(!1),[2]}}))}))}},{children:"Create"}))}))]}):n(C,{groupType:Y,setGroupType:q,setPageState:P})}export{I as ConversationCreatGroupDetail};
@@ -1 +1 @@
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{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as c}from"../../context/ComponentContext.js";import d from"./hooks/useEnrichedMessageList.js";import h from"./hooks/useMessageListElement.js";import{InfiniteScroll as g}from"../InfiniteScrollPaginator/InfiniteScroll.js";import{EmptyStateIndicator as u}from"../EmptyStateIndicator/EmptyStateIndicator.js";function f(n){var f=this,v=n.messageList,p=n.highlightedMessageId,M=n.loadMore,I=n.intervalsTimer,T=l(null),L=T[0],x=T[1],j=l(!1),C=j[0],S=j[1],E=a("TUIMessageList"),U=E.messageList,b=E.highlightedMessageId,y=E.isCompleted,k=E.isSameLastMessageID,N=E.messageListRef,w=E.noMore,H=E.TUIMessageListConfig,V=m(),q=V.loadMore,A=V.setHighlightedMessageId,D=c(),P=D.TUIMessage,R=D.EmptyStateIndicator,z=void 0===R?u:R,B=p||(null==H?void 0:H.highlightedMessageId)||b,F=60*(I||(null==H?void 0:H.intervalsTimer)||30),G=d({messageList:v||(null==H?void 0:H.messageList)||U}).messageList,J=M||(null==H?void 0:H.loadMore)||q,K=h({enrichedMessageList:G,TUIMessage:P,intervalsTimer:F});return r((function(){t(f,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==L?void 0:L.parentElement)||void 0===n?void 0:n.parentElement,!y&&(null==e?void 0:e.clientHeight)>=(null==L?void 0:L.clientHeight)?[4,J()]:[3,2];case 1:i.sent(),i.label=2;case 2:return!(null==L?void 0:L.children)||C&&k||(t=(null==L?void 0:L.children)||[],s=t[t.length-1],o=setTimeout((function(){null==s||s.scrollIntoView({block:"end"}),S(!0),clearTimeout(o)}),100)),[2]}}))}))}),[K,C]),r((function(){if(B){var e=null==L?void 0:L.querySelector("[data-message-id='".concat(B,"']"));if(!e)return;var t=e.children[1].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),A("")}),1e3)}}),[B]),o("div",e({className:"message-list ".concat(C?"":"hide"),ref:N},{children:[w,w&&s("p",e({className:"no-more"},{children:"No More"})),s(g,e({className:"message-list-infinite-scroll",hasMore:!0,loadMore:J,threshold:1},{children:s("ul",e({ref:x},{children:(null==K?void 0:K.length)>0?K:s(z,{listType:"message"})}))}))]}))}var v=n.memo(f);function p(t){return s(v,e({},t))}export{p 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{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as c}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as m}from"../../context/ComponentContext.js";import d from"./hooks/useEnrichedMessageList.js";import h from"./hooks/useMessageListElement.js";import{InfiniteScroll as g}from"../InfiniteScrollPaginator/InfiniteScroll.js";import{EmptyStateIndicator as u}from"../EmptyStateIndicator/EmptyStateIndicator.js";function f(n){var f=this,v=n.messageList,p=n.highlightedMessageId,M=n.loadMore,I=n.intervalsTimer,T=n.className,L=l(null),x=L[0],j=L[1],C=l(!1),S=C[0],E=C[1],U=a("TUIMessageList"),b=U.messageList,y=U.highlightedMessageId,N=U.isCompleted,k=U.isSameLastMessageID,w=U.messageListRef,H=U.noMore,V=U.TUIMessageListConfig,q=c(),A=q.loadMore,D=q.setHighlightedMessageId,P=m(),R=P.TUIMessage,z=P.EmptyStateIndicator,B=void 0===z?u:z,F=p||(null==V?void 0:V.highlightedMessageId)||y,G=60*(I||(null==V?void 0:V.intervalsTimer)||30),J=d({messageList:v||(null==V?void 0:V.messageList)||b}).messageList,K=M||(null==V?void 0:V.loadMore)||A,O=h({enrichedMessageList:J,TUIMessage:R,intervalsTimer:G});return r((function(){t(f,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==x?void 0:x.parentElement)||void 0===n?void 0:n.parentElement,!N&&(null==e?void 0:e.clientHeight)>=(null==x?void 0:x.clientHeight)?[4,K()]:[3,2];case 1:i.sent(),i.label=2;case 2:return!(null==x?void 0:x.children)||S&&k||(t=(null==x?void 0:x.children)||[],s=t[t.length-1],o=setTimeout((function(){null==s||s.scrollIntoView({block:"end"}),E(!0),clearTimeout(o)}),100)),[2]}}))}))}),[O,S]),r((function(){if(F){var e=null==x?void 0:x.querySelector("[data-message-id='".concat(F,"']"));if(!e)return;var t=e.children[1].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),D("")}),1e3)}}),[F]),o("div",e({className:"message-list ".concat(T," ").concat(S?"":"hide"),ref:w},{children:[H,H&&s("p",e({className:"no-more"},{children:"No More"})),s(g,e({className:"message-list-infinite-scroll",hasMore:!0,loadMore:K,threshold:1},{children:s("ul",e({ref:j},{children:(null==O?void 0:O.length)>0?O:s(B,{listType:"message"})}))}))]}))}var v=n.memo(f);function p(t){return s(v,e({},t))}export{p as TUIMessageList};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/chat-uikit-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "license": "MIT",
@@ -71,9 +71,12 @@ export function ConversationCreatGroupDetail(props: ConversationCreatGroupDetail
71
71
  const getDes = () => typeInfoList.find((item) => item.type === groupType).des;
72
72
 
73
73
  const next = async () => {
74
+ const memberList = profileList.map((item) => ({
75
+ userID: item.userID,
76
+ }));
74
77
  const avatar = getDefaultAvatar(groupType);
75
78
  const conversation = await createConversation({
76
- name: groupName, type: GroupType[groupType], groupID, avatar,
79
+ name: groupName, type: GroupType[groupType], groupID, avatar, memberList,
77
80
  });
78
81
  setActiveConversation(conversation);
79
82
  setConversationCreated(false);
@@ -28,6 +28,7 @@ function TUIMessageListWithContext <T extends MessageListProps>(
28
28
  highlightedMessageId: propsHighlightedMessageId,
29
29
  loadMore: propsLoadMore,
30
30
  intervalsTimer: propsIntervalsTimer,
31
+ className: propsClassName,
31
32
  } = props;
32
33
 
33
34
  const [ulElement, setUlElement] = useState<HTMLUListElement | null>(null);
@@ -99,7 +100,7 @@ function TUIMessageListWithContext <T extends MessageListProps>(
99
100
  }, [highlightedMessageId]);
100
101
 
101
102
  return (
102
- <div className={`message-list ${!firstRender ? 'hide' : ''}`} ref={messageListRef}>
103
+ <div className={`message-list ${propsClassName} ${!firstRender ? 'hide' : ''}`} ref={messageListRef}>
103
104
  {noMore}
104
105
  {noMore && <p className="no-more">No More</p>}
105
106
  <InfiniteScroll
@@ -119,7 +119,7 @@ function TUIProfileDefaultWithContext <T extends TUIProfileDefaultProps>(
119
119
  calendarClassName="tui-profile-birthday-calendar"
120
120
  isOpen
121
121
  format="y-MM-dd"
122
- onChange={(value) => { editBirthday(value); }}
122
+ onChange={(value:Date) => { editBirthday(value); }}
123
123
  value={showBirthdayFormat(`${userInfo?.birthday}`)}
124
124
  />
125
125
  ),