@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,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _utils = require("@selfcommunity/utils");
|
|
11
|
-
|
|
12
|
-
var _Errors = require("../constants/Errors");
|
|
13
|
-
|
|
14
|
-
var _types = require("@selfcommunity/types");
|
|
15
|
-
|
|
16
|
-
var _useDeepCompareEffect = require("use-deep-compare-effect");
|
|
17
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
5
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
6
|
+
const Errors_1 = require("../constants/Errors");
|
|
7
|
+
const types_1 = require("@selfcommunity/types");
|
|
8
|
+
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
18
9
|
/**
|
|
19
10
|
:::info
|
|
20
11
|
This custom hook is used to fetch a feed object.
|
|
@@ -24,56 +15,45 @@ var _useDeepCompareEffect = require("use-deep-compare-effect");
|
|
|
24
15
|
* @param object.feedObject
|
|
25
16
|
* @param object.feedObjectType
|
|
26
17
|
*/
|
|
27
|
-
function useSCFetchFeedObject({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}, [id, feedObjectType]);
|
|
71
|
-
(0, _useDeepCompareEffect.useDeepCompareEffectNoCheck)(() => {
|
|
72
|
-
setObj(feedObject);
|
|
73
|
-
}, [feedObject]);
|
|
74
|
-
return {
|
|
75
|
-
obj,
|
|
76
|
-
setObj,
|
|
77
|
-
error
|
|
78
|
-
};
|
|
79
|
-
}
|
|
18
|
+
function useSCFetchFeedObject({ id = null, feedObject = null, feedObjectType = types_1.SCFeedObjectTypologyType.POST || types_1.SCFeedObjectTypologyType.DISCUSSION || types_1.SCFeedObjectTypologyType.STATUS, }) {
|
|
19
|
+
const [obj, setObj] = (0, react_1.useState)(feedObject);
|
|
20
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
21
|
+
/**
|
|
22
|
+
* Memoized fetchFeedObject
|
|
23
|
+
*/
|
|
24
|
+
const fetchFeedObject = () => {
|
|
25
|
+
return api_services_1.http
|
|
26
|
+
.request({
|
|
27
|
+
url: api_services_1.Endpoints.FeedObject.url({ type: feedObjectType, id: id }),
|
|
28
|
+
method: api_services_1.Endpoints.FeedObject.method,
|
|
29
|
+
})
|
|
30
|
+
.then((res) => {
|
|
31
|
+
if (res.status >= 300) {
|
|
32
|
+
return Promise.reject(res);
|
|
33
|
+
}
|
|
34
|
+
return Promise.resolve(res.data);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* If id and feedObjectType resolve feddObject
|
|
39
|
+
*/
|
|
40
|
+
(0, react_1.useEffect)(() => {
|
|
41
|
+
if (id && feedObjectType) {
|
|
42
|
+
fetchFeedObject()
|
|
43
|
+
.then((obj) => {
|
|
44
|
+
setObj(obj);
|
|
45
|
+
})
|
|
46
|
+
.catch((err) => {
|
|
47
|
+
setError(`FeedObject with id ${id} not found`);
|
|
48
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `FeedObject with id ${id} not found`);
|
|
49
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, [id, feedObjectType]);
|
|
53
|
+
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
54
|
+
setObj(feedObject);
|
|
55
|
+
}, [feedObject]);
|
|
56
|
+
return { obj, setObj, error };
|
|
57
|
+
}
|
|
58
|
+
exports.default = useSCFetchFeedObject;
|
|
59
|
+
//# sourceMappingURL=useSCFetchFeedObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchFeedObject.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchFeedObject.ts"],"names":[],"mappings":";;AAAA,iCAA0C;AAC1C,8DAA0E;AAC1E,gDAA4C;AAC5C,gDAAkD;AAClD,gDAAwI;AACxI,qEAAoE;AAEpE;;;;;;;;GAQG;AACH,SAAwB,oBAAoB,CAAC,EAC3C,EAAE,GAAG,IAAI,EACT,UAAU,GAAG,IAAI,EACjB,cAAc,GAAG,gCAAwB,CAAC,IAAI,IAAI,gCAAwB,CAAC,UAAU,IAAI,gCAAwB,CAAC,MAAM,GAKzH;IACC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,IAAA,gBAAQ,EAA2D,UAAU,CAAC,CAAC;IACrG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAS,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,MAAM,eAAe,GAAG,GAAG,EAAE;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without changes
|
|
File without changes
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _Errors = require("../constants/Errors");
|
|
9
|
-
|
|
10
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
11
|
-
|
|
12
|
-
var _utils = require("@selfcommunity/utils");
|
|
13
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const Errors_1 = require("../constants/Errors");
|
|
5
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
6
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
14
7
|
/**
|
|
15
8
|
:::info
|
|
16
9
|
This custom hook is used to fetch an incubator object.
|
|
@@ -19,50 +12,42 @@ var _utils = require("@selfcommunity/utils");
|
|
|
19
12
|
* @param object.id
|
|
20
13
|
* @param object.incubator
|
|
21
14
|
*/
|
|
22
|
-
function useSCFetchIncubator({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
}, [id]);
|
|
63
|
-
return {
|
|
64
|
-
scIncubator,
|
|
65
|
-
setSCIncubator,
|
|
66
|
-
error
|
|
67
|
-
};
|
|
68
|
-
}
|
|
15
|
+
function useSCFetchIncubator({ id = null, incubator = null }) {
|
|
16
|
+
const [scIncubator, setSCIncubator] = (0, react_1.useState)(incubator);
|
|
17
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
18
|
+
/**
|
|
19
|
+
* Memoized fetchIncubator
|
|
20
|
+
*/
|
|
21
|
+
const fetchIncubator = (0, react_1.useMemo)(() => () => {
|
|
22
|
+
return api_services_1.http
|
|
23
|
+
.request({
|
|
24
|
+
url: api_services_1.Endpoints.GetASpecificIncubator.url({ id: id }),
|
|
25
|
+
method: api_services_1.Endpoints.GetASpecificIncubator.method,
|
|
26
|
+
})
|
|
27
|
+
.then((res) => {
|
|
28
|
+
if (res.status >= 300) {
|
|
29
|
+
return Promise.reject(res);
|
|
30
|
+
}
|
|
31
|
+
return Promise.resolve(res.data);
|
|
32
|
+
});
|
|
33
|
+
}, [id]);
|
|
34
|
+
/**
|
|
35
|
+
* If id resolve the obj
|
|
36
|
+
*/
|
|
37
|
+
(0, react_1.useEffect)(() => {
|
|
38
|
+
if (id) {
|
|
39
|
+
fetchIncubator()
|
|
40
|
+
.then((obj) => {
|
|
41
|
+
setSCIncubator(obj);
|
|
42
|
+
})
|
|
43
|
+
.catch((err) => {
|
|
44
|
+
setError(`Incubator with id ${id} not found`);
|
|
45
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Incubator with id ${id} not found`);
|
|
46
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, [id]);
|
|
50
|
+
return { scIncubator, setSCIncubator, error };
|
|
51
|
+
}
|
|
52
|
+
exports.default = useSCFetchIncubator;
|
|
53
|
+
//# sourceMappingURL=useSCFetchIncubator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchIncubator.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchIncubator.ts"],"names":[],"mappings":";;A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qBAAqB,EAAE,YAAY,CAAC,CAAC;gBACjE,cAAM,CAAC,KAAK,CAAC,sBAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;SACN;IACH,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAET,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,KAAK,EAAC,CAAC;AAC9C,CAAC;AA1CD,sCA0CC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _Errors = require("../constants/Errors");
|
|
9
|
-
|
|
10
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
11
|
-
|
|
12
|
-
var _utils = require("@selfcommunity/utils");
|
|
13
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const Errors_1 = require("../constants/Errors");
|
|
5
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
6
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
14
7
|
/**
|
|
15
8
|
:::info
|
|
16
9
|
This custom hook is used to fetch a tag object.
|
|
@@ -19,50 +12,42 @@ var _utils = require("@selfcommunity/utils");
|
|
|
19
12
|
* @param object.id
|
|
20
13
|
* @param object.tag
|
|
21
14
|
*/
|
|
22
|
-
function useSCFetchTag({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
}, [id]);
|
|
63
|
-
return {
|
|
64
|
-
scTag,
|
|
65
|
-
setSCTag,
|
|
66
|
-
error
|
|
67
|
-
};
|
|
68
|
-
}
|
|
15
|
+
function useSCFetchTag({ id = null, tag = null }) {
|
|
16
|
+
const [scTag, setSCTag] = (0, react_1.useState)(tag);
|
|
17
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
18
|
+
/**
|
|
19
|
+
* Memoized fetchTag
|
|
20
|
+
*/
|
|
21
|
+
const fetchTag = (0, react_1.useMemo)(() => () => {
|
|
22
|
+
return api_services_1.http
|
|
23
|
+
.request({
|
|
24
|
+
url: api_services_1.Endpoints.Tag.url({ id: id }),
|
|
25
|
+
method: api_services_1.Endpoints.Tag.method,
|
|
26
|
+
})
|
|
27
|
+
.then((res) => {
|
|
28
|
+
if (res.status >= 300) {
|
|
29
|
+
return Promise.reject(res);
|
|
30
|
+
}
|
|
31
|
+
return Promise.resolve(res.data);
|
|
32
|
+
});
|
|
33
|
+
}, [id]);
|
|
34
|
+
/**
|
|
35
|
+
* If id attempt to get the tag by id
|
|
36
|
+
*/
|
|
37
|
+
(0, react_1.useEffect)(() => {
|
|
38
|
+
if (id) {
|
|
39
|
+
fetchTag()
|
|
40
|
+
.then((obj) => {
|
|
41
|
+
setSCTag(obj);
|
|
42
|
+
})
|
|
43
|
+
.catch((err) => {
|
|
44
|
+
setError(`Tag with id ${id} not found`);
|
|
45
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Tag with id ${id} not found`);
|
|
46
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, [id]);
|
|
50
|
+
return { scTag, setSCTag, error };
|
|
51
|
+
}
|
|
52
|
+
exports.default = useSCFetchTag;
|
|
53
|
+
//# sourceMappingURL=useSCFetchTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchTag.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchTag.ts"],"names":[],"mappings":";;AAAA,iCAAmD;AACnD,gDAAkD;AAElD,8DAA0E;AAC1E,gDAA4C;AAE5C;;;;;;;GAOG;AACH,SAAwB,aAAa,CAAC,EAAC,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,IAAI,EAAiC;IAC3F,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAY,GAAG,CAAC,CAAC;IACnD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAS,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,MAAM,QAAQ,GAAG,IAAA,eAAO,EACtB,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,OAAO,mBAAI;aACR,OAAO,CAAC;YACP,GAAG,EAAE,wBAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC;YAChC,MAAM,EAAE,wBAAS,CAAC,GAAG,CAAC,MAAM;SAC7B,CAAC;aACD,IAAI,CAAC,CAAC,GAA4B,EAAE,EAAE;YACrC,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,EAAE;gBACrB,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aAC5B;YACD,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACP,CAAC,EACD,CAAC,EAAE,CAAC,CACL,CAAC;IAEF;;OAEG;IACH,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,EAAE,EAAE;YACN,QAAQ,EAAE;iBACP,IAAI,CAAC,CAAC,GAAc,EAAE,EAAE;gBACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;YAChB,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACb,QAAQ,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;gBACxC,cAAM,CAAC,KAAK,CAAC,sBAAa,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;gBAC3D,cAAM,CAAC,KAAK,CAAC,sBAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;SACN;IACH,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAET,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC;AAClC,CAAC;AA1CD,gCA0CC"}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSCFetchUser.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSCFetchUser.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAIhD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAC,EAAS,EAAE,IAAW,EAAC,EAAE;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAA;CAAC;;;;
|
|
1
|
+
{"version":3,"file":"useSCFetchUser.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSCFetchUser.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAIhD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAC,EAAS,EAAE,IAAW,EAAC,EAAE;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAA;CAAC;;;;EA4ChG"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _Errors = require("../constants/Errors");
|
|
9
|
-
|
|
10
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
11
|
-
|
|
12
|
-
var _utils = require("@selfcommunity/utils");
|
|
13
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const Errors_1 = require("../constants/Errors");
|
|
5
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
6
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
14
7
|
/**
|
|
15
8
|
:::info
|
|
16
9
|
This custom hook is used to fetch a user object.
|
|
@@ -19,50 +12,45 @@ var _utils = require("@selfcommunity/utils");
|
|
|
19
12
|
* @param object.id
|
|
20
13
|
* @param object.user
|
|
21
14
|
*/
|
|
22
|
-
function useSCFetchUser({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
scUser,
|
|
65
|
-
setSCUser,
|
|
66
|
-
error
|
|
67
|
-
};
|
|
68
|
-
}
|
|
15
|
+
function useSCFetchUser({ id = null, user = null }) {
|
|
16
|
+
const [scUser, setSCUser] = (0, react_1.useState)(user);
|
|
17
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
18
|
+
/**
|
|
19
|
+
* Memoized fetchUser
|
|
20
|
+
*/
|
|
21
|
+
const fetchUser = (0, react_1.useMemo)(() => () => {
|
|
22
|
+
return api_services_1.http
|
|
23
|
+
.request({
|
|
24
|
+
url: api_services_1.Endpoints.User.url({ id: id }),
|
|
25
|
+
method: api_services_1.Endpoints.User.method,
|
|
26
|
+
})
|
|
27
|
+
.then((res) => {
|
|
28
|
+
if (res.status >= 300) {
|
|
29
|
+
return Promise.reject(res);
|
|
30
|
+
}
|
|
31
|
+
return Promise.resolve(res.data);
|
|
32
|
+
});
|
|
33
|
+
}, [id]);
|
|
34
|
+
/**
|
|
35
|
+
* If id resolve the obj
|
|
36
|
+
*/
|
|
37
|
+
(0, react_1.useEffect)(() => {
|
|
38
|
+
if (id) {
|
|
39
|
+
fetchUser()
|
|
40
|
+
.then((obj) => {
|
|
41
|
+
setSCUser(obj);
|
|
42
|
+
})
|
|
43
|
+
.catch((err) => {
|
|
44
|
+
setError(`User with id ${id} not found`);
|
|
45
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `User with id ${id} not found`);
|
|
46
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
setSCUser(user);
|
|
51
|
+
}
|
|
52
|
+
}, [id, user]);
|
|
53
|
+
return { scUser, setSCUser, error };
|
|
54
|
+
}
|
|
55
|
+
exports.default = useSCFetchUser;
|
|
56
|
+
//# sourceMappingURL=useSCFetchUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchUser.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchUser.ts"],"names":[],"mappings":";;AAAA,iCAAmD;AACnD,gDAAkD;AAElD,8DAA0E;AAC1E,gDAA4C;AAE5C;;;;;;;GAOG;AACH,SAAwB,cAAc,CAAC,E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