@selfcommunity/react-core 0.1.7 → 0.1.8-alpha.2
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,23 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
var _Errors = require("../constants/Errors");
|
|
10
|
-
|
|
11
|
-
var _types = require("@selfcommunity/types");
|
|
12
|
-
|
|
13
|
-
var _apiServices = require("@selfcommunity/api-services");
|
|
14
|
-
|
|
15
|
-
var _utils = require("@selfcommunity/utils");
|
|
16
|
-
|
|
17
|
-
var _useSCFetchFeedObject = _interopRequireDefault(require("./useSCFetchFeedObject"));
|
|
18
|
-
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
|
|
1
|
+
import { useEffect, useReducer } from 'react';
|
|
2
|
+
import { SCOPE_SC_CORE } from '../constants/Errors';
|
|
3
|
+
import { SCCommentsOrderBy } from '@selfcommunity/types';
|
|
4
|
+
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
5
|
+
import { Logger } from '@selfcommunity/utils';
|
|
6
|
+
import useSCFetchFeedObject from './useSCFetchFeedObject';
|
|
21
7
|
/**
|
|
22
8
|
* @hidden
|
|
23
9
|
* We have complex state logic that involves multiple sub-values,
|
|
@@ -25,13 +11,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
25
11
|
* Define all possible auth action types label
|
|
26
12
|
* Use this to export actions and dispatch an action
|
|
27
13
|
*/
|
|
28
|
-
const commentsObjectActionTypes = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
export const commentsObjectActionTypes = {
|
|
15
|
+
LOADING_NEXT: '_loading_next',
|
|
16
|
+
LOADING_PREVIOUS: '_loading_previous',
|
|
17
|
+
DATA_NEXT_LOADED: '_data_next_loaded',
|
|
18
|
+
DATA_PREVIOUS_LOADED: '_data_previous_loaded',
|
|
19
|
+
DATA_RELOAD: '_data_reload',
|
|
20
|
+
DATA_RELOADED: '_data_reloaded',
|
|
35
21
|
};
|
|
36
22
|
/**
|
|
37
23
|
* commentsReducer:
|
|
@@ -40,81 +26,40 @@ const commentsObjectActionTypes = {
|
|
|
40
26
|
* @param state
|
|
41
27
|
* @param action
|
|
42
28
|
*/
|
|
43
|
-
|
|
44
|
-
exports.commentsObjectActionTypes = commentsObjectActionTypes;
|
|
45
|
-
|
|
46
29
|
function commentsReducer(state, action) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
comments: action.payload.comments,
|
|
64
|
-
isLoadingNext: false,
|
|
65
|
-
componentLoaded: true,
|
|
66
|
-
next: action.payload.next
|
|
67
|
-
}, action.payload.previous ? {
|
|
68
|
-
previous: action.payload.previous
|
|
69
|
-
} : {}, action.payload.total ? {
|
|
70
|
-
total: action.payload.total
|
|
71
|
-
} : {});
|
|
72
|
-
|
|
73
|
-
case commentsObjectActionTypes.DATA_PREVIOUS_LOADED:
|
|
74
|
-
return Object.assign({}, state, {
|
|
75
|
-
page: action.payload.currentPage,
|
|
76
|
-
comments: action.payload.comments,
|
|
77
|
-
isLoadingPrevious: false,
|
|
78
|
-
previous: action.payload.previous
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
case commentsObjectActionTypes.DATA_RELOAD:
|
|
82
|
-
return Object.assign({}, state, {
|
|
83
|
-
next: action.payload.next,
|
|
84
|
-
comments: [],
|
|
85
|
-
total: 0,
|
|
86
|
-
previous: null,
|
|
87
|
-
reload: true
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
case commentsObjectActionTypes.DATA_RELOADED:
|
|
91
|
-
return Object.assign({}, state, {
|
|
92
|
-
componentLoaded: false,
|
|
93
|
-
reload: false
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
default:
|
|
97
|
-
throw new Error(`Unhandled type: ${action.type}`);
|
|
98
|
-
}
|
|
30
|
+
switch (action.type) {
|
|
31
|
+
case commentsObjectActionTypes.LOADING_NEXT:
|
|
32
|
+
return Object.assign(Object.assign({}, state), { isLoadingNext: true, isLoadingPrevious: false });
|
|
33
|
+
case commentsObjectActionTypes.LOADING_PREVIOUS:
|
|
34
|
+
return Object.assign(Object.assign({}, state), { isLoadingNext: false, isLoadingPrevious: true });
|
|
35
|
+
case commentsObjectActionTypes.DATA_NEXT_LOADED:
|
|
36
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, state), { page: action.payload.currentPage, comments: action.payload.comments, isLoadingNext: false, componentLoaded: true, next: action.payload.next }), (action.payload.previous ? { previous: action.payload.previous } : {})), (action.payload.total ? { total: action.payload.total } : {}));
|
|
37
|
+
case commentsObjectActionTypes.DATA_PREVIOUS_LOADED:
|
|
38
|
+
return Object.assign(Object.assign({}, state), { page: action.payload.currentPage, comments: action.payload.comments, isLoadingPrevious: false, previous: action.payload.previous });
|
|
39
|
+
case commentsObjectActionTypes.DATA_RELOAD:
|
|
40
|
+
return Object.assign(Object.assign({}, state), { next: action.payload.next, comments: [], total: 0, previous: null, reload: true });
|
|
41
|
+
case commentsObjectActionTypes.DATA_RELOADED:
|
|
42
|
+
return Object.assign(Object.assign({}, state), { componentLoaded: false, reload: false });
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(`Unhandled type: ${action.type}`);
|
|
45
|
+
}
|
|
99
46
|
}
|
|
100
47
|
/**
|
|
101
48
|
* Define initial state
|
|
102
49
|
* @param data
|
|
103
50
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
51
|
function stateInitializer(data) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
52
|
+
return {
|
|
53
|
+
componentLoaded: false,
|
|
54
|
+
comments: [],
|
|
55
|
+
total: 0,
|
|
56
|
+
next: data.next,
|
|
57
|
+
previous: null,
|
|
58
|
+
isLoadingNext: false,
|
|
59
|
+
isLoadingPrevious: false,
|
|
60
|
+
page: data.offset / data.pageSize + 1,
|
|
61
|
+
reload: false,
|
|
62
|
+
};
|
|
118
63
|
}
|
|
119
64
|
/**
|
|
120
65
|
:::info
|
|
@@ -128,169 +73,120 @@ function stateInitializer(data) {
|
|
|
128
73
|
* @param orderBy
|
|
129
74
|
* @param parent
|
|
130
75
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
id
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const [state, dispatch] = (0, _react.useReducer)(commentsReducer, {}, () => stateInitializer({
|
|
173
|
-
offset,
|
|
174
|
-
pageSize,
|
|
175
|
-
next: getNextUrl()
|
|
176
|
-
}));
|
|
177
|
-
/**
|
|
178
|
-
* Calculate current page
|
|
179
|
-
*/
|
|
180
|
-
|
|
181
|
-
const getCurrentPage = url => {
|
|
182
|
-
const urlSearchParams = new URLSearchParams(url);
|
|
183
|
-
const params = Object.fromEntries(urlSearchParams.entries());
|
|
184
|
-
const currentOffset = params.offset ? parseInt(params.offset) : 0;
|
|
185
|
-
return currentOffset / pageSize + 1;
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Get Comments
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const performFetchComments = url => {
|
|
193
|
-
return _apiServices.http.request({
|
|
194
|
-
url,
|
|
195
|
-
method: _apiServices.Endpoints.Comments.method
|
|
196
|
-
}).then(res => {
|
|
197
|
-
if (res.status >= 300) {
|
|
198
|
-
return Promise.reject(res);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return Promise.resolve(res.data);
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* Fetch previous comments
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
function getPreviousPage() {
|
|
210
|
-
if (obj && state.previous && !state.isLoadingPrevious) {
|
|
211
|
-
dispatch({
|
|
212
|
-
type: commentsObjectActionTypes.LOADING_PREVIOUS
|
|
213
|
-
});
|
|
214
|
-
performFetchComments(state.previous).then(res => {
|
|
215
|
-
let currentPage = getCurrentPage(state.previous);
|
|
216
|
-
dispatch({
|
|
217
|
-
type: commentsObjectActionTypes.DATA_PREVIOUS_LOADED,
|
|
218
|
-
payload: {
|
|
219
|
-
page: currentPage,
|
|
220
|
-
comments: [...res.results, ...state.comments],
|
|
221
|
-
previous: res.previous
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
onChangePage && onChangePage(currentPage);
|
|
225
|
-
}).catch(error => {
|
|
226
|
-
_utils.Logger.error(_Errors.SCOPE_SC_CORE, error);
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Fetch next comments
|
|
232
|
-
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
function getNextPage() {
|
|
236
|
-
if (obj && state.next && !state.isLoadingNext) {
|
|
237
|
-
dispatch({
|
|
238
|
-
type: commentsObjectActionTypes.LOADING_NEXT
|
|
239
|
-
});
|
|
240
|
-
performFetchComments(state.next).then(res => {
|
|
241
|
-
let currentPage = getCurrentPage(state.next);
|
|
242
|
-
dispatch({
|
|
243
|
-
type: commentsObjectActionTypes.DATA_NEXT_LOADED,
|
|
244
|
-
payload: Object.assign({
|
|
245
|
-
page: currentPage,
|
|
246
|
-
comments: [...state.comments, ...res.results],
|
|
247
|
-
next: res.next,
|
|
248
|
-
total: res.count,
|
|
249
|
-
componentLoaded: true
|
|
250
|
-
}, offset && state.comments.length === 0 ? {
|
|
251
|
-
previous: res.previous
|
|
252
|
-
} : {})
|
|
76
|
+
export default function useSCFetchCommentObjects(props) {
|
|
77
|
+
// PROPS
|
|
78
|
+
const { id, feedObject, feedObjectType, offset = 0, pageSize = 5, orderBy = SCCommentsOrderBy.ADDED_AT_DESC, parent, onChangePage } = props;
|
|
79
|
+
// FeedObject
|
|
80
|
+
const { obj, setObj } = useSCFetchFeedObject({ id, feedObject, feedObjectType });
|
|
81
|
+
const objId = obj ? obj.id : null;
|
|
82
|
+
/**
|
|
83
|
+
* Get next url
|
|
84
|
+
*/
|
|
85
|
+
const getNextUrl = () => {
|
|
86
|
+
const _offset = offset ? `&offset=${offset}` : '';
|
|
87
|
+
const _parent = parent ? `&parent=${parent}` : '';
|
|
88
|
+
const _objectId = obj ? obj.id : id;
|
|
89
|
+
const _typeObject = obj ? obj.type : feedObjectType;
|
|
90
|
+
return `${Endpoints.Comments.url()}?${_typeObject}=${_objectId}&limit=${pageSize}&ordering=${orderBy}${_offset}${_parent}`;
|
|
91
|
+
};
|
|
92
|
+
// STATE
|
|
93
|
+
const [state, dispatch] = useReducer(commentsReducer, {}, () => stateInitializer({ offset, pageSize, next: getNextUrl() }));
|
|
94
|
+
/**
|
|
95
|
+
* Calculate current page
|
|
96
|
+
*/
|
|
97
|
+
const getCurrentPage = (url) => {
|
|
98
|
+
const urlSearchParams = new URLSearchParams(url);
|
|
99
|
+
const params = Object.fromEntries(urlSearchParams.entries());
|
|
100
|
+
const currentOffset = params.offset ? parseInt(params.offset) : 0;
|
|
101
|
+
return currentOffset / pageSize + 1;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Get Comments
|
|
105
|
+
*/
|
|
106
|
+
const performFetchComments = (url) => {
|
|
107
|
+
return http
|
|
108
|
+
.request({
|
|
109
|
+
url,
|
|
110
|
+
method: Endpoints.Comments.method,
|
|
111
|
+
})
|
|
112
|
+
.then((res) => {
|
|
113
|
+
if (res.status >= 300) {
|
|
114
|
+
return Promise.reject(res);
|
|
115
|
+
}
|
|
116
|
+
return Promise.resolve(res.data);
|
|
253
117
|
});
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Fetch previous comments
|
|
121
|
+
*/
|
|
122
|
+
function getPreviousPage() {
|
|
123
|
+
if (obj && state.previous && !state.isLoadingPrevious) {
|
|
124
|
+
dispatch({ type: commentsObjectActionTypes.LOADING_PREVIOUS });
|
|
125
|
+
performFetchComments(state.previous)
|
|
126
|
+
.then((res) => {
|
|
127
|
+
let currentPage = getCurrentPage(state.previous);
|
|
128
|
+
dispatch({
|
|
129
|
+
type: commentsObjectActionTypes.DATA_PREVIOUS_LOADED,
|
|
130
|
+
payload: {
|
|
131
|
+
page: currentPage,
|
|
132
|
+
comments: [...res.results, ...state.comments],
|
|
133
|
+
previous: res.previous,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
onChangePage && onChangePage(currentPage);
|
|
137
|
+
})
|
|
138
|
+
.catch((error) => {
|
|
139
|
+
Logger.error(SCOPE_SC_CORE, error);
|
|
140
|
+
});
|
|
271
141
|
}
|
|
272
|
-
});
|
|
273
142
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Fetch next comments
|
|
145
|
+
*/
|
|
146
|
+
function getNextPage() {
|
|
147
|
+
if (obj && state.next && !state.isLoadingNext) {
|
|
148
|
+
dispatch({ type: commentsObjectActionTypes.LOADING_NEXT });
|
|
149
|
+
performFetchComments(state.next)
|
|
150
|
+
.then((res) => {
|
|
151
|
+
let currentPage = getCurrentPage(state.next);
|
|
152
|
+
dispatch({
|
|
153
|
+
type: commentsObjectActionTypes.DATA_NEXT_LOADED,
|
|
154
|
+
payload: Object.assign({ page: currentPage, comments: [...state.comments, ...res.results], next: res.next, total: res.count, componentLoaded: true }, (offset && state.comments.length === 0 ? { previous: res.previous } : {})),
|
|
155
|
+
});
|
|
156
|
+
onChangePage && onChangePage(currentPage);
|
|
157
|
+
})
|
|
158
|
+
.catch((error) => {
|
|
159
|
+
Logger.error(SCOPE_SC_CORE, error);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
285
162
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
163
|
+
/**
|
|
164
|
+
* Reset component status on change orderBy, pageSize, offset
|
|
165
|
+
*/
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (state.componentLoaded && Boolean(obj) && !state.reload) {
|
|
168
|
+
dispatch({
|
|
169
|
+
type: commentsObjectActionTypes.DATA_RELOAD,
|
|
170
|
+
payload: {
|
|
171
|
+
next: getNextUrl(),
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}, [objId, parent, orderBy, pageSize, offset]);
|
|
176
|
+
/**
|
|
177
|
+
* Reload fetch comments
|
|
178
|
+
*/
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (state.componentLoaded && state.reload && !state.isLoadingNext && !state.isLoadingPrevious) {
|
|
181
|
+
dispatch({
|
|
182
|
+
type: commentsObjectActionTypes.DATA_RELOADED,
|
|
183
|
+
});
|
|
184
|
+
getNextPage();
|
|
185
|
+
}
|
|
186
|
+
}, [state.reload]);
|
|
187
|
+
return Object.assign(Object.assign({ feedObject: obj, setFeedObject: setObj }, state), { pageSize,
|
|
188
|
+
getNextPage,
|
|
189
|
+
getPreviousPage,
|
|
190
|
+
orderBy });
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=useSCFetchCommentObjects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchCommentObjects.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchCommentObjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,iBAAiB,EAA4D,MAAM,sBAAsB,CAAC;AAClH,OAAO,EAAC,IAAI,EAAE,SAAS,EAAe,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAiB1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,YAAY,EAAE,eAAe;IAC7B,gBAAgB,EAAE,mBAAmB;IACrC,gBAAgB,EAAE,mBAAmB;IACr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;aACF,CAAC,CAAC;SACJ;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/C;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;YAC7F,QAAQ,CAAC;gBACP,IAAI,EAAE,yBAAyB,CAAC,aAAa;aAC9C,CAAC,CAAC;YACH,WAAW,EAAE,CAAC;SACf;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnB,qCACE,UAAU,EAAE,GAAG,EACf,aAAa,EAAE,MAAM,IAClB,KAAK,KACR,QAAQ;QACR,WAAW;QACX,eAAe;QACf,OAAO,IACP;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCCustomAdvPosition, SCCustomAdvType } from '@selfcommunity/types';
|
|
3
|
+
/**
|
|
4
|
+
:::info
|
|
5
|
+
This custom hook is used to fetch a custom adv object.
|
|
6
|
+
:::
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.position
|
|
9
|
+
* @param object.categoryId
|
|
10
|
+
*/
|
|
11
|
+
export default function useSCFetchCustomAdv({ position, categoriesId }: {
|
|
12
|
+
position?: SCCustomAdvPosition;
|
|
13
|
+
categoriesId?: Array<number>;
|
|
14
|
+
}): {
|
|
15
|
+
scCustomAdv: SCCustomAdvType;
|
|
16
|
+
setSCCustomAdv: import("react").Dispatch<import("react").SetStateAction<SCCustomAdvType>>;
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useSCFetchCustomAdv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchCustomAdv.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSCFetchCustomAdv.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAE1E;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAC,QAAe,EAAE,YAAmB,EAAC,EAAE;IAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAAC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAC;;;;EA2DjJ"}
|
|
@@ -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, useRef, 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 custom adv object.
|
|
@@ -19,66 +10,54 @@ var _utils = require("@selfcommunity/utils");
|
|
|
19
10
|
* @param object.position
|
|
20
11
|
* @param object.categoryId
|
|
21
12
|
*/
|
|
22
|
-
function useSCFetchCustomAdv({
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
_utils.Logger.error(_Errors.SCOPE_SC_CORE, `Custom ADV with position ${position} not found`);
|
|
75
|
-
|
|
76
|
-
_utils.Logger.error(_Errors.SCOPE_SC_CORE, err.message);
|
|
77
|
-
});
|
|
78
|
-
}, [position, `${categoriesId}`]);
|
|
79
|
-
return {
|
|
80
|
-
scCustomAdv,
|
|
81
|
-
setSCCustomAdv,
|
|
82
|
-
error
|
|
83
|
-
};
|
|
84
|
-
}
|
|
13
|
+
export default function useSCFetchCustomAdv({ position = null, categoriesId = null }) {
|
|
14
|
+
const [scCustomAdv, setSCCustomAdv] = useState(null);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
const mounted = useRef(false);
|
|
17
|
+
/**
|
|
18
|
+
* Memoized fetchCustomAdv
|
|
19
|
+
*/
|
|
20
|
+
const fetchCustomAdv = useMemo(() => () => {
|
|
21
|
+
return http
|
|
22
|
+
.request({
|
|
23
|
+
url: Endpoints.CustomAdvSearch.url(),
|
|
24
|
+
method: Endpoints.CustomAdvSearch.method,
|
|
25
|
+
params: Object.assign(Object.assign({}, (position && { position: position })), (categoriesId && { categories: `[${categoriesId.toString()}]` })),
|
|
26
|
+
})
|
|
27
|
+
.then((res) => {
|
|
28
|
+
if (res.status >= 300) {
|
|
29
|
+
return Promise.reject(res);
|
|
30
|
+
}
|
|
31
|
+
return Promise.resolve(res.data.results);
|
|
32
|
+
});
|
|
33
|
+
}, [position, `${categoriesId}`]);
|
|
34
|
+
/**
|
|
35
|
+
* Track mount/unmount
|
|
36
|
+
*/
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
mounted.current = true;
|
|
39
|
+
return () => {
|
|
40
|
+
mounted.current = false;
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
/**
|
|
44
|
+
* If id attempt to get the category by id
|
|
45
|
+
*/
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
fetchCustomAdv()
|
|
48
|
+
.then((objects) => {
|
|
49
|
+
if (mounted.current) {
|
|
50
|
+
setSCCustomAdv(objects[Math.floor(Math.random() * objects.length)]);
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
.catch((err) => {
|
|
54
|
+
if (mounted.current) {
|
|
55
|
+
setError(`Custom ADV with position ${position} not found`);
|
|
56
|
+
}
|
|
57
|
+
Logger.error(SCOPE_SC_CORE, `Custom ADV with position ${position} not found`);
|
|
58
|
+
Logger.error(SCOPE_SC_CORE, err.message);
|
|
59
|
+
});
|
|
60
|
+
}, [position, `${categoriesId}`]);
|
|
61
|
+
return { scCustomAdv, setSCCustomAdv, error };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=useSCFetchCustomAdv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchCustomAdv.js","sourceRoot":"","sources":["../../../src/hooks/useSCFetchCustomAdv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,IAAI,EAAE,SAAS,EAAe,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAG5C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAC,QAAQ,GA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QACb,cAAc,EAAE;aACb,IAAI,CAAC,CAAC,OAA0B,EAAE,EAAE;YACnC,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aACrE;QACH,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,QAAQ,CAAC,4BAA4B,QAAQ,YAAY,CAAC,CAAC;aAC5D;YACD,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,4BAA4B,QAAQ,YAAY,CAAC,CAAC;YAC9E,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC,CAAC;IAElC,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,KAAK,EAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCFeedDiscussionType, SCFeedObjectType, SCFeedObjectTypologyType, SCFeedPostType } from '@selfcommunity/types';
|
|
3
|
+
/**
|
|
4
|
+
:::info
|
|
5
|
+
This custom hook is used to fetch a feed object.
|
|
6
|
+
:::
|
|
7
|
+
* @param object
|
|
8
|
+
* @param object.id
|
|
9
|
+
* @param object.feedObject
|
|
10
|
+
* @param object.feedObjectType
|
|
11
|
+
*/
|
|
12
|
+
export default function useSCFetchFeedObject({ id, feedObject, feedObjectType, }: {
|
|
13
|
+
id?: number;
|
|
14
|
+
feedObject?: SCFeedObjectType;
|
|
15
|
+
feedObjectType?: SCFeedObjectTypologyType;
|
|
16
|
+
}): {
|
|
17
|
+
obj: SCFeedObjectType | SCFeedDiscussionType | SCFeedPostType;
|
|
18
|
+
setObj: import("react").Dispatch<import("react").SetStateAction<SCFeedObjectType | SCFeedDiscussionType | SCFeedPostType>>;
|
|
19
|
+
error: string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useSCFetchFeedObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSCFetchFeedObject.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSCFetchFeedObject.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,oBAAoB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,cAAc,EAAmB,MAAM,sBAAsB,CAAC;AAGxI;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,EAAS,EACT,UAAiB,EACjB,cAAwH,GACzH,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,cAAc,CAAC,EAAE,wBAAwB,CAAC;CAC3C;;;;EA2CA"}
|