@selfcommunity/react-templates 0.5.0-alpha.0 → 0.5.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/lib/cjs/components/Category/Category.js +1 -2
  2. package/lib/cjs/components/Category/Skeleton.js +1 -2
  3. package/lib/cjs/components/CategoryFeed/CategoryFeed.js +15 -4
  4. package/lib/cjs/components/CategoryFeed/Skeleton.js +2 -2
  5. package/lib/cjs/components/Event/Event.js +1 -2
  6. package/lib/cjs/components/Event/Skeleton.js +1 -2
  7. package/lib/cjs/components/EventFeed/EventFeed.js +30 -16
  8. package/lib/cjs/components/EventFeed/Skeleton.js +2 -2
  9. package/lib/cjs/components/ExploreFeed/ExploreFeed.js +5 -4
  10. package/lib/cjs/components/ExploreFeed/Skeleton.js +2 -2
  11. package/lib/cjs/components/FeedObjectDetail/FeedObjectDetail.js +5 -4
  12. package/lib/cjs/components/FeedObjectDetail/Skeleton.js +1 -2
  13. package/lib/cjs/components/Group/Group.js +1 -2
  14. package/lib/cjs/components/Group/Skeleton.js +1 -2
  15. package/lib/cjs/components/GroupFeed/GroupFeed.js +22 -7
  16. package/lib/cjs/components/GroupFeed/Skeleton.js +2 -2
  17. package/lib/cjs/components/Lesson/Lesson.js +2 -3
  18. package/lib/cjs/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +2 -4
  19. package/lib/cjs/components/LoyaltyProgramDetail/PointsList.js +1 -2
  20. package/lib/cjs/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +1 -2
  21. package/lib/cjs/components/LoyaltyProgramDetail/Skeleton.js +1 -2
  22. package/lib/cjs/components/MainFeed/MainFeed.js +5 -4
  23. package/lib/cjs/components/MainFeed/Skeleton.js +2 -2
  24. package/lib/cjs/components/NotificationFeed/NotificationFeed.js +2 -2
  25. package/lib/cjs/components/NotificationFeed/Skeleton.js +2 -2
  26. package/lib/cjs/components/UserFeed/Skeleton.js +2 -2
  27. package/lib/cjs/components/UserFeed/UserFeed.js +5 -4
  28. package/lib/cjs/components/UserProfile/Skeleton.js +1 -2
  29. package/lib/cjs/components/UserProfile/UserProfile.js +6 -4
  30. package/lib/esm/components/Category/Category.js +1 -2
  31. package/lib/esm/components/Category/Skeleton.js +1 -2
  32. package/lib/esm/components/CategoryFeed/CategoryFeed.js +17 -6
  33. package/lib/esm/components/CategoryFeed/Skeleton.js +1 -1
  34. package/lib/esm/components/Event/Event.js +1 -2
  35. package/lib/esm/components/Event/Skeleton.js +1 -2
  36. package/lib/esm/components/EventFeed/EventFeed.js +30 -16
  37. package/lib/esm/components/EventFeed/Skeleton.js +1 -1
  38. package/lib/esm/components/ExploreFeed/ExploreFeed.js +4 -3
  39. package/lib/esm/components/ExploreFeed/Skeleton.js +1 -1
  40. package/lib/esm/components/FeedObjectDetail/FeedObjectDetail.js +5 -4
  41. package/lib/esm/components/FeedObjectDetail/Skeleton.js +1 -2
  42. package/lib/esm/components/Group/Group.js +1 -2
  43. package/lib/esm/components/Group/Skeleton.js +1 -2
  44. package/lib/esm/components/GroupFeed/GroupFeed.js +23 -8
  45. package/lib/esm/components/GroupFeed/Skeleton.js +1 -1
  46. package/lib/esm/components/Lesson/Lesson.js +1 -2
  47. package/lib/esm/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +1 -3
  48. package/lib/esm/components/LoyaltyProgramDetail/PointsList.js +1 -2
  49. package/lib/esm/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +1 -2
  50. package/lib/esm/components/LoyaltyProgramDetail/Skeleton.js +1 -2
  51. package/lib/esm/components/MainFeed/MainFeed.js +4 -3
  52. package/lib/esm/components/MainFeed/Skeleton.js +1 -1
  53. package/lib/esm/components/NotificationFeed/NotificationFeed.js +1 -1
  54. package/lib/esm/components/NotificationFeed/Skeleton.js +1 -1
  55. package/lib/esm/components/UserFeed/Skeleton.js +1 -1
  56. package/lib/esm/components/UserFeed/UserFeed.js +4 -3
  57. package/lib/esm/components/UserProfile/Skeleton.js +1 -2
  58. package/lib/esm/components/UserProfile/UserProfile.js +6 -4
  59. package/lib/umd/{c473ce30406a3dad83e1.eot → 30b299174b4fa1fb9ce8.eot} +0 -0
  60. package/lib/umd/{b6dbec3d5816ff8baef1.woff → 3b49304a98beb1239bc7.ttf} +0 -0
  61. package/lib/umd/589.js +2 -0
  62. package/lib/umd/738.js +1 -1
  63. package/lib/umd/73cbb3dbfaa3ddd4df47.js +2 -0
  64. package/lib/umd/73cbb3dbfaa3ddd4df47.js.LICENSE.txt +21 -0
  65. package/lib/umd/ab247f43e550f5f6d0f8.woff2 +0 -0
  66. package/lib/umd/{ba74e493633796d551d1.ttf → ce10db0c87e7112cb315.woff} +0 -0
  67. package/lib/umd/{6158171e38cbff3c3340.svg → fff8590360ed9eed64ae.svg} +75 -69
  68. package/lib/umd/react-templates.js +1 -1
  69. package/package.json +9 -6
  70. package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
  71. package/lib/umd/916.js +0 -2
  72. /package/lib/umd/{916.js.LICENSE.txt → 589.js.LICENSE.txt} +0 -0
@@ -1,12 +1,10 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useContext, useEffect, useMemo, useState } from 'react';
4
- import { styled } from '@mui/material/styles';
5
4
  import { http, Endpoints, UserService, LoyaltyService } from '@selfcommunity/api-services';
6
5
  import { SCUserContext } from '@selfcommunity/react-core';
7
- import { Box, Button, Card, CardActions, CardContent, CardMedia, Grid, Typography, useMediaQuery, useTheme } from '@mui/material';
6
+ import { Box, Button, Card, CardActions, CardContent, CardMedia, Grid, Typography, useMediaQuery, useTheme, styled, Chip } from '@mui/material';
8
7
  import { FormattedMessage } from 'react-intl';
9
- import Chip from '@mui/material/Chip';
10
8
  import classNames from 'classnames';
11
9
  import { useThemeProps } from '@mui/system';
12
10
  import Skeleton from './Skeleton';
@@ -1,9 +1,8 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useMemo } from 'react';
4
- import { styled } from '@mui/material/styles';
5
4
  import { SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
6
- import { Divider, Grid, Typography } from '@mui/material';
5
+ import { Divider, Grid, Typography, styled } from '@mui/material';
7
6
  import { FormattedMessage } from 'react-intl';
8
7
  import classNames from 'classnames';
9
8
  const PREFERENCES = [
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { styled } from '@mui/material/styles';
3
- import { Typography, CardContent, Skeleton, CardActions, CardMedia, Button } from '@mui/material';
2
+ import { Typography, CardContent, Skeleton, CardActions, CardMedia, Button, styled } from '@mui/material';
4
3
  import { Widget } from '@selfcommunity/react-ui';
5
4
  import { PREFIX } from './constants';
6
5
  const classes = {
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { styled } from '@mui/material/styles';
3
- import { Typography, Grid, Skeleton, Box, useTheme, useMediaQuery } from '@mui/material';
2
+ import { Typography, Grid, Skeleton, Box, useTheme, useMediaQuery, styled } from '@mui/material';
4
3
  import PrizeItemSkeleton from './PrizeItemSkeleton';
5
4
  import { PREFIX } from './constants';
6
5
  const classes = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext, useRef } from 'react';
3
- import { styled } from '@mui/material/styles';
3
+ import { styled } from '@mui/material';
4
4
  import { CategoriesSuggestionWidget, Feed, FeedObject, FeedObjectSkeleton, SCFeedObjectTemplateType, InlineComposerWidget, LoyaltyProgramWidget, UserSuggestionWidget, PlatformWidget, OnBoardingWidget } from '@selfcommunity/react-ui';
5
5
  import { Endpoints } from '@selfcommunity/api-services';
6
6
  import { SCUserContext, UserUtils } from '@selfcommunity/react-core';
@@ -91,7 +91,8 @@ export default function MainFeed(inProps) {
91
91
  }
92
92
  // HANDLERS
93
93
  const handleComposerSuccess = (feedObject) => {
94
- enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
94
+ const messageId = feedObject.scheduled_at ? 'ui.composer.scheduled.success' : 'ui.inlineComposerWidget.success';
95
+ enqueueSnackbar(_jsx(FormattedMessage, { id: messageId, defaultMessage: messageId }), {
95
96
  variant: 'success',
96
97
  autoHideDuration: 3000
97
98
  });
@@ -102,7 +103,7 @@ export default function MainFeed(inProps) {
102
103
  seen_by_id: [],
103
104
  has_boost: false
104
105
  };
105
- feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
106
+ !feedObject.draft && feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
106
107
  };
107
108
  const handleAddGenerationContent = (feedObjects) => {
108
109
  if (feedRef && feedRef.current) {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { styled } from '@mui/material/styles';
3
+ import { styled } from '@mui/material';
4
4
  import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
5
5
  import { PREFIX } from './constants';
6
6
  const classes = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useContext } from 'react';
3
- import { styled } from '@mui/material/styles';
3
+ import { styled } from '@mui/material';
4
4
  import { BroadcastMessages, CategoriesSuggestionWidget, Feed, SCFeedObjectTemplateType, FeedUpdatesWidget, LoyaltyProgramWidget, Notification, NotificationSkeleton, UserSuggestionWidget, PlatformWidget, getUnseenNotificationCounter } from '@selfcommunity/react-ui';
5
5
  import { Endpoints } from '@selfcommunity/api-services';
6
6
  import { SCUserContext } from '@selfcommunity/react-core';
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { styled } from '@mui/material/styles';
3
+ import { styled } from '@mui/material';
4
4
  import { FeedSkeleton, GenericSkeleton, NotificationSkeleton } from '@selfcommunity/react-ui';
5
5
  import { PREFIX } from './constants';
6
6
  const classes = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { styled } from '@mui/material/styles';
3
+ import { styled } from '@mui/material';
4
4
  import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
5
5
  import { PREFIX } from './constants';
6
6
  const classes = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo, useRef } from 'react';
3
- import { styled } from '@mui/material/styles';
3
+ import { styled } from '@mui/material';
4
4
  import { Endpoints } from '@selfcommunity/api-services';
5
5
  import { useSCFetchUser, useSCUser } from '@selfcommunity/react-core';
6
6
  import { Feed, FeedObject, FeedObjectSkeleton, InlineComposerWidget, SCFeedObjectTemplateType, UserFollowedCategoriesWidget, UserFollowedUsersWidget, UserFollowersWidget, UserLiveStreamWidget } from '@selfcommunity/react-ui';
@@ -89,7 +89,8 @@ export default function UserFeed(inProps) {
89
89
  const feedRef = useRef();
90
90
  // HANDLERS
91
91
  const handleComposerSuccess = (feedObject) => {
92
- enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
92
+ const messageId = feedObject.scheduled_at ? 'ui.composer.scheduled.success' : 'ui.inlineComposerWidget.success';
93
+ enqueueSnackbar(_jsx(FormattedMessage, { id: messageId, defaultMessage: messageId }), {
93
94
  variant: 'success',
94
95
  autoHideDuration: 3000
95
96
  });
@@ -100,7 +101,7 @@ export default function UserFeed(inProps) {
100
101
  seen_by_id: [],
101
102
  has_boost: false
102
103
  };
103
- feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
104
+ !feedObject.draft && feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
104
105
  };
105
106
  // WIDGETS
106
107
  const _widgets = useMemo(() => widgets.map((w) => {
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box } from '@mui/material';
3
- import { styled } from '@mui/material/styles';
2
+ import { Box, styled } from '@mui/material';
4
3
  import { UserProfileHeaderSkeleton } from '@selfcommunity/react-ui';
5
4
  import UserFeedSkeleton from '../UserFeed/Skeleton';
6
5
  import { PREFIX } from './constants';
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from 'react';
3
- import { styled } from '@mui/material/styles';
4
- import { Box, Button, Icon, Stack, Typography } from '@mui/material';
3
+ import { Box, Button, Icon, Stack, Typography, styled } from '@mui/material';
5
4
  import { ConnectionUserButton, LoyaltyProgramWidget, TagChip, UserActionIconButton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsWidget, UserConnectionsWidget, UserCounters, UserCreatedCoursesWidget, UserFollowedCategoriesWidget, UserFollowedUsersWidget, UserFollowersWidget, UserLiveStreamWidget, UserProfileBlocked, UserProfileHeader, UserSubscribedGroupsWidget } from '@selfcommunity/react-ui';
6
5
  import UserFeed from '../UserFeed';
7
6
  import { SCPreferences, SCRoutes, useSCFetchUser, useSCPreferences, useSCRouting, useSCUser, useSCFetchUserBlockedBy } from '@selfcommunity/react-core';
@@ -183,13 +182,16 @@ export default function UserProfile(inProps) {
183
182
  const isMe = useMemo(() => scUserContext.user && (scUser === null || scUser === void 0 ? void 0 : scUser.id) === scUserContext.user.id, [scUserContext.user, scUser]);
184
183
  const followEnabled = useMemo(() => SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED in scPreferencesContext.preferences &&
185
184
  scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED].value, [scPreferencesContext.preferences]);
186
- const privateMessagingEnabled = useMemo(() => features.includes(SCFeatureName.PRIVATE_MESSAGING), [features]);
185
+ const connectionEnabled = SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED in scPreferencesContext.preferences &&
186
+ scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED].value;
187
+ const privateMessagingEnabled = useMemo(() => SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED in scPreferencesContext.preferences &&
188
+ scPreferencesContext.preferences[SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED].value, [scPreferencesContext.preferences]);
187
189
  const _widgets = useMemo(() => {
188
190
  var _a, _b;
189
191
  if (widgets !== null) {
190
192
  return widgets;
191
193
  }
192
- if (!scUser) {
194
+ if (!scUser || (!followEnabled && !connectionEnabled)) {
193
195
  return [];
194
196
  }
195
197
  let _widgets = [];