@selfcommunity/react-ui 0.10.2-courses.185 → 0.10.2-courses.186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/cjs/components/Editor/Editor.d.ts +1 -1
- package/lib/cjs/components/Editor/Editor.js +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.js +6 -4
- package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/MentionNode.js +6 -4
- package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/cjs/components/Event/Event.js +6 -3
- package/lib/cjs/components/EventForm/types.d.ts +5 -5
- package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/cjs/components/Events/Events.d.ts +5 -0
- package/lib/cjs/components/Events/Events.js +21 -10
- package/lib/cjs/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/cjs/components/Events/OngoingEventsFilter.js +24 -0
- package/lib/cjs/components/Feed/Feed.d.ts +2 -2
- package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
- package/lib/cjs/components/LiveStreamForm/types.d.ts +3 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
- package/lib/cjs/components/LiveStreamRoom/types.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +2 -2
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/cjs/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/cjs/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
- package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
- package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/cjs/types/composer.d.ts +1 -1
- package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/esm/components/Editor/Editor.d.ts +1 -1
- package/lib/esm/components/Editor/Editor.js +2 -2
- package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/HashtagNode.js +6 -4
- package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/MentionNode.js +6 -4
- package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/esm/components/Event/Event.js +6 -3
- package/lib/esm/components/EventForm/types.d.ts +5 -5
- package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/esm/components/Events/Events.d.ts +5 -0
- package/lib/esm/components/Events/Events.js +22 -11
- package/lib/esm/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/esm/components/Events/OngoingEventsFilter.js +21 -0
- package/lib/esm/components/Feed/Feed.d.ts +2 -2
- package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
- package/lib/esm/components/LiveStreamForm/types.d.ts +3 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
- package/lib/esm/components/LiveStreamRoom/types.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +2 -2
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/esm/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/esm/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
- package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/esm/shared/StickyBox/index.d.ts +4 -4
- package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/esm/types/composer.d.ts +1 -1
- package/lib/umd/689.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +11 -11
- package/lib/umd/233.js +0 -2
- /package/lib/umd/{233.js.LICENSE.txt → 689.js.LICENSE.txt} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BottomNavigationProps as MuiBottomNavigationProps } from '@mui/material';
|
|
2
|
-
export
|
|
2
|
+
export type BottomNavigationProps = MuiBottomNavigationProps;
|
|
3
3
|
/**
|
|
4
4
|
* > API documentation for the Community-JS Bottom Navigation component. Learn about the available props and the CSS API.
|
|
5
5
|
*
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ToolbarPluginProps } from './plugins/ToolbarPlugin';
|
|
3
3
|
import { MediaPluginProps } from './plugins';
|
|
4
4
|
import { SCMediaType } from '@selfcommunity/types';
|
|
5
|
-
export
|
|
5
|
+
export type EditorRef = {
|
|
6
6
|
focus: () => void;
|
|
7
7
|
};
|
|
8
8
|
export interface EditorProps {
|
|
@@ -15,10 +15,10 @@ const ToolbarPlugin_1 = tslib_1.__importDefault(require("./plugins/ToolbarPlugin
|
|
|
15
15
|
const constants_1 = require("./constants");
|
|
16
16
|
const HorizontalRulePlugin_1 = require("./plugins/HorizontalRulePlugin");
|
|
17
17
|
const LexicalRichTextPlugin_1 = require("./plugins/LexicalRichTextPlugin");
|
|
18
|
-
const LexicalErrorBoundary_1 = require("@lexical/react/LexicalErrorBoundary");
|
|
19
18
|
const plugins_1 = require("./plugins");
|
|
20
19
|
const OnBlurPlugin_1 = tslib_1.__importDefault(require("./plugins/OnBlurPlugin"));
|
|
21
20
|
const OnFocusPlugin_1 = tslib_1.__importDefault(require("./plugins/OnFocusPlugin"));
|
|
21
|
+
const LexicalErrorBoundary_1 = require("@lexical/react/LexicalErrorBoundary");
|
|
22
22
|
const LexicalLinkPlugin_1 = require("@lexical/react/LexicalLinkPlugin");
|
|
23
23
|
const FloatingLinkPlugin_1 = tslib_1.__importDefault(require("./plugins/FloatingLinkPlugin"));
|
|
24
24
|
const ApiPlugin_1 = tslib_1.__importDefault(require("./plugins/ApiPlugin"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode, Spread, TextNode } from 'lexical';
|
|
2
2
|
import { SCCategoryType } from '@selfcommunity/types';
|
|
3
3
|
import { DOMConversionMap } from 'lexical/LexicalNode';
|
|
4
|
-
export
|
|
4
|
+
export type SerializedHashtagNode = Spread<{
|
|
5
5
|
category: SCCategoryType;
|
|
6
6
|
type: 'hashtag';
|
|
7
7
|
version: 1;
|
|
@@ -12,16 +12,16 @@ function convertHashtagElement(domNode) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
class HashtagNode extends lexical_1.TextNode {
|
|
15
|
-
constructor(category, text, key) {
|
|
16
|
-
super(text !== null && text !== void 0 ? text : `#${category.name}`, key);
|
|
17
|
-
this.__category = category;
|
|
18
|
-
}
|
|
19
15
|
static getType() {
|
|
20
16
|
return 'hashtag';
|
|
21
17
|
}
|
|
22
18
|
static clone(node) {
|
|
23
19
|
return new HashtagNode(node.__category, node.__text, node.__key);
|
|
24
20
|
}
|
|
21
|
+
constructor(category, text, key) {
|
|
22
|
+
super(text !== null && text !== void 0 ? text : `#${category.name}`, key);
|
|
23
|
+
this.__category = category;
|
|
24
|
+
}
|
|
25
25
|
createDOM(config) {
|
|
26
26
|
const tag = 'hashtag';
|
|
27
27
|
const dom = document.createElement(tag);
|
|
@@ -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
|
}
|
|
@@ -12,7 +12,7 @@ export interface ImagePayload {
|
|
|
12
12
|
declare function convertImageElement(domNode: any): {
|
|
13
13
|
node: ImageNode;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type SerializedImageNode = Spread<{
|
|
16
16
|
altText: string;
|
|
17
17
|
maxWidth: number | string;
|
|
18
18
|
src: string;
|
|
@@ -107,18 +107,18 @@ function convertImageElement(domNode) {
|
|
|
107
107
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
108
108
|
// @ts-ignore
|
|
109
109
|
class ImageNode extends lexical_1.DecoratorNode {
|
|
110
|
-
constructor(src, altText, maxWidth, key) {
|
|
111
|
-
super(key);
|
|
112
|
-
this.__src = src;
|
|
113
|
-
this.__altText = altText;
|
|
114
|
-
this.__maxWidth = maxWidth;
|
|
115
|
-
}
|
|
116
110
|
static getType() {
|
|
117
111
|
return 'image';
|
|
118
112
|
}
|
|
119
113
|
static clone(node) {
|
|
120
114
|
return new ImageNode(node.__src, node.__altText, node.__maxWidth, node.__key);
|
|
121
115
|
}
|
|
116
|
+
constructor(src, altText, maxWidth, key) {
|
|
117
|
+
super(key);
|
|
118
|
+
this.__src = src;
|
|
119
|
+
this.__altText = altText;
|
|
120
|
+
this.__maxWidth = maxWidth;
|
|
121
|
+
}
|
|
122
122
|
setWidthAndHeight(width, height) {
|
|
123
123
|
const writable = this.getWritable();
|
|
124
124
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode, Spread, TextNode } from 'lexical';
|
|
2
2
|
import { SCUserType } from '@selfcommunity/types';
|
|
3
3
|
import { DOMConversionMap } from 'lexical/LexicalNode';
|
|
4
|
-
export
|
|
4
|
+
export type SerializedMentionNode = Spread<{
|
|
5
5
|
user: SCUserType;
|
|
6
6
|
type: 'mention';
|
|
7
7
|
version: 1;
|
|
@@ -25,16 +25,16 @@ function convertMentionElement(domNode) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
class MentionNode extends lexical_1.TextNode {
|
|
28
|
-
constructor(user, text, key) {
|
|
29
|
-
super(text !== null && text !== void 0 ? text : `@${user.username}`, key);
|
|
30
|
-
this.__user = user;
|
|
31
|
-
}
|
|
32
28
|
static getType() {
|
|
33
29
|
return 'mention';
|
|
34
30
|
}
|
|
35
31
|
static clone(node) {
|
|
36
32
|
return new MentionNode(node.__user, node.__text, node.__key);
|
|
37
33
|
}
|
|
34
|
+
constructor(user, text, key) {
|
|
35
|
+
super(text !== null && text !== void 0 ? text : `@${user.username}`, key);
|
|
36
|
+
this.__user = user;
|
|
37
|
+
}
|
|
38
38
|
createDOM(config) {
|
|
39
39
|
const tag = 'mention';
|
|
40
40
|
const dom = document.createElement(tag);
|
|
@@ -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
|
}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { LexicalEditor } from 'lexical';
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
|
|
10
|
+
type ErrorBoundaryProps = {
|
|
11
11
|
children: JSX.Element;
|
|
12
12
|
onError: (error: Error) => void;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type ErrorBoundaryType = React.ComponentClass<ErrorBoundaryProps> | React.FC<ErrorBoundaryProps>;
|
|
15
15
|
export declare function useDecorators(editor: LexicalEditor, ErrorBoundary: ErrorBoundaryType): Array<JSX.Element>;
|
|
16
16
|
export {};
|
|
@@ -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'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SCEventLocationType, SCEventRecurrenceType, SCLiveStreamSettingsType } from '@selfcommunity/types';
|
|
2
|
-
export
|
|
2
|
+
export type Place = {
|
|
3
3
|
description: string;
|
|
4
4
|
id?: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type Geolocation = {
|
|
7
7
|
location: SCEventLocationType;
|
|
8
8
|
geolocation?: string;
|
|
9
9
|
lat?: number;
|
|
@@ -11,7 +11,7 @@ export declare type Geolocation = {
|
|
|
11
11
|
link?: string;
|
|
12
12
|
liveStreamSettings?: SCLiveStreamSettingsType;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type InitialFieldState = Geolocation & {
|
|
15
15
|
imageOriginal: string | ArrayBuffer;
|
|
16
16
|
imageOriginalFile: string | Blob;
|
|
17
17
|
startDate: Date | null;
|
|
@@ -24,5 +24,5 @@ export declare type InitialFieldState = Geolocation & {
|
|
|
24
24
|
isPublic: boolean;
|
|
25
25
|
isSubmitting: boolean;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
28
|
-
export
|
|
27
|
+
export type FieldStateKeys = keyof InitialFieldState;
|
|
28
|
+
export type FieldStateValues = InitialFieldState[FieldStateKeys];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UploadButtonProps } from '@rpldy/upload-button';
|
|
2
2
|
import type { ComponentType } from 'react';
|
|
3
|
-
|
|
3
|
+
type FileInputProps = {
|
|
4
4
|
accept: string;
|
|
5
5
|
};
|
|
6
6
|
declare const asUploadButton: (Component: ComponentType<any>, inputProps: FileInputProps) => import("react").ForwardRefExoticComponent<Pick<UploadButtonProps<Element>, "id" | "className" | "text" | "children" | "onClick" | "method" | "headers" | "paramName" | "params" | "forceJsonResponse" | "withCredentials" | "formatGroupParamName" | "sendWithFormData" | "formDataAllowUndefined" | "formatServerResponse" | "isSuccessfulCall" | "destination" | "fileFilter" | "autoUpload" | "clearPendingOnAdd" | "grouped" | "maxGroupSize" | "inputFieldName" | "fastAbortThreshold" | "userData" | "extraProps"> & import("react").RefAttributes<any>>;
|
|
@@ -82,7 +82,7 @@ function EventParticipantsButton(inProps) {
|
|
|
82
82
|
}, [scEvent]);
|
|
83
83
|
// FETCH FIRST FOLLOWERS
|
|
84
84
|
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
85
|
-
if (!scEvent) {
|
|
85
|
+
if (!scEvent || !participantsAvailable) {
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
if (!followers.length && participantsAvailable) {
|
|
@@ -21,10 +21,13 @@ const Skeleton_1 = tslib_1.__importDefault(require("../Events/Skeleton"));
|
|
|
21
21
|
const constants_1 = require("./constants");
|
|
22
22
|
const LocationEventsFilter_1 = tslib_1.__importDefault(require("./LocationEventsFilter"));
|
|
23
23
|
const PastEventsFilter_1 = tslib_1.__importDefault(require("./PastEventsFilter"));
|
|
24
|
+
const OngoingEventsFilter_1 = tslib_1.__importDefault(require("./OngoingEventsFilter"));
|
|
24
25
|
const classes = {
|
|
25
26
|
root: `${constants_1.PREFIX}-root`,
|
|
26
27
|
filters: `${constants_1.PREFIX}-filters`,
|
|
27
28
|
events: `${constants_1.PREFIX}-events`,
|
|
29
|
+
sectionTitle: `${constants_1.PREFIX}-section-title`,
|
|
30
|
+
divider: `${constants_1.PREFIX}-divider`,
|
|
28
31
|
item: `${constants_1.PREFIX}-item`,
|
|
29
32
|
itemSkeleton: `${constants_1.PREFIX}-item-skeleton`,
|
|
30
33
|
noResults: `${constants_1.PREFIX}-no-results`,
|
|
@@ -32,7 +35,7 @@ const classes = {
|
|
|
32
35
|
search: `${constants_1.PREFIX}-search`
|
|
33
36
|
};
|
|
34
37
|
const options = [
|
|
35
|
-
{ value: types_1.SCEventDateFilterType.
|
|
38
|
+
{ value: types_1.SCEventDateFilterType.ALL, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.any", defaultMessage: "ui.events.select.any" }) },
|
|
36
39
|
{ value: types_1.SCEventDateFilterType.TODAY, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.today", defaultMessage: "ui.events.select.today" }) },
|
|
37
40
|
{ value: types_1.SCEventDateFilterType.TOMORROW, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.tomorrow", defaultMessage: "ui.events.select.tomorrow" }) },
|
|
38
41
|
{ value: types_1.SCEventDateFilterType.THIS_WEEK, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.thisWeek", defaultMessage: "ui.events.select.thisWeek" }) },
|
|
@@ -46,7 +49,7 @@ const Root = (0, material_1.styled)(material_1.Box, {
|
|
|
46
49
|
exports.EventsChipRoot = (0, material_1.styled)(material_1.Chip, {
|
|
47
50
|
name: constants_1.PREFIX,
|
|
48
51
|
slot: 'EventsChipRoot',
|
|
49
|
-
shouldForwardProp: (prop) => prop !== 'showFollowed' && prop !== 'showPastEvents'
|
|
52
|
+
shouldForwardProp: (prop) => prop !== 'showFollowed' && prop !== 'showPastEvents' && prop !== 'showOngoingEvents'
|
|
50
53
|
})(() => ({}));
|
|
51
54
|
/**
|
|
52
55
|
* > API documentation for the Community-JS Events component. Learn about the available props and the CSS API.
|
|
@@ -81,7 +84,7 @@ function Events(inProps) {
|
|
|
81
84
|
props: inProps,
|
|
82
85
|
name: constants_1.PREFIX
|
|
83
86
|
});
|
|
84
|
-
const { endpoint = api_services_1.Endpoints.SearchEvents, endpointQueryParams = { limit: 8, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, className, EventComponentProps = { elevation: 0, square: true }, EventsSkeletonComponentProps = {}, EventSkeletonComponentProps = { elevation: 0, square: true }, GridContainerComponentProps = {}, GridItemComponentProps = {}, CreateEventButtonProps = {}, showFilters = false, filters, general = true } = props, rest = tslib_1.__rest(props, ["endpoint", "endpointQueryParams", "className", "EventComponentProps", "EventsSkeletonComponentProps", "EventSkeletonComponentProps", "GridContainerComponentProps", "GridItemComponentProps", "CreateEventButtonProps", "showFilters", "filters", "general"]);
|
|
87
|
+
const { endpoint = api_services_1.Endpoints.SearchEvents, endpointQueryParams = { limit: 8, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, className, EventComponentProps = { elevation: 0, square: true }, EventsSkeletonComponentProps = {}, EventSkeletonComponentProps = { elevation: 0, square: true }, GridContainerComponentProps = {}, GridItemComponentProps = {}, CreateEventButtonProps = {}, showFilters = false, filters, general = true, hideTitle = false } = props, rest = tslib_1.__rest(props, ["endpoint", "endpointQueryParams", "className", "EventComponentProps", "EventsSkeletonComponentProps", "EventSkeletonComponentProps", "GridContainerComponentProps", "GridItemComponentProps", "CreateEventButtonProps", "showFilters", "filters", "general", "hideTitle"]);
|
|
85
88
|
// STATE
|
|
86
89
|
const [events, setEvents] = (0, react_1.useState)([]);
|
|
87
90
|
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
@@ -91,7 +94,9 @@ function Events(inProps) {
|
|
|
91
94
|
const [location, setLocation] = (0, react_1.useState)(types_1.SCEventLocationFilterType.ANY);
|
|
92
95
|
const [showFollowed, setShowFollowed] = (0, react_1.useState)(false);
|
|
93
96
|
const [showPastEvents, setShowPastEvents] = (0, react_1.useState)(false);
|
|
97
|
+
const [showOngoingEvents, setShowOngoingEvents] = (0, react_1.useState)(false);
|
|
94
98
|
const [showMyEvents, setShowMyEvents] = (0, react_1.useState)(false);
|
|
99
|
+
const showUserEvents = !general && (events.length || (!events.length && (showPastEvents || showMyEvents || location !== types_1.SCEventLocationFilterType.ANY)));
|
|
95
100
|
// CONTEXT
|
|
96
101
|
const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
|
|
97
102
|
const scPreferencesContext = (0, react_1.useContext)(react_core_1.SCPreferencesContext);
|
|
@@ -118,6 +123,12 @@ function Events(inProps) {
|
|
|
118
123
|
const handleDeletePastClick = () => {
|
|
119
124
|
setShowPastEvents(false);
|
|
120
125
|
};
|
|
126
|
+
const handleChipOngoingClick = () => {
|
|
127
|
+
setShowOngoingEvents(!showOngoingEvents);
|
|
128
|
+
};
|
|
129
|
+
const handleDeleteOngoingClick = () => {
|
|
130
|
+
setShowOngoingEvents(false);
|
|
131
|
+
};
|
|
121
132
|
/**
|
|
122
133
|
* Fetches events list
|
|
123
134
|
*/
|
|
@@ -128,7 +139,7 @@ function Events(inProps) {
|
|
|
128
139
|
url: endpoint.url({}),
|
|
129
140
|
method: endpoint.method,
|
|
130
141
|
params: Object.assign(Object.assign({}, endpointQueryParams), (general
|
|
131
|
-
? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (query && { search: query })), (dateSearch !== types_1.SCEventDateFilterType.
|
|
142
|
+
? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (query && { search: query })), (dateSearch !== types_1.SCEventDateFilterType.ALL && { date_filter: dateSearch })), (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showFollowed && { follows: showFollowed })), (showOngoingEvents && { date_filter: types_1.SCEventDateFilterType.NOT_PAST })) : Object.assign(Object.assign(Object.assign({ subscription_status: types_1.SCEventSubscriptionStatusType.GOING }, (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showPastEvents && { past: showPastEvents })), (showMyEvents && { created_by: authUserId }))))
|
|
132
143
|
})
|
|
133
144
|
.then((res) => {
|
|
134
145
|
setEvents(res.data.results);
|
|
@@ -149,7 +160,7 @@ function Events(inProps) {
|
|
|
149
160
|
else {
|
|
150
161
|
fetchEvents();
|
|
151
162
|
}
|
|
152
|
-
}, [contentAvailability, authUserId, dateSearch, location, showFollowed, showPastEvents, showMyEvents]);
|
|
163
|
+
}, [contentAvailability, authUserId, dateSearch, location, showFollowed, showPastEvents, showMyEvents, showOngoingEvents]);
|
|
153
164
|
/**
|
|
154
165
|
* Subscriber for pubsub callback
|
|
155
166
|
*/
|
|
@@ -212,24 +223,24 @@ function Events(inProps) {
|
|
|
212
223
|
/**
|
|
213
224
|
* Renders events list
|
|
214
225
|
*/
|
|
215
|
-
const
|
|
226
|
+
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : showUserEvents ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showMyEvents ? 'secondary' : 'default', variant: showMyEvents ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByCreatedByMe", defaultMessage: "ui.events.filterByCreatedByMe" }), onClick: () => setShowMyEvents(!showMyEvents),
|
|
216
227
|
// @ts-expect-error this is needed to use showFollowed into SCEvents
|
|
217
|
-
showFollowed: showMyEvents, deleteIcon: showMyEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyEvents ? () => setShowMyEvents(false) : null, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.search, size: 'small', fullWidth: true, value: query, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
228
|
+
showFollowed: showMyEvents, deleteIcon: showMyEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyEvents ? () => setShowMyEvents(false) : null, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) }))] })) : general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.search, size: 'small', fullWidth: true, value: query, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
218
229
|
e.preventDefault();
|
|
219
230
|
if (e.key === 'Enter') {
|
|
220
231
|
fetchEvents();
|
|
221
232
|
}
|
|
222
233
|
}, InputProps: {
|
|
223
234
|
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isMobile ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => fetchEvents(), disabled: loading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", variant: "contained", color: "secondary", onClick: () => fetchEvents(), endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }), disabled: loading })) })))
|
|
224
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled:
|
|
235
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled: showOngoingEvents || loading, size: 'small', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ value: option.value }, { children: [(0, jsx_runtime_1.jsx)(material_1.Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) })), authUserId && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showFollowed ? 'secondary' : 'default', variant: showFollowed ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByFollowedInterest", defaultMessage: "ui.events.filterByFollowedInterest" }), onClick: handleChipClick,
|
|
225
236
|
// @ts-expect-error this is needed to use showFollowed into SCEvents
|
|
226
|
-
showFollowed: showFollowed, deleteIcon: showFollowed ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading }) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(
|
|
237
|
+
showFollowed: showFollowed, deleteIcon: showFollowed ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading }) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(OngoingEventsFilter_1.default, { showOngoingEvents: showOngoingEvents, handleClick: handleChipOngoingClick, handleDeleteClick: handleDeleteOngoingClick, disabled: dateSearch !== types_1.SCEventDateFilterType.ALL || loading }) }))] })) : null }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, EventsSkeletonComponentProps, { EventSkeletonProps: EventSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !events.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && react_core_1.UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? ((0, jsx_runtime_1.jsx)(CreateEventButton_1.default, Object.assign({}, CreateEventButtonProps))) : null })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title", defaultMessage: "ui.events.noEvents.title" }) }))] })) : showUserEvents ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title.personal", defaultMessage: "ui.events.noEvents.title.personal" }) })) })) : null }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.events }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [events.map((event) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.default, Object.assign({ event: event, eventId: event.id }, EventComponentProps)) }), event.id))), authUserId && events.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.itemSkeleton }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, Object.assign({ variant: "outlined", color: "primary", size: "small" }, CreateEventButtonProps, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.skeleton.action.add", defaultMessage: "ui.events.skeleton.action.add" }) })) })) }), 'skeleton-item'))] }) })), Boolean(next) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.button.seeMore", defaultMessage: "ui.events.button.seeMore" }) })))] })) })) })] }));
|
|
227
238
|
/**
|
|
228
239
|
* Renders root object (if content availability community option is false and user is anonymous, component is hidden)
|
|
229
240
|
*/
|
|
230
241
|
if (!contentAvailability && !scUserContext.user) {
|
|
231
242
|
return null;
|
|
232
243
|
}
|
|
233
|
-
return ((0, jsx_runtime_1.
|
|
244
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: showUserEvents && !hideTitle ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.myEvents.title", defaultMessage: "ui.events.myEvents.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.divider })] })) : general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.allEvents.title", defaultMessage: "ui.events.allEvents.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.divider })] })) : null }), content] })));
|
|
234
245
|
}
|
|
235
246
|
exports.default = Events;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChipProps } from '@mui/material';
|
|
2
|
+
export interface OngoingEventsFilterProps extends ChipProps {
|
|
3
|
+
autoHide?: boolean;
|
|
4
|
+
showOngoingEvents: boolean;
|
|
5
|
+
handleClick: () => void;
|
|
6
|
+
handleDeleteClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export default function OngoingEventsFilter(inProps: OngoingEventsFilterProps): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_intl_1 = require("react-intl");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const Events_1 = require("./Events");
|
|
9
|
+
function OngoingEventsFilter(inProps) {
|
|
10
|
+
// PROPS
|
|
11
|
+
const props = (0, material_1.useThemeProps)({
|
|
12
|
+
props: inProps,
|
|
13
|
+
name: constants_1.PREFIX
|
|
14
|
+
});
|
|
15
|
+
const { autoHide = false, showOngoingEvents, handleClick, handleDeleteClick } = props, rest = tslib_1.__rest(props, ["autoHide", "showOngoingEvents", "handleClick", "handleDeleteClick"]);
|
|
16
|
+
if (autoHide) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(Events_1.EventsChipRoot, Object.assign({ color: showOngoingEvents ? 'secondary' : 'default', variant: showOngoingEvents ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByOngoingEvents", defaultMessage: "ui.events.filterByOngoingEvents" }), onClick: handleClick,
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
showOngoingEvents: showOngoingEvents, deleteIcon: showOngoingEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showOngoingEvents ? handleDeleteClick : undefined }, rest)));
|
|
23
|
+
}
|
|
24
|
+
exports.default = OngoingEventsFilter;
|
|
@@ -9,11 +9,11 @@ import { StickyBoxProps } from '../../shared/StickyBox';
|
|
|
9
9
|
/**
|
|
10
10
|
* FeedSidebarProps has the same props as StickyBoxProps type
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type FeedSidebarProps = StickyBoxProps;
|
|
13
13
|
/**
|
|
14
14
|
* FeedRef props
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type FeedRef = {
|
|
17
17
|
addFeedData: (obj: any, syncPagination?: boolean) => void;
|
|
18
18
|
refresh: () => void;
|
|
19
19
|
getCurrentFeedObjectIds: () => number[];
|
|
@@ -11,7 +11,7 @@ interface FeedSkeletonMap {
|
|
|
11
11
|
*/
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type FeedSkeletonProps = React.PropsWithChildren<FeedSkeletonMap>;
|
|
15
15
|
/**
|
|
16
16
|
* > API documentation for the Community-JS Feed Skeleton component. Learn about the available props and the CSS API.
|
|
17
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type InitialFieldState = {
|
|
2
2
|
title: string;
|
|
3
3
|
description: string;
|
|
4
4
|
slug?: string;
|
|
@@ -7,5 +7,5 @@ export declare type InitialFieldState = {
|
|
|
7
7
|
coverFile?: string | Blob;
|
|
8
8
|
isSubmitting: boolean;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type FieldStateKeys = keyof InitialFieldState;
|
|
11
|
+
export type FieldStateValues = InitialFieldState[FieldStateKeys];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
3
3
|
import type { ParticipantClickEvent } from '@livekit/components-core';
|
|
4
|
-
export
|
|
4
|
+
export type FocusLayoutContainerProps = React.HTMLAttributes<HTMLDivElement>;
|
|
5
5
|
/**
|
|
6
6
|
* The `FocusLayoutContainer` is a layout component that expects two children:
|
|
7
7
|
* A small side component: In a video conference, this is usually a carousel of participants
|
|
@@ -12,7 +12,7 @@ export declare function useSettingsToggle({ props }: UseSettingsToggleProps): {
|
|
|
12
12
|
'aria-pressed': string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type SettingsMenuToggleProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
16
16
|
/**
|
|
17
17
|
* The `SettingsMenuToggle` component is a button that toggles the visibility of the `SettingsMenu` component.
|
|
18
18
|
*/
|
|
@@ -7,12 +7,12 @@ export declare function chain(...callbacks: any[]): (...args: any[]) => void;
|
|
|
7
7
|
interface Props {
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type TupleTypes<T> = {
|
|
11
11
|
[P in keyof T]: T[P];
|
|
12
12
|
} extends {
|
|
13
13
|
[key: number]: infer V;
|
|
14
14
|
} ? V : never;
|
|
15
|
-
|
|
15
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
16
16
|
/**
|
|
17
17
|
* Merges multiple props objects together. Event handlers are chained,
|
|
18
18
|
* classNames are combined, and ids are deduplicated - different ids
|
|
@@ -14,7 +14,7 @@ export interface TokenResult {
|
|
|
14
14
|
accessToken: string;
|
|
15
15
|
}
|
|
16
16
|
export declare function isVideoCodec(codec: string): codec is VideoCodec;
|
|
17
|
-
export
|
|
17
|
+
export type ConnectionDetails = {
|
|
18
18
|
serverUrl: string;
|
|
19
19
|
roomName: string;
|
|
20
20
|
participantName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BoxProps } from '@mui/material';
|
|
2
2
|
export declare const PREFIX = "SCDefaultDrawerSkeleton";
|
|
3
|
-
export
|
|
3
|
+
export type DefaultDrawerSkeletonProps = BoxProps;
|
|
4
4
|
/**
|
|
5
5
|
* > API documentation for the Community-JS Default Drawer Skeleton component. Learn about the available props and the CSS API.
|
|
6
6
|
|