@selfcommunity/react-core 0.4.9-alpha.1 → 0.4.9-alpha.2
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/constants/Cache.d.ts +1 -0
- package/lib/cjs/constants/Cache.js +2 -1
- package/lib/cjs/constants/Routes.d.ts +1 -0
- package/lib/cjs/constants/Routes.js +3 -1
- package/lib/cjs/hooks/useSCFetchGroup.js +3 -3
- package/lib/esm/constants/Cache.d.ts +1 -0
- package/lib/esm/constants/Cache.js +1 -0
- package/lib/esm/constants/Routes.d.ts +1 -0
- package/lib/esm/constants/Routes.js +2 -0
- package/lib/esm/hooks/useSCFetchGroup.js +3 -3
- package/lib/umd/react-core.js +1 -1
- package/package.json +4 -4
|
@@ -67,4 +67,5 @@ export declare const INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = "_iSugW
|
|
|
67
67
|
export declare const POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = "_pSugWidget_";
|
|
68
68
|
export declare const GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = "_gMemWidget_";
|
|
69
69
|
export declare const GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = "_gReqWidget_";
|
|
70
|
+
export declare const GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = "_glIST_";
|
|
70
71
|
export declare const getWidgetStateCacheKey: (p: any, id?: any) => string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.PEOPLE_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_PEOPLE_TOOLS_STATE_CACHE_PREFIX_KEY = exports.RELATED_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWERS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_POPULAR_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.getPmSnippetObjectCacheKey = exports.PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY = exports.getPmSnippetsObjectCacheKey = exports.PM_SNIPPETS_OBJECT_CACHE_PREFIX_KEY = exports.getAdvObjectCacheKey = exports.ADV_OBJECT_CACHE_PREFIX_KEY = exports.getFeedSPCacheKey = exports.FEED_CACHE_SP_KEY = exports.getVirtualizedScrollStateCacheKey = exports.VIRTUALIZED_SCROLL_STATE_CACHE_PREFIX_KEY = exports.getStateFeedCacheKey = exports.FEED_STATE_CACHE_PREFIX_KEY = exports.getFeedCacheKey = exports.FEED_CACHE_PREFIX_KEY = exports.getBroadcastMessagesObjectCacheKey = exports.BROADCAST_MESSAGES_OBJECT_CACHE_PREFIX_KEY = exports.getContributorsCachePrefixKeys = exports.getContributorsCacheKey = exports.CONTRIBUTORS_CACHE_PREFIX_KEY = exports.getIncubatorObjectCacheKey = exports.INCUBATOR_OBJECT_CACHE_PREFIX_KEY = exports.getGroupObjectCacheKey = exports.GROUP_OBJECT_CACHE_PREFIX_KEY = exports.getCategoryObjectCacheKey = exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY = exports.getCategoriesObjectCacheKey = exports.CATEGORIES_OBJECT_CACHE_PREFIX_KEY = exports.getCommentObjectsCachePrefixKeys = exports.getCommentObjectsCacheKey = exports.COMMENT_OBJECTS_CACHE_PREFIX_KEY = exports.getCommentObjectCacheKey = exports.COMMENT_OBJECT_CACHE_PREFIX_KEY = exports.getFeedObjectCacheKey = exports.FEED_OBJECT_CACHE_PREFIX_KEY = void 0;
|
|
7
|
-
exports.getWidgetStateCacheKey = exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = void 0;
|
|
7
|
+
exports.getWidgetStateCacheKey = exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = void 0;
|
|
8
8
|
/** FEED OBJECT **/
|
|
9
9
|
exports.FEED_OBJECT_CACHE_PREFIX_KEY = '_fo_';
|
|
10
10
|
const getFeedObjectCacheKey = (id, type) => `${exports.FEED_OBJECT_CACHE_PREFIX_KEY}${type}_${id}`;
|
|
@@ -93,5 +93,6 @@ exports.INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_iSugWidget_';
|
|
|
93
93
|
exports.POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_pSugWidget_';
|
|
94
94
|
exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = '_gMemWidget_';
|
|
95
95
|
exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_gReqWidget_';
|
|
96
|
+
exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = '_glIST_';
|
|
96
97
|
const getWidgetStateCacheKey = (p, id = undefined) => `${p}${id !== undefined ? id : ''}`;
|
|
97
98
|
exports.getWidgetStateCacheKey = getWidgetStateCacheKey;
|
|
@@ -32,6 +32,7 @@ export declare const RECOVER_ROUTE_NAME = "recover";
|
|
|
32
32
|
export declare const CUSTOM_PAGES_ROUTE_NAME = "custom_pages";
|
|
33
33
|
export declare const LEGAL_PAGES_ROUTE_NAME = "legal_pages";
|
|
34
34
|
export declare const GROUP_ROUTE_NAME = "group";
|
|
35
|
+
export declare const GROUPS_ROUTE_NAME = "groups";
|
|
35
36
|
/**
|
|
36
37
|
* Default Routes
|
|
37
38
|
* @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}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultRoutes = exports.GROUP_ROUTE_NAME = exports.LEGAL_PAGES_ROUTE_NAME = exports.CUSTOM_PAGES_ROUTE_NAME = exports.RECOVER_ROUTE_NAME = exports.SIGNUP_ROUTE_NAME = exports.SIGNIN_ROUTE_NAME = exports.INCUBATOR_ROUTE_NAME = exports.LOYALTY_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_DISCUSSIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_POSTS_ROUTE_NAME = exports.USER_PROFILE_CATEGORIES_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_SENT_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWERS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWINGS_ROUTE_NAME = exports.USER_PRIVATE_MESSAGES_ROUTE_NAME = exports.USER_NOTIFICATIONS_ROUTE_NAME = exports.USER_PROFILE_SETTINGS_ROUTE_NAME = exports.USER_PROFILE_ROUTE_NAME = exports.CATEGORIES_LIST_ROUTE_NAME = exports.CATEGORY_TRENDING_FEED_ROUTE_NAME = exports.CATEGORY_ROUTE_NAME = exports.COMMENT_ROUTE_NAME = exports.STATUS_ROUTE_NAME = exports.DISCUSSION_ROUTE_NAME = exports.POST_ROUTE_NAME = exports.EXPLORE_ROUTE_NAME = exports.HOME_ROUTE_NAME = exports.ROUTER_OPTION = exports.PORTAL_OPTION = void 0;
|
|
3
|
+
exports.defaultRoutes = exports.GROUPS_ROUTE_NAME = exports.GROUP_ROUTE_NAME = exports.LEGAL_PAGES_ROUTE_NAME = exports.CUSTOM_PAGES_ROUTE_NAME = exports.RECOVER_ROUTE_NAME = exports.SIGNUP_ROUTE_NAME = exports.SIGNIN_ROUTE_NAME = exports.INCUBATOR_ROUTE_NAME = exports.LOYALTY_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_DISCUSSIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_POSTS_ROUTE_NAME = exports.USER_PROFILE_CATEGORIES_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_SENT_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWERS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWINGS_ROUTE_NAME = exports.USER_PRIVATE_MESSAGES_ROUTE_NAME = exports.USER_NOTIFICATIONS_ROUTE_NAME = exports.USER_PROFILE_SETTINGS_ROUTE_NAME = exports.USER_PROFILE_ROUTE_NAME = exports.CATEGORIES_LIST_ROUTE_NAME = exports.CATEGORY_TRENDING_FEED_ROUTE_NAME = exports.CATEGORY_ROUTE_NAME = exports.COMMENT_ROUTE_NAME = exports.STATUS_ROUTE_NAME = exports.DISCUSSION_ROUTE_NAME = exports.POST_ROUTE_NAME = exports.EXPLORE_ROUTE_NAME = exports.HOME_ROUTE_NAME = exports.ROUTER_OPTION = exports.PORTAL_OPTION = void 0;
|
|
4
4
|
exports.PORTAL_OPTION = 'portal';
|
|
5
5
|
exports.ROUTER_OPTION = 'router';
|
|
6
6
|
/**
|
|
@@ -35,6 +35,7 @@ exports.RECOVER_ROUTE_NAME = 'recover';
|
|
|
35
35
|
exports.CUSTOM_PAGES_ROUTE_NAME = 'custom_pages';
|
|
36
36
|
exports.LEGAL_PAGES_ROUTE_NAME = 'legal_pages';
|
|
37
37
|
exports.GROUP_ROUTE_NAME = 'group';
|
|
38
|
+
exports.GROUPS_ROUTE_NAME = 'groups';
|
|
38
39
|
/**
|
|
39
40
|
* Default Routes
|
|
40
41
|
* @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}}
|
|
@@ -69,4 +70,5 @@ exports.defaultRoutes = {
|
|
|
69
70
|
[exports.CUSTOM_PAGES_ROUTE_NAME]: '/:id/:slug/',
|
|
70
71
|
[exports.LEGAL_PAGES_ROUTE_NAME]: '/legal/:policy/',
|
|
71
72
|
[exports.GROUP_ROUTE_NAME]: '/group/:id/',
|
|
73
|
+
[exports.GROUPS_ROUTE_NAME]: '/groups/',
|
|
72
74
|
};
|
|
@@ -23,7 +23,7 @@ function useSCFetchGroup({ id = null, group = null, cacheStrategy = utils_1.Cach
|
|
|
23
23
|
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
24
24
|
// CACHE
|
|
25
25
|
const __groupCacheKey = (0, Cache_1.getGroupObjectCacheKey)(__groupId);
|
|
26
|
-
const __group = authUserId ? group : (0, utils_1.objectWithoutProperties)(group, ['
|
|
26
|
+
const __group = authUserId ? group : (0, utils_1.objectWithoutProperties)(group, ['subscription_status']);
|
|
27
27
|
const [scGroup, setSCGroup] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__groupCacheKey, __group) : null);
|
|
28
28
|
const [error, setError] = (0, react_1.useState)(null);
|
|
29
29
|
/**
|
|
@@ -49,7 +49,7 @@ function useSCFetchGroup({ id = null, group = null, cacheStrategy = utils_1.Cach
|
|
|
49
49
|
if (__groupId && (!scGroup || (scGroup && __groupId !== scGroup.id))) {
|
|
50
50
|
fetchGroup()
|
|
51
51
|
.then((obj) => {
|
|
52
|
-
const _c = authUserId ? obj : (0, utils_1.objectWithoutProperties)(obj, ['
|
|
52
|
+
const _c = authUserId ? obj : (0, utils_1.objectWithoutProperties)(obj, ['subscription_status']);
|
|
53
53
|
setSCGroup(_c);
|
|
54
54
|
utils_1.LRUCache.set(__groupCacheKey, _c);
|
|
55
55
|
})
|
|
@@ -63,7 +63,7 @@ function useSCFetchGroup({ id = null, group = null, cacheStrategy = utils_1.Cach
|
|
|
63
63
|
}, [__groupId]);
|
|
64
64
|
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
65
65
|
if (group) {
|
|
66
|
-
const _c = authUserId ? group : (0, utils_1.objectWithoutProperties)(group, ['
|
|
66
|
+
const _c = authUserId ? group : (0, utils_1.objectWithoutProperties)(group, ['subscription_status']);
|
|
67
67
|
setSCGroup(_c);
|
|
68
68
|
utils_1.LRUCache.set(__groupCacheKey, _c);
|
|
69
69
|
}
|
|
@@ -67,4 +67,5 @@ export declare const INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = "_iSugW
|
|
|
67
67
|
export declare const POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = "_pSugWidget_";
|
|
68
68
|
export declare const GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = "_gMemWidget_";
|
|
69
69
|
export declare const GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = "_gReqWidget_";
|
|
70
|
+
export declare const GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = "_glIST_";
|
|
70
71
|
export declare const getWidgetStateCacheKey: (p: any, id?: any) => string;
|
|
@@ -71,4 +71,5 @@ export const INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_iSugWidget_';
|
|
|
71
71
|
export const POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_pSugWidget_';
|
|
72
72
|
export const GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = '_gMemWidget_';
|
|
73
73
|
export const GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_gReqWidget_';
|
|
74
|
+
export const GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = '_glIST_';
|
|
74
75
|
export const getWidgetStateCacheKey = (p, id = undefined) => `${p}${id !== undefined ? id : ''}`;
|
|
@@ -32,6 +32,7 @@ export declare const RECOVER_ROUTE_NAME = "recover";
|
|
|
32
32
|
export declare const CUSTOM_PAGES_ROUTE_NAME = "custom_pages";
|
|
33
33
|
export declare const LEGAL_PAGES_ROUTE_NAME = "legal_pages";
|
|
34
34
|
export declare const GROUP_ROUTE_NAME = "group";
|
|
35
|
+
export declare const GROUPS_ROUTE_NAME = "groups";
|
|
35
36
|
/**
|
|
36
37
|
* Default Routes
|
|
37
38
|
* @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}}
|
|
@@ -32,6 +32,7 @@ export const RECOVER_ROUTE_NAME = 'recover';
|
|
|
32
32
|
export const CUSTOM_PAGES_ROUTE_NAME = 'custom_pages';
|
|
33
33
|
export const LEGAL_PAGES_ROUTE_NAME = 'legal_pages';
|
|
34
34
|
export const GROUP_ROUTE_NAME = 'group';
|
|
35
|
+
export const GROUPS_ROUTE_NAME = 'groups';
|
|
35
36
|
/**
|
|
36
37
|
* Default Routes
|
|
37
38
|
* @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}}
|
|
@@ -66,4 +67,5 @@ export const defaultRoutes = {
|
|
|
66
67
|
[CUSTOM_PAGES_ROUTE_NAME]: '/:id/:slug/',
|
|
67
68
|
[LEGAL_PAGES_ROUTE_NAME]: '/legal/:policy/',
|
|
68
69
|
[GROUP_ROUTE_NAME]: '/group/:id/',
|
|
70
|
+
[GROUPS_ROUTE_NAME]: '/groups/',
|
|
69
71
|
};
|
|
@@ -21,7 +21,7 @@ export default function useSCFetchGroup({ id = null, group = null, cacheStrategy
|
|
|
21
21
|
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
22
22
|
// CACHE
|
|
23
23
|
const __groupCacheKey = getGroupObjectCacheKey(__groupId);
|
|
24
|
-
const __group = authUserId ? group : objectWithoutProperties(group, ['
|
|
24
|
+
const __group = authUserId ? group : objectWithoutProperties(group, ['subscription_status']);
|
|
25
25
|
const [scGroup, setSCGroup] = useState(cacheStrategy !== CacheStrategies.NETWORK_ONLY ? LRUCache.get(__groupCacheKey, __group) : null);
|
|
26
26
|
const [error, setError] = useState(null);
|
|
27
27
|
/**
|
|
@@ -47,7 +47,7 @@ export default function useSCFetchGroup({ id = null, group = null, cacheStrategy
|
|
|
47
47
|
if (__groupId && (!scGroup || (scGroup && __groupId !== scGroup.id))) {
|
|
48
48
|
fetchGroup()
|
|
49
49
|
.then((obj) => {
|
|
50
|
-
const _c = authUserId ? obj : objectWithoutProperties(obj, ['
|
|
50
|
+
const _c = authUserId ? obj : objectWithoutProperties(obj, ['subscription_status']);
|
|
51
51
|
setSCGroup(_c);
|
|
52
52
|
LRUCache.set(__groupCacheKey, _c);
|
|
53
53
|
})
|
|
@@ -61,7 +61,7 @@ export default function useSCFetchGroup({ id = null, group = null, cacheStrategy
|
|
|
61
61
|
}, [__groupId]);
|
|
62
62
|
useDeepCompareEffectNoCheck(() => {
|
|
63
63
|
if (group) {
|
|
64
|
-
const _c = authUserId ? group : objectWithoutProperties(group, ['
|
|
64
|
+
const _c = authUserId ? group : objectWithoutProperties(group, ['subscription_status']);
|
|
65
65
|
setSCGroup(_c);
|
|
66
66
|
LRUCache.set(__groupCacheKey, _c);
|
|
67
67
|
}
|