@selfcommunity/react-core 0.1.7 → 0.1.8-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/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js +37 -35
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCContextProvider/index.js +74 -81
- package/lib/cjs/components/provider/SCContextProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCLocaleProvider/index.js +86 -121
- package/lib/cjs/components/provider/SCLocaleProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCNotificationProvider/index.js +41 -41
- package/lib/cjs/components/provider/SCNotificationProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js +61 -62
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts.map +1 -1
- package/lib/cjs/components/provider/SCRoutingProvider/index.js +104 -111
- package/lib/cjs/components/provider/SCRoutingProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCThemeProvider/index.js +66 -79
- package/lib/cjs/components/provider/SCThemeProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCUserProvider/index.js +215 -270
- package/lib/cjs/components/provider/SCUserProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/router/index.d.ts +0 -0
- package/lib/{types → cjs}/components/router/index.d.ts.map +0 -0
- package/lib/cjs/components/router/index.js +48 -49
- package/lib/cjs/components/router/index.js.map +1 -0
- package/lib/{types → cjs}/constants/Actions.d.ts +0 -0
- package/lib/{types → cjs}/constants/Actions.d.ts.map +0 -0
- package/lib/cjs/constants/Actions.js +3 -4
- package/lib/cjs/constants/Actions.js.map +1 -0
- package/lib/{types → cjs}/constants/ContextProviders.d.ts +0 -0
- package/lib/{types → cjs}/constants/ContextProviders.d.ts.map +0 -0
- package/lib/cjs/constants/ContextProviders.js +22 -24
- package/lib/cjs/constants/ContextProviders.js.map +1 -0
- package/lib/{types → cjs}/constants/Device.d.ts +0 -0
- package/lib/{types → cjs}/constants/Device.d.ts.map +0 -0
- package/lib/cjs/constants/Device.js +3 -5
- package/lib/cjs/constants/Device.js.map +1 -0
- package/lib/{types → cjs}/constants/Errors.d.ts +0 -0
- package/lib/{types → cjs}/constants/Errors.d.ts.map +0 -0
- package/lib/cjs/constants/Errors.js +3 -5
- package/lib/cjs/constants/Errors.js.map +1 -0
- package/lib/{types → cjs}/constants/Features.d.ts +0 -0
- package/lib/{types → cjs}/constants/Features.d.ts.map +0 -0
- package/lib/cjs/constants/Features.js +43 -83
- package/lib/cjs/constants/Features.js.map +1 -0
- package/lib/{types → cjs}/constants/Locale.d.ts +0 -0
- package/lib/{types → cjs}/constants/Locale.d.ts.map +0 -0
- package/lib/cjs/constants/Locale.js +10 -17
- package/lib/cjs/constants/Locale.js.map +1 -0
- package/lib/{types → cjs}/constants/Notification.d.ts +0 -0
- package/lib/{types → cjs}/constants/Notification.d.ts.map +0 -0
- package/lib/cjs/constants/Notification.js +44 -53
- package/lib/cjs/constants/Notification.js.map +1 -0
- package/lib/{types → cjs}/constants/Notifications.d.ts +0 -0
- package/lib/{types → cjs}/constants/Notifications.d.ts.map +0 -0
- package/lib/cjs/constants/Notifications.js +11 -25
- package/lib/cjs/constants/Notifications.js.map +1 -0
- package/lib/cjs/constants/Preferences.d.ts +201 -0
- package/lib/cjs/constants/Preferences.d.ts.map +1 -0
- package/lib/cjs/constants/Preferences.js +184 -292
- package/lib/cjs/constants/Preferences.js.map +1 -0
- package/lib/{types → cjs}/constants/Routes.d.ts +0 -0
- package/lib/{types → cjs}/constants/Routes.d.ts.map +0 -0
- package/lib/cjs/constants/Routes.js +38 -59
- package/lib/cjs/constants/Routes.js.map +1 -0
- package/lib/{types → cjs}/constants/Session.d.ts +0 -0
- package/lib/{types → cjs}/constants/Session.d.ts.map +0 -0
- package/lib/cjs/constants/Session.js +12 -21
- package/lib/cjs/constants/Session.js.map +1 -0
- package/lib/{types → cjs}/constants/Theme.d.ts +0 -0
- package/lib/{types → cjs}/constants/Theme.d.ts.map +0 -0
- package/lib/cjs/constants/Theme.js +3 -4
- package/lib/cjs/constants/Theme.js.map +1 -0
- package/lib/cjs/constants/WebSocket.d.ts +4 -0
- package/lib/cjs/constants/WebSocket.d.ts.map +1 -0
- package/lib/cjs/constants/WebSocket.js +6 -9
- package/lib/cjs/constants/WebSocket.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCAuth.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCAuth.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCAuth.js +212 -282
- package/lib/cjs/hooks/useSCAuth.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCCachingManager.js +37 -51
- package/lib/cjs/hooks/useSCCachingManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCConnectionsManager.js +190 -254
- package/lib/cjs/hooks/useSCConnectionsManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchAddressingTagList.js +64 -55
- package/lib/cjs/hooks/useSCFetchAddressingTagList.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCategories.js +46 -56
- package/lib/cjs/hooks/useSCFetchCategories.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCategory.js +44 -59
- package/lib/cjs/hooks/useSCFetchCategory.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCommentObject.js +44 -59
- package/lib/cjs/hooks/useSCFetchCommentObject.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCommentObjects.js +157 -254
- package/lib/cjs/hooks/useSCFetchCommentObjects.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCustomAdv.js +57 -75
- package/lib/cjs/hooks/useSCFetchCustomAdv.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchFeedObject.js +49 -69
- package/lib/cjs/hooks/useSCFetchFeedObject.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchIncubator.js +44 -59
- package/lib/cjs/hooks/useSCFetchIncubator.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchTag.js +44 -59
- package/lib/cjs/hooks/useSCFetchTag.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts.map +1 -1
- package/lib/cjs/hooks/useSCFetchUser.js +47 -59
- package/lib/cjs/hooks/useSCFetchUser.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.js +105 -147
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFollowersManager.js +154 -204
- package/lib/cjs/hooks/useSCFollowersManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCMediaClick.js +18 -25
- package/lib/cjs/hooks/useSCMediaClick.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js +118 -148
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCWebPushMessaging.js +268 -268
- package/lib/cjs/hooks/useSCWebPushMessaging.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCWebSocket.js +103 -125
- package/lib/cjs/hooks/useSCWebSocket.js.map +1 -0
- package/lib/{types → cjs}/index.d.ts +0 -0
- package/lib/{types → cjs}/index.d.ts.map +0 -0
- package/lib/cjs/index.js +131 -144
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/themes/theme.d.ts +9 -0
- package/lib/cjs/themes/theme.d.ts.map +1 -0
- package/lib/cjs/themes/theme.js +132 -143
- package/lib/cjs/themes/theme.js.map +1 -0
- package/lib/{types → cjs}/types/context.d.ts +0 -0
- package/lib/{types → cjs}/types/context.d.ts.map +0 -0
- package/lib/cjs/types/context.js +2 -2
- package/lib/cjs/types/context.js.map +1 -0
- package/lib/{types → cjs}/types/index.d.ts +0 -0
- package/lib/{types → cjs}/types/index.d.ts.map +0 -0
- package/lib/cjs/types/index.js +2 -21
- package/lib/cjs/types/index.js.map +1 -0
- package/lib/{types → cjs}/utils/errors.d.ts +0 -0
- package/lib/{types → cjs}/utils/errors.d.ts.map +0 -0
- package/lib/cjs/utils/errors.js +138 -149
- package/lib/cjs/utils/errors.js.map +1 -0
- package/lib/{types → cjs}/utils/locale.d.ts +0 -0
- package/lib/{types → cjs}/utils/locale.d.ts.map +0 -0
- package/lib/cjs/utils/locale.js +32 -48
- package/lib/cjs/utils/locale.js.map +1 -0
- package/lib/{types → cjs}/utils/user.d.ts +0 -0
- package/lib/{types → cjs}/utils/user.d.ts.map +0 -0
- package/lib/cjs/utils/user.js +25 -40
- package/lib/cjs/utils/user.js.map +1 -0
- package/lib/{types → cjs}/utils/validator.d.ts +0 -0
- package/lib/{types → cjs}/utils/validator.d.ts.map +0 -0
- package/lib/cjs/utils/validator.js +386 -576
- package/lib/cjs/utils/validator.js.map +1 -0
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts +37 -0
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js +11 -37
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCContextProvider/index.d.ts +35 -0
- package/lib/esm/components/provider/SCContextProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCContextProvider/index.js +48 -83
- package/lib/esm/components/provider/SCContextProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCLocaleProvider/index.d.ts +42 -0
- package/lib/esm/components/provider/SCLocaleProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCLocaleProvider/index.js +59 -123
- package/lib/esm/components/provider/SCLocaleProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCNotificationProvider/index.d.ts +37 -0
- package/lib/esm/components/provider/SCNotificationProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCNotificationProvider/index.js +12 -43
- package/lib/esm/components/provider/SCNotificationProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts +38 -0
- package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCPreferencesProvider/index.js +35 -64
- package/lib/esm/components/provider/SCPreferencesProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCRoutingProvider/index.d.ts +39 -0
- package/lib/esm/components/provider/SCRoutingProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCRoutingProvider/index.js +78 -113
- package/lib/esm/components/provider/SCRoutingProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCThemeProvider/index.d.ts +49 -0
- package/lib/esm/components/provider/SCThemeProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCThemeProvider/index.js +36 -81
- package/lib/esm/components/provider/SCThemeProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCUserProvider/index.d.ts +38 -0
- package/lib/esm/components/provider/SCUserProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCUserProvider/index.js +186 -272
- package/lib/esm/components/provider/SCUserProvider/index.js.map +1 -0
- package/lib/esm/components/router/index.d.ts +34 -0
- package/lib/esm/components/router/index.d.ts.map +1 -0
- package/lib/esm/components/router/index.js +24 -50
- package/lib/esm/components/router/index.js.map +1 -0
- package/lib/esm/constants/Actions.d.ts +2 -0
- package/lib/esm/constants/Actions.d.ts.map +1 -0
- package/lib/esm/constants/Actions.js +2 -6
- package/lib/esm/constants/Actions.js.map +1 -0
- package/lib/esm/constants/ContextProviders.d.ts +6 -0
- package/lib/esm/constants/ContextProviders.d.ts.map +1 -0
- package/lib/esm/constants/ContextProviders.js +18 -26
- package/lib/esm/constants/ContextProviders.js.map +1 -0
- package/lib/esm/constants/Device.d.ts +6 -0
- package/lib/esm/constants/Device.d.ts.map +1 -0
- package/lib/esm/constants/Device.js +2 -7
- package/lib/esm/constants/Device.js.map +1 -0
- package/lib/esm/constants/Errors.d.ts +5 -0
- package/lib/esm/constants/Errors.d.ts.map +1 -0
- package/lib/esm/constants/Errors.js +2 -7
- package/lib/esm/constants/Errors.js.map +1 -0
- package/lib/esm/constants/Features.d.ts +41 -0
- package/lib/esm/constants/Features.d.ts.map +1 -0
- package/lib/esm/constants/Features.js +41 -84
- package/lib/esm/constants/Features.js.map +1 -0
- package/lib/esm/constants/Locale.d.ts +8 -0
- package/lib/esm/constants/Locale.d.ts.map +1 -0
- package/lib/esm/constants/Locale.js +8 -18
- package/lib/esm/constants/Locale.js.map +1 -0
- package/lib/esm/constants/Notification.d.ts +55 -0
- package/lib/esm/constants/Notification.d.ts.map +1 -0
- package/lib/esm/constants/Notification.js +42 -54
- package/lib/esm/constants/Notification.js.map +1 -0
- package/lib/esm/constants/Notifications.d.ts +11 -0
- package/lib/esm/constants/Notifications.d.ts.map +1 -0
- package/lib/esm/constants/Notifications.js +9 -26
- package/lib/esm/constants/Notifications.js.map +1 -0
- package/lib/esm/constants/Preferences.d.ts +201 -0
- package/lib/esm/constants/Preferences.d.ts.map +1 -0
- package/lib/esm/constants/Preferences.js +181 -296
- package/lib/esm/constants/Preferences.js.map +1 -0
- package/lib/esm/constants/Routes.d.ts +29 -0
- package/lib/esm/constants/Routes.d.ts.map +1 -0
- package/lib/esm/constants/Routes.js +36 -60
- package/lib/esm/constants/Routes.js.map +1 -0
- package/lib/esm/constants/Session.d.ts +10 -0
- package/lib/esm/constants/Session.d.ts.map +1 -0
- package/lib/esm/constants/Session.js +10 -22
- package/lib/esm/constants/Session.js.map +1 -0
- package/lib/esm/constants/Theme.d.ts +2 -0
- package/lib/esm/constants/Theme.d.ts.map +1 -0
- package/lib/esm/constants/Theme.js +2 -6
- package/lib/esm/constants/Theme.js.map +1 -0
- package/lib/esm/constants/WebSocket.d.ts +4 -0
- package/lib/esm/constants/WebSocket.d.ts.map +1 -0
- package/lib/esm/constants/WebSocket.js +4 -10
- package/lib/esm/constants/WebSocket.js.map +1 -0
- package/lib/esm/hooks/useSCAuth.d.ts +56 -0
- package/lib/esm/hooks/useSCAuth.d.ts.map +1 -0
- package/lib/esm/hooks/useSCAuth.js +185 -285
- package/lib/esm/hooks/useSCAuth.js.map +1 -0
- package/lib/esm/hooks/useSCCachingManager.d.ts +19 -0
- package/lib/esm/hooks/useSCCachingManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCCachingManager.js +36 -53
- package/lib/esm/hooks/useSCCachingManager.js.map +1 -0
- package/lib/esm/hooks/useSCConnectionsManager.d.ts +40 -0
- package/lib/esm/hooks/useSCConnectionsManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCConnectionsManager.js +186 -256
- package/lib/esm/hooks/useSCConnectionsManager.js.map +1 -0
- package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts +14 -0
- package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchAddressingTagList.js +39 -56
- package/lib/esm/hooks/useSCFetchAddressingTagList.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCategories.d.ts +17 -0
- package/lib/esm/hooks/useSCFetchCategories.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCategories.js +45 -57
- package/lib/esm/hooks/useSCFetchCategories.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCategory.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchCategory.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCategory.js +42 -60
- package/lib/esm/hooks/useSCFetchCategory.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObject.js +42 -60
- package/lib/esm/hooks/useSCFetchCommentObject.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObjects.d.ts +53 -0
- package/lib/esm/hooks/useSCFetchCommentObjects.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObjects.js +153 -257
- package/lib/esm/hooks/useSCFetchCommentObjects.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCustomAdv.js +55 -76
- package/lib/esm/hooks/useSCFetchCustomAdv.js.map +1 -0
- package/lib/esm/hooks/useSCFetchFeedObject.d.ts +21 -0
- package/lib/esm/hooks/useSCFetchFeedObject.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchFeedObject.js +47 -70
- package/lib/esm/hooks/useSCFetchFeedObject.js.map +1 -0
- package/lib/esm/hooks/useSCFetchIncubator.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchIncubator.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchIncubator.js +42 -60
- package/lib/esm/hooks/useSCFetchIncubator.js.map +1 -0
- package/lib/esm/hooks/useSCFetchTag.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchTag.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchTag.js +42 -60
- package/lib/esm/hooks/useSCFetchTag.js.map +1 -0
- package/lib/esm/hooks/useSCFetchUser.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchUser.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchUser.js +45 -60
- package/lib/esm/hooks/useSCFetchUser.js.map +1 -0
- package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts +37 -0
- package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFollowedCategoriesManager.js +101 -149
- package/lib/esm/hooks/useSCFollowedCategoriesManager.js.map +1 -0
- package/lib/esm/hooks/useSCFollowersManager.d.ts +37 -0
- package/lib/esm/hooks/useSCFollowersManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFollowersManager.js +150 -206
- package/lib/esm/hooks/useSCFollowersManager.js.map +1 -0
- package/lib/esm/hooks/useSCMediaClick.d.ts +4 -0
- package/lib/esm/hooks/useSCMediaClick.d.ts.map +1 -0
- package/lib/esm/hooks/useSCMediaClick.js +17 -27
- package/lib/esm/hooks/useSCMediaClick.js.map +1 -0
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts +27 -0
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js +114 -150
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
- package/lib/esm/hooks/useSCWebPushMessaging.d.ts +9 -0
- package/lib/esm/hooks/useSCWebPushMessaging.d.ts.map +1 -0
- package/lib/esm/hooks/useSCWebPushMessaging.js +244 -270
- package/lib/esm/hooks/useSCWebPushMessaging.js.map +1 -0
- package/lib/esm/hooks/useSCWebSocket.d.ts +12 -0
- package/lib/esm/hooks/useSCWebSocket.d.ts.map +1 -0
- package/lib/esm/hooks/useSCWebSocket.js +99 -127
- package/lib/esm/hooks/useSCWebSocket.js.map +1 -0
- package/lib/esm/index.d.ts +73 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +69 -151
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/themes/theme.d.ts +9 -0
- package/lib/esm/themes/theme.d.ts.map +1 -0
- package/lib/esm/themes/theme.js +128 -144
- package/lib/esm/themes/theme.js.map +1 -0
- package/lib/esm/types/context.d.ts +428 -0
- package/lib/esm/types/context.d.ts.map +1 -0
- package/lib/esm/types/context.js +2 -3
- package/lib/esm/types/context.js.map +1 -0
- package/lib/esm/types/index.d.ts +3 -0
- package/lib/esm/types/index.d.ts.map +1 -0
- package/lib/esm/types/index.js +2 -22
- package/lib/esm/types/index.js.map +1 -0
- package/lib/esm/utils/errors.d.ts +98 -0
- package/lib/esm/utils/errors.d.ts.map +1 -0
- package/lib/esm/utils/errors.js +114 -155
- package/lib/esm/utils/errors.js.map +1 -0
- package/lib/esm/utils/locale.d.ts +10 -0
- package/lib/esm/utils/locale.d.ts.map +1 -0
- package/lib/esm/utils/locale.js +27 -50
- package/lib/esm/utils/locale.js.map +1 -0
- package/lib/esm/utils/user.d.ts +41 -0
- package/lib/esm/utils/user.d.ts.map +1 -0
- package/lib/esm/utils/user.js +23 -46
- package/lib/esm/utils/user.js.map +1 -0
- package/lib/esm/utils/validator.d.ts +239 -0
- package/lib/esm/utils/validator.d.ts.map +1 -0
- package/lib/esm/utils/validator.js +352 -588
- package/lib/esm/utils/validator.js.map +1 -0
- package/lib/umd/react-core.js +1 -1
- package/package.json +9 -11
- package/lib/types/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,42 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _useSCAuth = _interopRequireWildcard(require("../../../hooks/useSCAuth"));
|
|
15
|
-
|
|
16
|
-
var _utils = require("@selfcommunity/utils");
|
|
17
|
-
|
|
18
|
-
var _pubsubJs = _interopRequireDefault(require("pubsub-js"));
|
|
19
|
-
|
|
20
|
-
var _Errors = require("../../../constants/Errors");
|
|
21
|
-
|
|
22
|
-
var _useDeepCompareEffect = _interopRequireDefault(require("use-deep-compare-effect"));
|
|
23
|
-
|
|
24
|
-
var _useSCFollowedCategoriesManager = _interopRequireDefault(require("../../../hooks/useSCFollowedCategoriesManager"));
|
|
25
|
-
|
|
26
|
-
var _useSCFollowersManager = _interopRequireDefault(require("../../../hooks/useSCFollowersManager"));
|
|
27
|
-
|
|
28
|
-
var _useSCConnectionsManager = _interopRequireDefault(require("../../../hooks/useSCConnectionsManager"));
|
|
29
|
-
|
|
30
|
-
var _types = require("@selfcommunity/types");
|
|
31
|
-
|
|
32
|
-
var _useSCSubscribedIncubatorsManager = _interopRequireDefault(require("../../../hooks/useSCSubscribedIncubatorsManager"));
|
|
33
|
-
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
-
|
|
36
|
-
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); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
1
|
+
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { UserService } from '@selfcommunity/api-services';
|
|
3
|
+
import { SCContext } from '../SCContextProvider';
|
|
4
|
+
import useSCAuth, { userActionTypes } from '../../../hooks/useSCAuth';
|
|
5
|
+
import { isClientSideRendering, Logger } from '@selfcommunity/utils';
|
|
6
|
+
import PubSub from 'pubsub-js';
|
|
7
|
+
import { SCOPE_SC_CORE } from '../../../constants/Errors';
|
|
8
|
+
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
|
|
9
|
+
import useSCFollowedCategoriesManager from '../../../hooks/useSCFollowedCategoriesManager';
|
|
10
|
+
import useSCFollowedManager from '../../../hooks/useSCFollowersManager';
|
|
11
|
+
import useSCConnectionsManager from '../../../hooks/useSCConnectionsManager';
|
|
12
|
+
import { SCNotificationTopicType, SCNotificationTypologyType, SCUserStatus } from '@selfcommunity/types';
|
|
13
|
+
import useSCSubscribedIncubatorsManager from '../../../hooks/useSCSubscribedIncubatorsManager';
|
|
40
14
|
/**
|
|
41
15
|
* SCUserContext (Authentication Context)
|
|
42
16
|
*
|
|
@@ -54,7 +28,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
54
28
|
````
|
|
55
29
|
:::
|
|
56
30
|
*/
|
|
57
|
-
const SCUserContext =
|
|
31
|
+
export const SCUserContext = createContext({});
|
|
58
32
|
/**
|
|
59
33
|
* #### Description:
|
|
60
34
|
* This component keeps current user logged and session; it is exported as we need to wrap the entire app with it
|
|
@@ -64,247 +38,187 @@ const SCUserContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
|
64
38
|
* <SCUserContext.Provider value={contextValue}>{!state.loading && children}</SCUserContext.Provider>
|
|
65
39
|
* ```
|
|
66
40
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const {
|
|
81
|
-
state,
|
|
82
|
-
dispatch,
|
|
83
|
-
helpers
|
|
84
|
-
} = (0, _useSCAuth.default)(initialSession);
|
|
85
|
-
/**
|
|
86
|
-
* Helper handle change user
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
function updateUser(info) {
|
|
90
|
-
dispatch({
|
|
91
|
-
type: _useSCAuth.userActionTypes.UPDATE_USER,
|
|
92
|
-
payload: info
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Managers followed, categories
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const followedManager = (0, _useSCFollowersManager.default)(state.user);
|
|
101
|
-
const subscribedIncubatorsManager = (0, _useSCSubscribedIncubatorsManager.default)(state.user);
|
|
102
|
-
const connectionsManager = (0, _useSCConnectionsManager.default)(state.user);
|
|
103
|
-
const categoriesManager = (0, _useSCFollowedCategoriesManager.default)(state.user, updateUser);
|
|
104
|
-
/**
|
|
105
|
-
* Ref notifications subscribers: BLOCKED_USER, UNBLOCKED_USER
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
const notificationUserBlockedSubscription = (0, _react.useRef)(null);
|
|
109
|
-
const notificationUserUnBlockedSubscription = (0, _react.useRef)(null);
|
|
110
|
-
/**
|
|
111
|
-
* Check if there is a currently active session
|
|
112
|
-
* when the provider is mounted for the first time.
|
|
113
|
-
* If there is an error, it means there is no session.
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
(0, _useDeepCompareEffect.default)(() => {
|
|
117
|
-
if (state.session.authToken && state.session.authToken.accessToken) {
|
|
118
|
-
dispatch({
|
|
119
|
-
type: _useSCAuth.userActionTypes.LOGIN_LOADING
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
_apiServices.UserService.getCurrentUser().then(user => {
|
|
123
|
-
dispatch({
|
|
124
|
-
type: _useSCAuth.userActionTypes.LOGIN_SUCCESS,
|
|
125
|
-
payload: {
|
|
126
|
-
user
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}).catch(error => {
|
|
130
|
-
_utils.Logger.error(_Errors.SCOPE_SC_CORE, 'Unable to retrieve the authenticated user.');
|
|
131
|
-
|
|
132
|
-
dispatch({
|
|
133
|
-
type: _useSCAuth.userActionTypes.LOGIN_FAILURE,
|
|
134
|
-
payload: {
|
|
135
|
-
error
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
});
|
|
41
|
+
export default function SCUserProvider({ children }) {
|
|
42
|
+
const scContext = useContext(SCContext);
|
|
43
|
+
/**
|
|
44
|
+
* Manage user session
|
|
45
|
+
* Refresh token if necessary
|
|
46
|
+
*/
|
|
47
|
+
const initialSession = scContext.settings.session;
|
|
48
|
+
const { state, dispatch, helpers } = useSCAuth(initialSession);
|
|
49
|
+
/**
|
|
50
|
+
* Helper handle change user
|
|
51
|
+
*/
|
|
52
|
+
function updateUser(info) {
|
|
53
|
+
dispatch({ type: userActionTypes.UPDATE_USER, payload: info });
|
|
139
54
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
* When receive this type of notifications, the user.status must be update.
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
(0, _react.useEffect)(() => {
|
|
173
|
-
notificationUserBlockedSubscription.current = _pubsubJs.default.subscribe(`${_types.SCNotificationTopicType.INTERACTION}.${_types.SCNotificationTypologyType.BLOCKED_USER}`, () => {
|
|
174
|
-
dispatch({
|
|
175
|
-
type: _useSCAuth.userActionTypes.UPDATE_USER,
|
|
176
|
-
payload: {
|
|
177
|
-
status: _types.SCUserStatus.BLOCKED
|
|
55
|
+
/**
|
|
56
|
+
* Managers followed, categories
|
|
57
|
+
*/
|
|
58
|
+
const followedManager = useSCFollowedManager(state.user);
|
|
59
|
+
const subscribedIncubatorsManager = useSCSubscribedIncubatorsManager(state.user);
|
|
60
|
+
const connectionsManager = useSCConnectionsManager(state.user);
|
|
61
|
+
const categoriesManager = useSCFollowedCategoriesManager(state.user, updateUser);
|
|
62
|
+
/**
|
|
63
|
+
* Ref notifications subscribers: BLOCKED_USER, UNBLOCKED_USER
|
|
64
|
+
*/
|
|
65
|
+
const notificationUserBlockedSubscription = useRef(null);
|
|
66
|
+
const notificationUserUnBlockedSubscription = useRef(null);
|
|
67
|
+
/**
|
|
68
|
+
* Check if there is a currently active session
|
|
69
|
+
* when the provider is mounted for the first time.
|
|
70
|
+
* If there is an error, it means there is no session.
|
|
71
|
+
*/
|
|
72
|
+
useDeepCompareEffectNoCheck(() => {
|
|
73
|
+
if (state.session.authToken && state.session.authToken.accessToken) {
|
|
74
|
+
dispatch({ type: userActionTypes.LOGIN_LOADING });
|
|
75
|
+
UserService.getCurrentUser()
|
|
76
|
+
.then((user) => {
|
|
77
|
+
dispatch({ type: userActionTypes.LOGIN_SUCCESS, payload: { user } });
|
|
78
|
+
})
|
|
79
|
+
.catch((error) => {
|
|
80
|
+
Logger.error(SCOPE_SC_CORE, 'Unable to retrieve the authenticated user.');
|
|
81
|
+
dispatch({ type: userActionTypes.LOGIN_FAILURE, payload: { error } });
|
|
82
|
+
});
|
|
178
83
|
}
|
|
179
|
-
|
|
84
|
+
}, [state.session]);
|
|
85
|
+
/**
|
|
86
|
+
* Controls caching of follow categories, users, etc...
|
|
87
|
+
* To avoid multi-tab problems (only for client side), on visibility change
|
|
88
|
+
* and document is in foreground refresh the cache
|
|
89
|
+
*/
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
typeof window !== 'undefined' && document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
92
|
+
return () => {
|
|
93
|
+
typeof window !== 'undefined' && document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
94
|
+
};
|
|
180
95
|
});
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
96
|
+
/**
|
|
97
|
+
* handler handleVisibilityChange for this provider
|
|
98
|
+
* Refresh followed categories, users, etc..
|
|
99
|
+
*/
|
|
100
|
+
function handleVisibilityChange() {
|
|
101
|
+
if (isClientSideRendering() && !window.document.hidden && state.user) {
|
|
102
|
+
categoriesManager.refresh && categoriesManager.refresh();
|
|
103
|
+
followedManager.refresh && followedManager.refresh();
|
|
104
|
+
connectionsManager.refresh && connectionsManager.refresh();
|
|
105
|
+
subscribedIncubatorsManager.refresh && subscribedIncubatorsManager.refresh();
|
|
186
106
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Handle change unseen interactions counter
|
|
197
|
-
*/
|
|
198
|
-
|
|
199
|
-
function setUnseenInteractionsCounter(counter) {
|
|
200
|
-
dispatch({
|
|
201
|
-
type: _useSCAuth.userActionTypes.UPDATE_USER,
|
|
202
|
-
payload: {
|
|
203
|
-
unseen_interactions_counter: counter
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Handle change unseen notification banners counter
|
|
209
|
-
*/
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
function setUnseenNotificationBannersCounter(counter) {
|
|
213
|
-
dispatch({
|
|
214
|
-
type: _useSCAuth.userActionTypes.UPDATE_USER,
|
|
215
|
-
payload: {
|
|
216
|
-
unseen_notification_banners_counter: counter
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Helper to refresh the session
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
function refreshSession() {
|
|
226
|
-
return helpers.refreshSession();
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Helper to refresh the notification counter
|
|
230
|
-
* Use getCurrentUser service since the notification counters
|
|
231
|
-
* have been inserted into the serialized user object
|
|
232
|
-
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const refreshNotificationCounters = (0, _react.useMemo)(() => () => {
|
|
236
|
-
if (state.user) {
|
|
237
|
-
return _apiServices.UserService.getCurrentUser().then(user => {
|
|
238
|
-
dispatch({
|
|
239
|
-
type: _useSCAuth.userActionTypes.UPDATE_USER,
|
|
240
|
-
payload: {
|
|
241
|
-
unseen_interactions_counter: user.unseen_interactions_counter,
|
|
242
|
-
unseen_notification_banners_counter: user.unseen_notification_banners_counter
|
|
243
|
-
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Subscribes to handle notifications of type BLOCKED_USER, UNBLOCKED_USER.
|
|
110
|
+
* When receive this type of notifications, the user.status must be update.
|
|
111
|
+
*/
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
notificationUserBlockedSubscription.current = PubSub.subscribe(`${SCNotificationTopicType.INTERACTION}.${SCNotificationTypologyType.BLOCKED_USER}`, () => {
|
|
114
|
+
dispatch({ type: userActionTypes.UPDATE_USER, payload: { status: SCUserStatus.BLOCKED } });
|
|
244
115
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
116
|
+
notificationUserUnBlockedSubscription.current = PubSub.subscribe(`${SCNotificationTopicType.INTERACTION}.${SCNotificationTypologyType.UNBLOCKED_USER}`, () => {
|
|
117
|
+
dispatch({ type: userActionTypes.UPDATE_USER, payload: { status: SCUserStatus.APPROVED } });
|
|
118
|
+
});
|
|
119
|
+
return () => {
|
|
120
|
+
PubSub.unsubscribe(notificationUserBlockedSubscription.current);
|
|
121
|
+
PubSub.unsubscribe(notificationUserUnBlockedSubscription.current);
|
|
122
|
+
};
|
|
123
|
+
}, []);
|
|
124
|
+
/**
|
|
125
|
+
* Handle change unseen interactions counter
|
|
126
|
+
*/
|
|
127
|
+
function setUnseenInteractionsCounter(counter) {
|
|
128
|
+
dispatch({ type: userActionTypes.UPDATE_USER, payload: { unseen_interactions_counter: counter } });
|
|
248
129
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
* from the state.
|
|
255
|
-
*/
|
|
256
|
-
|
|
257
|
-
function logout() {
|
|
258
|
-
dispatch({
|
|
259
|
-
type: _useSCAuth.userActionTypes.LOGOUT
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Make the provider update only when it should.
|
|
264
|
-
* We only want to force re-renders if the user, session,
|
|
265
|
-
* loading or error states change.
|
|
266
|
-
*
|
|
267
|
-
* Whenever the `value` passed into a provider changes,
|
|
268
|
-
* the whole tree under the provider re-renders, and
|
|
269
|
-
* that can be very costly! Even in this case, where
|
|
270
|
-
* you only get re-renders when logging in and out
|
|
271
|
-
* we want to keep things very performant.
|
|
272
|
-
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const contextValue = (0, _react.useMemo)(() => ({
|
|
276
|
-
user: state.user,
|
|
277
|
-
session: state.session,
|
|
278
|
-
loading: state.loading,
|
|
279
|
-
error: state.error,
|
|
280
|
-
updateUser,
|
|
281
|
-
setUnseenInteractionsCounter,
|
|
282
|
-
setUnseenNotificationBannersCounter,
|
|
283
|
-
refreshNotificationCounters,
|
|
284
|
-
logout,
|
|
285
|
-
refreshSession,
|
|
286
|
-
managers: {
|
|
287
|
-
categories: categoriesManager,
|
|
288
|
-
followed: followedManager,
|
|
289
|
-
connections: connectionsManager,
|
|
290
|
-
incubators: subscribedIncubatorsManager
|
|
130
|
+
/**
|
|
131
|
+
* Handle change unseen notification banners counter
|
|
132
|
+
*/
|
|
133
|
+
function setUnseenNotificationBannersCounter(counter) {
|
|
134
|
+
dispatch({ type: userActionTypes.UPDATE_USER, payload: { unseen_notification_banners_counter: counter } });
|
|
291
135
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Helper to refresh the session
|
|
138
|
+
*/
|
|
139
|
+
function refreshSession() {
|
|
140
|
+
return helpers.refreshSession();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Helper to refresh the notification counter
|
|
144
|
+
* Use getCurrentUser service since the notification counters
|
|
145
|
+
* have been inserted into the serialized user object
|
|
146
|
+
*/
|
|
147
|
+
const refreshNotificationCounters = useMemo(() => () => {
|
|
148
|
+
if (state.user) {
|
|
149
|
+
return UserService.getCurrentUser()
|
|
150
|
+
.then((user) => {
|
|
151
|
+
dispatch({
|
|
152
|
+
type: userActionTypes.UPDATE_USER,
|
|
153
|
+
payload: {
|
|
154
|
+
unseen_interactions_counter: user.unseen_interactions_counter,
|
|
155
|
+
unseen_notification_banners_counter: user.unseen_notification_banners_counter,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
})
|
|
159
|
+
.catch((error) => {
|
|
160
|
+
Logger.error(SCOPE_SC_CORE, `Unable to refresh notification counters. Error: ${error.response.toString()}`);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return Promise.reject();
|
|
164
|
+
}, [state.user]);
|
|
165
|
+
/**
|
|
166
|
+
* Call the logout endpoint and then remove the user
|
|
167
|
+
* from the state.
|
|
168
|
+
*/
|
|
169
|
+
function logout() {
|
|
170
|
+
dispatch({ type: userActionTypes.LOGOUT });
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Make the provider update only when it should.
|
|
174
|
+
* We only want to force re-renders if the user, session,
|
|
175
|
+
* loading or error states change.
|
|
176
|
+
*
|
|
177
|
+
* Whenever the `value` passed into a provider changes,
|
|
178
|
+
* the whole tree under the provider re-renders, and
|
|
179
|
+
* that can be very costly! Even in this case, where
|
|
180
|
+
* you only get re-renders when logging in and out
|
|
181
|
+
* we want to keep things very performant.
|
|
182
|
+
*/
|
|
183
|
+
const contextValue = useMemo(() => ({
|
|
184
|
+
user: state.user,
|
|
185
|
+
session: state.session,
|
|
186
|
+
loading: state.loading,
|
|
187
|
+
error: state.error,
|
|
188
|
+
updateUser,
|
|
189
|
+
setUnseenInteractionsCounter,
|
|
190
|
+
setUnseenNotificationBannersCounter,
|
|
191
|
+
refreshNotificationCounters,
|
|
192
|
+
logout,
|
|
193
|
+
refreshSession,
|
|
194
|
+
managers: {
|
|
195
|
+
categories: categoriesManager,
|
|
196
|
+
followed: followedManager,
|
|
197
|
+
connections: connectionsManager,
|
|
198
|
+
incubators: subscribedIncubatorsManager,
|
|
199
|
+
},
|
|
200
|
+
}), [
|
|
201
|
+
state,
|
|
202
|
+
categoriesManager.loading,
|
|
203
|
+
categoriesManager.categories,
|
|
204
|
+
followedManager.loading,
|
|
205
|
+
followedManager.followed,
|
|
206
|
+
connectionsManager.loading,
|
|
207
|
+
connectionsManager.connections,
|
|
208
|
+
subscribedIncubatorsManager.loading,
|
|
209
|
+
subscribedIncubatorsManager.incubators,
|
|
210
|
+
]);
|
|
211
|
+
/**
|
|
212
|
+
* We only want to render the underlying app after we
|
|
213
|
+
* assert for the presence of a current user.
|
|
214
|
+
*/
|
|
215
|
+
return React.createElement(SCUserContext.Provider, { value: contextValue }, children);
|
|
301
216
|
}
|
|
302
217
|
/**
|
|
303
218
|
* Let's only export the `useSCUser` hook instead of the context.
|
|
304
219
|
* We only want to use the hook directly and never the context component.
|
|
305
220
|
*/
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
221
|
+
export function useSCUser() {
|
|
222
|
+
return useContext(SCUserContext);
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/provider/SCUserProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACnF,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,SAAS,EAAE,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAE,MAAM,EAAC,MAAM,sBAAsB,CAAC;AACnE,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAC,2BAA2B,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;AAC3F,OAAO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AU;QACV,4BAA4B;QAC5B,mCAAmC;QACnC,2BAA2B;QAC3B,MAAM;QACN,cAAc;QACd,QAAQ,EAAE;YACR,UAAU,EAAE,iBAAiB;YAC7B,QAAQ,EAAE,eAAe;YACzB,WAAW,EAAE,kBAAkB;YAC/B,UAAU,EAAE,2BAA2B;SACxC;KACF,CAAC,EACF;QACE,KAAK;QACL,iBAAiB,CAAC,OAAO;QACzB,iBAAiB,CAAC,UAAU;QAC5B,eAAe,CAAC,OAAO;QACvB,eAAe,CAAC,QAAQ;QACxB,kBAAkB,CAAC,OAAO;QAC1B,kBAAkB,CAAC,WAAW;QAC9B,2BAA2B,CAAC,OAAO;QACnC,2BAA2B,CAAC,UAAU;KACvC,CACF,CAAC;IAEF;;;OAGG;IACH,OAAO,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAAG,QAAQ,CAA0B,CAAC;AAC1F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<{
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
children: any;
|
|
5
|
+
}, string | number> & React.RefAttributes<unknown>>;
|
|
6
|
+
/**
|
|
7
|
+
:::info
|
|
8
|
+
This component is used to navigate through the application.
|
|
9
|
+
:::
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
In order to use router you need to import this components first:
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
import {SCRoutingContextType, useSCRouting, Link, SCRoutes} from '@selfcommunity/react-core';
|
|
17
|
+
````
|
|
18
|
+
:::tipUsage Example:
|
|
19
|
+
|
|
20
|
+
```jsx
|
|
21
|
+
const scRoutingContext: SCRoutingContextType = useSCRouting();
|
|
22
|
+
<Button component={Link} to={scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, {id: user.id})>Go to profile</Button>
|
|
23
|
+
````
|
|
24
|
+
**or**
|
|
25
|
+
|
|
26
|
+
```jsx
|
|
27
|
+
const scRoutingContext: SCRoutingContextType = useSCRouting();
|
|
28
|
+
<Link to={scRoutingContext.url('profile', {id: user.id})}>Go to profile</Link>
|
|
29
|
+
````
|
|
30
|
+
|
|
31
|
+
:::
|
|
32
|
+
*/
|
|
33
|
+
export default _default;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/router/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;AAmCxC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsC"}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
|
|
17
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
|
-
|
|
19
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useContext } from 'react';
|
|
13
|
+
import { SCRoutingContext } from '../provider/SCRoutingProvider';
|
|
21
14
|
/**
|
|
22
15
|
*
|
|
23
16
|
* Import this components:
|
|
@@ -31,31 +24,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
31
24
|
* `<Link to={scRoutingContext.url('profile', {id: user.id})}>Go to profile</Link>`
|
|
32
25
|
*
|
|
33
26
|
*/
|
|
34
|
-
const Link = (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const ComponentLink = scRoutingContext.routerLink;
|
|
44
|
-
return /*#__PURE__*/_react.default.createElement(ComponentLink, _extends({}, other, {
|
|
45
|
-
ref: ref
|
|
46
|
-
}), children);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const {
|
|
50
|
-
to
|
|
51
|
-
} = other,
|
|
52
|
-
rest = _objectWithoutPropertiesLoose(other, _excluded2);
|
|
53
|
-
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement("a", _extends({
|
|
55
|
-
href: to
|
|
56
|
-
}, rest, {
|
|
57
|
-
ref: ref
|
|
58
|
-
}), children);
|
|
27
|
+
const Link = (_a, ref) => {
|
|
28
|
+
var { children } = _a, other = __rest(_a, ["children"]);
|
|
29
|
+
const scRoutingContext = useContext(SCRoutingContext);
|
|
30
|
+
if (scRoutingContext.routerLink) {
|
|
31
|
+
const ComponentLink = scRoutingContext.routerLink;
|
|
32
|
+
return (React.createElement(ComponentLink, Object.assign({}, other, { ref: ref }), children));
|
|
33
|
+
}
|
|
34
|
+
const { to } = other, rest = __rest(other, ["to"]);
|
|
35
|
+
return (React.createElement("a", Object.assign({ href: to }, rest, { ref: ref }), children));
|
|
59
36
|
};
|
|
60
37
|
/**
|
|
61
38
|
:::info
|
|
@@ -84,8 +61,5 @@ const scRoutingContext: SCRoutingContextType = useSCRouting();
|
|
|
84
61
|
|
|
85
62
|
:::
|
|
86
63
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var _default = /*#__PURE__*/_react.default.forwardRef(Link);
|
|
90
|
-
|
|
91
|
-
exports.default = _default;
|
|
64
|
+
export default React.forwardRef(Link);
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/router/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAG/D;;;;;;;;;;;;GAYG;AACH,MAAM,IAAI,GAAG,CAAC,EAAoB,EAAE,GAAG,EAAE,EAAE;QAA7B,EAAC,QAAQ,OAAW,EAAN,KAAK,cAAnB,YAAoB,CAAD;IAC/B,MAAM,gBAAgB,GAAyB,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC5E,IAAI,gBAAgB,CAAC,UAAU,EAAE;QAC/B,MAAM,aAAa,GAA8B,gBAAgB,CAAC,UAAU,CAAC;QAC7E,OAAO,CACL,oBAAC,aAAa,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG,KAC/B,QAAQ,CACK,CACjB,CAAC;KACH;IACD,MAAM,EAAC,EAAE,KAAa,KAAK,EAAb,IAAI,UAAI,KAAK,EAArB,MAAa,CAAQ,CAAC;IAC5B,OAAO,CACL,yCAAG,IAAI,EAAE,EAAE,IAAM,IAAI,IAAE,GAAG,EAAE,GAAG,KAC5B,QAAQ,CACP,CACL,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAe,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../src/constants/Actions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,0BAA0B,CAAC"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.HANDLE_ANONYMOUS_ACTION_OPTION = void 0;
|
|
5
|
-
const HANDLE_ANONYMOUS_ACTION_OPTION = 'handleAnonymousAction';
|
|
6
|
-
exports.HANDLE_ANONYMOUS_ACTION_OPTION = HANDLE_ANONYMOUS_ACTION_OPTION;
|
|
1
|
+
export const HANDLE_ANONYMOUS_ACTION_OPTION = 'handleAnonymousAction';
|
|
2
|
+
//# sourceMappingURL=Actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../src/constants/Actions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CONTEXT_PROVIDERS_OPTION = "contextProviders";
|
|
2
|
+
/**
|
|
3
|
+
* List of all nested providers that are required to run
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_CONTEXT_PROVIDERS: ((children: any) => JSX.Element)[];
|
|
6
|
+
//# sourceMappingURL=ContextProviders.d.ts.map
|