@selfcommunity/react-templates 0.3.55 → 0.4.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.
Files changed (89) hide show
  1. package/lib/cjs/components/Category/Category.js +3 -5
  2. package/lib/cjs/components/Category/Skeleton.js +2 -4
  3. package/lib/cjs/components/CategoryFeed/CategoryFeed.js +7 -7
  4. package/lib/cjs/components/CategoryFeed/Skeleton.js +2 -5
  5. package/lib/cjs/components/Event/Event.d.ts +77 -0
  6. package/lib/cjs/components/Event/Event.js +62 -0
  7. package/lib/cjs/components/Event/Skeleton.d.ts +21 -0
  8. package/lib/cjs/components/Event/Skeleton.js +40 -0
  9. package/lib/cjs/components/Event/constants.d.ts +1 -0
  10. package/lib/cjs/components/Event/constants.js +4 -0
  11. package/lib/cjs/components/Event/index.d.ts +4 -0
  12. package/lib/cjs/components/Event/index.js +8 -0
  13. package/lib/cjs/components/EventFeed/EventFeed.d.ts +69 -0
  14. package/lib/cjs/components/EventFeed/EventFeed.js +146 -0
  15. package/lib/cjs/components/EventFeed/Skeleton.d.ts +21 -0
  16. package/lib/cjs/components/EventFeed/Skeleton.js +39 -0
  17. package/lib/cjs/components/EventFeed/constants.d.ts +1 -0
  18. package/lib/cjs/components/EventFeed/constants.js +4 -0
  19. package/lib/cjs/components/EventFeed/index.d.ts +4 -0
  20. package/lib/cjs/components/EventFeed/index.js +8 -0
  21. package/lib/cjs/components/ExploreFeed/ExploreFeed.js +23 -4
  22. package/lib/cjs/components/ExploreFeed/Skeleton.js +2 -5
  23. package/lib/cjs/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
  24. package/lib/cjs/components/FeedObjectDetail/Skeleton.js +2 -9
  25. package/lib/cjs/components/Group/Group.js +3 -5
  26. package/lib/cjs/components/Group/Skeleton.js +2 -4
  27. package/lib/cjs/components/GroupFeed/GroupFeed.js +8 -8
  28. package/lib/cjs/components/GroupFeed/Skeleton.js +2 -5
  29. package/lib/cjs/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
  30. package/lib/cjs/components/LoyaltyProgramDetail/PointsList.js +4 -17
  31. package/lib/cjs/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -14
  32. package/lib/cjs/components/LoyaltyProgramDetail/Skeleton.js +2 -16
  33. package/lib/cjs/components/MainFeed/MainFeed.js +21 -4
  34. package/lib/cjs/components/MainFeed/Skeleton.js +2 -5
  35. package/lib/cjs/components/NotificationFeed/NotificationFeed.js +3 -2
  36. package/lib/cjs/components/NotificationFeed/Skeleton.js +2 -3
  37. package/lib/cjs/components/UserFeed/Skeleton.js +2 -5
  38. package/lib/cjs/components/UserFeed/UserFeed.js +6 -5
  39. package/lib/cjs/components/UserProfile/Skeleton.js +2 -4
  40. package/lib/cjs/components/UserProfile/UserProfile.js +13 -30
  41. package/lib/cjs/index.d.ts +4 -2
  42. package/lib/cjs/index.js +10 -4
  43. package/lib/esm/components/Category/Category.js +3 -5
  44. package/lib/esm/components/Category/Skeleton.js +2 -4
  45. package/lib/esm/components/CategoryFeed/CategoryFeed.js +7 -7
  46. package/lib/esm/components/CategoryFeed/Skeleton.js +2 -5
  47. package/lib/esm/components/Event/Event.d.ts +77 -0
  48. package/lib/esm/components/Event/Event.js +58 -0
  49. package/lib/esm/components/Event/Skeleton.d.ts +21 -0
  50. package/lib/esm/components/Event/Skeleton.js +36 -0
  51. package/lib/esm/components/Event/constants.d.ts +1 -0
  52. package/lib/esm/components/Event/constants.js +1 -0
  53. package/lib/esm/components/Event/index.d.ts +4 -0
  54. package/lib/esm/components/Event/index.js +4 -0
  55. package/lib/esm/components/EventFeed/EventFeed.d.ts +69 -0
  56. package/lib/esm/components/EventFeed/EventFeed.js +142 -0
  57. package/lib/esm/components/EventFeed/Skeleton.d.ts +21 -0
  58. package/lib/esm/components/EventFeed/Skeleton.js +35 -0
  59. package/lib/esm/components/EventFeed/constants.d.ts +1 -0
  60. package/lib/esm/components/EventFeed/constants.js +1 -0
  61. package/lib/esm/components/EventFeed/index.d.ts +4 -0
  62. package/lib/esm/components/EventFeed/index.js +4 -0
  63. package/lib/esm/components/ExploreFeed/ExploreFeed.js +24 -5
  64. package/lib/esm/components/ExploreFeed/Skeleton.js +2 -5
  65. package/lib/esm/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
  66. package/lib/esm/components/FeedObjectDetail/Skeleton.js +2 -8
  67. package/lib/esm/components/Group/Group.js +3 -5
  68. package/lib/esm/components/Group/Skeleton.js +2 -4
  69. package/lib/esm/components/GroupFeed/GroupFeed.js +8 -8
  70. package/lib/esm/components/GroupFeed/Skeleton.js +2 -5
  71. package/lib/esm/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
  72. package/lib/esm/components/LoyaltyProgramDetail/PointsList.js +4 -17
  73. package/lib/esm/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -13
  74. package/lib/esm/components/LoyaltyProgramDetail/Skeleton.js +2 -16
  75. package/lib/esm/components/MainFeed/MainFeed.js +23 -6
  76. package/lib/esm/components/MainFeed/Skeleton.js +2 -5
  77. package/lib/esm/components/NotificationFeed/NotificationFeed.js +3 -2
  78. package/lib/esm/components/NotificationFeed/Skeleton.js +2 -3
  79. package/lib/esm/components/UserFeed/Skeleton.js +2 -5
  80. package/lib/esm/components/UserFeed/UserFeed.js +6 -5
  81. package/lib/esm/components/UserProfile/Skeleton.js +2 -4
  82. package/lib/esm/components/UserProfile/UserProfile.js +13 -30
  83. package/lib/esm/index.d.ts +4 -2
  84. package/lib/esm/index.js +4 -2
  85. package/lib/umd/341.js +2 -0
  86. package/lib/umd/{138.js.LICENSE.txt → 341.js.LICENSE.txt} +15 -0
  87. package/lib/umd/react-templates.js +1 -1
  88. package/package.json +6 -6
  89. package/lib/umd/138.js +0 -2
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { styled } from '@mui/material/styles';
3
3
  import { Typography, Grid, Skeleton, Box, useTheme, useMediaQuery } from '@mui/material';
4
4
  import PrizeItemSkeleton from './PrizeItemSkeleton';
@@ -43,19 +43,5 @@ const Root = styled(Box, {
43
43
  export default function LoyaltyProgramDetailSkeleton() {
44
44
  const theme = useTheme();
45
45
  const isMobile = useMediaQuery(theme.breakpoints.down('md'));
46
- return (React.createElement(Root, { className: classes.root },
47
- React.createElement(Typography, { className: classes.title, component: 'div' },
48
- !isMobile && React.createElement(Skeleton, { animation: "wave", height: 30, width: 140, variant: "text" }),
49
- React.createElement(Skeleton, { animation: "wave", variant: "circular", width: 172, height: 30, className: classes.chip })),
50
- React.createElement(Typography, { className: classes.sectionTitle },
51
- React.createElement(Skeleton, { animation: "wave", height: 20, width: '50%', variant: "text" }),
52
- React.createElement(Skeleton, { animation: "wave", height: 17, width: '80%', variant: "text", className: classes.subTitle })),
53
- React.createElement(Typography, { className: classes.sectionTitle },
54
- React.createElement(Skeleton, { animation: "wave", height: 20, width: 146 })),
55
- React.createElement(Grid, { container: true, spacing: 2, className: classes.pointsList }, [...Array(8)].map((prize, index) => (React.createElement(Grid, { item: true, xs: 12, sm: 12, md: 6, key: index },
56
- React.createElement(Skeleton, { animation: "wave", height: 15, width: "100%" }))))),
57
- React.createElement(Typography, { className: classes.sectionTitle },
58
- React.createElement(Skeleton, { animation: "wave", height: 20, width: 140, variant: "text" })),
59
- React.createElement(Grid, { container: true, spacing: isMobile ? 3 : 6 }, [...Array(6)].map((prize, index) => (React.createElement(Grid, { item: true, xs: 12, sm: 12, md: 6, lg: 4, key: index },
60
- React.createElement(PrizeItemSkeleton, null)))))));
46
+ return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsxs(Typography, Object.assign({ className: classes.title, component: 'div' }, { children: [!isMobile && _jsx(Skeleton, { animation: "wave", height: 30, width: 140, variant: "text" }), _jsx(Skeleton, { animation: "wave", variant: "circular", width: 172, height: 30, className: classes.chip })] })), _jsxs(Typography, Object.assign({ className: classes.sectionTitle }, { children: [_jsx(Skeleton, { animation: "wave", height: 20, width: '50%', variant: "text" }), _jsx(Skeleton, { animation: "wave", height: 17, width: '80%', variant: "text", className: classes.subTitle })] })), _jsx(Typography, Object.assign({ className: classes.sectionTitle }, { children: _jsx(Skeleton, { animation: "wave", height: 20, width: 146 }) })), _jsx(Grid, Object.assign({ container: true, spacing: 2, className: classes.pointsList }, { children: [...Array(8)].map((prize, index) => (_jsx(Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6 }, { children: _jsx(Skeleton, { animation: "wave", height: 15, width: "100%" }) }), index))) })), _jsx(Typography, Object.assign({ className: classes.sectionTitle }, { children: _jsx(Skeleton, { animation: "wave", height: 20, width: 140, variant: "text" }) })), _jsx(Grid, Object.assign({ container: true, spacing: isMobile ? 3 : 6 }, { children: [...Array(6)].map((prize, index) => (_jsx(Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 4 }, { children: _jsx(PrizeItemSkeleton, {}) }), index))) }))] })));
61
47
  }
@@ -1,8 +1,9 @@
1
- import React, { useContext, useRef } from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useContext, useRef } from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
- import { CategoriesSuggestionWidget, Feed, FeedObject, FeedObjectSkeleton, SCFeedObjectTemplateType, InlineComposerWidget, LoyaltyProgramWidget, UserSuggestionWidget, PlatformWidget } from '@selfcommunity/react-ui';
4
+ import { CategoriesSuggestionWidget, Feed, FeedObject, FeedObjectSkeleton, SCFeedObjectTemplateType, InlineComposerWidget, LoyaltyProgramWidget, UserSuggestionWidget, PlatformWidget, OnBoardingWidget } from '@selfcommunity/react-ui';
4
5
  import { Endpoints } from '@selfcommunity/api-services';
5
- import { SCUserContext } from '@selfcommunity/react-core';
6
+ import { SCUserContext, UserUtils } from '@selfcommunity/react-core';
6
7
  import { useThemeProps } from '@mui/system';
7
8
  import classNames from 'classnames';
8
9
  import { SCCustomAdvPosition } from '@selfcommunity/types';
@@ -90,7 +91,7 @@ export default function MainFeed(inProps) {
90
91
  }
91
92
  // HANDLERS
92
93
  const handleComposerSuccess = (feedObject) => {
93
- enqueueSnackbar(React.createElement(FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
94
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
94
95
  variant: 'success',
95
96
  autoHideDuration: 3000
96
97
  });
@@ -103,14 +104,30 @@ export default function MainFeed(inProps) {
103
104
  };
104
105
  feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
105
106
  };
106
- return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className), ref: feedRef, endpoint: Endpoints.MainFeed, widgets: widgets, ItemComponent: FeedObject, itemPropsGenerator: (scUser, item) => ({
107
+ const handleAddGenerationContent = (feedObjects) => {
108
+ if (feedRef && feedRef.current) {
109
+ const currentFeedObjectIds = feedRef.current.getCurrentFeedObjectIds();
110
+ feedObjects.forEach((feedObject) => {
111
+ if (!currentFeedObjectIds.includes(feedObject.id)) {
112
+ const feedUnit = {
113
+ type: feedObject.type,
114
+ [feedObject.type]: feedObject,
115
+ seen_by_id: [],
116
+ has_boost: false
117
+ };
118
+ feedRef.current.addFeedData(feedUnit, true);
119
+ }
120
+ });
121
+ }
122
+ };
123
+ return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className), ref: feedRef, endpoint: Endpoints.MainFeed, widgets: widgets, ItemComponent: FeedObject, itemPropsGenerator: (scUser, item) => ({
107
124
  feedObject: item[item.type],
108
125
  feedObjectType: item.type,
109
126
  feedObjectActivities: item.activities ? item.activities : null,
110
127
  markRead: scUser ? !item.seen_by_id.includes(scUser.id) : null
111
128
  }), itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: FeedObjectSkeleton, ItemSkeletonProps: {
112
129
  template: SCFeedObjectTemplateType.PREVIEW
113
- }, FeedSidebarProps: FeedSidebarProps, HeaderComponent: React.createElement(InlineComposerWidget, { onSuccess: handleComposerSuccess }), requireAuthentication: true, disablePaginationLinks: true, enabledCustomAdvPositions: [
130
+ }, FeedSidebarProps: FeedSidebarProps, HeaderComponent: _jsxs(_Fragment, { children: [_jsx(InlineComposerWidget, { onSuccess: handleComposerSuccess }), UserUtils.isAdmin(scUserContext.user) && _jsx(OnBoardingWidget, { onGeneratedContent: handleAddGenerationContent })] }), requireAuthentication: true, disablePaginationLinks: true, enabledCustomAdvPositions: [
114
131
  SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
115
132
  SCCustomAdvPosition.POSITION_FEED,
116
133
  SCCustomAdvPosition.POSITION_BELOW_TOPBAR
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
4
  import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
@@ -30,9 +31,5 @@ const Root = styled(FeedSkeleton, {
30
31
  *
31
32
  */
32
33
  export default function MainFeedSkeleton() {
33
- return (React.createElement(Root, { className: classes.root, sidebar: React.createElement(React.Fragment, null,
34
- React.createElement(GenericSkeleton, { sx: { mb: 2 } }),
35
- React.createElement(GenericSkeleton, { sx: { mb: 2 } })) },
36
- React.createElement(InlineComposerWidgetSkeleton, null),
37
- Array.from({ length: 5 }).map((e, i) => (React.createElement(FeedObjectSkeleton, { key: i, template: SCFeedObjectTemplateType.DETAIL })))));
34
+ return (_jsxs(Root, Object.assign({ className: classes.root, sidebar: _jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: [_jsx(InlineComposerWidgetSkeleton, {}), Array.from({ length: 5 }).map((e, i) => (_jsx(FeedObjectSkeleton, { template: SCFeedObjectTemplateType.DETAIL }, i)))] })));
38
35
  }
@@ -1,4 +1,5 @@
1
- import React, { useContext } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
4
  import { BroadcastMessages, CategoriesSuggestionWidget, Feed, SCFeedObjectTemplateType, FeedUpdatesWidget, LoyaltyProgramWidget, Notification, NotificationSkeleton, UserSuggestionWidget, PlatformWidget, getUnseenNotificationCounter } from '@selfcommunity/react-ui';
4
5
  import { Endpoints } from '@selfcommunity/api-services';
@@ -113,7 +114,7 @@ export default function NotificationFeed(inProps) {
113
114
  void scUserContext.refreshCounters();
114
115
  }
115
116
  };
116
- return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className), endpoint: Endpoints.UserNotificationList, widgets: widgets, ItemComponent: Notification, itemPropsGenerator: (scUser, item) => ({
117
+ return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className), endpoint: Endpoints.UserNotificationList, widgets: widgets, ItemComponent: Notification, itemPropsGenerator: (scUser, item) => ({
117
118
  notificationObject: item
118
119
  }), itemIdGenerator: (item) => item.sid, ItemProps: NotificationProps, ItemSkeleton: NotificationSkeleton, ItemSkeletonProps: {
119
120
  template: SCFeedObjectTemplateType.PREVIEW
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
4
  import { FeedSkeleton, GenericSkeleton, NotificationSkeleton } from '@selfcommunity/react-ui';
@@ -30,7 +31,5 @@ const Root = styled(FeedSkeleton, {
30
31
  *
31
32
  */
32
33
  export default function NotificationFeedSkeleton() {
33
- return (React.createElement(Root, { className: classes.root, sidebar: React.createElement(React.Fragment, null,
34
- React.createElement(GenericSkeleton, { sx: { mb: 2 } }),
35
- React.createElement(GenericSkeleton, { sx: { mb: 2 } })) }, Array.from({ length: 5 }).map((e, i) => (React.createElement(NotificationSkeleton, { key: i })))));
34
+ return (_jsx(Root, Object.assign({ className: classes.root, sidebar: _jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: Array.from({ length: 5 }).map((e, i) => (_jsx(NotificationSkeleton, {}, i))) })));
36
35
  }
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
4
  import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
@@ -30,9 +31,5 @@ const Root = styled(FeedSkeleton, {
30
31
  *
31
32
  */
32
33
  export default function UserFeedSkeleton() {
33
- return (React.createElement(Root, { className: classes.root, sidebar: React.createElement(React.Fragment, null,
34
- React.createElement(GenericSkeleton, { sx: { mb: 2 } }),
35
- React.createElement(GenericSkeleton, { sx: { mb: 2 } })) },
36
- React.createElement(InlineComposerWidgetSkeleton, null),
37
- Array.from({ length: 5 }).map((e, i) => (React.createElement(FeedObjectSkeleton, { key: i, template: SCFeedObjectTemplateType.DETAIL })))));
34
+ return (_jsxs(Root, Object.assign({ className: classes.root, sidebar: _jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: [_jsx(InlineComposerWidgetSkeleton, {}), Array.from({ length: 5 }).map((e, i) => (_jsx(FeedObjectSkeleton, { template: SCFeedObjectTemplateType.DETAIL }, i)))] })));
38
35
  }
@@ -1,4 +1,5 @@
1
- import React, { useMemo, useRef } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo, useRef } from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
4
  import { Endpoints } from '@selfcommunity/api-services';
4
5
  import { useSCFetchUser, useSCUser } from '@selfcommunity/react-core';
@@ -81,7 +82,7 @@ export default function UserFeed(inProps) {
81
82
  const feedRef = useRef();
82
83
  // HANDLERS
83
84
  const handleComposerSuccess = (feedObject) => {
84
- enqueueSnackbar(React.createElement(FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
85
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
85
86
  variant: 'success',
86
87
  autoHideDuration: 3000
87
88
  });
@@ -99,13 +100,13 @@ export default function UserFeed(inProps) {
99
100
  return Object.assign(Object.assign({}, w), { componentProps: Object.assign(Object.assign({}, w.componentProps), { userId: scUser ? scUser.id : userId }) });
100
101
  }), [scUser, widgets]);
101
102
  if (scUser === null) {
102
- return React.createElement(UserFeedSkeleton, null);
103
+ return _jsx(UserFeedSkeleton, {});
103
104
  }
104
- return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className), ref: feedRef, endpoint: Object.assign(Object.assign({}, Endpoints.UserFeed), { url: () => Endpoints.UserFeed.url({ id: scUser.id }) }), widgets: _widgets, ItemComponent: FeedObject, itemPropsGenerator: (scUser, item) => ({
105
+ return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className), ref: feedRef, endpoint: Object.assign(Object.assign({}, Endpoints.UserFeed), { url: () => Endpoints.UserFeed.url({ id: scUser.id }) }), widgets: _widgets, ItemComponent: FeedObject, itemPropsGenerator: (scUser, item) => ({
105
106
  feedObject: item[item.type],
106
107
  feedObjectType: item.type,
107
108
  feedObjectActivities: item.activities ? item.activities : null
108
109
  }), itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: FeedObjectSkeleton, ItemSkeletonProps: {
109
110
  template: SCFeedObjectTemplateType.PREVIEW
110
- } }, (scUserContext.user ? { HeaderComponent: React.createElement(InlineComposerWidget, { onSuccess: handleComposerSuccess }) } : {}), { FeedSidebarProps: FeedSidebarProps }, FeedProps)));
111
+ } }, (scUserContext.user ? { HeaderComponent: _jsx(InlineComposerWidget, { onSuccess: handleComposerSuccess }) } : {}), { FeedSidebarProps: FeedSidebarProps }, FeedProps)));
111
112
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box } from '@mui/material';
3
3
  import { styled } from '@mui/material/styles';
4
4
  import { UserProfileHeaderSkeleton } from '@selfcommunity/react-ui';
@@ -32,7 +32,5 @@ const Root = styled(Box, {
32
32
  *
33
33
  */
34
34
  export default function UserProfileSkeleton() {
35
- return (React.createElement(Root, { className: classes.root },
36
- React.createElement(UserProfileHeaderSkeleton, null),
37
- React.createElement(UserFeedSkeleton, null)));
35
+ return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(UserProfileHeaderSkeleton, {}), _jsx(UserFeedSkeleton, {})] })));
38
36
  }
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
4
  import { Box, Button, Icon, Stack, Typography } from '@mui/material';
4
5
  import { ConnectionUserButton, LoyaltyProgramWidget, TagChip, UserActionIconButton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsWidget, UserConnectionsWidget, UserCounters, UserFollowedCategoriesWidget, UserFollowedUsersWidget, UserFollowersWidget, UserProfileBlocked, UserProfileHeader, UserSubscribedGroupsWidget, } from '@selfcommunity/react-ui';
@@ -202,7 +203,7 @@ export default function UserProfile(inProps) {
202
203
  }
203
204
  }, [isConnection, scUserContext.managers.followers, scUserContext.managers.connections, followEnabled, isMe, user, scUserContext.user]);
204
205
  if (!scUser) {
205
- return React.createElement(UserProfileSkeleton, null);
206
+ return _jsx(UserProfileSkeleton, {});
206
207
  }
207
208
  // HANDLERS
208
209
  const handleEdit = () => {
@@ -216,36 +217,18 @@ export default function UserProfile(inProps) {
216
217
  if (privateMessagingEnabled && !isMe && user && user.can_send_pm_to) {
217
218
  actionItems = [
218
219
  {
219
- label: React.createElement(FormattedMessage, { defaultMessage: "templates.userProfile.send.pm", id: "templates.userProfile.send.pm" }),
220
+ label: _jsx(FormattedMessage, { defaultMessage: "templates.userProfile.send.pm", id: "templates.userProfile.send.pm" }),
220
221
  to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, scUser)
221
222
  }
222
223
  ];
223
224
  }
224
- return (React.createElement(Root, { id: id, className: classNames(classes.root, className) },
225
- React.createElement(UserProfileHeader, Object.assign({ user: scUser }, UserProfileHeaderProps, { actions: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? null : (React.createElement(Stack, { key: `actions_${scUser.id}`, direction: "row", spacing: 2, className: classes.actions },
226
- startActions,
227
- isMe ? editStartActions : viewStartActions,
228
- isMe ? (React.createElement(Button, { variant: "contained", color: "secondary", onClick: handleEdit },
229
- React.createElement(FormattedMessage, { defaultMessage: "templates.userProfile.edit", id: "templates.userProfile.edit" }))) : (React.createElement(ConnectionUserButton, { user: scUser })),
230
- isMe ? editEndActions : viewEndActions,
231
- endActions,
232
- React.createElement(UserActionIconButton, { user: scUser, items: actionItems }))) })),
233
- scUserContext.user === undefined ||
234
- (scUserContext.user && ((loadingBlockedBy && blockedBy === null) || scUserContext.managers.blockedUsers.isLoading())) ? (React.createElement(UserFeedSkeleton, null)) : (React.createElement(React.Fragment, null, loadingBlockedBy || (scUserContext.user && scUserContext.managers.blockedUsers.loading) ? null : (React.createElement(React.Fragment, null, !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? (React.createElement(UserProfileBlocked, { user: scUser, blockedByUser: blockedBy })) : (React.createElement(React.Fragment, null,
235
- React.createElement(UserCounters, { className: classes.counters, userId: userId, user: scUser }),
236
- scUser.date_joined && (React.createElement(Typography, { className: classes.info },
237
- React.createElement(FormattedMessage, { id: "templates.userProfile.dateJoined", defaultMessage: "templates.userProfile.dateJoined", values: {
238
- date: intl.formatDate(scUser.date_joined, {
239
- year: 'numeric',
240
- month: 'long'
241
- })
242
- } }))),
243
- scUser.location && (React.createElement(Typography, { className: classes.info },
244
- React.createElement(Icon, null, "add_location_alt"),
245
- " ",
246
- scUser.location)),
247
- taggingEnabled && (React.createElement(Stack, { key: `tags_${scUser.id}`, direction: "row", spacing: 2, className: classes.tags }, scUser.tags
248
- .filter((t) => t.visible)
249
- .map((tag) => (React.createElement(TagChip, { key: tag.id, tag: tag, clickable: false, disposable: false }))))),
250
- React.createElement(UserFeed, Object.assign({ key: `feed_${scUser.id}`, className: classes.feed, user: scUser, widgets: _widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, UserFeedProps))))))))));
225
+ return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(UserProfileHeader, Object.assign({ user: scUser }, UserProfileHeaderProps, { actions: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? null : (_jsxs(Stack, Object.assign({ direction: "row", spacing: 2, className: classes.actions }, { children: [startActions, isMe ? editStartActions : viewStartActions, isMe ? (_jsx(Button, Object.assign({ variant: "contained", color: "secondary", onClick: handleEdit }, { children: _jsx(FormattedMessage, { defaultMessage: "templates.userProfile.edit", id: "templates.userProfile.edit" }) }))) : (_jsx(ConnectionUserButton, { user: scUser })), isMe ? editEndActions : viewEndActions, endActions, _jsx(UserActionIconButton, { user: scUser, items: actionItems })] }), `actions_${scUser.id}`)) })), scUserContext.user === undefined ||
226
+ (scUserContext.user && ((loadingBlockedBy && blockedBy === null) || scUserContext.managers.blockedUsers.isLoading())) ? (_jsx(UserFeedSkeleton, {})) : (_jsx(_Fragment, { children: loadingBlockedBy || (scUserContext.user && scUserContext.managers.blockedUsers.loading) ? null : (_jsx(_Fragment, { children: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? (_jsx(UserProfileBlocked, { user: scUser, blockedByUser: blockedBy })) : (_jsxs(_Fragment, { children: [_jsx(UserCounters, { className: classes.counters, userId: userId, user: scUser }), scUser.date_joined && (_jsx(Typography, Object.assign({ className: classes.info }, { children: _jsx(FormattedMessage, { id: "templates.userProfile.dateJoined", defaultMessage: "templates.userProfile.dateJoined", values: {
227
+ date: intl.formatDate(scUser.date_joined, {
228
+ year: 'numeric',
229
+ month: 'long'
230
+ })
231
+ } }) }))), scUser.location && (_jsxs(Typography, Object.assign({ className: classes.info }, { children: [_jsx(Icon, { children: "add_location_alt" }), " ", scUser.location] }))), taggingEnabled && (_jsx(Stack, Object.assign({ direction: "row", spacing: 2, className: classes.tags }, { children: scUser.tags
232
+ .filter((t) => t.visible)
233
+ .map((tag) => (_jsx(TagChip, { tag: tag, clickable: false, disposable: false }, tag.id))) }), `tags_${scUser.id}`)), _jsx(UserFeed, Object.assign({ className: classes.feed, user: scUser, widgets: _widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, UserFeedProps), `feed_${scUser.id}`)] })) })) }))] })));
251
234
  }
@@ -7,6 +7,8 @@ import NotificationFeed, { NotificationFeedProps, NotificationFeedSkeleton } fro
7
7
  import UserFeed, { UserFeedProps, UserFeedSkeleton } from './components/UserFeed';
8
8
  import UserProfile, { UserProfileProps, UserProfileSkeleton } from './components/UserProfile';
9
9
  import LoyaltyProgramDetail, { LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton } from './components/LoyaltyProgramDetail';
10
- import GroupFeed, { GroupFeedProps, GroupFeedSkeleton } from './components/GroupFeed';
11
10
  import Group, { GroupProps, GroupSkeleton } from './components/Group';
12
- export { Category, CategoryProps, CategorySkeleton, CategoryFeed, CategoryFeedProps, CategoryFeedSkeleton, ExploreFeed, ExploreFeedProps, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailProps, FeedObjectDetailSkeleton, MainFeed, MainFeedProps, MainFeedSkeleton, NotificationFeed, NotificationFeedProps, NotificationFeedSkeleton, UserFeed, UserFeedProps, UserFeedSkeleton, UserProfile, UserProfileProps, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedProps, GroupFeedSkeleton, Group, GroupProps, GroupSkeleton };
11
+ import GroupFeed, { GroupFeedProps, GroupFeedSkeleton } from './components/GroupFeed';
12
+ import Event, { EventProps, EventSkeleton } from './components/Event';
13
+ import EventFeed, { EventFeedProps, EventFeedSkeleton } from './components/EventFeed';
14
+ export { Category, CategoryProps, CategorySkeleton, CategoryFeed, CategoryFeedProps, CategoryFeedSkeleton, ExploreFeed, ExploreFeedProps, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailProps, FeedObjectDetailSkeleton, MainFeed, MainFeedProps, MainFeedSkeleton, NotificationFeed, NotificationFeedProps, NotificationFeedSkeleton, UserFeed, UserFeedProps, UserFeedSkeleton, UserProfile, UserProfileProps, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedProps, GroupFeedSkeleton, Group, GroupProps, GroupSkeleton, Event, EventProps, EventSkeleton, EventFeed, EventFeedProps, EventFeedSkeleton };
package/lib/esm/index.js CHANGED
@@ -7,6 +7,8 @@ import NotificationFeed, { NotificationFeedSkeleton } from './components/Notific
7
7
  import UserFeed, { UserFeedSkeleton } from './components/UserFeed';
8
8
  import UserProfile, { UserProfileSkeleton } from './components/UserProfile';
9
9
  import LoyaltyProgramDetail, { LoyaltyProgramDetailSkeleton } from './components/LoyaltyProgramDetail';
10
- import GroupFeed, { GroupFeedSkeleton } from './components/GroupFeed';
11
10
  import Group, { GroupSkeleton } from './components/Group';
12
- export { Category, CategorySkeleton, CategoryFeed, CategoryFeedSkeleton, ExploreFeed, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailSkeleton, MainFeed, MainFeedSkeleton, NotificationFeed, NotificationFeedSkeleton, UserFeed, UserFeedSkeleton, UserProfile, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedSkeleton, Group, GroupSkeleton };
11
+ import GroupFeed, { GroupFeedSkeleton } from './components/GroupFeed';
12
+ import Event, { EventSkeleton } from './components/Event';
13
+ import EventFeed, { EventFeedSkeleton } from './components/EventFeed';
14
+ export { Category, CategorySkeleton, CategoryFeed, CategoryFeedSkeleton, ExploreFeed, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailSkeleton, MainFeed, MainFeedSkeleton, NotificationFeed, NotificationFeedSkeleton, UserFeed, UserFeedSkeleton, UserProfile, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedSkeleton, Group, GroupSkeleton, Event, EventSkeleton, EventFeed, EventFeedSkeleton };