@selfcommunity/react-core 0.7.0-alpha.16 → 0.7.0-alpha.18
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/hooks/useSCFeature.d.ts +22 -0
- package/lib/cjs/hooks/useSCFeature.js +38 -0
- package/lib/cjs/hooks/useSCPreference.d.ts +36 -0
- package/lib/cjs/hooks/useSCPreference.js +69 -0
- package/lib/cjs/hooks/useSCPreferencesAndFeaturesEnabled.d.ts +17 -0
- package/lib/cjs/hooks/useSCPreferencesAndFeaturesEnabled.js +35 -0
- package/lib/cjs/index.d.ts +4 -2
- package/lib/cjs/index.js +10 -3
- package/lib/esm/hooks/useSCFeature.d.ts +22 -0
- package/lib/esm/hooks/useSCFeature.js +33 -0
- package/lib/esm/hooks/useSCPreference.d.ts +36 -0
- package/lib/esm/hooks/useSCPreference.js +65 -0
- package/lib/esm/hooks/useSCPreferencesAndFeaturesEnabled.d.ts +17 -0
- package/lib/esm/hooks/useSCPreferencesAndFeaturesEnabled.js +32 -0
- package/lib/esm/index.d.ts +4 -2
- package/lib/esm/index.js +4 -2
- package/lib/umd/react-core.js +1 -1
- package/package.json +4 -4
- package/lib/cjs/hooks/useSCPreferenceEnabled.d.ts +0 -6
- package/lib/cjs/hooks/useSCPreferenceEnabled.js +0 -16
- package/lib/esm/hooks/useSCPreferenceEnabled.d.ts +0 -6
- package/lib/esm/hooks/useSCPreferenceEnabled.js +0 -13
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SCFeatureName } from '@selfcommunity/types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to check if the feature is enabled
|
|
4
|
+
* @param featureName - feature name
|
|
5
|
+
* @returns boolean - true if the feature is in the list of features
|
|
6
|
+
*
|
|
7
|
+
* Ex.
|
|
8
|
+
* const isTaggingEnabled = useSCFeatureEnabled(SCFeatureName.TAGGING);
|
|
9
|
+
*/
|
|
10
|
+
export declare function useSCFeatureEnabled(featureName: SCFeatureName): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Custom hook to check if a list of features are enabled
|
|
13
|
+
* @param featureNames - feature names
|
|
14
|
+
* @returns boolean - true if all features are in the features list
|
|
15
|
+
*
|
|
16
|
+
* Ex.
|
|
17
|
+
* const hasRequiredFeatures = useSCFeaturesEnabled([
|
|
18
|
+
* SCFeatureName.TAGGING,
|
|
19
|
+
* SCFeatureName.GROUPING
|
|
20
|
+
* ]);
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSCFeaturesEnabled(featureNames: SCFeatureName[]): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSCFeaturesEnabled = exports.useSCFeatureEnabled = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const SCPreferencesProvider_1 = require("../components/provider/SCPreferencesProvider");
|
|
6
|
+
/**
|
|
7
|
+
* Custom hook to check if the feature is enabled
|
|
8
|
+
* @param featureName - feature name
|
|
9
|
+
* @returns boolean - true if the feature is in the list of features
|
|
10
|
+
*
|
|
11
|
+
* Ex.
|
|
12
|
+
* const isTaggingEnabled = useSCFeatureEnabled(SCFeatureName.TAGGING);
|
|
13
|
+
*/
|
|
14
|
+
function useSCFeatureEnabled(featureName) {
|
|
15
|
+
const { features } = (0, SCPreferencesProvider_1.useSCPreferences)();
|
|
16
|
+
return (0, react_1.useMemo)(() => {
|
|
17
|
+
return Boolean(features && features.includes(featureName));
|
|
18
|
+
}, [features, featureName]);
|
|
19
|
+
}
|
|
20
|
+
exports.useSCFeatureEnabled = useSCFeatureEnabled;
|
|
21
|
+
/**
|
|
22
|
+
* Custom hook to check if a list of features are enabled
|
|
23
|
+
* @param featureNames - feature names
|
|
24
|
+
* @returns boolean - true if all features are in the features list
|
|
25
|
+
*
|
|
26
|
+
* Ex.
|
|
27
|
+
* const hasRequiredFeatures = useSCFeaturesEnabled([
|
|
28
|
+
* SCFeatureName.TAGGING,
|
|
29
|
+
* SCFeatureName.GROUPING
|
|
30
|
+
* ]);
|
|
31
|
+
*/
|
|
32
|
+
function useSCFeaturesEnabled(featureNames) {
|
|
33
|
+
const { features } = (0, SCPreferencesProvider_1.useSCPreferences)();
|
|
34
|
+
return (0, react_1.useMemo)(() => {
|
|
35
|
+
return Boolean(features && featureNames.every((name) => features.includes(name)));
|
|
36
|
+
}, [features, featureNames]);
|
|
37
|
+
}
|
|
38
|
+
exports.useSCFeaturesEnabled = useSCFeaturesEnabled;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to recover a given preference.
|
|
3
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
4
|
+
* @param defaultValue - default returned value
|
|
5
|
+
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
6
|
+
*
|
|
7
|
+
* Ex.
|
|
8
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
9
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
10
|
+
*/
|
|
11
|
+
declare function useSCPreference<T = any>(preferenceKey: string, defaultValue?: T): T | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Custom hook to check if a given preference is present and has a value.
|
|
14
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
15
|
+
* @param defaultValue - default returned value (default=false)
|
|
16
|
+
* @returns boolean
|
|
17
|
+
*
|
|
18
|
+
* Ex.
|
|
19
|
+
* const isEnabled = useSCPreferenceEnabled(SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED);
|
|
20
|
+
**/
|
|
21
|
+
declare function useSCPreferenceEnabled(preferenceKey: string, defaultValue?: boolean): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Custom hook to check if all specified preferences are enabled
|
|
24
|
+
* @param preferenceKeys - Array of preference keys to check
|
|
25
|
+
* @param defaultValue - Default value if a preference doesn't exist
|
|
26
|
+
* @returns boolean - true if all preferences are enabled
|
|
27
|
+
*
|
|
28
|
+
* Ex.
|
|
29
|
+
* const arePreferencesEnabled = useSCPreferencesEnabled([
|
|
30
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
31
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
32
|
+
* ]);
|
|
33
|
+
*/
|
|
34
|
+
declare function useSCPreferencesEnabled(preferenceKeys: string[], defaultValue?: boolean): boolean;
|
|
35
|
+
export { useSCPreferenceEnabled, useSCPreferencesEnabled };
|
|
36
|
+
export default useSCPreference;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSCPreferencesEnabled = exports.useSCPreferenceEnabled = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const SCPreferencesProvider_1 = require("../components/provider/SCPreferencesProvider");
|
|
6
|
+
/**
|
|
7
|
+
* Custom hook to recover a given preference.
|
|
8
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
9
|
+
* @param defaultValue - default returned value
|
|
10
|
+
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
11
|
+
*
|
|
12
|
+
* Ex.
|
|
13
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
14
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
15
|
+
*/
|
|
16
|
+
function useSCPreference(preferenceKey, defaultValue) {
|
|
17
|
+
const { preferences } = (0, SCPreferencesProvider_1.useSCPreferences)();
|
|
18
|
+
return (0, react_1.useMemo)(() => {
|
|
19
|
+
if (!preferences || !(preferenceKey in preferences)) {
|
|
20
|
+
return defaultValue;
|
|
21
|
+
}
|
|
22
|
+
const pref = preferences[preferenceKey];
|
|
23
|
+
return pref.value;
|
|
24
|
+
}, [preferences, preferenceKey, defaultValue]);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Custom hook to check if a given preference is present and has a value.
|
|
28
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
29
|
+
* @param defaultValue - default returned value (default=false)
|
|
30
|
+
* @returns boolean
|
|
31
|
+
*
|
|
32
|
+
* Ex.
|
|
33
|
+
* const isEnabled = useSCPreferenceEnabled(SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED);
|
|
34
|
+
**/
|
|
35
|
+
function useSCPreferenceEnabled(preferenceKey, defaultValue = false) {
|
|
36
|
+
const value = useSCPreference(preferenceKey, defaultValue);
|
|
37
|
+
return value !== null && value !== void 0 ? value : defaultValue;
|
|
38
|
+
}
|
|
39
|
+
exports.useSCPreferenceEnabled = useSCPreferenceEnabled;
|
|
40
|
+
/**
|
|
41
|
+
* Custom hook to check if all specified preferences are enabled
|
|
42
|
+
* @param preferenceKeys - Array of preference keys to check
|
|
43
|
+
* @param defaultValue - Default value if a preference doesn't exist
|
|
44
|
+
* @returns boolean - true if all preferences are enabled
|
|
45
|
+
*
|
|
46
|
+
* Ex.
|
|
47
|
+
* const arePreferencesEnabled = useSCPreferencesEnabled([
|
|
48
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
49
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
50
|
+
* ]);
|
|
51
|
+
*/
|
|
52
|
+
function useSCPreferencesEnabled(preferenceKeys, defaultValue = false) {
|
|
53
|
+
const { preferences } = (0, SCPreferencesProvider_1.useSCPreferences)();
|
|
54
|
+
return (0, react_1.useMemo)(() => {
|
|
55
|
+
// Se non ci sono preferences o non è stato passato nessun preferenceKey, ritorna il valore di default
|
|
56
|
+
if (!preferences || !preferenceKeys.length) {
|
|
57
|
+
return defaultValue;
|
|
58
|
+
}
|
|
59
|
+
// Verifica che tutte le preferenze siano presenti e abbiano value = true
|
|
60
|
+
return preferenceKeys.every((key) => {
|
|
61
|
+
if (!(key in preferences)) {
|
|
62
|
+
return defaultValue;
|
|
63
|
+
}
|
|
64
|
+
return preferences[key].value;
|
|
65
|
+
});
|
|
66
|
+
}, [preferences, preferenceKeys, defaultValue]);
|
|
67
|
+
}
|
|
68
|
+
exports.useSCPreferencesEnabled = useSCPreferencesEnabled;
|
|
69
|
+
exports.default = useSCPreference;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SCFeatureName } from '@selfcommunity/types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook preferences and features at the same time
|
|
4
|
+
* @param preferences - array of preference keys
|
|
5
|
+
* @param features - array of feature keys
|
|
6
|
+
* @returns boolean - true only if all preferences and features are enabled
|
|
7
|
+
*
|
|
8
|
+
* Ex.
|
|
9
|
+
* const isEnabled = useSCPreferencesAndFeaturesEnabled(
|
|
10
|
+
* [
|
|
11
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
12
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
13
|
+
* ],
|
|
14
|
+
* [SCFeatureName.TAGGING]
|
|
15
|
+
* );
|
|
16
|
+
*/
|
|
17
|
+
export default function useSCPreferencesAndFeaturesEnabled(preferences: string[], features?: SCFeatureName[]): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const SCPreferencesProvider_1 = require("../components/provider/SCPreferencesProvider");
|
|
5
|
+
/**
|
|
6
|
+
* Custom hook preferences and features at the same time
|
|
7
|
+
* @param preferences - array of preference keys
|
|
8
|
+
* @param features - array of feature keys
|
|
9
|
+
* @returns boolean - true only if all preferences and features are enabled
|
|
10
|
+
*
|
|
11
|
+
* Ex.
|
|
12
|
+
* const isEnabled = useSCPreferencesAndFeaturesEnabled(
|
|
13
|
+
* [
|
|
14
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
15
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
16
|
+
* ],
|
|
17
|
+
* [SCFeatureName.TAGGING]
|
|
18
|
+
* );
|
|
19
|
+
*/
|
|
20
|
+
function useSCPreferencesAndFeaturesEnabled(preferences, features = []) {
|
|
21
|
+
const { preferences: preferencesContext, features: featuresContext } = (0, SCPreferencesProvider_1.useSCPreferences)();
|
|
22
|
+
return (0, react_1.useMemo)(() => {
|
|
23
|
+
// Check available context
|
|
24
|
+
if (!preferencesContext || !featuresContext) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
// Check every preferences
|
|
28
|
+
const preferencesEnabled = preferences.every((key) => key in preferencesContext && preferencesContext[key].value);
|
|
29
|
+
// Check every features
|
|
30
|
+
const featuresEnabled = features.every((feature) => featuresContext.includes(feature));
|
|
31
|
+
// Return true only if all preferences and features are enabled
|
|
32
|
+
return preferencesEnabled && featuresEnabled;
|
|
33
|
+
}, [preferencesContext, featuresContext, preferences, features]);
|
|
34
|
+
}
|
|
35
|
+
exports.default = useSCPreferencesAndFeaturesEnabled;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -75,8 +75,10 @@ import useSCFetchLesson from './hooks/useSCFetchLesson';
|
|
|
75
75
|
import useSCPaymentsEnabled from './hooks/useSCPaymentsEnabled';
|
|
76
76
|
import useSCFetchPaymentProduct from './hooks/useSCFetchPaymentProduct';
|
|
77
77
|
import useSCFetchPaymentOrder from './hooks/useSCFetchPaymentOrder';
|
|
78
|
-
import useSCPreferenceEnabled from './hooks/useSCPreferenceEnabled';
|
|
79
78
|
import useFetchMenuFooter from './hooks/useFetchMenuFooter';
|
|
79
|
+
import useSCPreference, { useSCPreferenceEnabled, useSCPreferencesEnabled } from './hooks/useSCPreference';
|
|
80
|
+
import { useSCFeatureEnabled, useSCFeaturesEnabled } from './hooks/useSCFeature';
|
|
81
|
+
import useSCPreferencesAndFeaturesEnabled from './hooks/useSCPreferencesAndFeaturesEnabled';
|
|
80
82
|
/**
|
|
81
83
|
* Routing component
|
|
82
84
|
*/
|
|
@@ -99,4 +101,4 @@ import * as Preferences from './constants/Preferences';
|
|
|
99
101
|
/**
|
|
100
102
|
* List all exports
|
|
101
103
|
*/
|
|
102
|
-
export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCJoinedCoursesManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUsers, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, useSCPaymentsEnabled, useSCFetchPaymentProduct, useSCFetchPaymentOrder, useSCPreferenceEnabled,
|
|
104
|
+
export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCJoinedCoursesManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUsers, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, useSCPaymentsEnabled, useSCFetchPaymentProduct, useSCFetchPaymentOrder, useFetchMenuFooter, useSCPreference, useSCPreferenceEnabled, useSCPreferencesEnabled, useSCFeatureEnabled, useSCFeaturesEnabled, useSCPreferencesAndFeaturesEnabled, };
|
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.useSCFetchCategory = exports.useSCFetchAddressingTagList = exports.useSCFetchTag = exports.useSCFetchCustomAdv = exports.useSCFetchLessonCommentObjects = exports.useSCFetchLessonCommentObject = exports.useSCFetchCommentObjects = exports.useSCFetchCommentObject = exports.useSCFetchFeedObject = exports.useSCFetchVote = exports.useSCFetchUserProviders = exports.useSCFetchUsers = exports.useSCFetchUser = exports.Preferences = exports.Locale = exports.getEventStatus = exports.UserUtils = exports.SCCache = exports.SCRoutes = exports.Link = exports.useSCAlertMessages = exports.SCAlertMessagesContext = exports.SCAlertMessagesProvider = exports.useSCNotification = exports.SCNotificationContext = exports.SCNotificationProvider = exports.SCNotification = exports.SCFeatures = exports.SCPreferences = exports.SCPreferencesProvider = exports.withSCLocale = exports.useSCLocale = exports.SCLocaleProvider = exports.useSCRouting = exports.SCRoutingProvider = exports.getTheme = exports.withSCTheme = exports.useSCTheme = exports.SCThemeProvider = exports.useSCPreferences = exports.useSCUser = exports.SCUserProvider = exports.SCContextProvider = exports.useSCContext = exports.SCPreferencesContext = exports.SCLocaleContext = exports.SCRoutingContext = exports.SCThemeContext = exports.SCUserContext = exports.SCContext = void 0;
|
|
4
|
-
exports.
|
|
4
|
+
exports.useSCPreferencesAndFeaturesEnabled = exports.useSCFeaturesEnabled = exports.useSCFeatureEnabled = exports.useSCPreferencesEnabled = exports.useSCPreferenceEnabled = exports.useSCPreference = exports.useFetchMenuFooter = exports.useSCFetchPaymentOrder = exports.useSCFetchPaymentProduct = exports.useSCPaymentsEnabled = exports.useSCFetchLesson = exports.useSCFetchCourses = exports.useSCFetchCourse = exports.useSCGoogleApiLoader = exports.useSCFetchLiveStream = exports.useSCFetchEvents = exports.useSCFetchEvent = exports.useSCFetchGroups = exports.useSCFetchGroup = exports.useSCUserIsBlocked = exports.useSCFetchUserBlockedBy = exports.useSCFetchBroadcastMessages = exports.useSCFetchPrivateMessageSnippets = exports.useResizeObserver = exports.usePageVisibility = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = exports.useSCFetchFeed = exports.useSCFetchContributors = exports.useSCMediaClick = exports.useSCFetchIncubator = exports.useSCFetchCategories = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
/**
|
|
7
7
|
* ContextProvider component
|
|
@@ -140,10 +140,17 @@ const useSCFetchPaymentProduct_1 = tslib_1.__importDefault(require("./hooks/useS
|
|
|
140
140
|
exports.useSCFetchPaymentProduct = useSCFetchPaymentProduct_1.default;
|
|
141
141
|
const useSCFetchPaymentOrder_1 = tslib_1.__importDefault(require("./hooks/useSCFetchPaymentOrder"));
|
|
142
142
|
exports.useSCFetchPaymentOrder = useSCFetchPaymentOrder_1.default;
|
|
143
|
-
const useSCPreferenceEnabled_1 = tslib_1.__importDefault(require("./hooks/useSCPreferenceEnabled"));
|
|
144
|
-
exports.useSCPreferenceEnabled = useSCPreferenceEnabled_1.default;
|
|
145
143
|
const useFetchMenuFooter_1 = tslib_1.__importDefault(require("./hooks/useFetchMenuFooter"));
|
|
146
144
|
exports.useFetchMenuFooter = useFetchMenuFooter_1.default;
|
|
145
|
+
const useSCPreference_1 = tslib_1.__importStar(require("./hooks/useSCPreference"));
|
|
146
|
+
exports.useSCPreference = useSCPreference_1.default;
|
|
147
|
+
Object.defineProperty(exports, "useSCPreferenceEnabled", { enumerable: true, get: function () { return useSCPreference_1.useSCPreferenceEnabled; } });
|
|
148
|
+
Object.defineProperty(exports, "useSCPreferencesEnabled", { enumerable: true, get: function () { return useSCPreference_1.useSCPreferencesEnabled; } });
|
|
149
|
+
const useSCFeature_1 = require("./hooks/useSCFeature");
|
|
150
|
+
Object.defineProperty(exports, "useSCFeatureEnabled", { enumerable: true, get: function () { return useSCFeature_1.useSCFeatureEnabled; } });
|
|
151
|
+
Object.defineProperty(exports, "useSCFeaturesEnabled", { enumerable: true, get: function () { return useSCFeature_1.useSCFeaturesEnabled; } });
|
|
152
|
+
const useSCPreferencesAndFeaturesEnabled_1 = tslib_1.__importDefault(require("./hooks/useSCPreferencesAndFeaturesEnabled"));
|
|
153
|
+
exports.useSCPreferencesAndFeaturesEnabled = useSCPreferencesAndFeaturesEnabled_1.default;
|
|
147
154
|
/**
|
|
148
155
|
* Routing component
|
|
149
156
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SCFeatureName } from '@selfcommunity/types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to check if the feature is enabled
|
|
4
|
+
* @param featureName - feature name
|
|
5
|
+
* @returns boolean - true if the feature is in the list of features
|
|
6
|
+
*
|
|
7
|
+
* Ex.
|
|
8
|
+
* const isTaggingEnabled = useSCFeatureEnabled(SCFeatureName.TAGGING);
|
|
9
|
+
*/
|
|
10
|
+
export declare function useSCFeatureEnabled(featureName: SCFeatureName): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Custom hook to check if a list of features are enabled
|
|
13
|
+
* @param featureNames - feature names
|
|
14
|
+
* @returns boolean - true if all features are in the features list
|
|
15
|
+
*
|
|
16
|
+
* Ex.
|
|
17
|
+
* const hasRequiredFeatures = useSCFeaturesEnabled([
|
|
18
|
+
* SCFeatureName.TAGGING,
|
|
19
|
+
* SCFeatureName.GROUPING
|
|
20
|
+
* ]);
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSCFeaturesEnabled(featureNames: SCFeatureName[]): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useSCPreferences } from '../components/provider/SCPreferencesProvider';
|
|
3
|
+
/**
|
|
4
|
+
* Custom hook to check if the feature is enabled
|
|
5
|
+
* @param featureName - feature name
|
|
6
|
+
* @returns boolean - true if the feature is in the list of features
|
|
7
|
+
*
|
|
8
|
+
* Ex.
|
|
9
|
+
* const isTaggingEnabled = useSCFeatureEnabled(SCFeatureName.TAGGING);
|
|
10
|
+
*/
|
|
11
|
+
export function useSCFeatureEnabled(featureName) {
|
|
12
|
+
const { features } = useSCPreferences();
|
|
13
|
+
return useMemo(() => {
|
|
14
|
+
return Boolean(features && features.includes(featureName));
|
|
15
|
+
}, [features, featureName]);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Custom hook to check if a list of features are enabled
|
|
19
|
+
* @param featureNames - feature names
|
|
20
|
+
* @returns boolean - true if all features are in the features list
|
|
21
|
+
*
|
|
22
|
+
* Ex.
|
|
23
|
+
* const hasRequiredFeatures = useSCFeaturesEnabled([
|
|
24
|
+
* SCFeatureName.TAGGING,
|
|
25
|
+
* SCFeatureName.GROUPING
|
|
26
|
+
* ]);
|
|
27
|
+
*/
|
|
28
|
+
export function useSCFeaturesEnabled(featureNames) {
|
|
29
|
+
const { features } = useSCPreferences();
|
|
30
|
+
return useMemo(() => {
|
|
31
|
+
return Boolean(features && featureNames.every((name) => features.includes(name)));
|
|
32
|
+
}, [features, featureNames]);
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to recover a given preference.
|
|
3
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
4
|
+
* @param defaultValue - default returned value
|
|
5
|
+
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
6
|
+
*
|
|
7
|
+
* Ex.
|
|
8
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
9
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
10
|
+
*/
|
|
11
|
+
declare function useSCPreference<T = any>(preferenceKey: string, defaultValue?: T): T | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Custom hook to check if a given preference is present and has a value.
|
|
14
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
15
|
+
* @param defaultValue - default returned value (default=false)
|
|
16
|
+
* @returns boolean
|
|
17
|
+
*
|
|
18
|
+
* Ex.
|
|
19
|
+
* const isEnabled = useSCPreferenceEnabled(SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED);
|
|
20
|
+
**/
|
|
21
|
+
declare function useSCPreferenceEnabled(preferenceKey: string, defaultValue?: boolean): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Custom hook to check if all specified preferences are enabled
|
|
24
|
+
* @param preferenceKeys - Array of preference keys to check
|
|
25
|
+
* @param defaultValue - Default value if a preference doesn't exist
|
|
26
|
+
* @returns boolean - true if all preferences are enabled
|
|
27
|
+
*
|
|
28
|
+
* Ex.
|
|
29
|
+
* const arePreferencesEnabled = useSCPreferencesEnabled([
|
|
30
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
31
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
32
|
+
* ]);
|
|
33
|
+
*/
|
|
34
|
+
declare function useSCPreferencesEnabled(preferenceKeys: string[], defaultValue?: boolean): boolean;
|
|
35
|
+
export { useSCPreferenceEnabled, useSCPreferencesEnabled };
|
|
36
|
+
export default useSCPreference;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useSCPreferences } from '../components/provider/SCPreferencesProvider';
|
|
3
|
+
/**
|
|
4
|
+
* Custom hook to recover a given preference.
|
|
5
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
6
|
+
* @param defaultValue - default returned value
|
|
7
|
+
* @returns the preference value or undefined/defaultValue if doesn't exist
|
|
8
|
+
*
|
|
9
|
+
* Ex.
|
|
10
|
+
* const customValue = useSCPreference<string>(SCPreferences.CUSTOM_SETTING);
|
|
11
|
+
* const numericValue = useSCPreference<number>(SCPreferences.CUSTOM_SETTING, 0);
|
|
12
|
+
*/
|
|
13
|
+
function useSCPreference(preferenceKey, defaultValue) {
|
|
14
|
+
const { preferences } = useSCPreferences();
|
|
15
|
+
return useMemo(() => {
|
|
16
|
+
if (!preferences || !(preferenceKey in preferences)) {
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
const pref = preferences[preferenceKey];
|
|
20
|
+
return pref.value;
|
|
21
|
+
}, [preferences, preferenceKey, defaultValue]);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Custom hook to check if a given preference is present and has a value.
|
|
25
|
+
* @param preferenceKey - full preference key (e.g., 'section.name')
|
|
26
|
+
* @param defaultValue - default returned value (default=false)
|
|
27
|
+
* @returns boolean
|
|
28
|
+
*
|
|
29
|
+
* Ex.
|
|
30
|
+
* const isEnabled = useSCPreferenceEnabled(SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED);
|
|
31
|
+
**/
|
|
32
|
+
function useSCPreferenceEnabled(preferenceKey, defaultValue = false) {
|
|
33
|
+
const value = useSCPreference(preferenceKey, defaultValue);
|
|
34
|
+
return value !== null && value !== void 0 ? value : defaultValue;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Custom hook to check if all specified preferences are enabled
|
|
38
|
+
* @param preferenceKeys - Array of preference keys to check
|
|
39
|
+
* @param defaultValue - Default value if a preference doesn't exist
|
|
40
|
+
* @returns boolean - true if all preferences are enabled
|
|
41
|
+
*
|
|
42
|
+
* Ex.
|
|
43
|
+
* const arePreferencesEnabled = useSCPreferencesEnabled([
|
|
44
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
45
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
46
|
+
* ]);
|
|
47
|
+
*/
|
|
48
|
+
function useSCPreferencesEnabled(preferenceKeys, defaultValue = false) {
|
|
49
|
+
const { preferences } = useSCPreferences();
|
|
50
|
+
return useMemo(() => {
|
|
51
|
+
// Se non ci sono preferences o non è stato passato nessun preferenceKey, ritorna il valore di default
|
|
52
|
+
if (!preferences || !preferenceKeys.length) {
|
|
53
|
+
return defaultValue;
|
|
54
|
+
}
|
|
55
|
+
// Verifica che tutte le preferenze siano presenti e abbiano value = true
|
|
56
|
+
return preferenceKeys.every((key) => {
|
|
57
|
+
if (!(key in preferences)) {
|
|
58
|
+
return defaultValue;
|
|
59
|
+
}
|
|
60
|
+
return preferences[key].value;
|
|
61
|
+
});
|
|
62
|
+
}, [preferences, preferenceKeys, defaultValue]);
|
|
63
|
+
}
|
|
64
|
+
export { useSCPreferenceEnabled, useSCPreferencesEnabled };
|
|
65
|
+
export default useSCPreference;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SCFeatureName } from '@selfcommunity/types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook preferences and features at the same time
|
|
4
|
+
* @param preferences - array of preference keys
|
|
5
|
+
* @param features - array of feature keys
|
|
6
|
+
* @returns boolean - true only if all preferences and features are enabled
|
|
7
|
+
*
|
|
8
|
+
* Ex.
|
|
9
|
+
* const isEnabled = useSCPreferencesAndFeaturesEnabled(
|
|
10
|
+
* [
|
|
11
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
12
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
13
|
+
* ],
|
|
14
|
+
* [SCFeatureName.TAGGING]
|
|
15
|
+
* );
|
|
16
|
+
*/
|
|
17
|
+
export default function useSCPreferencesAndFeaturesEnabled(preferences: string[], features?: SCFeatureName[]): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useSCPreferences } from '../components/provider/SCPreferencesProvider';
|
|
3
|
+
/**
|
|
4
|
+
* Custom hook preferences and features at the same time
|
|
5
|
+
* @param preferences - array of preference keys
|
|
6
|
+
* @param features - array of feature keys
|
|
7
|
+
* @returns boolean - true only if all preferences and features are enabled
|
|
8
|
+
*
|
|
9
|
+
* Ex.
|
|
10
|
+
* const isEnabled = useSCPreferencesAndFeaturesEnabled(
|
|
11
|
+
* [
|
|
12
|
+
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
|
|
13
|
+
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
|
|
14
|
+
* ],
|
|
15
|
+
* [SCFeatureName.TAGGING]
|
|
16
|
+
* );
|
|
17
|
+
*/
|
|
18
|
+
export default function useSCPreferencesAndFeaturesEnabled(preferences, features = []) {
|
|
19
|
+
const { preferences: preferencesContext, features: featuresContext } = useSCPreferences();
|
|
20
|
+
return useMemo(() => {
|
|
21
|
+
// Check available context
|
|
22
|
+
if (!preferencesContext || !featuresContext) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
// Check every preferences
|
|
26
|
+
const preferencesEnabled = preferences.every((key) => key in preferencesContext && preferencesContext[key].value);
|
|
27
|
+
// Check every features
|
|
28
|
+
const featuresEnabled = features.every((feature) => featuresContext.includes(feature));
|
|
29
|
+
// Return true only if all preferences and features are enabled
|
|
30
|
+
return preferencesEnabled && featuresEnabled;
|
|
31
|
+
}, [preferencesContext, featuresContext, preferences, features]);
|
|
32
|
+
}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -75,8 +75,10 @@ import useSCFetchLesson from './hooks/useSCFetchLesson';
|
|
|
75
75
|
import useSCPaymentsEnabled from './hooks/useSCPaymentsEnabled';
|
|
76
76
|
import useSCFetchPaymentProduct from './hooks/useSCFetchPaymentProduct';
|
|
77
77
|
import useSCFetchPaymentOrder from './hooks/useSCFetchPaymentOrder';
|
|
78
|
-
import useSCPreferenceEnabled from './hooks/useSCPreferenceEnabled';
|
|
79
78
|
import useFetchMenuFooter from './hooks/useFetchMenuFooter';
|
|
79
|
+
import useSCPreference, { useSCPreferenceEnabled, useSCPreferencesEnabled } from './hooks/useSCPreference';
|
|
80
|
+
import { useSCFeatureEnabled, useSCFeaturesEnabled } from './hooks/useSCFeature';
|
|
81
|
+
import useSCPreferencesAndFeaturesEnabled from './hooks/useSCPreferencesAndFeaturesEnabled';
|
|
80
82
|
/**
|
|
81
83
|
* Routing component
|
|
82
84
|
*/
|
|
@@ -99,4 +101,4 @@ import * as Preferences from './constants/Preferences';
|
|
|
99
101
|
/**
|
|
100
102
|
* List all exports
|
|
101
103
|
*/
|
|
102
|
-
export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCJoinedCoursesManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUsers, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, useSCPaymentsEnabled, useSCFetchPaymentProduct, useSCFetchPaymentOrder, useSCPreferenceEnabled,
|
|
104
|
+
export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCJoinedCoursesManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUsers, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, useSCPaymentsEnabled, useSCFetchPaymentProduct, useSCFetchPaymentOrder, useFetchMenuFooter, useSCPreference, useSCPreferenceEnabled, useSCPreferencesEnabled, useSCFeatureEnabled, useSCFeaturesEnabled, useSCPreferencesAndFeaturesEnabled, };
|
package/lib/esm/index.js
CHANGED
|
@@ -71,8 +71,10 @@ import useSCFetchLesson from './hooks/useSCFetchLesson';
|
|
|
71
71
|
import useSCPaymentsEnabled from './hooks/useSCPaymentsEnabled';
|
|
72
72
|
import useSCFetchPaymentProduct from './hooks/useSCFetchPaymentProduct';
|
|
73
73
|
import useSCFetchPaymentOrder from './hooks/useSCFetchPaymentOrder';
|
|
74
|
-
import useSCPreferenceEnabled from './hooks/useSCPreferenceEnabled';
|
|
75
74
|
import useFetchMenuFooter from './hooks/useFetchMenuFooter';
|
|
75
|
+
import useSCPreference, { useSCPreferenceEnabled, useSCPreferencesEnabled } from './hooks/useSCPreference';
|
|
76
|
+
import { useSCFeatureEnabled, useSCFeaturesEnabled } from './hooks/useSCFeature';
|
|
77
|
+
import useSCPreferencesAndFeaturesEnabled from './hooks/useSCPreferencesAndFeaturesEnabled';
|
|
76
78
|
/**
|
|
77
79
|
* Routing component
|
|
78
80
|
*/
|
|
@@ -95,4 +97,4 @@ import * as Preferences from './constants/Preferences';
|
|
|
95
97
|
/**
|
|
96
98
|
* List all exports
|
|
97
99
|
*/
|
|
98
|
-
export { SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUsers, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, useSCPaymentsEnabled, useSCFetchPaymentProduct, useSCFetchPaymentOrder, useSCPreferenceEnabled,
|
|
100
|
+
export { SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUsers, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchLessonCommentObject, useSCFetchLessonCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useResizeObserver, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, useSCFetchCourse, useSCFetchCourses, useSCFetchLesson, useSCPaymentsEnabled, useSCFetchPaymentProduct, useSCFetchPaymentOrder, useFetchMenuFooter, useSCPreference, useSCPreferenceEnabled, useSCPreferencesEnabled, useSCFeatureEnabled, useSCFeaturesEnabled, useSCPreferencesAndFeaturesEnabled, };
|