@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.
Files changed (395) hide show
  1. package/lib/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts +0 -0
  2. package/lib/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts.map +0 -0
  3. package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js +37 -35
  4. package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
  5. package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts +0 -0
  6. package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts.map +0 -0
  7. package/lib/cjs/components/provider/SCContextProvider/index.js +74 -81
  8. package/lib/cjs/components/provider/SCContextProvider/index.js.map +1 -0
  9. package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts +0 -0
  10. package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts.map +0 -0
  11. package/lib/cjs/components/provider/SCLocaleProvider/index.js +86 -121
  12. package/lib/cjs/components/provider/SCLocaleProvider/index.js.map +1 -0
  13. package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts +0 -0
  14. package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts.map +0 -0
  15. package/lib/cjs/components/provider/SCNotificationProvider/index.js +41 -41
  16. package/lib/cjs/components/provider/SCNotificationProvider/index.js.map +1 -0
  17. package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts +0 -0
  18. package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts.map +0 -0
  19. package/lib/cjs/components/provider/SCPreferencesProvider/index.js +61 -62
  20. package/lib/cjs/components/provider/SCPreferencesProvider/index.js.map +1 -0
  21. package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts +0 -0
  22. package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts.map +1 -1
  23. package/lib/cjs/components/provider/SCRoutingProvider/index.js +104 -111
  24. package/lib/cjs/components/provider/SCRoutingProvider/index.js.map +1 -0
  25. package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts +0 -0
  26. package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts.map +0 -0
  27. package/lib/cjs/components/provider/SCThemeProvider/index.js +66 -79
  28. package/lib/cjs/components/provider/SCThemeProvider/index.js.map +1 -0
  29. package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts +0 -0
  30. package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts.map +0 -0
  31. package/lib/cjs/components/provider/SCUserProvider/index.js +215 -270
  32. package/lib/cjs/components/provider/SCUserProvider/index.js.map +1 -0
  33. package/lib/{types → cjs}/components/router/index.d.ts +0 -0
  34. package/lib/{types → cjs}/components/router/index.d.ts.map +0 -0
  35. package/lib/cjs/components/router/index.js +48 -49
  36. package/lib/cjs/components/router/index.js.map +1 -0
  37. package/lib/{types → cjs}/constants/Actions.d.ts +0 -0
  38. package/lib/{types → cjs}/constants/Actions.d.ts.map +0 -0
  39. package/lib/cjs/constants/Actions.js +3 -4
  40. package/lib/cjs/constants/Actions.js.map +1 -0
  41. package/lib/{types → cjs}/constants/ContextProviders.d.ts +0 -0
  42. package/lib/{types → cjs}/constants/ContextProviders.d.ts.map +0 -0
  43. package/lib/cjs/constants/ContextProviders.js +22 -24
  44. package/lib/cjs/constants/ContextProviders.js.map +1 -0
  45. package/lib/{types → cjs}/constants/Device.d.ts +0 -0
  46. package/lib/{types → cjs}/constants/Device.d.ts.map +0 -0
  47. package/lib/cjs/constants/Device.js +3 -5
  48. package/lib/cjs/constants/Device.js.map +1 -0
  49. package/lib/{types → cjs}/constants/Errors.d.ts +0 -0
  50. package/lib/{types → cjs}/constants/Errors.d.ts.map +0 -0
  51. package/lib/cjs/constants/Errors.js +3 -5
  52. package/lib/cjs/constants/Errors.js.map +1 -0
  53. package/lib/{types → cjs}/constants/Features.d.ts +0 -0
  54. package/lib/{types → cjs}/constants/Features.d.ts.map +0 -0
  55. package/lib/cjs/constants/Features.js +43 -83
  56. package/lib/cjs/constants/Features.js.map +1 -0
  57. package/lib/{types → cjs}/constants/Locale.d.ts +0 -0
  58. package/lib/{types → cjs}/constants/Locale.d.ts.map +0 -0
  59. package/lib/cjs/constants/Locale.js +10 -17
  60. package/lib/cjs/constants/Locale.js.map +1 -0
  61. package/lib/{types → cjs}/constants/Notification.d.ts +0 -0
  62. package/lib/{types → cjs}/constants/Notification.d.ts.map +0 -0
  63. package/lib/cjs/constants/Notification.js +44 -53
  64. package/lib/cjs/constants/Notification.js.map +1 -0
  65. package/lib/{types → cjs}/constants/Notifications.d.ts +0 -0
  66. package/lib/{types → cjs}/constants/Notifications.d.ts.map +0 -0
  67. package/lib/cjs/constants/Notifications.js +11 -25
  68. package/lib/cjs/constants/Notifications.js.map +1 -0
  69. package/lib/cjs/constants/Preferences.d.ts +201 -0
  70. package/lib/cjs/constants/Preferences.d.ts.map +1 -0
  71. package/lib/cjs/constants/Preferences.js +184 -292
  72. package/lib/cjs/constants/Preferences.js.map +1 -0
  73. package/lib/{types → cjs}/constants/Routes.d.ts +0 -0
  74. package/lib/{types → cjs}/constants/Routes.d.ts.map +0 -0
  75. package/lib/cjs/constants/Routes.js +38 -59
  76. package/lib/cjs/constants/Routes.js.map +1 -0
  77. package/lib/{types → cjs}/constants/Session.d.ts +0 -0
  78. package/lib/{types → cjs}/constants/Session.d.ts.map +0 -0
  79. package/lib/cjs/constants/Session.js +12 -21
  80. package/lib/cjs/constants/Session.js.map +1 -0
  81. package/lib/{types → cjs}/constants/Theme.d.ts +0 -0
  82. package/lib/{types → cjs}/constants/Theme.d.ts.map +0 -0
  83. package/lib/cjs/constants/Theme.js +3 -4
  84. package/lib/cjs/constants/Theme.js.map +1 -0
  85. package/lib/cjs/constants/WebSocket.d.ts +4 -0
  86. package/lib/cjs/constants/WebSocket.d.ts.map +1 -0
  87. package/lib/cjs/constants/WebSocket.js +6 -9
  88. package/lib/cjs/constants/WebSocket.js.map +1 -0
  89. package/lib/{types → cjs}/hooks/useSCAuth.d.ts +0 -0
  90. package/lib/{types → cjs}/hooks/useSCAuth.d.ts.map +0 -0
  91. package/lib/cjs/hooks/useSCAuth.js +212 -282
  92. package/lib/cjs/hooks/useSCAuth.js.map +1 -0
  93. package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts +0 -0
  94. package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts.map +0 -0
  95. package/lib/cjs/hooks/useSCCachingManager.js +37 -51
  96. package/lib/cjs/hooks/useSCCachingManager.js.map +1 -0
  97. package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts +0 -0
  98. package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts.map +0 -0
  99. package/lib/cjs/hooks/useSCConnectionsManager.js +190 -254
  100. package/lib/cjs/hooks/useSCConnectionsManager.js.map +1 -0
  101. package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts +0 -0
  102. package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts.map +0 -0
  103. package/lib/cjs/hooks/useSCFetchAddressingTagList.js +64 -55
  104. package/lib/cjs/hooks/useSCFetchAddressingTagList.js.map +1 -0
  105. package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts +0 -0
  106. package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts.map +0 -0
  107. package/lib/cjs/hooks/useSCFetchCategories.js +46 -56
  108. package/lib/cjs/hooks/useSCFetchCategories.js.map +1 -0
  109. package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts +0 -0
  110. package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts.map +0 -0
  111. package/lib/cjs/hooks/useSCFetchCategory.js +44 -59
  112. package/lib/cjs/hooks/useSCFetchCategory.js.map +1 -0
  113. package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts +0 -0
  114. package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts.map +0 -0
  115. package/lib/cjs/hooks/useSCFetchCommentObject.js +44 -59
  116. package/lib/cjs/hooks/useSCFetchCommentObject.js.map +1 -0
  117. package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts +0 -0
  118. package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts.map +0 -0
  119. package/lib/cjs/hooks/useSCFetchCommentObjects.js +157 -254
  120. package/lib/cjs/hooks/useSCFetchCommentObjects.js.map +1 -0
  121. package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts +0 -0
  122. package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts.map +0 -0
  123. package/lib/cjs/hooks/useSCFetchCustomAdv.js +57 -75
  124. package/lib/cjs/hooks/useSCFetchCustomAdv.js.map +1 -0
  125. package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts +0 -0
  126. package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts.map +0 -0
  127. package/lib/cjs/hooks/useSCFetchFeedObject.js +49 -69
  128. package/lib/cjs/hooks/useSCFetchFeedObject.js.map +1 -0
  129. package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts +0 -0
  130. package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts.map +0 -0
  131. package/lib/cjs/hooks/useSCFetchIncubator.js +44 -59
  132. package/lib/cjs/hooks/useSCFetchIncubator.js.map +1 -0
  133. package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts +0 -0
  134. package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts.map +0 -0
  135. package/lib/cjs/hooks/useSCFetchTag.js +44 -59
  136. package/lib/cjs/hooks/useSCFetchTag.js.map +1 -0
  137. package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts +0 -0
  138. package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts.map +1 -1
  139. package/lib/cjs/hooks/useSCFetchUser.js +47 -59
  140. package/lib/cjs/hooks/useSCFetchUser.js.map +1 -0
  141. package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts +0 -0
  142. package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts.map +0 -0
  143. package/lib/cjs/hooks/useSCFollowedCategoriesManager.js +105 -147
  144. package/lib/cjs/hooks/useSCFollowedCategoriesManager.js.map +1 -0
  145. package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts +0 -0
  146. package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts.map +0 -0
  147. package/lib/cjs/hooks/useSCFollowersManager.js +154 -204
  148. package/lib/cjs/hooks/useSCFollowersManager.js.map +1 -0
  149. package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts +0 -0
  150. package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts.map +0 -0
  151. package/lib/cjs/hooks/useSCMediaClick.js +18 -25
  152. package/lib/cjs/hooks/useSCMediaClick.js.map +1 -0
  153. package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts +0 -0
  154. package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts.map +0 -0
  155. package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js +118 -148
  156. package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
  157. package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts +0 -0
  158. package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts.map +0 -0
  159. package/lib/cjs/hooks/useSCWebPushMessaging.js +268 -268
  160. package/lib/cjs/hooks/useSCWebPushMessaging.js.map +1 -0
  161. package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts +0 -0
  162. package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts.map +0 -0
  163. package/lib/cjs/hooks/useSCWebSocket.js +103 -125
  164. package/lib/cjs/hooks/useSCWebSocket.js.map +1 -0
  165. package/lib/{types → cjs}/index.d.ts +0 -0
  166. package/lib/{types → cjs}/index.d.ts.map +0 -0
  167. package/lib/cjs/index.js +131 -144
  168. package/lib/cjs/index.js.map +1 -0
  169. package/lib/cjs/themes/theme.d.ts +9 -0
  170. package/lib/cjs/themes/theme.d.ts.map +1 -0
  171. package/lib/cjs/themes/theme.js +132 -143
  172. package/lib/cjs/themes/theme.js.map +1 -0
  173. package/lib/{types → cjs}/types/context.d.ts +0 -0
  174. package/lib/{types → cjs}/types/context.d.ts.map +0 -0
  175. package/lib/cjs/types/context.js +2 -2
  176. package/lib/cjs/types/context.js.map +1 -0
  177. package/lib/{types → cjs}/types/index.d.ts +0 -0
  178. package/lib/{types → cjs}/types/index.d.ts.map +0 -0
  179. package/lib/cjs/types/index.js +2 -21
  180. package/lib/cjs/types/index.js.map +1 -0
  181. package/lib/{types → cjs}/utils/errors.d.ts +0 -0
  182. package/lib/{types → cjs}/utils/errors.d.ts.map +0 -0
  183. package/lib/cjs/utils/errors.js +138 -149
  184. package/lib/cjs/utils/errors.js.map +1 -0
  185. package/lib/{types → cjs}/utils/locale.d.ts +0 -0
  186. package/lib/{types → cjs}/utils/locale.d.ts.map +0 -0
  187. package/lib/cjs/utils/locale.js +32 -48
  188. package/lib/cjs/utils/locale.js.map +1 -0
  189. package/lib/{types → cjs}/utils/user.d.ts +0 -0
  190. package/lib/{types → cjs}/utils/user.d.ts.map +0 -0
  191. package/lib/cjs/utils/user.js +25 -40
  192. package/lib/cjs/utils/user.js.map +1 -0
  193. package/lib/{types → cjs}/utils/validator.d.ts +0 -0
  194. package/lib/{types → cjs}/utils/validator.d.ts.map +0 -0
  195. package/lib/cjs/utils/validator.js +386 -576
  196. package/lib/cjs/utils/validator.js.map +1 -0
  197. package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts +37 -0
  198. package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts.map +1 -0
  199. package/lib/esm/components/provider/SCAlertMessagesProvider/index.js +11 -37
  200. package/lib/esm/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
  201. package/lib/esm/components/provider/SCContextProvider/index.d.ts +35 -0
  202. package/lib/esm/components/provider/SCContextProvider/index.d.ts.map +1 -0
  203. package/lib/esm/components/provider/SCContextProvider/index.js +48 -83
  204. package/lib/esm/components/provider/SCContextProvider/index.js.map +1 -0
  205. package/lib/esm/components/provider/SCLocaleProvider/index.d.ts +42 -0
  206. package/lib/esm/components/provider/SCLocaleProvider/index.d.ts.map +1 -0
  207. package/lib/esm/components/provider/SCLocaleProvider/index.js +59 -123
  208. package/lib/esm/components/provider/SCLocaleProvider/index.js.map +1 -0
  209. package/lib/esm/components/provider/SCNotificationProvider/index.d.ts +37 -0
  210. package/lib/esm/components/provider/SCNotificationProvider/index.d.ts.map +1 -0
  211. package/lib/esm/components/provider/SCNotificationProvider/index.js +12 -43
  212. package/lib/esm/components/provider/SCNotificationProvider/index.js.map +1 -0
  213. package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts +38 -0
  214. package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts.map +1 -0
  215. package/lib/esm/components/provider/SCPreferencesProvider/index.js +35 -64
  216. package/lib/esm/components/provider/SCPreferencesProvider/index.js.map +1 -0
  217. package/lib/esm/components/provider/SCRoutingProvider/index.d.ts +39 -0
  218. package/lib/esm/components/provider/SCRoutingProvider/index.d.ts.map +1 -0
  219. package/lib/esm/components/provider/SCRoutingProvider/index.js +78 -113
  220. package/lib/esm/components/provider/SCRoutingProvider/index.js.map +1 -0
  221. package/lib/esm/components/provider/SCThemeProvider/index.d.ts +49 -0
  222. package/lib/esm/components/provider/SCThemeProvider/index.d.ts.map +1 -0
  223. package/lib/esm/components/provider/SCThemeProvider/index.js +36 -81
  224. package/lib/esm/components/provider/SCThemeProvider/index.js.map +1 -0
  225. package/lib/esm/components/provider/SCUserProvider/index.d.ts +38 -0
  226. package/lib/esm/components/provider/SCUserProvider/index.d.ts.map +1 -0
  227. package/lib/esm/components/provider/SCUserProvider/index.js +186 -272
  228. package/lib/esm/components/provider/SCUserProvider/index.js.map +1 -0
  229. package/lib/esm/components/router/index.d.ts +34 -0
  230. package/lib/esm/components/router/index.d.ts.map +1 -0
  231. package/lib/esm/components/router/index.js +24 -50
  232. package/lib/esm/components/router/index.js.map +1 -0
  233. package/lib/esm/constants/Actions.d.ts +2 -0
  234. package/lib/esm/constants/Actions.d.ts.map +1 -0
  235. package/lib/esm/constants/Actions.js +2 -6
  236. package/lib/esm/constants/Actions.js.map +1 -0
  237. package/lib/esm/constants/ContextProviders.d.ts +6 -0
  238. package/lib/esm/constants/ContextProviders.d.ts.map +1 -0
  239. package/lib/esm/constants/ContextProviders.js +18 -26
  240. package/lib/esm/constants/ContextProviders.js.map +1 -0
  241. package/lib/esm/constants/Device.d.ts +6 -0
  242. package/lib/esm/constants/Device.d.ts.map +1 -0
  243. package/lib/esm/constants/Device.js +2 -7
  244. package/lib/esm/constants/Device.js.map +1 -0
  245. package/lib/esm/constants/Errors.d.ts +5 -0
  246. package/lib/esm/constants/Errors.d.ts.map +1 -0
  247. package/lib/esm/constants/Errors.js +2 -7
  248. package/lib/esm/constants/Errors.js.map +1 -0
  249. package/lib/esm/constants/Features.d.ts +41 -0
  250. package/lib/esm/constants/Features.d.ts.map +1 -0
  251. package/lib/esm/constants/Features.js +41 -84
  252. package/lib/esm/constants/Features.js.map +1 -0
  253. package/lib/esm/constants/Locale.d.ts +8 -0
  254. package/lib/esm/constants/Locale.d.ts.map +1 -0
  255. package/lib/esm/constants/Locale.js +8 -18
  256. package/lib/esm/constants/Locale.js.map +1 -0
  257. package/lib/esm/constants/Notification.d.ts +55 -0
  258. package/lib/esm/constants/Notification.d.ts.map +1 -0
  259. package/lib/esm/constants/Notification.js +42 -54
  260. package/lib/esm/constants/Notification.js.map +1 -0
  261. package/lib/esm/constants/Notifications.d.ts +11 -0
  262. package/lib/esm/constants/Notifications.d.ts.map +1 -0
  263. package/lib/esm/constants/Notifications.js +9 -26
  264. package/lib/esm/constants/Notifications.js.map +1 -0
  265. package/lib/esm/constants/Preferences.d.ts +201 -0
  266. package/lib/esm/constants/Preferences.d.ts.map +1 -0
  267. package/lib/esm/constants/Preferences.js +181 -296
  268. package/lib/esm/constants/Preferences.js.map +1 -0
  269. package/lib/esm/constants/Routes.d.ts +29 -0
  270. package/lib/esm/constants/Routes.d.ts.map +1 -0
  271. package/lib/esm/constants/Routes.js +36 -60
  272. package/lib/esm/constants/Routes.js.map +1 -0
  273. package/lib/esm/constants/Session.d.ts +10 -0
  274. package/lib/esm/constants/Session.d.ts.map +1 -0
  275. package/lib/esm/constants/Session.js +10 -22
  276. package/lib/esm/constants/Session.js.map +1 -0
  277. package/lib/esm/constants/Theme.d.ts +2 -0
  278. package/lib/esm/constants/Theme.d.ts.map +1 -0
  279. package/lib/esm/constants/Theme.js +2 -6
  280. package/lib/esm/constants/Theme.js.map +1 -0
  281. package/lib/esm/constants/WebSocket.d.ts +4 -0
  282. package/lib/esm/constants/WebSocket.d.ts.map +1 -0
  283. package/lib/esm/constants/WebSocket.js +4 -10
  284. package/lib/esm/constants/WebSocket.js.map +1 -0
  285. package/lib/esm/hooks/useSCAuth.d.ts +56 -0
  286. package/lib/esm/hooks/useSCAuth.d.ts.map +1 -0
  287. package/lib/esm/hooks/useSCAuth.js +185 -285
  288. package/lib/esm/hooks/useSCAuth.js.map +1 -0
  289. package/lib/esm/hooks/useSCCachingManager.d.ts +19 -0
  290. package/lib/esm/hooks/useSCCachingManager.d.ts.map +1 -0
  291. package/lib/esm/hooks/useSCCachingManager.js +36 -53
  292. package/lib/esm/hooks/useSCCachingManager.js.map +1 -0
  293. package/lib/esm/hooks/useSCConnectionsManager.d.ts +40 -0
  294. package/lib/esm/hooks/useSCConnectionsManager.d.ts.map +1 -0
  295. package/lib/esm/hooks/useSCConnectionsManager.js +186 -256
  296. package/lib/esm/hooks/useSCConnectionsManager.js.map +1 -0
  297. package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts +14 -0
  298. package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts.map +1 -0
  299. package/lib/esm/hooks/useSCFetchAddressingTagList.js +39 -56
  300. package/lib/esm/hooks/useSCFetchAddressingTagList.js.map +1 -0
  301. package/lib/esm/hooks/useSCFetchCategories.d.ts +17 -0
  302. package/lib/esm/hooks/useSCFetchCategories.d.ts.map +1 -0
  303. package/lib/esm/hooks/useSCFetchCategories.js +45 -57
  304. package/lib/esm/hooks/useSCFetchCategories.js.map +1 -0
  305. package/lib/esm/hooks/useSCFetchCategory.d.ts +19 -0
  306. package/lib/esm/hooks/useSCFetchCategory.d.ts.map +1 -0
  307. package/lib/esm/hooks/useSCFetchCategory.js +42 -60
  308. package/lib/esm/hooks/useSCFetchCategory.js.map +1 -0
  309. package/lib/esm/hooks/useSCFetchCommentObject.d.ts +19 -0
  310. package/lib/esm/hooks/useSCFetchCommentObject.d.ts.map +1 -0
  311. package/lib/esm/hooks/useSCFetchCommentObject.js +42 -60
  312. package/lib/esm/hooks/useSCFetchCommentObject.js.map +1 -0
  313. package/lib/esm/hooks/useSCFetchCommentObjects.d.ts +53 -0
  314. package/lib/esm/hooks/useSCFetchCommentObjects.d.ts.map +1 -0
  315. package/lib/esm/hooks/useSCFetchCommentObjects.js +153 -257
  316. package/lib/esm/hooks/useSCFetchCommentObjects.js.map +1 -0
  317. package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +19 -0
  318. package/lib/esm/hooks/useSCFetchCustomAdv.d.ts.map +1 -0
  319. package/lib/esm/hooks/useSCFetchCustomAdv.js +55 -76
  320. package/lib/esm/hooks/useSCFetchCustomAdv.js.map +1 -0
  321. package/lib/esm/hooks/useSCFetchFeedObject.d.ts +21 -0
  322. package/lib/esm/hooks/useSCFetchFeedObject.d.ts.map +1 -0
  323. package/lib/esm/hooks/useSCFetchFeedObject.js +47 -70
  324. package/lib/esm/hooks/useSCFetchFeedObject.js.map +1 -0
  325. package/lib/esm/hooks/useSCFetchIncubator.d.ts +19 -0
  326. package/lib/esm/hooks/useSCFetchIncubator.d.ts.map +1 -0
  327. package/lib/esm/hooks/useSCFetchIncubator.js +42 -60
  328. package/lib/esm/hooks/useSCFetchIncubator.js.map +1 -0
  329. package/lib/esm/hooks/useSCFetchTag.d.ts +19 -0
  330. package/lib/esm/hooks/useSCFetchTag.d.ts.map +1 -0
  331. package/lib/esm/hooks/useSCFetchTag.js +42 -60
  332. package/lib/esm/hooks/useSCFetchTag.js.map +1 -0
  333. package/lib/esm/hooks/useSCFetchUser.d.ts +19 -0
  334. package/lib/esm/hooks/useSCFetchUser.d.ts.map +1 -0
  335. package/lib/esm/hooks/useSCFetchUser.js +45 -60
  336. package/lib/esm/hooks/useSCFetchUser.js.map +1 -0
  337. package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts +37 -0
  338. package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts.map +1 -0
  339. package/lib/esm/hooks/useSCFollowedCategoriesManager.js +101 -149
  340. package/lib/esm/hooks/useSCFollowedCategoriesManager.js.map +1 -0
  341. package/lib/esm/hooks/useSCFollowersManager.d.ts +37 -0
  342. package/lib/esm/hooks/useSCFollowersManager.d.ts.map +1 -0
  343. package/lib/esm/hooks/useSCFollowersManager.js +150 -206
  344. package/lib/esm/hooks/useSCFollowersManager.js.map +1 -0
  345. package/lib/esm/hooks/useSCMediaClick.d.ts +4 -0
  346. package/lib/esm/hooks/useSCMediaClick.d.ts.map +1 -0
  347. package/lib/esm/hooks/useSCMediaClick.js +17 -27
  348. package/lib/esm/hooks/useSCMediaClick.js.map +1 -0
  349. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts +27 -0
  350. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts.map +1 -0
  351. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js +114 -150
  352. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
  353. package/lib/esm/hooks/useSCWebPushMessaging.d.ts +9 -0
  354. package/lib/esm/hooks/useSCWebPushMessaging.d.ts.map +1 -0
  355. package/lib/esm/hooks/useSCWebPushMessaging.js +244 -270
  356. package/lib/esm/hooks/useSCWebPushMessaging.js.map +1 -0
  357. package/lib/esm/hooks/useSCWebSocket.d.ts +12 -0
  358. package/lib/esm/hooks/useSCWebSocket.d.ts.map +1 -0
  359. package/lib/esm/hooks/useSCWebSocket.js +99 -127
  360. package/lib/esm/hooks/useSCWebSocket.js.map +1 -0
  361. package/lib/esm/index.d.ts +73 -0
  362. package/lib/esm/index.d.ts.map +1 -0
  363. package/lib/esm/index.js +69 -151
  364. package/lib/esm/index.js.map +1 -0
  365. package/lib/esm/themes/theme.d.ts +9 -0
  366. package/lib/esm/themes/theme.d.ts.map +1 -0
  367. package/lib/esm/themes/theme.js +128 -144
  368. package/lib/esm/themes/theme.js.map +1 -0
  369. package/lib/esm/types/context.d.ts +428 -0
  370. package/lib/esm/types/context.d.ts.map +1 -0
  371. package/lib/esm/types/context.js +2 -3
  372. package/lib/esm/types/context.js.map +1 -0
  373. package/lib/esm/types/index.d.ts +3 -0
  374. package/lib/esm/types/index.d.ts.map +1 -0
  375. package/lib/esm/types/index.js +2 -22
  376. package/lib/esm/types/index.js.map +1 -0
  377. package/lib/esm/utils/errors.d.ts +98 -0
  378. package/lib/esm/utils/errors.d.ts.map +1 -0
  379. package/lib/esm/utils/errors.js +114 -155
  380. package/lib/esm/utils/errors.js.map +1 -0
  381. package/lib/esm/utils/locale.d.ts +10 -0
  382. package/lib/esm/utils/locale.d.ts.map +1 -0
  383. package/lib/esm/utils/locale.js +27 -50
  384. package/lib/esm/utils/locale.js.map +1 -0
  385. package/lib/esm/utils/user.d.ts +41 -0
  386. package/lib/esm/utils/user.d.ts.map +1 -0
  387. package/lib/esm/utils/user.js +23 -46
  388. package/lib/esm/utils/user.js.map +1 -0
  389. package/lib/esm/utils/validator.d.ts +239 -0
  390. package/lib/esm/utils/validator.d.ts.map +1 -0
  391. package/lib/esm/utils/validator.js +352 -588
  392. package/lib/esm/utils/validator.js.map +1 -0
  393. package/lib/umd/react-core.js +1 -1
  394. package/package.json +9 -11
  395. package/lib/types/tsconfig.build.tsbuildinfo +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/provider/SCNotificationProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAC,yBAAyB,EAAC,MAAM,gBAAgB,CAAC;AAIzD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,0CAA4E,CAAC;AAE/G;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAC,QAAe,EAAC,EAAE;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,GAAG,CAAC,OAAO,CAK1G;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,yBAAyB,CAE7D"}
@@ -1,22 +1,6 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.SCNotificationContext = void 0;
5
- exports.default = SCNotificationProvider;
6
- exports.useSCNotification = useSCNotification;
7
-
8
- var _react = _interopRequireWildcard(require("react"));
9
-
10
- var _useSCWebSocket = _interopRequireDefault(require("../../../hooks/useSCWebSocket"));
11
-
12
- var _useSCWebPushMessaging = _interopRequireDefault(require("../../../hooks/useSCWebPushMessaging"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
1
+ import React, { createContext, useContext } from 'react';
2
+ import useSCWebSocket from '../../../hooks/useSCWebSocket';
3
+ import useSCWebPushMessaging from '../../../hooks/useSCWebPushMessaging';
20
4
  /**
21
5
  * Creates Global Context
22
6
  *
@@ -33,7 +17,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
33
17
  ````
34
18
  :::
35
19
  */
36
- const SCNotificationContext = /*#__PURE__*/(0, _react.createContext)({});
20
+ export const SCNotificationContext = createContext({});
37
21
  /**
38
22
  * #### Description:
39
23
  * This component makes the notification context available down the React tree.
@@ -43,31 +27,16 @@ const SCNotificationContext = /*#__PURE__*/(0, _react.createContext)({});
43
27
  * <SCNotificationContext.Provider value={{wsInstance}}>{children}</SCNotificationContext.Provider>
44
28
  * ```
45
29
  */
46
-
47
- exports.SCNotificationContext = SCNotificationContext;
48
-
49
- function SCNotificationProvider({
50
- children = null
51
- }) {
52
- const {
53
- wsInstance
54
- } = (0, _useSCWebSocket.default)();
55
- const {
56
- wpSubscription
57
- } = (0, _useSCWebPushMessaging.default)();
58
- return /*#__PURE__*/_react.default.createElement(SCNotificationContext.Provider, {
59
- value: {
60
- wsInstance,
61
- wpSubscription
62
- }
63
- }, children);
30
+ export default function SCNotificationProvider({ children = null }) {
31
+ const { wsInstance } = useSCWebSocket();
32
+ const { wpSubscription } = useSCWebPushMessaging();
33
+ return React.createElement(SCNotificationContext.Provider, { value: { wsInstance, wpSubscription } }, children);
64
34
  }
65
35
  /**
66
36
  * Let's only export the `useSCNotification` hook instead of the context.
67
37
  * We only want to use the hook directly and never the context component.
68
38
  */
69
-
70
-
71
- function useSCNotification() {
72
- return (0, _react.useContext)(SCNotificationContext);
73
- }
39
+ export function useSCNotification() {
40
+ return useContext(SCNotificationContext);
41
+ }
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/provider/SCNotificationProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AAEvD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAA4B,EAA+B,CAAC,CAAC;AAE/G;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAC,QAAQ,GAAG,IAAI,EAA8B;IAC3F,MAAM,EAAC,UAAU,EAAC,GAAG,cAAc,EAAE,CAAC;IACtC,MAAM,EAAC,cAAc,EAAC,GAAG,qBAAqB,EAAE,CAAC;IAEjD,OAAO,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,UAAU,EAAE,cAAc,EAAC,IAAG,QAAQ,CAAkC,CAAC;AAC1H,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { SCPreferencesContextType } from '../../../types/context';
3
+ /**
4
+ * Creates Preferences/Features Context
5
+ *
6
+ :::tipContext can be consumed in one of the following ways:
7
+
8
+
9
+ ```jsx
10
+ 1. <SCPreferencesContext.Consumer>{(preferences) => (...)}</SCPreferencesContext.Consumer>
11
+ ```
12
+ ```jsx
13
+ 2. const scPreferences: SCPreferencesType = usePreferencesContext(SCPreferencesContext);
14
+ ```
15
+ ```jsx
16
+ 3. const scPreferences: SCPreferencesType = useSCPreferences();
17
+ ````
18
+ :::
19
+ */
20
+ export declare const SCPreferencesContext: React.Context<SCPreferencesContextType>;
21
+ /**
22
+ * #### Description:
23
+ * This component imports all preferences and features enabled.
24
+ * @param children
25
+ * @return
26
+ * ```jsx
27
+ * <SCPreferencesContext.Provider value={{preferences, features}}>{!loading && children}</SCPreferencesContext.Provider>
28
+ * ```
29
+ */
30
+ export default function SCPreferencesProvider({ children }: {
31
+ children: React.ReactNode;
32
+ }): JSX.Element;
33
+ /**
34
+ * Let's only export the `useSCPreferences` hook instead of the context.
35
+ * We only want to use the hook directly and never the context component.
36
+ */
37
+ export declare function useSCPreferences(): SCPreferencesContextType;
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/provider/SCPreferencesProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAC,wBAAwB,EAAC,MAAM,wBAAwB,CAAC;AAIhE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,yCAA0E,CAAC;AAE5G;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAC,QAAe,EAAC,EAAE;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,GAAG,CAAC,OAAO,CA4BzG;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,wBAAwB,CAE3D"}
@@ -1,22 +1,7 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.SCPreferencesContext = void 0;
5
- exports.default = SCPreferencesProvider;
6
- exports.useSCPreferences = useSCPreferences;
7
-
8
- var _react = _interopRequireWildcard(require("react"));
9
-
10
- var _apiServices = require("@selfcommunity/api-services");
11
-
12
- var _utils = require("@selfcommunity/utils");
13
-
14
- var _Errors = require("../../../constants/Errors");
15
-
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
1
+ import React, { createContext, useContext, useEffect, useState } from 'react';
2
+ import { FeatureService, PreferenceService } from '@selfcommunity/api-services';
3
+ import { Logger } from '@selfcommunity/utils';
4
+ import { SCOPE_SC_CORE } from '../../../constants/Errors';
20
5
  /**
21
6
  * Creates Preferences/Features Context
22
7
  *
@@ -34,7 +19,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
34
19
  ````
35
20
  :::
36
21
  */
37
- const SCPreferencesContext = /*#__PURE__*/(0, _react.createContext)({});
22
+ export const SCPreferencesContext = createContext({});
38
23
  /**
39
24
  * #### Description:
40
25
  * This component imports all preferences and features enabled.
@@ -44,52 +29,38 @@ const SCPreferencesContext = /*#__PURE__*/(0, _react.createContext)({});
44
29
  * <SCPreferencesContext.Provider value={{preferences, features}}>{!loading && children}</SCPreferencesContext.Provider>
45
30
  * ```
46
31
  */
47
-
48
- exports.SCPreferencesContext = SCPreferencesContext;
49
-
50
- function SCPreferencesProvider({
51
- children = null
52
- }) {
53
- const [preferences, setPreferences] = (0, _react.useState)({});
54
- const [features, setFeatures] = (0, _react.useState)([]);
55
- const [, setError] = (0, _react.useState)();
56
- const [loading, setLoading] = (0, _react.useState)(true);
57
- /**
58
- * Load all dynamic preferences and features enabled
59
- * to manages configurations of the project
60
- */
61
-
62
- (0, _react.useEffect)(() => {
63
- Promise.all([_apiServices.PreferenceService.getAllPreferences(), _apiServices.FeatureService.getAllFeatures()]).then(function ([preferences, features]) {
64
- setPreferences(preferences['results'].reduce((obj, p) => Object.assign({}, obj, {
65
- [`${p.section}.${p.name}`]: p
66
- }), {}));
67
- setFeatures(features['results'].map(f => f.name));
68
- setLoading(false);
69
- }).catch(_error => {
70
- _utils.Logger.error(_Errors.SCOPE_SC_CORE, _error);
71
-
72
- setError(_error);
73
- });
74
- }, []);
75
- /**
76
- * Nesting all necessary providers
77
- * All child components will use help contexts to works
78
- */
79
-
80
- return /*#__PURE__*/_react.default.createElement(SCPreferencesContext.Provider, {
81
- value: {
82
- preferences,
83
- features
84
- }
85
- }, !loading && children);
32
+ export default function SCPreferencesProvider({ children = null }) {
33
+ const [preferences, setPreferences] = useState({});
34
+ const [features, setFeatures] = useState([]);
35
+ const [, setError] = useState();
36
+ const [loading, setLoading] = useState(true);
37
+ /**
38
+ * Load all dynamic preferences and features enabled
39
+ * to manages configurations of the project
40
+ */
41
+ useEffect(() => {
42
+ Promise.all([PreferenceService.getAllPreferences(), FeatureService.getAllFeatures()])
43
+ .then(function ([preferences, features]) {
44
+ setPreferences(preferences['results'].reduce((obj, p) => (Object.assign(Object.assign({}, obj), { [`${p.section}.${p.name}`]: p })), {}));
45
+ setFeatures(features['results'].map((f) => f.name));
46
+ setLoading(false);
47
+ })
48
+ .catch((_error) => {
49
+ Logger.error(SCOPE_SC_CORE, _error);
50
+ setError(_error);
51
+ });
52
+ }, []);
53
+ /**
54
+ * Nesting all necessary providers
55
+ * All child components will use help contexts to works
56
+ */
57
+ return React.createElement(SCPreferencesContext.Provider, { value: { preferences, features } }, !loading && children);
86
58
  }
87
59
  /**
88
60
  * Let's only export the `useSCPreferences` hook instead of the context.
89
61
  * We only want to use the hook directly and never the context component.
90
62
  */
91
-
92
-
93
- function useSCPreferences() {
94
- return (0, _react.useContext)(SCPreferencesContext);
95
- }
63
+ export function useSCPreferences() {
64
+ return useContext(SCPreferencesContext);
65
+ }
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/provider/SCPreferencesProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA2B,EAA8B,CAAC,CAAC;AAE5G;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAC,QAAQ,GAAG,IAAI,EAA8B;IAC1F,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAsB,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IACvD,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAO,CAAC;IACrC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAC;IAEtD;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,EAAE,cAAc,CAAC,cAAc,EAAE,CAAC,CAAC;aAClF,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC;YACrC,cAAc,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iCAAK,GAAG,KAAE,CAAC,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,IAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YACzG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACpD,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;YAChB,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YACpC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP;;;OAGG;IACH,OAAO,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,WAAW,EAAE,QAAQ,EAAC,IAAG,CAAC,OAAO,IAAI,QAAQ,CAAiC,CAAC;AAC/H,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { SCRoutingContextType } from '../../../types';
3
+ /**
4
+ * Creates Global Context
5
+ *
6
+ :::tipContext can be consumed in one of the following ways:
7
+
8
+
9
+ ```jsx
10
+ 1. <SCRoutingContext.Consumer>{(routerLink, routes, url) => (...)}</SCRoutingContext.Consumer>
11
+ ```
12
+ ```jsx
13
+ 2. const scRoutingContext: SCRoutingContextType = useContext(SCRoutingContext);
14
+ ```
15
+ ```jsx
16
+ 3. const scRoutingContext: SCRoutingContextType = useSCRouting();
17
+ ````
18
+
19
+ :::
20
+ */
21
+ export declare const SCRoutingContext: React.Context<SCRoutingContextType>;
22
+ /**
23
+ * #### Description:
24
+ * This component provides routing context.
25
+ * @param children
26
+ * @return
27
+ * ```jsx
28
+ * <SCRoutingContext.Provider value={contextValue}>{children}</SCRoutingContext.Provider>
29
+ * ```
30
+ */
31
+ export default function SCRoutingProvider({ children }: {
32
+ children: React.ReactNode;
33
+ }): JSX.Element;
34
+ /**
35
+ * Let's only export the `useSCTheme` hook instead of the context.
36
+ * We only want to use the hook directly and never the context component.
37
+ */
38
+ export declare function useSCRouting(): SCRoutingContextType;
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/provider/SCRoutingProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAA0C,oBAAoB,EAAoB,MAAM,gBAAgB,CAAC;AAoBhH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,qCAAkE,CAAC;AAEhG;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAC,QAAe,EAAC,EAAE;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,GAAG,CAAC,OAAO,CAmFrG;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,oBAAoB,CAEnD"}
@@ -1,24 +1,8 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.SCRoutingContext = void 0;
5
- exports.default = SCRoutingProvider;
6
- exports.useSCRouting = useSCRouting;
7
-
8
- var _react = _interopRequireWildcard(require("react"));
9
-
10
- var _SCContextProvider = require("../SCContextProvider");
11
-
12
- var _SCPreferencesProvider = require("../SCPreferencesProvider");
13
-
14
- var SCPreferences = _interopRequireWildcard(require("../../../constants/Preferences"));
15
-
16
- var _Routes = require("../../../constants/Routes");
17
-
18
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
-
20
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
-
1
+ import React, { createContext, useContext, useMemo } from 'react';
2
+ import { useSCContext } from '../SCContextProvider';
3
+ import { SCPreferencesContext } from '../SCPreferencesProvider';
4
+ import * as SCPreferences from '../../../constants/Preferences';
5
+ import { CATEGORIES_LIST_ROUTE_NAME, CATEGORY_ROUTE_NAME, COMMENT_ROUTE_NAME, DISCUSSION_ROUTE_NAME, INCUBATOR_ROUTE_NAME, POST_ROUTE_NAME, STATUS_ROUTE_NAME, USER_NOTIFICATIONS_ROUTE_NAME, USER_PRIVATE_MESSAGES_ROUTE_NAME, USER_PROFILE_ROUTE_NAME, USER_PROFILE_SETTINGS_ROUTE_NAME, defaultRoutes, } from '../../../constants/Routes';
22
6
  /**
23
7
  * Creates Global Context
24
8
  *
@@ -37,7 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
37
21
 
38
22
  :::
39
23
  */
40
- const SCRoutingContext = /*#__PURE__*/(0, _react.createContext)({});
24
+ export const SCRoutingContext = createContext({});
41
25
  /**
42
26
  * #### Description:
43
27
  * This component provides routing context.
@@ -47,100 +31,81 @@ const SCRoutingContext = /*#__PURE__*/(0, _react.createContext)({});
47
31
  * <SCRoutingContext.Provider value={contextValue}>{children}</SCRoutingContext.Provider>
48
32
  * ```
49
33
  */
50
-
51
- exports.SCRoutingContext = SCRoutingContext;
52
-
53
- function SCRoutingProvider({
54
- children = null
55
- }) {
56
- const scPreferencesContext = (0, _react.useContext)(_SCPreferencesProvider.SCPreferencesContext);
57
- const scContext = (0, _SCContextProvider.useSCContext)();
58
- const router = scContext.settings.router ? scContext.settings.router : {};
59
- const routerLink = router.routerLink ? router.routerLink : null;
60
-
61
- const _routes = Object.assign(getPreferencesRoutes(), _Routes.defaultRoutes);
62
-
63
- const routes = router.routes ? Object.assign({}, _routes, router.routes) : _Routes.defaultRoutes;
64
- /**
65
- * Normalize template url (preferences)
66
- */
67
-
68
- function normalizeUrl(url) {
69
- let tpl = url;
70
- const re = /\{([^/]+)?\}/g;
71
- let match = re.exec(url);
72
-
73
- while (match) {
74
- tpl = tpl.replace(match[0], `:${match[1]}`);
75
- re.lastIndex = 0;
76
- match = re.exec(tpl);
34
+ export default function SCRoutingProvider({ children = null }) {
35
+ const scPreferencesContext = useContext(SCPreferencesContext);
36
+ const scContext = useSCContext();
37
+ const router = scContext.settings.router ? scContext.settings.router : {};
38
+ const routerLink = router.routerLink ? router.routerLink : null;
39
+ const _routes = Object.assign(getPreferencesRoutes(), defaultRoutes);
40
+ const routes = router.routes ? Object.assign(Object.assign({}, _routes), router.routes) : defaultRoutes;
41
+ /**
42
+ * Normalize template url (preferences)
43
+ */
44
+ function normalizeUrl(url) {
45
+ let tpl = url;
46
+ const re = /\{([^/]+)?\}/g;
47
+ let match = re.exec(url);
48
+ while (match) {
49
+ tpl = tpl.replace(match[0], `:${match[1]}`);
50
+ re.lastIndex = 0;
51
+ match = re.exec(tpl);
52
+ }
53
+ return tpl;
77
54
  }
78
-
79
- return tpl;
80
- }
81
- /**
82
- * Get override routes from community preferences
83
- */
84
-
85
-
86
- function getPreferencesRoutes() {
87
- return {
88
- [_Routes.POST_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_POST].value),
89
- [_Routes.DISCUSSION_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_DISCUSSION].value),
90
- [_Routes.STATUS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_STATUS].value),
91
- [_Routes.COMMENT_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_COMMENT].value),
92
- [_Routes.CATEGORY_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_CATEGORY].value),
93
- [_Routes.CATEGORIES_LIST_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_CATEGORIES_LIST].value),
94
- [_Routes.USER_PROFILE_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE].value),
95
- [_Routes.USER_PROFILE_SETTINGS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS].value),
96
- [_Routes.USER_NOTIFICATIONS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_NOTIFICATIONS].value),
97
- [_Routes.USER_PRIVATE_MESSAGES_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES].value),
98
- [_Routes.INCUBATOR_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR].value)
99
- };
100
- }
101
- /**
102
- * Generate path
103
- */
104
-
105
-
106
- function url(name = '', params = {}) {
107
- const replacer = (tpl, data) => {
108
- const re = /:([^/|^?|^#]+)?/g;
109
- let _tpl = tpl;
110
- let match = re.exec(tpl);
111
-
112
- while (match) {
113
- _tpl = _tpl.replace(match[0], data[match[1]]);
114
- re.lastIndex = 0;
115
- match = re.exec(_tpl);
116
- }
117
-
118
- if (router.handleRoute) {
119
- // Handle override url
120
- return router.handleRoute(name, _tpl, params, tpl);
121
- }
122
-
123
- return _tpl;
124
- };
125
-
126
- return replacer(routes[name], params);
127
- }
128
-
129
- const contextValue = (0, _react.useMemo)(() => ({
130
- routerLink,
131
- routes,
132
- url
133
- }), [routerLink, routes]);
134
- return /*#__PURE__*/_react.default.createElement(SCRoutingContext.Provider, {
135
- value: contextValue
136
- }, children);
55
+ /**
56
+ * Get override routes from community preferences
57
+ */
58
+ function getPreferencesRoutes() {
59
+ if (Object.keys(scPreferencesContext.preferences).length) {
60
+ return {
61
+ [POST_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_POST].value),
62
+ [DISCUSSION_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_DISCUSSION].value),
63
+ [STATUS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_STATUS].value),
64
+ [COMMENT_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_COMMENT].value),
65
+ [CATEGORY_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_CATEGORY].value),
66
+ [CATEGORIES_LIST_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_CATEGORIES_LIST].value),
67
+ [USER_PROFILE_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE].value),
68
+ [USER_PROFILE_SETTINGS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS].value),
69
+ [USER_NOTIFICATIONS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_NOTIFICATIONS].value),
70
+ [USER_PRIVATE_MESSAGES_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES].value),
71
+ [INCUBATOR_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR].value),
72
+ };
73
+ }
74
+ return {};
75
+ }
76
+ /**
77
+ * Generate path
78
+ */
79
+ function url(name = '', params = {}) {
80
+ const replacer = (tpl, data) => {
81
+ const re = /:([^/|^?|^#]+)?/g;
82
+ let _tpl = tpl;
83
+ let match = re.exec(tpl);
84
+ while (match) {
85
+ _tpl = _tpl.replace(match[0], data[match[1]]);
86
+ re.lastIndex = 0;
87
+ match = re.exec(_tpl);
88
+ }
89
+ if (router.handleRoute) {
90
+ // Handle override url
91
+ return router.handleRoute(name, _tpl, params, tpl);
92
+ }
93
+ return _tpl;
94
+ };
95
+ return replacer(routes[name], params);
96
+ }
97
+ const contextValue = useMemo(() => ({
98
+ routerLink,
99
+ routes,
100
+ url,
101
+ }), [routerLink, routes]);
102
+ return React.createElement(SCRoutingContext.Provider, { value: contextValue }, children);
137
103
  }
138
104
  /**
139
105
  * Let's only export the `useSCTheme` hook instead of the context.
140
106
  * We only want to use the hook directly and never the context component.
141
107
  */
142
-
143
-
144
- function useSCRouting() {
145
- return (0, _react.useContext)(SCRoutingContext);
146
- }
108
+ export function useSCRouting() {
109
+ return useContext(SCRoutingContext);
110
+ }
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/provider/SCRoutingProvider/index.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { SCThemeContextType } from '../../../types';
3
+ /**
4
+ * Creates Global Context
5
+ *
6
+ :::tipContext can be consumed in one of the following ways:
7
+
8
+ ```jsx
9
+ 1. <SCThemeContext.Consumer>{(theme,) => (...)}</SCThemeContext.Consumer>
10
+ ```
11
+ ```jsx
12
+ 2. const scThemeContext: SCThemeContextType = useContext(SCThemeContext);
13
+ ```
14
+ ```jsx
15
+ 3. const scThemeContext: SCThemeContextType = useSCTheme();
16
+ ````
17
+
18
+ :::
19
+
20
+ */
21
+ export declare const SCThemeContext: React.Context<SCThemeContextType>;
22
+ /**
23
+ * #### Description:
24
+ * This component makes the `theme` available down the React tree.
25
+ * It should preferably be used at **the root of your component tree**.
26
+ * See: https://mui.com/system/styled/
27
+ *
28
+ * @param children
29
+ * @return
30
+ * ```jsx
31
+ * <SCThemeContext.Provider value={{theme, setTheme: setCustomTheme}}>
32
+ * <ThemeProvider theme={theme}>{children}</ThemeProvider>
33
+ * </SCThemeContext.Provider>
34
+ * ```
35
+ */
36
+ export default function SCThemeProvider({ children }: {
37
+ children: React.ReactNode;
38
+ }): JSX.Element;
39
+ /**
40
+ * Export hoc to inject the base theme to components
41
+ * @param Component
42
+ */
43
+ export declare const withSCTheme: (Component: any) => (props: any) => JSX.Element;
44
+ /**
45
+ * Let's only export the `useSCTheme` hook instead of the context.
46
+ * We only want to use the hook directly and never the context component.
47
+ */
48
+ export declare function useSCTheme(): SCThemeContextType;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/provider/SCThemeProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAKlD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,mCAA8D,CAAC;AAE1F;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAC,QAAe,EAAC,EAAE;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,GAAG,CAAC,OAAO,CA4BnG;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,iDAOvB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,IAAI,kBAAkB,CAE/C"}