@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.
Files changed (60) hide show
  1. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +8 -7
  2. package/lib/cjs/components/EventForm/EventAddress.js +7 -6
  3. package/lib/cjs/components/EventForm/EventForm.d.ts +6 -1
  4. package/lib/cjs/components/EventForm/EventForm.js +27 -9
  5. package/lib/cjs/components/EventForm/types.d.ts +2 -1
  6. package/lib/cjs/components/LiveStream/LiveStream.js +1 -1
  7. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.d.ts +2 -1
  8. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +1 -1
  9. package/lib/cjs/components/LiveStreamForm/constants.d.ts +3 -0
  10. package/lib/cjs/components/LiveStreamForm/constants.js +6 -3
  11. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +22 -11
  12. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +5 -1
  13. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
  14. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +8 -0
  15. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +27 -0
  16. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +65 -0
  17. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +26 -0
  18. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +194 -0
  19. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
  20. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +38 -0
  21. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +61 -0
  22. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +247 -0
  23. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
  24. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +31 -0
  25. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +4 -3
  26. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +5 -5
  27. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
  28. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +2 -1
  29. package/lib/cjs/shared/LiveStreamInfoDetails/index.js +9 -1
  30. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +2 -1
  31. package/lib/esm/components/EventForm/EventAddress.js +7 -6
  32. package/lib/esm/components/EventForm/EventForm.d.ts +6 -1
  33. package/lib/esm/components/EventForm/EventForm.js +27 -9
  34. package/lib/esm/components/EventForm/types.d.ts +2 -1
  35. package/lib/esm/components/LiveStream/LiveStream.js +1 -1
  36. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.d.ts +2 -1
  37. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +1 -1
  38. package/lib/esm/components/LiveStreamForm/constants.d.ts +3 -0
  39. package/lib/esm/components/LiveStreamForm/constants.js +6 -3
  40. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +25 -14
  41. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +5 -1
  42. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
  43. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +6 -0
  44. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +27 -0
  45. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +60 -0
  46. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +26 -0
  47. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +191 -0
  48. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
  49. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +35 -0
  50. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +61 -0
  51. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +241 -0
  52. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
  53. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +27 -0
  54. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +4 -3
  55. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +6 -6
  56. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
  57. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +1 -0
  58. package/lib/esm/shared/LiveStreamInfoDetails/index.js +9 -1
  59. package/lib/umd/react-ui.js +1 -1
  60. package/package.json +7 -7
@@ -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?: string;
14
+ speakerFocused?: SCUserType;
14
15
  disableChat?: boolean;
15
16
  disableMicrophone?: boolean;
16
17
  disableCamera?: boolean;
17
- disableScreenShare?: boolean;
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, disableScreenShare, hideParticipantList, showSettings, ...props }: VideoConferenceProps): JSX.Element;
40
+ export declare function VideoConference({ chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat, disableMicrophone, disableCamera, disableShareScreen, hideParticipantList, showSettings, ...props }: VideoConferenceProps): JSX.Element;
@@ -7,6 +7,7 @@ const React = tslib_1.__importStar(require("react"));
7
7
  const components_core_1 = require("@livekit/components-core");
8
8
  const livekit_client_1 = require("livekit-client");
9
9
  const components_react_1 = require("@livekit/components-react");
10
+ const ParticipantTile_1 = require("./ParticipantTile");
10
11
  /**
11
12
  * The `VideoConference` ready-made component is your drop-in solution for a classic video conferencing application.
12
13
  * It provides functionality such as focusing on one participant, grid view with pagination to handle large numbers
@@ -27,7 +28,7 @@ const components_react_1 = require("@livekit/components-react");
27
28
  */
28
29
  function VideoConference(_a) {
29
30
  var _b, _c;
30
- var { chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat = false, disableMicrophone = false, disableCamera = false, disableScreenShare = true, hideParticipantList = false, showSettings } = _a, props = tslib_1.__rest(_a, ["chatMessageFormatter", "chatMessageDecoder", "chatMessageEncoder", "SettingsComponent", "speakerFocused", "disableChat", "disableMicrophone", "disableCamera", "disableScreenShare", "hideParticipantList", "showSettings"]);
31
+ var { chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat = false, disableMicrophone = false, disableCamera = false, disableShareScreen = false, hideParticipantList = false, showSettings } = _a, props = tslib_1.__rest(_a, ["chatMessageFormatter", "chatMessageDecoder", "chatMessageEncoder", "SettingsComponent", "speakerFocused", "disableChat", "disableMicrophone", "disableCamera", "disableShareScreen", "hideParticipantList", "showSettings"]);
31
32
  const [widgetState, setWidgetState] = React.useState({
32
33
  showChat: false,
33
34
  unreadMessages: 0,
@@ -73,7 +74,6 @@ function VideoConference(_a) {
73
74
  lastAutoFocusedScreenShareTrack.current = null;
74
75
  }
75
76
  if (focusTrack && !(0, components_core_1.isTrackReference)(focusTrack)) {
76
- console.log('asdadsa');
77
77
  const updatedFocusTrack = tracks.find((tr) => tr.participant.identity === focusTrack.participant.identity && tr.source === focusTrack.source);
78
78
  if (updatedFocusTrack !== focusTrack && (0, components_core_1.isTrackReference)(updatedFocusTrack)) {
79
79
  (_f = (_e = layoutContext.pin).dispatch) === null || _f === void 0 ? void 0 : _f.call(_e, { msg: 'set_pin', trackReference: updatedFocusTrack });
@@ -81,7 +81,7 @@ function VideoConference(_a) {
81
81
  }
82
82
  else if (speakerFocused) {
83
83
  const speaker = participants.find((pt) => {
84
- return pt.name === speakerFocused;
84
+ return pt.name === speakerFocused.username;
85
85
  });
86
86
  if (speaker) {
87
87
  const updatedFocusTrack = tracks.find((tr) => {
@@ -100,12 +100,12 @@ function VideoConference(_a) {
100
100
  participants,
101
101
  speakerFocused
102
102
  ]);
103
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-conference" }, props, { children: [(0, components_core_1.isWeb)() && ((0, jsx_runtime_1.jsxs)(components_react_1.LayoutContextProvider, Object.assign({ value: layoutContext, onPinChange: handleFocusStateChange, onWidgetChange: widgetUpdate }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-conference-inner" }, { children: [!focusTrack ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-grid-layout-wrapper" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.GridLayout, Object.assign({ tracks: tracks }, { children: (0, jsx_runtime_1.jsx)(components_react_1.ParticipantTile, {}) })) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-focus-layout-wrapper" }, { children: (0, jsx_runtime_1.jsxs)(components_react_1.FocusLayoutContainer, { children: [!hideParticipantList && ((0, jsx_runtime_1.jsx)(components_react_1.CarouselLayout, Object.assign({ tracks: carouselTracks }, { children: (0, jsx_runtime_1.jsx)(components_react_1.ParticipantTile, {}) }))), focusTrack && (0, jsx_runtime_1.jsx)(components_react_1.FocusLayout, { trackRef: focusTrack })] }) }))), (0, jsx_runtime_1.jsx)(components_react_1.ControlBar, { controls: Object.assign(Object.assign({}, (localParticipant.name !== speakerFocused
103
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-conference" }, props, { children: [(0, components_core_1.isWeb)() && ((0, jsx_runtime_1.jsxs)(components_react_1.LayoutContextProvider, Object.assign({ value: layoutContext, onPinChange: handleFocusStateChange, onWidgetChange: widgetUpdate }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-conference-inner" }, { children: [!focusTrack ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-grid-layout-wrapper" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.GridLayout, Object.assign({ tracks: tracks }, { children: (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, {}) })) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-focus-layout-wrapper" }, { children: (0, jsx_runtime_1.jsxs)(components_react_1.FocusLayoutContainer, { children: [!hideParticipantList && ((0, jsx_runtime_1.jsx)(components_react_1.CarouselLayout, Object.assign({ tracks: carouselTracks }, { children: (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, {}) }))), focusTrack && (0, jsx_runtime_1.jsx)(components_react_1.FocusLayout, { trackRef: focusTrack })] }) }))), (0, jsx_runtime_1.jsx)(components_react_1.ControlBar, { controls: Object.assign(Object.assign({}, (localParticipant.name !== speakerFocused.username
104
104
  ? {
105
105
  chat: !disableChat,
106
106
  microphone: !disableMicrophone,
107
107
  camera: !disableCamera,
108
- screenShare: !disableScreenShare
108
+ screenShare: !disableShareScreen
109
109
  }
110
110
  : {})), { settings: !!SettingsComponent }) })] })), !disableChat && ((0, jsx_runtime_1.jsx)(components_react_1.Chat, { style: { display: widgetState.showChat ? 'grid' : 'none' }, messageFormatter: chatMessageFormatter, messageEncoder: chatMessageEncoder, messageDecoder: chatMessageDecoder })), SettingsComponent && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-settings-menu-modal", style: { display: widgetState.showSettings ? 'block' : 'none' } }, { children: (0, jsx_runtime_1.jsx)(SettingsComponent, {}) })))] }))), (0, jsx_runtime_1.jsx)(components_react_1.RoomAudioRenderer, {}), (0, jsx_runtime_1.jsx)(components_react_1.ConnectionStateToast, {})] })));
111
111
  }
@@ -1 +1,2 @@
1
1
  export declare const PREFIX = "SCLiveStreamVideoConference";
2
+ export declare const BAN_ROOM_USER = "_ban_room_user";
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PREFIX = void 0;
3
+ exports.BAN_ROOM_USER = exports.PREFIX = void 0;
4
4
  exports.PREFIX = 'SCLiveStreamVideoConference';
5
+ exports.BAN_ROOM_USER = '_ban_room_user';
@@ -33,7 +33,15 @@ function LiveStreamInfoDetails(inProps) {
33
33
  if (!scLiveStream) {
34
34
  return null;
35
35
  }
36
- return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: scLiveStream.closed_at ? 'calendar_off' : 'CalendarIcon' })), hasInProgress && scLiveStream.running && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.inProgress", defaultMessage: "ui.eventInfoDetails.inProgress" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.inProgress }) })))] }))), beforeLocationInfo, hasLocationInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "play_circle_outline" })), (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream), target: "_blank", className: classes.link }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.url }, { children: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) })) }))] }))), beforeCreatedInfo, hasCreatedInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "create" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
36
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: scLiveStream.closed_at ? 'calendar_off' : 'CalendarIcon' })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.date.startEndTime", defaultMessage: "ui.eventInfoDetails.date.startEndTime", values: {
37
+ date: intl.formatDate(scLiveStream.created_at, {
38
+ weekday: 'long',
39
+ day: 'numeric',
40
+ year: 'numeric',
41
+ month: 'long'
42
+ }),
43
+ start: intl.formatDate(scLiveStream.created_at, { hour: 'numeric', minute: 'numeric' })
44
+ } }) })), hasInProgress && scLiveStream.running && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.inProgress", defaultMessage: "ui.eventInfoDetails.inProgress" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.inProgress }) })))] }))), beforeLocationInfo, hasLocationInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "play_circle_outline" })), (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream), target: "_blank", className: classes.link }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.url }, { children: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) })) }))] }))), beforeCreatedInfo, hasCreatedInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "create" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
37
45
  date: intl.formatDate(scLiveStream.created_at, {
38
46
  weekday: 'long',
39
47
  day: 'numeric',
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import { useThemeProps } from '@mui/system';
6
6
  import { useSCUser } from '@selfcommunity/react-core';
7
+ import { SCEventLocationType } from '@selfcommunity/types';
7
8
  import classNames from 'classnames';
8
9
  import { FormattedMessage } from 'react-intl';
9
10
  import BaseDialog from '../../shared/BaseDialog';
@@ -95,5 +96,5 @@ export default function CreateLiveStreamDialog(inProps) {
95
96
  /**
96
97
  * Renders root object
97
98
  */
98
- return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: 'md', title: _jsxs(Box, Object.assign({ className: classes.title, component: 'span' }, { children: [Boolean(step === CreateLiveStreamStep.CREATE_LIVE && canCreateEvent) && (_jsx(Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: _jsx(Icon, { children: "arrow_back" }) }, { children: "Back" }))), _jsx(Box, Object.assign({ component: 'span' }, { children: _jsx(FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, scroll: 'paper', onClose: onClose, className: classNames(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: _jsxs(Box, Object.assign({ className: classes.content }, { children: [step === CreateLiveStreamStep.SELECT_TYPE && (_jsx(LiveStreamSelector, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === CreateLiveStreamStep.CREATE_LIVE && (_jsx(_Fragment, { children: liveType === LiveStreamType.EVENT_LIVE ? _jsx(EventForm, { onSuccess: handleSubmit }) : _jsx(LiveStreamForm, { onSuccess: handleSubmit }) }))] })) })));
99
+ return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: 'md', title: _jsxs(Box, Object.assign({ className: classes.title, component: 'span' }, { children: [Boolean(step === CreateLiveStreamStep.CREATE_LIVE && canCreateEvent) && (_jsx(Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: _jsx(Icon, { children: "arrow_back" }) }, { children: "Back" }))), _jsx(Box, Object.assign({ component: 'span' }, { children: _jsx(FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, scroll: 'paper', onClose: onClose, className: classNames(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: _jsxs(Box, Object.assign({ className: classes.content }, { children: [step === CreateLiveStreamStep.SELECT_TYPE && (_jsx(LiveStreamSelector, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === CreateLiveStreamStep.CREATE_LIVE && (_jsx(_Fragment, { children: liveType === LiveStreamType.EVENT_LIVE ? _jsx(EventForm, { presetLocation: SCEventLocationType.LIVESTREAM, onSuccess: handleSubmit }) : _jsx(LiveStreamForm, { onSuccess: handleSubmit }) }))] })) })));
99
100
  }
@@ -56,12 +56,12 @@ export default function EventAddress(inProps) {
56
56
  const [suggestions, setSuggestions] = useState([]);
57
57
  const [timeoutId, setTimeoutId] = useState(null);
58
58
  const liveStream = useMemo(() => {
59
- console.log(event);
60
- return {
61
- title: (event === null || event === void 0 ? void 0 : event.name) || `${intl.formatMessage(messages.name)}`,
62
- created_at: (event === null || event === void 0 ? void 0 : event.start_date) || getNewDate(),
63
- settings: /* event?.livestream?.settings || */ LIVESTREAM_DEFAULT_SETTINGS
64
- } /* || event.livestream? */;
59
+ return (event.live_stream ||
60
+ {
61
+ title: (event === null || event === void 0 ? void 0 : event.name) || `${intl.formatMessage(messages.name)}`,
62
+ created_at: (event === null || event === void 0 ? void 0 : event.start_date) || getNewDate(),
63
+ settings: LIVESTREAM_DEFAULT_SETTINGS
64
+ });
65
65
  }, [event]);
66
66
  // CONTEXT
67
67
  const scContext = useSCContext();
@@ -73,6 +73,7 @@ export default function EventAddress(inProps) {
73
73
  // HANDLERS
74
74
  const handleChange = (_event, newValue) => {
75
75
  setLocation(newValue);
76
+ forwardGeolocationData({ location: newValue });
76
77
  };
77
78
  const handleSelection = (_event, newValue) => __awaiter(this, void 0, void 0, function* () {
78
79
  if (newValue) {
@@ -1,5 +1,5 @@
1
1
  import { BoxProps } from '@mui/material';
2
- import { SCEventType } from '@selfcommunity/types';
2
+ import { SCEventLocationType, SCEventType } from '@selfcommunity/types';
3
3
  export interface EventFormProps extends BoxProps {
4
4
  /**
5
5
  * Overrides or extends the styles applied to the component.
@@ -11,6 +11,11 @@ export interface EventFormProps extends BoxProps {
11
11
  * @default null
12
12
  */
13
13
  event?: SCEventType;
14
+ /**
15
+ * Initial location
16
+ * @default SCEventLocationType.PERSON
17
+ */
18
+ presetLocation?: SCEventLocationType;
14
19
  /**
15
20
  * On success callback function
16
21
  * @default null
@@ -118,7 +118,7 @@ export default function EventForm(inProps) {
118
118
  props: inProps,
119
119
  name: PREFIX
120
120
  });
121
- const { className, onSuccess, onError, event = null } = props, rest = __rest(props, ["className", "onSuccess", "onError", "event"]);
121
+ const { className, onSuccess, onError, event, presetLocation = SCEventLocationType.PERSON } = props, rest = __rest(props, ["className", "onSuccess", "onError", "event", "presetLocation"]);
122
122
  // CONTEXT
123
123
  const scContext = useSCContext();
124
124
  // INTL
@@ -126,20 +126,25 @@ export default function EventForm(inProps) {
126
126
  const startDateTime = useMemo(() => getNewDate(event === null || event === void 0 ? void 0 : event.start_date), [event]);
127
127
  const endDateTime = useMemo(() => getNewDate(event === null || event === void 0 ? void 0 : event.end_date), [event]);
128
128
  const initialFieldState = {
129
+ name: (event === null || event === void 0 ? void 0 : event.name) || '',
130
+ description: event ? event.description : '',
129
131
  imageOriginal: (event === null || event === void 0 ? void 0 : event.image_bigger) || '',
130
132
  imageOriginalFile: '',
131
133
  startDate: event ? startDateTime : getNewDate(),
132
134
  startTime: event ? startDateTime : getLaterHoursDate(1),
133
135
  endDate: (event === null || event === void 0 ? void 0 : event.end_date) ? endDateTime : getNewDate(),
134
136
  endTime: (event === null || event === void 0 ? void 0 : event.end_date) ? endDateTime : getLaterHoursDate(3),
135
- location: (event === null || event === void 0 ? void 0 : event.location) || SCEventLocationType.PERSON,
137
+ location: (event === null || event === void 0 ? void 0 : event.location)
138
+ ? event.location === SCEventLocationType.ONLINE && event.live_stream
139
+ ? SCEventLocationType.LIVESTREAM
140
+ : SCEventLocationType.ONLINE
141
+ : presetLocation,
136
142
  geolocation: (event === null || event === void 0 ? void 0 : event.geolocation) || '',
137
143
  lat: (event === null || event === void 0 ? void 0 : event.geolocation_lat) || null,
138
144
  lng: (event === null || event === void 0 ? void 0 : event.geolocation_lng) || null,
139
145
  link: (event === null || event === void 0 ? void 0 : event.link) || '',
146
+ liveStreamSettings: (event === null || event === void 0 ? void 0 : event.live_stream) ? event === null || event === void 0 ? void 0 : event.live_stream.settings : null,
140
147
  recurring: (event === null || event === void 0 ? void 0 : event.recurring) || SCEventRecurrenceType.NEVER,
141
- name: (event === null || event === void 0 ? void 0 : event.name) || '',
142
- description: event ? event.description : '',
143
148
  isPublic: (_a = (event === null || event === void 0 ? void 0 : event.privacy) === SCEventPrivacyType.PUBLIC) !== null && _a !== void 0 ? _a : true,
144
149
  isSubmitting: false
145
150
  };
@@ -185,7 +190,7 @@ export default function EventForm(inProps) {
185
190
  setField((prev) => (Object.assign(Object.assign({}, prev), data)));
186
191
  }, []);
187
192
  const handleLiveStreamSettingsData = useCallback((data) => {
188
- setField((prev) => (Object.assign(Object.assign({}, prev), data)));
193
+ setField((prev) => (Object.assign(Object.assign({}, prev), { liveStreamSettings: Object.assign(Object.assign({}, prev.liveStreamSettings), data) })));
189
194
  }, []);
190
195
  const handleSubmit = useCallback(() => {
191
196
  setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: true })));
@@ -197,14 +202,21 @@ export default function EventForm(inProps) {
197
202
  formData.append('start_date', combineDateAndTime(field.startDate, field.startTime));
198
203
  formData.append('recurring', field.recurring);
199
204
  formData.append('end_date', combineDateAndTime(field.endDate, field.endTime));
200
- formData.append('location', field.location);
205
+ formData.append('location', field.location === SCEventLocationType.PERSON ? SCEventLocationType.PERSON : SCEventLocationType.ONLINE);
201
206
  if (field.location === SCEventLocationType.ONLINE) {
202
207
  formData.append('link', field.link);
208
+ formData.append('live_stream_settings', '');
209
+ }
210
+ else if (field.location === SCEventLocationType.LIVESTREAM) {
211
+ formData.append('link', '');
212
+ formData.append('live_stream_settings', JSON.stringify(field.liveStreamSettings));
203
213
  }
204
214
  else if (field.location === SCEventLocationType.PERSON) {
205
215
  formData.append('geolocation', field.geolocation);
206
216
  formData.append('geolocation_lat', field.lat.toString());
207
217
  formData.append('geolocation_lng', field.lng.toString());
218
+ formData.append('link', '');
219
+ formData.append('live_stream_settings', '');
208
220
  }
209
221
  if (privateEnabled) {
210
222
  formData.append('privacy', field.isPublic ? SCEventPrivacyType.PUBLIC : SCEventPrivacyType.PRIVATE);
@@ -315,11 +327,17 @@ export default function EventForm(inProps) {
315
327
  var _a;
316
328
  return (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "access_time" }) }) }))) }), error: Boolean(error['endDateError']), helperText: ((_a = error['endDateError']) === null || _a === void 0 ? void 0 : _a.error) ? (_jsx(FormattedMessage, { id: "ui.eventForm.time.end.error.invalid", defaultMessage: "ui.eventForm.time.end.error.invalid" })) : null })));
317
329
  }
318
- }, onChange: (value) => handleChangeDateTime(value, 'endTime'), shouldDisableTime: shouldDisabledTime })] })) })), _jsx(EventAddress, { forwardGeolocationData: handleGeoData, forwardLivestreamSettingsData: handleLiveStreamSettingsData, event: event !== null && event !== void 0 ? event : {
330
+ }, onChange: (value) => handleChangeDateTime(value, 'endTime'), shouldDisableTime: shouldDisabledTime })] })) })), _jsx(EventAddress, { forwardGeolocationData: handleGeoData, forwardLivestreamSettingsData: handleLiveStreamSettingsData, event: Object.assign(Object.assign({}, event), {
319
331
  name: field.name,
320
332
  start_date: field.startDate,
321
- geolocation: field.geolocation
322
- } }), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.privacySection }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [_jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), _jsx(Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: event && !field.isPublic }), _jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), _jsx(Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? (_jsx(FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
333
+ location: field.location,
334
+ geolocation: field.geolocation,
335
+ live_stream: {
336
+ title: field.name || `${intl.formatMessage(messages.name)}`,
337
+ created_at: field.startDate,
338
+ settings: field.liveStreamSettings
339
+ }
340
+ }) }), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.privacySection }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [_jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), _jsx(Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: event && !field.isPublic }), _jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), _jsx(Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? (_jsx(FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
323
341
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
324
342
  // @ts-ignore
325
343
  b: (chunks) => _jsx("strong", { children: chunks })
@@ -1,4 +1,4 @@
1
- import { SCEventLocationType, SCEventRecurrenceType } from '@selfcommunity/types';
1
+ import { SCEventLocationType, SCEventRecurrenceType, SCLiveStreamSettingsType } from '@selfcommunity/types';
2
2
  export type Place = {
3
3
  description: string;
4
4
  id?: string;
@@ -9,6 +9,7 @@ export type Geolocation = {
9
9
  lat?: number;
10
10
  lng?: number;
11
11
  link?: string;
12
+ liveStreamSettings?: SCLiveStreamSettingsType;
12
13
  };
13
14
  export type InitialFieldState = Geolocation & {
14
15
  imageOriginal: string | ArrayBuffer;
@@ -124,7 +124,7 @@ export default function LiveStream(inProps) {
124
124
  contentObj = (_jsxs(DetailRoot, Object.assign({ className: classes.detailRoot }, { children: [_jsxs(Box, Object.assign({ className: classes.detailImageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: scLiveStream.cover, alt: scLiveStream.title, className: classes.detailImage }), !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.liveStream.inProgress", defaultMessage: "ui.liveStream.inProgress" }), className: classes.detailInProgress })), _jsx(Calendar, { day: new Date(scLiveStream.created_at).getDate() })] })), _jsxs(CardContent, Object.assign({ className: classes.detailContent }, { children: [_jsx(Box, Object.assign({ className: classes.detailNameWrapper }, { children: _jsx(Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scLiveStream.title })) })), _jsx(LiveStreamInfoDetails, { liveStream: scLiveStream }), !hideLiveStreamHost && (_jsx(User, { user: scLiveStream.host, elevation: 0, secondary: _jsx(Typography, Object.assign({ variant: "caption" }, { children: _jsx(FormattedMessage, { id: "ui.myEventsWidget.planner", defaultMessage: "ui.myEventsWidget.planner" }) })), actions: _jsx(_Fragment, {}), className: classes.detailUser })), _jsx(Divider, { className: classes.detailSecondDivider })] })), actions !== null && actions !== void 0 ? actions : (_jsx(CardActions, Object.assign({ className: classes.detailActions }, { children: _jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.liveStream.see", id: "ui.liveStream.see" }) })) })))] })));
125
125
  }
126
126
  else if (template === SCLiveStreamTemplateType.PREVIEW) {
127
- contentObj = (_jsxs(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [_jsxs(Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: scLiveStream.cover, alt: scLiveStream.title, className: classes.previewImage }), !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.liveStream.inProgress", defaultMessage: "ui.liveStream.inProgress" }), className: classes.previewInProgress }))] })), _jsx(CardContent, Object.assign({ className: classes.previewContent }, { children: _jsx(LiveStreamInfoDetails, { liveStream: scLiveStream, hasLocationInfo: false, beforeDateInfo: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scLiveStream), className: classes.previewNameWrapper }, { children: _jsx(Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scLiveStream.title })) })) }) })), actions !== null && actions !== void 0 ? actions : (_jsx(CardActions, Object.assign({ className: classes.previewActions }, { children: _jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scLiveStream) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.liveStream.see", id: "ui.liveStream.see" }) })) })))] })));
127
+ contentObj = (_jsxs(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [_jsxs(Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: scLiveStream.cover, alt: scLiveStream.title, className: classes.previewImage }), !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.liveStream.inProgress", defaultMessage: "ui.liveStream.inProgress" }), className: classes.previewInProgress }))] })), _jsx(CardContent, Object.assign({ className: classes.previewContent }, { children: _jsx(LiveStreamInfoDetails, { liveStream: scLiveStream, beforeDateInfo: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream), className: classes.previewNameWrapper }, { children: _jsx(Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scLiveStream.title })) })) }) })), actions !== null && actions !== void 0 ? actions : (_jsx(CardActions, Object.assign({ className: classes.previewActions }, { children: _jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.liveStream.see", id: "ui.liveStream.see" }) })) })))] })));
128
128
  }
129
129
  else {
130
130
  contentObj = (_jsx(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: _jsxs(Box, Object.assign({ className: classes.snippetImage }, { children: [_jsx(Avatar, { variant: "square", alt: scLiveStream.title, src: scLiveStream.cover, className: classes.snippetAvatar }), ' ', !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.liveStream.inProgress", defaultMessage: "ui.liveStream.inProgress" }), className: classes.snippetInProgress }))] })), primary: _jsxs(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scLiveStream), className: classes.snippetPrimary }, { children: [_jsx(Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scLiveStream.created_at, {
@@ -1,4 +1,5 @@
1
1
  import { BoxProps } from '@mui/material';
2
+ import { SCLiveStreamSettingsType } from '@selfcommunity/types';
2
3
  export declare const PREFIX = "SCLiveStreamFormSettings";
3
4
  export interface LiveStreamFormSettingsProps extends BoxProps {
4
5
  /**
@@ -10,7 +11,7 @@ export interface LiveStreamFormSettingsProps extends BoxProps {
10
11
  * Event Object
11
12
  * @default null
12
13
  */
13
- settings?: Record<string, any>;
14
+ settings?: SCLiveStreamSettingsType;
14
15
  /**
15
16
  * onChange callback
16
17
  * @param data
@@ -51,7 +51,7 @@ export default function LiveStreamSettingsForm(inProps) {
51
51
  /**
52
52
  * Renders root object
53
53
  */
54
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.muteParticipant), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['muteParticipant']: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipant) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.muteParticipant", defaultMessage: "ui.liveStreamForm.muteParticipant" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.hideParticipantList), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['hideParticipantList']: !(settings === null || settings === void 0 ? void 0 : settings.hideParticipantList) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.hideParticipantList", defaultMessage: "ui.liveStreamForm.hideParticipantList" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['automaticallyNotifyFollowers']: !(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.automaticallyNotifyFollowers", defaultMessage: "ui.liveStreamForm.automaticallyNotifyFollowers" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableVideo), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['disableVideo']: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableVideo", defaultMessage: "ui.liveStreamForm.disableVideo" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableChat), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['disableChat']: !(settings === null || settings === void 0 ? void 0 : settings.disableChat) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableChat", defaultMessage: "ui.liveStreamForm.disableChat" }) }))] })), _jsxs(FormControl, Object.assign({ className: classes.accessView }, { children: [_jsx(InputLabel, Object.assign({ id: "viewLabel" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }) })), _jsx(Select, Object.assign({ name: "view", label: _jsx(FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }), labelId: "viewLabel", fullWidth: true, value: (_a = settings === null || settings === void 0 ? void 0 : settings.view) !== null && _a !== void 0 ? _a : SCLiveStreamViewType.SPEAKER, onChange: (e) => onChange(Object.assign(Object.assign({}, settings), { ['view']: e.target.value })), displayEmpty: true, renderValue: (selected) => {
54
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.muteParticipant), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['muteParticipant']: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipant) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.muteParticipant", defaultMessage: "ui.liveStreamForm.muteParticipant" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableVideo), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['disableVideo']: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableVideo", defaultMessage: "ui.liveStreamForm.disableVideo" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableChat), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['disableChat']: !(settings === null || settings === void 0 ? void 0 : settings.disableChat) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableChat", defaultMessage: "ui.liveStreamForm.disableChat" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['disableShareScreen']: !(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableShareScreen", defaultMessage: "ui.liveStreamForm.disableShareScreen" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.hideParticipantList), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['hideParticipantList']: !(settings === null || settings === void 0 ? void 0 : settings.hideParticipantList) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.hideParticipantList", defaultMessage: "ui.liveStreamForm.hideParticipantList" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers), onChange: () => onChange(Object.assign(Object.assign({}, settings), { ['automaticallyNotifyFollowers']: !(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.automaticallyNotifyFollowers", defaultMessage: "ui.liveStreamForm.automaticallyNotifyFollowers" }) }))] })), _jsxs(FormControl, Object.assign({ className: classes.accessView }, { children: [_jsx(InputLabel, Object.assign({ id: "viewLabel" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }) })), _jsx(Select, Object.assign({ name: "view", label: _jsx(FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }), labelId: "viewLabel", fullWidth: true, value: (_a = settings === null || settings === void 0 ? void 0 : settings.view) !== null && _a !== void 0 ? _a : SCLiveStreamViewType.SPEAKER, onChange: (e) => onChange(Object.assign(Object.assign({}, settings), { ['view']: e.target.value })), displayEmpty: true, renderValue: (selected) => {
55
55
  return (_jsxs(_Fragment, { children: [_jsx(Icon, Object.assign({ className: classes.accessViewIcon }, { children: selected === SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", _jsx(FormattedMessage, { id: `ui.liveStreamForm.view.${selected}`, defaultMessage: `ui.liveStreamForm.view.${selected}` })] }));
56
56
  } }, { children: Object.values(SCLiveStreamViewType).map((f) => (_jsx(MenuItem, Object.assign({ value: f }, { children: _jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsxs("b", { children: [_jsx(Icon, Object.assign({ className: classes.accessViewIcon }, { children: f === SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", _jsx(FormattedMessage, { id: `ui.liveStreamForm.view.${f}`, defaultMessage: `ui.liveStreamForm.view.${f}` })] }) })), _jsx(Typography, { children: _jsx(FormattedMessage, { id: `ui.liveStreamForm.view.${f}.description`, defaultMessage: `ui.liveStreamForm.view.${f}.description` }) })] }) }), f))) }))] }))] })));
57
57
  }
@@ -1,3 +1,4 @@
1
+ import { SCLiveStreamViewType } from '@selfcommunity/types';
1
2
  export declare const PREFIX = "SCLiveStreamForm";
2
3
  export declare const LIVESTREAM_DEFAULT_SETTINGS: {
3
4
  muteParticipant: boolean;
@@ -5,4 +6,6 @@ export declare const LIVESTREAM_DEFAULT_SETTINGS: {
5
6
  automaticallyNotifyFollowers: boolean;
6
7
  disableVideo: boolean;
7
8
  disableChat: boolean;
9
+ disableShareScreen: boolean;
10
+ view: SCLiveStreamViewType;
8
11
  };
@@ -1,8 +1,11 @@
1
+ import { SCLiveStreamViewType } from '@selfcommunity/types';
1
2
  export const PREFIX = 'SCLiveStreamForm';
2
3
  export const LIVESTREAM_DEFAULT_SETTINGS = {
3
4
  muteParticipant: true,
4
- hideParticipantList: true,
5
- automaticallyNotifyFollowers: true,
5
+ hideParticipantList: false,
6
+ automaticallyNotifyFollowers: false,
6
7
  disableVideo: true,
7
- disableChat: false
8
+ disableChat: false,
9
+ disableShareScreen: true,
10
+ view: SCLiveStreamViewType.SPEAKER
8
11
  };
@@ -1,19 +1,20 @@
1
- import { __awaiter, __rest } from "tslib";
1
+ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Box, CircularProgress, Typography } from '@mui/material';
3
+ import { Alert, Box, CircularProgress, Typography } from '@mui/material';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import { useThemeProps } from '@mui/system';
6
- import { useSCFetchLiveStream, useSCUser } from '@selfcommunity/react-core';
6
+ import { SCPreferences, useSCFetchLiveStream, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
7
+ import { SCFeatureName } from '@selfcommunity/types';
7
8
  import classNames from 'classnames';
8
9
  import { FormattedMessage } from 'react-intl';
9
10
  import { PREFIX } from './constants';
10
- import { PreJoin } from '@livekit/components-react';
11
11
  import { useCallback, useMemo, useState } from 'react';
12
12
  import LiveStreamVideoConference from './LiveStreamVideoConference';
13
13
  import '@livekit/components-styles';
14
14
  import { LiveStreamService } from '@selfcommunity/api-services';
15
15
  import { Logger } from '@selfcommunity/utils';
16
16
  import { SCOPE_SC_UI } from '../../constants/Errors';
17
+ import { PreJoin } from './LiveStreamVideoConference/PreJoin';
17
18
  const classes = {
18
19
  root: `${PREFIX}-root`,
19
20
  content: `${PREFIX}-content`,
@@ -57,29 +58,34 @@ const Root = styled(Box, {
57
58
  * @param inProps
58
59
  */
59
60
  export default function LiveStreamRoom(inProps) {
60
- var _a;
61
+ var _a, _b, _c, _d;
61
62
  //PROPS
62
63
  const props = useThemeProps({
63
64
  props: inProps,
64
65
  name: PREFIX
65
66
  });
66
- const { id = `live_stream_room_object_${props.liveStreamId ? props.liveStreamId : props.liveStream ? props.liveStream.id : ''}`, liveStreamId = null, liveStream = null, className, showPrejoinTitle = true, showPrejoinDescription = false, startPrejoinContent, endPrejoinContent, presetConnectionDetails, presetPreJoinChoices, LiveStreamVideoConferenceComponentProps = {} } = props, rest = __rest(props, ["id", "liveStreamId", "liveStream", "className", "showPrejoinTitle", "showPrejoinDescription", "startPrejoinContent", "endPrejoinContent", "presetConnectionDetails", "presetPreJoinChoices", "LiveStreamVideoConferenceComponentProps"]);
67
+ const { id = `live_stream_room_object_${props.liveStreamId ? props.liveStreamId : props.liveStream ? props.liveStream.id : ''}`, liveStreamId = null, liveStream = null, className, showPrejoinTitle = true, showPrejoinDescription = false, startPrejoinContent, endPrejoinContent, presetConnectionDetails, presetPreJoinChoices, LiveStreamVideoConferenceComponentProps = { options: { codec: 'vp8', hq: false } } } = props, rest = __rest(props, ["id", "liveStreamId", "liveStream", "className", "showPrejoinTitle", "showPrejoinDescription", "startPrejoinContent", "endPrejoinContent", "presetConnectionDetails", "presetPreJoinChoices", "LiveStreamVideoConferenceComponentProps"]);
67
68
  // CONTEXT
68
69
  const scUserContext = useSCUser();
70
+ const { preferences, features } = useSCPreferences();
69
71
  // STATE
70
72
  const { scLiveStream } = useSCFetchLiveStream({ id: liveStreamId, liveStream });
71
73
  const [preJoinChoices, setPreJoinChoices] = useState(presetPreJoinChoices);
72
74
  const [loading, setLoading] = useState(false);
73
75
  const preJoinDefaults = useMemo(() => {
74
- var _a, _b, _c, _d, _e;
76
+ var _a, _b, _c;
75
77
  return {
76
78
  username: ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) || '',
77
- videoEnabled: (_c = (_b = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo) !== null && _c !== void 0 ? _c : true,
78
- audioEnabled: (_e = (_d = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _d === void 0 ? void 0 : _d.muteParticipant) !== null && _e !== void 0 ? _e : true
79
+ videoEnabled: ((_b = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo) === false,
80
+ audioEnabled: ((_c = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipant) === false
79
81
  };
80
82
  }, [scUserContext.user, scLiveStream]);
81
83
  const [connectionDetails, setConnectionDetails] = useState(presetConnectionDetails);
82
- const canCreateLiveStream = useMemo(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
84
+ const liveStreamEnabled = useMemo(() => preferences &&
85
+ features &&
86
+ features.includes(SCFeatureName.LIVE_STREAM) &&
87
+ SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
88
+ preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [preferences, features]);
83
89
  const toggleAttrDisabledPrejoinActions = useCallback((disabled) => {
84
90
  const container = document.querySelector('.lk-prejoin');
85
91
  if (container) {
@@ -91,11 +97,13 @@ export default function LiveStreamRoom(inProps) {
91
97
  });
92
98
  }
93
99
  }, []);
100
+ const canUseAudio = useMemo(() => { var _a; return (scUserContext.user && liveStream && liveStream.host.id === scUserContext.user.id) || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipant)); }, [scUserContext, liveStream]);
101
+ const canUseVideo = useMemo(() => { var _a; return (scUserContext.user && liveStream && liveStream.host.id === scUserContext.user.id) || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.disableVideo)); }, [scUserContext, liveStream]);
94
102
  // HANDLERS
95
103
  /**
96
104
  * Handle PreJoin Submit
97
105
  */
98
- const handlePreJoinSubmit = useCallback((values) => __awaiter(this, void 0, void 0, function* () {
106
+ const handlePreJoinSubmit = useCallback((values) => {
99
107
  if (scLiveStream) {
100
108
  setLoading(true);
101
109
  LiveStreamService.join(scLiveStream.id)
@@ -110,7 +118,7 @@ export default function LiveStreamRoom(inProps) {
110
118
  });
111
119
  toggleAttrDisabledPrejoinActions(true);
112
120
  }
113
- }), [scUserContext.user, setPreJoinChoices, setConnectionDetails, scLiveStream]);
121
+ }, [scUserContext.user, setPreJoinChoices, setConnectionDetails, scLiveStream]);
114
122
  /**
115
123
  * Handle PreJoin Error
116
124
  */
@@ -118,11 +126,14 @@ export default function LiveStreamRoom(inProps) {
118
126
  /**
119
127
  * User must be authenticated
120
128
  */
121
- if ((!scLiveStream && !scUserContext.user) || !canCreateLiveStream) {
129
+ if ((!scLiveStream && !scUserContext.user) || !liveStreamEnabled) {
122
130
  return _jsx(CircularProgress, {});
123
131
  }
124
132
  /**
125
133
  * Renders root object
126
134
  */
127
- return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { children: _jsx(Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? (_jsxs(_Fragment, { children: [startPrejoinContent && _jsx(Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title) && (_jsx(Typography, Object.assign({ component: 'div', variant: "h5", className: classes.title }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title }))), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description) && (_jsx(Typography, Object.assign({ component: 'div', variant: "body1", className: classes.description }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description }))), _jsxs(Box, Object.assign({ className: classNames(classes.preJoin, { [classes.preJoinLoading]: loading }) }, { children: [_jsx(PreJoin, { defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError }), loading && (_jsxs(Box, Object.assign({ className: classes.prejoinLoader }, { children: [_jsx(CircularProgress, {}), _jsx(Typography, Object.assign({ component: 'div', variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.connecting", defaultMessage: "ui.liveStreamRoom.connecting" }) }))] })))] })), _jsx(Box, Object.assign({ className: classes.endPrejoinContent }, { children: endPrejoinContent }))] })) : (_jsx(Box, Object.assign({ className: classes.conference }, { children: _jsx(LiveStreamVideoConference, Object.assign({ connectionDetails: connectionDetails, userChoices: preJoinChoices, options: { codec: props.codec, hq: props.hq } }, LiveStreamVideoConferenceComponentProps)) }))) })) })));
135
+ return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { children: _jsx(Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? (_jsxs(_Fragment, { children: [startPrejoinContent && _jsx(Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title) && (_jsx(Typography, Object.assign({ component: 'div', variant: "h5", className: classes.title }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title }))), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description) && (_jsx(Typography, Object.assign({ component: 'div', variant: "body1", className: classes.description }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description }))), _jsxs(Box, Object.assign({ className: classNames(classes.preJoin, { [classes.preJoinLoading]: loading }) }, { children: [_jsx(PreJoin, { liveStream: scLiveStream, defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError }), loading && (_jsxs(Box, Object.assign({ className: classes.prejoinLoader }, { children: [_jsx(CircularProgress, {}), _jsx(Typography, Object.assign({ component: 'div', variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.connecting", defaultMessage: "ui.liveStreamRoom.connecting" }) }))] })))] })), _jsxs(Box, Object.assign({ className: classes.endPrejoinContent }, { children: [Boolean(scUserContext.user &&
136
+ scUserContext.user.id !== scLiveStream.host.id &&
137
+ scLiveStream &&
138
+ (((_a = scLiveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipant) || (scLiveStream && ((_b = scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo)))) && (_jsxs(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: [scLiveStream && ((_c = scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipant) && (_jsxs(_Fragment, { children: ["The host of the live set your microphone as off", _jsx("br", {})] })), scLiveStream && ((_d = scLiveStream.settings) === null || _d === void 0 ? void 0 : _d.disableVideo) && _jsx(_Fragment, { children: "The host of the live set your camera as off" })] }))), endPrejoinContent] }))] })) : (_jsx(Box, Object.assign({ className: classes.conference }, { children: _jsx(LiveStreamVideoConference, Object.assign({ liveStream: scLiveStream, connectionDetails: connectionDetails, userChoices: preJoinChoices }, LiveStreamVideoConferenceComponentProps)) }))) })) })));
128
139
  }
@@ -67,6 +67,10 @@ export default function LiveStreamVideoConference(inProps) {
67
67
  const [e2eeSetupComplete, setE2eeSetupComplete] = useState(true);
68
68
  const [liveActive, setLiveActive] = useState(true);
69
69
  const [error, setError] = useState(null);
70
+ const canUseAudio = useMemo(() => { var _a; return (scUserContext.user && liveStream && liveStream.host.id === scUserContext.user.id) || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipant)); }, [scUserContext, liveStream]);
71
+ const canUseVideo = useMemo(() => { var _a; return (scUserContext.user && liveStream && liveStream.host.id === scUserContext.user.id) || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.disableVideo)); }, [scUserContext, liveStream]);
72
+ const canUseChat = useMemo(() => { var _a; return (scUserContext.user && liveStream && liveStream.host.id === scUserContext.user.id) || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.disableChat)); }, [scUserContext, liveStream]);
73
+ const canUseShareScreen = useMemo(() => { var _a; return (scUserContext.user && liveStream && liveStream.host.id === scUserContext.user.id) || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.disableShareScreen)); }, [scUserContext, liveStream]);
70
74
  /* const liveStreamRoomMaxParticipants = useMemo(
71
75
  () =>
72
76
  preferences &&
@@ -176,5 +180,5 @@ export default function LiveStreamVideoConference(inProps) {
176
180
  /**
177
181
  * Renders root object
178
182
  */
179
- return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: liveActive && !error ? (_jsx(_Fragment, { children: _jsx(LiveKitRoom, Object.assign({ connect: Boolean(e2eeSetupComplete && liveActive), token: connectionDetails['participantToken'], serverUrl: connectionDetails['serverUrl'], connectOptions: connectOptions, video: userChoices.videoEnabled, audio: userChoices.audioEnabled, onDisconnected: handleOnLeave, onEncryptionError: handleEncryptionError, onError: handleError }, LiveKitRoomComponentProps, { children: _jsxs(LayoutContextProvider, { children: [_jsx(VideoConference, Object.assign({ chatMessageFormatter: formatChatMessageLinks }, VideoConferenceComponentProps)), _jsx(ConnectionState, {})] }) })) })) : (_jsx(_Fragment, { children: error ? (_jsxs(Box, Object.assign({ className: classes.endConferenceWrap }, { children: [startConferenceEndContent, error, endConferenceEndContent] }))) : liveActive === false ? (_jsxs(Box, Object.assign({ className: classes.endConferenceWrap }, { children: [startConferenceEndContent, _jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.conference.end", defaultMessage: "ui.liveStreamRoom.conference.end" }) })), _jsx(Button, Object.assign({ variant: "contained", color: "secondary", component: Link, to: '/', className: classes.btnBackHome }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.button.backHome", defaultMessage: "ui.liveStreamRoom.button.backHome" }) })), endConferenceEndContent] }))) : (_jsx(CircularProgress, {})) })) })));
183
+ return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: liveActive && !error ? (_jsx(_Fragment, { children: _jsx(LiveKitRoom, Object.assign({ connect: Boolean(e2eeSetupComplete && liveActive), token: connectionDetails['participantToken'], serverUrl: connectionDetails['serverUrl'], connectOptions: connectOptions, video: userChoices.videoEnabled, audio: userChoices.audioEnabled, onDisconnected: handleOnLeave, onEncryptionError: handleEncryptionError, onError: handleError }, LiveKitRoomComponentProps, { children: _jsxs(LayoutContextProvider, { children: [_jsx(VideoConference, Object.assign({ chatMessageFormatter: formatChatMessageLinks, speakerFocused: liveStream.host }, VideoConferenceComponentProps, { disableMicrophone: !canUseAudio, disableCamera: !canUseVideo, disableChat: !canUseChat, disableShareScreen: !canUseShareScreen })), _jsx(ConnectionState, {})] }) })) })) : (_jsx(_Fragment, { children: error ? (_jsxs(Box, Object.assign({ className: classes.endConferenceWrap }, { children: [startConferenceEndContent, error, endConferenceEndContent] }))) : liveActive === false ? (_jsxs(Box, Object.assign({ className: classes.endConferenceWrap }, { children: [startConferenceEndContent, _jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.conference.end", defaultMessage: "ui.liveStreamRoom.conference.end" }) })), _jsx(Button, Object.assign({ variant: "contained", color: "secondary", component: Link, to: '/', className: classes.btnBackHome }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.button.backHome", defaultMessage: "ui.liveStreamRoom.button.backHome" }) })), endConferenceEndContent] }))) : (_jsx(CircularProgress, {})) })) })));
180
184
  }
@@ -0,0 +1,6 @@
1
+ import type { SVGProps } from 'react';
2
+ /**
3
+ * @internal
4
+ */
5
+ declare const SvgParticipantPlaceholder: (props: SVGProps<SVGSVGElement>) => JSX.Element;
6
+ export default SvgParticipantPlaceholder;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @internal
4
+ */
5
+ const SvgParticipantPlaceholder = (props) => (_jsxs("svg", Object.assign({ width: 320, height: 320, viewBox: "0 0 320 320", preserveAspectRatio: "xMidYMid meet", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M160 180C204.182 180 240 144.183 240 100C240 55.8172 204.182 20 160 20C115.817 20 79.9997 55.8172 79.9997 100C79.9997 144.183 115.817 180 160 180Z", fill: "white", fillOpacity: 0.25 }), _jsx("path", { d: "M97.6542 194.614C103.267 191.818 109.841 192.481 115.519 195.141C129.025 201.466 144.1 205 159.999 205C175.899 205 190.973 201.466 204.48 195.141C210.158 192.481 216.732 191.818 222.345 194.614C262.703 214.719 291.985 253.736 298.591 300.062C300.15 310.997 291.045 320 280 320H39.9997C28.954 320 19.8495 310.997 21.4087 300.062C28.014 253.736 57.2966 214.72 97.6542 194.614Z", fill: "white", fillOpacity: 0.25 })] })));
6
+ export default SvgParticipantPlaceholder;
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import type { Participant } from 'livekit-client';
3
+ import type { ParticipantClickEvent, TrackReferenceOrPlaceholder } from '@livekit/components-core';
4
+ /**
5
+ * The `ParticipantContextIfNeeded` component only creates a `ParticipantContext`
6
+ * if there is no `ParticipantContext` already.
7
+ */
8
+ export declare function ParticipantContextIfNeeded(props: React.PropsWithChildren<{
9
+ participant?: Participant;
10
+ }>): JSX.Element;
11
+ /**
12
+ * Only create a `TrackRefContext` if there is no `TrackRefContext` already.
13
+ */
14
+ export declare function TrackRefContextIfNeeded(props: React.PropsWithChildren<{
15
+ trackRef?: TrackReferenceOrPlaceholder;
16
+ }>): JSX.Element;
17
+ export interface ParticipantTileProps extends React.HTMLAttributes<HTMLDivElement> {
18
+ /** The track reference to display. */
19
+ trackRef?: TrackReferenceOrPlaceholder;
20
+ disableSpeakingIndicator?: boolean;
21
+ onParticipantClick?: (event: ParticipantClickEvent) => void;
22
+ }
23
+ /**
24
+ * The `ParticipantTile` component is the base utility wrapper for displaying a visual representation of a participant.
25
+ * This component can be used as a child of the `TrackLoop` component or by passing a track reference as property.
26
+ */
27
+ export declare const ParticipantTile: (props: ParticipantTileProps & React.RefAttributes<HTMLDivElement>) => React.ReactNode;