@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,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
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
|
-
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
3
|
+
import { Logger } from '@selfcommunity/utils';
|
|
4
|
+
import { SCOPE_SC_CORE } from '../constants/Errors';
|
|
5
|
+
import { SCFeedObjectTypologyType } from '@selfcommunity/types';
|
|
6
|
+
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
|
|
18
7
|
/**
|
|
19
8
|
:::info
|
|
20
9
|
This custom hook is used to fetch a feed object.
|
|
@@ -24,56 +13,44 @@ var _useDeepCompareEffect = require("use-deep-compare-effect");
|
|
|
24
13
|
* @param object.feedObject
|
|
25
14
|
* @param object.feedObjectType
|
|
26
15
|
*/
|
|
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
|
-
}
|
|
16
|
+
export default function useSCFetchFeedObject({ id = null, feedObject = null, feedObjectType = SCFeedObjectTypologyType.POST || SCFeedObjectTypologyType.DISCUSSION || SCFeedObjectTypologyType.STATUS, }) {
|
|
17
|
+
const [obj, setObj] = useState(feedObject);
|
|
18
|
+
const [error, setError] = useState(null);
|
|
19
|
+
/**
|
|
20
|
+
* Memoized fetchFeedObject
|
|
21
|
+
*/
|
|
22
|
+
const fetchFeedObject = () => {
|
|
23
|
+
return http
|
|
24
|
+
.request({
|
|
25
|
+
url: Endpoints.FeedObject.url({ type: feedObjectType, id: id }),
|
|
26
|
+
method: Endpoints.FeedObject.method,
|
|
27
|
+
})
|
|
28
|
+
.then((res) => {
|
|
29
|
+
if (res.status >= 300) {
|
|
30
|
+
return Promise.reject(res);
|
|
31
|
+
}
|
|
32
|
+
return Promise.resolve(res.data);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* If id and feedObjectType resolve feddObject
|
|
37
|
+
*/
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (id && feedObjectType) {
|
|
40
|
+
fetchFeedObject()
|
|
41
|
+
.then((obj) => {
|
|
42
|
+
setObj(obj);
|
|
43
|
+
})
|
|
44
|
+
.catch((err) => {
|
|
45
|
+
setError(`FeedObject with id ${id} not found`);
|
|
46
|
+
Logger.error(SCOPE_SC_CORE, `FeedObject with id ${id} not found`);
|
|
47
|
+
Logger.error(SCOPE_SC_CORE, err.message);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, [id, feedObjectType]);
|
|
51
|
+
useDeepCompareEffectNoCheck(() => {
|
|
52
|
+
setObj(feedObject);
|
|
53
|
+
}, [feedObject]);
|
|
54
|
+
return { obj, setObj, error };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=useSCFetchFeedObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchFeedObject.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchFeedObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAE,SAAS,EAAe,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAyC,wBAAwB,EAAmC,MAAM,sBAAsB,CAAC;AACxI,OAAO,EAAC,2BAA2B,EAAC,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,EAAE,GAAG,IAAI,EACT,UAAU,GAAG,IAAI,EACjB,cAAc,GAAG,wBAAwB,CAAC,IAAI,IAAI,wBAAwB,CAAC,UAAU,IAAI,wBAAwB,CAAC,MAAM,GAKzH;IACC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAA2D,UAAU,CAAC,CAAC;IACrG,MAAM,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IAEjB,OAAO,EAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCIncubatorType } from '@selfcommunity/types';
|
|
3
|
+
/**
|
|
4
|
+
:::info
|
|
5
|
+
This custom hook is used to fetch an incubator object.
|
|
6
|
+
:::
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.incubator
|
|
10
|
+
*/
|
|
11
|
+
export default function useSCFetchIncubator({ id, incubator }: {
|
|
12
|
+
id?: number;
|
|
13
|
+
incubator?: SCIncubatorType;
|
|
14
|
+
}): {
|
|
15
|
+
scIncubator: SCIncubatorType;
|
|
16
|
+
setSCIncubator: import("react").Dispatch<import("react").SetStateAction<SCIncubatorType>>;
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useSCFetchIncubator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchIncubator.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSCFetchIncubator.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAIrD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAC,EAAS,EAAE,SAAgB,EAAC,EAAE;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,eAAe,CAAA;CAAC;;;;EA0CpH"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _react = require("react");
|
|
7
|
-
|
|
8
|
-
var _Errors = require("../constants/Errors");
|
|
9
|
-
|
|
10
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
11
|
-
|
|
12
|
-
var _utils = require("@selfcommunity/utils");
|
|
13
|
-
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { SCOPE_SC_CORE } from '../constants/Errors';
|
|
3
|
+
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
4
|
+
import { Logger } from '@selfcommunity/utils';
|
|
14
5
|
/**
|
|
15
6
|
:::info
|
|
16
7
|
This custom hook is used to fetch an incubator object.
|
|
@@ -19,50 +10,41 @@ var _utils = require("@selfcommunity/utils");
|
|
|
19
10
|
* @param object.id
|
|
20
11
|
* @param object.incubator
|
|
21
12
|
*/
|
|
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
|
-
}
|
|
13
|
+
export default function useSCFetchIncubator({ id = null, incubator = null }) {
|
|
14
|
+
const [scIncubator, setSCIncubator] = useState(incubator);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
/**
|
|
17
|
+
* Memoized fetchIncubator
|
|
18
|
+
*/
|
|
19
|
+
const fetchIncubator = useMemo(() => () => {
|
|
20
|
+
return http
|
|
21
|
+
.request({
|
|
22
|
+
url: Endpoints.GetASpecificIncubator.url({ id: id }),
|
|
23
|
+
method: Endpoints.GetASpecificIncubator.method,
|
|
24
|
+
})
|
|
25
|
+
.then((res) => {
|
|
26
|
+
if (res.status >= 300) {
|
|
27
|
+
return Promise.reject(res);
|
|
28
|
+
}
|
|
29
|
+
return Promise.resolve(res.data);
|
|
30
|
+
});
|
|
31
|
+
}, [id]);
|
|
32
|
+
/**
|
|
33
|
+
* If id resolve the obj
|
|
34
|
+
*/
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (id) {
|
|
37
|
+
fetchIncubator()
|
|
38
|
+
.then((obj) => {
|
|
39
|
+
setSCIncubator(obj);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
setError(`Incubator with id ${id} not found`);
|
|
43
|
+
Logger.error(SCOPE_SC_CORE, `Incubator with id ${id} not found`);
|
|
44
|
+
Logger.error(SCOPE_SC_CORE, err.message);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, [id]);
|
|
48
|
+
return { scIncubator, setSCIncubator, error };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=useSCFetchIncubator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchIncubator.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchIncubator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAC,IAAI,EAAE,SAAS,EAAe,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAC,EAAE,GAAG,IAAI,EAAE,SAAS,GAAG,IAAI,EAA6C;IACnH,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAA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AC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCTagType } from '@selfcommunity/types';
|
|
3
|
+
/**
|
|
4
|
+
:::info
|
|
5
|
+
This custom hook is used to fetch a tag object.
|
|
6
|
+
:::
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.tag
|
|
10
|
+
*/
|
|
11
|
+
export default function useSCFetchTag({ id, tag }: {
|
|
12
|
+
id?: number;
|
|
13
|
+
tag?: SCTagType;
|
|
14
|
+
}): {
|
|
15
|
+
scTag: SCTagType;
|
|
16
|
+
setSCTag: import("react").Dispatch<import("react").SetStateAction<SCTagType>>;
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useSCFetchTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchTag.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSCFetchTag.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAI/C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAC,EAAS,EAAE,GAAU,EAAC,EAAE;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,SAAS,CAAA;CAAC;;;;EA0C5F"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _react = require("react");
|
|
7
|
-
|
|
8
|
-
var _Errors = require("../constants/Errors");
|
|
9
|
-
|
|
10
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
11
|
-
|
|
12
|
-
var _utils = require("@selfcommunity/utils");
|
|
13
|
-
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { SCOPE_SC_CORE } from '../constants/Errors';
|
|
3
|
+
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
4
|
+
import { Logger } from '@selfcommunity/utils';
|
|
14
5
|
/**
|
|
15
6
|
:::info
|
|
16
7
|
This custom hook is used to fetch a tag object.
|
|
@@ -19,50 +10,41 @@ var _utils = require("@selfcommunity/utils");
|
|
|
19
10
|
* @param object.id
|
|
20
11
|
* @param object.tag
|
|
21
12
|
*/
|
|
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
|
-
}
|
|
13
|
+
export default function useSCFetchTag({ id = null, tag = null }) {
|
|
14
|
+
const [scTag, setSCTag] = useState(tag);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
/**
|
|
17
|
+
* Memoized fetchTag
|
|
18
|
+
*/
|
|
19
|
+
const fetchTag = useMemo(() => () => {
|
|
20
|
+
return http
|
|
21
|
+
.request({
|
|
22
|
+
url: Endpoints.Tag.url({ id: id }),
|
|
23
|
+
method: Endpoints.Tag.method,
|
|
24
|
+
})
|
|
25
|
+
.then((res) => {
|
|
26
|
+
if (res.status >= 300) {
|
|
27
|
+
return Promise.reject(res);
|
|
28
|
+
}
|
|
29
|
+
return Promise.resolve(res.data);
|
|
30
|
+
});
|
|
31
|
+
}, [id]);
|
|
32
|
+
/**
|
|
33
|
+
* If id attempt to get the tag by id
|
|
34
|
+
*/
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (id) {
|
|
37
|
+
fetchTag()
|
|
38
|
+
.then((obj) => {
|
|
39
|
+
setSCTag(obj);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
setError(`Tag with id ${id} not found`);
|
|
43
|
+
Logger.error(SCOPE_SC_CORE, `Tag with id ${id} not found`);
|
|
44
|
+
Logger.error(SCOPE_SC_CORE, err.message);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, [id]);
|
|
48
|
+
return { scTag, setSCTag, error };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=useSCFetchTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchTag.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAC,IAAI,EAAE,SAAS,EAAe,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAC,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,IAAI,EAAiC;IAC3F,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAY,GAAG,CAAC,CAAC;IACnD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,MAAM,QAAQ,GAA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etch a user object.
|
|
6
|
+
:::
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.user
|
|
10
|
+
*/
|
|
11
|
+
export default function useSCFetchUser({ id, user }: {
|
|
12
|
+
id?: number;
|
|
13
|
+
user?: SCUserType;
|
|
14
|
+
}): {
|
|
15
|
+
scUser: SCUserType;
|
|
16
|
+
setSCUser: import("react").Dispatch<import("react").SetStateAction<SCUserType>>;
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useSCFetchUser.d.ts.map
|
|
@@ -0,0 +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;;;;EA4ChG"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _react = require("react");
|
|
7
|
-
|
|
8
|
-
var _Errors = require("../constants/Errors");
|
|
9
|
-
|
|
10
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
11
|
-
|
|
12
|
-
var _utils = require("@selfcommunity/utils");
|
|
13
|
-
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { SCOPE_SC_CORE } from '../constants/Errors';
|
|
3
|
+
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
4
|
+
import { Logger } from '@selfcommunity/utils';
|
|
14
5
|
/**
|
|
15
6
|
:::info
|
|
16
7
|
This custom hook is used to fetch a user object.
|
|
@@ -19,50 +10,44 @@ var _utils = require("@selfcommunity/utils");
|
|
|
19
10
|
* @param object.id
|
|
20
11
|
* @param object.user
|
|
21
12
|
*/
|
|
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
|
-
return {
|
|
64
|
-
scUser,
|
|
65
|
-
setSCUser,
|
|
66
|
-
error
|
|
67
|
-
};
|
|
68
|
-
}
|
|
13
|
+
export default function useSCFetchUser({ id = null, user = null }) {
|
|
14
|
+
const [scUser, setSCUser] = useState(user);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
/**
|
|
17
|
+
* Memoized fetchUser
|
|
18
|
+
*/
|
|
19
|
+
const fetchUser = useMemo(() => () => {
|
|
20
|
+
return http
|
|
21
|
+
.request({
|
|
22
|
+
url: Endpoints.User.url({ id: id }),
|
|
23
|
+
method: Endpoints.User.method,
|
|
24
|
+
})
|
|
25
|
+
.then((res) => {
|
|
26
|
+
if (res.status >= 300) {
|
|
27
|
+
return Promise.reject(res);
|
|
28
|
+
}
|
|
29
|
+
return Promise.resolve(res.data);
|
|
30
|
+
});
|
|
31
|
+
}, [id]);
|
|
32
|
+
/**
|
|
33
|
+
* If id resolve the obj
|
|
34
|
+
*/
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (id) {
|
|
37
|
+
fetchUser()
|
|
38
|
+
.then((obj) => {
|
|
39
|
+
setSCUser(obj);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
setError(`User with id ${id} not found`);
|
|
43
|
+
Logger.error(SCOPE_SC_CORE, `User with id ${id} not found`);
|
|
44
|
+
Logger.error(SCOPE_SC_CORE, err.message);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
setSCUser(user);
|
|
49
|
+
}
|
|
50
|
+
}, [id, user]);
|
|
51
|
+
return { scUser, setSCUser, error };
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=useSCFetchUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchUser.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAC,IAAI,EAAE,SAAS,EAAe,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAC,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAmC;IAC/F,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAa,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,MAAM,SAAS,GAAG,OAAO,CACvB,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,OAAO,IAAI;aACR,OAAO,CAAC;YACP,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC;YACjC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;SAC9B,CAAC;aACD,IAAI,CAAC,CAAC,GAA6B,EAAE,EAAE;YACtC,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,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,EAAE,EAAE;YACN,SAAS,EAAE;iBACR,IAAI,CAAC,CAAC,GAAe,EAAE,EAAE;gBACxB,SAAS,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACb,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;gBACzC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;gBAC5D,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;SACN;aAAM;YACL,SAAS,CAAC,IAAI,CAAC,CAAC;SACjB;IACH,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;IAEf,OAAO,EAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SCCategoryType, SCUserType } from '@selfcommunity/types';
|
|
2
|
+
/**
|
|
3
|
+
:::info
|
|
4
|
+
This custom hook is used to manage the categories followed.
|
|
5
|
+
:::
|
|
6
|
+
|
|
7
|
+
:::tipHow to use it:
|
|
8
|
+
Follow these steps:
|
|
9
|
+
```jsx
|
|
10
|
+
1. const scUserContext: SCUserContextType = useSCUser();
|
|
11
|
+
2. const scFollowedCategoriesManager: SCFollowedCategoriesManagerType = scUserContext.manager.categories;
|
|
12
|
+
3. scFollowedCategoriesManager.isFollowed(category)
|
|
13
|
+
```
|
|
14
|
+
:::
|
|
15
|
+
*/
|
|
16
|
+
export default function useSCFollowedCategoriesManager(user?: SCUserType, updateUser?: (info: any) => void): {
|
|
17
|
+
categories: any[];
|
|
18
|
+
loading: number[];
|
|
19
|
+
isLoading: (obj: {
|
|
20
|
+
id: number;
|
|
21
|
+
}) => boolean;
|
|
22
|
+
follow?: undefined;
|
|
23
|
+
isFollowed?: undefined;
|
|
24
|
+
refresh?: undefined;
|
|
25
|
+
emptyCache?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
categories: any[];
|
|
28
|
+
loading: number[];
|
|
29
|
+
isLoading: (obj: {
|
|
30
|
+
id: number;
|
|
31
|
+
}) => boolean;
|
|
32
|
+
follow: (category: SCCategoryType) => Promise<any>;
|
|
33
|
+
isFollowed: (category: SCCategoryType) => boolean;
|
|
34
|
+
refresh: () => void;
|
|
35
|
+
emptyCache: () => void;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=useSCFollowedCategoriesManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFollowedCategoriesManager.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSCFollowedCategoriesManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,cAAc,EAAE,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAKhE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,KAAA,KAAK,IAAI;;;;;;;;;;;;;;;;uBA2CpF,cAAc,KAAG,QAAQ,GAAG,CAAC;2BAqD7B,cAAc,KAAG,OAAO;mBAtF3B,IAAI;;EAsGjB"}
|