@selfcommunity/react-core 0.7.0-alpha.1 → 0.7.0-alpha.11
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/provider/SCThemeProvider/index.js +3 -3
- package/lib/cjs/constants/Cache.d.ts +12 -0
- package/lib/cjs/constants/Cache.js +17 -1
- package/lib/cjs/constants/Preferences.d.ts +16 -0
- package/lib/cjs/constants/Preferences.js +31 -2
- package/lib/cjs/constants/Routes.d.ts +6 -0
- package/lib/cjs/constants/Routes.js +14 -1
- package/lib/cjs/hooks/useSCFetchCategory.d.ts +1 -0
- package/lib/cjs/hooks/useSCFetchCategory.js +18 -1
- package/lib/cjs/hooks/useSCFetchCourse.js +15 -15
- package/lib/cjs/hooks/useSCFetchEvent.d.ts +1 -0
- package/lib/cjs/hooks/useSCFetchEvent.js +16 -1
- package/lib/cjs/hooks/useSCFetchGroup.d.ts +1 -0
- package/lib/cjs/hooks/useSCFetchGroup.js +16 -1
- package/lib/cjs/hooks/useSCFetchPaymentOrder.d.ts +20 -0
- package/lib/cjs/hooks/useSCFetchPaymentOrder.js +70 -0
- package/lib/cjs/hooks/useSCFetchPaymentProduct.d.ts +20 -0
- package/lib/cjs/hooks/useSCFetchPaymentProduct.js +70 -0
- package/lib/cjs/hooks/useSCFetchUsers.d.ts +20 -0
- package/lib/cjs/hooks/useSCFetchUsers.js +50 -0
- package/lib/cjs/hooks/useSCJoinedCoursesManager.d.ts +1 -1
- package/lib/cjs/hooks/useSCJoinedCoursesManager.js +36 -67
- package/lib/cjs/hooks/useSCPaymentsEnabled.d.ts +18 -0
- package/lib/cjs/hooks/useSCPaymentsEnabled.js +35 -0
- package/lib/cjs/hooks/useSCPreferenceEnabled.d.ts +6 -0
- package/lib/cjs/hooks/useSCPreferenceEnabled.js +16 -0
- package/lib/cjs/hooks/useSCSubscribedEventsManager.js +4 -14
- package/lib/cjs/hooks/useSCSubscribedGroupsManager.d.ts +1 -1
- package/lib/cjs/hooks/useSCSubscribedGroupsManager.js +29 -54
- package/lib/cjs/hooks/useSCWebPushMessaging.js +2 -2
- package/lib/cjs/index.d.ts +7 -2
- package/lib/cjs/index.js +13 -2
- package/lib/cjs/themes/theme.js +14 -2
- package/lib/cjs/types/theme.d.ts +53 -1
- package/lib/cjs/utils/hooks/index.d.ts +2 -1
- package/lib/cjs/utils/hooks/index.js +3 -1
- package/lib/cjs/utils/hooks/useResizeObserver.d.ts +1 -0
- package/lib/cjs/utils/hooks/useResizeObserver.js +16 -0
- package/lib/cjs/utils/user.d.ts +8 -1
- package/lib/cjs/utils/user.js +15 -2
- package/lib/esm/components/provider/SCThemeProvider/index.js +1 -1
- package/lib/esm/constants/Cache.d.ts +12 -0
- package/lib/esm/constants/Cache.js +12 -0
- package/lib/esm/constants/Preferences.d.ts +16 -0
- package/lib/esm/constants/Preferences.js +28 -0
- package/lib/esm/constants/Routes.d.ts +6 -0
- package/lib/esm/constants/Routes.js +12 -0
- package/lib/esm/hooks/useSCFetchCategory.d.ts +1 -0
- package/lib/esm/hooks/useSCFetchCategory.js +18 -1
- package/lib/esm/hooks/useSCFetchCourse.js +15 -15
- package/lib/esm/hooks/useSCFetchEvent.d.ts +1 -0
- package/lib/esm/hooks/useSCFetchEvent.js +16 -1
- package/lib/esm/hooks/useSCFetchGroup.d.ts +1 -0
- package/lib/esm/hooks/useSCFetchGroup.js +16 -1
- package/lib/esm/hooks/useSCFetchPaymentOrder.d.ts +20 -0
- package/lib/esm/hooks/useSCFetchPaymentOrder.js +67 -0
- package/lib/esm/hooks/useSCFetchPaymentProduct.d.ts +20 -0
- package/lib/esm/hooks/useSCFetchPaymentProduct.js +67 -0
- package/lib/esm/hooks/useSCFetchUsers.d.ts +20 -0
- package/lib/esm/hooks/useSCFetchUsers.js +48 -0
- package/lib/esm/hooks/useSCJoinedCoursesManager.d.ts +1 -1
- package/lib/esm/hooks/useSCJoinedCoursesManager.js +37 -67
- package/lib/esm/hooks/useSCPaymentsEnabled.d.ts +18 -0
- package/lib/esm/hooks/useSCPaymentsEnabled.js +31 -0
- package/lib/esm/hooks/useSCPreferenceEnabled.d.ts +6 -0
- package/lib/esm/hooks/useSCPreferenceEnabled.js +13 -0
- package/lib/esm/hooks/useSCSubscribedEventsManager.js +4 -14
- package/lib/esm/hooks/useSCSubscribedGroupsManager.d.ts +1 -1
- package/lib/esm/hooks/useSCSubscribedGroupsManager.js +29 -54
- package/lib/esm/hooks/useSCWebPushMessaging.js +1 -1
- package/lib/esm/index.d.ts +7 -2
- package/lib/esm/index.js +7 -2
- package/lib/esm/themes/theme.js +13 -1
- package/lib/esm/types/theme.d.ts +53 -1
- package/lib/esm/utils/hooks/index.d.ts +2 -1
- package/lib/esm/utils/hooks/index.js +2 -1
- package/lib/esm/utils/hooks/useResizeObserver.d.ts +1 -0
- package/lib/esm/utils/hooks/useResizeObserver.js +13 -0
- package/lib/esm/utils/user.d.ts +8 -1
- package/lib/esm/utils/user.js +13 -1
- package/lib/umd/440.js +2 -0
- package/lib/umd/react-core.js +1 -1
- package/package.json +6 -6
- package/lib/umd/258.js +0 -2
- /package/lib/umd/{258.js.LICENSE.txt → 440.js.LICENSE.txt} +0 -0
package/lib/cjs/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ import * as SCCache from './constants/Cache';
|
|
|
42
42
|
* Custom Hooks
|
|
43
43
|
*/
|
|
44
44
|
import useSCFetchUser from './hooks/useSCFetchUser';
|
|
45
|
+
import useSCFetchUsers from './hooks/useSCFetchUsers';
|
|
45
46
|
import useSCFetchUserProviders from './hooks/useSCFetchUserProviders';
|
|
46
47
|
import useSCFetchVote from './hooks/useSCFetchVote';
|
|
47
48
|
import useSCFetchFeedObject from './hooks/useSCFetchFeedObject';
|
|
@@ -71,6 +72,10 @@ import useSCGoogleApiLoader from './hooks/useSCGoogleApiLoader';
|
|
|
71
72
|
import useSCFetchCourse from './hooks/useSCFetchCourse';
|
|
72
73
|
import useSCFetchCourses from './hooks/useSCFetchCourses';
|
|
73
74
|
import useSCFetchLesson from './hooks/useSCFetchLesson';
|
|
75
|
+
import useSCPaymentsEnabled from './hooks/useSCPaymentsEnabled';
|
|
76
|
+
import useSCFetchPaymentProduct from './hooks/useSCFetchPaymentProduct';
|
|
77
|
+
import useSCFetchPaymentOrder from './hooks/useSCFetchPaymentOrder';
|
|
78
|
+
import useSCPreferenceEnabled from './hooks/useSCPreferenceEnabled';
|
|
74
79
|
/**
|
|
75
80
|
* Routing component
|
|
76
81
|
*/
|
|
@@ -82,7 +87,7 @@ import * as SCRoutes from './constants/Routes';
|
|
|
82
87
|
*/
|
|
83
88
|
import * as UserUtils from './utils/user';
|
|
84
89
|
import getTheme from './themes/theme';
|
|
85
|
-
import { useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility } from './utils/hooks';
|
|
90
|
+
import { useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver } from './utils/hooks';
|
|
86
91
|
import { getEventStatus } from './utils/event';
|
|
87
92
|
/**
|
|
88
93
|
* Constants:
|
|
@@ -93,4 +98,4 @@ import * as Preferences from './constants/Preferences';
|
|
|
93
98
|
/**
|
|
94
99
|
* List all exports
|
|
95
100
|
*/
|
|
96
|
-
export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCJoinedCoursesManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, };
|
|
101
|
+
export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCJoinedCoursesManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUsers, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, useSCPaymentsEnabled, useSCFetchPaymentProduct, useSCFetchPaymentOrder, useSCPreferenceEnabled, };
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.useSCFetchLesson = exports.useSCFetchCourses = exports.useSCFetchCourse = exports.useSCGoogleApiLoader = exports.useSCFetchLiveStream = exports.useSCFetchEvents = exports.useSCFetchEvent = exports.useSCFetchGroups = exports.useSCFetchGroup = exports.useSCUserIsBlocked = exports.useSCFetchUserBlockedBy = exports.useSCFetchBroadcastMessages = exports.useSCFetchPrivateMessageSnippets = exports.usePageVisibility = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = exports.useSCFetchFeed = exports.useSCFetchContributors = exports.useSCMediaClick = exports.useSCFetchIncubator = void 0;
|
|
3
|
+
exports.useSCFetchCategory = exports.useSCFetchAddressingTagList = exports.useSCFetchTag = exports.useSCFetchCustomAdv = exports.useSCFetchLessonCommentObjects = exports.useSCFetchLessonCommentObject = exports.useSCFetchCommentObjects = exports.useSCFetchCommentObject = exports.useSCFetchFeedObject = exports.useSCFetchVote = exports.useSCFetchUserProviders = exports.useSCFetchUsers = exports.useSCFetchUser = exports.Preferences = exports.Locale = exports.getEventStatus = exports.UserUtils = exports.SCCache = exports.SCRoutes = exports.Link = exports.useSCAlertMessages = exports.SCAlertMessagesContext = exports.SCAlertMessagesProvider = exports.useSCNotification = exports.SCNotificationContext = exports.SCNotificationProvider = exports.SCNotification = exports.SCFeatures = exports.SCPreferences = exports.SCPreferencesProvider = exports.withSCLocale = exports.useSCLocale = exports.SCLocaleProvider = exports.useSCRouting = exports.SCRoutingProvider = exports.getTheme = exports.withSCTheme = exports.useSCTheme = exports.SCThemeProvider = exports.useSCPreferences = exports.useSCUser = exports.SCUserProvider = exports.SCContextProvider = exports.useSCContext = exports.SCPreferencesContext = exports.SCLocaleContext = exports.SCRoutingContext = exports.SCThemeContext = exports.SCUserContext = exports.SCContext = void 0;
|
|
4
|
+
exports.useSCPreferenceEnabled = exports.useSCFetchPaymentOrder = exports.useSCFetchPaymentProduct = exports.useSCPaymentsEnabled = exports.useSCFetchLesson = exports.useSCFetchCourses = exports.useSCFetchCourse = exports.useSCGoogleApiLoader = exports.useSCFetchLiveStream = exports.useSCFetchEvents = exports.useSCFetchEvent = exports.useSCFetchGroups = exports.useSCFetchGroup = exports.useSCUserIsBlocked = exports.useSCFetchUserBlockedBy = exports.useSCFetchBroadcastMessages = exports.useSCFetchPrivateMessageSnippets = exports.useResizeObserver = exports.usePageVisibility = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = exports.useSCFetchFeed = exports.useSCFetchContributors = exports.useSCMediaClick = exports.useSCFetchIncubator = exports.useSCFetchCategories = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
/**
|
|
7
7
|
* ContextProvider component
|
|
@@ -74,6 +74,8 @@ exports.SCCache = SCCache;
|
|
|
74
74
|
*/
|
|
75
75
|
const useSCFetchUser_1 = tslib_1.__importDefault(require("./hooks/useSCFetchUser"));
|
|
76
76
|
exports.useSCFetchUser = useSCFetchUser_1.default;
|
|
77
|
+
const useSCFetchUsers_1 = tslib_1.__importDefault(require("./hooks/useSCFetchUsers"));
|
|
78
|
+
exports.useSCFetchUsers = useSCFetchUsers_1.default;
|
|
77
79
|
const useSCFetchUserProviders_1 = tslib_1.__importDefault(require("./hooks/useSCFetchUserProviders"));
|
|
78
80
|
exports.useSCFetchUserProviders = useSCFetchUserProviders_1.default;
|
|
79
81
|
const useSCFetchVote_1 = tslib_1.__importDefault(require("./hooks/useSCFetchVote"));
|
|
@@ -132,6 +134,14 @@ const useSCFetchCourses_1 = tslib_1.__importDefault(require("./hooks/useSCFetchC
|
|
|
132
134
|
exports.useSCFetchCourses = useSCFetchCourses_1.default;
|
|
133
135
|
const useSCFetchLesson_1 = tslib_1.__importDefault(require("./hooks/useSCFetchLesson"));
|
|
134
136
|
exports.useSCFetchLesson = useSCFetchLesson_1.default;
|
|
137
|
+
const useSCPaymentsEnabled_1 = tslib_1.__importDefault(require("./hooks/useSCPaymentsEnabled"));
|
|
138
|
+
exports.useSCPaymentsEnabled = useSCPaymentsEnabled_1.default;
|
|
139
|
+
const useSCFetchPaymentProduct_1 = tslib_1.__importDefault(require("./hooks/useSCFetchPaymentProduct"));
|
|
140
|
+
exports.useSCFetchPaymentProduct = useSCFetchPaymentProduct_1.default;
|
|
141
|
+
const useSCFetchPaymentOrder_1 = tslib_1.__importDefault(require("./hooks/useSCFetchPaymentOrder"));
|
|
142
|
+
exports.useSCFetchPaymentOrder = useSCFetchPaymentOrder_1.default;
|
|
143
|
+
const useSCPreferenceEnabled_1 = tslib_1.__importDefault(require("./hooks/useSCPreferenceEnabled"));
|
|
144
|
+
exports.useSCPreferenceEnabled = useSCPreferenceEnabled_1.default;
|
|
135
145
|
/**
|
|
136
146
|
* Routing component
|
|
137
147
|
*/
|
|
@@ -154,6 +164,7 @@ Object.defineProperty(exports, "useIsomorphicLayoutEffect", { enumerable: true,
|
|
|
154
164
|
Object.defineProperty(exports, "useEffectOnce", { enumerable: true, get: function () { return hooks_1.useEffectOnce; } });
|
|
155
165
|
Object.defineProperty(exports, "useNoInitialEffect", { enumerable: true, get: function () { return hooks_1.useNoInitialEffect; } });
|
|
156
166
|
Object.defineProperty(exports, "usePageVisibility", { enumerable: true, get: function () { return hooks_1.usePageVisibility; } });
|
|
167
|
+
Object.defineProperty(exports, "useResizeObserver", { enumerable: true, get: function () { return hooks_1.useResizeObserver; } });
|
|
157
168
|
const event_1 = require("./utils/event");
|
|
158
169
|
Object.defineProperty(exports, "getEventStatus", { enumerable: true, get: function () { return event_1.getEventStatus; } });
|
|
159
170
|
/**
|
package/lib/cjs/themes/theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
5
|
const utils_1 = require("@selfcommunity/utils");
|
|
6
6
|
const validate_color_1 = tslib_1.__importDefault(require("validate-color"));
|
|
7
7
|
const Preferences_1 = require("../constants/Preferences");
|
|
@@ -51,6 +51,18 @@ const getTheme = (options, preferences) => {
|
|
|
51
51
|
sizeXLarge: 120,
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
|
+
contentProduct: {
|
|
55
|
+
icon: {
|
|
56
|
+
sizeSmall: 24,
|
|
57
|
+
sizeMedium: 40,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
contentProductPrice: {
|
|
61
|
+
icon: {
|
|
62
|
+
sizeSmall: 24,
|
|
63
|
+
sizeMedium: 40,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
54
66
|
};
|
|
55
67
|
const defaultOptions = preferences
|
|
56
68
|
? {
|
|
@@ -60,6 +72,6 @@ const getTheme = (options, preferences) => {
|
|
|
60
72
|
typography: Object.assign({}, (isValidPreference(preferences, Preferences_1.STYLE_FONT_FAMILY, utils_2.isString) && { fontFamily: preferences[Preferences_1.STYLE_FONT_FAMILY].value })),
|
|
61
73
|
}
|
|
62
74
|
: {};
|
|
63
|
-
return (0,
|
|
75
|
+
return (0, material_1.createTheme)((0, utils_1.mergeDeep)(Object.assign({ selfcommunity }, defaultOptions), options));
|
|
64
76
|
};
|
|
65
77
|
exports.default = getTheme;
|
package/lib/cjs/types/theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme as MuiTheme } from '@mui/material
|
|
1
|
+
import { Theme as MuiTheme } from '@mui/material';
|
|
2
2
|
/**
|
|
3
3
|
* Interface SCThemeAvatarVariableType
|
|
4
4
|
*/
|
|
@@ -55,6 +55,32 @@ export interface SCThemeCategoryIconVariableType {
|
|
|
55
55
|
*/
|
|
56
56
|
sizeLarge: number;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Interface SCThemeContentProductIconVariableType
|
|
60
|
+
*/
|
|
61
|
+
export interface SCThemeContentProductIconVariableType {
|
|
62
|
+
/**
|
|
63
|
+
* ContentProduct size small
|
|
64
|
+
*/
|
|
65
|
+
sizeSmall: number;
|
|
66
|
+
/**
|
|
67
|
+
* ContentProduct size medium
|
|
68
|
+
*/
|
|
69
|
+
sizeMedium: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Interface SCThemeContentProductPriceIconVariableType
|
|
73
|
+
*/
|
|
74
|
+
export interface SCThemeContentProductPriceIconVariableType {
|
|
75
|
+
/**
|
|
76
|
+
* ContentProductPrice size small
|
|
77
|
+
*/
|
|
78
|
+
sizeSmall: number;
|
|
79
|
+
/**
|
|
80
|
+
* ContentProductPrice size medium
|
|
81
|
+
*/
|
|
82
|
+
sizeMedium: number;
|
|
83
|
+
}
|
|
58
84
|
/**
|
|
59
85
|
* Interface SCThemeCategoryVariableType
|
|
60
86
|
*/
|
|
@@ -64,6 +90,24 @@ export interface SCThemeCategoryVariableType {
|
|
|
64
90
|
*/
|
|
65
91
|
icon: SCThemeCategoryIconVariableType;
|
|
66
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Interface SCThemeContentProductVariableType
|
|
95
|
+
*/
|
|
96
|
+
export interface SCThemeContentProductVariableType {
|
|
97
|
+
/**
|
|
98
|
+
* ContentProduct icon size
|
|
99
|
+
*/
|
|
100
|
+
icon: SCThemeContentProductIconVariableType;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Interface SCThemeContentProductPriceVariableType
|
|
104
|
+
*/
|
|
105
|
+
export interface SCThemeContentProductPriceVariableType {
|
|
106
|
+
/**
|
|
107
|
+
* ContentProductPrice icon size
|
|
108
|
+
*/
|
|
109
|
+
icon: SCThemeContentProductPriceIconVariableType;
|
|
110
|
+
}
|
|
67
111
|
/**
|
|
68
112
|
* Interface SCThemeVariablesType
|
|
69
113
|
*/
|
|
@@ -80,6 +124,14 @@ export interface SCThemeVariablesType {
|
|
|
80
124
|
* Group
|
|
81
125
|
*/
|
|
82
126
|
group: SCThemeGroupVariableType;
|
|
127
|
+
/**
|
|
128
|
+
* ContentProduct
|
|
129
|
+
*/
|
|
130
|
+
contentProduct: SCThemeContentProductVariableType;
|
|
131
|
+
/**
|
|
132
|
+
* ContentProductPrice
|
|
133
|
+
*/
|
|
134
|
+
contentProductPrice: SCThemeContentProductPriceVariableType;
|
|
83
135
|
}
|
|
84
136
|
export interface SCThemeType extends MuiTheme {
|
|
85
137
|
/**
|
|
@@ -4,4 +4,5 @@ import useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';
|
|
|
4
4
|
import useEffectOnce from './useEffectOnce';
|
|
5
5
|
import useNoInitialEffect from './useNoInitialEffect';
|
|
6
6
|
import usePageVisibility from './usePageVisibility';
|
|
7
|
-
|
|
7
|
+
import useResizeObserver from './useResizeObserver';
|
|
8
|
+
export { useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePageVisibility = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = void 0;
|
|
3
|
+
exports.useResizeObserver = exports.usePageVisibility = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const useIsComponentMountedRef_1 = tslib_1.__importDefault(require("./useIsComponentMountedRef"));
|
|
6
6
|
exports.useIsComponentMountedRef = useIsComponentMountedRef_1.default;
|
|
@@ -14,3 +14,5 @@ const useNoInitialEffect_1 = tslib_1.__importDefault(require("./useNoInitialEffe
|
|
|
14
14
|
exports.useNoInitialEffect = useNoInitialEffect_1.default;
|
|
15
15
|
const usePageVisibility_1 = tslib_1.__importDefault(require("./usePageVisibility"));
|
|
16
16
|
exports.usePageVisibility = usePageVisibility_1.default;
|
|
17
|
+
const useResizeObserver_1 = tslib_1.__importDefault(require("./useResizeObserver"));
|
|
18
|
+
exports.useResizeObserver = useResizeObserver_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useResizeObserver(element: Element | null, options: ResizeObserverOptions | undefined, observerCallback: ResizeObserverCallback): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
function useResizeObserver(element, options, observerCallback) {
|
|
5
|
+
(0, react_1.useEffect)(() => {
|
|
6
|
+
if (!element || !('ResizeObserver' in window)) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const observer = new ResizeObserver(observerCallback);
|
|
10
|
+
observer.observe(element, options);
|
|
11
|
+
return () => {
|
|
12
|
+
observer.disconnect();
|
|
13
|
+
};
|
|
14
|
+
}, [element, options, observerCallback]);
|
|
15
|
+
}
|
|
16
|
+
exports.default = useResizeObserver;
|
package/lib/cjs/utils/user.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { SCUserType } from '@selfcommunity/types';
|
|
|
6
6
|
export declare const ADMIN_ROLE = "admin";
|
|
7
7
|
export declare const MODERATOR_ROLE = "moderator";
|
|
8
8
|
export declare const EDITOR_ROLE = "editor";
|
|
9
|
+
export declare const PUBLISHER_ROLE = "publisher";
|
|
9
10
|
export declare const COMMUNITY_CREATOR = 1;
|
|
10
11
|
/**
|
|
11
12
|
* Get user role from roles(set)
|
|
@@ -38,7 +39,13 @@ export declare function isModerator(user: SCUserType): boolean;
|
|
|
38
39
|
*/
|
|
39
40
|
export declare function isEditor(user: SCUserType): boolean;
|
|
40
41
|
/**
|
|
41
|
-
* Check if user is
|
|
42
|
+
* Check if user is publisher
|
|
43
|
+
* @param user
|
|
44
|
+
* @returns boolean
|
|
45
|
+
*/
|
|
46
|
+
export declare function isPublisher(user: SCUserType): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Check if user is admin, moderator, editor or publisher
|
|
42
49
|
* @param user
|
|
43
50
|
* @returns boolean
|
|
44
51
|
*/
|
package/lib/cjs/utils/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBlocked = exports.isStaff = exports.isEditor = exports.isModerator = exports.isCommunityCreator = exports.isAdmin = exports.getUserRole = exports.COMMUNITY_CREATOR = exports.EDITOR_ROLE = exports.MODERATOR_ROLE = exports.ADMIN_ROLE = void 0;
|
|
3
|
+
exports.isBlocked = exports.isStaff = exports.isPublisher = exports.isEditor = exports.isModerator = exports.isCommunityCreator = exports.isAdmin = exports.getUserRole = exports.COMMUNITY_CREATOR = exports.PUBLISHER_ROLE = exports.EDITOR_ROLE = exports.MODERATOR_ROLE = exports.ADMIN_ROLE = void 0;
|
|
4
4
|
const types_1 = require("@selfcommunity/types");
|
|
5
5
|
/**
|
|
6
6
|
* Staff Roles
|
|
@@ -9,6 +9,7 @@ const types_1 = require("@selfcommunity/types");
|
|
|
9
9
|
exports.ADMIN_ROLE = 'admin';
|
|
10
10
|
exports.MODERATOR_ROLE = 'moderator';
|
|
11
11
|
exports.EDITOR_ROLE = 'editor';
|
|
12
|
+
exports.PUBLISHER_ROLE = 'publisher';
|
|
12
13
|
exports.COMMUNITY_CREATOR = 1;
|
|
13
14
|
/**
|
|
14
15
|
* Get user role from roles(set)
|
|
@@ -27,6 +28,9 @@ function getUserRole(user) {
|
|
|
27
28
|
else if (role === exports.EDITOR_ROLE) {
|
|
28
29
|
return exports.EDITOR_ROLE;
|
|
29
30
|
}
|
|
31
|
+
else if (role === exports.PUBLISHER_ROLE) {
|
|
32
|
+
return exports.PUBLISHER_ROLE;
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
return null;
|
|
32
36
|
}
|
|
@@ -68,7 +72,16 @@ function isEditor(user) {
|
|
|
68
72
|
}
|
|
69
73
|
exports.isEditor = isEditor;
|
|
70
74
|
/**
|
|
71
|
-
* Check if user is
|
|
75
|
+
* Check if user is publisher
|
|
76
|
+
* @param user
|
|
77
|
+
* @returns boolean
|
|
78
|
+
*/
|
|
79
|
+
function isPublisher(user) {
|
|
80
|
+
return getUserRole(user) === exports.PUBLISHER_ROLE;
|
|
81
|
+
}
|
|
82
|
+
exports.isPublisher = isPublisher;
|
|
83
|
+
/**
|
|
84
|
+
* Check if user is admin, moderator, editor or publisher
|
|
72
85
|
* @param user
|
|
73
86
|
* @returns boolean
|
|
74
87
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useState } from 'react';
|
|
3
|
-
import ThemeProvider from '@mui/material
|
|
3
|
+
import { ThemeProvider } from '@mui/material';
|
|
4
4
|
import getTheme from '../../../themes/theme';
|
|
5
5
|
import { useSCContext } from '../SCContextProvider';
|
|
6
6
|
import { useSCPreferences } from '../SCPreferencesProvider';
|
|
@@ -76,6 +76,18 @@ export declare const getPmSnippetsObjectCacheKey: () => string;
|
|
|
76
76
|
/** PRIVATE MESSAGE SNIPPET OBJECT **/
|
|
77
77
|
export declare const PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY = "_pms_";
|
|
78
78
|
export declare const getPmSnippetObjectCacheKey: (id: any) => string;
|
|
79
|
+
/** PAYMENT PRODUCT OBJECT **/
|
|
80
|
+
export declare const PAYMENT_PRODUCT_OBJECT_CACHE_PREFIX_KEY = "_ppo_";
|
|
81
|
+
export declare const getPaymentProductObjectCacheKey: (id: any) => string;
|
|
82
|
+
/** PAYMENT PRODUCT OBJECT **/
|
|
83
|
+
export declare const PAYMENT_ORDER_OBJECT_CACHE_PREFIX_KEY = "_pord_";
|
|
84
|
+
export declare const getPaymentOrderObjectCacheKey: (id: any) => string;
|
|
85
|
+
/** USER OBJECT **/
|
|
86
|
+
export declare const USER_OBJECT_CACHE_PREFIX_KEY = "_usr_";
|
|
87
|
+
export declare const getUserObjectCacheKey: (id: number) => string;
|
|
88
|
+
/** USERS OBJECT **/
|
|
89
|
+
export declare const USERS_OBJECT_CACHE_PREFIX_KEY = "_usrs_";
|
|
90
|
+
export declare const getUsersObjectCacheKey: (search?: string) => string;
|
|
79
91
|
/** TOOLS */
|
|
80
92
|
export declare const CATEGORIES_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = "_cListWidget_";
|
|
81
93
|
export declare const CATEGORIES_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = "_cFolWidget_";
|
|
@@ -80,6 +80,18 @@ export const getPmSnippetsObjectCacheKey = () => `${PM_SNIPPETS_OBJECT_CACHE_PRE
|
|
|
80
80
|
/** PRIVATE MESSAGE SNIPPET OBJECT **/
|
|
81
81
|
export const PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY = '_pms_';
|
|
82
82
|
export const getPmSnippetObjectCacheKey = (id) => `${PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
83
|
+
/** PAYMENT PRODUCT OBJECT **/
|
|
84
|
+
export const PAYMENT_PRODUCT_OBJECT_CACHE_PREFIX_KEY = '_ppo_';
|
|
85
|
+
export const getPaymentProductObjectCacheKey = (id) => `${PAYMENT_PRODUCT_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
86
|
+
/** PAYMENT PRODUCT OBJECT **/
|
|
87
|
+
export const PAYMENT_ORDER_OBJECT_CACHE_PREFIX_KEY = '_pord_';
|
|
88
|
+
export const getPaymentOrderObjectCacheKey = (id) => `${PAYMENT_ORDER_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
89
|
+
/** USER OBJECT **/
|
|
90
|
+
export const USER_OBJECT_CACHE_PREFIX_KEY = '_usr_';
|
|
91
|
+
export const getUserObjectCacheKey = (id) => `${USER_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
92
|
+
/** USERS OBJECT **/
|
|
93
|
+
export const USERS_OBJECT_CACHE_PREFIX_KEY = '_usrs_';
|
|
94
|
+
export const getUsersObjectCacheKey = (search) => search ? `${USERS_OBJECT_CACHE_PREFIX_KEY}${encodeURIComponent(search)}` : `${USERS_OBJECT_CACHE_PREFIX_KEY}`;
|
|
83
95
|
/** TOOLS */
|
|
84
96
|
export const CATEGORIES_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = '_cListWidget_';
|
|
85
97
|
export const CATEGORIES_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = '_cFolWidget_';
|
|
@@ -81,6 +81,8 @@ export declare const ADDONS_POST_GEOLOCATION_ENABLED: string;
|
|
|
81
81
|
export declare const ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED: string;
|
|
82
82
|
export declare const ADDONS_SHARE_POST_ON_TWITTER_ENABLED: string;
|
|
83
83
|
export declare const ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED: string;
|
|
84
|
+
export declare const ADDONS_PRIVATE_MESSAGES_ENABLED: string;
|
|
85
|
+
export declare const ADDONS_SHARE_POST_ENABLED: string;
|
|
84
86
|
/**
|
|
85
87
|
* ADVERTISING
|
|
86
88
|
*/
|
|
@@ -89,6 +91,7 @@ export declare const ADVERTISING_CUSTOM_ADV_ONLY_FOR_ANONYMOUS_USERS_ENABLED: st
|
|
|
89
91
|
/**
|
|
90
92
|
* CONFIGURATIONS
|
|
91
93
|
*/
|
|
94
|
+
export declare const CONFIGURATIONS_CONNECTION_ENABLED: string;
|
|
92
95
|
export declare const CONFIGURATIONS_FOLLOW_ENABLED: string;
|
|
93
96
|
export declare const CONFIGURATIONS_EXPLORE_STREAM_ENABLED: string;
|
|
94
97
|
export declare const CONFIGURATIONS_EXPLORE_STREAM_ORDER_BY: string;
|
|
@@ -146,6 +149,18 @@ export declare const CONFIGURATIONS_LIVE_STREAM_ENABLED: string;
|
|
|
146
149
|
export declare const CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED: string;
|
|
147
150
|
export declare const CONFIGURATIONS_LIVE_VIDEO_CONFERENCE_ENABLED: string;
|
|
148
151
|
export declare const CONFIGURATIONS_SUBSCRIPTION_TIER: string;
|
|
152
|
+
export declare const CONFIGURATIONS_PAYMENTS_ENABLED: string;
|
|
153
|
+
export declare const CONFIGURATIONS_STRIPE_CONNECTED_ACCOUNT_ID: string;
|
|
154
|
+
export declare const CONFIGURATIONS_CONTEXT_MENU_ENABLED: string;
|
|
155
|
+
export declare const CONFIGURATIONS_CATEGORY_FOLLOW_ENABLED: string;
|
|
156
|
+
export declare const CONFIGURATIONS_COMMENTS_ENABLED: string;
|
|
157
|
+
export declare const CONFIGURATIONS_SIDEBAR_SHOW_ALL_CATEGORIES_ENABLED: string;
|
|
158
|
+
export declare const CONFIGURATIONS_VIDEO_AUTOPLAY_ENABLED: string;
|
|
159
|
+
export declare const CONFIGURATIONS_VIDEO_PLAY_TRACKING_DELAY_SECONDS: string;
|
|
160
|
+
export declare const CONFIGURATIONS_SCHEDULED_POSTS_ENABLED: string;
|
|
161
|
+
export declare const CONFIGURATIONS_POST_CATEGORY_REQUIRED_ENABLED: string;
|
|
162
|
+
export declare const CONFIGURATIONS_POST_ADDRESSING_REQUIRED_ENABLED: string;
|
|
163
|
+
export declare const CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED: string;
|
|
149
164
|
/**
|
|
150
165
|
* PROVIDERS
|
|
151
166
|
*/
|
|
@@ -177,6 +192,7 @@ export declare const WEBMASTER_META_DESCRIPTION: string;
|
|
|
177
192
|
*/
|
|
178
193
|
export declare const STATIC_ENVIRONMENT: string;
|
|
179
194
|
export declare const STATIC_STACKID: string;
|
|
195
|
+
export declare const STATIC_STRIPE_PUBLIC_KEY: string;
|
|
180
196
|
export declare const getPreferenceSection: (value: any) => any;
|
|
181
197
|
export declare const getPreferenceName: (value: any) => any;
|
|
182
198
|
export declare const getPreference: (value: any) => {
|
|
@@ -82,6 +82,8 @@ export const ADDONS_POST_GEOLOCATION_ENABLED = `${SCPreferenceSection.ADDONS}.${
|
|
|
82
82
|
export const ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED = `${SCPreferenceSection.ADDONS}.${SCPreferenceName.SHARE_POST_ON_FACEBOOK_ENABLED}`;
|
|
83
83
|
export const ADDONS_SHARE_POST_ON_TWITTER_ENABLED = `${SCPreferenceSection.ADDONS}.${SCPreferenceName.SHARE_POST_ON_TWITTER_ENABLED}`;
|
|
84
84
|
export const ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED = `${SCPreferenceSection.ADDONS}.${SCPreferenceName.SHARE_POST_ON_LINKEDIN_ENABLED}`;
|
|
85
|
+
export const ADDONS_PRIVATE_MESSAGES_ENABLED = `${SCPreferenceSection.ADDONS}.${SCPreferenceName.PRIVATE_MESSAGES_ENABLED}`;
|
|
86
|
+
export const ADDONS_SHARE_POST_ENABLED = `${SCPreferenceSection.ADDONS}.${SCPreferenceName.SHARE_POST_ENABLED}`;
|
|
85
87
|
/**
|
|
86
88
|
* ADVERTISING
|
|
87
89
|
*/
|
|
@@ -90,6 +92,7 @@ export const ADVERTISING_CUSTOM_ADV_ONLY_FOR_ANONYMOUS_USERS_ENABLED = `${SCPref
|
|
|
90
92
|
/**
|
|
91
93
|
* CONFIGURATIONS
|
|
92
94
|
*/
|
|
95
|
+
export const CONFIGURATIONS_CONNECTION_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.CONNECTION_ENABLED}`;
|
|
93
96
|
export const CONFIGURATIONS_FOLLOW_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.FOLLOW_ENABLED}`;
|
|
94
97
|
export const CONFIGURATIONS_EXPLORE_STREAM_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.EXPLORE_STREAM_ENABLED}`;
|
|
95
98
|
export const CONFIGURATIONS_EXPLORE_STREAM_ORDER_BY = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.EXPLORE_STREAM_ORDER_BY}`;
|
|
@@ -147,6 +150,18 @@ export const CONFIGURATIONS_LIVE_STREAM_ENABLED = `${SCPreferenceSection.CONFIGU
|
|
|
147
150
|
export const CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.LIVE_STREAM_ONLY_STAFF_ENABLED}`;
|
|
148
151
|
export const CONFIGURATIONS_LIVE_VIDEO_CONFERENCE_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.LIVE_STREAM_VIDEO_CONFERENCE_ENABLED}`;
|
|
149
152
|
export const CONFIGURATIONS_SUBSCRIPTION_TIER = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.SUBSCRIPTION_TIER}`;
|
|
153
|
+
export const CONFIGURATIONS_PAYMENTS_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.PAYMENTS_ENABLED}`;
|
|
154
|
+
export const CONFIGURATIONS_STRIPE_CONNECTED_ACCOUNT_ID = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.STRIPE_CONNECTED_ACCOUNT_ID}`;
|
|
155
|
+
export const CONFIGURATIONS_CONTEXT_MENU_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.CONTEXT_MENU_ENABLED}`;
|
|
156
|
+
export const CONFIGURATIONS_CATEGORY_FOLLOW_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.CATEGORY_FOLLOW_ENABLED}`;
|
|
157
|
+
export const CONFIGURATIONS_COMMENTS_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.COMMENTS_ENABLED}`;
|
|
158
|
+
export const CONFIGURATIONS_SIDEBAR_SHOW_ALL_CATEGORIES_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.SIDEBAR_SHOW_ALL_CATEGORIES_ENABLED}`;
|
|
159
|
+
export const CONFIGURATIONS_VIDEO_AUTOPLAY_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.VIDEO_AUTOPLAY_ENABLED}`;
|
|
160
|
+
export const CONFIGURATIONS_VIDEO_PLAY_TRACKING_DELAY_SECONDS = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.VIDEO_PLAY_TRACKING_DELAY_SECONDS}`;
|
|
161
|
+
export const CONFIGURATIONS_SCHEDULED_POSTS_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.SCHEDULED_POSTS_ENABLED}`;
|
|
162
|
+
export const CONFIGURATIONS_POST_CATEGORY_REQUIRED_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.POST_CATEGORY_REQUIRED_ENABLED}`;
|
|
163
|
+
export const CONFIGURATIONS_POST_ADDRESSING_REQUIRED_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.POST_ADDRESSING_REQUIRED_ENABLED}`;
|
|
164
|
+
export const CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.POST_USER_ADDRESSING_ENABLED}`;
|
|
150
165
|
/**
|
|
151
166
|
* PROVIDERS
|
|
152
167
|
*/
|
|
@@ -178,6 +193,7 @@ export const WEBMASTER_META_DESCRIPTION = `${SCPreferenceSection.WEBMASTER}.${SC
|
|
|
178
193
|
*/
|
|
179
194
|
export const STATIC_ENVIRONMENT = `${SCPreferenceSection.STATIC}.${SCPreferenceName.ENVIRONMENT}`;
|
|
180
195
|
export const STATIC_STACKID = `${SCPreferenceSection.STATIC}.${SCPreferenceName.STACK_ID}`;
|
|
196
|
+
export const STATIC_STRIPE_PUBLIC_KEY = `${SCPreferenceSection.STATIC}.${SCPreferenceName.STRIPE_PUBLIC_KEY}`;
|
|
181
197
|
const booleanType = (value) => {
|
|
182
198
|
if (value === 'True') {
|
|
183
199
|
return true;
|
|
@@ -252,6 +268,7 @@ export const DATA_TYPES = {
|
|
|
252
268
|
[ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED]: booleanType,
|
|
253
269
|
[ADDONS_SHARE_POST_ON_TWITTER_ENABLED]: booleanType,
|
|
254
270
|
[ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED]: booleanType,
|
|
271
|
+
[ADDONS_SHARE_POST_ENABLED]: booleanType,
|
|
255
272
|
[CONFIGURATIONS_FOLLOW_ENABLED]: booleanType,
|
|
256
273
|
[CONFIGURATIONS_EXPLORE_STREAM_ENABLED]: booleanType,
|
|
257
274
|
[CONFIGURATIONS_EXPLORE_STREAM_ORDER_BY]: stringType,
|
|
@@ -308,6 +325,16 @@ export const DATA_TYPES = {
|
|
|
308
325
|
[CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED]: booleanType,
|
|
309
326
|
[CONFIGURATIONS_LIVE_VIDEO_CONFERENCE_ENABLED]: booleanType,
|
|
310
327
|
[CONFIGURATIONS_SUBSCRIPTION_TIER]: stringType,
|
|
328
|
+
[CONFIGURATIONS_PAYMENTS_ENABLED]: booleanType,
|
|
329
|
+
[CONFIGURATIONS_STRIPE_CONNECTED_ACCOUNT_ID]: stringType,
|
|
330
|
+
[CONFIGURATIONS_CONTEXT_MENU_ENABLED]: booleanType,
|
|
331
|
+
[CONFIGURATIONS_COMMENTS_ENABLED]: booleanType,
|
|
332
|
+
[CONFIGURATIONS_SIDEBAR_SHOW_ALL_CATEGORIES_ENABLED]: booleanType,
|
|
333
|
+
[CONFIGURATIONS_VIDEO_AUTOPLAY_ENABLED]: booleanType,
|
|
334
|
+
[CONFIGURATIONS_VIDEO_PLAY_TRACKING_DELAY_SECONDS]: integerType,
|
|
335
|
+
[CONFIGURATIONS_SCHEDULED_POSTS_ENABLED]: booleanType,
|
|
336
|
+
[CONFIGURATIONS_POST_CATEGORY_REQUIRED_ENABLED]: booleanType,
|
|
337
|
+
[CONFIGURATIONS_POST_ADDRESSING_REQUIRED_ENABLED]: booleanType,
|
|
311
338
|
[PROVIDERS_APP_URL_ON_APP_STORE]: stringType,
|
|
312
339
|
[PROVIDERS_APP_URL_ON_GOOGLE_PLAY]: stringType,
|
|
313
340
|
[PROVIDERS_FACEBOOK_SIGNIN_ENABLED]: stringType,
|
|
@@ -330,4 +357,5 @@ export const DATA_TYPES = {
|
|
|
330
357
|
[WEBMASTER_META_DESCRIPTION]: stringType,
|
|
331
358
|
[STATIC_ENVIRONMENT]: stringType,
|
|
332
359
|
[STATIC_STACKID]: stringType,
|
|
360
|
+
[STATIC_STRIPE_PUBLIC_KEY]: stringType,
|
|
333
361
|
};
|
|
@@ -23,7 +23,12 @@ export declare const USER_PROFILE_CONNECTIONS_REQUESTS_ROUTE_NAME = "user_connec
|
|
|
23
23
|
export declare const USER_PROFILE_CONNECTIONS_REQUESTS_SENT_ROUTE_NAME = "user_connections_requests_sent";
|
|
24
24
|
export declare const USER_PROFILE_CATEGORIES_ROUTE_NAME = "user_categories";
|
|
25
25
|
export declare const USER_PROFILE_FOLLOWED_POSTS_ROUTE_NAME = "user_followed_posts";
|
|
26
|
+
export declare const USER_PROFILE_SCHEDULED_POSTS_ROUTE_NAME = "user_scheduled_posts";
|
|
27
|
+
export declare const USER_PROFILE_SCHEDULED_DISCUSSIONS_ROUTE_NAME = "user_scheduled_discussions";
|
|
26
28
|
export declare const USER_PROFILE_FOLLOWED_DISCUSSIONS_ROUTE_NAME = "user_followed_discussions";
|
|
29
|
+
export declare const USER_PAYMENTS_HISTORY_ORDERS_ROUTE_NAME = "user_payments_history_orders";
|
|
30
|
+
export declare const USER_PAYMENTS_ORDER_PDF_ROUTE_NAME = "user_payments_order_pdf";
|
|
31
|
+
export declare const USER_PAYMENT_METHODS_ROUTE_NAME = "user_payment_methods";
|
|
27
32
|
export declare const LOYALTY_ROUTE_NAME = "loyalty";
|
|
28
33
|
export declare const INCUBATOR_ROUTE_NAME = "incubator";
|
|
29
34
|
export declare const SIGNIN_ROUTE_NAME = "signin";
|
|
@@ -50,6 +55,7 @@ export declare const EVENTS_SUGGESTED_ROUTE_NAME = "events_suggested";
|
|
|
50
55
|
export declare const EVENTS_SUBSCRIBED_ROUTE_NAME = "events_subscribed";
|
|
51
56
|
export declare const EVENTS_HIGHLIGHT_ROUTE_NAME = "events_highlight";
|
|
52
57
|
export declare const LIVESTREAM_ROUTE_NAME = "live";
|
|
58
|
+
export declare const CHECKOUT_PAYMENT = "checkout_payment";
|
|
53
59
|
/**
|
|
54
60
|
* Default Routes
|
|
55
61
|
* @type {{[p: string]: string, '[POST_ROUTE_NAME]': string, '[INCUBATOR_ROUTE_NAME]': string, '[LOYALTY_ROUTE_NAME]': string, '[USER_NOTIFICATION_ROUTE_NAME]': string, '[USER_PRIVATE_MESSAGES_ROUTE_NAME]': string, '[COMMENT_ROUTE_NAME]': string, '[DISCUSSION_ROUTE_NAME]': string, '[CATEGORIES_ROUTE_NAME]': string, '[USER_PROFILE_ROUTE_NAME]': string, '[CATEGORY_ROUTE_NAME]': string, '[USER_PROFILE_SETTINGS_ROUTE_NAME]': string, '[STATUS_ROUTE_NAME]': string}}
|
|
@@ -23,7 +23,12 @@ export const USER_PROFILE_CONNECTIONS_REQUESTS_ROUTE_NAME = 'user_connections_re
|
|
|
23
23
|
export const USER_PROFILE_CONNECTIONS_REQUESTS_SENT_ROUTE_NAME = 'user_connections_requests_sent';
|
|
24
24
|
export const USER_PROFILE_CATEGORIES_ROUTE_NAME = 'user_categories';
|
|
25
25
|
export const USER_PROFILE_FOLLOWED_POSTS_ROUTE_NAME = 'user_followed_posts';
|
|
26
|
+
export const USER_PROFILE_SCHEDULED_POSTS_ROUTE_NAME = 'user_scheduled_posts';
|
|
27
|
+
export const USER_PROFILE_SCHEDULED_DISCUSSIONS_ROUTE_NAME = 'user_scheduled_discussions';
|
|
26
28
|
export const USER_PROFILE_FOLLOWED_DISCUSSIONS_ROUTE_NAME = 'user_followed_discussions';
|
|
29
|
+
export const USER_PAYMENTS_HISTORY_ORDERS_ROUTE_NAME = 'user_payments_history_orders';
|
|
30
|
+
export const USER_PAYMENTS_ORDER_PDF_ROUTE_NAME = 'user_payments_order_pdf';
|
|
31
|
+
export const USER_PAYMENT_METHODS_ROUTE_NAME = 'user_payment_methods';
|
|
27
32
|
export const LOYALTY_ROUTE_NAME = 'loyalty';
|
|
28
33
|
export const INCUBATOR_ROUTE_NAME = 'incubator';
|
|
29
34
|
export const SIGNIN_ROUTE_NAME = 'signin';
|
|
@@ -50,6 +55,7 @@ export const EVENTS_SUGGESTED_ROUTE_NAME = 'events_suggested';
|
|
|
50
55
|
export const EVENTS_SUBSCRIBED_ROUTE_NAME = 'events_subscribed';
|
|
51
56
|
export const EVENTS_HIGHLIGHT_ROUTE_NAME = 'events_highlight';
|
|
52
57
|
export const LIVESTREAM_ROUTE_NAME = 'live';
|
|
58
|
+
export const CHECKOUT_PAYMENT = 'checkout_payment';
|
|
53
59
|
/**
|
|
54
60
|
* Default Routes
|
|
55
61
|
* @type {{[p: string]: string, '[POST_ROUTE_NAME]': string, '[INCUBATOR_ROUTE_NAME]': string, '[LOYALTY_ROUTE_NAME]': string, '[USER_NOTIFICATION_ROUTE_NAME]': string, '[USER_PRIVATE_MESSAGES_ROUTE_NAME]': string, '[COMMENT_ROUTE_NAME]': string, '[DISCUSSION_ROUTE_NAME]': string, '[CATEGORIES_ROUTE_NAME]': string, '[USER_PROFILE_ROUTE_NAME]': string, '[CATEGORY_ROUTE_NAME]': string, '[USER_PROFILE_SETTINGS_ROUTE_NAME]': string, '[STATUS_ROUTE_NAME]': string}}
|
|
@@ -75,7 +81,12 @@ export const defaultRoutes = {
|
|
|
75
81
|
[USER_PROFILE_CONNECTIONS_REQUESTS_SENT_ROUTE_NAME]: '/user/:id/connections/requests/sent/',
|
|
76
82
|
[USER_PROFILE_CATEGORIES_ROUTE_NAME]: '/user/:id/categories/',
|
|
77
83
|
[USER_PROFILE_FOLLOWED_POSTS_ROUTE_NAME]: '/user/:id/posts/followed/',
|
|
84
|
+
[USER_PROFILE_SCHEDULED_POSTS_ROUTE_NAME]: '/user/:id/posts/scheduled/',
|
|
78
85
|
[USER_PROFILE_FOLLOWED_DISCUSSIONS_ROUTE_NAME]: '/user/:id/discussions/followed/',
|
|
86
|
+
[USER_PROFILE_SCHEDULED_DISCUSSIONS_ROUTE_NAME]: '/user/:id/discussions/scheduled/',
|
|
87
|
+
[USER_PAYMENTS_HISTORY_ORDERS_ROUTE_NAME]: '/user/:id/:username/history_orders/',
|
|
88
|
+
[USER_PAYMENTS_ORDER_PDF_ROUTE_NAME]: '/user/:id/:username/order/:pid/pdf/',
|
|
89
|
+
[USER_PAYMENT_METHODS_ROUTE_NAME]: '/user/:id/:username/payment_methods/',
|
|
79
90
|
[LOYALTY_ROUTE_NAME]: '/loyalty/',
|
|
80
91
|
[INCUBATOR_ROUTE_NAME]: '/incubator/:id/',
|
|
81
92
|
[SIGNIN_ROUTE_NAME]: '/signin/',
|
|
@@ -102,4 +113,5 @@ export const defaultRoutes = {
|
|
|
102
113
|
[COURSE_LESSON_COMMENTS_ROUTE_NAME]: '/course/:id/:slug/section/:section_id/lesson/:lesson_id/comments',
|
|
103
114
|
[COURSE_LESSON_EDIT_ROUTE_NAME]: '/course/:id/:slug/section/:section_id/lesson/:lesson_id/edit',
|
|
104
115
|
[LIVESTREAM_ROUTE_NAME]: '/live/:slug/',
|
|
116
|
+
[CHECKOUT_PAYMENT]: '/checkout/:content_type/:content_id/price/:price_id',
|
|
105
117
|
};
|
|
@@ -40,6 +40,23 @@ export default function useSCFetchCategory({ id = null, category = null, cacheSt
|
|
|
40
40
|
return Promise.resolve(res.data);
|
|
41
41
|
});
|
|
42
42
|
}, [__categoryId]);
|
|
43
|
+
/**
|
|
44
|
+
* Refresh category
|
|
45
|
+
*/
|
|
46
|
+
const refreshCategory = useMemo(() => () => {
|
|
47
|
+
fetchCategory()
|
|
48
|
+
.then((obj) => {
|
|
49
|
+
const _c = authUserId ? obj : objectWithoutProperties(obj, ['followed']);
|
|
50
|
+
setSCCategory(_c);
|
|
51
|
+
LRUCache.set(__categoryCacheKey, _c);
|
|
52
|
+
})
|
|
53
|
+
.catch((err) => {
|
|
54
|
+
LRUCache.delete(__categoryCacheKey);
|
|
55
|
+
setError(`Error on refresh category with id ${id}`);
|
|
56
|
+
Logger.error(SCOPE_SC_CORE, `Error on refresh category with id ${id}`);
|
|
57
|
+
Logger.error(SCOPE_SC_CORE, err.message);
|
|
58
|
+
});
|
|
59
|
+
}, [__categoryId, setSCCategory, __categoryCacheKey]);
|
|
43
60
|
/**
|
|
44
61
|
* If id attempt to get the category by id
|
|
45
62
|
*/
|
|
@@ -66,5 +83,5 @@ export default function useSCFetchCategory({ id = null, category = null, cacheSt
|
|
|
66
83
|
LRUCache.set(__categoryCacheKey, _c);
|
|
67
84
|
}
|
|
68
85
|
}, [category]);
|
|
69
|
-
return { scCategory, setSCCategory, error };
|
|
86
|
+
return { scCategory, setSCCategory, error, refreshCategory };
|
|
70
87
|
}
|
|
@@ -46,6 +46,21 @@ export default function useSCFetchCourse({ id = null, course = null, cacheStrate
|
|
|
46
46
|
return Promise.resolve(res.data);
|
|
47
47
|
});
|
|
48
48
|
}, []);
|
|
49
|
+
/**
|
|
50
|
+
* Refresh course
|
|
51
|
+
*/
|
|
52
|
+
const refreshCourse = useMemo(() => () => {
|
|
53
|
+
fetchCourse(id)
|
|
54
|
+
.then((e) => {
|
|
55
|
+
setSCCourse(e);
|
|
56
|
+
})
|
|
57
|
+
.catch((err) => {
|
|
58
|
+
LRUCache.delete(__courseCacheKey);
|
|
59
|
+
setError(`Error on refresh course with id ${id}`);
|
|
60
|
+
Logger.error(SCOPE_SC_CORE, `Error on refresh course with id ${id}`);
|
|
61
|
+
Logger.error(SCOPE_SC_CORE, err.message);
|
|
62
|
+
});
|
|
63
|
+
}, [id, __courseCacheKey, setSCCourse]);
|
|
49
64
|
/**
|
|
50
65
|
* If id attempt to get the course by id
|
|
51
66
|
*/
|
|
@@ -74,20 +89,5 @@ export default function useSCFetchCourse({ id = null, course = null, cacheStrate
|
|
|
74
89
|
setSCCourse(course);
|
|
75
90
|
}
|
|
76
91
|
}, [course, authUserId]);
|
|
77
|
-
/**
|
|
78
|
-
* Refreshes course data from the network
|
|
79
|
-
*/
|
|
80
|
-
const refreshCourse = useCallback(() => {
|
|
81
|
-
if (id) {
|
|
82
|
-
fetchCourse(id)
|
|
83
|
-
.then((e) => {
|
|
84
|
-
setSCCourse(e);
|
|
85
|
-
})
|
|
86
|
-
.catch((err) => {
|
|
87
|
-
setError(`Failed to refresh course data: ${err.message}`);
|
|
88
|
-
Logger.error(SCOPE_SC_CORE, err.message);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}, [id, fetchCourse]);
|
|
92
92
|
return { scCourse, setSCCourse, error, refreshCourse };
|
|
93
93
|
}
|