@tencentcloud/chat-uikit-react 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +34 -84
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/Icon/images/union.png.js +1 -1
- package/dist/cjs/components/Icon/images/ununion.png.js +1 -1
- package/dist/cjs/components/TUIChat/hooks/useMessageReceviedListener.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -0
- package/dist/cjs/components/TUIConversation/TUIConversation.js +1 -1
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +1 -0
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/untils.js +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.d.css +10 -216
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/Icon/images/union.png.js +1 -1
- package/dist/esm/components/Icon/images/ununion.png.js +1 -1
- package/dist/esm/components/TUIChat/hooks/useMessageReceviedListener.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -0
- package/dist/esm/components/TUIConversation/TUIConversation.js +1 -1
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +1 -0
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/untils.js +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.d.css +10 -216
- package/package.json +2 -2
- package/readme.zh_cn.md +60 -0
- package/src/components/ConversationPreview/utils.tsx +2 -1
- package/src/components/Icon/images/union.png +0 -0
- package/src/components/Icon/images/ununion.png +0 -0
- package/src/components/TUIChat/hooks/useMessageReceviedListener.tsx +2 -2
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +2 -3
- package/src/components/TUIConversation/TUIConversation.tsx +5 -0
- package/src/components/TUIConversationList/TUIConversationList.tsx +14 -2
- package/src/components/TUIConversationList/hooks/useConversationList.tsx +9 -3
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +8 -3
- package/src/components/TUIKit/hooks/useTUIKit.tsx +7 -1
- package/src/components/TUIMessage/MessageCustom.tsx +13 -1
- package/src/components/TUIMessage/styles/layout.scss +11 -3
- package/src/components/TUIMessage/utils/index.ts +3 -0
- package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +0 -25
- package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +3 -3
- package/src/components/TUIMessageInput/TUIMessageInput.tsx +7 -2
- package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +1 -1
- package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +1 -0
- package/src/components/TUIMessageList/TUIMessageList.tsx +1 -1
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/untils.ts +10 -12
- package/src/context/TUIConversationContext.tsx +2 -0
- package/src/context/TUIKitContext.tsx +5 -1
- package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -1
- package/dist/cjs/components/TUILive/TUILive.d.ts +0 -29
- package/dist/cjs/components/TUILive/TUILive.js +0 -1
- package/dist/cjs/components/TUILive/TUILiveContent.d.ts +0 -13
- package/dist/cjs/components/TUILive/TUILiveContent.js +0 -1
- package/dist/cjs/components/TUILive/TUILiveFooter.d.ts +0 -29
- package/dist/cjs/components/TUILive/TUILiveFooter.js +0 -1
- package/dist/cjs/components/TUILive/TUILiveHeader.d.ts +0 -20
- package/dist/cjs/components/TUILive/TUILiveHeader.js +0 -1
- package/dist/cjs/components/TUILive/TUILiveMemberList.d.ts +0 -11
- package/dist/cjs/components/TUILive/TUILiveMemberList.js +0 -1
- package/dist/cjs/components/TUILive/hooks/useLiveAtiveElements.js +0 -1
- package/dist/cjs/components/TUILive/hooks/useLivePlayer.js +0 -1
- package/dist/cjs/components/TUILive/hooks/useLiveState.js +0 -1
- package/dist/cjs/components/TUILive/untils.js +0 -1
- package/dist/cjs/context/TUILiveContext.d.ts +0 -51
- package/dist/cjs/context/TUILiveContext.js +0 -1
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +0 -1
- package/dist/esm/components/TUILive/TUILive.d.ts +0 -29
- package/dist/esm/components/TUILive/TUILive.js +0 -1
- package/dist/esm/components/TUILive/TUILiveContent.d.ts +0 -13
- package/dist/esm/components/TUILive/TUILiveContent.js +0 -1
- package/dist/esm/components/TUILive/TUILiveFooter.d.ts +0 -29
- package/dist/esm/components/TUILive/TUILiveFooter.js +0 -1
- package/dist/esm/components/TUILive/TUILiveHeader.d.ts +0 -20
- package/dist/esm/components/TUILive/TUILiveHeader.js +0 -1
- package/dist/esm/components/TUILive/TUILiveMemberList.d.ts +0 -11
- package/dist/esm/components/TUILive/TUILiveMemberList.js +0 -1
- package/dist/esm/components/TUILive/hooks/useLiveAtiveElements.js +0 -1
- package/dist/esm/components/TUILive/hooks/useLivePlayer.js +0 -1
- package/dist/esm/components/TUILive/hooks/useLiveState.js +0 -1
- package/dist/esm/components/TUILive/untils.js +0 -1
- package/dist/esm/context/TUILiveContext.d.ts +0 -51
- package/dist/esm/context/TUILiveContext.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useCallback } from 'react';
|
|
1
|
+
import React, { PropsWithChildren, useCallback, useEffect } from 'react';
|
|
2
2
|
import './styles/index.scss';
|
|
3
3
|
|
|
4
4
|
import { Message } from 'tim-js-sdk';
|
|
@@ -16,11 +16,11 @@ export function InputQuoteDefalut <T extends InputQuoteProps>(
|
|
|
16
16
|
props:PropsWithChildren<T>,
|
|
17
17
|
):React.ReactElement {
|
|
18
18
|
const {
|
|
19
|
-
message,
|
|
19
|
+
message: propsMessage,
|
|
20
20
|
} = props;
|
|
21
21
|
|
|
22
22
|
const { operateMessage } = useTUIChatActionContext('MessageRevokeWithContext');
|
|
23
|
-
const { cloudCustomData } = useHandleQuoteMessage(
|
|
23
|
+
const { cloudCustomData, message } = useHandleQuoteMessage(propsMessage);
|
|
24
24
|
|
|
25
25
|
const handleClose = useCallback(() => {
|
|
26
26
|
operateMessage({
|
|
@@ -81,10 +81,15 @@ function UnMemoizedTUIMessageInput<T extends TUIMessageInputProps>(props: PropsW
|
|
|
81
81
|
TUIMessageInput: PropTUIMessageInput,
|
|
82
82
|
InputPlugins: PropInputPlugins,
|
|
83
83
|
InputQuote: PropInputQuote,
|
|
84
|
-
isTransmitter
|
|
85
|
-
className,
|
|
84
|
+
isTransmitter: propsIsTransmitter,
|
|
85
|
+
className: propsClassName,
|
|
86
86
|
} = props;
|
|
87
87
|
|
|
88
|
+
const { TUIMessageInputConfig } = useTUIChatStateContext('TUIMessageInput');
|
|
89
|
+
|
|
90
|
+
const className = propsClassName || TUIMessageInputConfig?.className;
|
|
91
|
+
const isTransmitter = propsIsTransmitter || TUIMessageInputConfig?.isTransmitter || false;
|
|
92
|
+
|
|
88
93
|
const {
|
|
89
94
|
TUIMessageInput: ContextInput,
|
|
90
95
|
InputPlugins: ContextInputPlugins,
|
|
@@ -32,7 +32,7 @@ export function TUIMessageInputDefault():React.ReactElement {
|
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
if (focus && textareaRef.current) {
|
|
34
34
|
textareaRef.current.autofocus = true;
|
|
35
|
-
textareaRef
|
|
35
|
+
textareaRef?.current?.focus();
|
|
36
36
|
textareaRef?.current?.addEventListener('paste', handlePasete);
|
|
37
37
|
}
|
|
38
38
|
return () => {
|
|
@@ -101,7 +101,7 @@ function TUIMessageListWithContext <T extends MessageListProps>(
|
|
|
101
101
|
return (
|
|
102
102
|
<div className={`message-list ${!firstRender ? 'hide' : ''}`} ref={messageListRef}>
|
|
103
103
|
{noMore}
|
|
104
|
-
{noMore && <p className="no-more">
|
|
104
|
+
{noMore && <p className="no-more">No More</p>}
|
|
105
105
|
<InfiniteScroll
|
|
106
106
|
className="message-list-infinite-scroll"
|
|
107
107
|
hasMore
|
|
@@ -33,7 +33,7 @@ function useMessageListElement <T extends MessageListElementProps>(
|
|
|
33
33
|
isShowIntervalsTImer && <div className="message-list-time" key={`${currrentTimer + index}`}>{currrentTimer ? getTimeStamp(currrentTimer * 1000) : 0}</div>
|
|
34
34
|
}
|
|
35
35
|
<li className="message-list-item" key={key}>
|
|
36
|
-
<TUIMessage message={item} />
|
|
36
|
+
<TUIMessage message={item} key={key} />
|
|
37
37
|
</li>
|
|
38
38
|
|
|
39
39
|
</>
|
package/src/components/index.ts
CHANGED
package/src/components/untils.ts
CHANGED
|
@@ -11,18 +11,16 @@ import { defaultGroupAvatarWork, defaultUserAvatar } from './Avatar';
|
|
|
11
11
|
|
|
12
12
|
// Determine if it is a JSON string
|
|
13
13
|
export function isJSON(str: string) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
) {
|
|
25
|
-
return true;
|
|
14
|
+
if (typeof str === 'string') {
|
|
15
|
+
try {
|
|
16
|
+
const data = JSON.parse(str);
|
|
17
|
+
if (data) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
} catch (error) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
26
24
|
}
|
|
27
25
|
return false;
|
|
28
26
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
+
import { Conversation } from 'tim-js-sdk';
|
|
2
3
|
import { TUIConversationList } from '../components';
|
|
3
4
|
|
|
4
5
|
export interface TUIConversationContextValue {
|
|
5
6
|
createConversation?:(conversationID:string) => Promise<any>,
|
|
6
7
|
deleteConversation?:(conversationID:string) => Promise<any>,
|
|
8
|
+
filterConversation?:(conversationList: Array<Conversation>) => Array<Conversation>,
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export const TUIConversationContext = React.createContext<TUIConversationContextValue>(undefined);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defineProperty=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation, Profile, GroupMember } from 'tim-js-sdk';
|
|
3
|
-
import { TUILiveActivePorps, TUILiveCallbackParams, TUILiveTagParam, TUILiveMemberListItemParams } from '../../context/TUILiveContext.js';
|
|
4
|
-
import { OwnerLabelListItem } from './TUILiveFooter.js';
|
|
5
|
-
|
|
6
|
-
interface TUILiveProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
conversation?: Conversation;
|
|
10
|
-
myProfile?: Profile;
|
|
11
|
-
ownerProfile?: GroupMember;
|
|
12
|
-
follow?: TUILiveActivePorps;
|
|
13
|
-
subscribe?: TUILiveActivePorps;
|
|
14
|
-
like?: TUILiveActivePorps;
|
|
15
|
-
unlike?: TUILiveActivePorps;
|
|
16
|
-
activePlugins?: Array<React.ReactElement>;
|
|
17
|
-
menuIcon?: React.ReactElement;
|
|
18
|
-
callback?: (data: TUILiveCallbackParams) => void;
|
|
19
|
-
headerTag?: Array<string>;
|
|
20
|
-
footerTag?: Array<string>;
|
|
21
|
-
onTagClick?: (data?: TUILiveTagParam) => void;
|
|
22
|
-
groupID?: string;
|
|
23
|
-
memberGroupList?: Array<TUILiveMemberListItemParams>;
|
|
24
|
-
ownerLabelList?: Array<OwnerLabelListItem>;
|
|
25
|
-
}
|
|
26
|
-
declare function UnMemoizedTUILive<T extends TUILiveProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
27
|
-
declare const TUILive: typeof UnMemoizedTUILive;
|
|
28
|
-
|
|
29
|
-
export { TUILive };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),t=require("../../context/TUIKitContext.js");require("../../context/TUIMessageContext.js");var o=require("../../context/TUILiveContext.js"),s=require("./hooks/useLiveState.js"),n=require("./TUILiveContent.js"),u=require("./TUILiveFooter.js"),a=require("./TUILiveHeader.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(l){var c=l.className,v=l.url,m=l.conversation,L=l.ownerProfile,b=l.myProfile,f=l.children,x=l.follow,I=l.subscribe,g=l.like,j=l.unlike,T=l.activePlugins,d=void 0===T?[]:T,p=l.callback,_=l.menuIcon,C=l.onTagClick,U=l.groupID,w=l.memberGroupList,k=l.ownerLabelList,q=t.useTUIKitContext("TUILive"),P=q.tim,h=q.conversation,y=q.myProfile,S=q.setActiveConversation,F=b||y,M=m||h,A=s.useLiveState({tim:P,conversation:m||h,groupID:U,setActiveConversation:S}),D=A.group,G=A.ownerProfile,H=A.memberCount,K=A.memberList,N=L||G,O=e.__assign({type:"follow",isShow:!0,value:!1,num:0},x),z=e.__assign({type:"subscribe",isShow:!0,value:!1,num:0},I),B=e.__assign({type:"like",isShow:!0,value:!1,num:0},g),E=e.__assign({type:"unlike",isShow:!0,value:!1,num:0},j),J=r.useMemo((function(){return{url:v,group:D,conversation:M,ownerProfile:N,myProfile:F,follow:O,subscribe:z,like:B,unlike:E,activePlugins:d,menuIcon:_,callback:p,onTagClick:C,memberCount:H,memberList:K,memberGroupList:w,ownerLabelList:k}}),[v,D,M,N,F,O,z,B,E,d,_,p,w,C,H,K,k]);return i.jsx(o.TUILiveContextProvider,e.__assign({value:J},{children:i.jsxs(i.Fragment,{children:[i.jsxs("div",e.__assign({className:"tui-live ".concat(c)},{children:[i.jsx(a.TUILiveHeader,{}),i.jsx(n.TUILiveContent,{}),i.jsx(u.TUILiveFooter,{})]})),f&&f]})}))}var v=l(r).default.memo(c);exports.TUILive=v;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
interface TUILiveContentBaseProps {
|
|
4
|
-
url?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
interface TUILiveContentProps extends TUILiveContentBaseProps {
|
|
8
|
-
TUILiveContent?: React.ComponentType<TUILiveContentBaseProps>;
|
|
9
|
-
}
|
|
10
|
-
declare function UnMemoizedTUILiveContent<T extends TUILiveContentProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
11
|
-
declare const TUILiveContent: typeof UnMemoizedTUILiveContent;
|
|
12
|
-
|
|
13
|
-
export { TUILiveContent, TUILiveContentBaseProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),i=require("../../context/TUILiveContext.js"),n=require("./hooks/useLivePlayer.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(o){var s=o.className,u=o.url,a=o.TUILiveContent,l=t.useRef(),c=i.useTUILiveContext("TUILiveHeader").url,v=u||c;if(!/(http(s)?:\/\/)?\w+(\.\w+)+\/(\w+\/)*(.*?\.)+(swf|avi|flv|mpg|mov|wav|3gp|mkv|rmvb|mp3|mp4)/.test(v))throw new Error("The url is invalid, please fill in the correct url");a&&r.jsx(a,{url:v});var f=n.useLivePlayer(null==l?void 0:l.current).TCPlayer,p="player-container-".concat((new Date).getTime());return t.useEffect((function(){l&&f&&f.src(v)}),[l,f]),r.jsx("video",e.__assign({autoPlay:!0,muted:!0,loop:!0,controls:!0,className:"tui-live-content ".concat(s),id:p,preload:"auto",playsInline:!0,ref:l},{children:r.jsx("source",{src:""})}))}var u=o(t).default.memo(s);exports.TUILiveContent=u;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation, Group, GroupMember, Profile } from 'tim-js-sdk';
|
|
3
|
-
import { TUILiveActivePorps, TUILiveCallbackParams } from '../../context/TUILiveContext.js';
|
|
4
|
-
|
|
5
|
-
interface OwnerLabelListItem {
|
|
6
|
-
key?: string;
|
|
7
|
-
value?: string;
|
|
8
|
-
}
|
|
9
|
-
interface TUILiveFooterBaseProps {
|
|
10
|
-
className?: string;
|
|
11
|
-
conversation?: Conversation;
|
|
12
|
-
group?: Group;
|
|
13
|
-
ownerProfile?: GroupMember;
|
|
14
|
-
myProfile?: Profile;
|
|
15
|
-
ownerLabelList?: Array<OwnerLabelListItem>;
|
|
16
|
-
}
|
|
17
|
-
interface TUILiveFooterProps extends TUILiveFooterBaseProps {
|
|
18
|
-
TUILiveFooter?: React.ComponentType<TUILiveFooterBaseProps>;
|
|
19
|
-
follow?: TUILiveActivePorps;
|
|
20
|
-
subscribe?: TUILiveActivePorps;
|
|
21
|
-
like?: TUILiveActivePorps;
|
|
22
|
-
unlike?: TUILiveActivePorps;
|
|
23
|
-
activePlugins?: Array<React.ReactElement>;
|
|
24
|
-
callback?: (data: TUILiveCallbackParams) => void;
|
|
25
|
-
}
|
|
26
|
-
declare function UnMemoizedTUILiveFooter<T extends TUILiveFooterProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
27
|
-
declare const TUILiveFooter: typeof UnMemoizedTUILiveFooter;
|
|
28
|
-
|
|
29
|
-
export { OwnerLabelListItem, TUILiveFooter, TUILiveFooterBaseProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),s=require("../../context/TUILiveContext.js"),n=require("./hooks/useLiveAtiveElements.js"),o=require("../Icon/Icon.js"),u=require("../Icon/type.js"),t=require("../Avatar/Avatar.js"),r=require("./untils.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(a){var c=a.className,v=a.conversation,f=a.group,k=a.ownerLabelList,m=a.ownerProfile,b=a.myProfile,p=a.TUILiveFooter,I=a.activePlugins,d=a.follow,y=a.subscribe,w=a.like,h=a.unlike,j=a.callback,x=s.useTUILiveContext("TUILiveHeader"),g=x.group,L=x.ownerProfile,N=x.myProfile,T=x.activePlugins,_=x.follow,U=x.subscribe,E=x.like,q=x.unlike,C=x.callback,A=x.ownerLabelList,P=f||g,O=b||N,S=I||T,K=d||_,F=y||U,V=w||E,D=h||q,R=j||C;p&&i.jsx(p,{conversation:v,group:P,myProfile:O});var H=m||L,W=k||A||((null==H?void 0:H.memberCustomField)||[]).filter((function(e){return null==e?void 0:e.value})),z=l.useState({follow:K.value,subscribe:F.value,like:V.value,unlike:D.value}),M=z[0];z[1];var B=K.isShow&&n.useLiveAtiveElements({icon:u.IconTypes.UNUNION,activeIcon:u.IconTypes.UNION,name:"Follow",type:"follow",iconWidth:12,iconHeight:12,value:M.follow,onClick:function(){return M.follow=!M.follow,R({type:"follow",value:M.follow}),{value:M.follow}}}),G=F.isShow&&n.useLiveAtiveElements({icon:u.IconTypes.UNVECTOR,activeIcon:u.IconTypes.VECTOR,name:"Subscribe",type:"subscribe",value:M.subscribe,onClick:function(){return M.subscribe=!M.subscribe,R({type:"subscribe",value:M.subscribe}),{value:M.subscribe}}}),J=V.isShow&&n.useLiveAtiveElements({icon:u.IconTypes.LIKE,activeIcon:u.IconTypes.LIKED,name:r.handleNumber(V.num,1),type:"like",value:!M.unlike&&M.like,suffix:D.isShow&&{icon:u.IconTypes.UNLIKE,activeIcon:u.IconTypes.UNLIKED,type:"unlike",value:!M.like&&M.unlike,onClick:function(){return M.like&&R({type:"like",value:!M.like}),M.like=!1,M.unlike=!M.unlike,{value:M.like,suffixValue:M.unlike}}},onClick:function(){return M.unlike=!1,M.like=!M.like,R({type:"like",value:M.like}),{value:M.like,suffixValue:M.unlike}}}),Q=e.__spreadArray([B,G,J],S,!0).filter((function(e){return e}));return i.jsxs("footer",e.__assign({className:"tui-live-footer ".concat(c)},{children:[i.jsx(t.Avatar,{size:40,image:(null==H?void 0:H.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"}),i.jsxs("div",e.__assign({className:"tui-live-footer-main"},{children:[i.jsxs("div",e.__assign({className:"owner-name"},{children:[i.jsx("h1",{children:(null==H?void 0:H.nick)||(null==H?void 0:H.userID)}),i.jsx(o.Icon,{type:u.IconTypes.OWNER,width:15,height:15})]})),i.jsx("ul",e.__assign({className:"tui-live-list tag-list"},{children:null==W?void 0:W.map((function(l){return i.jsx("li",e.__assign({className:"tui-live-item tag-item"},{children:null==l?void 0:l.value}),l.value)}))}))]})),i.jsx("ul",e.__assign({className:"tui-live-list opate-list"},{children:Q}))]}))}var v=a(l).default.memo(c);exports.TUILiveFooter=v;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation, Group } from 'tim-js-sdk';
|
|
3
|
-
import { TUILiveActivePorps, TUILiveTagParam } from '../../context/TUILiveContext.js';
|
|
4
|
-
|
|
5
|
-
interface TUILiveHeaderBaseProps {
|
|
6
|
-
className?: string;
|
|
7
|
-
conversation?: Conversation;
|
|
8
|
-
group?: Group;
|
|
9
|
-
}
|
|
10
|
-
interface TUILiveHeaderProps extends TUILiveHeaderBaseProps {
|
|
11
|
-
TUILiveHeader?: React.ComponentType<TUILiveHeaderBaseProps>;
|
|
12
|
-
menuIcon?: React.ReactElement;
|
|
13
|
-
follow?: TUILiveActivePorps;
|
|
14
|
-
subscribe?: TUILiveActivePorps;
|
|
15
|
-
onTagClick?: (data?: TUILiveTagParam) => void;
|
|
16
|
-
}
|
|
17
|
-
declare function UnMemoizedTUILiveHeader<T extends TUILiveHeaderProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
18
|
-
declare const TUILiveHeader: typeof UnMemoizedTUILiveHeader;
|
|
19
|
-
|
|
20
|
-
export { TUILiveHeader, TUILiveHeaderBaseProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),s=require("../../context/TUILiveContext.js"),l=require("../Icon/Icon.js"),a=require("../Icon/type.js"),t=require("./untils.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(n){var r=n.className,u=n.conversation,c=n.group,o=n.TUILiveHeader,v=n.menuIcon,d=n.follow,m=n.subscribe,h=n.onTagClick,x=s.useTUILiveContext("TUILiveHeader"),g=x.group,j=x.follow,I=x.subscribe,p=x.menuIcon,_=x.onTagClick,N=x.memberCount,f=c||g,T=v||p,b=d||j,y=m||I,C=h||_;o&&i.jsx(o,{conversation:u,group:f});var q=((null==f?void 0:f.groupCustomField)||[]).filter((function(e){return null==e?void 0:e.value})),L=[{icon:a.IconTypes.MEMBER,value:N},{icon:a.IconTypes.UNION,value:b.num},{icon:a.IconTypes.VECTOR,value:y.num}];return i.jsxs("header",e.__assign({className:"tui-live-header ".concat(r)},{children:[i.jsxs("div",e.__assign({className:"tui-live-header-name"},{children:[i.jsx("h1",{children:(null==f?void 0:f.name)||(null==f?void 0:f.groupID)}),T]})),i.jsxs("div",e.__assign({className:"tui-live-header-content"},{children:[i.jsxs("div",e.__assign({className:"tui-live-header-label"},{children:[i.jsx(l.Icon,{className:"icon",type:a.IconTypes.LIVING,width:12,height:12}),i.jsx("p",{children:"Living"})]})),i.jsx("ul",e.__assign({className:"tui-live-list tag-list"},{children:null==q?void 0:q.map((function(n,s){return i.jsx("li",e.__assign({role:"menuitem",tabIndex:s,className:"tui-live-item tag-item",onClick:function(e){C({value:n.value,ele:e})}},{children:null==n?void 0:n.value}),n.value)}))})),i.jsx("ul",e.__assign({className:"tui-live-list"},{children:null==L?void 0:L.map((function(n){return i.jsxs("li",e.__assign({className:"tui-live-item"},{children:[i.jsx(l.Icon,{className:"icon",type:n.icon,width:12,height:12}),i.jsx("span",e.__assign({className:"list-item-text"},{children:t.handleNumber(n.value)}))]}),n.icon)}))}))]}))]}))}var c=r(n).default.memo(u);exports.TUILiveHeader=c;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { TUILiveMemberListItemParams } from '../../context/TUILiveContext.js';
|
|
3
|
-
|
|
4
|
-
interface TUILiveMemberListProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
memberGroupList?: Array<TUILiveMemberListItemParams>;
|
|
7
|
-
}
|
|
8
|
-
declare function UnMemoizedTUILiveMemberList<T extends TUILiveMemberListProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
9
|
-
declare const TUILiveMemberList: typeof UnMemoizedTUILiveMemberList;
|
|
10
|
-
|
|
11
|
-
export { TUILiveMemberList, TUILiveMemberListProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),s=require("../../context/TUILiveContext.js"),l=require("../Icon/Icon.js"),t=require("../Icon/type.js"),r=require("../Avatar/Avatar.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(a){a.className;var o=a.memberGroupList,u=s.useTUILiveContext("TUILiveHeader"),c=u.memberGroupList,v=u.memberList,d=u.ownerProfile,m=n.useState([]),h=m[0],_=m[1];return n.useEffect((function(){var i=o||c;if((null==i?void 0:i.length)>0&&(null==v?void 0:v.length)>0&&0===(null==h?void 0:h.length)){var n=i.map((function(i){var n=e.__assign(e.__assign({},i),{list:[],show:!0});return n.filter&&(n.list=null==n?void 0:n.filter(v,d)),n}));_(n)}0===(null==i?void 0:i.length)&&(null==v?void 0:v.length)>0&&0===(null==h?void 0:h.length)&&_(n=[{title:"All",name:"All",show:!0,list:v}])}),[o,c,d,h,v]),i.jsx("main",e.__assign({className:"tui-live-members"},{children:null==h?void 0:h.map((function(n,s){var a;return i.jsxs("ul",e.__assign({className:"list"},{children:[i.jsxs("div",e.__assign({role:"menuitem",tabIndex:s,className:"list-header",onClick:function(){var i,n;i=s,n=h.map((function(n,s){return s===i?e.__assign(e.__assign({},n),{show:!n.show}):n})),_(n)}},{children:[i.jsx("h1",{children:null==n?void 0:n.title}),i.jsx(l.Icon,{type:t.IconTypes.ARROW_DOWN,width:12,height:7})]})),(null==n?void 0:n.show)&&(null===(a=null==n?void 0:n.list)||void 0===a?void 0:a.map((function(n){return i.jsxs("li",e.__assign({className:"list-item"},{children:[i.jsx(r.Avatar,{size:18,image:(null==n?void 0:n.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"}),i.jsx("span",e.__assign({className:"nick"},{children:(null==n?void 0:n.nick)||(null==n?void 0:n.userID)}))]}),null==n?void 0:n.userID)})))]}),null==n?void 0:n.name)}))}))}var u=a(n).default.memo(o);exports.TUILiveMemberList=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("../../Icon/Icon.js");require("../../Icon/type.js"),exports.useLiveAtiveElements=function(a){var s=this,l=a.name;a.type;var r=a.icon,c=a.activeIcon,u=a.value,o=a.onClick;a.className;var v=a.suffix,d=a.iconWidth,x=a.iconHeight,_=t.useState(u),h=_[0],f=_[1],m=t.useState(null==v?void 0:v.value),b=m[0],p=m[1],j=t.useCallback((function(){return e.__awaiter(s,void 0,void 0,(function(){var i;return e.__generator(this,(function(e){switch(e.label){case 0:return o?[4,o()]:[3,2];case 1:i=e.sent(),f(null==i?void 0:i.value),p(i.suffixValue),e.label=2;case 2:return[2]}}))}))}),[o]),g=t.useCallback((function(){return e.__awaiter(s,void 0,void 0,(function(){var i;return e.__generator(this,(function(e){switch(e.label){case 0:return(null==v?void 0:v.onClick)?[4,null==v?void 0:v.onClick()]:[3,2];case 1:i=e.sent(),f(null==i?void 0:i.value),p(i.suffixValue),e.label=2;case 2:return[2]}}))}))}),[null==v?void 0:v.onClick]);return i.jsxs("li",e.__assign({className:"tui-live-item opate-item"},{children:[i.jsxs("div",e.__assign({className:"opate-box",role:"menuitem",tabIndex:0,onClick:j},{children:[i.jsx(n.Icon,{type:h?c:r,width:d||15,height:x||15}),i.jsx("span",e.__assign({className:"list-item-text"},{children:l}))]})),v&&i.jsx("div",e.__assign({role:"menuitem",tabIndex:0,className:"opate-item-suffix line opate-box",onClick:g},{children:i.jsx(n.Icon,{type:b?v.activeIcon:v.icon,width:d||15,height:x||15})}))]}),l)};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),i="https://web.sdk.qcloud.com/player/tcplayer/release",n={link:{type:"link",url:"tcplayer.min.css",isOnload:!1},TXLivePlayer:{type:"script",url:"libs/TXLivePlayer-1.2.3.min.js",isOnload:!1},hls:{type:"script",url:"libs/hls.min.1.1.5.js",isOnload:!1},flv:{type:"script",url:"libs/flv.min.1.6.3.js",isOnload:!1},dash:{type:"script",url:"libs/dash.all.min.4.4.1.js",isOnload:!1},tcplayer:{type:"script",url:"tcplayer.v4.6.0.min.js",isOnload:!1}};exports.useLivePlayer=function(l){var r=this,s=t.useState(null),a=s[0],o=s[1],c=t.useState(n),u=c[0],d=c[1],p=t.useState(!1),y=p[0],v=p[1];return t.useEffect((function(){e.__awaiter(r,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,void((null===window||void 0===window?void 0:window.TCPlayer)?v(!0):Object.keys(u).map((function(e){var t=document.createElement(u[e].type);return"link"===u[e].type?(t.href="".concat(i,"/").concat("v4.6.0","/").concat(u[e].url),t.rel="stylesheet"):t.src="".concat(i,"/").concat("v4.6.0","/").concat(u[e].url),document.body.appendChild(t),t.onload=function(){u[e].isOnload=!0,d(u),v(Object.keys(u).every((function(e){return u[e].isOnload})))},e})))];case 1:return e.sent(),[2]}}))}))}),[]),t.useEffect((function(){if(y&&l){var e=null===window||void 0===window?void 0:window.TCPlayer(null==l?void 0:l.id,{});o(e)}}),[y,l]),{TCPlayer:a}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(require("tim-js-sdk"));exports.useLiveState=function(n){var u=this,o=n.tim,i=n.conversation,a=n.groupID,l=n.setActiveConversation,s=t.useState(null),c=s[0],d=s[1],v=t.useState(null),f=v[0],_=v[1],b=t.useState(null),g=b[0],p=b[1],w=t.useState(0),h=w[0],m=w[1],P=t.useState(null),D=P[0],E=P[1],G=t.useCallback((function(){return e.__awaiter(u,void 0,void 0,(function(){var t,n,r;return e.__generator(this,(function(e){switch(e.label){case 0:return!a||f?[3,3]:[4,null==o?void 0:o.getGroupProfile({groupID:a})];case 1:return t=e.sent(),_(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.group),[4,I(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.group)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))}),[o,a]),I=function(t){return e.__awaiter(u,void 0,void 0,(function(){var n,r;return e.__generator(this,(function(e){switch(e.label){case 0:return(null==t?void 0:t.ownerID)?[4,null==o?void 0:o.getGroupMemberProfile({groupID:a,userIDList:[null==t?void 0:t.ownerID]})]:[3,2];case 1:n=e.sent(),p(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.memberList[0]),e.label=2;case 2:return[2]}}))}))},T=t.useCallback((function(){return e.__awaiter(u,void 0,void 0,(function(){var t,n,r,u,i;return e.__generator(this,(function(e){switch(e.label){case 0:return a?[4,null==o?void 0:o.getGroupOnlineMemberCount(a)]:[3,3];case 1:return t=e.sent(),m(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.memberCount),(null===(u=null==t?void 0:t.data)||void 0===u?void 0:u.memberCount)>0?[4,null==o?void 0:o.getGroupMemberList({groupID:a,offset:0})]:[3,3];case 2:n=e.sent(),E(null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.memberList),e.label=3;case 3:return[2]}}))}))}),[o]),C=function(e){console.log("onGroupAttributesUpdated",null==e?void 0:e.data)};return t.useEffect((function(){return e.__awaiter(u,void 0,void 0,(function(){var t,n,r;return e.__generator(this,(function(e){switch(e.label){case 0:return c?[2]:i?(l(i),d(i),[3,3]):[3,1];case 1:return[4,null==o?void 0:o.getConversationProfile("GROUP".concat(a))];case 2:t=e.sent(),l(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.conversation),d(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.conversation),e.label=3;case 3:return[2]}}))})),function(){e.__awaiter(u,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return c?[4,null==o?void 0:o.deleteConversation("GROUP".concat(a))]:[3,3];case 1:return e.sent(),d(null),[4,null==o?void 0:o.quitGroup(a)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))}}),[o,i,c]),t.useEffect((function(){var t=null;return e.__awaiter(u,void 0,void 0,(function(){var n=this;return e.__generator(this,(function(r){switch(r.label){case 0:return[4,G()];case 1:return r.sent(),[4,T()];case 2:return r.sent(),t=setInterval((function(){return e.__awaiter(n,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,T()];case 1:return e.sent(),[2]}}))}))}),1e4),[2]}}))})),null==o||o.on(r.default.EVENT.GROUP_ATTRIBUTES_UPDATED,C),function(){null==o||o.off(r.default.EVENT.GROUP_ATTRIBUTES_UPDATED,C),t&&clearInterval(t)}}),[o,a]),t.useEffect((function(){e.__awaiter(u,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return c&&f?[4,null==o?void 0:o.joinGroup({groupID:a,type:r.default.TYPES.GRP_AVCHATROOM})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}),[o,c,f]),{group:f,ownerProfile:g,memberCount:h,memberList:D}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.handleNumber=function(e,t){void 0===t&&(t=0);var o="".concat(e);return 0===t&&(e>1e3&&e<1e4?o="".concat((e/1e3).toFixed(1),"K"):e>1e4&&(o="".concat((e/1e3).toFixed(0),"K"))),1===t&&e>1e4&&(o="".concat((e/1e4).toFixed(1),"W")),o};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { GroupMember, Conversation, Group, Profile } from 'tim-js-sdk';
|
|
3
|
-
import { OwnerLabelListItem } from '../components/TUILive/TUILiveFooter.js';
|
|
4
|
-
|
|
5
|
-
interface TUILiveActivePorps {
|
|
6
|
-
type?: 'follow' | 'subscribe' | 'like' | 'unlike';
|
|
7
|
-
value?: boolean;
|
|
8
|
-
isShow?: boolean;
|
|
9
|
-
num?: number;
|
|
10
|
-
}
|
|
11
|
-
interface TUILiveCallbackParams {
|
|
12
|
-
type?: 'follow' | 'subscribe' | 'like' | 'unlike';
|
|
13
|
-
value?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface TUILiveMemberListItemParams {
|
|
16
|
-
title?: React.ReactElement | string;
|
|
17
|
-
name?: string;
|
|
18
|
-
filter?: (list: Array<GroupMember>, ownerProfile: GroupMember) => Array<GroupMember>;
|
|
19
|
-
show?: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface TUILiveTagParam {
|
|
22
|
-
type?: 'header' | 'footer';
|
|
23
|
-
value?: string;
|
|
24
|
-
ele?: React.MouseEvent<HTMLLIElement, MouseEvent>;
|
|
25
|
-
}
|
|
26
|
-
interface TUILiveContextValue {
|
|
27
|
-
url?: string;
|
|
28
|
-
conversation?: Conversation;
|
|
29
|
-
group?: Group;
|
|
30
|
-
ownerProfile?: GroupMember;
|
|
31
|
-
myProfile?: Profile;
|
|
32
|
-
follow?: TUILiveActivePorps;
|
|
33
|
-
subscribe?: TUILiveActivePorps;
|
|
34
|
-
like?: TUILiveActivePorps;
|
|
35
|
-
unlike?: TUILiveActivePorps;
|
|
36
|
-
activePlugins?: Array<React.ReactElement>;
|
|
37
|
-
menuIcon?: React.ReactElement;
|
|
38
|
-
callback?: (data: TUILiveCallbackParams) => void;
|
|
39
|
-
memberGroupList?: Array<TUILiveMemberListItemParams>;
|
|
40
|
-
memberList?: Array<GroupMember>;
|
|
41
|
-
onTagClick?: (data?: TUILiveTagParam) => void;
|
|
42
|
-
memberCount?: number;
|
|
43
|
-
ownerLabelList?: Array<OwnerLabelListItem>;
|
|
44
|
-
}
|
|
45
|
-
declare const TUILiveContext: React.Context<TUILiveContextValue>;
|
|
46
|
-
declare function TUILiveContextProvider({ children, value }: PropsWithChildren<{
|
|
47
|
-
value: TUILiveContextValue;
|
|
48
|
-
}>): React.ReactElement;
|
|
49
|
-
declare const useTUILiveContext: (componentName?: string) => TUILiveContextValue;
|
|
50
|
-
|
|
51
|
-
export { TUILiveActivePorps, TUILiveCallbackParams, TUILiveContext, TUILiveContextProvider, TUILiveContextValue, TUILiveMemberListItemParams, TUILiveTagParam, useTUILiveContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=i(r).default.createContext(void 0);exports.TUILiveContext=n,exports.TUILiveContextProvider=function(r){var i=r.children,u=r.value;return t.jsx(n.Provider,e.__assign({value:u},{children:i}))},exports.useTUILiveContext=function(e){var t=r.useContext(n);return!t&&e?{}:t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}export{e as defineProperty};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation, Profile, GroupMember } from 'tim-js-sdk';
|
|
3
|
-
import { TUILiveActivePorps, TUILiveCallbackParams, TUILiveTagParam, TUILiveMemberListItemParams } from '../../context/TUILiveContext.js';
|
|
4
|
-
import { OwnerLabelListItem } from './TUILiveFooter.js';
|
|
5
|
-
|
|
6
|
-
interface TUILiveProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
conversation?: Conversation;
|
|
10
|
-
myProfile?: Profile;
|
|
11
|
-
ownerProfile?: GroupMember;
|
|
12
|
-
follow?: TUILiveActivePorps;
|
|
13
|
-
subscribe?: TUILiveActivePorps;
|
|
14
|
-
like?: TUILiveActivePorps;
|
|
15
|
-
unlike?: TUILiveActivePorps;
|
|
16
|
-
activePlugins?: Array<React.ReactElement>;
|
|
17
|
-
menuIcon?: React.ReactElement;
|
|
18
|
-
callback?: (data: TUILiveCallbackParams) => void;
|
|
19
|
-
headerTag?: Array<string>;
|
|
20
|
-
footerTag?: Array<string>;
|
|
21
|
-
onTagClick?: (data?: TUILiveTagParam) => void;
|
|
22
|
-
groupID?: string;
|
|
23
|
-
memberGroupList?: Array<TUILiveMemberListItemParams>;
|
|
24
|
-
ownerLabelList?: Array<OwnerLabelListItem>;
|
|
25
|
-
}
|
|
26
|
-
declare function UnMemoizedTUILive<T extends TUILiveProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
27
|
-
declare const TUILive: typeof UnMemoizedTUILive;
|
|
28
|
-
|
|
29
|
-
export { TUILive };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as o,jsxs as i,Fragment as r}from"react/jsx-runtime";import t,{useMemo as n}from"react";import{useTUIKitContext as m}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{TUILiveContextProvider as l}from"../../context/TUILiveContext.js";import{useLiveState as s}from"./hooks/useLiveState.js";import{TUILiveContent as u}from"./TUILiveContent.js";import{TUILiveFooter as c}from"./TUILiveFooter.js";import{TUILiveHeader as a}from"./TUILiveHeader.js";function v(t){var v=t.className,p=t.url,f=t.conversation,b=t.ownerProfile,L=t.myProfile,w=t.children,k=t.follow,I=t.subscribe,C=t.like,g=t.unlike,h=t.activePlugins,T=void 0===h?[]:h,j=t.callback,x=t.menuIcon,P=t.onTagClick,d=t.groupID,y=t.memberGroupList,U=t.ownerLabelList,S=m("TUILive"),A=S.tim,D=S.conversation,G=S.myProfile,N=S.setActiveConversation,F=L||G,H=f||D,K=s({tim:A,conversation:f||D,groupID:d,setActiveConversation:N}),M=K.group,q=K.ownerProfile,z=K.memberCount,B=K.memberList,E=b||q,J=e({type:"follow",isShow:!0,value:!1,num:0},k),O=e({type:"subscribe",isShow:!0,value:!1,num:0},I),Q=e({type:"like",isShow:!0,value:!1,num:0},C),R=e({type:"unlike",isShow:!0,value:!1,num:0},g),V=n((function(){return{url:p,group:M,conversation:H,ownerProfile:E,myProfile:F,follow:J,subscribe:O,like:Q,unlike:R,activePlugins:T,menuIcon:x,callback:j,onTagClick:P,memberCount:z,memberList:B,memberGroupList:y,ownerLabelList:U}}),[p,M,H,E,F,J,O,Q,R,T,x,j,y,P,z,B,U]);return o(l,e({value:V},{children:i(r,{children:[i("div",e({className:"tui-live ".concat(v)},{children:[o(a,{}),o(u,{}),o(c,{})]})),w&&w]})}))}var p=t.memo(v);export{p as TUILive};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
interface TUILiveContentBaseProps {
|
|
4
|
-
url?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
interface TUILiveContentProps extends TUILiveContentBaseProps {
|
|
8
|
-
TUILiveContent?: React.ComponentType<TUILiveContentBaseProps>;
|
|
9
|
-
}
|
|
10
|
-
declare function UnMemoizedTUILiveContent<T extends TUILiveContentProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
11
|
-
declare const TUILiveContent: typeof UnMemoizedTUILiveContent;
|
|
12
|
-
|
|
13
|
-
export { TUILiveContent, TUILiveContentBaseProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import t,{useRef as o,useEffect as i}from"react";import{useTUILiveContext as a}from"../../context/TUILiveContext.js";import{useLivePlayer as l}from"./hooks/useLivePlayer.js";function n(t){var n=t.className,m=t.url,c=t.TUILiveContent,s=o(),u=a("TUILiveHeader").url,v=m||u;if(!/(http(s)?:\/\/)?\w+(\.\w+)+\/(\w+\/)*(.*?\.)+(swf|avi|flv|mpg|mov|wav|3gp|mkv|rmvb|mp3|mp4)/.test(v))throw new Error("The url is invalid, please fill in the correct url");c&&e(c,{url:v});var p=l(null==s?void 0:s.current).TCPlayer,f="player-container-".concat((new Date).getTime());return i((function(){s&&p&&p.src(v)}),[s,p]),e("video",r({autoPlay:!0,muted:!0,loop:!0,controls:!0,className:"tui-live-content ".concat(n),id:f,preload:"auto",playsInline:!0,ref:s},{children:e("source",{src:""})}))}var m=t.memo(n);export{m as TUILiveContent};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation, Group, GroupMember, Profile } from 'tim-js-sdk';
|
|
3
|
-
import { TUILiveActivePorps, TUILiveCallbackParams } from '../../context/TUILiveContext.js';
|
|
4
|
-
|
|
5
|
-
interface OwnerLabelListItem {
|
|
6
|
-
key?: string;
|
|
7
|
-
value?: string;
|
|
8
|
-
}
|
|
9
|
-
interface TUILiveFooterBaseProps {
|
|
10
|
-
className?: string;
|
|
11
|
-
conversation?: Conversation;
|
|
12
|
-
group?: Group;
|
|
13
|
-
ownerProfile?: GroupMember;
|
|
14
|
-
myProfile?: Profile;
|
|
15
|
-
ownerLabelList?: Array<OwnerLabelListItem>;
|
|
16
|
-
}
|
|
17
|
-
interface TUILiveFooterProps extends TUILiveFooterBaseProps {
|
|
18
|
-
TUILiveFooter?: React.ComponentType<TUILiveFooterBaseProps>;
|
|
19
|
-
follow?: TUILiveActivePorps;
|
|
20
|
-
subscribe?: TUILiveActivePorps;
|
|
21
|
-
like?: TUILiveActivePorps;
|
|
22
|
-
unlike?: TUILiveActivePorps;
|
|
23
|
-
activePlugins?: Array<React.ReactElement>;
|
|
24
|
-
callback?: (data: TUILiveCallbackParams) => void;
|
|
25
|
-
}
|
|
26
|
-
declare function UnMemoizedTUILiveFooter<T extends TUILiveFooterProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
27
|
-
declare const TUILiveFooter: typeof UnMemoizedTUILiveFooter;
|
|
28
|
-
|
|
29
|
-
export { OwnerLabelListItem, TUILiveFooter, TUILiveFooterBaseProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__spreadArray as e,__assign as i}from"tslib";import{jsx as l,jsxs as o}from"react/jsx-runtime";import n,{useState as t}from"react";import{useTUILiveContext as r}from"../../context/TUILiveContext.js";import{useLiveAtiveElements as u}from"./hooks/useLiveAtiveElements.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Avatar as c}from"../Avatar/Avatar.js";import{handleNumber as v}from"./untils.js";function m(n){var m=n.className,f=n.conversation,k=n.group,b=n.ownerLabelList,p=n.ownerProfile,d=n.myProfile,w=n.TUILiveFooter,h=n.activePlugins,I=n.follow,N=n.subscribe,y=n.like,L=n.unlike,g=n.callback,U=r("TUILiveHeader"),C=U.group,E=U.ownerProfile,j=U.myProfile,x=U.activePlugins,P=U.follow,T=U.subscribe,K=U.like,O=U.unlike,S=U.callback,V=U.ownerLabelList,A=h||x,D=I||P,F=N||T,R=y||K,H=L||O,W=g||S;w&&l(w,{conversation:f,group:k||C,myProfile:d||j});var q=p||E,z=b||V||((null==q?void 0:q.memberCustomField)||[]).filter((function(e){return null==e?void 0:e.value})),_=t({follow:D.value,subscribe:F.value,like:R.value,unlike:H.value}),B=_[0];_[1];var G=D.isShow&&u({icon:s.UNUNION,activeIcon:s.UNION,name:"Follow",type:"follow",iconWidth:12,iconHeight:12,value:B.follow,onClick:function(){return B.follow=!B.follow,W({type:"follow",value:B.follow}),{value:B.follow}}}),J=F.isShow&&u({icon:s.UNVECTOR,activeIcon:s.VECTOR,name:"Subscribe",type:"subscribe",value:B.subscribe,onClick:function(){return B.subscribe=!B.subscribe,W({type:"subscribe",value:B.subscribe}),{value:B.subscribe}}}),M=R.isShow&&u({icon:s.LIKE,activeIcon:s.LIKED,name:v(R.num,1),type:"like",value:!B.unlike&&B.like,suffix:H.isShow&&{icon:s.UNLIKE,activeIcon:s.UNLIKED,type:"unlike",value:!B.like&&B.unlike,onClick:function(){return B.like&&W({type:"like",value:!B.like}),B.like=!1,B.unlike=!B.unlike,{value:B.like,suffixValue:B.unlike}}},onClick:function(){return B.unlike=!1,B.like=!B.like,W({type:"like",value:B.like}),{value:B.like,suffixValue:B.unlike}}}),Q=e([G,J,M],A,!0).filter((function(e){return e}));return o("footer",i({className:"tui-live-footer ".concat(m)},{children:[l(c,{size:40,image:(null==q?void 0:q.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"}),o("div",i({className:"tui-live-footer-main"},{children:[o("div",i({className:"owner-name"},{children:[l("h1",{children:(null==q?void 0:q.nick)||(null==q?void 0:q.userID)}),l(a,{type:s.OWNER,width:15,height:15})]})),l("ul",i({className:"tui-live-list tag-list"},{children:null==z?void 0:z.map((function(e){return l("li",i({className:"tui-live-item tag-item"},{children:null==e?void 0:e.value}),e.value)}))}))]})),l("ul",i({className:"tui-live-list opate-list"},{children:Q}))]}))}var f=n.memo(m);export{f as TUILiveFooter};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation, Group } from 'tim-js-sdk';
|
|
3
|
-
import { TUILiveActivePorps, TUILiveTagParam } from '../../context/TUILiveContext.js';
|
|
4
|
-
|
|
5
|
-
interface TUILiveHeaderBaseProps {
|
|
6
|
-
className?: string;
|
|
7
|
-
conversation?: Conversation;
|
|
8
|
-
group?: Group;
|
|
9
|
-
}
|
|
10
|
-
interface TUILiveHeaderProps extends TUILiveHeaderBaseProps {
|
|
11
|
-
TUILiveHeader?: React.ComponentType<TUILiveHeaderBaseProps>;
|
|
12
|
-
menuIcon?: React.ReactElement;
|
|
13
|
-
follow?: TUILiveActivePorps;
|
|
14
|
-
subscribe?: TUILiveActivePorps;
|
|
15
|
-
onTagClick?: (data?: TUILiveTagParam) => void;
|
|
16
|
-
}
|
|
17
|
-
declare function UnMemoizedTUILiveHeader<T extends TUILiveHeaderProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
18
|
-
declare const TUILiveHeader: typeof UnMemoizedTUILiveHeader;
|
|
19
|
-
|
|
20
|
-
export { TUILiveHeader, TUILiveHeaderBaseProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as i,jsxs as l}from"react/jsx-runtime";import n from"react";import{useTUILiveContext as o}from"../../context/TUILiveContext.js";import{Icon as t}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";import{handleNumber as r}from"./untils.js";function c(n){var c=n.className,u=n.conversation,m=n.group,s=n.TUILiveHeader,v=n.menuIcon,d=n.follow,h=n.subscribe,p=n.onTagClick,f=o("TUILiveHeader"),N=f.group,I=f.follow,g=f.subscribe,b=f.menuIcon,C=f.onTagClick,x=f.memberCount,T=m||N,j=v||b,L=d||I,w=h||g,U=p||C;s&&i(s,{conversation:u,group:T});var k=((null==T?void 0:T.groupCustomField)||[]).filter((function(e){return null==e?void 0:e.value})),y=[{icon:a.MEMBER,value:x},{icon:a.UNION,value:L.num},{icon:a.VECTOR,value:w.num}];return l("header",e({className:"tui-live-header ".concat(c)},{children:[l("div",e({className:"tui-live-header-name"},{children:[i("h1",{children:(null==T?void 0:T.name)||(null==T?void 0:T.groupID)}),j]})),l("div",e({className:"tui-live-header-content"},{children:[l("div",e({className:"tui-live-header-label"},{children:[i(t,{className:"icon",type:a.LIVING,width:12,height:12}),i("p",{children:"Living"})]})),i("ul",e({className:"tui-live-list tag-list"},{children:null==k?void 0:k.map((function(l,n){return i("li",e({role:"menuitem",tabIndex:n,className:"tui-live-item tag-item",onClick:function(e){U({value:l.value,ele:e})}},{children:null==l?void 0:l.value}),l.value)}))})),i("ul",e({className:"tui-live-list"},{children:null==y?void 0:y.map((function(n){return l("li",e({className:"tui-live-item"},{children:[i(t,{className:"icon",type:n.icon,width:12,height:12}),i("span",e({className:"list-item-text"},{children:r(n.value)}))]}),n.icon)}))}))]}))]}))}var u=n.memo(c);export{u as TUILiveHeader};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { TUILiveMemberListItemParams } from '../../context/TUILiveContext.js';
|
|
3
|
-
|
|
4
|
-
interface TUILiveMemberListProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
memberGroupList?: Array<TUILiveMemberListItemParams>;
|
|
7
|
-
}
|
|
8
|
-
declare function UnMemoizedTUILiveMemberList<T extends TUILiveMemberListProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
9
|
-
declare const TUILiveMemberList: typeof UnMemoizedTUILiveMemberList;
|
|
10
|
-
|
|
11
|
-
export { TUILiveMemberList, TUILiveMemberListProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as l}from"tslib";import{jsx as i,jsxs as e}from"react/jsx-runtime";import n,{useState as t,useEffect as o}from"react";import{useTUILiveContext as r}from"../../context/TUILiveContext.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Avatar as s}from"../Avatar/Avatar.js";function u(n){n.className;var u=n.memberGroupList,v=r("TUILiveHeader"),c=v.memberGroupList,d=v.memberList,h=v.ownerProfile,p=t([]),f=p[0],g=p[1];return o((function(){var i=u||c;if((null==i?void 0:i.length)>0&&(null==d?void 0:d.length)>0&&0===(null==f?void 0:f.length)){var e=i.map((function(i){var e=l(l({},i),{list:[],show:!0});return e.filter&&(e.list=null==e?void 0:e.filter(d,h)),e}));g(e)}0===(null==i?void 0:i.length)&&(null==d?void 0:d.length)>0&&0===(null==f?void 0:f.length)&&g(e=[{title:"All",name:"All",show:!0,list:d}])}),[u,c,h,f,d]),i("main",l({className:"tui-live-members"},{children:null==f?void 0:f.map((function(n,t){var o;return e("ul",l({className:"list"},{children:[e("div",l({role:"menuitem",tabIndex:t,className:"list-header",onClick:function(){var i,e;i=t,e=f.map((function(e,n){return n===i?l(l({},e),{show:!e.show}):e})),g(e)}},{children:[i("h1",{children:null==n?void 0:n.title}),i(a,{type:m.ARROW_DOWN,width:12,height:7})]})),(null==n?void 0:n.show)&&(null===(o=null==n?void 0:n.list)||void 0===o?void 0:o.map((function(n){return e("li",l({className:"list-item"},{children:[i(s,{size:18,image:(null==n?void 0:n.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"}),i("span",l({className:"nick"},{children:(null==n?void 0:n.nick)||(null==n?void 0:n.userID)}))]}),null==n?void 0:n.userID)})))]}),null==n?void 0:n.name)}))}))}var v=n.memo(u);export{v as TUILiveMemberList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as i,__assign as t}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import{useState as l,useCallback as a}from"react";import{Icon as c}from"../../Icon/Icon.js";import"../../Icon/type.js";function r(r){var u=this,s=r.name;r.type;var m=r.icon,v=r.activeIcon,d=r.value,f=r.onClick;r.className;var h=r.suffix,p=r.iconWidth,x=r.iconHeight,b=l(d),I=b[0],k=b[1],C=l(null==h?void 0:h.value),N=C[0],w=C[1],y=a((function(){return e(u,void 0,void 0,(function(){var e;return i(this,(function(i){switch(i.label){case 0:return f?[4,f()]:[3,2];case 1:e=i.sent(),k(null==e?void 0:e.value),w(e.suffixValue),i.label=2;case 2:return[2]}}))}))}),[f]),g=a((function(){return e(u,void 0,void 0,(function(){var e;return i(this,(function(i){switch(i.label){case 0:return(null==h?void 0:h.onClick)?[4,null==h?void 0:h.onClick()]:[3,2];case 1:e=i.sent(),k(null==e?void 0:e.value),w(e.suffixValue),i.label=2;case 2:return[2]}}))}))}),[null==h?void 0:h.onClick]);return n("li",t({className:"tui-live-item opate-item"},{children:[n("div",t({className:"opate-box",role:"menuitem",tabIndex:0,onClick:y},{children:[o(c,{type:I?v:m,width:p||15,height:x||15}),o("span",t({className:"list-item-text"},{children:s}))]})),h&&o("div",t({role:"menuitem",tabIndex:0,className:"opate-item-suffix line opate-box",onClick:g},{children:o(c,{type:N?h.activeIcon:h.icon,width:p||15,height:x||15})}))]}),s)}export{r as useLiveAtiveElements};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as n,__generator as i}from"tslib";import{useState as l,useEffect as t}from"react";var e="https://web.sdk.qcloud.com/player/tcplayer/release",r={link:{type:"link",url:"tcplayer.min.css",isOnload:!1},TXLivePlayer:{type:"script",url:"libs/TXLivePlayer-1.2.3.min.js",isOnload:!1},hls:{type:"script",url:"libs/hls.min.1.1.5.js",isOnload:!1},flv:{type:"script",url:"libs/flv.min.1.6.3.js",isOnload:!1},dash:{type:"script",url:"libs/dash.all.min.4.4.1.js",isOnload:!1},tcplayer:{type:"script",url:"tcplayer.v4.6.0.min.js",isOnload:!1}};function o(o){var s=this,c=l(null),a=c[0],d=c[1],u=l(r),p=u[0],y=u[1],v=l(!1),m=v[0],f=v[1];return t((function(){n(s,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,void((null===window||void 0===window?void 0:window.TCPlayer)?f(!0):Object.keys(p).map((function(n){var i=document.createElement(p[n].type);return"link"===p[n].type?(i.href="".concat(e,"/").concat("v4.6.0","/").concat(p[n].url),i.rel="stylesheet"):i.src="".concat(e,"/").concat("v4.6.0","/").concat(p[n].url),document.body.appendChild(i),i.onload=function(){p[n].isOnload=!0,y(p),f(Object.keys(p).every((function(n){return p[n].isOnload})))},n})))];case 1:return n.sent(),[2]}}))}))}),[]),t((function(){if(m&&o){var n=null===window||void 0===window?void 0:window.TCPlayer(null==o?void 0:o.id,{});d(n)}}),[m,o]),{TCPlayer:a}}export{o as useLivePlayer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as n,__generator as t}from"tslib";import{useState as e,useCallback as o,useEffect as r}from"react";import i from"tim-js-sdk";function u(u){var l=this,a=u.tim,s=u.conversation,c=u.groupID,v=u.setActiveConversation,d=e(null),f=d[0],b=d[1],m=e(null),p=m[0],h=m[1],g=e(null),D=g[0],G=g[1],I=e(0),P=I[0],T=I[1],w=e(null),E=w[0],U=w[1],A=o((function(){return n(l,void 0,void 0,(function(){var n,e,o;return t(this,(function(t){switch(t.label){case 0:return!c||p?[3,3]:[4,null==a?void 0:a.getGroupProfile({groupID:c})];case 1:return n=t.sent(),h(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.group),[4,C(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.group)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}),[a,c]),C=function(e){return n(l,void 0,void 0,(function(){var n,o;return t(this,(function(t){switch(t.label){case 0:return(null==e?void 0:e.ownerID)?[4,null==a?void 0:a.getGroupMemberProfile({groupID:c,userIDList:[null==e?void 0:e.ownerID]})]:[3,2];case 1:n=t.sent(),G(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.memberList[0]),t.label=2;case 2:return[2]}}))}))},R=o((function(){return n(l,void 0,void 0,(function(){var n,e,o,r,i;return t(this,(function(t){switch(t.label){case 0:return c?[4,null==a?void 0:a.getGroupOnlineMemberCount(c)]:[3,3];case 1:return n=t.sent(),T(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.memberCount),(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.memberCount)>0?[4,null==a?void 0:a.getGroupMemberList({groupID:c,offset:0})]:[3,3];case 2:e=t.sent(),U(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.memberList),t.label=3;case 3:return[2]}}))}))}),[a]),O=function(n){console.log("onGroupAttributesUpdated",null==n?void 0:n.data)};return r((function(){return n(l,void 0,void 0,(function(){var n,e,o;return t(this,(function(t){switch(t.label){case 0:return f?[2]:s?(v(s),b(s),[3,3]):[3,1];case 1:return[4,null==a?void 0:a.getConversationProfile("GROUP".concat(c))];case 2:n=t.sent(),v(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.conversation),b(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.conversation),t.label=3;case 3:return[2]}}))})),function(){n(l,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return f?[4,null==a?void 0:a.deleteConversation("GROUP".concat(c))]:[3,3];case 1:return n.sent(),b(null),[4,null==a?void 0:a.quitGroup(c)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}}),[a,s,f]),r((function(){var e=null;return n(l,void 0,void 0,(function(){var o=this;return t(this,(function(r){switch(r.label){case 0:return[4,A()];case 1:return r.sent(),[4,R()];case 2:return r.sent(),e=setInterval((function(){return n(o,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,R()];case 1:return n.sent(),[2]}}))}))}),1e4),[2]}}))})),null==a||a.on(i.EVENT.GROUP_ATTRIBUTES_UPDATED,O),function(){null==a||a.off(i.EVENT.GROUP_ATTRIBUTES_UPDATED,O),e&&clearInterval(e)}}),[a,c]),r((function(){n(l,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return f&&p?[4,null==a?void 0:a.joinGroup({groupID:c,type:i.TYPES.GRP_AVCHATROOM})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}),[a,f,p]),{group:p,ownerProfile:D,memberCount:P,memberList:E}}export{u as useLiveState};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=function(e,o){void 0===o&&(o=0);var t="".concat(e);return 0===o&&(e>1e3&&e<1e4?t="".concat((e/1e3).toFixed(1),"K"):e>1e4&&(t="".concat((e/1e3).toFixed(0),"K"))),1===o&&e>1e4&&(t="".concat((e/1e4).toFixed(1),"W")),t};export{e as handleNumber};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { GroupMember, Conversation, Group, Profile } from 'tim-js-sdk';
|
|
3
|
-
import { OwnerLabelListItem } from '../components/TUILive/TUILiveFooter.js';
|
|
4
|
-
|
|
5
|
-
interface TUILiveActivePorps {
|
|
6
|
-
type?: 'follow' | 'subscribe' | 'like' | 'unlike';
|
|
7
|
-
value?: boolean;
|
|
8
|
-
isShow?: boolean;
|
|
9
|
-
num?: number;
|
|
10
|
-
}
|
|
11
|
-
interface TUILiveCallbackParams {
|
|
12
|
-
type?: 'follow' | 'subscribe' | 'like' | 'unlike';
|
|
13
|
-
value?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface TUILiveMemberListItemParams {
|
|
16
|
-
title?: React.ReactElement | string;
|
|
17
|
-
name?: string;
|
|
18
|
-
filter?: (list: Array<GroupMember>, ownerProfile: GroupMember) => Array<GroupMember>;
|
|
19
|
-
show?: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface TUILiveTagParam {
|
|
22
|
-
type?: 'header' | 'footer';
|
|
23
|
-
value?: string;
|
|
24
|
-
ele?: React.MouseEvent<HTMLLIElement, MouseEvent>;
|
|
25
|
-
}
|
|
26
|
-
interface TUILiveContextValue {
|
|
27
|
-
url?: string;
|
|
28
|
-
conversation?: Conversation;
|
|
29
|
-
group?: Group;
|
|
30
|
-
ownerProfile?: GroupMember;
|
|
31
|
-
myProfile?: Profile;
|
|
32
|
-
follow?: TUILiveActivePorps;
|
|
33
|
-
subscribe?: TUILiveActivePorps;
|
|
34
|
-
like?: TUILiveActivePorps;
|
|
35
|
-
unlike?: TUILiveActivePorps;
|
|
36
|
-
activePlugins?: Array<React.ReactElement>;
|
|
37
|
-
menuIcon?: React.ReactElement;
|
|
38
|
-
callback?: (data: TUILiveCallbackParams) => void;
|
|
39
|
-
memberGroupList?: Array<TUILiveMemberListItemParams>;
|
|
40
|
-
memberList?: Array<GroupMember>;
|
|
41
|
-
onTagClick?: (data?: TUILiveTagParam) => void;
|
|
42
|
-
memberCount?: number;
|
|
43
|
-
ownerLabelList?: Array<OwnerLabelListItem>;
|
|
44
|
-
}
|
|
45
|
-
declare const TUILiveContext: React.Context<TUILiveContextValue>;
|
|
46
|
-
declare function TUILiveContextProvider({ children, value }: PropsWithChildren<{
|
|
47
|
-
value: TUILiveContextValue;
|
|
48
|
-
}>): React.ReactElement;
|
|
49
|
-
declare const useTUILiveContext: (componentName?: string) => TUILiveContextValue;
|
|
50
|
-
|
|
51
|
-
export { TUILiveActivePorps, TUILiveCallbackParams, TUILiveContext, TUILiveContextProvider, TUILiveContextValue, TUILiveMemberListItemParams, TUILiveTagParam, useTUILiveContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as t}from"react/jsx-runtime";import e,{useContext as o}from"react";var i=e.createContext(void 0);function n(e){var o=e.children,n=e.value;return t(i.Provider,r({value:n},{children:o}))}var a=function(r){var t=o(i);return!t&&r?{}:t};export{i as TUILiveContext,n as TUILiveContextProvider,a as useTUILiveContext};
|