@selfcommunity/react-core 0.1.7-alpha.1 → 0.1.8-alpha.1
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
|
File without changes
|
|
File without changes
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useSCAlertMessages = exports.SCAlertMessagesContext = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const notistack_1 = require("notistack");
|
|
16
29
|
/**
|
|
17
30
|
* Creates Global Context
|
|
18
31
|
*
|
|
@@ -29,7 +42,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
42
|
:::
|
|
30
43
|
|
|
31
44
|
*/
|
|
32
|
-
|
|
45
|
+
exports.SCAlertMessagesContext = (0, react_1.createContext)({});
|
|
33
46
|
/**
|
|
34
47
|
* #### Description:
|
|
35
48
|
* This component makes the `intl` available down the React tree.
|
|
@@ -39,29 +52,18 @@ const SCAlertMessagesContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
|
39
52
|
* <SCAlertMessagesContext.Provider value={{options}}>
|
|
40
53
|
* ```
|
|
41
54
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
children = null
|
|
47
|
-
}) {
|
|
48
|
-
const [options, setOptions] = (0, _react.useState)({
|
|
49
|
-
maxSnack: 3,
|
|
50
|
-
autoHideDuration: null
|
|
51
|
-
});
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(SCAlertMessagesContext.Provider, {
|
|
53
|
-
value: {
|
|
54
|
-
options,
|
|
55
|
-
setOptions
|
|
56
|
-
}
|
|
57
|
-
}, /*#__PURE__*/_react.default.createElement(_notistack.SnackbarProvider, options, children));
|
|
55
|
+
function SCAlertMessagesProvider({ children = null }) {
|
|
56
|
+
const [options, setOptions] = (0, react_1.useState)({ maxSnack: 3, autoHideDuration: null });
|
|
57
|
+
return (react_1.default.createElement(exports.SCAlertMessagesContext.Provider, { value: { options, setOptions } },
|
|
58
|
+
react_1.default.createElement(notistack_1.SnackbarProvider, Object.assign({}, options), children)));
|
|
58
59
|
}
|
|
60
|
+
exports.default = SCAlertMessagesProvider;
|
|
59
61
|
/**
|
|
60
62
|
* Let's only export the `useSCAlertMessages` hook instead of the context.
|
|
61
63
|
* We only want to use the hook directly and never the context component.
|
|
62
64
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
65
|
function useSCAlertMessages() {
|
|
66
|
-
|
|
67
|
-
}
|
|
66
|
+
return (0, react_1.useContext)(exports.SCAlertMessagesContext);
|
|
67
|
+
}
|
|
68
|
+
exports.useSCAlertMessages = useSCAlertMessages;
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/provider/SCAlertMessagesProvider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiE;AAEjE,yCAA2C;AAE3C;;;;;;;;;;;;;;;GAeG;AACU,QAAA,sBAAsB,GAAG,IAAA,qBAAa,EAA6B,EAAgC,CAAC,CAAC;AAElH;;;;;;;;GAQG;AACH,SAAwB,uBAAuB,CAAC,EAAC,QAAQ,GAAG,IAAI,EAA8B;IAC5F,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAsB,EAAC,QAAQ,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAC,CAAC,CAAC;IAEnG,OAAO,CACL,8BAAC,8BAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3D,8BAAC,4BAAgB,oBAAK,OAAO,GAAG,QAAQ,CAAoB,CAC5B,CACnC,CAAC;AACJ,CAAC;AARD,0CAQC;AAED;;;GAGG;AACH,SAAgB,kBAAkB;IAChC,OAAO,IAAA,kBAAU,EAAC,8BAAsB,CAAC,CAAC;AAC5C,CAAC;AAFD,gDAEC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useSCContext = exports.SCContext = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
29
|
+
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
30
|
+
const validator_1 = require("../../../utils/validator");
|
|
22
31
|
/**
|
|
23
32
|
* Creates Global Context
|
|
24
33
|
*
|
|
@@ -34,7 +43,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
34
43
|
````
|
|
35
44
|
:::
|
|
36
45
|
*/
|
|
37
|
-
|
|
46
|
+
exports.SCContext = (0, react_1.createContext)({});
|
|
38
47
|
/**
|
|
39
48
|
* This component imports all providers
|
|
40
49
|
* @param object
|
|
@@ -45,73 +54,57 @@ const SCContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
|
45
54
|
* <SCContext.Provider value={{settings}}>
|
|
46
55
|
* ```
|
|
47
56
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
function SCContextProvider({
|
|
52
|
-
conf,
|
|
53
|
-
children
|
|
54
|
-
}) {
|
|
55
|
-
const [settings, setSettings] = (0, _react.useState)(null);
|
|
56
|
-
/**
|
|
57
|
-
* Export the provider as we need to wrap the entire app with it
|
|
58
|
-
* This provider keeps current user logged and session
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
(0, _useDeepCompareEffect.default)(() => {
|
|
57
|
+
function SCContextProvider({ conf, children }) {
|
|
58
|
+
const [settings, setSettings] = (0, react_1.useState)(null);
|
|
62
59
|
/**
|
|
63
|
-
*
|
|
60
|
+
* Export the provider as we need to wrap the entire app with it
|
|
61
|
+
* This provider keeps current user logged and session
|
|
64
62
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
64
|
+
/**
|
|
65
|
+
* Validate initial settings
|
|
66
|
+
*/
|
|
67
|
+
const { validationResult, settings } = (0, validator_1.validateOptions)(conf, validator_1.validOptions);
|
|
68
|
+
/**
|
|
69
|
+
* Init provider
|
|
70
|
+
*/
|
|
71
|
+
if (validationResult.hasErrors()) {
|
|
72
|
+
/**
|
|
73
|
+
* Exist errors in initial conf
|
|
74
|
+
*/
|
|
75
|
+
validationResult.emit();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
/**
|
|
79
|
+
* Emit warnings if exist
|
|
80
|
+
*/
|
|
81
|
+
validationResult.emitWarnings();
|
|
82
|
+
/**
|
|
83
|
+
* Set the base path on the http objects
|
|
84
|
+
*/
|
|
85
|
+
api_services_1.http.setBasePortal(settings.portal);
|
|
86
|
+
/**
|
|
87
|
+
* Render all Providers
|
|
88
|
+
*/
|
|
89
|
+
setSettings(settings);
|
|
90
|
+
}
|
|
91
|
+
}, [conf]);
|
|
69
92
|
/**
|
|
70
|
-
*
|
|
93
|
+
* Nesting all necessary providers
|
|
94
|
+
* All child components will use help contexts to works
|
|
71
95
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*/
|
|
77
|
-
validationResult.emit();
|
|
78
|
-
} else {
|
|
79
|
-
/**
|
|
80
|
-
* Emit warnings if exist
|
|
81
|
-
*/
|
|
82
|
-
validationResult.emitWarnings();
|
|
83
|
-
/**
|
|
84
|
-
* Set the base path on the http objects
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
_apiServices.http.setBasePortal(settings.portal);
|
|
88
|
-
/**
|
|
89
|
-
* Render all Providers
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
setSettings(settings);
|
|
94
|
-
}
|
|
95
|
-
}, [conf]);
|
|
96
|
-
/**
|
|
97
|
-
* Nesting all necessary providers
|
|
98
|
-
* All child components will use help contexts to works
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
return /*#__PURE__*/_react.default.createElement(SCContext.Provider, {
|
|
102
|
-
value: {
|
|
103
|
-
settings
|
|
104
|
-
}
|
|
105
|
-
}, settings && settings.contextProviders.reduceRight((memo, ContextProvider) => {
|
|
106
|
-
return /*#__PURE__*/_react.default.createElement(ContextProvider, null, memo);
|
|
107
|
-
}, children));
|
|
96
|
+
return (react_1.default.createElement(exports.SCContext.Provider, { value: { settings } }, settings &&
|
|
97
|
+
settings.contextProviders.reduceRight((memo, ContextProvider) => {
|
|
98
|
+
return react_1.default.createElement(ContextProvider, null, memo);
|
|
99
|
+
}, children)));
|
|
108
100
|
}
|
|
101
|
+
exports.default = SCContextProvider;
|
|
109
102
|
/**
|
|
110
103
|
* Let's only export the `useSCContext` hook instead of the context.
|
|
111
104
|
* We only want to use the hook directly and never the context component.
|
|
112
105
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
106
|
function useSCContext() {
|
|
116
|
-
|
|
117
|
-
}
|
|
107
|
+
return (0, react_1.useContext)(exports.SCContext);
|
|
108
|
+
}
|
|
109
|
+
exports.useSCContext = useSCContext;
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/provider/SCContextProvider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiE;AACjE,8DAAiD;AACjD,qEAAoE;AACpE,wDAAuE;AAGvE;;;;;;;;;;;;;;GAcG;AACU,QAAA,SAAS,GAAG,IAAA,qBAAa,EAAgB,EAAmB,CAAC,CAAC;AAE3E;;;;;;;;;GASG;AACH,SAAwB,iBAAiB,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAwB;IAC/E,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAiB,IAAI,CAAC,CAAC;IAE/D;;;OAGG;IACH,IAAA,qDAA2B,EAAC,GAAG,EAAE;QAC/B;;WAEG;QACH,MAAM,EAAC,gBAAgB,EAAE,QAAQ,EAAC,GAAG,IAAA,2BAAe,EAAC,IAAI,EAAE,wBAAY,CAAC,CAAC;QAEzE;;WAEG;QACH,IAAI,gBAAgB,CAAC,SAAS,EAAE,EAAE;YAChC;;eAEG;YACH,gBAAgB,CAAC,IAAI,EAAE,CAAC;SACzB;aAAM;YACL;;eAEG;YACH,gBAAgB,CAAC,YAAY,EAAE,CAAC;YAEhC;;eAEG;YACH,mBAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAEpC;;eAEG;YACH,WAAW,CAAC,QAAQ,CAAC,CAAC;SACvB;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX;;;OAGG;IACH,OAAO,CACL,8BAAC,iBAAS,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,QAAQ,EAAC,IAClC,QAAQ;QACP,QAAQ,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE;YAC9D,OAAO,8BAAC,eAAe,QAAE,IAAI,CAAmB,CAAC;QACnD,CAAC,EAAE,QAAQ,CAAC,CACK,CACtB,CAAC;AACJ,CAAC;AAnDD,oCAmDC;AAED;;;GAGG;AACH,SAAgB,YAAY;IAC1B,OAAO,IAAA,kBAAU,EAAC,iBAAS,CAAC,CAAC;AAC/B,CAAC;AAFD,oCAEC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useSCLocale = exports.withSCLocale = exports.SCLocaleContext = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const SCContextProvider_1 = require("../SCContextProvider");
|
|
29
|
+
const locale_1 = require("../../../utils/locale");
|
|
30
|
+
const Locale_1 = require("../../../constants/Locale");
|
|
31
|
+
const react_intl_1 = require("react-intl");
|
|
32
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
33
|
+
const Errors_1 = require("../../../constants/Errors");
|
|
34
|
+
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
33
35
|
/**
|
|
34
36
|
* Creates Global Context
|
|
35
37
|
*
|
|
@@ -46,7 +48,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
46
48
|
````
|
|
47
49
|
:::
|
|
48
50
|
*/
|
|
49
|
-
|
|
51
|
+
exports.SCLocaleContext = (0, react_1.createContext)({});
|
|
50
52
|
/**
|
|
51
53
|
* #### Description:
|
|
52
54
|
* This component makes the `intl` available down the React tree.
|
|
@@ -56,103 +58,66 @@ const SCLocaleContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
|
56
58
|
* <SCLocaleContext.Provider value={{locale, messages, selectLocale}}>
|
|
57
59
|
* ```
|
|
58
60
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var _scContext$settings$l2;
|
|
102
|
-
|
|
103
|
-
selectLocale((_scContext$settings$l2 = scContext.settings.locale) != null && _scContext$settings$l2.default ? scContext.settings.locale.default : _Locale.DEFAULT_LANGUAGE_UI);
|
|
104
|
-
}, [scContext.settings.locale]);
|
|
105
|
-
/**
|
|
106
|
-
* handleIntlError
|
|
107
|
-
* @param error
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
const handleIntlError = error => {
|
|
111
|
-
if (error.code === 'MISSING_TRANSLATION') {
|
|
112
|
-
_utils.Logger.warn(_Errors.SCOPE_SC_CORE, `Missing translation: ${error.message}`);
|
|
113
|
-
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
throw error;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
return /*#__PURE__*/_react.default.createElement(SCLocaleContext.Provider, {
|
|
121
|
-
value: {
|
|
122
|
-
locale,
|
|
123
|
-
messages,
|
|
124
|
-
selectLocale
|
|
125
|
-
}
|
|
126
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
127
|
-
key: locale,
|
|
128
|
-
locale: locale,
|
|
129
|
-
messages: messages,
|
|
130
|
-
onError: handleIntlError
|
|
131
|
-
}, children));
|
|
61
|
+
function SCLocaleProvider({ children = null }) {
|
|
62
|
+
var _a;
|
|
63
|
+
const scContext = (0, SCContextProvider_1.useSCContext)();
|
|
64
|
+
const initialLocale = ((_a = scContext.settings.locale) === null || _a === void 0 ? void 0 : _a.default) ? scContext.settings.locale.default : Locale_1.DEFAULT_LANGUAGE_UI;
|
|
65
|
+
const initial = (0, locale_1.loadLocaleData)(initialLocale, scContext.settings);
|
|
66
|
+
const [locale, setLocale] = (0, react_1.useState)(initial.locale);
|
|
67
|
+
const [messages, setMessages] = (0, react_1.useState)(initial.messages);
|
|
68
|
+
/**
|
|
69
|
+
* Update current locale state
|
|
70
|
+
* @param _intl
|
|
71
|
+
*/
|
|
72
|
+
const updateLocale = (_intl) => {
|
|
73
|
+
setLocale(_intl.locale);
|
|
74
|
+
setMessages(_intl.messages);
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Select locale loading data
|
|
78
|
+
*/
|
|
79
|
+
const selectLocale = (0, react_1.useMemo)(() => (l) => {
|
|
80
|
+
const { messages, locale } = (0, locale_1.loadLocaleData)(l, scContext.settings);
|
|
81
|
+
updateLocale({ messages, locale });
|
|
82
|
+
}, [locale]);
|
|
83
|
+
/**
|
|
84
|
+
* Update locale and messages if initial conf changes
|
|
85
|
+
*/
|
|
86
|
+
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
87
|
+
var _a;
|
|
88
|
+
selectLocale(((_a = scContext.settings.locale) === null || _a === void 0 ? void 0 : _a.default) ? scContext.settings.locale.default : Locale_1.DEFAULT_LANGUAGE_UI);
|
|
89
|
+
}, [scContext.settings.locale]);
|
|
90
|
+
/**
|
|
91
|
+
* handleIntlError
|
|
92
|
+
* @param error
|
|
93
|
+
*/
|
|
94
|
+
const handleIntlError = (error) => {
|
|
95
|
+
if (error.code === 'MISSING_TRANSLATION') {
|
|
96
|
+
utils_1.Logger.warn(Errors_1.SCOPE_SC_CORE, `Missing translation: ${error.message}`);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
throw error;
|
|
100
|
+
};
|
|
101
|
+
return (react_1.default.createElement(exports.SCLocaleContext.Provider, { value: { locale, messages, selectLocale } },
|
|
102
|
+
react_1.default.createElement(react_intl_1.IntlProvider, { key: locale, locale: locale, messages: messages, onError: handleIntlError }, children)));
|
|
132
103
|
}
|
|
104
|
+
exports.default = SCLocaleProvider;
|
|
133
105
|
/**
|
|
134
106
|
* Export hoc to inject the base theme to components
|
|
135
107
|
* @param Component
|
|
136
108
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
142
|
-
locale: scLocaleContext.locale,
|
|
143
|
-
messages: scLocaleContext.messages
|
|
144
|
-
}, /*#__PURE__*/_react.default.createElement(Component, _extends({
|
|
145
|
-
setLanguage: scLocaleContext.selectLocale
|
|
146
|
-
}, props)));
|
|
109
|
+
const withSCLocale = (Component) => (props) => {
|
|
110
|
+
const scLocaleContext = (0, react_1.useContext)(exports.SCLocaleContext);
|
|
111
|
+
return (react_1.default.createElement(react_intl_1.IntlProvider, { locale: scLocaleContext.locale, messages: scLocaleContext.messages },
|
|
112
|
+
react_1.default.createElement(Component, Object.assign({ setLanguage: scLocaleContext.selectLocale }, props))));
|
|
147
113
|
};
|
|
114
|
+
exports.withSCLocale = withSCLocale;
|
|
148
115
|
/**
|
|
149
116
|
* Let's only export the `useSCLocale` hook instead of the context.
|
|
150
117
|
* We only want to use the hook directly and never the context component.
|
|
151
118
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
exports.withSCLocale = withSCLocale;
|
|
155
|
-
|
|
156
119
|
function useSCLocale() {
|
|
157
|
-
|
|
158
|
-
}
|
|
120
|
+
return (0, react_1.useContext)(exports.SCLocaleContext);
|
|
121
|
+
}
|
|
122
|
+
exports.useSCLocale = useSCLocale;
|
|
123
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/provider/SCLocaleProvider/index.tsx"],"names":[],"mappings":"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"}
|
|
File without changes
|
|
File without changes
|