@selfcommunity/react-ui 0.8.1-alpha.4 → 0.9.0-alpha.0
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/EventMediaWidget/EventMediaWidget.d.ts +37 -0
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +242 -0
- package/lib/cjs/components/EventMediaWidget/Skeleton.d.ts +2 -0
- package/lib/cjs/components/EventMediaWidget/Skeleton.js +28 -0
- package/lib/cjs/components/EventMediaWidget/TriggerButton.d.ts +15 -0
- package/lib/cjs/components/EventMediaWidget/TriggerButton.js +63 -0
- package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +7 -0
- package/lib/cjs/components/EventMediaWidget/asUploadButton.js +25 -0
- package/lib/cjs/components/EventMediaWidget/constants.d.ts +1 -0
- package/lib/cjs/components/EventMediaWidget/constants.js +4 -0
- package/lib/cjs/components/EventMediaWidget/index.d.ts +4 -0
- package/lib/cjs/components/EventMediaWidget/index.js +8 -0
- package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +1 -3
- package/lib/cjs/index.d.ts +6 -5
- package/lib/cjs/index.js +14 -13
- package/lib/cjs/shared/Lightbox/BaseLightbox.d.ts +19 -0
- package/lib/cjs/shared/Lightbox/BaseLightbox.js +35 -0
- package/lib/cjs/shared/Lightbox/Lightbox.d.ts +31 -17
- package/lib/cjs/shared/Lightbox/Lightbox.js +16 -19
- package/lib/cjs/shared/Lightbox/constants.d.ts +1 -0
- package/lib/cjs/shared/Lightbox/constants.js +4 -0
- package/lib/cjs/shared/Lightbox/index.d.ts +4 -2
- package/lib/cjs/shared/Lightbox/index.js +4 -1
- package/lib/cjs/shared/Media/File/DisplayComponent.js +23 -6
- package/lib/cjs/shared/MediaChunkUploader/index.js +13 -11
- package/lib/cjs/utils/hash.d.ts +2 -1
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.d.ts +37 -0
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +239 -0
- package/lib/esm/components/EventMediaWidget/Skeleton.d.ts +2 -0
- package/lib/esm/components/EventMediaWidget/Skeleton.js +22 -0
- package/lib/esm/components/EventMediaWidget/TriggerButton.d.ts +15 -0
- package/lib/esm/components/EventMediaWidget/TriggerButton.js +60 -0
- package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +7 -0
- package/lib/esm/components/EventMediaWidget/asUploadButton.js +23 -0
- package/lib/esm/components/EventMediaWidget/constants.d.ts +1 -0
- package/lib/esm/components/EventMediaWidget/constants.js +1 -0
- package/lib/esm/components/EventMediaWidget/index.d.ts +4 -0
- package/lib/esm/components/EventMediaWidget/index.js +4 -0
- package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +1 -3
- package/lib/esm/index.d.ts +6 -5
- package/lib/esm/index.js +7 -7
- package/lib/esm/shared/Lightbox/BaseLightbox.d.ts +19 -0
- package/lib/esm/shared/Lightbox/BaseLightbox.js +33 -0
- package/lib/esm/shared/Lightbox/Lightbox.d.ts +31 -17
- package/lib/esm/shared/Lightbox/Lightbox.js +15 -19
- package/lib/esm/shared/Lightbox/constants.d.ts +1 -0
- package/lib/esm/shared/Lightbox/constants.js +1 -0
- package/lib/esm/shared/Lightbox/index.d.ts +4 -2
- package/lib/esm/shared/Lightbox/index.js +3 -1
- package/lib/esm/shared/Media/File/DisplayComponent.js +23 -6
- package/lib/esm/shared/MediaChunkUploader/index.js +14 -12
- package/lib/esm/utils/hash.d.ts +2 -1
- package/lib/umd/react-ui.js +1 -1
- package/package.json +6 -6
- package/lib/cjs/shared/Media/File/Lightbox/index.d.ts +0 -28
- package/lib/cjs/shared/Media/File/Lightbox/index.js +0 -37
- package/lib/esm/shared/Media/File/Lightbox/index.d.ts +0 -28
- package/lib/esm/shared/Media/File/Lightbox/index.js +0 -34
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { LoadingButton } from '@mui/lab';
|
|
4
|
+
import { Button, CardActions, CardContent, CardHeader, Divider, Icon, Stack, Tooltip, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
5
|
+
import { styled } from '@mui/material/styles';
|
|
6
|
+
import { Box, useThemeProps } from '@mui/system';
|
|
7
|
+
import { Endpoints, EventService, http } from '@selfcommunity/api-services';
|
|
8
|
+
import { SCCache, useSCFetchEvent, useSCUser } from '@selfcommunity/react-core';
|
|
9
|
+
import { Logger } from '@selfcommunity/utils';
|
|
10
|
+
import { Fragment, useCallback, useEffect, useMemo, useReducer, useState } from 'react';
|
|
11
|
+
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
12
|
+
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
13
|
+
import { DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET } from '../../constants/Pagination';
|
|
14
|
+
import BaseDialog from '../../shared/BaseDialog';
|
|
15
|
+
import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
|
|
16
|
+
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
17
|
+
import InfiniteScroll from '../../shared/InfiniteScroll';
|
|
18
|
+
import { Lightbox } from '../../shared/Lightbox';
|
|
19
|
+
import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../utils/widget';
|
|
20
|
+
import Widget from '../Widget';
|
|
21
|
+
import { PREFIX } from './constants';
|
|
22
|
+
import SkeletonComponent, { EventMediaSkeleton } from './Skeleton';
|
|
23
|
+
import TriggerButton from './TriggerButton';
|
|
24
|
+
const messages = defineMessages({
|
|
25
|
+
title: {
|
|
26
|
+
id: 'ui.eventMediaWidget.title',
|
|
27
|
+
defaultMessage: 'ui.eventMediaWidget.title'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const MEDIAS_TO_SHOW = 9;
|
|
31
|
+
const classes = {
|
|
32
|
+
root: `${PREFIX}-root`,
|
|
33
|
+
header: `${PREFIX}-header`,
|
|
34
|
+
grid: `${PREFIX}-grid`,
|
|
35
|
+
media: `${PREFIX}-media`,
|
|
36
|
+
mediaLayer: `${PREFIX}-media-layer`,
|
|
37
|
+
countHiddenMediaWrapper: `${PREFIX}-count-hidden-media-wrapper`,
|
|
38
|
+
countHiddenMedia: `${PREFIX}-count-hidden-media`,
|
|
39
|
+
content: `${PREFIX}-content`,
|
|
40
|
+
actions: `${PREFIX}-actions`,
|
|
41
|
+
dialogRoot: `${PREFIX}-dialog-root`,
|
|
42
|
+
dialogInfiniteScroll: `${PREFIX}-dialog-infinite-scroll`,
|
|
43
|
+
dialogMediaWrapper: `${PREFIX}-dialog-media-wrapper`,
|
|
44
|
+
dialogButtonWrapper: `${PREFIX}-dialog-button-wrapper`,
|
|
45
|
+
dialogLoadingButton: `${PREFIX}-dialog-loading-button`,
|
|
46
|
+
endMessage: `${PREFIX}-end-message`
|
|
47
|
+
};
|
|
48
|
+
const Root = styled(Widget, {
|
|
49
|
+
name: PREFIX,
|
|
50
|
+
slot: 'Root',
|
|
51
|
+
overridesResolver: (_props, styles) => styles.root,
|
|
52
|
+
shouldForwardProp: (prop) => prop !== 'showPadding'
|
|
53
|
+
})(() => ({}));
|
|
54
|
+
const DialogRoot = styled(BaseDialog, {
|
|
55
|
+
name: PREFIX,
|
|
56
|
+
slot: 'DialogRoot',
|
|
57
|
+
overridesResolver: (_props, styles) => styles.dialogRoot,
|
|
58
|
+
shouldForwardProp: (prop) => prop !== 'loading'
|
|
59
|
+
})(() => ({}));
|
|
60
|
+
export default function EventMediaWidget(inProps) {
|
|
61
|
+
// PROPS
|
|
62
|
+
const props = useThemeProps({
|
|
63
|
+
props: inProps,
|
|
64
|
+
name: PREFIX
|
|
65
|
+
});
|
|
66
|
+
// CONST
|
|
67
|
+
const { event, eventId, limit = DEFAULT_PAGINATION_LIMIT, endpointQueryParams = {
|
|
68
|
+
limit,
|
|
69
|
+
offset: DEFAULT_PAGINATION_OFFSET
|
|
70
|
+
}, cacheStrategy, dialogProps } = props, rest = __rest(props, ["event", "eventId", "limit", "endpointQueryParams", "cacheStrategy", "dialogProps"]);
|
|
71
|
+
// STATE
|
|
72
|
+
const [state, dispatch] = useReducer(dataWidgetReducer, {
|
|
73
|
+
isLoadingNext: false,
|
|
74
|
+
next: null,
|
|
75
|
+
cacheKey: SCCache.getWidgetStateCacheKey(SCCache.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY),
|
|
76
|
+
cacheStrategy,
|
|
77
|
+
visibleItems: limit
|
|
78
|
+
}, stateWidgetInitializer);
|
|
79
|
+
const [medias, setMedias] = useState([]);
|
|
80
|
+
const [mediasCount, setMediasCount] = useState(0);
|
|
81
|
+
const [openDialog, setOpenDialog] = useState(false);
|
|
82
|
+
const [openDialogConfirm, setOpenDialogConfirm] = useState(false);
|
|
83
|
+
const [mediaId, setMediaId] = useState(null);
|
|
84
|
+
const [preview, setPreview] = useState(-1);
|
|
85
|
+
const [loading, setLoading] = useState(false);
|
|
86
|
+
const [showSkeleton, setShowSkeleton] = useState(null);
|
|
87
|
+
// CONTEXT
|
|
88
|
+
const scUserContext = useSCUser();
|
|
89
|
+
// HOOKS
|
|
90
|
+
const { scEvent } = useSCFetchEvent({ id: eventId, event });
|
|
91
|
+
const intl = useIntl();
|
|
92
|
+
const theme = useTheme();
|
|
93
|
+
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
94
|
+
// CONSTS
|
|
95
|
+
const hasAllow = useMemo(() => { var _a; return ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === (scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by.id); }, [scUserContext, scEvent]);
|
|
96
|
+
const countHiddenMedia = useMemo(() => mediasCount - MEDIAS_TO_SHOW, [mediasCount]);
|
|
97
|
+
/**
|
|
98
|
+
* Initialize component
|
|
99
|
+
* Fetch data only if the component is not initialized and it is not loading data
|
|
100
|
+
*/
|
|
101
|
+
const _initComponent = useCallback(() => {
|
|
102
|
+
if (!state.initialized && !state.isLoadingNext) {
|
|
103
|
+
dispatch({ type: actionWidgetTypes.LOADING_NEXT });
|
|
104
|
+
EventService.getEventPhotoGallery(scEvent.id, Object.assign({}, endpointQueryParams))
|
|
105
|
+
.then((payload) => {
|
|
106
|
+
dispatch({ type: actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
|
|
107
|
+
setMedias(payload.results);
|
|
108
|
+
setMediasCount(payload.count);
|
|
109
|
+
})
|
|
110
|
+
.catch((error) => {
|
|
111
|
+
dispatch({ type: actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
112
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}, [state.isLoadingNext, state.initialized, scEvent]);
|
|
116
|
+
const _fetchNext = useCallback((index) => {
|
|
117
|
+
if (mediasCount > medias.length && index >= 6 && !state.isLoadingNext && state.next) {
|
|
118
|
+
setPreview(index);
|
|
119
|
+
dispatch({ type: actionWidgetTypes.LOADING_NEXT });
|
|
120
|
+
http
|
|
121
|
+
.request({
|
|
122
|
+
url: state.next,
|
|
123
|
+
method: Endpoints.GetEventPhotoGallery.method
|
|
124
|
+
})
|
|
125
|
+
.then((res) => {
|
|
126
|
+
dispatch({ type: actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
|
|
127
|
+
setMedias((prev) => [...prev, ...res.data.results]);
|
|
128
|
+
setMediasCount(res.data.count);
|
|
129
|
+
})
|
|
130
|
+
.catch((error) => {
|
|
131
|
+
dispatch({ type: actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
132
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, [state.next, state.isLoadingNext, medias.length]);
|
|
136
|
+
const handleOpenLightbox = useCallback((index) => {
|
|
137
|
+
setPreview(index);
|
|
138
|
+
}, [setPreview]);
|
|
139
|
+
const handleCloseLightbox = useCallback(() => {
|
|
140
|
+
setPreview(-1);
|
|
141
|
+
}, [setPreview]);
|
|
142
|
+
const handleToggleDialogOpen = useCallback(() => {
|
|
143
|
+
setOpenDialog((prev) => !prev);
|
|
144
|
+
}, [setOpenDialog]);
|
|
145
|
+
const handleNext = useCallback(() => {
|
|
146
|
+
setShowSkeleton('dialog');
|
|
147
|
+
dispatch({ type: actionWidgetTypes.LOADING_NEXT });
|
|
148
|
+
http
|
|
149
|
+
.request({
|
|
150
|
+
url: state.next,
|
|
151
|
+
method: Endpoints.GetEventPhotoGallery.method
|
|
152
|
+
})
|
|
153
|
+
.then((res) => {
|
|
154
|
+
dispatch({ type: actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
|
|
155
|
+
setMedias((prev) => [...prev, ...res.data.results]);
|
|
156
|
+
setMediasCount(res.data.count);
|
|
157
|
+
setShowSkeleton(null);
|
|
158
|
+
})
|
|
159
|
+
.catch((error) => {
|
|
160
|
+
dispatch({ type: actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
161
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
162
|
+
});
|
|
163
|
+
}, [state.next, state.isLoadingNext, state.initialized, dispatch, setMedias, setMediasCount, setShowSkeleton]);
|
|
164
|
+
const handleRemoveMedia = useCallback((id) => {
|
|
165
|
+
if (hasAllow) {
|
|
166
|
+
setMediaId(id);
|
|
167
|
+
setOpenDialogConfirm(true);
|
|
168
|
+
}
|
|
169
|
+
}, [setMediaId, setOpenDialogConfirm]);
|
|
170
|
+
const handleConfirmAction = useCallback(() => {
|
|
171
|
+
setLoading(true);
|
|
172
|
+
http
|
|
173
|
+
.request({
|
|
174
|
+
url: Endpoints.RemoveMediasFromEventPhotoGallery.url({ id: scEvent.id }),
|
|
175
|
+
method: Endpoints.RemoveMediasFromEventPhotoGallery.method,
|
|
176
|
+
data: { medias: [mediaId] }
|
|
177
|
+
})
|
|
178
|
+
.then(() => {
|
|
179
|
+
setMedias((prev) => prev.filter((media) => media.id !== mediaId));
|
|
180
|
+
setMediasCount((prev) => prev - 1);
|
|
181
|
+
setMediaId(null);
|
|
182
|
+
setLoading(false);
|
|
183
|
+
setOpenDialogConfirm(false);
|
|
184
|
+
})
|
|
185
|
+
.catch((error) => {
|
|
186
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
187
|
+
});
|
|
188
|
+
}, [scEvent, mediaId, setMedias, setLoading, setOpenDialogConfirm, dispatch]);
|
|
189
|
+
const handleCloseAction = useCallback(() => {
|
|
190
|
+
setMediaId(null);
|
|
191
|
+
setOpenDialogConfirm(false);
|
|
192
|
+
}, [setMediaId, setOpenDialogConfirm]);
|
|
193
|
+
const handleAddMedia = useCallback((media) => {
|
|
194
|
+
setShowSkeleton('widget');
|
|
195
|
+
http
|
|
196
|
+
.request({
|
|
197
|
+
url: Endpoints.AddMediaToEventPhotoGallery.url({ id: scEvent.id }),
|
|
198
|
+
method: Endpoints.AddMediaToEventPhotoGallery.method,
|
|
199
|
+
data: { media: media.id }
|
|
200
|
+
})
|
|
201
|
+
.then((res) => {
|
|
202
|
+
setMedias((prev) => [res.data, ...prev]);
|
|
203
|
+
setMediasCount((prev) => prev + 1);
|
|
204
|
+
setShowSkeleton(null);
|
|
205
|
+
})
|
|
206
|
+
.catch((error) => {
|
|
207
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
208
|
+
});
|
|
209
|
+
}, [scEvent, setMedias, setMediasCount, setShowSkeleton]);
|
|
210
|
+
// EFFECTS
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
let _t;
|
|
213
|
+
if (scUserContext.user && scEvent) {
|
|
214
|
+
_t = setTimeout(_initComponent);
|
|
215
|
+
return () => {
|
|
216
|
+
clearTimeout(_t);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}, [scUserContext.user, scEvent]);
|
|
220
|
+
useEffect(() => {
|
|
221
|
+
if (isMobile && openDialog && state.next) {
|
|
222
|
+
handleNext();
|
|
223
|
+
}
|
|
224
|
+
}, [isMobile, openDialog, state.next]);
|
|
225
|
+
// RENDER
|
|
226
|
+
if (!scEvent || (state.initialized && mediasCount === 0 && !hasAllow)) {
|
|
227
|
+
return _jsx(HiddenPlaceholder, {});
|
|
228
|
+
}
|
|
229
|
+
if (!state.initialized || (state.isLoadingNext && mediasCount === 0)) {
|
|
230
|
+
return _jsx(SkeletonComponent, {});
|
|
231
|
+
}
|
|
232
|
+
return (_jsxs(Root, Object.assign({ className: classes.root }, rest, { showPadding: hasAllow }, { children: [_jsx(CardHeader, { title: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center" }, { children: [_jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.title", defaultMessage: "ui.eventMediaWidget.title" }) })), hasAllow && mediasCount > 0 && _jsx(TriggerButton, { size: "small", onAdd: handleAddMedia })] })), className: classes.header }), _jsx(Divider, {}), _jsxs(CardContent, Object.assign({ className: classes.content }, { children: [_jsxs(Box, Object.assign({ className: classes.grid }, { children: [showSkeleton === 'widget' && _jsx(EventMediaSkeleton, {}), medias.slice(0, MEDIAS_TO_SHOW).map((media, i, array) => (_jsx(Box, Object.assign({ onClick: () => handleOpenLightbox(i), sx: {
|
|
233
|
+
background: `url(${media.image}) no-repeat center`
|
|
234
|
+
}, className: classes.media }, { children: medias.length > array.length && i === array.length - 1 && (_jsxs(Fragment, { children: [_jsx(Box, { className: classes.mediaLayer }), _jsx(Box, Object.assign({ className: classes.countHiddenMediaWrapper }, { children: _jsxs(Typography, Object.assign({ className: classes.countHiddenMedia }, { children: ["+", countHiddenMedia] })) }))] })) }), media.id))), hasAllow && mediasCount === 0 && (_jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.add", defaultMessage: "ui.eventMediaWidget.add" }) }, { children: _jsx(TriggerButton, { size: "large", onAdd: handleAddMedia, isSquare: true }) })))] })), preview !== -1 && _jsx(Lightbox, { onClose: handleCloseLightbox, index: preview, medias: medias, onIndexChange: _fetchNext })] })), hasAllow && mediasCount > 0 && (_jsx(CardActions, Object.assign({ className: classes.actions }, { children: _jsx(Button, Object.assign({ onClick: handleToggleDialogOpen }, { children: _jsx(Typography, Object.assign({ variant: "caption" }, { children: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.showAll", defaultMessage: "ui.eventMediaWidget.showAll" }) })) })) }))), openDialog && (_jsx(DialogRoot, Object.assign({ className: classes.dialogRoot, title: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }), onClose: handleToggleDialogOpen, open: openDialog }, dialogProps, { children: _jsx(InfiniteScroll, Object.assign({ dataLength: medias.length, height: isMobile ? '100%' : '515px', next: handleNext, hasMoreNext: Boolean(state.next), className: classes.dialogInfiniteScroll, endMessage: _jsx(Typography, Object.assign({ className: classes.endMessage }, { children: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.noMoreResults", defaultMessage: "ui.eventMediaWidget.noMoreResults" }) })) }, { children: _jsxs(Box, Object.assign({ className: classes.grid }, { children: [medias.map((media) => (_jsx(Box, Object.assign({ sx: {
|
|
235
|
+
background: `url(${media.image}) no-repeat center`
|
|
236
|
+
}, className: classes.dialogMediaWrapper }, { children: _jsx(Stack, Object.assign({ className: classes.dialogButtonWrapper }, { children: _jsx(LoadingButton, Object.assign({ className: classes.dialogLoadingButton, loading: mediaId === media.id, size: "large", onClick: () => handleRemoveMedia(media.id), sx: {
|
|
237
|
+
color: (theme) => (mediaId === media.id ? 'transparent' : theme.palette.common.white)
|
|
238
|
+
} }, { children: _jsx(Icon, Object.assign({ fontSize: "inherit" }, { children: "delete" })) })) })) }), media.id))), showSkeleton === 'dialog' && Array.from(Array(countHiddenMedia)).map((_, i) => _jsx(EventMediaSkeleton, {}, i))] })) })) }))), openDialogConfirm && (_jsx(ConfirmDialog, { open: openDialogConfirm, title: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.dialog.title", defaultMessage: "ui.eventMediaWidget.dialog.title" }), content: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.dialog.msg", defaultMessage: "ui.eventMediaWidget.dialog.msg" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.dialog.confirm", defaultMessage: "ui.eventMediaWidget.dialog.confirm" }), isUpdating: loading, onConfirm: handleConfirmAction, onClose: handleCloseAction }))] })));
|
|
239
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, CardContent, CardHeader, Divider } from '@mui/material';
|
|
3
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import Widget from '../Widget';
|
|
6
|
+
import { PREFIX } from './constants';
|
|
7
|
+
const classes = {
|
|
8
|
+
root: `${PREFIX}-skeleton-root`,
|
|
9
|
+
grid: `${PREFIX}-grid`,
|
|
10
|
+
media: `${PREFIX}-media`
|
|
11
|
+
};
|
|
12
|
+
const Root = styled(Widget, {
|
|
13
|
+
name: PREFIX,
|
|
14
|
+
slot: 'SkeletonRoot',
|
|
15
|
+
overridesResolver: (_props, styles) => styles.skeletonRoot
|
|
16
|
+
})(() => ({}));
|
|
17
|
+
export default function EventMediaWidgetSkeleton() {
|
|
18
|
+
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(CardHeader, { title: _jsx(Skeleton, { animation: "wave", width: "50px", height: "23px" }) }), _jsx(Divider, {}), _jsx(CardContent, { children: _jsx(Box, Object.assign({ className: classes.grid }, { children: Array.from(Array(9)).map((_, i) => (_jsx(EventMediaSkeleton, {}, i))) })) })] })));
|
|
19
|
+
}
|
|
20
|
+
export function EventMediaSkeleton() {
|
|
21
|
+
return _jsx(Skeleton, { variant: "rectangular", animation: "wave", width: "100%", className: classes.media });
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LoadingButtonProps } from '@mui/lab';
|
|
2
|
+
import { SCMediaType } from '@selfcommunity/types';
|
|
3
|
+
export interface TriggerIconButtonProps extends LoadingButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Callback triggered when a media is added
|
|
6
|
+
* @param media
|
|
7
|
+
*/
|
|
8
|
+
onAdd?: (media: SCMediaType) => void | null;
|
|
9
|
+
/**
|
|
10
|
+
* Prop to change shape
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
isSquare?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export default function TriggerButton(props: TriggerIconButtonProps): JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { LoadingButton } from '@mui/lab';
|
|
4
|
+
import { Stack, Typography } from '@mui/material';
|
|
5
|
+
import Icon from '@mui/material/Icon';
|
|
6
|
+
import { styled } from '@mui/material/styles';
|
|
7
|
+
import ChunkedUploady from '@rpldy/chunked-uploady';
|
|
8
|
+
import { Endpoints } from '@selfcommunity/api-services';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { useSnackbar } from 'notistack';
|
|
11
|
+
import { forwardRef, useCallback, useState } from 'react';
|
|
12
|
+
import { FormattedMessage } from 'react-intl';
|
|
13
|
+
import MediaChunkUploader from '../../shared/MediaChunkUploader';
|
|
14
|
+
import asUploadButton from './asUploadButton';
|
|
15
|
+
import { PREFIX } from './constants';
|
|
16
|
+
const classes = {
|
|
17
|
+
triggerRoot: `${PREFIX}-trigger-root`,
|
|
18
|
+
triggerContent: `${PREFIX}-trigger-content`,
|
|
19
|
+
triggerIcon: `${PREFIX}-trigger-icon`
|
|
20
|
+
};
|
|
21
|
+
const Root = styled(LoadingButton, {
|
|
22
|
+
name: PREFIX,
|
|
23
|
+
slot: 'TriggerRoot',
|
|
24
|
+
overridesResolver: (_props, styles) => styles.triggerRoot,
|
|
25
|
+
shouldForwardProp: (prop) => prop !== 'isSquare'
|
|
26
|
+
})(() => ({}));
|
|
27
|
+
const GalleryUploadStack = asUploadButton(forwardRef((props, ref) => _jsx(Stack, Object.assign({}, props, { "aria-label": "upload", ref: ref }))), { accept: 'image/*' });
|
|
28
|
+
export default function TriggerButton(props) {
|
|
29
|
+
// PROPS
|
|
30
|
+
const { className, onAdd = null, isSquare = false } = props, rest = __rest(props, ["className", "onAdd", "isSquare"]);
|
|
31
|
+
// STATE
|
|
32
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
33
|
+
// HOOKS
|
|
34
|
+
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
|
|
35
|
+
const handleFilterByMime = useCallback((file) => {
|
|
36
|
+
return file.type.startsWith('image/');
|
|
37
|
+
}, []);
|
|
38
|
+
const handleSuccess = useCallback((media) => {
|
|
39
|
+
onAdd === null || onAdd === void 0 ? void 0 : onAdd(media);
|
|
40
|
+
}, []);
|
|
41
|
+
const handleProgress = useCallback((chunks) => {
|
|
42
|
+
setIsUploading(Object.keys(chunks).length > 0);
|
|
43
|
+
}, []);
|
|
44
|
+
const handleError = useCallback((chunk, error) => {
|
|
45
|
+
const _snackBar = enqueueSnackbar(`${chunk.name}: ${error}`, {
|
|
46
|
+
variant: 'error',
|
|
47
|
+
anchorOrigin: { horizontal: 'center', vertical: 'top' },
|
|
48
|
+
autoHideDuration: 2000,
|
|
49
|
+
SnackbarProps: {
|
|
50
|
+
onClick: () => {
|
|
51
|
+
closeSnackbar(_snackBar);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}, [enqueueSnackbar]);
|
|
56
|
+
return (_jsxs(ChunkedUploady, Object.assign({ destination: {
|
|
57
|
+
url: Endpoints.ComposerChunkUploadMedia.url(),
|
|
58
|
+
method: Endpoints.ComposerChunkUploadMedia.method
|
|
59
|
+
}, fileFilter: handleFilterByMime, chunkSize: 204800 }, { children: [_jsx(MediaChunkUploader, { onSuccess: handleSuccess, onProgress: handleProgress, onError: handleError, type: "image" }), _jsx(Root, Object.assign({ className: classNames(className, classes.triggerRoot) }, rest, { "aria-label": "add media", loading: isUploading, isSquare: isSquare }, { children: _jsxs(GalleryUploadStack, Object.assign({ className: classes.triggerContent }, { children: [!isSquare && (_jsx(Typography, Object.assign({ variant: "caption", component: "p" }, { children: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.add", defaultMessage: "ui.eventMediaWidget.add" }) }))), _jsx(Icon, Object.assign({ className: classes.triggerIcon }, { children: "add" }))] })) }))] })));
|
|
60
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UploadButtonProps } from '@rpldy/upload-button';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
declare type FileInputProps = {
|
|
4
|
+
accept: string;
|
|
5
|
+
};
|
|
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>>;
|
|
7
|
+
export default asUploadButton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { markAsUploadOptionsComponent, useUploadyContext } from '@rpldy/shared-ui';
|
|
4
|
+
import { forwardRef, useCallback, useRef } from 'react';
|
|
5
|
+
const asUploadButton = (Component, inputProps) => {
|
|
6
|
+
const AsUploadButton = (props, ref) => {
|
|
7
|
+
const { showFileUpload, getInternalFileInput } = useUploadyContext();
|
|
8
|
+
const { id, className, text, children, extraProps, onClick } = props, uploadOptions = __rest(props, ["id", "className", "text", "children", "extraProps", "onClick"]);
|
|
9
|
+
//using ref so onButtonClick can stay memoized
|
|
10
|
+
const uploadOptionsRef = useRef();
|
|
11
|
+
uploadOptionsRef.current = uploadOptions;
|
|
12
|
+
const onButtonClick = useCallback((e) => {
|
|
13
|
+
const input = getInternalFileInput();
|
|
14
|
+
input.current.accept = inputProps.accept;
|
|
15
|
+
showFileUpload(uploadOptionsRef.current);
|
|
16
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
17
|
+
}, [getInternalFileInput, showFileUpload, uploadOptionsRef, onClick]);
|
|
18
|
+
return _jsx(Component, Object.assign({ ref: ref, onClick: onButtonClick, id: id, className: className, children: children || text || 'Upload' }, extraProps));
|
|
19
|
+
};
|
|
20
|
+
markAsUploadOptionsComponent(AsUploadButton);
|
|
21
|
+
return forwardRef(AsUploadButton);
|
|
22
|
+
};
|
|
23
|
+
export default asUploadButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCEventMediaWidget";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PREFIX = 'SCEventMediaWidget';
|
|
@@ -162,7 +162,5 @@ export default function PrivateMessageThreadItem(inProps) {
|
|
|
162
162
|
message.status !== SCPrivateMessageStatusType.HIDDEN && _jsx(PrivateMessageSettingsIconButton, { onMenuItemDeleteClick: handleMenuItemClick }) }, { children: [message.group && ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) !== message.sender.username && (_jsx(Typography, Object.assign({ color: "secondary", variant: "h4", className: classes.username }, { children: message.sender.username }))), _jsxs(_Fragment, { children: [hasFile && message.status !== SCPrivateMessageStatusType.HIDDEN ? (renderMessageFile(message)) : (_jsx(Box, Object.assign({ className: classes.text }, { children: _jsx(Typography, { component: "span", dangerouslySetInnerHTML: { __html: message.message } }) }))), _jsx(Typography, Object.assign({ className: classes.messageTime, color: "text.secondary" }, { children: `${intl.formatDate(message.created_at, {
|
|
163
163
|
hour: 'numeric',
|
|
164
164
|
minute: 'numeric'
|
|
165
|
-
})}` }))] }), openDialog && (_jsx(_Fragment, { children: (message === null || message === void 0 ? void 0 : message.file.mimetype.startsWith(SCMessageFileType.VIDEO)) ? (_jsx(DialogRoot, Object.assign({ open: openDialog, onClose: () => setOpenDialog(false), className: classes.dialogRoot }, { children: _jsx(AutoPlayer, { url: message === null || message === void 0 ? void 0 : message.file.url, width: '100%', enableAutoplay: false }) }))) : (_jsx(LightBox, { images: [{ src: message === null || message === void 0 ? void 0 : message.file.url, key: message.file.uuid }], onClose: () => setOpenDialog(false), toolbarButtons:
|
|
166
|
-
_jsx(IconButton, Object.assign({ onClick: () => handleDownload(message === null || message === void 0 ? void 0 : message.file), className: classes.downloadButton }, { children: _jsx(Icon, { children: "download" }) }), 'download')
|
|
167
|
-
] })) }))] })));
|
|
165
|
+
})}` }))] }), openDialog && (_jsx(_Fragment, { children: (message === null || message === void 0 ? void 0 : message.file.mimetype.startsWith(SCMessageFileType.VIDEO)) ? (_jsx(DialogRoot, Object.assign({ open: openDialog, onClose: () => setOpenDialog(false), className: classes.dialogRoot }, { children: _jsx(AutoPlayer, { url: message === null || message === void 0 ? void 0 : message.file.url, width: '100%', enableAutoplay: false }) }))) : (_jsx(LightBox, { images: [{ src: message === null || message === void 0 ? void 0 : message.file.url, key: message.file.uuid }], onClose: () => setOpenDialog(false), toolbarButtons: _jsx(IconButton, Object.assign({ onClick: () => handleDownload(message === null || message === void 0 ? void 0 : message.file), className: classes.downloadButton }, { children: _jsx(Icon, { children: "download" }) }), 'download') })) }))] })));
|
|
168
166
|
}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ import EventHeader, { EventHeaderProps, EventHeaderSkeleton } from './components
|
|
|
47
47
|
import EventInfoWidget, { EventInfoWidgetProps } from './components/EventInfoWidget';
|
|
48
48
|
import EventInviteButton, { EventInviteButtonProps } from './components/EventInviteButton';
|
|
49
49
|
import EventLocationWidget, { EventLocationWidgetProps, EventLocationWidgetSkeleton } from './components/EventLocationWidget';
|
|
50
|
+
import EventMediaWidget, { EventMediaWidgetProps, EventMediaWidgetSkeleton } from './components/EventMediaWidget';
|
|
50
51
|
import EventMembersWidget, { EventMembersWidgetProps, EventMembersWidgetSkeleton } from './components/EventMembersWidget';
|
|
51
52
|
import EventParticipantsButton, { EventParticipantsButtonProps } from './components/EventParticipantsButton';
|
|
52
53
|
import Events, { EventsProps, EventsSkeleton, EventsSkeletonProps } from './components/Events';
|
|
@@ -79,7 +80,7 @@ import InviteUserEventButton, { InviteUserEventButtonProps } from './components/
|
|
|
79
80
|
import LocationAutocomplete, { LocationAutocompleteProps } from './components/LocationAutocomplete';
|
|
80
81
|
import LoyaltyProgramWidget, { LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton } from './components/LoyaltyProgramWidget';
|
|
81
82
|
import MyEventsWidget, { MyEventsWidgetProps, MyEventsWidgetSkeleton } from './components/MyEventsWidget';
|
|
82
|
-
import NavigationMenuIconButton, { NavigationMenuContent,
|
|
83
|
+
import NavigationMenuIconButton, { NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButtonProps } from './components/NavigationMenuIconButton';
|
|
83
84
|
import DefaultDrawerContent, { DefaultDrawerContentProps } from './components/NavigationMenuIconButton/DefaultDrawerContent';
|
|
84
85
|
import DefaultHeaderContent, { DefaultHeaderContentProps } from './components/NavigationMenuIconButton/DefaultHeaderContent';
|
|
85
86
|
import NavigationSettingsIconButton, { NavigationSettingsIconButtonProps, NavigationSettingsItem } from './components/NavigationSettingsIconButton';
|
|
@@ -132,7 +133,7 @@ import EventActionsMenu, { EventActionsMenuProps } from './shared/EventActionsMe
|
|
|
132
133
|
import EventInfoDetails, { EventInfoDetailsProps } from './shared/EventInfoDetails';
|
|
133
134
|
import HiddenPlaceholder from './shared/HiddenPlaceholder';
|
|
134
135
|
import LanguageSwitcher from './shared/LanguageSwitcher';
|
|
135
|
-
import Lightbox from './shared/Lightbox';
|
|
136
|
+
import BaseLightbox, { BaseLightboxProps, Lightbox, LightboxProps } from './shared/Lightbox';
|
|
136
137
|
import { EditMediaProps, File, Link, Share } from './shared/Media';
|
|
137
138
|
import MediaChunkUploader, { MediaChunkUploaderProps } from './shared/MediaChunkUploader';
|
|
138
139
|
import PasswordTextField from './shared/PasswordTextField';
|
|
@@ -144,7 +145,7 @@ import UrlTextField from './shared/UrlTextField';
|
|
|
144
145
|
import UserAvatar, { UserAvatarProps } from './shared/UserAvatar';
|
|
145
146
|
import UserDeletedSnackBar, { UserDeletedSnackBarProps } from './shared/UserDeletedSnackBar';
|
|
146
147
|
import UsernameTextField from './shared/UsernameTextField';
|
|
147
|
-
import { PlatformWidgetActionType, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, VirtualScrollerItemProps
|
|
148
|
+
import { PlatformWidgetActionType, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, VirtualScrollerItemProps } from './types';
|
|
148
149
|
/**
|
|
149
150
|
* Constants
|
|
150
151
|
*/
|
|
@@ -152,9 +153,9 @@ import { DEFAULT_WIDGETS_NUMBER } from './constants/Feed';
|
|
|
152
153
|
import { DEFAULT_PRELOAD_OFFSET_VIEWPORT, MAX_PRELOAD_OFFSET_VIEWPORT, MIN_PRELOAD_OFFSET_VIEWPORT } from './constants/LazyLoad';
|
|
153
154
|
import { LEGAL_POLICIES } from './constants/LegalPolicies';
|
|
154
155
|
import { DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME } from './constants/Pagination';
|
|
156
|
+
import { SCEventMembersEventType, SCGroupMembersEventType } from './constants/PubSub';
|
|
155
157
|
import { FACEBOOK_SHARE, LINKEDIN_SHARE, X_SHARE } from './constants/SocialShare';
|
|
156
158
|
import { DEFAULT_FIELDS } from './constants/UserProfile';
|
|
157
|
-
import { SCTopicType, SCGroupEventType, SCEventMembersEventType, SCGroupMembersEventType } from './constants/PubSub';
|
|
158
159
|
/**
|
|
159
160
|
* Utilities
|
|
160
161
|
*/
|
|
@@ -174,4 +175,4 @@ import LogoSelfCommunity from './assets/logo';
|
|
|
174
175
|
/**
|
|
175
176
|
* List all exports
|
|
176
177
|
*/
|
|
177
|
-
export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps,
|
|
178
|
+
export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, useStickyBox, UseStickyBoxProps, VirtualScrollerItemProps, Widget, WidgetProps, X_SHARE };
|
package/lib/esm/index.js
CHANGED
|
@@ -47,6 +47,7 @@ import EventHeader, { EventHeaderSkeleton } from './components/EventHeader';
|
|
|
47
47
|
import EventInfoWidget from './components/EventInfoWidget';
|
|
48
48
|
import EventInviteButton from './components/EventInviteButton';
|
|
49
49
|
import EventLocationWidget, { EventLocationWidgetSkeleton } from './components/EventLocationWidget';
|
|
50
|
+
import EventMediaWidget, { EventMediaWidgetSkeleton } from './components/EventMediaWidget';
|
|
50
51
|
import EventMembersWidget, { EventMembersWidgetSkeleton } from './components/EventMembersWidget';
|
|
51
52
|
import EventParticipantsButton from './components/EventParticipantsButton';
|
|
52
53
|
import Events, { EventsSkeleton } from './components/Events';
|
|
@@ -79,7 +80,7 @@ import InviteUserEventButton from './components/InviteUserEventButton';
|
|
|
79
80
|
import LocationAutocomplete from './components/LocationAutocomplete';
|
|
80
81
|
import LoyaltyProgramWidget, { LoyaltyProgramWidgetSkeleton } from './components/LoyaltyProgramWidget';
|
|
81
82
|
import MyEventsWidget, { MyEventsWidgetSkeleton } from './components/MyEventsWidget';
|
|
82
|
-
import NavigationMenuIconButton, { NavigationMenuContent,
|
|
83
|
+
import NavigationMenuIconButton, { NavigationMenuContent, NavigationMenuDrawer, NavigationMenuHeader } from './components/NavigationMenuIconButton';
|
|
83
84
|
import DefaultDrawerContent from './components/NavigationMenuIconButton/DefaultDrawerContent';
|
|
84
85
|
import DefaultHeaderContent from './components/NavigationMenuIconButton/DefaultHeaderContent';
|
|
85
86
|
import NavigationSettingsIconButton from './components/NavigationSettingsIconButton';
|
|
@@ -132,7 +133,7 @@ import EventActionsMenu from './shared/EventActionsMenu';
|
|
|
132
133
|
import EventInfoDetails from './shared/EventInfoDetails';
|
|
133
134
|
import HiddenPlaceholder from './shared/HiddenPlaceholder';
|
|
134
135
|
import LanguageSwitcher from './shared/LanguageSwitcher';
|
|
135
|
-
import Lightbox from './shared/Lightbox';
|
|
136
|
+
import BaseLightbox, { Lightbox } from './shared/Lightbox';
|
|
136
137
|
import { File, Link, Share } from './shared/Media';
|
|
137
138
|
import MediaChunkUploader from './shared/MediaChunkUploader';
|
|
138
139
|
import PasswordTextField from './shared/PasswordTextField';
|
|
@@ -144,7 +145,7 @@ import UrlTextField from './shared/UrlTextField';
|
|
|
144
145
|
import UserAvatar from './shared/UserAvatar';
|
|
145
146
|
import UserDeletedSnackBar from './shared/UserDeletedSnackBar';
|
|
146
147
|
import UsernameTextField from './shared/UsernameTextField';
|
|
147
|
-
import { SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations
|
|
148
|
+
import { SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations } from './types';
|
|
148
149
|
/**
|
|
149
150
|
* Constants
|
|
150
151
|
*/
|
|
@@ -154,7 +155,6 @@ import { LEGAL_POLICIES } from './constants/LegalPolicies';
|
|
|
154
155
|
import { DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME } from './constants/Pagination';
|
|
155
156
|
import { FACEBOOK_SHARE, LINKEDIN_SHARE, X_SHARE } from './constants/SocialShare';
|
|
156
157
|
import { DEFAULT_FIELDS } from './constants/UserProfile';
|
|
157
|
-
import { SCTopicType, SCGroupEventType } from './constants/PubSub';
|
|
158
158
|
/**
|
|
159
159
|
* Utilities
|
|
160
160
|
*/
|
|
@@ -174,12 +174,12 @@ import LogoSelfCommunity from './assets/logo';
|
|
|
174
174
|
/**
|
|
175
175
|
* List all exports
|
|
176
176
|
*/
|
|
177
|
-
export { AcceptRequestUserEventButton, AccountChangeMailValidation, AccountDataPortability, AccountDataPortabilityButton, AccountDelete, AccountDeleteButton, AccountRecover, AccountReset, AccountVerify, AvatarGroupSkeleton, BaseDialog, BaseItem, BottomNavigation, BroadcastMessages, BroadcastMessagesSkeleton, bytesToSize, Calendar, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesSkeleton, CategoriesSuggestionWidget, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryFollowButton, CategoryFollowersButton, CategoryHeader, CategoryHeaderSkeleton, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CentralProgress, ChangeCover, ChangeGroupCover, ChangeGroupPicture, ChangePicture, CommentObject, CommentObjectReply, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectSkeleton, Composer, ComposerIconButton, ConfirmDialog, ConnectionUserButton,
|
|
177
|
+
export { AcceptRequestUserEventButton, AccountChangeMailValidation, AccountDataPortability, AccountDataPortabilityButton, AccountDelete, AccountDeleteButton, AccountRecover, AccountReset, AccountVerify, AvatarGroupSkeleton, BaseDialog, BaseItem, BaseLightbox, BottomNavigation, BroadcastMessages, BroadcastMessagesSkeleton, bytesToSize, Calendar, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesSkeleton, CategoriesSuggestionWidget, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryFollowButton, CategoryFollowersButton, CategoryHeader, CategoryHeaderSkeleton, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CentralProgress, ChangeCover, ChangeGroupCover, ChangeGroupPicture, ChangePicture, CommentObject, CommentObjectReply, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectSkeleton, Composer, ComposerIconButton, ConfirmDialog, ConnectionUserButton,
|
|
178
178
|
/* SC CONSENT SOLUTION */
|
|
179
179
|
ConsentSolution, ConsentSolutionButton, ConsentSolutionSkeleton, ContributionUtils, CreateEventButton, CreateEventWidget, CreateEventWidgetSkeleton, CreateGroupButton, CustomAdv, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET,
|
|
180
180
|
/* SC UI PAGINATION */
|
|
181
|
-
DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultHeaderContent,
|
|
181
|
+
DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultHeaderContent, EditEventButton, EditGroupButton, Editor, EditorSkeleton, EmailTextField, Event, EventActionsMenu, EventHeader, EventHeaderSkeleton, EventInfoDetails, EventInfoWidget, EventInviteButton, EventLocationWidget, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetSkeleton, EventParticipantsButton, Events, EventSkeleton, EventsSkeleton, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectSkeleton, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetSkeleton, File, FollowUserButton, Footer, FooterSkeleton, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupForm, GroupHeader, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInvitedWidget, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersWidget, GroupMembersWidgetSkeleton, GroupRequestsWidget, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSkeleton, GroupsSkeleton, GroupSubscribeButton,
|
|
182
182
|
/* SC UI SHARED */
|
|
183
183
|
HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorListWidget, IncubatorSubscribeButton, IncubatorSuggestionWidget, InfiniteScroll, InlineComposerWidget, InlineComposerWidgetSkeleton, InviteUserEventButton, LanguageSwitcher, LEGAL_POLICIES, Lightbox, Link, LINKEDIN_SHARE, LocationAutocomplete,
|
|
184
184
|
/* Assets */
|
|
185
|
-
LogoSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, MediaChunkUploader, MessageUploaderUtils, MetadataField, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuHeader, NavigationMenuIconButton,
|
|
185
|
+
LogoSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, MediaChunkUploader, MessageUploaderUtils, MetadataField, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuHeader, NavigationMenuIconButton, NavigationSettingsIconButton, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileSkeleton, NavigationToolbarSkeleton, Notification, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetSkeleton, PollSuggestionWidget, PrivateMessageComponent, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSnippetItem, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemSkeleton, PrivateMessageThreadSkeleton, ProgressBar, RelatedEventsWidget, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchDialog, Share, SnippetNotifications, SnippetNotificationsSkeleton, StickyBox, SuggestedEventsWidget, SuggestedEventsWidgetSkeleton, TagChip, ToastNotifications, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserAvatar, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetSkeleton, UserCounters, UserDeletedSnackBar, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileEdit, UserProfileEditSectionAccount, UserProfileEditSectionPublicInfo, UserProfileEditSectionSettings, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderSkeleton, UserSkeleton, UserSocialAssociation, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetSkeleton, useStickyBox, Widget, X_SHARE };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MouseEvent, TouchEvent } from 'react';
|
|
2
|
+
import { PhotoProviderBase } from 'react-photo-view/dist/types';
|
|
3
|
+
import { DataType } from '../../types/lightbox';
|
|
4
|
+
/**
|
|
5
|
+
* Overrides/extends the styles applied to the component.
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
export interface BaseLightboxProps extends PhotoProviderBase {
|
|
9
|
+
className?: string;
|
|
10
|
+
images: DataType[];
|
|
11
|
+
index?: number;
|
|
12
|
+
onIndexChange?: (index: number) => void;
|
|
13
|
+
visible?: boolean;
|
|
14
|
+
onClose?: (evt?: MouseEvent | TouchEvent) => void;
|
|
15
|
+
afterClose?: () => void;
|
|
16
|
+
toolbarButtons?: JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
declare const BaseLightbox: (props: BaseLightboxProps) => JSX.Element;
|
|
19
|
+
export default BaseLightbox;
|