@selfcommunity/react-ui 0.8.0-live.54 → 0.8.0-live.56

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 (72) hide show
  1. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -5
  2. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -16
  3. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +0 -2
  4. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +13 -31
  5. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
  6. package/lib/cjs/components/EventForm/EventAddress.d.ts +2 -1
  7. package/lib/cjs/components/EventForm/EventAddress.js +23 -3
  8. package/lib/cjs/components/EventForm/EventForm.js +8 -1
  9. package/lib/cjs/components/LiveStream/LiveStream.d.ts +79 -0
  10. package/lib/cjs/components/LiveStream/LiveStream.js +143 -0
  11. package/lib/cjs/components/LiveStream/Skeleton.d.ts +46 -0
  12. package/lib/cjs/components/LiveStream/Skeleton.js +92 -0
  13. package/lib/cjs/components/LiveStream/constants.d.ts +1 -0
  14. package/lib/cjs/components/LiveStream/constants.js +4 -0
  15. package/lib/cjs/components/LiveStream/index.d.ts +4 -0
  16. package/lib/cjs/components/LiveStream/index.js +8 -0
  17. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.d.ts +1 -1
  18. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +33 -38
  19. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.d.ts +46 -0
  20. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +61 -0
  21. package/lib/cjs/components/LiveStreamForm/constants.d.ts +7 -0
  22. package/lib/cjs/components/LiveStreamForm/constants.js +8 -1
  23. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.d.ts +3 -2
  24. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +24 -38
  25. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +7 -2
  26. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +4 -4
  27. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +39 -0
  28. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +112 -0
  29. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +2 -16
  30. package/lib/cjs/index.d.ts +3 -1
  31. package/lib/cjs/index.js +6 -1
  32. package/lib/cjs/shared/LiveStreamInfoDetails/index.d.ts +17 -0
  33. package/lib/cjs/shared/LiveStreamInfoDetails/index.js +45 -0
  34. package/lib/cjs/types/liveStream.d.ts +5 -0
  35. package/lib/cjs/types/liveStream.js +9 -0
  36. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -5
  37. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +3 -17
  38. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +0 -2
  39. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +10 -28
  40. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
  41. package/lib/esm/components/EventForm/EventAddress.d.ts +2 -1
  42. package/lib/esm/components/EventForm/EventAddress.js +23 -3
  43. package/lib/esm/components/EventForm/EventForm.js +8 -1
  44. package/lib/esm/components/LiveStream/LiveStream.d.ts +79 -0
  45. package/lib/esm/components/LiveStream/LiveStream.js +140 -0
  46. package/lib/esm/components/LiveStream/Skeleton.d.ts +46 -0
  47. package/lib/esm/components/LiveStream/Skeleton.js +89 -0
  48. package/lib/esm/components/LiveStream/constants.d.ts +1 -0
  49. package/lib/esm/components/LiveStream/constants.js +1 -0
  50. package/lib/esm/components/LiveStream/index.d.ts +4 -0
  51. package/lib/esm/components/LiveStream/index.js +4 -0
  52. package/lib/esm/components/LiveStreamForm/LiveStreamForm.d.ts +1 -1
  53. package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +33 -38
  54. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.d.ts +46 -0
  55. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +57 -0
  56. package/lib/esm/components/LiveStreamForm/constants.d.ts +7 -0
  57. package/lib/esm/components/LiveStreamForm/constants.js +7 -0
  58. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.d.ts +3 -2
  59. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +26 -40
  60. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +7 -2
  61. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +5 -5
  62. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +39 -0
  63. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +108 -0
  64. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +3 -17
  65. package/lib/esm/index.d.ts +3 -1
  66. package/lib/esm/index.js +3 -1
  67. package/lib/esm/shared/LiveStreamInfoDetails/index.d.ts +17 -0
  68. package/lib/esm/shared/LiveStreamInfoDetails/index.js +42 -0
  69. package/lib/esm/types/liveStream.d.ts +5 -0
  70. package/lib/esm/types/liveStream.js +6 -0
  71. package/lib/umd/react-ui.js +1 -1
  72. package/package.json +7 -7
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Icon, Stack, styled, Tooltip, Typography, useThemeProps } from '@mui/material';
3
+ import { Link, SCRoutes, useSCFetchLiveStream, useSCRouting } from '@selfcommunity/react-core';
4
+ import { FormattedMessage, useIntl } from 'react-intl';
5
+ const PREFIX = 'SCLiveStreamInfoDetails';
6
+ const classes = {
7
+ root: `${PREFIX}-root`,
8
+ iconTextWrapper: `${PREFIX}-icon-text-wrapper`,
9
+ inProgress: `${PREFIX}-in-progress`,
10
+ link: `${PREFIX}-link`,
11
+ url: `${PREFIX}-url`,
12
+ creationWrapper: `${PREFIX}-creation-wrapper`
13
+ };
14
+ const Root = styled(Stack, {
15
+ name: PREFIX,
16
+ slot: 'Root',
17
+ overridesResolver: (_props, styles) => styles.root
18
+ })(() => ({}));
19
+ export default function LiveStreamInfoDetails(inProps) {
20
+ // PROPS
21
+ const props = useThemeProps({
22
+ props: inProps,
23
+ name: PREFIX
24
+ });
25
+ const { liveStream, liveStreamId, hideDateIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasLocationInfo = true, hasCreatedInfo = false, hasInProgress = false, beforeDateInfo, beforeLocationInfo, beforeCreatedInfo } = props;
26
+ // CONTEXT
27
+ const scRoutingContext = useSCRouting();
28
+ // HOOKS
29
+ const intl = useIntl();
30
+ const { scLiveStream } = useSCFetchLiveStream({ id: liveStreamId, liveStream });
31
+ if (!scLiveStream) {
32
+ return null;
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' })), 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
+ date: intl.formatDate(scLiveStream.created_at, {
36
+ weekday: 'long',
37
+ day: 'numeric',
38
+ year: 'numeric',
39
+ month: 'long'
40
+ })
41
+ } }) }))] })))] })));
42
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum SCLiveStreamTemplateType {
2
+ DETAIL = "detail",
3
+ SNIPPET = "snippet",
4
+ PREVIEW = "preview"
5
+ }
@@ -0,0 +1,6 @@
1
+ export var SCLiveStreamTemplateType;
2
+ (function (SCLiveStreamTemplateType) {
3
+ SCLiveStreamTemplateType["DETAIL"] = "detail";
4
+ SCLiveStreamTemplateType["SNIPPET"] = "snippet";
5
+ SCLiveStreamTemplateType["PREVIEW"] = "preview";
6
+ })(SCLiveStreamTemplateType || (SCLiveStreamTemplateType = {}));