@selfcommunity/react-ui 0.11.0-alpha.6 → 0.11.0-alpha.60

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 (163) hide show
  1. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
  2. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
  3. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
  4. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
  5. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +9 -1
  6. package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +1 -1
  7. package/lib/cjs/components/CreateEventButton/CreateEventButton.js +1 -1
  8. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
  9. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
  10. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
  11. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
  12. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
  13. package/lib/cjs/components/Editor/Editor.js +9 -9
  14. package/lib/cjs/components/Editor/nodes/HashtagNode.js +2 -0
  15. package/lib/cjs/components/Editor/nodes/MentionNode.js +2 -0
  16. package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
  17. package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.js +34 -0
  18. package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
  19. package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.js +2 -3
  20. package/lib/cjs/components/Event/Event.js +6 -3
  21. package/lib/cjs/components/EventForm/EventAddress.js +1 -1
  22. package/lib/cjs/components/EventForm/EventForm.js +40 -22
  23. package/lib/cjs/components/EventForm/utils.d.ts +1 -0
  24. package/lib/cjs/components/EventForm/utils.js +6 -1
  25. package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  26. package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
  27. package/lib/cjs/components/EventHeader/EventHeader.js +3 -2
  28. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +12 -12
  29. package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +8 -8
  30. package/lib/cjs/components/EventMembersWidget/types.d.ts +4 -5
  31. package/lib/cjs/components/EventMembersWidget/types.js +7 -7
  32. package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
  33. package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
  34. package/lib/cjs/components/Events/Events.d.ts +11 -0
  35. package/lib/cjs/components/Events/Events.js +21 -10
  36. package/lib/cjs/components/Events/OngoingEventsFilter.d.ts +8 -0
  37. package/lib/cjs/components/Events/OngoingEventsFilter.js +24 -0
  38. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +4 -1
  39. package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
  40. package/lib/cjs/components/Footer/Footer.js +9 -6
  41. package/lib/cjs/components/Footer/constants.d.ts +1 -0
  42. package/lib/cjs/components/Footer/constants.js +2 -1
  43. package/lib/cjs/components/GroupForm/GroupForm.js +2 -2
  44. package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
  45. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
  46. package/lib/cjs/components/Groups/Groups.js +18 -16
  47. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +65 -6
  48. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
  49. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
  50. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
  51. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
  52. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
  53. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
  54. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +106 -0
  55. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
  56. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +37 -0
  57. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
  58. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
  59. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
  60. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
  61. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +62 -5
  62. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
  63. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
  64. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
  65. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +2 -2
  66. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
  67. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
  68. package/lib/cjs/components/Notification/Event/Event.js +20 -2
  69. package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
  70. package/lib/cjs/components/SearchDialog/SearchDialog.d.ts +4 -1
  71. package/lib/cjs/components/SearchDialog/SearchDialog.js +2 -2
  72. package/lib/cjs/constants/LiveStream.d.ts +1 -0
  73. package/lib/cjs/constants/LiveStream.js +2 -1
  74. package/lib/cjs/shared/EventActionsMenu/index.js +5 -1
  75. package/lib/cjs/shared/UpScalingTierBadge/index.js +9 -0
  76. package/lib/cjs/utils/buttonCounters.d.ts +1 -0
  77. package/lib/cjs/utils/buttonCounters.js +4 -3
  78. package/lib/cjs/utils/events.d.ts +1 -0
  79. package/lib/cjs/utils/events.js +6 -1
  80. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
  81. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
  82. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
  83. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
  84. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +10 -2
  85. package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +1 -1
  86. package/lib/esm/components/CreateEventButton/CreateEventButton.js +1 -1
  87. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
  88. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
  89. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
  90. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
  91. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +12 -4
  92. package/lib/esm/components/Editor/Editor.js +8 -8
  93. package/lib/esm/components/Editor/nodes/HashtagNode.js +2 -0
  94. package/lib/esm/components/Editor/nodes/MentionNode.js +2 -0
  95. package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
  96. package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.js +30 -0
  97. package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
  98. package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.js +1 -1
  99. package/lib/esm/components/Event/Event.js +6 -3
  100. package/lib/esm/components/EventForm/EventAddress.js +1 -1
  101. package/lib/esm/components/EventForm/EventForm.js +42 -24
  102. package/lib/esm/components/EventForm/utils.d.ts +1 -0
  103. package/lib/esm/components/EventForm/utils.js +4 -0
  104. package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  105. package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
  106. package/lib/esm/components/EventHeader/EventHeader.js +3 -2
  107. package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +14 -14
  108. package/lib/esm/components/EventMembersWidget/TabContentComponent.js +9 -9
  109. package/lib/esm/components/EventMembersWidget/types.d.ts +4 -5
  110. package/lib/esm/components/EventMembersWidget/types.js +6 -6
  111. package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
  112. package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
  113. package/lib/esm/components/Events/Events.d.ts +11 -0
  114. package/lib/esm/components/Events/Events.js +22 -11
  115. package/lib/esm/components/Events/OngoingEventsFilter.d.ts +8 -0
  116. package/lib/esm/components/Events/OngoingEventsFilter.js +21 -0
  117. package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -1
  118. package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
  119. package/lib/esm/components/Footer/Footer.js +10 -7
  120. package/lib/esm/components/Footer/constants.d.ts +1 -0
  121. package/lib/esm/components/Footer/constants.js +1 -0
  122. package/lib/esm/components/GroupForm/GroupForm.js +2 -2
  123. package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
  124. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
  125. package/lib/esm/components/Groups/Groups.js +21 -19
  126. package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +67 -8
  127. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
  128. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
  129. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
  130. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
  131. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
  132. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
  133. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +103 -0
  134. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
  135. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +34 -0
  136. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
  137. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
  138. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
  139. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
  140. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +66 -9
  141. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
  142. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
  143. package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
  144. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +2 -2
  145. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
  146. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
  147. package/lib/esm/components/Notification/Event/Event.js +21 -3
  148. package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
  149. package/lib/esm/components/SearchDialog/SearchDialog.d.ts +4 -1
  150. package/lib/esm/components/SearchDialog/SearchDialog.js +2 -2
  151. package/lib/esm/constants/LiveStream.d.ts +1 -0
  152. package/lib/esm/constants/LiveStream.js +1 -0
  153. package/lib/esm/shared/EventActionsMenu/index.js +6 -2
  154. package/lib/esm/shared/UpScalingTierBadge/index.js +9 -0
  155. package/lib/esm/utils/buttonCounters.d.ts +1 -0
  156. package/lib/esm/utils/buttonCounters.js +3 -2
  157. package/lib/esm/utils/events.d.ts +1 -0
  158. package/lib/esm/utils/events.js +4 -0
  159. package/lib/umd/239.js +2 -0
  160. package/lib/umd/react-ui.js +1 -1
  161. package/package.json +14 -13
  162. package/lib/umd/653.js +0 -2
  163. /package/lib/umd/{653.js.LICENSE.txt → 239.js.LICENSE.txt} +0 -0
@@ -22,6 +22,11 @@ export interface CategoryAutocompleteProps extends Pick<AutocompleteProps<SCCate
22
22
  * @param value
23
23
  */
24
24
  onChange?: (value: any) => void;
25
+ /**
26
+ * Feed API Query Params
27
+ * @default [{'limit': 10, 'offset': 0}]
28
+ */
29
+ endpointQueryParams?: Record<string, string | number | boolean>;
25
30
  }
26
31
  /**
27
32
  * > API documentation for the Community-JS Category Autocomplete component. Learn about the available props and the CSS API.
@@ -51,17 +51,17 @@ const CategoryAutocomplete = (inProps) => {
51
51
  name: PREFIX
52
52
  });
53
53
  // Props
54
- const { onChange, multiple = false, defaultValue = multiple ? [] : null, limitCountCategories = 0, checkboxSelect = false, disabled = false, TextFieldProps = {
54
+ const { onChange, multiple = false, defaultValue = multiple ? [] : null, limitCountCategories = 0, checkboxSelect = false, disabled = false, endpointQueryParams = {}, TextFieldProps = {
55
55
  variant: 'outlined',
56
56
  label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.categoryAutocomplete.label", defaultMessage: "ui.categoryAutocomplete.label" })
57
- } } = props, rest = tslib_1.__rest(props, ["onChange", "multiple", "defaultValue", "limitCountCategories", "checkboxSelect", "disabled", "TextFieldProps"]);
57
+ } } = props, rest = tslib_1.__rest(props, ["onChange", "multiple", "defaultValue", "limitCountCategories", "checkboxSelect", "disabled", "endpointQueryParams", "TextFieldProps"]);
58
58
  // State
59
59
  const [open, setOpen] = (0, react_1.useState)(false);
60
60
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
61
61
  // @ts-ignore
62
62
  const [value, setValue] = (0, react_1.useState)(typeof defaultValue === 'string' ? null : defaultValue);
63
63
  // HOOKS
64
- const { categories, isLoading } = (0, react_core_1.useSCFetchCategories)();
64
+ const { categories, isLoading } = (0, react_core_1.useSCFetchCategories)({ endpointQueryParams });
65
65
  (0, react_1.useEffect)(() => {
66
66
  if (value === null) {
67
67
  return;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { BoxProps } from '@mui/material';
3
- import { SCCategoryType } from '@selfcommunity/types/src/index';
3
+ import { SCCategoryType } from '@selfcommunity/types';
4
4
  import { ComposerLayerProps } from '../../../../types/composer';
5
5
  export interface CategoryLayerProps extends Omit<BoxProps, 'defaultValue'>, ComposerLayerProps {
6
6
  defaultValue: SCCategoryType[];
@@ -6,6 +6,7 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const react_intl_1 = require("react-intl");
7
7
  const material_1 = require("@mui/material");
8
8
  const styles_1 = require("@mui/material/styles");
9
+ const react_core_1 = require("@selfcommunity/react-core");
9
10
  const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
10
11
  const CategoryAutocomplete_1 = tslib_1.__importDefault(require("../../../CategoryAutocomplete"));
11
12
  const DialogContent_1 = tslib_1.__importDefault(require("@mui/material/DialogContent"));
@@ -25,9 +26,11 @@ const CategoryLayer = react_1.default.forwardRef((props, ref) => {
25
26
  const { className, onClose, onSave, defaultValue = [] } = props, rest = tslib_1.__rest(props, ["className", "onClose", "onSave", "defaultValue"]);
26
27
  // STATE
27
28
  const [value, setValue] = (0, react_1.useState)(defaultValue);
29
+ // CONTEXT
30
+ const scUserContext = (0, react_core_1.useSCUser)();
28
31
  // HANDLERS
29
32
  const handleSave = (0, react_1.useCallback)(() => onSave(value), [value, onSave]);
30
33
  const handleChange = (0, react_1.useCallback)((categories) => setValue(categories), []);
31
- return (0, jsx_runtime_1.jsxs)(Root, Object.assign({ ref: ref, className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, Object.assign({ className: classes.title }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "arrow_back" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.category.title", defaultMessage: "ui.composer.layer.category.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSave }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.save", defaultMessage: "ui.composer.layer.save" }) }))] })), (0, jsx_runtime_1.jsx)(DialogContent_1.default, Object.assign({ className: classes.content }, { children: (0, jsx_runtime_1.jsx)(CategoryAutocomplete_1.default, { multiple: true, onChange: handleChange, defaultValue: defaultValue }) }))] }));
34
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ ref: ref, className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, Object.assign({ className: classes.title }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "arrow_back" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.category.title", defaultMessage: "ui.composer.layer.category.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSave }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.save", defaultMessage: "ui.composer.layer.save" }) }))] })), (0, jsx_runtime_1.jsx)(DialogContent_1.default, Object.assign({ className: classes.content }, { children: (0, jsx_runtime_1.jsx)(CategoryAutocomplete_1.default, Object.assign({ multiple: true, onChange: handleChange, defaultValue: defaultValue }, (!react_core_1.UserUtils.isStaff(scUserContext.user) && { endpointQueryParams: { can_create_content: true } }))) }))] })));
32
35
  });
33
36
  exports.default = CategoryLayer;
@@ -13,6 +13,7 @@ const EventFormDialog_1 = tslib_1.__importDefault(require("../EventFormDialog"))
13
13
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
14
14
  const GroupForm_1 = tslib_1.__importDefault(require("../GroupForm"));
15
15
  const CreateLiveStreamDialog_1 = tslib_1.__importDefault(require("../CreateLiveStreamDialog"));
16
+ const types_1 = require("@selfcommunity/types");
16
17
  const PREFIX = 'SCComposerIconButton';
17
18
  const classes = {
18
19
  root: `${PREFIX}-root`,
@@ -83,10 +84,17 @@ exports.default = react_1.default.forwardRef(function ComposerIconButton(inProps
83
84
  // HOOKS
84
85
  const theme = (0, material_1.useTheme)();
85
86
  const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
87
+ const { preferences } = (0, react_core_1.useSCPreferences)();
86
88
  // MEMOS
87
89
  const canCreateGroup = (0, react_1.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_group; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
88
90
  const canCreateEvent = (0, react_1.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_event; }, [(_b = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _b === void 0 ? void 0 : _b.permission]);
89
- const canCreateLiveStream = (0, react_1.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; }, [(_c = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _c === void 0 ? void 0 : _c.permission]);
91
+ const canCreateLive = (0, react_1.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; }, [(_c = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _c === void 0 ? void 0 : _c.permission]);
92
+ const isCommunityOwner = (0, react_1.useMemo)(() => { var _a; return ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === 1; }, [scUserContext.user]);
93
+ const isFreeTrialTier = (0, react_1.useMemo)(() => preferences &&
94
+ react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
95
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
96
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === types_1.SCCommunitySubscriptionTier.FREE_TRIAL, [preferences]);
97
+ const canCreateLiveStream = (0, react_1.useMemo)(() => (isFreeTrialTier && isCommunityOwner && canCreateLive) || (!isFreeTrialTier && canCreateLive), [isFreeTrialTier, isCommunityOwner, canCreateLive]);
90
98
  const renderContent = (0, react_1.useMemo)(() => {
91
99
  return ((0, jsx_runtime_1.jsx)(material_1.MenuList, { children: listItem.map((item, i) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ onClick: item.onClick }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: item.icon })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: item.text, defaultMessage: item.text }) })) })] }), i))) }));
92
100
  }, [listItem]);
@@ -7,7 +7,7 @@ export interface CreateEventButtonProps extends ButtonProps {
7
7
  */
8
8
  className?: string;
9
9
  /**
10
- * Props to spread to CreateGroup component
10
+ * Props to spread to CreateEvent component
11
11
  * @default empty object
12
12
  */
13
13
  EventFormDialogComponentProps?: EventFormDialogProps;
@@ -18,7 +18,7 @@ const classes = {
18
18
  const Root = (0, styles_1.styled)(material_1.Button, {
19
19
  name: PREFIX,
20
20
  slot: 'Root',
21
- overridesResolver: (props, styles) => styles.root
21
+ overridesResolver: (_props, styles) => styles.root
22
22
  })(() => ({}));
23
23
  /**
24
24
  *> API documentation for the Community-JS Create Group Button component. Learn about the available props and the CSS API.
@@ -1,5 +1,4 @@
1
1
  import { ButtonProps } from '@mui/material/Button/Button';
2
- import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
3
2
  import { CreateLiveStreamDialogProps } from '../CreateLiveStreamDialog';
4
3
  export interface CreateLiveStreamButtonProps extends ButtonProps {
5
4
  /**
@@ -12,11 +11,6 @@ export interface CreateLiveStreamButtonProps extends ButtonProps {
12
11
  * @default empty object
13
12
  */
14
13
  CreateLiveStreamDialogComponentProps?: CreateLiveStreamDialogProps;
15
- /**
16
- * On success callback function
17
- * @default null
18
- */
19
- onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
20
14
  /**
21
15
  * Any other properties
22
16
  */
@@ -45,7 +45,7 @@ function CreateLiveStreamButton(inProps) {
45
45
  props: inProps,
46
46
  name: PREFIX
47
47
  });
48
- const { className, CreateLiveStreamDialogComponentProps = {}, onSuccess, children } = props, rest = tslib_1.__rest(props, ["className", "CreateLiveStreamDialogComponentProps", "onSuccess", "children"]);
48
+ const { className, CreateLiveStreamDialogComponentProps = {}, children } = props, rest = tslib_1.__rest(props, ["className", "CreateLiveStreamDialogComponentProps", "children"]);
49
49
  // CONTEXT
50
50
  const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
51
51
  const { preferences, features } = (0, react_core_1.useSCPreferences)();
@@ -71,13 +71,6 @@ function CreateLiveStreamButton(inProps) {
71
71
  const handleClose = () => {
72
72
  setOpen((o) => !o);
73
73
  };
74
- /**
75
- * Handle close
76
- */
77
- const handleSuccess = (data) => {
78
- onSuccess && onSuccess(data);
79
- setOpen((o) => !o);
80
- };
81
74
  /**
82
75
  * If there's no authUserId, component is hidden.
83
76
  */
@@ -87,6 +80,6 @@ function CreateLiveStreamButton(inProps) {
87
80
  /**
88
81
  * Renders root object
89
82
  */
90
- return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "movie" }) }, rest, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && (0, jsx_runtime_1.jsx)(CreateLiveStreamDialog_1.default, Object.assign({ open: true, onClose: handleClose, onSuccess: handleSuccess }, CreateLiveStreamDialogComponentProps))] }));
83
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "movie" }) }, rest, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && (0, jsx_runtime_1.jsx)(CreateLiveStreamDialog_1.default, Object.assign({ open: true, onClose: handleClose }, CreateLiveStreamDialogComponentProps))] }));
91
84
  }
92
85
  exports.default = CreateLiveStreamButton;
@@ -1,5 +1,6 @@
1
- import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
2
1
  import { BaseDialogProps } from '../../shared/BaseDialog';
2
+ import { EventFormProps } from '../EventForm';
3
+ import { LiveStreamFormProps } from '../LiveStreamForm';
3
4
  export interface CreateLiveStreamDialogProps extends BaseDialogProps {
4
5
  /**
5
6
  * Overrides or extends the styles applied to the component.
@@ -17,10 +18,15 @@ export interface CreateLiveStreamDialogProps extends BaseDialogProps {
17
18
  */
18
19
  onClose?: () => void;
19
20
  /**
20
- * On success callback function
21
- * @default null
21
+ * Props to spread to EventForm component
22
+ * @default {}
23
+ */
24
+ EventFormComponentProps?: EventFormProps;
25
+ /**
26
+ * Props to spread to LiveStreamForm component
27
+ * @default {}
22
28
  */
23
- onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
29
+ LiveStreamFormComponentProps?: LiveStreamFormProps;
24
30
  /**
25
31
  * Any other properties
26
32
  */
@@ -25,10 +25,11 @@ const classes = {
25
25
  const Root = (0, styles_1.styled)(BaseDialog_1.default, {
26
26
  name: constants_1.PREFIX,
27
27
  slot: 'Root'
28
- })(({ theme }) => ({
28
+ })(() => ({
29
29
  paddingBottom: '0px !important',
30
30
  [`& .${classes.title}`]: {
31
- display: 'flex'
31
+ display: 'flex',
32
+ alignItems: 'center'
32
33
  },
33
34
  [`& .${classes.content}`]: {
34
35
  paddingBottom: 0
@@ -58,20 +59,21 @@ const Transition = react_1.default.forwardRef(function Transition(props, ref) {
58
59
  * @param inProps
59
60
  */
60
61
  function CreateLiveStreamDialog(inProps) {
61
- var _a, _b;
62
+ var _a;
62
63
  //PROPS
63
64
  const props = (0, system_1.useThemeProps)({
64
65
  props: inProps,
65
66
  name: constants_1.PREFIX
66
67
  });
67
- const { className, open = true, onClose, onSuccess } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "onSuccess"]);
68
+ const { className, open = true, onClose, EventFormComponentProps = {}, LiveStreamFormComponentProps = {} } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "EventFormComponentProps", "LiveStreamFormComponentProps"]);
68
69
  // CONTEXT
69
70
  const scUserContext = (0, react_core_1.useSCUser)();
70
- const canCreateLiveStream = (0, react_1.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]);
71
- const canCreateEvent = (0, react_1.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_event; }, [(_b = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _b === void 0 ? void 0 : _b.permission]);
71
+ // PERMISSION
72
+ const canCreateEvent = (0, react_1.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_event; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
72
73
  // STATE
73
74
  const [step, setStep] = (0, react_1.useState)(canCreateEvent ? types_2.CreateLiveStreamStep.SELECT_TYPE : types_2.CreateLiveStreamStep.CREATE_LIVE);
74
75
  const [liveType, setLiveType] = (0, react_1.useState)(canCreateEvent ? null : types_2.LiveStreamType.DIRECT_LIVE);
76
+ const canShowBackButton = (0, react_1.useMemo)(() => step === types_2.CreateLiveStreamStep.CREATE_LIVE && canCreateEvent, [step, canCreateEvent]);
75
77
  // HANDLER
76
78
  const handleLiveTypeSelected = (0, react_1.useCallback)((l) => {
77
79
  setLiveType(l);
@@ -80,24 +82,28 @@ function CreateLiveStreamDialog(inProps) {
80
82
  setLiveType(l);
81
83
  setStep(types_2.CreateLiveStreamStep.CREATE_LIVE);
82
84
  }, []);
83
- const handleBack = (0, react_1.useCallback)((l) => {
85
+ const handleBack = (0, react_1.useCallback)(() => {
84
86
  setStep(types_2.CreateLiveStreamStep.SELECT_TYPE);
85
87
  }, []);
86
88
  const handleSubmit = (0, react_1.useCallback)((e) => {
87
- onSuccess && onSuccess(e);
88
- }, []);
89
+ var _a, _b;
90
+ liveType === types_2.LiveStreamType.EVENT_LIVE
91
+ ? (_a = EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, e)
92
+ : (_b = LiveStreamFormComponentProps.onSuccess) === null || _b === void 0 ? void 0 : _b.call(LiveStreamFormComponentProps, e);
93
+ onClose === null || onClose === void 0 ? void 0 : onClose();
94
+ }, [liveType, onClose, EventFormComponentProps, LiveStreamFormComponentProps]);
89
95
  (0, react_1.useEffect)(() => {
90
96
  if (!canCreateEvent) {
91
97
  setLiveType(types_2.LiveStreamType.DIRECT_LIVE);
92
98
  }
93
99
  }, [canCreateEvent]);
94
100
  // user must be logged
95
- if (!scUserContext.user || !canCreateLiveStream) {
101
+ if (!scUserContext.user) {
96
102
  return null;
97
103
  }
98
104
  /**
99
105
  * Renders root object
100
106
  */
101
- return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: 'md', title: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.title, component: 'span' }, { children: [Boolean(step === types_2.CreateLiveStreamStep.CREATE_LIVE && canCreateEvent) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "arrow_back" }) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createLivestreamDialog.button.back", defaultMessage: "ui.createLivestreamDialog.button.back" }) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: 'span' }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, scroll: "body", onClose: onClose, className: (0, classnames_1.default)(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.content }, { children: [step === types_2.CreateLiveStreamStep.SELECT_TYPE && ((0, jsx_runtime_1.jsx)(LiveStreamSelector_1.default, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === types_2.CreateLiveStreamStep.CREATE_LIVE && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: liveType === types_2.LiveStreamType.EVENT_LIVE ? ((0, jsx_runtime_1.jsx)(EventForm_1.default, { EventAddressComponentProps: { locations: [types_1.SCEventLocationType.LIVESTREAM] }, onSuccess: handleSubmit })) : ((0, jsx_runtime_1.jsx)(LiveStreamForm_1.default, { onSuccess: handleSubmit })) }))] })) })));
107
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: "md", title: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.title, component: "span" }, { children: [canShowBackButton && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "arrow_back" }) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createLivestreamDialog.button.back", defaultMessage: "ui.createLivestreamDialog.button.back" }) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: "span" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, scroll: "body", onClose: !canShowBackButton ? onClose : undefined, className: (0, classnames_1.default)(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.content }, { children: [step === types_2.CreateLiveStreamStep.SELECT_TYPE && ((0, jsx_runtime_1.jsx)(LiveStreamSelector_1.default, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === types_2.CreateLiveStreamStep.CREATE_LIVE && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: liveType === types_2.LiveStreamType.EVENT_LIVE ? ((0, jsx_runtime_1.jsx)(EventForm_1.default, Object.assign({}, EventFormComponentProps, { EventAddressComponentProps: { locations: [types_1.SCEventLocationType.LIVESTREAM] }, onSuccess: handleSubmit }))) : ((0, jsx_runtime_1.jsx)(LiveStreamForm_1.default, Object.assign({}, LiveStreamFormComponentProps, { onSuccess: handleSubmit }))) }))] })) })));
102
108
  }
103
109
  exports.default = CreateLiveStreamDialog;
@@ -84,6 +84,14 @@ function LiveStreamSelector(inProps) {
84
84
  react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
85
85
  preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
86
86
  preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === types_2.SCCommunitySubscriptionTier.FREE_TRIAL, [preferences]);
87
+ const isEnterpriseTier = (0, react_1.useMemo)(() => preferences &&
88
+ react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
89
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
90
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === types_2.SCCommunitySubscriptionTier.ENTERPRISE, [preferences]);
91
+ const isStage = (0, react_1.useMemo)(() => preferences &&
92
+ react_core_1.SCPreferences.STATIC_ENVIRONMENT in preferences &&
93
+ preferences[react_core_1.SCPreferences.STATIC_ENVIRONMENT].value === types_2.SCCommunityEnvironment.STAGE, [preferences]);
94
+ const communityStackId = (0, react_1.useMemo)(() => preferences && react_core_1.SCPreferences.STATIC_ENVIRONMENT in preferences && preferences[react_core_1.SCPreferences.STATIC_STACKID].value, [preferences]);
87
95
  const intl = (0, react_intl_1.useIntl)();
88
96
  const options = [
89
97
  {
@@ -157,11 +165,11 @@ function LiveStreamSelector(inProps) {
157
165
  }, []);
158
166
  const warning = (0, react_1.useMemo)(() => {
159
167
  let _message;
160
- if (isFreeTrialTier && isCommunityOwner) {
168
+ if (isFreeTrialTier && isCommunityOwner && !isEnterpriseTier) {
161
169
  _message = ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.selector.warningSubscriptionRequired", defaultMessage: "ui.liveStreamForm.selector.warningSubscriptionRequired", values: {
162
170
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
163
171
  // @ts-ignore
164
- link: (...chunks) => (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: constants_2.SELFCOMMUNITY_PRICING[scContext.settings.locale.default] }, { children: chunks }))
172
+ link: (...chunks) => ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "_blank", to: `${isStage ? constants_2.HUB_STAGE : constants_2.HUB_PROD}dashboard/community/${communityStackId}/subscription` }, { children: chunks })))
165
173
  } }));
166
174
  }
167
175
  else if (timeRemaining !== null && timeRemaining <= constants_1.WARNING_THRESHOLD_EXPIRING_SOON) {
@@ -11,19 +11,19 @@ const system_1 = require("@mui/system");
11
11
  const nodes_1 = tslib_1.__importDefault(require("./nodes"));
12
12
  const LexicalComposer_1 = require("@lexical/react/LexicalComposer");
13
13
  const LexicalContentEditable_1 = require("@lexical/react/LexicalContentEditable");
14
- const LexicalHistoryPlugin_1 = require("@lexical/react/LexicalHistoryPlugin");
14
+ const ToolbarPlugin_1 = tslib_1.__importDefault(require("./plugins/ToolbarPlugin"));
15
+ const constants_1 = require("./constants");
16
+ const HorizontalRulePlugin_1 = require("./plugins/HorizontalRulePlugin");
15
17
  const LexicalRichTextPlugin_1 = require("./plugins/LexicalRichTextPlugin");
16
- const LexicalErrorBoundary_1 = tslib_1.__importDefault(require("@lexical/react/LexicalErrorBoundary"));
17
- const LexicalHorizontalRulePlugin_1 = require("@lexical/react/LexicalHorizontalRulePlugin");
18
+ const LexicalErrorBoundary_1 = require("@lexical/react/LexicalErrorBoundary");
18
19
  const plugins_1 = require("./plugins");
20
+ const OnBlurPlugin_1 = tslib_1.__importDefault(require("./plugins/OnBlurPlugin"));
21
+ const OnFocusPlugin_1 = tslib_1.__importDefault(require("./plugins/OnFocusPlugin"));
19
22
  const LexicalLinkPlugin_1 = require("@lexical/react/LexicalLinkPlugin");
23
+ const FloatingLinkPlugin_1 = tslib_1.__importDefault(require("./plugins/FloatingLinkPlugin"));
20
24
  const ApiPlugin_1 = tslib_1.__importDefault(require("./plugins/ApiPlugin"));
21
- const ToolbarPlugin_1 = tslib_1.__importDefault(require("./plugins/ToolbarPlugin"));
25
+ const LexicalHistoryPlugin_1 = require("@lexical/react/LexicalHistoryPlugin");
22
26
  const LexicalListPlugin_1 = require("@lexical/react/LexicalListPlugin");
23
- const FloatingLinkPlugin_1 = tslib_1.__importDefault(require("./plugins/FloatingLinkPlugin"));
24
- const OnBlurPlugin_1 = tslib_1.__importDefault(require("./plugins/OnBlurPlugin"));
25
- const OnFocusPlugin_1 = tslib_1.__importDefault(require("./plugins/OnFocusPlugin"));
26
- const constants_1 = require("./constants");
27
27
  const classes = {
28
28
  root: `${constants_1.PREFIX}-root`,
29
29
  focused: `${constants_1.PREFIX}-focused`,
@@ -145,6 +145,6 @@ const Editor = (inProps, ref) => {
145
145
  nodes: [...nodes_1.default],
146
146
  theme: editorTheme
147
147
  }), [editable]);
148
- return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, { [classes.toolbar]: toolbar, [classes.focused]: focused }) }, { children: (0, jsx_runtime_1.jsxs)(LexicalComposer_1.LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [toolbar ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ToolbarPlugin_1.default, { uploadImage: uploadImage }), (0, jsx_runtime_1.jsx)(LexicalListPlugin_1.ListPlugin, {}), (0, jsx_runtime_1.jsx)(LexicalHorizontalRulePlugin_1.HorizontalRulePlugin, {})] })) : ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.actions, direction: "row" }, { children: [uploadImage && (0, jsx_runtime_1.jsx)(plugins_1.ImagePlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.EmojiPlugin, {})] }))), (0, jsx_runtime_1.jsx)(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: (0, jsx_runtime_1.jsx)(LexicalContentEditable_1.ContentEditable, { className: classes.content }), placeholder: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.placeholder, onClick: handleFocus }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.placeholder", defaultMessage: "ui.editor.placeholder" }) })), ErrorBoundary: LexicalErrorBoundary_1.default }), (0, jsx_runtime_1.jsx)(plugins_1.DefaultHtmlValuePlugin, { defaultValue: defaultValue }), (0, jsx_runtime_1.jsx)(LexicalHistoryPlugin_1.HistoryPlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.OnChangePlugin, { onChange: handleChange }), (0, jsx_runtime_1.jsx)(OnBlurPlugin_1.default, { onBlur: handleHasBlur }), (0, jsx_runtime_1.jsx)(OnFocusPlugin_1.default, { onFocus: handleHasFocus }), (0, jsx_runtime_1.jsx)(plugins_1.AutoLinkPlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.MentionsPlugin, {}), (0, jsx_runtime_1.jsx)(LexicalLinkPlugin_1.LinkPlugin, {}), (0, jsx_runtime_1.jsx)(FloatingLinkPlugin_1.default, {}), (0, jsx_runtime_1.jsx)(ApiPlugin_1.default, { ref: apiRef })] })) })));
148
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, { [classes.toolbar]: toolbar, [classes.focused]: focused }) }, { children: (0, jsx_runtime_1.jsxs)(LexicalComposer_1.LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [toolbar ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ToolbarPlugin_1.default, { uploadImage: uploadImage }), (0, jsx_runtime_1.jsx)(LexicalListPlugin_1.ListPlugin, {}), (0, jsx_runtime_1.jsx)(HorizontalRulePlugin_1.HorizontalRulePlugin, {})] })) : ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.actions, direction: "row" }, { children: [uploadImage && (0, jsx_runtime_1.jsx)(plugins_1.ImagePlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.EmojiPlugin, {})] }))), (0, jsx_runtime_1.jsx)(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: (0, jsx_runtime_1.jsx)(LexicalContentEditable_1.ContentEditable, { className: classes.content }), placeholder: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.placeholder, onClick: handleFocus }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.placeholder", defaultMessage: "ui.editor.placeholder" }) })), ErrorBoundary: LexicalErrorBoundary_1.LexicalErrorBoundary }), (0, jsx_runtime_1.jsx)(plugins_1.DefaultHtmlValuePlugin, { defaultValue: defaultValue }), (0, jsx_runtime_1.jsx)(LexicalHistoryPlugin_1.HistoryPlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.OnChangePlugin, { onChange: handleChange }), (0, jsx_runtime_1.jsx)(OnBlurPlugin_1.default, { onBlur: handleHasBlur }), (0, jsx_runtime_1.jsx)(OnFocusPlugin_1.default, { onFocus: handleHasFocus }), (0, jsx_runtime_1.jsx)(plugins_1.AutoLinkPlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.MentionsPlugin, {}), (0, jsx_runtime_1.jsx)(LexicalLinkPlugin_1.LinkPlugin, {}), (0, jsx_runtime_1.jsx)(FloatingLinkPlugin_1.default, {}), (0, jsx_runtime_1.jsx)(ApiPlugin_1.default, { ref: apiRef })] })) })));
149
149
  };
150
150
  exports.default = (0, react_1.forwardRef)(Editor);
@@ -36,6 +36,8 @@ class HashtagNode extends lexical_1.TextNode {
36
36
  if (inner === null) {
37
37
  return true;
38
38
  }
39
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
40
+ // @ts-ignore
39
41
  super.updateDOM(prevNode, inner, config);
40
42
  return false;
41
43
  }
@@ -50,6 +50,8 @@ class MentionNode extends lexical_1.TextNode {
50
50
  if (inner === null) {
51
51
  return true;
52
52
  }
53
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
54
+ // @ts-ignore
53
55
  super.updateDOM(prevNode, inner, config);
54
56
  return false;
55
57
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export declare function HorizontalRulePlugin(): null;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.HorizontalRulePlugin = void 0;
11
+ const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
12
+ const LexicalHorizontalRuleNode_1 = require("@lexical/react/LexicalHorizontalRuleNode");
13
+ const utils_1 = require("@lexical/utils");
14
+ const lexical_1 = require("lexical");
15
+ const react_1 = require("react");
16
+ function HorizontalRulePlugin() {
17
+ const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
18
+ (0, react_1.useEffect)(() => {
19
+ return editor.registerCommand(LexicalHorizontalRuleNode_1.INSERT_HORIZONTAL_RULE_COMMAND, (type) => {
20
+ const selection = (0, lexical_1.$getSelection)();
21
+ if (!(0, lexical_1.$isRangeSelection)(selection)) {
22
+ return false;
23
+ }
24
+ const focusNode = selection.focus.getNode();
25
+ if (focusNode !== null) {
26
+ const horizontalRuleNode = (0, LexicalHorizontalRuleNode_1.$createHorizontalRuleNode)();
27
+ (0, utils_1.$insertNodeToNearestRoot)(horizontalRuleNode);
28
+ }
29
+ return true;
30
+ }, lexical_1.COMMAND_PRIORITY_EDITOR);
31
+ }, [editor]);
32
+ return null;
33
+ }
34
+ exports.HorizontalRulePlugin = HorizontalRulePlugin;
@@ -1,6 +1,6 @@
1
1
  import { ErrorBoundaryType } from '../shared/useDecorators';
2
2
  export declare function RichTextPlugin({ contentEditable, placeholder, ErrorBoundary }: {
3
3
  contentEditable: JSX.Element;
4
- placeholder: ((isEditable: boolean) => null | JSX.Element) | null | JSX.Element;
5
- ErrorBoundary: ErrorBoundaryType;
4
+ placeholder?: ((isEditable: boolean) => null | JSX.Element) | null | JSX.Element;
5
+ ErrorBoundary?: ErrorBoundaryType;
6
6
  }): JSX.Element;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RichTextPlugin = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const jsx_runtime_1 = require("react/jsx-runtime");
6
5
  const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
7
- const useLexicalEditable_1 = tslib_1.__importDefault(require("@lexical/react/useLexicalEditable"));
6
+ const useLexicalEditable_1 = require("@lexical/react/useLexicalEditable");
8
7
  const useDecorators_1 = require("../shared/useDecorators");
9
8
  const useEditorFocus_1 = require("../shared/useEditorFocus");
10
9
  const useCanShowPlaceholder_1 = require("../shared/useCanShowPlaceholder");
@@ -19,7 +18,7 @@ exports.RichTextPlugin = RichTextPlugin;
19
18
  function Placeholder({ content }) {
20
19
  const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
21
20
  const showPlaceholder = (0, useCanShowPlaceholder_1.useCanShowPlaceholder)(editor);
22
- const editable = (0, useLexicalEditable_1.default)();
21
+ const editable = (0, useLexicalEditable_1.useLexicalEditable)();
23
22
  const hasFocus = (0, useEditorFocus_1.useEditorFocus)();
24
23
  if (!showPlaceholder || hasFocus) {
25
24
  return null;
@@ -19,6 +19,7 @@ const User_1 = tslib_1.__importDefault(require("../User"));
19
19
  const Widget_1 = tslib_1.__importDefault(require("../Widget"));
20
20
  const constants_1 = require("./constants");
21
21
  const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
22
+ const events_1 = require("../../utils/events");
22
23
  const classes = {
23
24
  root: `${constants_1.PREFIX}-root`,
24
25
  detailRoot: `${constants_1.PREFIX}-detail-root`,
@@ -46,7 +47,8 @@ const classes = {
46
47
  snippetInProgress: `${constants_1.PREFIX}-snippet-in-progress`,
47
48
  snippetPrimary: `${constants_1.PREFIX}-snippet-primary`,
48
49
  snippetSecondary: `${constants_1.PREFIX}-snippet-secondary`,
49
- snippetActions: `${constants_1.PREFIX}-snippet-actions`
50
+ snippetActions: `${constants_1.PREFIX}-snippet-actions`,
51
+ finishedChip: `${constants_1.PREFIX}-finished-chip`
50
52
  };
51
53
  const Root = (0, styles_1.styled)(Widget_1.default, {
52
54
  name: constants_1.PREFIX,
@@ -110,6 +112,7 @@ function Event(inProps) {
110
112
  // STATE
111
113
  const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event, autoSubscribe: false });
112
114
  const inProgress = (0, react_1.useMemo)(() => scEvent && scEvent.active && scEvent.running, [scEvent]);
115
+ const isEventFinished = (0, react_1.useMemo)(() => (0, events_1.checkEventFinished)(scEvent), [scEvent]);
113
116
  // CONTEXT
114
117
  const scRoutingContext = (0, react_core_1.useSCRouting)();
115
118
  // HOOKS
@@ -128,10 +131,10 @@ function Event(inProps) {
128
131
  contentObj = ((0, jsx_runtime_1.jsxs)(DetailRoot, Object.assign({ className: classes.detailRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.detailImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.detailImage }), !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.detailInProgress })), (0, jsx_runtime_1.jsx)(Calendar_1.default, { day: new Date(scEvent.start_date).getDate() })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.detailContent }, { children: [scEvent.active ? ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.detailNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.detailNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) }))), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent }), !hideEventPlanner && ((0, jsx_runtime_1.jsx)(User_1.default, { user: scEvent.managed_by, elevation: 0, secondary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.myEventsWidget.planner", defaultMessage: "ui.myEventsWidget.planner" }) })), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), className: classes.detailUser })), !hideEventParticipants && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailFirstDivider }), (0, jsx_runtime_1.jsx)(EventParticipantsButton_1.default, Object.assign({ event: scEvent }, EventParticipantsButtonComponentProps))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailSecondDivider })] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.detailActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
129
132
  }
130
133
  else if (template === event_1.SCEventTemplateType.PREVIEW) {
131
- contentObj = ((0, jsx_runtime_1.jsxs)(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.previewImage }), !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.previewInProgress }))] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.previewContent }, { children: [(0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hidePrivacyIcon: true, hasLocationInfo: false, beforePrivacyInfo: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.previewNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scEvent.name })) })) }), !hideEventParticipants && (0, jsx_runtime_1.jsx)(EventParticipantsButton_1.default, Object.assign({ event: scEvent, hideCaption: true }, EventParticipantsButtonComponentProps))] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.previewActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
134
+ contentObj = ((0, jsx_runtime_1.jsxs)(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.previewImage }), !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.previewInProgress })), isEventFinished && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.finished", defaultMessage: "ui.event.finished" }), className: classes.finishedChip }))] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.previewContent }, { children: [(0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hidePrivacyIcon: true, hasLocationInfo: false, beforePrivacyInfo: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.previewNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scEvent.name })) })) }), !hideEventParticipants && (0, jsx_runtime_1.jsx)(EventParticipantsButton_1.default, Object.assign({ event: scEvent, hideCaption: true }, EventParticipantsButtonComponentProps))] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.previewActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
132
135
  }
133
136
  else {
134
- contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.snippetImage }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.snippetAvatar }), ' ', !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.snippetInProgress }))] })), primary: (0, jsx_runtime_1.jsxs)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.snippetPrimary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, {
137
+ contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.snippetImage }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.snippetAvatar }), ' ', !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.snippetInProgress })), isEventFinished && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.finished", defaultMessage: "ui.event.finished" }), className: classes.finishedChip }))] })), primary: (0, jsx_runtime_1.jsxs)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.snippetPrimary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, {
135
138
  weekday: 'long',
136
139
  month: 'long',
137
140
  day: 'numeric'
@@ -157,6 +157,6 @@ function EventAddress(inProps) {
157
157
  }
158
158
  return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ className: classes.tabs, value: location, onChange: handleChange, indicatorColor: "secondary", textColor: "secondary", variant: "fullWidth" }, { children: [isInPersonTabActive && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.PERSON, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "add_location_alt" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.label", defaultMessage: "ui.eventForm.address.live.label" }) })), isOnlineTabActive && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.ONLINE, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "play_circle_outline" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.online.label", defaultMessage: "ui.eventForm.address.online.label" }) })), isLiveTabActive && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.LIVESTREAM, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "photo_camera" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.liveStream.label", defaultMessage: "ui.eventForm.address.liveStream.label" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.tabContent }, { children: [isInPersonTabActive && location === types_1.SCEventLocationType.PERSON && ((0, jsx_runtime_1.jsx)(material_1.Autocomplete, { disabled: !geocodingApiKey, size: "small", value: geolocation, onChange: handleSelection, inputValue: inputValue, onInputChange: handleLocationChange, options: suggestions, getOptionLabel: (option) => option.description || geolocation.description, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.noResults", defaultMessage: "ui.eventForm.address.live.noResults" }), isOptionEqualToValue: (option, value) => option.description === value.description, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.placeholder", defaultMessage: "ui.eventForm.address.live.placeholder" }), variant: "outlined", fullWidth: true, InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "add_location_alt" }) })), params.InputProps.endAdornment] })) }) }))) })), isOnlineTabActive && location === types_1.SCEventLocationType.ONLINE && ((0, jsx_runtime_1.jsx)(UrlTextField_1.default, { size: "small", fullWidth: true, type: "url", placeholder: `${intl.formatMessage(messages.virtualPlaceholder)}`, helperText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.online.help", defaultMessage: "ui.eventForm.address.online.help" }), InputProps: {
159
159
  endAdornment: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "play_circle_outline" })
160
- }, onChange: handleLinkChange })), isLiveTabActive && location === types_1.SCEventLocationType.LIVESTREAM && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LiveStream_1.default, { template: liveStream_1.SCLiveStreamTemplateType.SNIPPET, liveStream: liveStream, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}) }), (0, jsx_runtime_1.jsx)(LiveStreamFormSettings_1.default, { settings: liveStream.settings || constants_2.LIVESTREAM_DEFAULT_SETTINGS, onChange: handleLiveStreamSettingsChange })] }))] }))] })));
160
+ }, value: event ? event.link : '', onChange: handleLinkChange })), isLiveTabActive && location === types_1.SCEventLocationType.LIVESTREAM && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LiveStream_1.default, { template: liveStream_1.SCLiveStreamTemplateType.SNIPPET, liveStream: liveStream, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}) }), (0, jsx_runtime_1.jsx)(LiveStreamFormSettings_1.default, { settings: liveStream.settings || constants_2.LIVESTREAM_DEFAULT_SETTINGS, onChange: handleLiveStreamSettingsChange })] }))] }))] })));
161
161
  }
162
162
  exports.default = EventAddress;