@selfcommunity/react-ui 0.8.0-live.57 → 0.8.0-live.59
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/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +8 -7
- package/lib/cjs/components/EventForm/EventAddress.js +7 -6
- package/lib/cjs/components/EventForm/EventForm.d.ts +6 -1
- package/lib/cjs/components/EventForm/EventForm.js +27 -9
- package/lib/cjs/components/EventForm/types.d.ts +2 -1
- package/lib/cjs/components/LiveStream/LiveStream.js +1 -1
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.d.ts +2 -1
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +1 -1
- package/lib/cjs/components/LiveStreamForm/constants.d.ts +3 -0
- package/lib/cjs/components/LiveStreamForm/constants.js +6 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +22 -11
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +5 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +8 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +27 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +65 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +26 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +194 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +38 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +61 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +247 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +31 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +4 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +5 -5
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +2 -1
- package/lib/cjs/shared/LiveStreamInfoDetails/index.js +9 -1
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +2 -1
- package/lib/esm/components/EventForm/EventAddress.js +7 -6
- package/lib/esm/components/EventForm/EventForm.d.ts +6 -1
- package/lib/esm/components/EventForm/EventForm.js +27 -9
- package/lib/esm/components/EventForm/types.d.ts +2 -1
- package/lib/esm/components/LiveStream/LiveStream.js +1 -1
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.d.ts +2 -1
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +1 -1
- package/lib/esm/components/LiveStreamForm/constants.d.ts +3 -0
- package/lib/esm/components/LiveStreamForm/constants.js +6 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +25 -14
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +5 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +6 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +60 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +26 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +191 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +35 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +61 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +241 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +4 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +6 -6
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +1 -0
- package/lib/esm/shared/LiveStreamInfoDetails/index.js +9 -1
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Track } from 'livekit-client';
|
|
5
|
+
import { useTrackToggle, CameraIcon, CameraDisabledIcon, MicDisabledIcon, MicIcon, ScreenShareIcon, ScreenShareStopIcon } from '@livekit/components-react';
|
|
6
|
+
export function getSourceIcon(source, enabled) {
|
|
7
|
+
switch (source) {
|
|
8
|
+
case Track.Source.Microphone:
|
|
9
|
+
return enabled ? _jsx(MicIcon, {}) : _jsx(MicDisabledIcon, {});
|
|
10
|
+
case Track.Source.Camera:
|
|
11
|
+
return enabled ? _jsx(CameraIcon, {}) : _jsx(CameraDisabledIcon, {});
|
|
12
|
+
case Track.Source.ScreenShare:
|
|
13
|
+
return enabled ? _jsx(ScreenShareStopIcon, {}) : _jsx(ScreenShareIcon, {});
|
|
14
|
+
default:
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* With the `TrackToggle` component it is possible to mute and unmute your camera and microphone.
|
|
20
|
+
* The component uses an html button element under the hood so you can treat it like a button.
|
|
21
|
+
*/
|
|
22
|
+
export const TrackToggle =
|
|
23
|
+
/* @__PURE__ */ React.forwardRef(function TrackToggle(_a, ref) {
|
|
24
|
+
var { showIcon, disabled } = _a, props = __rest(_a, ["showIcon", "disabled"]);
|
|
25
|
+
const { buttonProps, enabled } = useTrackToggle(props);
|
|
26
|
+
return (_jsxs("button", Object.assign({ ref: ref }, buttonProps, { disabled: disabled }, { children: [(showIcon !== null && showIcon !== void 0 ? showIcon : true) && getSourceIcon(props.source, enabled && !disabled), props.children] })));
|
|
27
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { MessageDecoder, MessageEncoder } from '@livekit/components-core';
|
|
3
3
|
import { MessageFormatter } from '@livekit/components-react';
|
|
4
|
+
import { SCUserType } from '@selfcommunity/types';
|
|
4
5
|
/**
|
|
5
6
|
* @public
|
|
6
7
|
*/
|
|
@@ -10,11 +11,11 @@ export interface VideoConferenceProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
10
11
|
chatMessageDecoder?: MessageDecoder;
|
|
11
12
|
/** @alpha */
|
|
12
13
|
SettingsComponent?: React.ComponentType;
|
|
13
|
-
speakerFocused?:
|
|
14
|
+
speakerFocused?: SCUserType;
|
|
14
15
|
disableChat?: boolean;
|
|
15
16
|
disableMicrophone?: boolean;
|
|
16
17
|
disableCamera?: boolean;
|
|
17
|
-
|
|
18
|
+
disableShareScreen?: boolean;
|
|
18
19
|
hideParticipantList?: boolean;
|
|
19
20
|
showSettings?: boolean;
|
|
20
21
|
}
|
|
@@ -36,4 +37,4 @@ export interface VideoConferenceProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
36
37
|
* ```
|
|
37
38
|
* @public
|
|
38
39
|
*/
|
|
39
|
-
export declare function VideoConference({ chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat, disableMicrophone, disableCamera,
|
|
40
|
+
export declare function VideoConference({ chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat, disableMicrophone, disableCamera, disableShareScreen, hideParticipantList, showSettings, ...props }: VideoConferenceProps): JSX.Element;
|
|
@@ -3,7 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { isEqualTrackRef, isTrackReference, isWeb, log } from '@livekit/components-core';
|
|
5
5
|
import { RoomEvent, Track } from 'livekit-client';
|
|
6
|
-
import { CarouselLayout, Chat, ConnectionStateToast, ControlBar, FocusLayout, FocusLayoutContainer, GridLayout, LayoutContextProvider,
|
|
6
|
+
import { CarouselLayout, Chat, ConnectionStateToast, ControlBar, FocusLayout, FocusLayoutContainer, GridLayout, LayoutContextProvider, RoomAudioRenderer, useCreateLayoutContext, useLocalParticipant, useParticipants, usePinnedTracks, useTracks } from '@livekit/components-react';
|
|
7
|
+
import { ParticipantTile } from './ParticipantTile';
|
|
7
8
|
/**
|
|
8
9
|
* The `VideoConference` ready-made component is your drop-in solution for a classic video conferencing application.
|
|
9
10
|
* It provides functionality such as focusing on one participant, grid view with pagination to handle large numbers
|
|
@@ -24,7 +25,7 @@ import { CarouselLayout, Chat, ConnectionStateToast, ControlBar, FocusLayout, Fo
|
|
|
24
25
|
*/
|
|
25
26
|
export function VideoConference(_a) {
|
|
26
27
|
var _b, _c;
|
|
27
|
-
var { chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat = false, disableMicrophone = false, disableCamera = false,
|
|
28
|
+
var { chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat = false, disableMicrophone = false, disableCamera = false, disableShareScreen = false, hideParticipantList = false, showSettings } = _a, props = __rest(_a, ["chatMessageFormatter", "chatMessageDecoder", "chatMessageEncoder", "SettingsComponent", "speakerFocused", "disableChat", "disableMicrophone", "disableCamera", "disableShareScreen", "hideParticipantList", "showSettings"]);
|
|
28
29
|
const [widgetState, setWidgetState] = React.useState({
|
|
29
30
|
showChat: false,
|
|
30
31
|
unreadMessages: 0,
|
|
@@ -70,7 +71,6 @@ export function VideoConference(_a) {
|
|
|
70
71
|
lastAutoFocusedScreenShareTrack.current = null;
|
|
71
72
|
}
|
|
72
73
|
if (focusTrack && !isTrackReference(focusTrack)) {
|
|
73
|
-
console.log('asdadsa');
|
|
74
74
|
const updatedFocusTrack = tracks.find((tr) => tr.participant.identity === focusTrack.participant.identity && tr.source === focusTrack.source);
|
|
75
75
|
if (updatedFocusTrack !== focusTrack && isTrackReference(updatedFocusTrack)) {
|
|
76
76
|
(_f = (_e = layoutContext.pin).dispatch) === null || _f === void 0 ? void 0 : _f.call(_e, { msg: 'set_pin', trackReference: updatedFocusTrack });
|
|
@@ -78,7 +78,7 @@ export function VideoConference(_a) {
|
|
|
78
78
|
}
|
|
79
79
|
else if (speakerFocused) {
|
|
80
80
|
const speaker = participants.find((pt) => {
|
|
81
|
-
return pt.name === speakerFocused;
|
|
81
|
+
return pt.name === speakerFocused.username;
|
|
82
82
|
});
|
|
83
83
|
if (speaker) {
|
|
84
84
|
const updatedFocusTrack = tracks.find((tr) => {
|
|
@@ -97,12 +97,12 @@ export function VideoConference(_a) {
|
|
|
97
97
|
participants,
|
|
98
98
|
speakerFocused
|
|
99
99
|
]);
|
|
100
|
-
return (_jsxs("div", Object.assign({ className: "lk-video-conference" }, props, { children: [isWeb() && (_jsxs(LayoutContextProvider, Object.assign({ value: layoutContext, onPinChange: handleFocusStateChange, onWidgetChange: widgetUpdate }, { children: [_jsxs("div", Object.assign({ className: "lk-video-conference-inner" }, { children: [!focusTrack ? (_jsx("div", Object.assign({ className: "lk-grid-layout-wrapper" }, { children: _jsx(GridLayout, Object.assign({ tracks: tracks }, { children: _jsx(ParticipantTile, {}) })) }))) : (_jsx("div", Object.assign({ className: "lk-focus-layout-wrapper" }, { children: _jsxs(FocusLayoutContainer, { children: [!hideParticipantList && (_jsx(CarouselLayout, Object.assign({ tracks: carouselTracks }, { children: _jsx(ParticipantTile, {}) }))), focusTrack && _jsx(FocusLayout, { trackRef: focusTrack })] }) }))), _jsx(ControlBar, { controls: Object.assign(Object.assign({}, (localParticipant.name !== speakerFocused
|
|
100
|
+
return (_jsxs("div", Object.assign({ className: "lk-video-conference" }, props, { children: [isWeb() && (_jsxs(LayoutContextProvider, Object.assign({ value: layoutContext, onPinChange: handleFocusStateChange, onWidgetChange: widgetUpdate }, { children: [_jsxs("div", Object.assign({ className: "lk-video-conference-inner" }, { children: [!focusTrack ? (_jsx("div", Object.assign({ className: "lk-grid-layout-wrapper" }, { children: _jsx(GridLayout, Object.assign({ tracks: tracks }, { children: _jsx(ParticipantTile, {}) })) }))) : (_jsx("div", Object.assign({ className: "lk-focus-layout-wrapper" }, { children: _jsxs(FocusLayoutContainer, { children: [!hideParticipantList && (_jsx(CarouselLayout, Object.assign({ tracks: carouselTracks }, { children: _jsx(ParticipantTile, {}) }))), focusTrack && _jsx(FocusLayout, { trackRef: focusTrack })] }) }))), _jsx(ControlBar, { controls: Object.assign(Object.assign({}, (localParticipant.name !== speakerFocused.username
|
|
101
101
|
? {
|
|
102
102
|
chat: !disableChat,
|
|
103
103
|
microphone: !disableMicrophone,
|
|
104
104
|
camera: !disableCamera,
|
|
105
|
-
screenShare: !
|
|
105
|
+
screenShare: !disableShareScreen
|
|
106
106
|
}
|
|
107
107
|
: {})), { settings: !!SettingsComponent }) })] })), !disableChat && (_jsx(Chat, { style: { display: widgetState.showChat ? 'grid' : 'none' }, messageFormatter: chatMessageFormatter, messageEncoder: chatMessageEncoder, messageDecoder: chatMessageDecoder })), SettingsComponent && (_jsx("div", Object.assign({ className: "lk-settings-menu-modal", style: { display: widgetState.showSettings ? 'block' : 'none' } }, { children: _jsx(SettingsComponent, {}) })))] }))), _jsx(RoomAudioRenderer, {}), _jsx(ConnectionStateToast, {})] })));
|
|
108
108
|
}
|
|
@@ -31,7 +31,15 @@ export default function LiveStreamInfoDetails(inProps) {
|
|
|
31
31
|
if (!scLiveStream) {
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
|
-
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: scLiveStream.closed_at ? 'calendar_off' : 'CalendarIcon' })),
|
|
34
|
+
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: scLiveStream.closed_at ? 'calendar_off' : 'CalendarIcon' })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.date.startEndTime", defaultMessage: "ui.eventInfoDetails.date.startEndTime", values: {
|
|
35
|
+
date: intl.formatDate(scLiveStream.created_at, {
|
|
36
|
+
weekday: 'long',
|
|
37
|
+
day: 'numeric',
|
|
38
|
+
year: 'numeric',
|
|
39
|
+
month: 'long'
|
|
40
|
+
}),
|
|
41
|
+
start: intl.formatDate(scLiveStream.created_at, { hour: 'numeric', minute: 'numeric' })
|
|
42
|
+
} }) })), hasInProgress && scLiveStream.running && (_jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.inProgress", defaultMessage: "ui.eventInfoDetails.inProgress" }) }, { children: _jsx(Box, { className: classes.inProgress }) })))] }))), beforeLocationInfo, hasLocationInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "play_circle_outline" })), _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream), target: "_blank", className: classes.link }, { children: _jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) })) }))] }))), beforeCreatedInfo, hasCreatedInfo && (_jsxs(Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "create" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
|
|
35
43
|
date: intl.formatDate(scLiveStream.created_at, {
|
|
36
44
|
weekday: 'long',
|
|
37
45
|
day: 'numeric',
|