@selfcommunity/react-core 0.1.2-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/LICENSE.md +21 -0
- package/README.md +13 -0
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js +67 -0
- package/lib/cjs/components/provider/SCContextProvider/index.js +117 -0
- package/lib/cjs/components/provider/SCLocaleProvider/index.js +158 -0
- package/lib/cjs/components/provider/SCNotificationProvider/index.js +73 -0
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js +93 -0
- package/lib/cjs/components/provider/SCRoutingProvider/index.js +146 -0
- package/lib/cjs/components/provider/SCThemeProvider/index.js +123 -0
- package/lib/cjs/components/provider/SCUserProvider/index.js +310 -0
- package/lib/cjs/components/router/index.js +91 -0
- package/lib/cjs/constants/Actions.js +6 -0
- package/lib/cjs/constants/ContextProviders.js +29 -0
- package/lib/cjs/constants/Device.js +11 -0
- package/lib/cjs/constants/Errors.js +10 -0
- package/lib/cjs/constants/Features.js +84 -0
- package/lib/cjs/constants/Locale.js +19 -0
- package/lib/cjs/constants/Notification.js +67 -0
- package/lib/cjs/constants/Notifications.js +27 -0
- package/lib/cjs/constants/Preferences.js +344 -0
- package/lib/cjs/constants/Routes.js +68 -0
- package/lib/cjs/constants/Session.js +22 -0
- package/lib/cjs/constants/Theme.js +6 -0
- package/lib/cjs/constants/WebSocket.js +10 -0
- package/lib/cjs/hooks/useSCAuth.js +340 -0
- package/lib/cjs/hooks/useSCCachingManager.js +58 -0
- package/lib/cjs/hooks/useSCConnectionsManager.js +285 -0
- package/lib/cjs/hooks/useSCFetchCategories.js +71 -0
- package/lib/cjs/hooks/useSCFetchCategory.js +68 -0
- package/lib/cjs/hooks/useSCFetchCommentObject.js +68 -0
- package/lib/cjs/hooks/useSCFetchCommentObjects.js +296 -0
- package/lib/cjs/hooks/useSCFetchCustomAdv.js +84 -0
- package/lib/cjs/hooks/useSCFetchFeedObject.js +79 -0
- package/lib/cjs/hooks/useSCFetchIncubator.js +68 -0
- package/lib/cjs/hooks/useSCFetchTag.js +68 -0
- package/lib/cjs/hooks/useSCFetchUser.js +68 -0
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.js +162 -0
- package/lib/cjs/hooks/useSCFollowersManager.js +232 -0
- package/lib/cjs/hooks/useSCMediaClick.js +27 -0
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js +165 -0
- package/lib/cjs/hooks/useSCWebPushMessaging.js +286 -0
- package/lib/cjs/hooks/useSCWebSocket.js +120 -0
- package/lib/cjs/index.js +169 -0
- package/lib/cjs/scss/styles.scss +1 -0
- package/lib/cjs/themes/theme.js +165 -0
- package/lib/cjs/types/context.js +3 -0
- package/lib/cjs/types/index.js +22 -0
- package/lib/cjs/utils/errors.js +196 -0
- package/lib/cjs/utils/locale.js +56 -0
- package/lib/cjs/utils/logger.js +32 -0
- package/lib/cjs/utils/object.js +44 -0
- package/lib/cjs/utils/session.js +17 -0
- package/lib/cjs/utils/string.js +57 -0
- package/lib/cjs/utils/url.js +70 -0
- package/lib/cjs/utils/user.js +83 -0
- package/lib/cjs/utils/validator.js +771 -0
- package/lib/cjs/utils/webPushMessaging.js +110 -0
- package/lib/cjs/utils/websocket.js +307 -0
- package/lib/esm/api-services/src/client/index.d.ts +115 -0
- package/lib/esm/api-services/src/client/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/constants/Endpoints.d.ts +10 -0
- package/lib/esm/api-services/src/constants/Endpoints.d.ts.map +1 -0
- package/lib/esm/api-services/src/index.d.ts +24 -0
- package/lib/esm/api-services/src/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/category/index.d.ts +13 -0
- package/lib/esm/api-services/src/services/category/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/feature/index.d.ts +10 -0
- package/lib/esm/api-services/src/services/feature/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/preference/index.d.ts +16 -0
- package/lib/esm/api-services/src/services/preference/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/user/index.d.ts +16 -0
- package/lib/esm/api-services/src/services/user/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/utils/http.d.ts +6 -0
- package/lib/esm/api-services/src/utils/http.d.ts.map +1 -0
- package/lib/esm/api-services/src/utils/token.d.ts +16 -0
- package/lib/esm/api-services/src/utils/token.d.ts.map +1 -0
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js +67 -0
- package/lib/esm/components/provider/SCContextProvider/index.js +117 -0
- package/lib/esm/components/provider/SCLocaleProvider/index.js +158 -0
- package/lib/esm/components/provider/SCNotificationProvider/index.js +73 -0
- package/lib/esm/components/provider/SCPreferencesProvider/index.js +93 -0
- package/lib/esm/components/provider/SCRoutingProvider/index.js +146 -0
- package/lib/esm/components/provider/SCThemeProvider/index.js +123 -0
- package/lib/esm/components/provider/SCUserProvider/index.js +310 -0
- package/lib/esm/components/router/index.js +91 -0
- package/lib/esm/constants/Actions.js +6 -0
- package/lib/esm/constants/ContextProviders.js +29 -0
- package/lib/esm/constants/Device.js +11 -0
- package/lib/esm/constants/Errors.js +10 -0
- package/lib/esm/constants/Features.js +84 -0
- package/lib/esm/constants/Locale.js +19 -0
- package/lib/esm/constants/Notification.js +67 -0
- package/lib/esm/constants/Notifications.js +27 -0
- package/lib/esm/constants/Preferences.js +344 -0
- package/lib/esm/constants/Routes.js +68 -0
- package/lib/esm/constants/Session.js +22 -0
- package/lib/esm/constants/Theme.js +6 -0
- package/lib/esm/constants/WebSocket.js +10 -0
- package/lib/esm/hooks/useSCAuth.js +340 -0
- package/lib/esm/hooks/useSCCachingManager.js +58 -0
- package/lib/esm/hooks/useSCConnectionsManager.js +285 -0
- package/lib/esm/hooks/useSCFetchCategories.js +71 -0
- package/lib/esm/hooks/useSCFetchCategory.js +68 -0
- package/lib/esm/hooks/useSCFetchCommentObject.js +68 -0
- package/lib/esm/hooks/useSCFetchCommentObjects.js +296 -0
- package/lib/esm/hooks/useSCFetchCustomAdv.js +84 -0
- package/lib/esm/hooks/useSCFetchFeedObject.js +79 -0
- package/lib/esm/hooks/useSCFetchIncubator.js +68 -0
- package/lib/esm/hooks/useSCFetchTag.js +68 -0
- package/lib/esm/hooks/useSCFetchUser.js +68 -0
- package/lib/esm/hooks/useSCFollowedCategoriesManager.js +162 -0
- package/lib/esm/hooks/useSCFollowersManager.js +232 -0
- package/lib/esm/hooks/useSCMediaClick.js +27 -0
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js +165 -0
- package/lib/esm/hooks/useSCWebPushMessaging.js +286 -0
- package/lib/esm/hooks/useSCWebSocket.js +120 -0
- package/lib/esm/index.js +169 -0
- package/lib/esm/react-core/src/components/provider/SCAlertMessagesProvider/index.d.ts +37 -0
- package/lib/esm/react-core/src/components/provider/SCAlertMessagesProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/provider/SCContextProvider/index.d.ts +35 -0
- package/lib/esm/react-core/src/components/provider/SCContextProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/provider/SCLocaleProvider/index.d.ts +42 -0
- package/lib/esm/react-core/src/components/provider/SCLocaleProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/provider/SCNotificationProvider/index.d.ts +37 -0
- package/lib/esm/react-core/src/components/provider/SCNotificationProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/provider/SCPreferencesProvider/index.d.ts +38 -0
- package/lib/esm/react-core/src/components/provider/SCPreferencesProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/provider/SCRoutingProvider/index.d.ts +39 -0
- package/lib/esm/react-core/src/components/provider/SCRoutingProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/provider/SCThemeProvider/index.d.ts +49 -0
- package/lib/esm/react-core/src/components/provider/SCThemeProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/provider/SCUserProvider/index.d.ts +38 -0
- package/lib/esm/react-core/src/components/provider/SCUserProvider/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/components/router/index.d.ts +34 -0
- package/lib/esm/react-core/src/components/router/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Actions.d.ts +2 -0
- package/lib/esm/react-core/src/constants/Actions.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/ContextProviders.d.ts +6 -0
- package/lib/esm/react-core/src/constants/ContextProviders.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Device.d.ts +6 -0
- package/lib/esm/react-core/src/constants/Device.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Errors.d.ts +5 -0
- package/lib/esm/react-core/src/constants/Errors.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Features.d.ts +41 -0
- package/lib/esm/react-core/src/constants/Features.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Locale.d.ts +8 -0
- package/lib/esm/react-core/src/constants/Locale.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Notification.d.ts +55 -0
- package/lib/esm/react-core/src/constants/Notification.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Notifications.d.ts +11 -0
- package/lib/esm/react-core/src/constants/Notifications.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Routes.d.ts +29 -0
- package/lib/esm/react-core/src/constants/Routes.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Session.d.ts +10 -0
- package/lib/esm/react-core/src/constants/Session.d.ts.map +1 -0
- package/lib/esm/react-core/src/constants/Theme.d.ts +2 -0
- package/lib/esm/react-core/src/constants/Theme.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCAuth.d.ts +56 -0
- package/lib/esm/react-core/src/hooks/useSCAuth.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCCachingManager.d.ts +19 -0
- package/lib/esm/react-core/src/hooks/useSCCachingManager.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCConnectionsManager.d.ts +40 -0
- package/lib/esm/react-core/src/hooks/useSCConnectionsManager.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCategories.d.ts +17 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCategories.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCategory.d.ts +19 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCategory.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCommentObject.d.ts +19 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCommentObject.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCommentObjects.d.ts +54 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCommentObjects.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCustomAdv.d.ts +19 -0
- package/lib/esm/react-core/src/hooks/useSCFetchCustomAdv.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchFeedObject.d.ts +21 -0
- package/lib/esm/react-core/src/hooks/useSCFetchFeedObject.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchIncubator.d.ts +19 -0
- package/lib/esm/react-core/src/hooks/useSCFetchIncubator.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchTag.d.ts +19 -0
- package/lib/esm/react-core/src/hooks/useSCFetchTag.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFetchUser.d.ts +19 -0
- package/lib/esm/react-core/src/hooks/useSCFetchUser.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFollowedCategoriesManager.d.ts +37 -0
- package/lib/esm/react-core/src/hooks/useSCFollowedCategoriesManager.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCFollowersManager.d.ts +37 -0
- package/lib/esm/react-core/src/hooks/useSCFollowersManager.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCMediaClick.d.ts +4 -0
- package/lib/esm/react-core/src/hooks/useSCMediaClick.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCSubscribedIncubatorsManager.d.ts +27 -0
- package/lib/esm/react-core/src/hooks/useSCSubscribedIncubatorsManager.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCWebPushMessaging.d.ts +9 -0
- package/lib/esm/react-core/src/hooks/useSCWebPushMessaging.d.ts.map +1 -0
- package/lib/esm/react-core/src/hooks/useSCWebSocket.d.ts +12 -0
- package/lib/esm/react-core/src/hooks/useSCWebSocket.d.ts.map +1 -0
- package/lib/esm/react-core/src/index.d.ts +77 -0
- package/lib/esm/react-core/src/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/types/context.d.ts +428 -0
- package/lib/esm/react-core/src/types/context.d.ts.map +1 -0
- package/lib/esm/react-core/src/types/index.d.ts +3 -0
- package/lib/esm/react-core/src/types/index.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/errors.d.ts +98 -0
- package/lib/esm/react-core/src/utils/errors.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/locale.d.ts +10 -0
- package/lib/esm/react-core/src/utils/locale.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/logger.d.ts +11 -0
- package/lib/esm/react-core/src/utils/logger.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/object.d.ts +13 -0
- package/lib/esm/react-core/src/utils/object.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/session.d.ts +6 -0
- package/lib/esm/react-core/src/utils/session.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/string.d.ts +21 -0
- package/lib/esm/react-core/src/utils/string.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/url.d.ts +22 -0
- package/lib/esm/react-core/src/utils/url.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/user.d.ts +41 -0
- package/lib/esm/react-core/src/utils/user.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/validator.d.ts +239 -0
- package/lib/esm/react-core/src/utils/validator.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/webPushMessaging.d.ts +14 -0
- package/lib/esm/react-core/src/utils/webPushMessaging.d.ts.map +1 -0
- package/lib/esm/react-core/src/utils/websocket.d.ts +177 -0
- package/lib/esm/react-core/src/utils/websocket.d.ts.map +1 -0
- package/lib/esm/react-i18n/src/index.d.ts +815 -0
- package/lib/esm/react-i18n/src/index.d.ts.map +1 -0
- package/lib/esm/scss/styles.scss +1 -0
- package/lib/esm/themes/theme.js +165 -0
- package/lib/esm/types/context.js +3 -0
- package/lib/esm/types/index.js +22 -0
- package/lib/esm/types/src/index.d.ts +9 -0
- package/lib/esm/types/src/index.d.ts.map +1 -0
- package/lib/esm/types/src/types/auth.d.ts +26 -0
- package/lib/esm/types/src/types/auth.d.ts.map +1 -0
- package/lib/esm/types/src/types/broadcastMessage.d.ts +73 -0
- package/lib/esm/types/src/types/broadcastMessage.d.ts.map +1 -0
- package/lib/esm/types/src/types/category.d.ts +100 -0
- package/lib/esm/types/src/types/category.d.ts.map +1 -0
- package/lib/esm/types/src/types/comment.d.ts +97 -0
- package/lib/esm/types/src/types/comment.d.ts.map +1 -0
- package/lib/esm/types/src/types/customAdv.d.ts +53 -0
- package/lib/esm/types/src/types/customAdv.d.ts.map +1 -0
- package/lib/esm/types/src/types/customNotification.d.ts +28 -0
- package/lib/esm/types/src/types/customNotification.d.ts.map +1 -0
- package/lib/esm/types/src/types/embed.d.ts +33 -0
- package/lib/esm/types/src/types/embed.d.ts.map +1 -0
- package/lib/esm/types/src/types/feed.d.ts +208 -0
- package/lib/esm/types/src/types/feed.d.ts.map +1 -0
- package/lib/esm/types/src/types/incubator.d.ts +53 -0
- package/lib/esm/types/src/types/incubator.d.ts.map +1 -0
- package/lib/esm/types/src/types/index.d.ts +22 -0
- package/lib/esm/types/src/types/index.d.ts.map +1 -0
- package/lib/esm/types/src/types/location.d.ts +61 -0
- package/lib/esm/types/src/types/location.d.ts.map +1 -0
- package/lib/esm/types/src/types/media.d.ts +52 -0
- package/lib/esm/types/src/types/media.d.ts.map +1 -0
- package/lib/esm/types/src/types/notification.d.ts +416 -0
- package/lib/esm/types/src/types/notification.d.ts.map +1 -0
- package/lib/esm/types/src/types/poll.d.ts +77 -0
- package/lib/esm/types/src/types/poll.d.ts.map +1 -0
- package/lib/esm/types/src/types/privateMessage.d.ts +109 -0
- package/lib/esm/types/src/types/privateMessage.d.ts.map +1 -0
- package/lib/esm/types/src/types/prize.d.ts +48 -0
- package/lib/esm/types/src/types/prize.d.ts.map +1 -0
- package/lib/esm/types/src/types/tag.d.ts +47 -0
- package/lib/esm/types/src/types/tag.d.ts.map +1 -0
- package/lib/esm/types/src/types/user.d.ts +227 -0
- package/lib/esm/types/src/types/user.d.ts.map +1 -0
- package/lib/esm/utils/errors.js +196 -0
- package/lib/esm/utils/locale.js +56 -0
- package/lib/esm/utils/logger.js +32 -0
- package/lib/esm/utils/object.js +44 -0
- package/lib/esm/utils/session.js +17 -0
- package/lib/esm/utils/src/index.d.ts +7 -0
- package/lib/esm/utils/src/index.d.ts.map +1 -0
- package/lib/esm/utils/src/utils/string.d.ts +21 -0
- package/lib/esm/utils/src/utils/string.d.ts.map +1 -0
- package/lib/esm/utils/src/utils/url.d.ts +22 -0
- package/lib/esm/utils/src/utils/url.d.ts.map +1 -0
- package/lib/esm/utils/string.js +57 -0
- package/lib/esm/utils/url.js +70 -0
- package/lib/esm/utils/user.js +83 -0
- package/lib/esm/utils/validator.js +771 -0
- package/lib/esm/utils/webPushMessaging.js +110 -0
- package/lib/esm/utils/websocket.js +307 -0
- package/lib/umd/react-core.js +2 -0
- package/lib/umd/react-core.js.LICENSE.txt +1 -0
- package/package.json +128 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = useSCWebPushMessaging;
|
|
5
|
+
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
|
|
8
|
+
var _SCContextProvider = require("../components/provider/SCContextProvider");
|
|
9
|
+
|
|
10
|
+
var _SCUserProvider = require("../components/provider/SCUserProvider");
|
|
11
|
+
|
|
12
|
+
var _logger = require("../utils/logger");
|
|
13
|
+
|
|
14
|
+
var _webPushMessaging = require("../utils/webPushMessaging");
|
|
15
|
+
|
|
16
|
+
var _Errors = require("../constants/Errors");
|
|
17
|
+
|
|
18
|
+
var _apiServices = require("@selfcommunity/api-services");
|
|
19
|
+
|
|
20
|
+
var _Device = require("../constants/Device");
|
|
21
|
+
|
|
22
|
+
var _SCPreferencesProvider = require("../components/provider/SCPreferencesProvider");
|
|
23
|
+
|
|
24
|
+
var SCPreferences = _interopRequireWildcard(require("../constants/Preferences"));
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
:::info
|
|
32
|
+
This custom hook is used to to init web push messaging.
|
|
33
|
+
:::
|
|
34
|
+
*/
|
|
35
|
+
function useSCWebPushMessaging() {
|
|
36
|
+
// CONTEXT
|
|
37
|
+
const scContext = (0, _SCContextProvider.useSCContext)();
|
|
38
|
+
const scUserContext = (0, _SCUserProvider.useSCUser)();
|
|
39
|
+
const scPreferencesContext = (0, _react.useContext)(_SCPreferencesProvider.SCPreferencesContext); // STATE
|
|
40
|
+
|
|
41
|
+
const [wpSubscription, setWpSubscription] = (0, _react.useState)(null); // REFS
|
|
42
|
+
|
|
43
|
+
const subAttempts = (0, _react.useRef)(0); // CONST
|
|
44
|
+
|
|
45
|
+
const applicationServerKey = scContext.settings.notifications.webPushMessaging.applicationServerKey !== undefined ? scContext.settings.notifications.webPushMessaging.applicationServerKey : SCPreferences.PROVIDERS_WEB_PUSH_PUBLIC_KEY in scPreferencesContext.preferences ? scPreferencesContext.preferences[SCPreferences.PROVIDERS_WEB_PUSH_PUBLIC_KEY].value : null;
|
|
46
|
+
const webPushEnabled = SCPreferences.PROVIDERS_WEB_PUSH_ENABLED in scPreferencesContext.preferences && scPreferencesContext.preferences[SCPreferences.PROVIDERS_WEB_PUSH_ENABLED].value ? scPreferencesContext.preferences[SCPreferences.PROVIDERS_WEB_PUSH_ENABLED].value : false;
|
|
47
|
+
/**
|
|
48
|
+
* perform update the Subscription
|
|
49
|
+
* @param data
|
|
50
|
+
* @param remove
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
const performUpdateSubscription = (data, remove) => {
|
|
54
|
+
const url = remove ? _apiServices.Endpoints.DeleteDevice.url({
|
|
55
|
+
type: _Device.WEB_PUSH_NOTIFICATION_DEVICE_TYPE,
|
|
56
|
+
id: data.registration_id
|
|
57
|
+
}) : _apiServices.Endpoints.NewDevice.url({
|
|
58
|
+
type: _Device.WEB_PUSH_NOTIFICATION_DEVICE_TYPE
|
|
59
|
+
});
|
|
60
|
+
const method = remove ? _apiServices.Endpoints.DeleteDevice.method : _apiServices.Endpoints.NewDevice.method;
|
|
61
|
+
return _apiServices.http.request(Object.assign({
|
|
62
|
+
url,
|
|
63
|
+
method
|
|
64
|
+
}, remove ? {} : {
|
|
65
|
+
data: data
|
|
66
|
+
})).then(res => {
|
|
67
|
+
if (res.status >= 300) {
|
|
68
|
+
return Promise.reject(res);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return Promise.resolve(res.data);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* updateSubscriptionOnServer to sync current subscription
|
|
76
|
+
* @param sub
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const updateSubscriptionOnServer = (sub, remove) => {
|
|
81
|
+
const browser = (0, _webPushMessaging.loadVersionBrowser)();
|
|
82
|
+
const endpointParts = sub.endpoint.split('/');
|
|
83
|
+
const registration_id = endpointParts[endpointParts.length - 1];
|
|
84
|
+
const data = {
|
|
85
|
+
browser: browser.name.toUpperCase(),
|
|
86
|
+
p256dh: btoa(String.fromCharCode.apply(null, new Uint8Array(sub.getKey('p256dh')))),
|
|
87
|
+
auth: btoa(String.fromCharCode.apply(null, new Uint8Array(sub.getKey('auth')))),
|
|
88
|
+
user: scUserContext.user ? scUserContext.user.username : '',
|
|
89
|
+
registration_id: registration_id
|
|
90
|
+
};
|
|
91
|
+
return performUpdateSubscription(data, remove).then(res => {
|
|
92
|
+
if (remove) {
|
|
93
|
+
setWpSubscription(null);
|
|
94
|
+
} else {
|
|
95
|
+
setWpSubscription(res);
|
|
96
|
+
}
|
|
97
|
+
}).catch(e => {
|
|
98
|
+
_logger.Logger.error(_Errors.SCOPE_SC_CORE, e);
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Unsubscribe
|
|
103
|
+
* @param callback
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
const unsubscribe = (callback = null) => {
|
|
108
|
+
navigator.serviceWorker.ready.then(function (serviceWorkerRegistration) {
|
|
109
|
+
// To unsubscribe from push messaging, you need get the
|
|
110
|
+
// subcription object, which you can call unsubscribe() on.
|
|
111
|
+
serviceWorkerRegistration.pushManager.getSubscription().then(pushSubscription => {
|
|
112
|
+
// Check we have a subscription to unsubscribe
|
|
113
|
+
if (!pushSubscription) {
|
|
114
|
+
// No subscription object, so set the state
|
|
115
|
+
// to allow the user to subscribe to push
|
|
116
|
+
return;
|
|
117
|
+
} // We have a subscription, so call unsubscribe on it
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
pushSubscription.unsubscribe().then(() => {
|
|
121
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, 'Unsubscription successfully'); // Request to server to remove
|
|
122
|
+
// the users data from your data store so you
|
|
123
|
+
// don't attempt to send them push messages anymore
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
updateSubscriptionOnServer(pushSubscription, true).then(() => {
|
|
127
|
+
callback && callback();
|
|
128
|
+
});
|
|
129
|
+
}).catch(function (e) {
|
|
130
|
+
// We failed to unsubscribe, this can lead to
|
|
131
|
+
// an unusual state, so may be best to remove
|
|
132
|
+
// the subscription id from your data store and
|
|
133
|
+
// inform the user that you disabled push
|
|
134
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, `Unsubscription error.`);
|
|
135
|
+
|
|
136
|
+
console.log(e);
|
|
137
|
+
});
|
|
138
|
+
}).catch(function (e) {
|
|
139
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, `Error thrown while unsubscribing from push messaging. ${e}`);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Get subscription
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
const subscribe = () => {
|
|
149
|
+
navigator.serviceWorker.ready.then(function (serviceWorkerRegistration) {
|
|
150
|
+
serviceWorkerRegistration.pushManager.subscribe({
|
|
151
|
+
userVisibleOnly: true,
|
|
152
|
+
applicationServerKey: (0, _webPushMessaging.urlB64ToUint8Array)(applicationServerKey)
|
|
153
|
+
}).then(function (subscription) {
|
|
154
|
+
if (!subscription) {
|
|
155
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, 'We aren’t subscribed to push.');
|
|
156
|
+
} else {
|
|
157
|
+
updateSubscriptionOnServer(subscription, false);
|
|
158
|
+
}
|
|
159
|
+
}).catch(function (e) {
|
|
160
|
+
if (Notification.permission === 'denied') {
|
|
161
|
+
// The user denied the notification permission which
|
|
162
|
+
// means we failed to subscribe and the user will need
|
|
163
|
+
// to manually change the notification permission to
|
|
164
|
+
// subscribe to push messages
|
|
165
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, 'Permission for Notifications was denied');
|
|
166
|
+
} else {
|
|
167
|
+
// A problem occurred with the subscription
|
|
168
|
+
subAttempts.current += 1;
|
|
169
|
+
|
|
170
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, `Unable to subscribe(${subAttempts.current}) to push. ${e}`);
|
|
171
|
+
|
|
172
|
+
if (subAttempts.current < 3) {
|
|
173
|
+
unsubscribe(() => subscribe());
|
|
174
|
+
} else {
|
|
175
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, `Unable to subscribe to push. ${e}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Request web push notification permission
|
|
183
|
+
* @type {(function(): void)|*}
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
const requestNotificationPermission = () => {
|
|
188
|
+
if (Notification.permission !== 'granted') {
|
|
189
|
+
Notification.requestPermission().then(function (permission) {
|
|
190
|
+
if (permission === 'granted') {
|
|
191
|
+
navigator.serviceWorker.ready.then(serviceWorkerRegistration => {
|
|
192
|
+
// Do we already have a push message subscription?
|
|
193
|
+
serviceWorkerRegistration.pushManager.getSubscription().then(function (subscription) {
|
|
194
|
+
// Enable any UI which subscribes / unsubscribes from
|
|
195
|
+
// push messages.
|
|
196
|
+
if (!subscription) {
|
|
197
|
+
subscribe();
|
|
198
|
+
return;
|
|
199
|
+
} // Keep your server in sync with the latest subscription
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
updateSubscriptionOnServer(subscription, false);
|
|
203
|
+
}).catch(err => {
|
|
204
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, 'Error during getSubscription()');
|
|
205
|
+
|
|
206
|
+
console.log(err);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
} else {
|
|
210
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, 'Permission for Notifications was denied');
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Initialize state
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
const initialiseState = () => {
|
|
221
|
+
/**
|
|
222
|
+
* Check if Notifications supported in the service worker
|
|
223
|
+
*/
|
|
224
|
+
if (!('showNotification' in ServiceWorkerRegistration.prototype)) {
|
|
225
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, "Notifications aren't supported.");
|
|
226
|
+
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Features, such as service workers and push notifications, require HTTPS secure domains,
|
|
231
|
+
* so your development environment must serve content over HTTPS to match a production environment.
|
|
232
|
+
* Check if push messaging is supported.
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
if (!('PushManager' in window && 'serviceWorker' in navigator)) {
|
|
237
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, "Service Worker or Push messaging aren't supported.");
|
|
238
|
+
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Check the current Notification permission.
|
|
243
|
+
* If its denied, it's a permanent block until the user changes the permission
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
if (Notification.permission === 'denied') {
|
|
248
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, 'The user has blocked notifications.');
|
|
249
|
+
|
|
250
|
+
return;
|
|
251
|
+
} else {
|
|
252
|
+
if (Notification.permission === 'default') {
|
|
253
|
+
_logger.Logger.info(_Errors.SCOPE_SC_CORE, 'Request permission.');
|
|
254
|
+
|
|
255
|
+
requestNotificationPermission();
|
|
256
|
+
} else if (Notification.permission === 'granted') {
|
|
257
|
+
subscribe();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Init state web push subscription
|
|
263
|
+
* If web push enabled, applicationServerKey and user is logged, check subscription
|
|
264
|
+
*/
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
(0, _react.useEffect)(() => {
|
|
268
|
+
if (!wpSubscription && !scContext.settings.notifications.webPushMessaging.disableToastMessage && scUserContext.user) {
|
|
269
|
+
if (!webPushEnabled) {
|
|
270
|
+
_logger.Logger.warn(_Errors.SCOPE_SC_CORE, 'This instance is not configured to support notifications. Enable this feature.');
|
|
271
|
+
} else if (!applicationServerKey) {
|
|
272
|
+
_logger.Logger.warn(_Errors.SCOPE_SC_CORE, 'Invalid or missing applicationServerKey. Check the configuration that is passed to the SCContextProvider.');
|
|
273
|
+
} else {
|
|
274
|
+
initialiseState();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (!scUserContext.user && wpSubscription) {
|
|
279
|
+
// Unsubscribe if user not in session
|
|
280
|
+
unsubscribe();
|
|
281
|
+
}
|
|
282
|
+
}, [scUserContext.user, scContext.settings.notifications.webPushMessaging, wpSubscription]);
|
|
283
|
+
return {
|
|
284
|
+
wpSubscription
|
|
285
|
+
};
|
|
286
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = useSCWebSocket;
|
|
5
|
+
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
|
|
8
|
+
var _types = require("@selfcommunity/types");
|
|
9
|
+
|
|
10
|
+
var _SCContextProvider = require("../components/provider/SCContextProvider");
|
|
11
|
+
|
|
12
|
+
var _SCUserProvider = require("../components/provider/SCUserProvider");
|
|
13
|
+
|
|
14
|
+
var _websocket = _interopRequireDefault(require("../utils/websocket"));
|
|
15
|
+
|
|
16
|
+
var _Notification = require("../constants/Notification");
|
|
17
|
+
|
|
18
|
+
var _WebSocket = require("../constants/WebSocket");
|
|
19
|
+
|
|
20
|
+
var _pubsubJs = _interopRequireDefault(require("pubsub-js"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
:::info
|
|
26
|
+
This custom hook is used to to init web socket.
|
|
27
|
+
:::
|
|
28
|
+
*/
|
|
29
|
+
function useSCWebSocket() {
|
|
30
|
+
const scContext = (0, _SCContextProvider.useSCContext)();
|
|
31
|
+
const scUserContext = (0, _SCUserProvider.useSCUser)();
|
|
32
|
+
const [wsInstance, setWsInstance] = (0, _react.useState)(null); // Websocket uri and protocols
|
|
33
|
+
|
|
34
|
+
const _wsUri = `wss://${new URL(scContext.settings.portal).hostname}/ws/${_WebSocket.WS_FACILITY_NOTIFY}?subscribe-user`;
|
|
35
|
+
|
|
36
|
+
const _wsProtocol = scContext.settings.session.authToken && scContext.settings.session.authToken.accessToken ? `${_WebSocket.WS_PROTOCOL_PREFIX}${scContext.settings.session.authToken.accessToken}` : null;
|
|
37
|
+
/**
|
|
38
|
+
* Before document unload handler
|
|
39
|
+
* Close webSocket
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
const handleBeforeUnload = () => {
|
|
44
|
+
wsInstance && wsInstance.close();
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Check if there is a currently active session and a
|
|
48
|
+
* wsInstance connection when the provider is mounted for the first time.
|
|
49
|
+
* If there is an error, it means there is no session.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
(0, _react.useEffect)(() => {
|
|
54
|
+
if (scUserContext.user && !wsInstance && _wsUri && _wsProtocol) {
|
|
55
|
+
setWsInstance(_websocket.default.getInstance({
|
|
56
|
+
uri: _wsUri,
|
|
57
|
+
heartbeatMsg: _WebSocket.WS_HEARTBEAT_MESSAGE,
|
|
58
|
+
protocols: [_wsProtocol],
|
|
59
|
+
receiveMessage: receiveMessage
|
|
60
|
+
})); // Close the socket channel before window unload
|
|
61
|
+
|
|
62
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!scUserContext.user && wsInstance) {
|
|
66
|
+
// Disconnect the socket
|
|
67
|
+
window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
68
|
+
wsInstance && wsInstance.close();
|
|
69
|
+
}
|
|
70
|
+
}, [scUserContext.user]);
|
|
71
|
+
/**
|
|
72
|
+
* Receive a message from wsInstance.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
const receiveMessage = data => {
|
|
76
|
+
// receive a message though the websocket from the server
|
|
77
|
+
let _data = JSON.parse(data);
|
|
78
|
+
|
|
79
|
+
if (_data && _data.type && _Notification.SCNotificationTopics.includes(_data.type)) {
|
|
80
|
+
if (_data.type === _types.SCNotificationTopicType.INTERACTION) {
|
|
81
|
+
/**
|
|
82
|
+
* With topic interaction there are two types of notifications group:
|
|
83
|
+
* - notification_banner
|
|
84
|
+
* - comment, nested_comment, follow, etc..
|
|
85
|
+
*/
|
|
86
|
+
if (_data.data.activity_type === _types.SCNotificationTypologyType.NOTIFICATION_BANNER) {
|
|
87
|
+
/**
|
|
88
|
+
* Notification of type 'notification_banner'
|
|
89
|
+
* It is a special case of notifications with topic 'interaction'
|
|
90
|
+
*/
|
|
91
|
+
_pubsubJs.default.publish(`${_data.type}.${_types.SCNotificationTypologyType.NOTIFICATION_BANNER}`, _data);
|
|
92
|
+
} else if (_Notification.SCNotificationMapping[_data.data.activity_type]) {
|
|
93
|
+
/**
|
|
94
|
+
* Notification of type 'comment', 'nested_comment', etc...
|
|
95
|
+
*/
|
|
96
|
+
_pubsubJs.default.publish(`${_data.type}.${_Notification.SCNotificationMapping[_data.data.activity_type]}`, _data);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
setNotificationCounters(_data.data);
|
|
100
|
+
} else {
|
|
101
|
+
_pubsubJs.default.publish(`${_data.type}`, _data);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Update user context counters
|
|
107
|
+
* @param payload
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
const setNotificationCounters = payload => {
|
|
112
|
+
payload.count_interactions !== undefined && scUserContext.setUnseenInteractionsCounter(payload.count_interactions);
|
|
113
|
+
payload.count_notification_banners !== undefined && scUserContext.setUnseenInteractionsCounter(payload.count_notification_banners);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
wsInstance,
|
|
118
|
+
setWsInstance
|
|
119
|
+
};
|
|
120
|
+
}
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.UserUtils = exports.UrlUtils = exports.StringUtils = exports.SCRoutes = exports.SCPreferences = exports.SCNotification = exports.SCFeatures = exports.ObjectUtils = exports.Locale = void 0;
|
|
5
|
+
|
|
6
|
+
var _types = require("./types");
|
|
7
|
+
|
|
8
|
+
exports.SCUserContextType = _types.SCUserContextType;
|
|
9
|
+
exports.SCFollowedCategoriesManagerType = _types.SCFollowedCategoriesManagerType;
|
|
10
|
+
exports.SCContextProviderType = _types.SCContextProviderType;
|
|
11
|
+
exports.SCContextType = _types.SCContextType;
|
|
12
|
+
exports.SCSettingsType = _types.SCSettingsType;
|
|
13
|
+
exports.SCSessionType = _types.SCSessionType;
|
|
14
|
+
exports.SCFollowedManagerType = _types.SCFollowedManagerType;
|
|
15
|
+
exports.SCConnectionsManagerType = _types.SCConnectionsManagerType;
|
|
16
|
+
exports.SCSubscribedIncubatorsManagerType = _types.SCSubscribedIncubatorsManagerType;
|
|
17
|
+
exports.SCLocaleType = _types.SCLocaleType;
|
|
18
|
+
exports.SCNotificationContextType = _types.SCNotificationContextType;
|
|
19
|
+
exports.SCPreferencesContextType = _types.SCPreferencesContextType;
|
|
20
|
+
exports.SCThemeContextType = _types.SCThemeContextType;
|
|
21
|
+
exports.SCRoutingContextType = _types.SCRoutingContextType;
|
|
22
|
+
exports.SCLocaleContextType = _types.SCLocaleContextType;
|
|
23
|
+
exports.SCAlertMessagesContextType = _types.SCAlertMessagesContextType;
|
|
24
|
+
|
|
25
|
+
var _SCContextProvider = _interopRequireWildcard(require("./components/provider/SCContextProvider"));
|
|
26
|
+
|
|
27
|
+
exports.SCContextProvider = _SCContextProvider.default;
|
|
28
|
+
exports.SCContext = _SCContextProvider.SCContext;
|
|
29
|
+
exports.useSCContext = _SCContextProvider.useSCContext;
|
|
30
|
+
|
|
31
|
+
var _SCUserProvider = _interopRequireWildcard(require("./components/provider/SCUserProvider"));
|
|
32
|
+
|
|
33
|
+
exports.SCUserProvider = _SCUserProvider.default;
|
|
34
|
+
exports.SCUserContext = _SCUserProvider.SCUserContext;
|
|
35
|
+
exports.useSCUser = _SCUserProvider.useSCUser;
|
|
36
|
+
|
|
37
|
+
var _SCThemeProvider = _interopRequireWildcard(require("./components/provider/SCThemeProvider"));
|
|
38
|
+
|
|
39
|
+
exports.SCThemeProvider = _SCThemeProvider.default;
|
|
40
|
+
exports.SCThemeContext = _SCThemeProvider.SCThemeContext;
|
|
41
|
+
exports.useSCTheme = _SCThemeProvider.useSCTheme;
|
|
42
|
+
exports.withSCTheme = _SCThemeProvider.withSCTheme;
|
|
43
|
+
|
|
44
|
+
var _SCRoutingProvider = _interopRequireWildcard(require("./components/provider/SCRoutingProvider"));
|
|
45
|
+
|
|
46
|
+
exports.SCRoutingProvider = _SCRoutingProvider.default;
|
|
47
|
+
exports.SCRoutingContext = _SCRoutingProvider.SCRoutingContext;
|
|
48
|
+
exports.useSCRouting = _SCRoutingProvider.useSCRouting;
|
|
49
|
+
|
|
50
|
+
var _SCLocaleProvider = _interopRequireWildcard(require("./components/provider/SCLocaleProvider"));
|
|
51
|
+
|
|
52
|
+
exports.SCLocaleProvider = _SCLocaleProvider.default;
|
|
53
|
+
exports.SCLocaleContext = _SCLocaleProvider.SCLocaleContext;
|
|
54
|
+
exports.useSCLocale = _SCLocaleProvider.useSCLocale;
|
|
55
|
+
exports.withSCLocale = _SCLocaleProvider.withSCLocale;
|
|
56
|
+
|
|
57
|
+
var _SCNotificationProvider = _interopRequireWildcard(require("./components/provider/SCNotificationProvider"));
|
|
58
|
+
|
|
59
|
+
exports.SCNotificationProvider = _SCNotificationProvider.default;
|
|
60
|
+
exports.SCNotificationContext = _SCNotificationProvider.SCNotificationContext;
|
|
61
|
+
exports.useSCNotification = _SCNotificationProvider.useSCNotification;
|
|
62
|
+
|
|
63
|
+
var _SCAlertMessagesProvider = _interopRequireWildcard(require("./components/provider/SCAlertMessagesProvider"));
|
|
64
|
+
|
|
65
|
+
exports.SCAlertMessagesProvider = _SCAlertMessagesProvider.default;
|
|
66
|
+
exports.SCAlertMessagesContext = _SCAlertMessagesProvider.SCAlertMessagesContext;
|
|
67
|
+
exports.useSCAlertMessages = _SCAlertMessagesProvider.useSCAlertMessages;
|
|
68
|
+
|
|
69
|
+
var _SCPreferencesProvider = _interopRequireWildcard(require("./components/provider/SCPreferencesProvider"));
|
|
70
|
+
|
|
71
|
+
exports.SCPreferencesProvider = _SCPreferencesProvider.default;
|
|
72
|
+
exports.SCPreferencesContext = _SCPreferencesProvider.SCPreferencesContext;
|
|
73
|
+
exports.useSCPreferences = _SCPreferencesProvider.useSCPreferences;
|
|
74
|
+
|
|
75
|
+
var SCPreferences = _interopRequireWildcard(require("./constants/Preferences"));
|
|
76
|
+
|
|
77
|
+
exports.SCPreferences = SCPreferences;
|
|
78
|
+
|
|
79
|
+
var SCFeatures = _interopRequireWildcard(require("./constants/Features"));
|
|
80
|
+
|
|
81
|
+
exports.SCFeatures = SCFeatures;
|
|
82
|
+
|
|
83
|
+
var SCNotification = _interopRequireWildcard(require("./constants/Notification"));
|
|
84
|
+
|
|
85
|
+
exports.SCNotification = SCNotification;
|
|
86
|
+
|
|
87
|
+
var _useSCFetchUser = _interopRequireDefault(require("./hooks/useSCFetchUser"));
|
|
88
|
+
|
|
89
|
+
exports.useSCFetchUser = _useSCFetchUser.default;
|
|
90
|
+
|
|
91
|
+
var _useSCFetchFeedObject = _interopRequireDefault(require("./hooks/useSCFetchFeedObject"));
|
|
92
|
+
|
|
93
|
+
exports.useSCFetchFeedObject = _useSCFetchFeedObject.default;
|
|
94
|
+
|
|
95
|
+
var _useSCFetchCommentObject = _interopRequireDefault(require("./hooks/useSCFetchCommentObject"));
|
|
96
|
+
|
|
97
|
+
exports.useSCFetchCommentObject = _useSCFetchCommentObject.default;
|
|
98
|
+
|
|
99
|
+
var _useSCFetchCommentObjects = _interopRequireDefault(require("./hooks/useSCFetchCommentObjects"));
|
|
100
|
+
|
|
101
|
+
exports.useSCFetchCommentObjects = _useSCFetchCommentObjects.default;
|
|
102
|
+
|
|
103
|
+
var _useSCFetchCustomAdv = _interopRequireDefault(require("./hooks/useSCFetchCustomAdv"));
|
|
104
|
+
|
|
105
|
+
exports.useSCFetchCustomAdv = _useSCFetchCustomAdv.default;
|
|
106
|
+
|
|
107
|
+
var _useSCFetchTag = _interopRequireDefault(require("./hooks/useSCFetchTag"));
|
|
108
|
+
|
|
109
|
+
exports.useSCFetchTag = _useSCFetchTag.default;
|
|
110
|
+
|
|
111
|
+
var _useSCFetchCategory = _interopRequireDefault(require("./hooks/useSCFetchCategory"));
|
|
112
|
+
|
|
113
|
+
exports.useSCFetchCategory = _useSCFetchCategory.default;
|
|
114
|
+
|
|
115
|
+
var _useSCFetchCategories = _interopRequireDefault(require("./hooks/useSCFetchCategories"));
|
|
116
|
+
|
|
117
|
+
exports.useSCFetchCategories = _useSCFetchCategories.default;
|
|
118
|
+
|
|
119
|
+
var _useSCFetchIncubator = _interopRequireDefault(require("./hooks/useSCFetchIncubator"));
|
|
120
|
+
|
|
121
|
+
exports.useSCFetchIncubator = _useSCFetchIncubator.default;
|
|
122
|
+
|
|
123
|
+
var _useSCMediaClick = _interopRequireDefault(require("./hooks/useSCMediaClick"));
|
|
124
|
+
|
|
125
|
+
exports.useSCMediaClick = _useSCMediaClick.default;
|
|
126
|
+
|
|
127
|
+
var _router = _interopRequireDefault(require("./components/router"));
|
|
128
|
+
|
|
129
|
+
exports.Link = _router.default;
|
|
130
|
+
|
|
131
|
+
var SCRoutes = _interopRequireWildcard(require("./constants/Routes"));
|
|
132
|
+
|
|
133
|
+
exports.SCRoutes = SCRoutes;
|
|
134
|
+
|
|
135
|
+
var _logger = require("./utils/logger");
|
|
136
|
+
|
|
137
|
+
exports.Logger = _logger.Logger;
|
|
138
|
+
|
|
139
|
+
var StringUtils = _interopRequireWildcard(require("./utils/string"));
|
|
140
|
+
|
|
141
|
+
exports.StringUtils = StringUtils;
|
|
142
|
+
|
|
143
|
+
var ObjectUtils = _interopRequireWildcard(require("./utils/object"));
|
|
144
|
+
|
|
145
|
+
exports.ObjectUtils = ObjectUtils;
|
|
146
|
+
|
|
147
|
+
var UrlUtils = _interopRequireWildcard(require("./utils/url"));
|
|
148
|
+
|
|
149
|
+
exports.UrlUtils = UrlUtils;
|
|
150
|
+
|
|
151
|
+
var UserUtils = _interopRequireWildcard(require("./utils/user"));
|
|
152
|
+
|
|
153
|
+
exports.UserUtils = UserUtils;
|
|
154
|
+
|
|
155
|
+
var _websocket = _interopRequireWildcard(require("./utils/websocket"));
|
|
156
|
+
|
|
157
|
+
exports.WSClient = _websocket.default;
|
|
158
|
+
exports.WSClientType = _websocket.WSClientType;
|
|
159
|
+
exports.WSClientPropTypes = _websocket.WSClientPropTypes;
|
|
160
|
+
|
|
161
|
+
var Locale = _interopRequireWildcard(require("./constants/Locale"));
|
|
162
|
+
|
|
163
|
+
exports.Locale = Locale;
|
|
164
|
+
|
|
165
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
166
|
+
|
|
167
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
168
|
+
|
|
169
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|