@selfcommunity/react-core 0.4.56-alpha.0 → 0.5.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js +3 -4
- package/lib/cjs/components/provider/SCContextProvider/index.js +6 -5
- package/lib/cjs/components/provider/SCLocaleProvider/index.js +4 -6
- package/lib/cjs/components/provider/SCNotificationProvider/index.js +3 -2
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js +18 -3
- package/lib/cjs/components/provider/SCRoutingProvider/index.js +3 -2
- package/lib/cjs/components/provider/SCThemeProvider/index.js +4 -5
- package/lib/cjs/components/provider/SCUserProvider/index.js +9 -2
- package/lib/cjs/components/provider/SCVoteProvider/index.js +3 -3
- package/lib/cjs/components/router/index.js +3 -2
- package/lib/cjs/constants/Cache.d.ts +11 -0
- package/lib/cjs/constants/Cache.js +15 -2
- package/lib/cjs/constants/Integrations.d.ts +5 -0
- package/lib/cjs/constants/Integrations.js +6 -1
- package/lib/cjs/constants/Preferences.d.ts +3 -0
- package/lib/cjs/constants/Preferences.js +8 -2
- package/lib/cjs/constants/Routes.d.ts +5 -0
- package/lib/cjs/constants/Routes.js +11 -1
- package/lib/cjs/hooks/useSCFetchEvent.d.ts +22 -0
- package/lib/cjs/hooks/useSCFetchEvent.js +87 -0
- package/lib/cjs/hooks/useSCFetchEvents.d.ts +22 -0
- package/lib/cjs/hooks/useSCFetchEvents.js +83 -0
- package/lib/cjs/hooks/useSCSubscribedEventsManager.d.ts +38 -0
- package/lib/cjs/hooks/useSCSubscribedEventsManager.js +297 -0
- package/lib/cjs/hooks/useSCWebPushMessaging.js +3 -4
- package/lib/cjs/index.d.ts +8 -3
- package/lib/cjs/index.js +13 -3
- package/lib/cjs/types/context.d.ts +71 -2
- package/lib/cjs/types/index.d.ts +2 -2
- package/lib/cjs/utils/errors.d.ts +2 -0
- package/lib/cjs/utils/errors.js +4 -0
- package/lib/cjs/utils/event.d.ts +8 -0
- package/lib/cjs/utils/event.js +29 -0
- package/lib/cjs/utils/user.d.ts +7 -0
- package/lib/cjs/utils/user.js +11 -1
- package/lib/cjs/utils/validator.d.ts +30 -1
- package/lib/cjs/utils/validator.js +52 -1
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js +3 -3
- package/lib/esm/components/provider/SCContextProvider/index.js +6 -5
- package/lib/esm/components/provider/SCLocaleProvider/index.js +4 -5
- package/lib/esm/components/provider/SCNotificationProvider/index.js +3 -2
- package/lib/esm/components/provider/SCPreferencesProvider/index.js +18 -2
- package/lib/esm/components/provider/SCRoutingProvider/index.js +3 -2
- package/lib/esm/components/provider/SCThemeProvider/index.js +4 -5
- package/lib/esm/components/provider/SCUserProvider/index.js +9 -2
- package/lib/esm/components/provider/SCVoteProvider/index.js +3 -2
- package/lib/esm/components/router/index.js +3 -2
- package/lib/esm/constants/Cache.d.ts +11 -0
- package/lib/esm/constants/Cache.js +11 -0
- package/lib/esm/constants/Integrations.d.ts +5 -0
- package/lib/esm/constants/Integrations.js +5 -0
- package/lib/esm/constants/Preferences.d.ts +3 -0
- package/lib/esm/constants/Preferences.js +6 -0
- package/lib/esm/constants/Routes.d.ts +5 -0
- package/lib/esm/constants/Routes.js +10 -0
- package/lib/esm/hooks/useSCFetchEvent.d.ts +22 -0
- package/lib/esm/hooks/useSCFetchEvent.js +84 -0
- package/lib/esm/hooks/useSCFetchEvents.d.ts +22 -0
- package/lib/esm/hooks/useSCFetchEvents.js +81 -0
- package/lib/esm/hooks/useSCSubscribedEventsManager.d.ts +38 -0
- package/lib/esm/hooks/useSCSubscribedEventsManager.js +293 -0
- package/lib/esm/hooks/useSCWebPushMessaging.js +3 -4
- package/lib/esm/index.d.ts +8 -3
- package/lib/esm/index.js +7 -2
- package/lib/esm/types/context.d.ts +71 -2
- package/lib/esm/types/index.d.ts +2 -2
- package/lib/esm/utils/errors.d.ts +2 -0
- package/lib/esm/utils/errors.js +4 -0
- package/lib/esm/utils/event.d.ts +8 -0
- package/lib/esm/utils/event.js +25 -0
- package/lib/esm/utils/user.d.ts +7 -0
- package/lib/esm/utils/user.js +9 -0
- package/lib/esm/utils/validator.d.ts +30 -1
- package/lib/esm/utils/validator.js +49 -0
- package/lib/umd/react-core.js +1 -1
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCAlertMessages = exports.SCAlertMessagesContext = void 0;
|
|
4
|
-
const
|
|
5
|
-
const react_1 =
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
6
|
const notistack_1 = require("notistack");
|
|
7
7
|
/**
|
|
8
8
|
* Creates Global Context
|
|
@@ -32,8 +32,7 @@ exports.SCAlertMessagesContext = (0, react_1.createContext)({});
|
|
|
32
32
|
*/
|
|
33
33
|
function SCAlertMessagesProvider({ children = null }) {
|
|
34
34
|
const [options, setOptions] = (0, react_1.useState)({ maxSnack: 3, autoHideDuration: null });
|
|
35
|
-
return (
|
|
36
|
-
react_1.default.createElement(notistack_1.SnackbarProvider, Object.assign({}, options), children)));
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(exports.SCAlertMessagesContext.Provider, Object.assign({ value: { options, setOptions } }, { children: (0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, Object.assign({}, options, { children: children })) })));
|
|
37
36
|
}
|
|
38
37
|
exports.default = SCAlertMessagesProvider;
|
|
39
38
|
/**
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCContext = exports.SCContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
7
8
|
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
8
9
|
const validator_1 = require("../../../utils/validator");
|
|
@@ -83,10 +84,10 @@ function SCContextProvider({ conf, children }) {
|
|
|
83
84
|
* Nesting all necessary providers
|
|
84
85
|
* All child components will use help contexts to works
|
|
85
86
|
*/
|
|
86
|
-
return (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(exports.SCContext.Provider, Object.assign({ value: { settings } }, { children: settings &&
|
|
88
|
+
settings.contextProviders.reduceRight((memo, ContextProvider) => {
|
|
89
|
+
return (0, jsx_runtime_1.jsx)(ContextProvider, { children: memo });
|
|
90
|
+
}, children) })));
|
|
90
91
|
}
|
|
91
92
|
exports.default = SCContextProvider;
|
|
92
93
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCLocale = exports.withSCLocale = exports.SCLocaleContext = void 0;
|
|
4
|
-
const
|
|
5
|
-
const react_1 =
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
6
|
const SCContextProvider_1 = require("../SCContextProvider");
|
|
7
7
|
const locale_1 = require("../../../utils/locale");
|
|
8
8
|
const Locale_1 = require("../../../constants/Locale");
|
|
@@ -76,8 +76,7 @@ function SCLocaleProvider({ children = null }) {
|
|
|
76
76
|
}
|
|
77
77
|
throw error;
|
|
78
78
|
};
|
|
79
|
-
return (
|
|
80
|
-
react_1.default.createElement(react_intl_1.IntlProvider, { key: locale, locale: locale, messages: messages, onError: handleIntlError }, children)));
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(exports.SCLocaleContext.Provider, Object.assign({ value: { locale, messages, selectLocale } }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.IntlProvider, Object.assign({ locale: locale, messages: messages, onError: handleIntlError }, { children: children }), locale) })));
|
|
81
80
|
}
|
|
82
81
|
exports.default = SCLocaleProvider;
|
|
83
82
|
/**
|
|
@@ -86,8 +85,7 @@ exports.default = SCLocaleProvider;
|
|
|
86
85
|
*/
|
|
87
86
|
const withSCLocale = (Component) => (props) => {
|
|
88
87
|
const scLocaleContext = (0, react_1.useContext)(exports.SCLocaleContext);
|
|
89
|
-
return (
|
|
90
|
-
react_1.default.createElement(Component, Object.assign({ setLanguage: scLocaleContext.selectLocale }, props))));
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(react_intl_1.IntlProvider, Object.assign({ locale: scLocaleContext.locale, messages: scLocaleContext.messages }, { children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ setLanguage: scLocaleContext.selectLocale }, props)) })));
|
|
91
89
|
};
|
|
92
90
|
exports.withSCLocale = withSCLocale;
|
|
93
91
|
/**
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCNotification = exports.SCNotificationContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const useSCWebSocket_1 = tslib_1.__importDefault(require("../../../hooks/useSCWebSocket"));
|
|
7
8
|
const useSCWebPushMessaging_1 = tslib_1.__importDefault(require("../../../hooks/useSCWebPushMessaging"));
|
|
8
9
|
const useSCMobileNativePushMessaging_1 = tslib_1.__importDefault(require("../../../hooks/useSCMobileNativePushMessaging"));
|
|
@@ -36,7 +37,7 @@ function SCNotificationProvider({ children = null }) {
|
|
|
36
37
|
const { wsInstance } = (0, useSCWebSocket_1.default)();
|
|
37
38
|
const { wpSubscription } = (0, useSCWebPushMessaging_1.default)();
|
|
38
39
|
const { mnpmInstance } = (0, useSCMobileNativePushMessaging_1.default)();
|
|
39
|
-
return
|
|
40
|
+
return (0, jsx_runtime_1.jsx)(exports.SCNotificationContext.Provider, Object.assign({ value: { wsInstance, wpSubscription, mnpmInstance } }, { children: children }));
|
|
40
41
|
}
|
|
41
42
|
exports.default = SCNotificationProvider;
|
|
42
43
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCPreferences = exports.SCPreferencesContext = void 0;
|
|
4
|
-
const
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
5
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
7
6
|
const utils_1 = require("@selfcommunity/utils");
|
|
7
|
+
const react_1 = require("react");
|
|
8
8
|
const Errors_1 = require("../../../constants/Errors");
|
|
9
9
|
const SCContextProvider_1 = require("../SCContextProvider");
|
|
10
10
|
/**
|
|
@@ -54,13 +54,28 @@ function SCPreferencesProvider({ children = null }) {
|
|
|
54
54
|
.catch((_error) => {
|
|
55
55
|
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, _error);
|
|
56
56
|
setError(_error);
|
|
57
|
+
// setLoading(false);
|
|
57
58
|
});
|
|
58
59
|
}, []);
|
|
60
|
+
/**
|
|
61
|
+
* Force refresh of preferences & features
|
|
62
|
+
*/
|
|
63
|
+
const refresh = () => {
|
|
64
|
+
Promise.all([api_services_1.PreferenceService.getAllPreferences(), api_services_1.FeatureService.getAllFeatures()])
|
|
65
|
+
.then(function ([preferences, features]) {
|
|
66
|
+
setPreferences(preferences['results'].reduce((obj, p) => (Object.assign(Object.assign({}, obj), { [`${p.section}.${p.name}`]: p })), {}));
|
|
67
|
+
setFeatures(features['results'].filter((f) => f.enabled).map((f) => f.name));
|
|
68
|
+
})
|
|
69
|
+
.catch((_error) => {
|
|
70
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, _error);
|
|
71
|
+
setError(_error);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
59
74
|
/**
|
|
60
75
|
* Nesting all necessary providers
|
|
61
76
|
* All child components will use help contexts to works
|
|
62
77
|
*/
|
|
63
|
-
return
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(exports.SCPreferencesContext.Provider, Object.assign({ value: { preferences, features, setPreferences, setFeatures, refresh } }, { children: !loading && children })));
|
|
64
79
|
}
|
|
65
80
|
exports.default = SCPreferencesProvider;
|
|
66
81
|
/**
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCRouting = exports.SCRoutingContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const SCContextProvider_1 = require("../SCContextProvider");
|
|
7
8
|
const SCPreferencesProvider_1 = require("../SCPreferencesProvider");
|
|
8
9
|
const SCPreferences = tslib_1.__importStar(require("../../../constants/Preferences"));
|
|
@@ -104,7 +105,7 @@ function SCRoutingProvider({ children = null }) {
|
|
|
104
105
|
routes,
|
|
105
106
|
url,
|
|
106
107
|
}), [routerLink, routes]);
|
|
107
|
-
return
|
|
108
|
+
return (0, jsx_runtime_1.jsx)(exports.SCRoutingContext.Provider, Object.assign({ value: contextValue }, { children: children }));
|
|
108
109
|
}
|
|
109
110
|
exports.default = SCRoutingProvider;
|
|
110
111
|
/**
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCTheme = exports.withSCTheme = exports.SCThemeContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const ThemeProvider_1 = tslib_1.__importDefault(require("@mui/material/styles/ThemeProvider"));
|
|
7
8
|
const theme_1 = tslib_1.__importDefault(require("../../../themes/theme"));
|
|
8
9
|
const SCContextProvider_1 = require("../SCContextProvider");
|
|
@@ -59,8 +60,7 @@ function SCThemeProvider({ children = null }) {
|
|
|
59
60
|
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
60
61
|
setCustomTheme(theme);
|
|
61
62
|
}, [scContext.settings.theme]);
|
|
62
|
-
return (
|
|
63
|
-
react_1.default.createElement(ThemeProvider_1.default, { theme: theme }, children)));
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(exports.SCThemeContext.Provider, Object.assign({ value: { theme, setTheme: setCustomTheme } }, { children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.default, Object.assign({ theme: theme }, { children: children })) })));
|
|
64
64
|
}
|
|
65
65
|
exports.default = SCThemeProvider;
|
|
66
66
|
/**
|
|
@@ -69,8 +69,7 @@ exports.default = SCThemeProvider;
|
|
|
69
69
|
*/
|
|
70
70
|
const withSCTheme = (Component) => (props) => {
|
|
71
71
|
const scThemeContext = (0, react_1.useContext)(exports.SCThemeContext);
|
|
72
|
-
return (
|
|
73
|
-
react_1.default.createElement(Component, Object.assign({ setTheme: scThemeContext.setTheme }, props))));
|
|
72
|
+
return ((0, jsx_runtime_1.jsx)(ThemeProvider_1.default, Object.assign({ theme: scThemeContext.theme }, { children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ setTheme: scThemeContext.setTheme }, props)) })));
|
|
74
73
|
};
|
|
75
74
|
exports.withSCTheme = withSCTheme;
|
|
76
75
|
/**
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCUser = exports.SCUserContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
7
8
|
const SCContextProvider_1 = require("../SCContextProvider");
|
|
8
9
|
const useSCAuth_1 = tslib_1.__importStar(require("../../../hooks/useSCAuth"));
|
|
@@ -20,6 +21,7 @@ const useSCSubscribedIncubatorsManager_1 = tslib_1.__importDefault(require("../.
|
|
|
20
21
|
const useSCBlockedUsersManager_1 = tslib_1.__importDefault(require("../../../hooks/useSCBlockedUsersManager"));
|
|
21
22
|
const Session = tslib_1.__importStar(require("../../../constants/Session"));
|
|
22
23
|
const useSCSubscribedGroupsManager_1 = tslib_1.__importDefault(require("../../../hooks/useSCSubscribedGroupsManager"));
|
|
24
|
+
const useSCSubscribedEventsManager_1 = tslib_1.__importDefault(require("../../../hooks/useSCSubscribedEventsManager"));
|
|
23
25
|
/**
|
|
24
26
|
* SCUserContext (Authentication Context)
|
|
25
27
|
*
|
|
@@ -72,6 +74,7 @@ function SCUserProvider({ children }) {
|
|
|
72
74
|
const categoriesManager = (0, useSCFollowedCategoriesManager_1.default)(state.user, updateUser);
|
|
73
75
|
const blockedUsersManager = (0, useSCBlockedUsersManager_1.default)(state.user);
|
|
74
76
|
const subscribedGroupsManager = (0, useSCSubscribedGroupsManager_1.default)(state.user);
|
|
77
|
+
const subscribedEventsManager = (0, useSCSubscribedEventsManager_1.default)(state.user);
|
|
75
78
|
/**
|
|
76
79
|
* Ref notifications subscribers: BLOCKED_USER, UNBLOCKED_USER
|
|
77
80
|
*/
|
|
@@ -123,6 +126,7 @@ function SCUserProvider({ children }) {
|
|
|
123
126
|
subscribedIncubatorsManager.refresh && subscribedIncubatorsManager.refresh();
|
|
124
127
|
blockedUsersManager.refresh && blockedUsersManager.refresh();
|
|
125
128
|
subscribedGroupsManager.refresh && subscribedGroupsManager.refresh();
|
|
129
|
+
subscribedEventsManager.refresh && subscribedEventsManager.refresh();
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
/**
|
|
@@ -219,6 +223,7 @@ function SCUserProvider({ children }) {
|
|
|
219
223
|
incubators: subscribedIncubatorsManager,
|
|
220
224
|
blockedUsers: blockedUsersManager,
|
|
221
225
|
groups: subscribedGroupsManager,
|
|
226
|
+
events: subscribedEventsManager,
|
|
222
227
|
},
|
|
223
228
|
}), [
|
|
224
229
|
state,
|
|
@@ -237,12 +242,14 @@ function SCUserProvider({ children }) {
|
|
|
237
242
|
subscribedIncubatorsManager.incubators,
|
|
238
243
|
subscribedGroupsManager.loading,
|
|
239
244
|
subscribedGroupsManager.groups,
|
|
245
|
+
subscribedEventsManager.loading,
|
|
246
|
+
subscribedEventsManager.events,
|
|
240
247
|
]);
|
|
241
248
|
/**
|
|
242
249
|
* We only want to render the underlying app after we
|
|
243
250
|
* assert for the presence of a current user.
|
|
244
251
|
*/
|
|
245
|
-
return
|
|
252
|
+
return (0, jsx_runtime_1.jsx)(exports.SCUserContext.Provider, Object.assign({ value: contextValue }, { children: children }));
|
|
246
253
|
}
|
|
247
254
|
exports.default = SCUserProvider;
|
|
248
255
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSCVote = exports.SCVoteContext = void 0;
|
|
4
|
-
const
|
|
5
|
-
const react_1 =
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
6
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
7
7
|
const utils_1 = require("@selfcommunity/utils");
|
|
8
8
|
const Errors_1 = require("../../../constants/Errors");
|
|
@@ -82,7 +82,7 @@ function SCVoteProvider({ children = null }) {
|
|
|
82
82
|
* Nesting all necessary providers
|
|
83
83
|
* All child components will use help contexts to works
|
|
84
84
|
*/
|
|
85
|
-
return
|
|
85
|
+
return (0, jsx_runtime_1.jsx)(exports.SCVoteContext.Provider, Object.assign({ value: { reactions, isLoading, refreshReactions } }, { children: initialized && children }));
|
|
86
86
|
}
|
|
87
87
|
exports.default = SCVoteProvider;
|
|
88
88
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
6
|
const SCRoutingProvider_1 = require("../provider/SCRoutingProvider");
|
|
6
7
|
/**
|
|
@@ -21,10 +22,10 @@ const Link = (_a, ref) => {
|
|
|
21
22
|
const scRoutingContext = (0, react_1.useContext)(SCRoutingProvider_1.SCRoutingContext);
|
|
22
23
|
if (scRoutingContext.routerLink) {
|
|
23
24
|
const ComponentLink = scRoutingContext.routerLink;
|
|
24
|
-
return (
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(ComponentLink, Object.assign({}, other, { ref: ref }, { children: children })));
|
|
25
26
|
}
|
|
26
27
|
const { to } = other, rest = tslib_1.__rest(other, ["to"]);
|
|
27
|
-
return (
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: to }, rest, { ref: ref }, { children: children })));
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
:::info
|
|
@@ -17,6 +17,12 @@ export declare const getCategoriesObjectCacheKey: () => string;
|
|
|
17
17
|
/** CATEGORY OBJECT **/
|
|
18
18
|
export declare const CATEGORY_OBJECT_CACHE_PREFIX_KEY = "_ca_";
|
|
19
19
|
export declare const getCategoryObjectCacheKey: (id: any) => string;
|
|
20
|
+
/** EVENT OBJECT **/
|
|
21
|
+
export declare const EVENT_OBJECT_CACHE_PREFIX_KEY = "_evt_";
|
|
22
|
+
export declare const getEventObjectCacheKey: (id: any) => string;
|
|
23
|
+
/** EVENTS OBJECT **/
|
|
24
|
+
export declare const EVENTS_OBJECT_CACHE_PREFIX_KEY = "_evts_";
|
|
25
|
+
export declare const getEventsObjectCacheKey: () => string;
|
|
20
26
|
/** GROUP OBJECT **/
|
|
21
27
|
export declare const GROUP_OBJECT_CACHE_PREFIX_KEY = "_grp_";
|
|
22
28
|
export declare const getGroupObjectCacheKey: (id: any) => string;
|
|
@@ -58,6 +64,11 @@ export declare const CATEGORIES_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = "_cSug
|
|
|
58
64
|
export declare const CATEGORIES_POPULAR_TOOLS_STATE_CACHE_PREFIX_KEY = "_cPopWidget_";
|
|
59
65
|
export declare const USER_FOLLOWERS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uFolWidget_";
|
|
60
66
|
export declare const USER_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = "_uFoldWidget_";
|
|
67
|
+
export declare const USER_EVENTS_STATE_CACHE_PREFIX_KEY = "_uEvents_";
|
|
68
|
+
export declare const USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = "_uOtherEvents_";
|
|
69
|
+
export declare const USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uPartecipantsEvents_";
|
|
70
|
+
export declare const USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = "_uInvitedEvents_";
|
|
71
|
+
export declare const USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uRequestsEvents_";
|
|
61
72
|
export declare const USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConWidget_";
|
|
62
73
|
export declare const USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConReqWidget_";
|
|
63
74
|
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 = void 0;
|
|
6
|
+
exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = 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.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.USER_REQUESTS_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}`;
|
|
@@ -27,6 +27,14 @@ exports.getCategoriesObjectCacheKey = getCategoriesObjectCacheKey;
|
|
|
27
27
|
exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY = '_ca_';
|
|
28
28
|
const getCategoryObjectCacheKey = (id) => `${exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
29
29
|
exports.getCategoryObjectCacheKey = getCategoryObjectCacheKey;
|
|
30
|
+
/** EVENT OBJECT **/
|
|
31
|
+
exports.EVENT_OBJECT_CACHE_PREFIX_KEY = '_evt_';
|
|
32
|
+
const getEventObjectCacheKey = (id) => `${exports.EVENT_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
33
|
+
exports.getEventObjectCacheKey = getEventObjectCacheKey;
|
|
34
|
+
/** EVENTS OBJECT **/
|
|
35
|
+
exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = '_evts_';
|
|
36
|
+
const getEventsObjectCacheKey = () => `${exports.EVENTS_OBJECT_CACHE_PREFIX_KEY}`;
|
|
37
|
+
exports.getEventsObjectCacheKey = getEventsObjectCacheKey;
|
|
30
38
|
/** GROUP OBJECT **/
|
|
31
39
|
exports.GROUP_OBJECT_CACHE_PREFIX_KEY = '_grp_';
|
|
32
40
|
const getGroupObjectCacheKey = (id) => `${exports.GROUP_OBJECT_CACHE_PREFIX_KEY}${id}`;
|
|
@@ -85,6 +93,11 @@ exports.CATEGORIES_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_cSugWidget_';
|
|
|
85
93
|
exports.CATEGORIES_POPULAR_TOOLS_STATE_CACHE_PREFIX_KEY = '_cPopWidget_';
|
|
86
94
|
exports.USER_FOLLOWERS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uFolWidget_';
|
|
87
95
|
exports.USER_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = '_uFoldWidget_';
|
|
96
|
+
exports.USER_EVENTS_STATE_CACHE_PREFIX_KEY = '_uEvents_';
|
|
97
|
+
exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = '_uOtherEvents_';
|
|
98
|
+
exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uPartecipantsEvents_';
|
|
99
|
+
exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = '_uInvitedEvents_';
|
|
100
|
+
exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uRequestsEvents_';
|
|
88
101
|
exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConWidget_';
|
|
89
102
|
exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqWidget_';
|
|
90
103
|
exports.USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqSentWidget_';
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export declare const INTEGRATIONS_OPTION = "integrations";
|
|
2
2
|
export declare const INTEGRATIONS_OPENAI_OPTION = "openai";
|
|
3
3
|
export declare const INTEGRATIONS_OPENAI_SECRETKEY_OPTION = "secretKey";
|
|
4
|
+
export declare const INTEGRATIONS_GEOCODING_OPTION = "geocoding";
|
|
5
|
+
export declare const INTEGRATIONS_GEOCODING_APIKEY_OPTION = "apiKey";
|
|
4
6
|
export declare const DEFAULT_INTEGRATIONS_OPTION: {
|
|
5
7
|
openai: {
|
|
6
8
|
secretKey: any;
|
|
7
9
|
};
|
|
10
|
+
geocoding: {
|
|
11
|
+
apiKey: any;
|
|
12
|
+
};
|
|
8
13
|
};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_INTEGRATIONS_OPTION = exports.INTEGRATIONS_OPENAI_SECRETKEY_OPTION = exports.INTEGRATIONS_OPENAI_OPTION = exports.INTEGRATIONS_OPTION = void 0;
|
|
3
|
+
exports.DEFAULT_INTEGRATIONS_OPTION = exports.INTEGRATIONS_GEOCODING_APIKEY_OPTION = exports.INTEGRATIONS_GEOCODING_OPTION = exports.INTEGRATIONS_OPENAI_SECRETKEY_OPTION = exports.INTEGRATIONS_OPENAI_OPTION = exports.INTEGRATIONS_OPTION = void 0;
|
|
4
4
|
// integrations
|
|
5
5
|
exports.INTEGRATIONS_OPTION = 'integrations';
|
|
6
6
|
exports.INTEGRATIONS_OPENAI_OPTION = 'openai';
|
|
7
7
|
exports.INTEGRATIONS_OPENAI_SECRETKEY_OPTION = 'secretKey';
|
|
8
|
+
exports.INTEGRATIONS_GEOCODING_OPTION = 'geocoding';
|
|
9
|
+
exports.INTEGRATIONS_GEOCODING_APIKEY_OPTION = 'apiKey';
|
|
8
10
|
exports.DEFAULT_INTEGRATIONS_OPTION = {
|
|
9
11
|
[exports.INTEGRATIONS_OPENAI_OPTION]: {
|
|
10
12
|
[exports.INTEGRATIONS_OPENAI_SECRETKEY_OPTION]: null,
|
|
11
13
|
},
|
|
14
|
+
[exports.INTEGRATIONS_GEOCODING_OPTION]: {
|
|
15
|
+
[exports.INTEGRATIONS_GEOCODING_APIKEY_OPTION]: null,
|
|
16
|
+
},
|
|
12
17
|
};
|
|
@@ -129,6 +129,9 @@ export declare const CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE: string;
|
|
|
129
129
|
export declare const CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED: string;
|
|
130
130
|
export declare const CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED: string;
|
|
131
131
|
export declare const CONFIGURATIONS_GROUPS_PRIVATE_ENABLED: string;
|
|
132
|
+
export declare const CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED: string;
|
|
133
|
+
export declare const CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED: string;
|
|
134
|
+
export declare const CONFIGURATIONS_EVENTS_PRIVATE_ENABLED: string;
|
|
132
135
|
/**
|
|
133
136
|
* PROVIDERS
|
|
134
137
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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_AFFINIDY_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.
|
|
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 = void 0;
|
|
4
|
+
exports.PROVIDERS_FACEBOOK_SIGNIN_ENABLED = exports.PROVIDERS_APP_URL_ON_GOOGLE_PLAY = exports.PROVIDERS_APP_URL_ON_APP_STORE = exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_GROUPS_PRIVATE_ENABLED = exports.CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_GROUPS_ONLY_STAFF_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_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 = void 0;
|
|
6
6
|
const types_1 = require("@selfcommunity/types");
|
|
7
7
|
/**
|
|
8
8
|
* DEFAULT CONF VALIDATION OPTION
|
|
@@ -135,6 +135,9 @@ exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE = `${types_1.SCPreferenceSection
|
|
|
135
135
|
exports.CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.GROUPS_ONLY_STAFF_ENABLED}`;
|
|
136
136
|
exports.CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.GROUPS_VISIBILITY_ENABLED}`;
|
|
137
137
|
exports.CONFIGURATIONS_GROUPS_PRIVATE_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.GROUPS_PRIVATE_ENABLED}`;
|
|
138
|
+
exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.EVENTS_ONLY_STAFF_ENABLED}`;
|
|
139
|
+
exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.EVENTS_VISIBILITY_ENABLED}`;
|
|
140
|
+
exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.EVENTS_PRIVATE_ENABLED}`;
|
|
138
141
|
/**
|
|
139
142
|
* PROVIDERS
|
|
140
143
|
*/
|
|
@@ -274,6 +277,9 @@ exports.DATA_TYPES = {
|
|
|
274
277
|
[exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT]: stringType,
|
|
275
278
|
[exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL]: stringType,
|
|
276
279
|
[exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE]: stringType,
|
|
280
|
+
[exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED]: booleanType,
|
|
281
|
+
[exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED]: booleanType,
|
|
282
|
+
[exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED]: booleanType,
|
|
277
283
|
[exports.CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED]: booleanType,
|
|
278
284
|
[exports.CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED]: booleanType,
|
|
279
285
|
[exports.CONFIGURATIONS_GROUPS_PRIVATE_ENABLED]: booleanType,
|
|
@@ -36,6 +36,11 @@ export declare const GROUP_MEMBERS_ROUTE_NAME = "group_members";
|
|
|
36
36
|
export declare const GROUP_MESSAGES_ROUTE_NAME = "group_messages";
|
|
37
37
|
export declare const GROUPS_ROUTE_NAME = "groups";
|
|
38
38
|
export declare const GROUPS_SUBSCRIBED_ROUTE_NAME = "groups_subscribed";
|
|
39
|
+
export declare const EVENT_ROUTE_NAME = "event";
|
|
40
|
+
export declare const EVENTS_ROUTE_NAME = "events";
|
|
41
|
+
export declare const EVENTS_SUGGESTED_ROUTE_NAME = "events_suggested";
|
|
42
|
+
export declare const EVENTS_SUBSCRIBED_ROUTE_NAME = "events_subscribed";
|
|
43
|
+
export declare const EVENTS_HIGHLIGHT_ROUTE_NAME = "events_highlight";
|
|
39
44
|
/**
|
|
40
45
|
* Default Routes
|
|
41
46
|
* @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.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.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
|
/**
|
|
@@ -39,6 +39,11 @@ exports.GROUP_MEMBERS_ROUTE_NAME = 'group_members';
|
|
|
39
39
|
exports.GROUP_MESSAGES_ROUTE_NAME = 'group_messages';
|
|
40
40
|
exports.GROUPS_ROUTE_NAME = 'groups';
|
|
41
41
|
exports.GROUPS_SUBSCRIBED_ROUTE_NAME = 'groups_subscribed';
|
|
42
|
+
exports.EVENT_ROUTE_NAME = 'event';
|
|
43
|
+
exports.EVENTS_ROUTE_NAME = 'events';
|
|
44
|
+
exports.EVENTS_SUGGESTED_ROUTE_NAME = 'events_suggested';
|
|
45
|
+
exports.EVENTS_SUBSCRIBED_ROUTE_NAME = 'events_subscribed';
|
|
46
|
+
exports.EVENTS_HIGHLIGHT_ROUTE_NAME = 'events_highlight';
|
|
42
47
|
/**
|
|
43
48
|
* Default Routes
|
|
44
49
|
* @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}}
|
|
@@ -77,4 +82,9 @@ exports.defaultRoutes = {
|
|
|
77
82
|
[exports.GROUP_MESSAGES_ROUTE_NAME]: '/group/:id/:slug/messages/',
|
|
78
83
|
[exports.GROUPS_ROUTE_NAME]: '/groups/',
|
|
79
84
|
[exports.GROUPS_SUBSCRIBED_ROUTE_NAME]: '/groups/subscribed/',
|
|
85
|
+
[exports.EVENTS_ROUTE_NAME]: '/events/',
|
|
86
|
+
[exports.EVENTS_SUGGESTED_ROUTE_NAME]: '/events/suggested',
|
|
87
|
+
[exports.EVENT_ROUTE_NAME]: '/event/:id/:slug/',
|
|
88
|
+
[exports.EVENTS_SUBSCRIBED_ROUTE_NAME]: '/events/subscribed/',
|
|
89
|
+
[exports.EVENTS_HIGHLIGHT_ROUTE_NAME]: '/events/highlight/',
|
|
80
90
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
3
|
+
/**
|
|
4
|
+
:::info
|
|
5
|
+
This custom hook is used to fetch an event object.
|
|
6
|
+
:::
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.event
|
|
10
|
+
* @param object.autosubscribe
|
|
11
|
+
* @param object.cacheStrategy
|
|
12
|
+
*/
|
|
13
|
+
export default function useSCFetchEvent({ id, event, autoSubscribe, cacheStrategy, }: {
|
|
14
|
+
id?: number | string;
|
|
15
|
+
event?: SCEventType;
|
|
16
|
+
autoSubscribe?: boolean;
|
|
17
|
+
cacheStrategy?: CacheStrategies;
|
|
18
|
+
}): {
|
|
19
|
+
scEvent: SCEventType;
|
|
20
|
+
setSCEvent: (event: SCEventType) => void;
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
7
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
8
|
+
const Cache_1 = require("../constants/Cache");
|
|
9
|
+
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
10
|
+
const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
11
|
+
/**
|
|
12
|
+
:::info
|
|
13
|
+
This custom hook is used to fetch an event object.
|
|
14
|
+
:::
|
|
15
|
+
* @param object
|
|
16
|
+
* @param object.id
|
|
17
|
+
* @param object.event
|
|
18
|
+
* @param object.autosubscribe
|
|
19
|
+
* @param object.cacheStrategy
|
|
20
|
+
*/
|
|
21
|
+
function useSCFetchEvent({ id = null, event = null, autoSubscribe = true, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
22
|
+
const __eventId = event ? event.id : id;
|
|
23
|
+
// CONTEXT
|
|
24
|
+
const scUserContext = (0, SCUserProvider_1.useSCUser)();
|
|
25
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
26
|
+
// CACHE
|
|
27
|
+
const __eventCacheKey = (0, Cache_1.getEventObjectCacheKey)(__eventId);
|
|
28
|
+
const __event = authUserId ? event : (0, utils_1.objectWithoutProperties)(event, ['subscription_status']);
|
|
29
|
+
const [scEvent, setScEvent] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__eventCacheKey, __event) : null);
|
|
30
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
31
|
+
const setSCEvent = (event) => {
|
|
32
|
+
const _e = authUserId ? event : (0, utils_1.objectWithoutProperties)(event, ['subscription_status']);
|
|
33
|
+
setScEvent(_e);
|
|
34
|
+
utils_1.LRUCache.set(__eventCacheKey, _e);
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Memoized fetchTag
|
|
38
|
+
*/
|
|
39
|
+
const fetchEvent = (0, react_1.useMemo)(() => () => {
|
|
40
|
+
return api_services_1.http
|
|
41
|
+
.request({
|
|
42
|
+
url: api_services_1.Endpoints.GetEventInfo.url({ id: __eventId }),
|
|
43
|
+
method: api_services_1.Endpoints.GetEventInfo.method,
|
|
44
|
+
})
|
|
45
|
+
.then((res) => {
|
|
46
|
+
if (res.status >= 300) {
|
|
47
|
+
return Promise.reject(res);
|
|
48
|
+
}
|
|
49
|
+
return Promise.resolve(res.data);
|
|
50
|
+
});
|
|
51
|
+
}, [__eventId]);
|
|
52
|
+
/**
|
|
53
|
+
* If id attempt to get the event by id
|
|
54
|
+
*/
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
if (__eventId && scUserContext.user !== undefined && (!scEvent || (scEvent && __eventId !== scEvent.id))) {
|
|
57
|
+
fetchEvent()
|
|
58
|
+
.then((event) => {
|
|
59
|
+
if (autoSubscribe &&
|
|
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
|
+
}
|
|
71
|
+
})
|
|
72
|
+
.catch((err) => {
|
|
73
|
+
utils_1.LRUCache.delete(__eventCacheKey);
|
|
74
|
+
setError(`Event with id ${id} not found`);
|
|
75
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Event with id ${id} not found`);
|
|
76
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}, [__eventId, authUserId, scUserContext.user]);
|
|
80
|
+
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
81
|
+
if (event) {
|
|
82
|
+
setSCEvent(event);
|
|
83
|
+
}
|
|
84
|
+
}, [event, authUserId]);
|
|
85
|
+
return { scEvent, setSCEvent, error };
|
|
86
|
+
}
|
|
87
|
+
exports.default = useSCFetchEvent;
|