@selfcommunity/react-core 0.5.0-embeds.17 → 0.5.0-live.102
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/SCRoutingProvider/index.js +1 -0
- package/lib/cjs/constants/Cache.d.ts +5 -0
- package/lib/cjs/constants/Cache.js +8 -2
- package/lib/cjs/constants/Notification.d.ts +1 -0
- package/lib/cjs/constants/Notification.js +2 -1
- package/lib/cjs/constants/Preferences.d.ts +7 -1
- package/lib/cjs/constants/Preferences.js +17 -5
- package/lib/cjs/constants/Routes.d.ts +1 -0
- package/lib/cjs/constants/Routes.js +3 -1
- package/lib/cjs/hooks/useSCFetchEvent.d.ts +1 -1
- package/lib/cjs/hooks/useSCFetchEvent.js +38 -28
- package/lib/cjs/hooks/useSCFetchLiveStream.d.ts +20 -0
- package/lib/cjs/hooks/useSCFetchLiveStream.js +76 -0
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.js +4 -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/usePageVisibility.d.ts +2 -0
- package/lib/cjs/utils/hooks/usePageVisibility.js +17 -0
- package/lib/cjs/utils/validator.js +1 -2
- package/lib/esm/components/provider/SCRoutingProvider/index.js +2 -1
- package/lib/esm/constants/Cache.d.ts +5 -0
- package/lib/esm/constants/Cache.js +5 -0
- package/lib/esm/constants/Notification.d.ts +1 -0
- package/lib/esm/constants/Notification.js +2 -1
- package/lib/esm/constants/Preferences.d.ts +7 -1
- package/lib/esm/constants/Preferences.js +14 -2
- package/lib/esm/constants/Routes.d.ts +1 -0
- package/lib/esm/constants/Routes.js +2 -0
- package/lib/esm/hooks/useSCFetchEvent.d.ts +1 -1
- package/lib/esm/hooks/useSCFetchEvent.js +38 -28
- package/lib/esm/hooks/useSCFetchLiveStream.d.ts +20 -0
- package/lib/esm/hooks/useSCFetchLiveStream.js +73 -0
- package/lib/esm/index.d.ts +3 -2
- package/lib/esm/index.js +3 -2
- package/lib/esm/utils/hooks/index.d.ts +2 -1
- package/lib/esm/utils/hooks/index.js +2 -1
- package/lib/esm/utils/hooks/usePageVisibility.d.ts +2 -0
- package/lib/esm/utils/hooks/usePageVisibility.js +15 -0
- package/lib/esm/utils/validator.js +1 -2
- package/lib/umd/react-core.js +1 -1
- package/lib/umd/react-core.js.LICENSE.txt +2 -0
- package/package.json +132 -127
|
@@ -74,6 +74,7 @@ function SCRoutingProvider({ children = null }) {
|
|
|
74
74
|
[Routes_1.USER_NOTIFICATIONS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS].value),
|
|
75
75
|
[Routes_1.USER_PRIVATE_MESSAGES_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES].value),
|
|
76
76
|
[Routes_1.INCUBATOR_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR].value),
|
|
77
|
+
[Routes_1.LIVESTREAM_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM].value),
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
80
|
return {};
|
|
@@ -23,6 +23,9 @@ export declare const getEventObjectCacheKey: (id: any) => string;
|
|
|
23
23
|
/** EVENTS OBJECT **/
|
|
24
24
|
export declare const EVENTS_OBJECT_CACHE_PREFIX_KEY = "_evts_";
|
|
25
25
|
export declare const getEventsObjectCacheKey: () => string;
|
|
26
|
+
/** EVENT OBJECT **/
|
|
27
|
+
export declare const LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = "_liveStream_";
|
|
28
|
+
export declare const getLiveStreamObjectCacheKey: (id: any) => string;
|
|
26
29
|
/** GROUP OBJECT **/
|
|
27
30
|
export declare const GROUP_OBJECT_CACHE_PREFIX_KEY = "_grp_";
|
|
28
31
|
export declare const getGroupObjectCacheKey: (id: any) => string;
|
|
@@ -69,6 +72,8 @@ export declare const USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = "_uOtherEvents_"
|
|
|
69
72
|
export declare const USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uPartecipantsEvents_";
|
|
70
73
|
export declare const USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = "_uInvitedEvents_";
|
|
71
74
|
export declare const USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uRequestsEvents_";
|
|
75
|
+
export declare const USER_LIVE_STREAM_CACHE_PREFIX_KEY = "_uUserLives_";
|
|
76
|
+
export declare const EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = "_eMedia_";
|
|
72
77
|
export declare const USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConWidget_";
|
|
73
78
|
export declare const USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConReqWidget_";
|
|
74
79
|
export declare const USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConReqSentWidget_";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Cache prefixes
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.getWidgetStateCacheKey = exports.GROUPS_SUBSCRIBED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = 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_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = void 0;
|
|
6
|
+
exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_EVENTS_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.getGroupsObjectCacheKey = exports.GROUPS_OBJECT_CACHE_PREFIX_KEY = exports.getGroupObjectCacheKey = exports.GROUP_OBJECT_CACHE_PREFIX_KEY = exports.getLiveStreamObjectCacheKey = exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = exports.getEventsObjectCacheKey = exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = exports.getEventObjectCacheKey = exports.EVENT_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.GROUPS_SUBSCRIBED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = 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.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = exports.USER_LIVE_STREAM_CACHE_PREFIX_KEY = exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_PARTECIPANTS_EVENTS_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}`;
|
|
@@ -35,6 +35,10 @@ exports.getEventObjectCacheKey = getEventObjectCacheKey;
|
|
|
35
35
|
exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = '_evts_';
|
|
36
36
|
const getEventsObjectCacheKey = () => `${exports.EVENTS_OBJECT_CACHE_PREFIX_KEY}`;
|
|
37
37
|
exports.getEventsObjectCacheKey = getEventsObjectCacheKey;
|
|
38
|
+
/** EVENT OBJECT **/
|
|
39
|
+
exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = '_liveStream_';
|
|
40
|
+
const getLiveStreamObjectCacheKey = (id) => `${exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
41
|
+
exports.getLiveStreamObjectCacheKey = getLiveStreamObjectCacheKey;
|
|
38
42
|
/** GROUP OBJECT **/
|
|
39
43
|
exports.GROUP_OBJECT_CACHE_PREFIX_KEY = '_grp_';
|
|
40
44
|
const getGroupObjectCacheKey = (id) => `${exports.GROUP_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
@@ -98,6 +102,8 @@ exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = '_uOtherEvents_';
|
|
|
98
102
|
exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uPartecipantsEvents_';
|
|
99
103
|
exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = '_uInvitedEvents_';
|
|
100
104
|
exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uRequestsEvents_';
|
|
105
|
+
exports.USER_LIVE_STREAM_CACHE_PREFIX_KEY = '_uUserLives_';
|
|
106
|
+
exports.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = '_eMedia_';
|
|
101
107
|
exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConWidget_';
|
|
102
108
|
exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqWidget_';
|
|
103
109
|
exports.USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqSentWidget_';
|
|
@@ -21,6 +21,7 @@ export declare const SCNotificationMapping: {
|
|
|
21
21
|
16: SCNotificationTypologyType;
|
|
22
22
|
37: SCNotificationTypologyType;
|
|
23
23
|
105: SCNotificationTypologyType;
|
|
24
|
+
26: SCNotificationTypologyType;
|
|
24
25
|
50: SCNotificationTypologyType;
|
|
25
26
|
51: SCNotificationTypologyType;
|
|
26
27
|
52: SCNotificationTypologyType;
|
|
@@ -24,6 +24,7 @@ exports.SCNotificationMapping = {
|
|
|
24
24
|
16: types_1.SCNotificationTypologyType.FOLLOW,
|
|
25
25
|
37: types_1.SCNotificationTypologyType.PRIVATE_MESSAGE,
|
|
26
26
|
105: types_1.SCNotificationTypologyType.DELETE_PRIVATE_MESSAGE,
|
|
27
|
+
26: types_1.SCNotificationTypologyType.LIVE_STREAM_STARTED,
|
|
27
28
|
50: types_1.SCNotificationTypologyType.DELETED_FOR_ADVERTISING,
|
|
28
29
|
51: types_1.SCNotificationTypologyType.DELETED_FOR_AGGRESSIVE,
|
|
29
30
|
52: types_1.SCNotificationTypologyType.DELETED_FOR_VULGAR,
|
|
@@ -50,7 +51,7 @@ exports.SCNotificationMapping = {
|
|
|
50
51
|
31: types_1.SCNotificationTypologyType.USER_INVITED_TO_JOIN_GROUP,
|
|
51
52
|
32: types_1.SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP,
|
|
52
53
|
33: types_1.SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP,
|
|
53
|
-
34: types_1.SCNotificationTypologyType.USER_ADDED_TO_GROUP
|
|
54
|
+
34: types_1.SCNotificationTypologyType.USER_ADDED_TO_GROUP,
|
|
54
55
|
};
|
|
55
56
|
/**
|
|
56
57
|
* Silent Snippet Notifications
|
|
@@ -70,7 +70,7 @@ export declare const POINTS_DAILY_VISIT: string;
|
|
|
70
70
|
/**
|
|
71
71
|
* ADDONS
|
|
72
72
|
*/
|
|
73
|
-
export declare const
|
|
73
|
+
export declare const ADDONS_AFFINITY_ENABLED: string;
|
|
74
74
|
export declare const ADDONS_CLOSED_COMMUNITY: string;
|
|
75
75
|
export declare const ADDONS_INCUBATOR_ENABLED: string;
|
|
76
76
|
export declare const ADDONS_INCUBATOR_SUBSCRIBERS: string;
|
|
@@ -117,6 +117,7 @@ export declare const CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS: string;
|
|
|
117
117
|
export declare const CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS: string;
|
|
118
118
|
export declare const CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES: string;
|
|
119
119
|
export declare const CONFIGURATIONS_URL_TEMPLATE_INCUBATOR: string;
|
|
120
|
+
export declare const CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM: string;
|
|
120
121
|
export declare const CONFIGURATIONS_APP_URL: string;
|
|
121
122
|
export declare const CONFIGURATIONS_USER_METADATA_DEFINITIONS: string;
|
|
122
123
|
export declare const CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID: string;
|
|
@@ -134,6 +135,11 @@ export declare const CONFIGURATIONS_EVENTS_ENABLED: string;
|
|
|
134
135
|
export declare const CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED: string;
|
|
135
136
|
export declare const CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED: string;
|
|
136
137
|
export declare const CONFIGURATIONS_EVENTS_PRIVATE_ENABLED: string;
|
|
138
|
+
export declare const CONFIGURATIONS_ONBOARDING_ENABLED: string;
|
|
139
|
+
export declare const CONFIGURATIONS_ONBOARDING_HIDDEN: string;
|
|
140
|
+
export declare const CONFIGURATIONS_LIVE_STREAM_ENABLED: string;
|
|
141
|
+
export declare const CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED: string;
|
|
142
|
+
export declare const CONFIGURATIONS_SUBSCRIPTION_TIER: string;
|
|
137
143
|
/**
|
|
138
144
|
* PROVIDERS
|
|
139
145
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED = exports.ADDONS_POST_GEOLOCATION_ENABLED = exports.ADDONS_REGISTRATION_WIZARD = exports.ADDONS_POLLS_ENABLED = exports.ADDONS_LOYALTY_POINTS_COLLECTION = exports.ADDONS_INCUBATOR_SUBSCRIBERS = exports.ADDONS_INCUBATOR_ENABLED = exports.ADDONS_CLOSED_COMMUNITY = exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.DATA_TYPES = exports.getPreference = exports.getPreferenceName = exports.getPreferenceSection = exports.WEBMASTER_META_DESCRIPTION = exports.WEBMASTER_META_TITLE_HOME_NOT_LOGGED = exports.WEBMASTER_META_ROBOTS = exports.PROVIDERS_WEB_PUSH_ENABLED = exports.PROVIDERS_WEB_PUSH_PUBLIC_KEY = exports.PROVIDERS_GOOGLE_APP_SECRET = exports.PROVIDERS_GOOGLE_APP_KEY = exports.PROVIDERS_GOOGLE_SIGNIN_ENABLED = exports.PROVIDERS_GOOGLE_GEOCODING_API_KEY = exports.PROVIDERS_TWITTER_APP_SECRET = exports.PROVIDERS_TWITTER_APP_KEY = exports.PROVIDERS_TWITTER_SIGNIN_ENABLED = exports.PROVIDERS_LINKEDIN_APP_SECRET = exports.PROVIDERS_LINKEDIN_APP_KEY = exports.PROVIDERS_LINKEDIN_SIGNIN_ENABLED = exports.PROVIDERS_FACEBOOK_APP_SECRET = exports.PROVIDERS_FACEBOOK_APP_KEY = exports.PROVIDERS_FACEBOOK_SIGNIN_ENABLED = exports.PROVIDERS_APP_URL_ON_GOOGLE_PLAY = void 0;
|
|
3
|
+
exports.ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED = exports.ADDONS_POST_GEOLOCATION_ENABLED = exports.ADDONS_REGISTRATION_WIZARD = exports.ADDONS_POLLS_ENABLED = exports.ADDONS_LOYALTY_POINTS_COLLECTION = exports.ADDONS_INCUBATOR_SUBSCRIBERS = exports.ADDONS_INCUBATOR_ENABLED = exports.ADDONS_CLOSED_COMMUNITY = exports.ADDONS_AFFINITY_ENABLED = exports.POINTS_DAILY_VISIT = exports.POINTS_APP_USED = exports.POINTS_SOCIAL_SHARE = exports.POINTS_CONNECTION_OR_FOLLOWER = exports.POINTS_RECEIVE_VOTE = exports.POINTS_MAKE_COMMENT = exports.POINTS_MAKE_POST = exports.POINTS_MAKE_DISCUSSION = exports.LOYALTY_PRIZE_C_IMAGE = exports.LOYALTY_PRIZE_B_IMAGE = exports.LOYALTY_PRIZE_A_IMAGE = exports.STAFF_STAFF_BADGE_LABEL = exports.STAFF_STAFF_BADGE_ICON = exports.IMAGES_ERRORPAGES_IMAGE = exports.IMAGES_ERROR_503 = exports.IMAGES_ERROR_404 = exports.IMAGES_USER_DEFAULT_COVER = exports.IMAGES_APP_ICON = exports.COVERS_VISIBILITY = exports.COVERS_COVER_4_HP_M1920 = exports.COVERS_COVER_3_HP_M1920 = exports.COVERS_COVER_2_HP_M1920 = exports.COVERS_COVER_1_HP_M1920 = exports.COLORS_COLORFONTSECONDARY = exports.COLORS_COLORFONT = exports.COLORS_NAVBARBACK = exports.COLORS_COLORSECONDARY = exports.COLORS_COLORPRIMARY = exports.COLORS_COLORBACK = exports.LOGO_NAVBAR_LOGO_MOBILE = exports.LOGO_NAVBAR_LOGO = exports.STYLE_FONT_FAMILY = exports.TEXT_ERROR_PAGES_SUBTITLE = exports.TEXT_ERROR_PAGES_TITLE = exports.TEXT_APPLICATION_COPYRIGHT = exports.TEXT_APPLICATION_SLOGAN2 = exports.TEXT_APPLICATION_SLOGAN1 = exports.TEXT_APPLICATION_NAME = exports.DEFAULT_GLOBAL_PREFERENCES_OPTION = exports.GLOBAL_PREFERENCES_OPTION = exports.PREFERENCES_OPTION = void 0;
|
|
4
|
+
exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_EVENTS_ENABLED = exports.CONFIGURATIONS_GROUPS_PRIVATE_ENABLED = exports.CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_GROUPS_ENABLED = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED = exports.CONFIGURATIONS_GDPR_SIGNUP_ACCEPT_HTML = exports.CONFIGURATIONS_GDPR_COOKIE_CONSENT_EXTERNAL_HTML = exports.CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID = exports.CONFIGURATIONS_USER_METADATA_DEFINITIONS = exports.CONFIGURATIONS_APP_URL = exports.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM = exports.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES = exports.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE = exports.CONFIGURATIONS_URL_TEMPLATE_CATEGORIES_LIST = exports.CONFIGURATIONS_URL_TEMPLATE_CATEGORY = exports.CONFIGURATIONS_URL_TEMPLATE_COMMENT = exports.CONFIGURATIONS_URL_TEMPLATE_STATUS = exports.CONFIGURATIONS_URL_TEMPLATE_DISCUSSION = exports.CONFIGURATIONS_URL_TEMPLATE_POST = exports.CONFIGURATIONS_URL_TEMPLATE_VERIFY_EMAIL = exports.CONFIGURATIONS_URL_TEMPLATE_PASSWORD_RECOVER = exports.CONFIGURATIONS_URL_TEMPLATE_EMAIL_UNSUBSCRIBE = exports.CONFIGURATIONS_URL_TEMPLATE_EMAIL_SETTINGS = exports.CONFIGURATIONS_STATUS_TYPE_ENABLED = exports.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED = exports.CONFIGURATIONS_POST_TYPE_ENABLED = exports.CONFIGURATIONS_USERS_APPROVAL_ENABLED = exports.CONFIGURATIONS_CONTENT_AVAILABILITY = exports.CONFIGURATIONS_STREAM_QUALITY = exports.CONFIGURATIONS_POST_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_PEOPLE_SEARCH_ENABLED = exports.CONFIGURATIONS_MANUAL_CATEGORIES_ORDER_ENABLED = exports.CONFIGURATIONS_HOME_STREAM_ORDER_BY = exports.CONFIGURATIONS_EXPLORE_STREAM_ORDER_BY = exports.CONFIGURATIONS_EXPLORE_STREAM_ENABLED = exports.CONFIGURATIONS_FOLLOW_ENABLED = exports.ADVERTISING_CUSTOM_ADV_ONLY_FOR_ANONYMOUS_USERS_ENABLED = exports.ADVERTISING_CUSTOM_ADV_ENABLED = exports.ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED = exports.ADDONS_SHARE_POST_ON_TWITTER_ENABLED = void 0;
|
|
5
|
+
exports.DATA_TYPES = exports.getPreference = exports.getPreferenceName = exports.getPreferenceSection = exports.WEBMASTER_META_DESCRIPTION = exports.WEBMASTER_META_TITLE_HOME_NOT_LOGGED = exports.WEBMASTER_META_ROBOTS = exports.PROVIDERS_WEB_PUSH_ENABLED = exports.PROVIDERS_WEB_PUSH_PUBLIC_KEY = exports.PROVIDERS_GOOGLE_APP_SECRET = exports.PROVIDERS_GOOGLE_APP_KEY = exports.PROVIDERS_GOOGLE_SIGNIN_ENABLED = exports.PROVIDERS_GOOGLE_GEOCODING_API_KEY = exports.PROVIDERS_TWITTER_APP_SECRET = exports.PROVIDERS_TWITTER_APP_KEY = exports.PROVIDERS_TWITTER_SIGNIN_ENABLED = exports.PROVIDERS_LINKEDIN_APP_SECRET = exports.PROVIDERS_LINKEDIN_APP_KEY = exports.PROVIDERS_LINKEDIN_SIGNIN_ENABLED = exports.PROVIDERS_FACEBOOK_APP_SECRET = exports.PROVIDERS_FACEBOOK_APP_KEY = exports.PROVIDERS_FACEBOOK_SIGNIN_ENABLED = exports.PROVIDERS_APP_URL_ON_GOOGLE_PLAY = exports.PROVIDERS_APP_URL_ON_APP_STORE = exports.CONFIGURATIONS_SUBSCRIPTION_TIER = exports.CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_LIVE_STREAM_ENABLED = exports.CONFIGURATIONS_ONBOARDING_HIDDEN = exports.CONFIGURATIONS_ONBOARDING_ENABLED = void 0;
|
|
6
6
|
const types_1 = require("@selfcommunity/types");
|
|
7
7
|
/**
|
|
8
8
|
* DEFAULT CONF VALIDATION OPTION
|
|
@@ -76,7 +76,7 @@ exports.POINTS_DAILY_VISIT = `${types_1.SCPreferenceSection.LOYALTY}.${types_1.S
|
|
|
76
76
|
/**
|
|
77
77
|
* ADDONS
|
|
78
78
|
*/
|
|
79
|
-
exports.
|
|
79
|
+
exports.ADDONS_AFFINITY_ENABLED = `${types_1.SCPreferenceSection.ADDONS}.${types_1.SCPreferenceName.AFFINITY_ENABLED}`;
|
|
80
80
|
exports.ADDONS_CLOSED_COMMUNITY = `${types_1.SCPreferenceSection.ADDONS}.${types_1.SCPreferenceName.CLOSED_COMMUNITY}`;
|
|
81
81
|
exports.ADDONS_INCUBATOR_ENABLED = `${types_1.SCPreferenceSection.ADDONS}.${types_1.SCPreferenceName.INCUBATOR_ENABLED}`;
|
|
82
82
|
exports.ADDONS_INCUBATOR_SUBSCRIBERS = `${types_1.SCPreferenceSection.ADDONS}.${types_1.SCPreferenceName.INCUBATOR_SUBSCRIBERS}`;
|
|
@@ -123,6 +123,7 @@ exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS = `${types_1.SCPrefere
|
|
|
123
123
|
exports.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_NOTIFICATIONS}`;
|
|
124
124
|
exports.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_USER_PRIVATE_MESSAGES}`;
|
|
125
125
|
exports.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_INCUBATOR}`;
|
|
126
|
+
exports.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_LIVE_STREAM}`;
|
|
126
127
|
exports.CONFIGURATIONS_APP_URL = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.APP_URL}`;
|
|
127
128
|
exports.CONFIGURATIONS_USER_METADATA_DEFINITIONS = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.USER_METADATA_DEFINITIONS}`;
|
|
128
129
|
exports.CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.TAG_MANAGER_CONTAINER_ID}`;
|
|
@@ -140,6 +141,11 @@ exports.CONFIGURATIONS_EVENTS_ENABLED = `${types_1.SCPreferenceSection.CONFIGURA
|
|
|
140
141
|
exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.EVENTS_ONLY_STAFF_ENABLED}`;
|
|
141
142
|
exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.EVENTS_VISIBILITY_ENABLED}`;
|
|
142
143
|
exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.EVENTS_PRIVATE_ENABLED}`;
|
|
144
|
+
exports.CONFIGURATIONS_ONBOARDING_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.ONBOARDING_ENABLED}`;
|
|
145
|
+
exports.CONFIGURATIONS_ONBOARDING_HIDDEN = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.ONBOARDING_HIDDEN}`;
|
|
146
|
+
exports.CONFIGURATIONS_LIVE_STREAM_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.LIVE_STREAM_ENABLED}`;
|
|
147
|
+
exports.CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.LIVE_STREAM_ONLY_STAFF_ENABLED}`;
|
|
148
|
+
exports.CONFIGURATIONS_SUBSCRIPTION_TIER = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.SUBSCRIPTION_TIER}`;
|
|
143
149
|
/**
|
|
144
150
|
* PROVIDERS
|
|
145
151
|
*/
|
|
@@ -232,7 +238,7 @@ exports.DATA_TYPES = {
|
|
|
232
238
|
[exports.LOYALTY_PRIZE_A_IMAGE]: stringType,
|
|
233
239
|
[exports.LOYALTY_PRIZE_B_IMAGE]: stringType,
|
|
234
240
|
[exports.LOYALTY_PRIZE_C_IMAGE]: stringType,
|
|
235
|
-
[exports.
|
|
241
|
+
[exports.ADDONS_AFFINITY_ENABLED]: booleanType,
|
|
236
242
|
[exports.ADDONS_CLOSED_COMMUNITY]: booleanType,
|
|
237
243
|
[exports.ADDONS_INCUBATOR_ENABLED]: booleanType,
|
|
238
244
|
[exports.ADDONS_INCUBATOR_SUBSCRIBERS]: integerType,
|
|
@@ -270,6 +276,7 @@ exports.DATA_TYPES = {
|
|
|
270
276
|
[exports.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS]: stringType,
|
|
271
277
|
[exports.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES]: stringType,
|
|
272
278
|
[exports.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR]: stringType,
|
|
279
|
+
[exports.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM]: stringType,
|
|
273
280
|
[exports.CONFIGURATIONS_APP_URL]: stringType,
|
|
274
281
|
[exports.CONFIGURATIONS_USER_METADATA_DEFINITIONS]: stringType,
|
|
275
282
|
[exports.CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID]: stringType,
|
|
@@ -287,6 +294,11 @@ exports.DATA_TYPES = {
|
|
|
287
294
|
[exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED]: booleanType,
|
|
288
295
|
[exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED]: booleanType,
|
|
289
296
|
[exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED]: booleanType,
|
|
297
|
+
[exports.CONFIGURATIONS_ONBOARDING_ENABLED]: booleanType,
|
|
298
|
+
[exports.CONFIGURATIONS_ONBOARDING_HIDDEN]: booleanType,
|
|
299
|
+
[exports.CONFIGURATIONS_LIVE_STREAM_ENABLED]: booleanType,
|
|
300
|
+
[exports.CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED]: booleanType,
|
|
301
|
+
[exports.CONFIGURATIONS_SUBSCRIPTION_TIER]: stringType,
|
|
290
302
|
[exports.PROVIDERS_APP_URL_ON_APP_STORE]: stringType,
|
|
291
303
|
[exports.PROVIDERS_APP_URL_ON_GOOGLE_PLAY]: stringType,
|
|
292
304
|
[exports.PROVIDERS_FACEBOOK_SIGNIN_ENABLED]: stringType,
|
|
@@ -41,6 +41,7 @@ export declare const EVENTS_ROUTE_NAME = "events";
|
|
|
41
41
|
export declare const EVENTS_SUGGESTED_ROUTE_NAME = "events_suggested";
|
|
42
42
|
export declare const EVENTS_SUBSCRIBED_ROUTE_NAME = "events_subscribed";
|
|
43
43
|
export declare const EVENTS_HIGHLIGHT_ROUTE_NAME = "events_highlight";
|
|
44
|
+
export declare const LIVESTREAM_ROUTE_NAME = "live";
|
|
44
45
|
/**
|
|
45
46
|
* Default Routes
|
|
46
47
|
* @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.EVENTS_HIGHLIGHT_ROUTE_NAME = exports.EVENTS_SUBSCRIBED_ROUTE_NAME = exports.EVENTS_SUGGESTED_ROUTE_NAME = exports.EVENTS_ROUTE_NAME = exports.EVENT_ROUTE_NAME = exports.GROUPS_SUBSCRIBED_ROUTE_NAME = exports.GROUPS_ROUTE_NAME = exports.GROUP_MESSAGES_ROUTE_NAME = exports.GROUP_MEMBERS_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;
|
|
3
|
+
exports.defaultRoutes = exports.LIVESTREAM_ROUTE_NAME = exports.EVENTS_HIGHLIGHT_ROUTE_NAME = exports.EVENTS_SUBSCRIBED_ROUTE_NAME = exports.EVENTS_SUGGESTED_ROUTE_NAME = exports.EVENTS_ROUTE_NAME = exports.EVENT_ROUTE_NAME = exports.GROUPS_SUBSCRIBED_ROUTE_NAME = exports.GROUPS_ROUTE_NAME = exports.GROUP_MESSAGES_ROUTE_NAME = exports.GROUP_MEMBERS_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
|
/**
|
|
@@ -44,6 +44,7 @@ exports.EVENTS_ROUTE_NAME = 'events';
|
|
|
44
44
|
exports.EVENTS_SUGGESTED_ROUTE_NAME = 'events_suggested';
|
|
45
45
|
exports.EVENTS_SUBSCRIBED_ROUTE_NAME = 'events_subscribed';
|
|
46
46
|
exports.EVENTS_HIGHLIGHT_ROUTE_NAME = 'events_highlight';
|
|
47
|
+
exports.LIVESTREAM_ROUTE_NAME = 'live';
|
|
47
48
|
/**
|
|
48
49
|
* Default Routes
|
|
49
50
|
* @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}}
|
|
@@ -87,4 +88,5 @@ exports.defaultRoutes = {
|
|
|
87
88
|
[exports.EVENT_ROUTE_NAME]: '/event/:id/:slug/',
|
|
88
89
|
[exports.EVENTS_SUBSCRIBED_ROUTE_NAME]: '/events/subscribed/',
|
|
89
90
|
[exports.EVENTS_HIGHLIGHT_ROUTE_NAME]: '/events/highlight/',
|
|
91
|
+
[exports.LIVESTREAM_ROUTE_NAME]: '/live/:slug/',
|
|
90
92
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_1 = require("react");
|
|
4
|
-
const Errors_1 = require("../constants/Errors");
|
|
5
|
-
const types_1 = require("@selfcommunity/types");
|
|
6
3
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
4
|
+
const types_1 = require("@selfcommunity/types");
|
|
7
5
|
const utils_1 = require("@selfcommunity/utils");
|
|
8
|
-
const
|
|
6
|
+
const react_1 = require("react");
|
|
9
7
|
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
10
8
|
const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
9
|
+
const Cache_1 = require("../constants/Cache");
|
|
10
|
+
const Errors_1 = require("../constants/Errors");
|
|
11
11
|
/**
|
|
12
12
|
:::info
|
|
13
13
|
This custom hook is used to fetch an event object.
|
|
@@ -28,18 +28,39 @@ function useSCFetchEvent({ id = null, event = null, autoSubscribe = true, cacheS
|
|
|
28
28
|
const __event = authUserId ? event : (0, utils_1.objectWithoutProperties)(event, ['subscription_status']);
|
|
29
29
|
const [scEvent, setScEvent] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__eventCacheKey, __event) : null);
|
|
30
30
|
const [error, setError] = (0, react_1.useState)(null);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Memoized setSCEvent (auto-subscription if need it)
|
|
33
|
+
*/
|
|
34
|
+
const setSCEvent = (0, react_1.useMemo)(() => (e) => {
|
|
35
|
+
if (autoSubscribe &&
|
|
36
|
+
authUserId !== null &&
|
|
37
|
+
((e.privacy === types_1.SCEventPrivacyType.PUBLIC && !e.subscription_status) || e.subscription_status === types_1.SCEventSubscriptionStatusType.INVITED)) {
|
|
38
|
+
// Auto subscribe to the event
|
|
39
|
+
api_services_1.EventService.subscribeToEvent(e.id)
|
|
40
|
+
.then(() => {
|
|
41
|
+
const updatedEvent = Object.assign(Object.assign({}, e), { subscription_status: types_1.SCEventSubscriptionStatusType.SUBSCRIBED });
|
|
42
|
+
setScEvent(updatedEvent);
|
|
43
|
+
utils_1.LRUCache.set(__eventCacheKey, updatedEvent);
|
|
44
|
+
})
|
|
45
|
+
.catch(() => {
|
|
46
|
+
const updatedEvent = authUserId ? e : (0, utils_1.objectWithoutProperties)(e, ['subscription_status']);
|
|
47
|
+
setScEvent(updatedEvent);
|
|
48
|
+
utils_1.LRUCache.set(__eventCacheKey, updatedEvent);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const updatedEvent = authUserId ? e : (0, utils_1.objectWithoutProperties)(e, ['subscription_status']);
|
|
53
|
+
setScEvent(updatedEvent);
|
|
54
|
+
utils_1.LRUCache.set(__eventCacheKey, updatedEvent);
|
|
55
|
+
}
|
|
56
|
+
}, [autoSubscribe, authUserId, setScEvent]);
|
|
36
57
|
/**
|
|
37
58
|
* Memoized fetchTag
|
|
38
59
|
*/
|
|
39
|
-
const fetchEvent = (0, react_1.useMemo)(() => () => {
|
|
60
|
+
const fetchEvent = (0, react_1.useMemo)(() => (id) => {
|
|
40
61
|
return api_services_1.http
|
|
41
62
|
.request({
|
|
42
|
-
url: api_services_1.Endpoints.GetEventInfo.url({ id
|
|
63
|
+
url: api_services_1.Endpoints.GetEventInfo.url({ id }),
|
|
43
64
|
method: api_services_1.Endpoints.GetEventInfo.method,
|
|
44
65
|
})
|
|
45
66
|
.then((res) => {
|
|
@@ -48,26 +69,15 @@ function useSCFetchEvent({ id = null, event = null, autoSubscribe = true, cacheS
|
|
|
48
69
|
}
|
|
49
70
|
return Promise.resolve(res.data);
|
|
50
71
|
});
|
|
51
|
-
}, [
|
|
72
|
+
}, []);
|
|
52
73
|
/**
|
|
53
74
|
* If id attempt to get the event by id
|
|
54
75
|
*/
|
|
55
76
|
(0, react_1.useEffect)(() => {
|
|
56
|
-
if (
|
|
57
|
-
fetchEvent()
|
|
58
|
-
.then((
|
|
59
|
-
|
|
60
|
-
authUserId !== null &&
|
|
61
|
-
((event.privacy === types_1.SCEventPrivacyType.PUBLIC && !event.subscription_status) || event.subscription_status === types_1.SCEventSubscriptionStatusType.INVITED)) {
|
|
62
|
-
// Auto subscribe to the event
|
|
63
|
-
api_services_1.EventService.subscribeToEvent(event.id).then(() => {
|
|
64
|
-
const updatedEvent = Object.assign(Object.assign({}, event), { subscription_status: types_1.SCEventSubscriptionStatusType.SUBSCRIBED });
|
|
65
|
-
setSCEvent(updatedEvent);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
setSCEvent(event);
|
|
70
|
-
}
|
|
77
|
+
if (id !== null && id !== undefined && !event) {
|
|
78
|
+
fetchEvent(id)
|
|
79
|
+
.then((e) => {
|
|
80
|
+
setSCEvent(e);
|
|
71
81
|
})
|
|
72
82
|
.catch((err) => {
|
|
73
83
|
utils_1.LRUCache.delete(__eventCacheKey);
|
|
@@ -76,7 +86,7 @@ function useSCFetchEvent({ id = null, event = null, autoSubscribe = true, cacheS
|
|
|
76
86
|
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
77
87
|
});
|
|
78
88
|
}
|
|
79
|
-
}, [
|
|
89
|
+
}, [id, event, authUserId]);
|
|
80
90
|
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
81
91
|
if (event) {
|
|
82
92
|
setSCEvent(event);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SCLiveStreamType } from '@selfcommunity/types';
|
|
2
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
3
|
+
/**
|
|
4
|
+
:::info
|
|
5
|
+
This custom hook is used to fetch an liveStream object.
|
|
6
|
+
:::
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.liveStream
|
|
10
|
+
* @param object.cacheStrategy
|
|
11
|
+
*/
|
|
12
|
+
export default function useSCFetchLiveStream({ id, liveStream, cacheStrategy, }: {
|
|
13
|
+
id?: number | string;
|
|
14
|
+
liveStream?: SCLiveStreamType;
|
|
15
|
+
cacheStrategy?: CacheStrategies;
|
|
16
|
+
}): {
|
|
17
|
+
scLiveStream: SCLiveStreamType;
|
|
18
|
+
setSCLiveStream: (e: SCLiveStreamType) => void;
|
|
19
|
+
error: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
4
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
7
|
+
const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
8
|
+
const Cache_1 = require("../constants/Cache");
|
|
9
|
+
const Errors_1 = require("../constants/Errors");
|
|
10
|
+
/**
|
|
11
|
+
:::info
|
|
12
|
+
This custom hook is used to fetch an liveStream object.
|
|
13
|
+
:::
|
|
14
|
+
* @param object
|
|
15
|
+
* @param object.id
|
|
16
|
+
* @param object.liveStream
|
|
17
|
+
* @param object.cacheStrategy
|
|
18
|
+
*/
|
|
19
|
+
function useSCFetchLiveStream({ id = null, liveStream = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
20
|
+
const __eventId = liveStream ? liveStream.id : id;
|
|
21
|
+
// CONTEXT
|
|
22
|
+
const scUserContext = (0, SCUserProvider_1.useSCUser)();
|
|
23
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
24
|
+
// CACHE
|
|
25
|
+
const __liveStreamCacheKey = (0, Cache_1.getLiveStreamObjectCacheKey)(__eventId);
|
|
26
|
+
const __liveStream = authUserId ? liveStream : (0, utils_1.objectWithoutProperties)(liveStream, ['subscription_status']);
|
|
27
|
+
const [scLiveStream, setScLiveStream] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__liveStreamCacheKey, __liveStream) : null);
|
|
28
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
29
|
+
/**
|
|
30
|
+
* Memoized setSCLiveStream (auto-subscription if need it)
|
|
31
|
+
*/
|
|
32
|
+
const setSCLiveStream = (0, react_1.useMemo)(() => (e) => {
|
|
33
|
+
setScLiveStream(e);
|
|
34
|
+
utils_1.LRUCache.set(__liveStreamCacheKey, e);
|
|
35
|
+
}, [authUserId, setScLiveStream]);
|
|
36
|
+
/**
|
|
37
|
+
* Memoized fetchTag
|
|
38
|
+
*/
|
|
39
|
+
const fetchLiveStream = (0, react_1.useMemo)(() => (id) => {
|
|
40
|
+
return api_services_1.http
|
|
41
|
+
.request({
|
|
42
|
+
url: api_services_1.Endpoints.GetLiveStreamInfo.url({ id }),
|
|
43
|
+
method: api_services_1.Endpoints.GetLiveStreamInfo.method,
|
|
44
|
+
})
|
|
45
|
+
.then((res) => {
|
|
46
|
+
if (res.status >= 300) {
|
|
47
|
+
return Promise.reject(res);
|
|
48
|
+
}
|
|
49
|
+
return Promise.resolve(res.data);
|
|
50
|
+
});
|
|
51
|
+
}, []);
|
|
52
|
+
/**
|
|
53
|
+
* If id attempt to get the liveStream by id
|
|
54
|
+
*/
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
if (id !== null && id !== undefined && !liveStream) {
|
|
57
|
+
fetchLiveStream(id)
|
|
58
|
+
.then((e) => {
|
|
59
|
+
setSCLiveStream(e);
|
|
60
|
+
})
|
|
61
|
+
.catch((err) => {
|
|
62
|
+
utils_1.LRUCache.delete(__liveStreamCacheKey);
|
|
63
|
+
setError(`LiveStream with id ${id} not found`);
|
|
64
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `LiveStream with id ${id} not found`);
|
|
65
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [id, liveStream, authUserId]);
|
|
69
|
+
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
70
|
+
if (liveStream) {
|
|
71
|
+
setSCLiveStream(liveStream);
|
|
72
|
+
}
|
|
73
|
+
}, [liveStream, authUserId]);
|
|
74
|
+
return { scLiveStream, setSCLiveStream, error };
|
|
75
|
+
}
|
|
76
|
+
exports.default = useSCFetchLiveStream;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ import useSCFetchGroup from './hooks/useSCFetchGroup';
|
|
|
64
64
|
import useSCFetchGroups from './hooks/useSCFetchGroups';
|
|
65
65
|
import useSCFetchEvent from './hooks/useSCFetchEvent';
|
|
66
66
|
import useSCFetchEvents from './hooks/useSCFetchEvents';
|
|
67
|
+
import useSCFetchLiveStream from './hooks/useSCFetchLiveStream';
|
|
67
68
|
/**
|
|
68
69
|
* Routing component
|
|
69
70
|
*/
|
|
@@ -75,7 +76,7 @@ import * as SCRoutes from './constants/Routes';
|
|
|
75
76
|
*/
|
|
76
77
|
import * as UserUtils from './utils/user';
|
|
77
78
|
import getTheme from './themes/theme';
|
|
78
|
-
import { useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect } from './utils/hooks';
|
|
79
|
+
import { useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility } from './utils/hooks';
|
|
79
80
|
import { getEventStatus } from './utils/event';
|
|
80
81
|
/**
|
|
81
82
|
* Constants:
|
|
@@ -86,4 +87,4 @@ import * as Preferences from './constants/Preferences';
|
|
|
86
87
|
/**
|
|
87
88
|
* List all exports
|
|
88
89
|
*/
|
|
89
|
-
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, 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, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, };
|
|
90
|
+
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, 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, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, };
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCMediaClick = exports.useSCFetchIncubator = exports.useSCFetchCategories = exports.useSCFetchCategory = exports.useSCFetchAddressingTagList = exports.useSCFetchTag = exports.useSCFetchCustomAdv = exports.useSCFetchCommentObjects = exports.useSCFetchCommentObject = exports.useSCFetchFeedObject = exports.useSCFetchVote = exports.useSCFetchUserProviders = 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.useSCFetchEvents = exports.useSCFetchEvent = exports.useSCFetchGroups = exports.useSCFetchGroup = exports.useSCUserIsBlocked = exports.useSCFetchUserBlockedBy = exports.useSCFetchBroadcastMessages = exports.useSCFetchPrivateMessageSnippets = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = exports.useSCFetchFeed = exports.useSCFetchContributors = void 0;
|
|
4
|
+
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 = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
/**
|
|
7
7
|
* ContextProvider component
|
|
@@ -118,6 +118,8 @@ const useSCFetchEvent_1 = tslib_1.__importDefault(require("./hooks/useSCFetchEve
|
|
|
118
118
|
exports.useSCFetchEvent = useSCFetchEvent_1.default;
|
|
119
119
|
const useSCFetchEvents_1 = tslib_1.__importDefault(require("./hooks/useSCFetchEvents"));
|
|
120
120
|
exports.useSCFetchEvents = useSCFetchEvents_1.default;
|
|
121
|
+
const useSCFetchLiveStream_1 = tslib_1.__importDefault(require("./hooks/useSCFetchLiveStream"));
|
|
122
|
+
exports.useSCFetchLiveStream = useSCFetchLiveStream_1.default;
|
|
121
123
|
/**
|
|
122
124
|
* Routing component
|
|
123
125
|
*/
|
|
@@ -139,6 +141,7 @@ Object.defineProperty(exports, "usePreviousValue", { enumerable: true, get: func
|
|
|
139
141
|
Object.defineProperty(exports, "useIsomorphicLayoutEffect", { enumerable: true, get: function () { return hooks_1.useIsomorphicLayoutEffect; } });
|
|
140
142
|
Object.defineProperty(exports, "useEffectOnce", { enumerable: true, get: function () { return hooks_1.useEffectOnce; } });
|
|
141
143
|
Object.defineProperty(exports, "useNoInitialEffect", { enumerable: true, get: function () { return hooks_1.useNoInitialEffect; } });
|
|
144
|
+
Object.defineProperty(exports, "usePageVisibility", { enumerable: true, get: function () { return hooks_1.usePageVisibility; } });
|
|
142
145
|
const event_1 = require("./utils/event");
|
|
143
146
|
Object.defineProperty(exports, "getEventStatus", { enumerable: true, get: function () { return event_1.getEventStatus; } });
|
|
144
147
|
/**
|
|
@@ -3,4 +3,5 @@ import usePreviousValue from './usePreviousValue';
|
|
|
3
3
|
import useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';
|
|
4
4
|
import useEffectOnce from './useEffectOnce';
|
|
5
5
|
import useNoInitialEffect from './useNoInitialEffect';
|
|
6
|
-
|
|
6
|
+
import usePageVisibility from './usePageVisibility';
|
|
7
|
+
export { useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = void 0;
|
|
3
|
+
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;
|
|
@@ -12,3 +12,5 @@ const useEffectOnce_1 = tslib_1.__importDefault(require("./useEffectOnce"));
|
|
|
12
12
|
exports.useEffectOnce = useEffectOnce_1.default;
|
|
13
13
|
const useNoInitialEffect_1 = tslib_1.__importDefault(require("./useNoInitialEffect"));
|
|
14
14
|
exports.useNoInitialEffect = useNoInitialEffect_1.default;
|
|
15
|
+
const usePageVisibility_1 = tslib_1.__importDefault(require("./usePageVisibility"));
|
|
16
|
+
exports.usePageVisibility = usePageVisibility_1.default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const usePageVisibility = () => {
|
|
5
|
+
const [isPageVisible, setIsPageVisible] = (0, react_1.useState)(true);
|
|
6
|
+
(0, react_1.useEffect)(() => {
|
|
7
|
+
const handleVisibilityChange = () => {
|
|
8
|
+
setIsPageVisible(!document.hidden);
|
|
9
|
+
};
|
|
10
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
11
|
+
return () => {
|
|
12
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
13
|
+
};
|
|
14
|
+
}, []);
|
|
15
|
+
return isPageVisible;
|
|
16
|
+
};
|
|
17
|
+
exports.default = usePageVisibility;
|
|
@@ -206,7 +206,7 @@ exports.validateWebSocketDisableToastMessage = validateWebSocketDisableToastMess
|
|
|
206
206
|
const validateWebSocketSecure = (value) => {
|
|
207
207
|
const errors = [];
|
|
208
208
|
const warnings = [];
|
|
209
|
-
if (value) {
|
|
209
|
+
if ((value === null || value === void 0 ? void 0 : value.toString()) !== undefined) {
|
|
210
210
|
if (!(typeof value === 'boolean')) {
|
|
211
211
|
errors.push(errors_1.ValidationError.ERROR_INVALID_NOTIFICATIONS_WEBSOCKET_SECURE);
|
|
212
212
|
}
|
|
@@ -679,7 +679,6 @@ exports.validateOpenAI = validateOpenAI;
|
|
|
679
679
|
* @param v
|
|
680
680
|
*/
|
|
681
681
|
const validateGeocoding = (v) => {
|
|
682
|
-
//console.log(v);
|
|
683
682
|
const errors = [];
|
|
684
683
|
const warnings = [];
|
|
685
684
|
if (v && !(0, utils_1.isObject)(v)) {
|
|
@@ -3,7 +3,7 @@ import { createContext, useContext, useMemo } from 'react';
|
|
|
3
3
|
import { useSCContext } from '../SCContextProvider';
|
|
4
4
|
import { SCPreferencesContext } from '../SCPreferencesProvider';
|
|
5
5
|
import * as SCPreferences from '../../../constants/Preferences';
|
|
6
|
-
import { CATEGORIES_LIST_ROUTE_NAME, CATEGORY_ROUTE_NAME, COMMENT_ROUTE_NAME, DISCUSSION_ROUTE_NAME, INCUBATOR_ROUTE_NAME, POST_ROUTE_NAME, STATUS_ROUTE_NAME, USER_NOTIFICATIONS_ROUTE_NAME, USER_PRIVATE_MESSAGES_ROUTE_NAME, USER_PROFILE_ROUTE_NAME, USER_PROFILE_SETTINGS_ROUTE_NAME, defaultRoutes, } from '../../../constants/Routes';
|
|
6
|
+
import { CATEGORIES_LIST_ROUTE_NAME, CATEGORY_ROUTE_NAME, COMMENT_ROUTE_NAME, DISCUSSION_ROUTE_NAME, INCUBATOR_ROUTE_NAME, POST_ROUTE_NAME, STATUS_ROUTE_NAME, USER_NOTIFICATIONS_ROUTE_NAME, USER_PRIVATE_MESSAGES_ROUTE_NAME, USER_PROFILE_ROUTE_NAME, USER_PROFILE_SETTINGS_ROUTE_NAME, defaultRoutes, LIVESTREAM_ROUTE_NAME, } from '../../../constants/Routes';
|
|
7
7
|
/**
|
|
8
8
|
* Creates Global Context
|
|
9
9
|
*
|
|
@@ -70,6 +70,7 @@ export default function SCRoutingProvider({ children = null }) {
|
|
|
70
70
|
[USER_NOTIFICATIONS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS].value),
|
|
71
71
|
[USER_PRIVATE_MESSAGES_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES].value),
|
|
72
72
|
[INCUBATOR_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR].value),
|
|
73
|
+
[LIVESTREAM_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM].value),
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
return {};
|