piral-core 1.0.0-pre.2217 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (672) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +4 -4
  3. package/app.codegen +36 -0
  4. package/app.codegen.d.ts +29 -0
  5. package/dist/codegen.js +5308 -0
  6. package/esm/Piral.d.ts +4 -4
  7. package/esm/Piral.js +8 -11
  8. package/esm/Piral.js.map +1 -1
  9. package/esm/PiralContext.d.ts +21 -0
  10. package/esm/PiralContext.js +34 -0
  11. package/esm/PiralContext.js.map +1 -0
  12. package/esm/RootListener.d.ts +2 -0
  13. package/esm/RootListener.js +23 -0
  14. package/esm/RootListener.js.map +1 -0
  15. package/esm/actions/app.d.ts +7 -4
  16. package/esm/actions/app.js +24 -14
  17. package/esm/actions/app.js.map +1 -1
  18. package/esm/actions/components.js +5 -6
  19. package/esm/actions/components.js.map +1 -1
  20. package/esm/actions/data.js +16 -17
  21. package/esm/actions/data.js.map +1 -1
  22. package/esm/actions/define.js +2 -3
  23. package/esm/actions/define.js.map +1 -1
  24. package/esm/actions/portal.d.ts +2 -0
  25. package/esm/actions/portal.js +9 -4
  26. package/esm/actions/portal.js.map +1 -1
  27. package/esm/actions/state.js +7 -4
  28. package/esm/actions/state.js.map +1 -1
  29. package/esm/components/ErrorBoundary.d.ts +14 -31
  30. package/esm/components/ErrorBoundary.js +22 -28
  31. package/esm/components/ErrorBoundary.js.map +1 -1
  32. package/esm/components/ExtensionSlot.d.ts +1 -0
  33. package/esm/components/ExtensionSlot.js +34 -11
  34. package/esm/components/ExtensionSlot.js.map +1 -1
  35. package/esm/components/ForeignComponentContainer.d.ts +19 -0
  36. package/esm/components/ForeignComponentContainer.js +46 -0
  37. package/esm/components/ForeignComponentContainer.js.map +1 -0
  38. package/esm/components/Mediator.js +15 -12
  39. package/esm/components/Mediator.js.map +1 -1
  40. package/esm/components/PiralGlobals.d.ts +6 -0
  41. package/esm/components/PiralGlobals.js +13 -0
  42. package/esm/components/PiralGlobals.js.map +1 -0
  43. package/esm/components/PiralRoutes.d.ts +5 -0
  44. package/esm/components/PiralRoutes.js +6 -11
  45. package/esm/components/PiralRoutes.js.map +1 -1
  46. package/esm/components/PiralSuspense.d.ts +5 -0
  47. package/esm/components/PiralSuspense.js +8 -0
  48. package/esm/components/PiralSuspense.js.map +1 -0
  49. package/esm/components/PiralView.d.ts +10 -1
  50. package/esm/components/PiralView.js +12 -25
  51. package/esm/components/PiralView.js.map +1 -1
  52. package/esm/components/PortalRenderer.d.ts +5 -0
  53. package/esm/components/PortalRenderer.js +7 -0
  54. package/esm/components/PortalRenderer.js.map +1 -0
  55. package/esm/components/ResponsiveLayout.d.ts +9 -1
  56. package/esm/components/ResponsiveLayout.js +5 -13
  57. package/esm/components/ResponsiveLayout.js.map +1 -1
  58. package/esm/components/SwitchErrorInfo.js +12 -10
  59. package/esm/components/SwitchErrorInfo.js.map +1 -1
  60. package/esm/components/components.d.ts +18 -6
  61. package/esm/components/components.js +21 -9
  62. package/esm/components/components.js.map +1 -1
  63. package/esm/components/index.d.ts +4 -10
  64. package/esm/components/index.js +4 -10
  65. package/esm/components/index.js.map +1 -1
  66. package/esm/components/wrapComponent.d.ts +7 -0
  67. package/esm/components/wrapComponent.js +42 -0
  68. package/esm/components/wrapComponent.js.map +1 -0
  69. package/esm/createInstance.d.ts +2 -2
  70. package/esm/createInstance.js +34 -30
  71. package/esm/createInstance.js.map +1 -1
  72. package/esm/defaults/DefaultErrorInfo.js +10 -0
  73. package/esm/defaults/DefaultErrorInfo.js.map +1 -0
  74. package/esm/{components → defaults}/DefaultLayout.js +1 -4
  75. package/esm/defaults/DefaultLayout.js.map +1 -0
  76. package/esm/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +2 -2
  77. package/esm/defaults/DefaultLoadingIndicator.js.map +1 -0
  78. package/esm/defaults/DefaultRouteSwitch_v5.d.ts +3 -0
  79. package/esm/defaults/DefaultRouteSwitch_v5.js +11 -0
  80. package/esm/defaults/DefaultRouteSwitch_v5.js.map +1 -0
  81. package/esm/defaults/DefaultRouteSwitch_v6.d.ts +3 -0
  82. package/esm/defaults/DefaultRouteSwitch_v6.js +15 -0
  83. package/esm/defaults/DefaultRouteSwitch_v6.js.map +1 -0
  84. package/esm/defaults/DefaultRouter_v5.d.ts +3 -0
  85. package/esm/defaults/DefaultRouter_v5.js +7 -0
  86. package/esm/defaults/DefaultRouter_v5.js.map +1 -0
  87. package/esm/defaults/DefaultRouter_v6.d.ts +3 -0
  88. package/esm/defaults/DefaultRouter_v6.js +7 -0
  89. package/esm/defaults/DefaultRouter_v6.js.map +1 -0
  90. package/esm/defaults/navigator_none.d.ts +5 -0
  91. package/esm/defaults/navigator_none.js +30 -0
  92. package/esm/defaults/navigator_none.js.map +1 -0
  93. package/esm/defaults/navigator_v5.d.ts +6 -0
  94. package/esm/defaults/navigator_v5.js +81 -0
  95. package/esm/defaults/navigator_v5.js.map +1 -0
  96. package/esm/defaults/navigator_v6.d.ts +6 -0
  97. package/esm/defaults/navigator_v6.js +77 -0
  98. package/esm/defaults/navigator_v6.js.map +1 -0
  99. package/esm/helpers.d.ts +12 -26
  100. package/esm/helpers.js +14 -72
  101. package/esm/helpers.js.map +1 -1
  102. package/esm/hooks/action.js +2 -3
  103. package/esm/hooks/action.js.map +1 -1
  104. package/esm/hooks/actions.js +1 -1
  105. package/esm/hooks/actions.js.map +1 -1
  106. package/esm/hooks/globalState.d.ts +7 -0
  107. package/esm/hooks/globalState.js +10 -8
  108. package/esm/hooks/globalState.js.map +1 -1
  109. package/esm/hooks/index.d.ts +2 -5
  110. package/esm/hooks/index.js +2 -5
  111. package/esm/hooks/index.js.map +1 -1
  112. package/esm/hooks/media.js +8 -7
  113. package/esm/hooks/media.js.map +1 -1
  114. package/esm/hooks/piletApi.d.ts +7 -0
  115. package/esm/hooks/piletApi.js +14 -0
  116. package/esm/hooks/piletApi.js.map +1 -0
  117. package/esm/hooks/routes.d.ts +2 -0
  118. package/esm/hooks/routes.js +11 -0
  119. package/esm/hooks/routes.js.map +1 -0
  120. package/esm/hooks/setter.js +3 -2
  121. package/esm/hooks/setter.js.map +1 -1
  122. package/esm/hooks/sharedData.js +2 -2
  123. package/esm/hooks/sharedData.js.map +1 -1
  124. package/esm/index.d.ts +3 -1
  125. package/esm/index.js +3 -1
  126. package/esm/index.js.map +1 -1
  127. package/esm/modules/api.d.ts +2 -5
  128. package/esm/modules/api.js +9 -68
  129. package/esm/modules/api.js.map +1 -1
  130. package/esm/modules/core.d.ts +3 -0
  131. package/esm/modules/core.js +50 -0
  132. package/esm/modules/core.js.map +1 -0
  133. package/esm/modules/dependencies.d.ts +5 -6
  134. package/esm/modules/dependencies.js +9 -24
  135. package/esm/modules/dependencies.js.map +1 -1
  136. package/esm/modules/element.d.ts +5 -0
  137. package/esm/modules/element.js +169 -0
  138. package/esm/modules/element.js.map +1 -0
  139. package/esm/modules/index.d.ts +1 -0
  140. package/esm/modules/index.js +1 -0
  141. package/esm/modules/index.js.map +1 -1
  142. package/esm/setters/SetComponent.js +11 -0
  143. package/esm/setters/SetComponent.js.map +1 -0
  144. package/esm/setters/SetError.js +11 -0
  145. package/esm/setters/SetError.js.map +1 -0
  146. package/esm/setters/SetErrors.js +9 -0
  147. package/esm/setters/SetErrors.js.map +1 -0
  148. package/esm/setters/SetLayout.js +9 -0
  149. package/esm/setters/SetLayout.js.map +1 -0
  150. package/esm/setters/SetProvider.js +11 -0
  151. package/esm/setters/SetProvider.js.map +1 -0
  152. package/esm/setters/SetRedirect.js +12 -0
  153. package/esm/setters/SetRedirect.js.map +1 -0
  154. package/{lib/components → esm/setters}/SetRoute.d.ts +6 -2
  155. package/esm/setters/SetRoute.js +11 -0
  156. package/esm/setters/SetRoute.js.map +1 -0
  157. package/esm/setters/index.d.ts +7 -0
  158. package/esm/setters/index.js +8 -0
  159. package/esm/setters/index.js.map +1 -0
  160. package/esm/state/createActions.d.ts +2 -2
  161. package/esm/state/createActions.js +8 -12
  162. package/esm/state/createActions.js.map +1 -1
  163. package/esm/state/createGlobalState.d.ts +1 -2
  164. package/esm/state/createGlobalState.js +9 -34
  165. package/esm/state/createGlobalState.js.map +1 -1
  166. package/esm/state/stateContext.js +1 -1
  167. package/esm/state/stateContext.js.map +1 -1
  168. package/esm/state/withApi.d.ts +1 -1
  169. package/esm/state/withApi.js +19 -104
  170. package/esm/state/withApi.js.map +1 -1
  171. package/esm/tools/codegen.d.ts +21 -0
  172. package/esm/tools/codegen.js +145 -0
  173. package/esm/tools/codegen.js.map +1 -0
  174. package/esm/tools/debugger.d.ts +4 -0
  175. package/esm/tools/debugger.js +54 -0
  176. package/esm/tools/debugger.js.map +1 -0
  177. package/esm/tools/emulator.d.ts +3 -0
  178. package/esm/tools/emulator.js +11 -0
  179. package/esm/tools/emulator.js.map +1 -0
  180. package/esm/types/api.d.ts +37 -10
  181. package/esm/types/common.d.ts +11 -11
  182. package/esm/types/components.d.ts +74 -8
  183. package/esm/types/config.d.ts +24 -17
  184. package/esm/types/data.d.ts +2 -2
  185. package/esm/types/extension.d.ts +31 -4
  186. package/esm/types/index.d.ts +1 -0
  187. package/esm/types/index.js +1 -0
  188. package/esm/types/index.js.map +1 -1
  189. package/esm/types/instance.d.ts +26 -4
  190. package/esm/types/layout.d.ts +3 -3
  191. package/esm/types/navigation.d.ts +94 -0
  192. package/esm/types/navigation.js +2 -0
  193. package/esm/types/navigation.js.map +1 -0
  194. package/esm/types/plugin.d.ts +1 -14
  195. package/esm/types/state.d.ts +66 -27
  196. package/esm/types/utils.d.ts +1 -1
  197. package/esm/utils/compare.d.ts +1 -1
  198. package/esm/utils/compare.js +24 -7
  199. package/esm/utils/compare.js.map +1 -1
  200. package/esm/utils/data.js +6 -7
  201. package/esm/utils/data.js.map +1 -1
  202. package/esm/utils/extension.d.ts +16 -0
  203. package/esm/utils/extension.js +37 -0
  204. package/esm/utils/extension.js.map +1 -0
  205. package/esm/utils/foreign.d.ts +7 -2
  206. package/esm/utils/foreign.js +20 -9
  207. package/esm/utils/foreign.js.map +1 -1
  208. package/esm/utils/guid.js +3 -3
  209. package/esm/utils/guid.js.map +1 -1
  210. package/esm/utils/helpers.d.ts +11 -8
  211. package/esm/utils/helpers.js +29 -18
  212. package/esm/utils/helpers.js.map +1 -1
  213. package/esm/utils/index.d.ts +3 -1
  214. package/esm/utils/index.js +3 -1
  215. package/esm/utils/index.js.map +1 -1
  216. package/esm/utils/media.js +8 -8
  217. package/esm/utils/media.js.map +1 -1
  218. package/esm/utils/state.d.ts +57 -0
  219. package/esm/utils/state.js +83 -0
  220. package/esm/utils/state.js.map +1 -0
  221. package/esm/utils/storage.js +13 -14
  222. package/esm/utils/storage.js.map +1 -1
  223. package/lib/Piral.d.ts +4 -4
  224. package/lib/Piral.js +11 -13
  225. package/lib/Piral.js.map +1 -1
  226. package/lib/PiralContext.d.ts +21 -0
  227. package/lib/PiralContext.js +38 -0
  228. package/lib/PiralContext.js.map +1 -0
  229. package/lib/RootListener.d.ts +2 -0
  230. package/lib/RootListener.js +27 -0
  231. package/lib/RootListener.js.map +1 -0
  232. package/lib/actions/app.d.ts +7 -4
  233. package/lib/actions/app.js +27 -16
  234. package/lib/actions/app.js.map +1 -1
  235. package/lib/actions/components.js +5 -6
  236. package/lib/actions/components.js.map +1 -1
  237. package/lib/actions/data.js +17 -18
  238. package/lib/actions/data.js.map +1 -1
  239. package/lib/actions/define.js +2 -3
  240. package/lib/actions/define.js.map +1 -1
  241. package/lib/actions/index.js +1 -1
  242. package/lib/actions/portal.d.ts +2 -0
  243. package/lib/actions/portal.js +12 -5
  244. package/lib/actions/portal.js.map +1 -1
  245. package/lib/actions/state.js +7 -4
  246. package/lib/actions/state.js.map +1 -1
  247. package/lib/components/ErrorBoundary.d.ts +14 -31
  248. package/lib/components/ErrorBoundary.js +23 -28
  249. package/lib/components/ErrorBoundary.js.map +1 -1
  250. package/lib/components/ExtensionSlot.d.ts +1 -0
  251. package/lib/components/ExtensionSlot.js +37 -14
  252. package/lib/components/ExtensionSlot.js.map +1 -1
  253. package/lib/components/ForeignComponentContainer.d.ts +19 -0
  254. package/lib/components/ForeignComponentContainer.js +50 -0
  255. package/lib/components/ForeignComponentContainer.js.map +1 -0
  256. package/lib/components/Mediator.js +18 -14
  257. package/lib/components/Mediator.js.map +1 -1
  258. package/lib/components/PiralGlobals.d.ts +6 -0
  259. package/lib/components/PiralGlobals.js +17 -0
  260. package/lib/components/PiralGlobals.js.map +1 -0
  261. package/lib/components/PiralRoutes.d.ts +5 -0
  262. package/lib/components/PiralRoutes.js +8 -12
  263. package/lib/components/PiralRoutes.js.map +1 -1
  264. package/lib/components/PiralSuspense.d.ts +5 -0
  265. package/lib/components/PiralSuspense.js +12 -0
  266. package/lib/components/PiralSuspense.js.map +1 -0
  267. package/lib/components/PiralView.d.ts +10 -1
  268. package/lib/components/PiralView.js +15 -27
  269. package/lib/components/PiralView.js.map +1 -1
  270. package/lib/components/PortalRenderer.d.ts +5 -0
  271. package/lib/components/PortalRenderer.js +11 -0
  272. package/lib/components/PortalRenderer.js.map +1 -0
  273. package/lib/components/ResponsiveLayout.d.ts +9 -1
  274. package/lib/components/ResponsiveLayout.js +7 -14
  275. package/lib/components/ResponsiveLayout.js.map +1 -1
  276. package/lib/components/SwitchErrorInfo.js +15 -12
  277. package/lib/components/SwitchErrorInfo.js.map +1 -1
  278. package/lib/components/components.d.ts +18 -6
  279. package/lib/components/components.js +24 -12
  280. package/lib/components/components.js.map +1 -1
  281. package/lib/components/index.d.ts +4 -10
  282. package/lib/components/index.js +5 -11
  283. package/lib/components/index.js.map +1 -1
  284. package/lib/components/wrapComponent.d.ts +7 -0
  285. package/lib/components/wrapComponent.js +46 -0
  286. package/lib/components/wrapComponent.js.map +1 -0
  287. package/lib/createInstance.d.ts +2 -2
  288. package/lib/createInstance.js +40 -36
  289. package/lib/createInstance.js.map +1 -1
  290. package/lib/defaults/DefaultErrorInfo.js +14 -0
  291. package/lib/defaults/DefaultErrorInfo.js.map +1 -0
  292. package/lib/{components → defaults}/DefaultLayout.js +3 -5
  293. package/lib/defaults/DefaultLayout.js.map +1 -0
  294. package/lib/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +4 -3
  295. package/lib/defaults/DefaultLoadingIndicator.js.map +1 -0
  296. package/lib/defaults/DefaultRouteSwitch_v5.d.ts +3 -0
  297. package/lib/defaults/DefaultRouteSwitch_v5.js +15 -0
  298. package/lib/defaults/DefaultRouteSwitch_v5.js.map +1 -0
  299. package/lib/defaults/DefaultRouteSwitch_v6.d.ts +3 -0
  300. package/lib/defaults/DefaultRouteSwitch_v6.js +19 -0
  301. package/lib/defaults/DefaultRouteSwitch_v6.js.map +1 -0
  302. package/lib/defaults/DefaultRouter_v5.d.ts +3 -0
  303. package/lib/defaults/DefaultRouter_v5.js +11 -0
  304. package/lib/defaults/DefaultRouter_v5.js.map +1 -0
  305. package/lib/defaults/DefaultRouter_v6.d.ts +3 -0
  306. package/lib/defaults/DefaultRouter_v6.js +11 -0
  307. package/lib/defaults/DefaultRouter_v6.js.map +1 -0
  308. package/lib/defaults/navigator_none.d.ts +5 -0
  309. package/lib/defaults/navigator_none.js +37 -0
  310. package/lib/defaults/navigator_none.js.map +1 -0
  311. package/lib/defaults/navigator_v5.d.ts +6 -0
  312. package/lib/defaults/navigator_v5.js +88 -0
  313. package/lib/defaults/navigator_v5.js.map +1 -0
  314. package/lib/defaults/navigator_v6.d.ts +6 -0
  315. package/lib/defaults/navigator_v6.js +84 -0
  316. package/lib/defaults/navigator_v6.js.map +1 -0
  317. package/lib/helpers.d.ts +12 -26
  318. package/lib/helpers.js +15 -75
  319. package/lib/helpers.js.map +1 -1
  320. package/lib/hooks/action.js +2 -3
  321. package/lib/hooks/action.js.map +1 -1
  322. package/lib/hooks/actions.js +4 -4
  323. package/lib/hooks/actions.js.map +1 -1
  324. package/lib/hooks/globalState.d.ts +7 -0
  325. package/lib/hooks/globalState.js +14 -11
  326. package/lib/hooks/globalState.js.map +1 -1
  327. package/lib/hooks/index.d.ts +2 -5
  328. package/lib/hooks/index.js +3 -6
  329. package/lib/hooks/index.js.map +1 -1
  330. package/lib/hooks/media.js +10 -9
  331. package/lib/hooks/media.js.map +1 -1
  332. package/lib/hooks/piletApi.d.ts +7 -0
  333. package/lib/hooks/piletApi.js +18 -0
  334. package/lib/hooks/piletApi.js.map +1 -0
  335. package/lib/hooks/routes.d.ts +2 -0
  336. package/lib/hooks/routes.js +15 -0
  337. package/lib/hooks/routes.js.map +1 -0
  338. package/lib/hooks/setter.js +4 -3
  339. package/lib/hooks/setter.js.map +1 -1
  340. package/lib/hooks/sharedData.js +3 -3
  341. package/lib/hooks/sharedData.js.map +1 -1
  342. package/lib/index.d.ts +3 -1
  343. package/lib/index.js +4 -2
  344. package/lib/index.js.map +1 -1
  345. package/lib/modules/api.d.ts +2 -5
  346. package/lib/modules/api.js +12 -74
  347. package/lib/modules/api.js.map +1 -1
  348. package/lib/modules/core.d.ts +3 -0
  349. package/lib/modules/core.js +54 -0
  350. package/lib/modules/core.js.map +1 -0
  351. package/lib/modules/dependencies.d.ts +5 -6
  352. package/lib/modules/dependencies.js +12 -27
  353. package/lib/modules/dependencies.js.map +1 -1
  354. package/lib/modules/element.d.ts +5 -0
  355. package/lib/modules/element.js +173 -0
  356. package/lib/modules/element.js.map +1 -0
  357. package/lib/modules/index.d.ts +1 -0
  358. package/lib/modules/index.js +2 -1
  359. package/lib/modules/index.js.map +1 -1
  360. package/lib/setters/SetComponent.js +15 -0
  361. package/lib/setters/SetComponent.js.map +1 -0
  362. package/lib/setters/SetError.js +15 -0
  363. package/lib/setters/SetError.js.map +1 -0
  364. package/lib/setters/SetErrors.js +13 -0
  365. package/lib/setters/SetErrors.js.map +1 -0
  366. package/lib/setters/SetLayout.js +13 -0
  367. package/lib/setters/SetLayout.js.map +1 -0
  368. package/lib/{components → setters}/SetProvider.js +4 -5
  369. package/lib/setters/SetProvider.js.map +1 -0
  370. package/lib/setters/SetRedirect.js +16 -0
  371. package/lib/setters/SetRedirect.js.map +1 -0
  372. package/{esm/components → lib/setters}/SetRoute.d.ts +6 -2
  373. package/lib/setters/SetRoute.js +15 -0
  374. package/lib/setters/SetRoute.js.map +1 -0
  375. package/lib/setters/index.d.ts +7 -0
  376. package/lib/setters/index.js +11 -0
  377. package/lib/setters/index.js.map +1 -0
  378. package/lib/state/createActions.d.ts +2 -2
  379. package/lib/state/createActions.js +9 -13
  380. package/lib/state/createActions.js.map +1 -1
  381. package/lib/state/createGlobalState.d.ts +1 -2
  382. package/lib/state/createGlobalState.js +9 -34
  383. package/lib/state/createGlobalState.js.map +1 -1
  384. package/lib/state/index.js +1 -1
  385. package/lib/state/stateContext.js +1 -1
  386. package/lib/state/stateContext.js.map +1 -1
  387. package/lib/state/withApi.d.ts +1 -1
  388. package/lib/state/withApi.js +20 -105
  389. package/lib/state/withApi.js.map +1 -1
  390. package/lib/tools/codegen.d.ts +21 -0
  391. package/lib/tools/codegen.js +152 -0
  392. package/lib/tools/codegen.js.map +1 -0
  393. package/lib/tools/debugger.d.ts +4 -0
  394. package/lib/tools/debugger.js +58 -0
  395. package/lib/tools/debugger.js.map +1 -0
  396. package/lib/tools/emulator.d.ts +3 -0
  397. package/lib/tools/emulator.js +15 -0
  398. package/lib/tools/emulator.js.map +1 -0
  399. package/lib/types/api.d.ts +37 -10
  400. package/lib/types/common.d.ts +11 -11
  401. package/lib/types/components.d.ts +74 -8
  402. package/lib/types/config.d.ts +24 -17
  403. package/lib/types/data.d.ts +2 -2
  404. package/lib/types/extension.d.ts +31 -4
  405. package/lib/types/index.d.ts +1 -0
  406. package/lib/types/index.js +2 -1
  407. package/lib/types/index.js.map +1 -1
  408. package/lib/types/instance.d.ts +26 -4
  409. package/lib/types/layout.d.ts +3 -3
  410. package/lib/types/navigation.d.ts +94 -0
  411. package/lib/types/navigation.js +3 -0
  412. package/lib/types/navigation.js.map +1 -0
  413. package/lib/types/plugin.d.ts +1 -14
  414. package/lib/types/state.d.ts +66 -27
  415. package/lib/types/utils.d.ts +1 -1
  416. package/lib/utils/compare.d.ts +1 -1
  417. package/lib/utils/compare.js +26 -9
  418. package/lib/utils/compare.js.map +1 -1
  419. package/lib/utils/data.js +6 -7
  420. package/lib/utils/data.js.map +1 -1
  421. package/lib/utils/extension.d.ts +16 -0
  422. package/lib/utils/extension.js +42 -0
  423. package/lib/utils/extension.js.map +1 -0
  424. package/lib/utils/foreign.d.ts +7 -2
  425. package/lib/utils/foreign.js +25 -12
  426. package/lib/utils/foreign.js.map +1 -1
  427. package/lib/utils/guid.js +3 -3
  428. package/lib/utils/guid.js.map +1 -1
  429. package/lib/utils/helpers.d.ts +11 -8
  430. package/lib/utils/helpers.js +31 -18
  431. package/lib/utils/helpers.js.map +1 -1
  432. package/lib/utils/index.d.ts +3 -1
  433. package/lib/utils/index.js +7 -2
  434. package/lib/utils/index.js.map +1 -1
  435. package/lib/utils/media.js +7 -7
  436. package/lib/utils/media.js.map +1 -1
  437. package/lib/utils/react.js +1 -1
  438. package/lib/utils/react.js.map +1 -1
  439. package/lib/utils/state.d.ts +57 -0
  440. package/lib/utils/state.js +94 -0
  441. package/lib/utils/state.js.map +1 -0
  442. package/lib/utils/storage.js +11 -12
  443. package/lib/utils/storage.js.map +1 -1
  444. package/package.json +55 -18
  445. package/src/Piral.test.tsx +7 -16
  446. package/src/Piral.tsx +12 -11
  447. package/src/PiralContext.tsx +43 -0
  448. package/src/RootListener.test.tsx +46 -0
  449. package/src/RootListener.tsx +26 -0
  450. package/src/actions/app.test.ts +114 -44
  451. package/src/actions/app.ts +33 -23
  452. package/src/actions/components.test.ts +11 -11
  453. package/src/actions/components.ts +5 -33
  454. package/src/actions/data.test.ts +50 -50
  455. package/src/actions/define.test.ts +2 -2
  456. package/src/actions/portal.test.ts +62 -17
  457. package/src/actions/portal.ts +19 -1
  458. package/src/actions/state.test.ts +3 -3
  459. package/src/actions/state.ts +8 -4
  460. package/src/components/ErrorBoundary.tsx +22 -49
  461. package/src/components/ExtensionSlot.test.tsx +115 -30
  462. package/src/components/ExtensionSlot.tsx +57 -18
  463. package/src/components/ForeignComponentContainer.test.tsx +100 -0
  464. package/src/components/ForeignComponentContainer.tsx +63 -0
  465. package/src/components/Mediator.test.tsx +16 -14
  466. package/src/components/Mediator.tsx +17 -9
  467. package/src/components/PiralGlobals.tsx +16 -0
  468. package/src/components/PiralRoutes.test.tsx +65 -57
  469. package/src/components/PiralRoutes.tsx +10 -17
  470. package/src/components/PiralSuspense.tsx +19 -0
  471. package/src/components/PiralView-server.test.tsx +61 -0
  472. package/src/components/PiralView.test.tsx +27 -26
  473. package/src/components/PiralView.tsx +28 -35
  474. package/src/components/PortalRenderer.tsx +12 -0
  475. package/src/components/ResponsiveLayout.test.tsx +18 -37
  476. package/src/components/ResponsiveLayout.tsx +18 -15
  477. package/src/components/SwitchErrorInfo.test.tsx +36 -0
  478. package/src/components/SwitchErrorInfo.tsx +5 -1
  479. package/src/components/components.tsx +20 -6
  480. package/src/components/index.ts +4 -10
  481. package/src/components/wrapComponent.tsx +74 -0
  482. package/src/createInstance.test.tsx +10 -0
  483. package/src/createInstance.tsx +19 -14
  484. package/src/{components → defaults}/DefaultErrorInfo.test.tsx +15 -18
  485. package/src/{components → defaults}/DefaultErrorInfo.tsx +2 -3
  486. package/src/defaults/DefaultLayout.test.tsx +23 -0
  487. package/src/defaults/DefaultLoadingIndicator.test.tsx +10 -0
  488. package/src/defaults/DefaultRouteSwitch_v5.tsx +15 -0
  489. package/src/defaults/DefaultRouteSwitch_v6.tsx +20 -0
  490. package/src/defaults/DefaultRouter_v5.tsx +8 -0
  491. package/src/defaults/DefaultRouter_v6.tsx +8 -0
  492. package/src/defaults/navigator_none.tsx +35 -0
  493. package/src/defaults/navigator_v5.tsx +99 -0
  494. package/src/defaults/navigator_v6.tsx +96 -0
  495. package/src/helpers.test.tsx +30 -49
  496. package/src/helpers.tsx +31 -108
  497. package/src/hooks/action.ts +2 -3
  498. package/src/hooks/globalState.ts +10 -9
  499. package/src/hooks/index.ts +2 -5
  500. package/src/hooks/media.ts +2 -1
  501. package/src/hooks/piletApi.ts +14 -0
  502. package/src/hooks/routes.ts +14 -0
  503. package/src/hooks/setter-server.test.ts +22 -0
  504. package/src/hooks/setter.test.ts +18 -0
  505. package/src/hooks/setter.ts +2 -1
  506. package/src/index.tsx +3 -1
  507. package/src/modules/api.test.ts +15 -26
  508. package/src/modules/api.ts +3 -65
  509. package/src/modules/core.test.ts +148 -0
  510. package/src/modules/core.ts +52 -0
  511. package/src/modules/dependencies.test.ts +16 -5
  512. package/src/modules/dependencies.ts +13 -31
  513. package/src/modules/element-server.test.ts +29 -0
  514. package/src/modules/element.test.ts +67 -0
  515. package/src/modules/element.ts +212 -0
  516. package/src/modules/index.ts +1 -0
  517. package/src/{components → setters}/SetComponent.test.tsx +9 -8
  518. package/src/{components → setters}/SetComponent.tsx +2 -2
  519. package/src/{components → setters}/SetError.test.tsx +9 -8
  520. package/src/{components → setters}/SetError.tsx +2 -2
  521. package/src/{components → setters}/SetErrors.test.tsx +9 -8
  522. package/src/{components → setters}/SetLayout.test.tsx +9 -8
  523. package/src/{components → setters}/SetProvider.test.tsx +9 -8
  524. package/src/{components → setters}/SetProvider.tsx +2 -2
  525. package/src/{components → setters}/SetRedirect.test.tsx +9 -8
  526. package/src/{components → setters}/SetRedirect.tsx +4 -4
  527. package/src/{components → setters}/SetRoute.test.tsx +9 -8
  528. package/src/{components → setters}/SetRoute.tsx +7 -4
  529. package/src/setters/index.ts +7 -0
  530. package/src/state/createActions.test.ts +2 -2
  531. package/src/state/createActions.ts +5 -3
  532. package/src/state/createGlobalState.test.ts +55 -54
  533. package/src/state/createGlobalState.ts +4 -28
  534. package/src/state/withApi.test.tsx +87 -40
  535. package/src/state/withApi.tsx +31 -165
  536. package/src/tools/codegen.ts +193 -0
  537. package/src/tools/debugger.ts +84 -0
  538. package/src/tools/emulator.ts +13 -0
  539. package/src/types/api.ts +50 -11
  540. package/src/types/components.ts +76 -7
  541. package/src/types/config.ts +23 -17
  542. package/src/types/extension.ts +38 -5
  543. package/src/types/index.ts +1 -0
  544. package/src/types/instance.ts +28 -4
  545. package/src/types/navigation.ts +101 -0
  546. package/src/types/plugin.ts +1 -15
  547. package/src/types/state.ts +65 -25
  548. package/src/types/utils.ts +1 -1
  549. package/src/utils/compare.test.ts +15 -15
  550. package/src/utils/compare.ts +23 -3
  551. package/src/utils/extension.test.tsx +21 -0
  552. package/src/utils/extension.tsx +48 -0
  553. package/src/utils/foreign.test.ts +29 -11
  554. package/src/utils/foreign.ts +34 -7
  555. package/src/utils/guid.test.ts +6 -1
  556. package/src/utils/helpers.test.ts +52 -0
  557. package/src/utils/helpers.ts +22 -8
  558. package/src/utils/index.ts +4 -1
  559. package/src/utils/media-server.test.ts +13 -0
  560. package/src/utils/media.ts +2 -2
  561. package/src/utils/state.test.ts +37 -0
  562. package/src/utils/state.ts +131 -0
  563. package/dependencies.codegen +0 -9
  564. package/dependencies.codegen.native.js +0 -2
  565. package/esm/components/DefaultErrorInfo.js +0 -12
  566. package/esm/components/DefaultErrorInfo.js.map +0 -1
  567. package/esm/components/DefaultLayout.js.map +0 -1
  568. package/esm/components/DefaultLoader.js.map +0 -1
  569. package/esm/components/SetComponent.js +0 -12
  570. package/esm/components/SetComponent.js.map +0 -1
  571. package/esm/components/SetError.js +0 -12
  572. package/esm/components/SetError.js.map +0 -1
  573. package/esm/components/SetErrors.js +0 -10
  574. package/esm/components/SetErrors.js.map +0 -1
  575. package/esm/components/SetLayout.js +0 -10
  576. package/esm/components/SetLayout.js.map +0 -1
  577. package/esm/components/SetProvider.js +0 -12
  578. package/esm/components/SetProvider.js.map +0 -1
  579. package/esm/components/SetRedirect.js +0 -14
  580. package/esm/components/SetRedirect.js.map +0 -1
  581. package/esm/components/SetRoute.js +0 -12
  582. package/esm/components/SetRoute.js.map +0 -1
  583. package/esm/hooks/debounce.d.ts +0 -8
  584. package/esm/hooks/debounce.js +0 -18
  585. package/esm/hooks/debounce.js.map +0 -1
  586. package/esm/hooks/lockBodyScroll.d.ts +0 -6
  587. package/esm/hooks/lockBodyScroll.js +0 -13
  588. package/esm/hooks/lockBodyScroll.js.map +0 -1
  589. package/esm/hooks/onClickOutside.d.ts +0 -8
  590. package/esm/hooks/onClickOutside.js +0 -23
  591. package/esm/hooks/onClickOutside.js.map +0 -1
  592. package/esm/hooks/onScreenVisible.d.ts +0 -11
  593. package/esm/hooks/onScreenVisible.js +0 -28
  594. package/esm/hooks/onScreenVisible.js.map +0 -1
  595. package/esm/hooks/promise.d.ts +0 -13
  596. package/esm/hooks/promise.js +0 -21
  597. package/esm/hooks/promise.js.map +0 -1
  598. package/esm/utils/events.d.ts +0 -3
  599. package/esm/utils/events.js +0 -35
  600. package/esm/utils/events.js.map +0 -1
  601. package/lib/components/DefaultErrorInfo.js +0 -15
  602. package/lib/components/DefaultErrorInfo.js.map +0 -1
  603. package/lib/components/DefaultLayout.js.map +0 -1
  604. package/lib/components/DefaultLoader.js.map +0 -1
  605. package/lib/components/SetComponent.js +0 -16
  606. package/lib/components/SetComponent.js.map +0 -1
  607. package/lib/components/SetError.js +0 -16
  608. package/lib/components/SetError.js.map +0 -1
  609. package/lib/components/SetErrors.js +0 -14
  610. package/lib/components/SetErrors.js.map +0 -1
  611. package/lib/components/SetLayout.js +0 -14
  612. package/lib/components/SetLayout.js.map +0 -1
  613. package/lib/components/SetProvider.js.map +0 -1
  614. package/lib/components/SetRedirect.js +0 -18
  615. package/lib/components/SetRedirect.js.map +0 -1
  616. package/lib/components/SetRoute.js +0 -16
  617. package/lib/components/SetRoute.js.map +0 -1
  618. package/lib/hooks/debounce.d.ts +0 -8
  619. package/lib/hooks/debounce.js +0 -22
  620. package/lib/hooks/debounce.js.map +0 -1
  621. package/lib/hooks/lockBodyScroll.d.ts +0 -6
  622. package/lib/hooks/lockBodyScroll.js +0 -17
  623. package/lib/hooks/lockBodyScroll.js.map +0 -1
  624. package/lib/hooks/onClickOutside.d.ts +0 -8
  625. package/lib/hooks/onClickOutside.js +0 -27
  626. package/lib/hooks/onClickOutside.js.map +0 -1
  627. package/lib/hooks/onScreenVisible.d.ts +0 -11
  628. package/lib/hooks/onScreenVisible.js +0 -32
  629. package/lib/hooks/onScreenVisible.js.map +0 -1
  630. package/lib/hooks/promise.d.ts +0 -13
  631. package/lib/hooks/promise.js +0 -25
  632. package/lib/hooks/promise.js.map +0 -1
  633. package/lib/utils/events.d.ts +0 -3
  634. package/lib/utils/events.js +0 -39
  635. package/lib/utils/events.js.map +0 -1
  636. package/src/components/DefaultLayout.test.tsx +0 -23
  637. package/src/components/DefaultLoader.test.tsx +0 -10
  638. package/src/hooks/debounce.test.ts +0 -67
  639. package/src/hooks/debounce.ts +0 -19
  640. package/src/hooks/globalState.test.ts +0 -47
  641. package/src/hooks/lockBodyScroll.test.ts +0 -24
  642. package/src/hooks/lockBodyScroll.ts +0 -13
  643. package/src/hooks/onClickOutside.test.ts +0 -113
  644. package/src/hooks/onClickOutside.ts +0 -25
  645. package/src/hooks/onScreenVisible.test.ts +0 -68
  646. package/src/hooks/onScreenVisible.ts +0 -28
  647. package/src/hooks/promise.test.ts +0 -76
  648. package/src/hooks/promise.ts +0 -35
  649. package/src/utils/events.test.ts +0 -65
  650. package/src/utils/events.ts +0 -39
  651. package/esm/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
  652. package/esm/{components → defaults}/DefaultLayout.d.ts +0 -0
  653. package/esm/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
  654. package/esm/{components → setters}/SetComponent.d.ts +0 -0
  655. package/esm/{components → setters}/SetError.d.ts +0 -0
  656. package/esm/{components → setters}/SetErrors.d.ts +0 -0
  657. package/esm/{components → setters}/SetLayout.d.ts +0 -0
  658. package/esm/{components → setters}/SetProvider.d.ts +0 -0
  659. package/esm/{components → setters}/SetRedirect.d.ts +0 -0
  660. package/lib/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
  661. package/lib/{components → defaults}/DefaultLayout.d.ts +0 -0
  662. package/lib/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
  663. package/lib/{components → setters}/SetComponent.d.ts +0 -0
  664. package/lib/{components → setters}/SetError.d.ts +0 -0
  665. package/lib/{components → setters}/SetErrors.d.ts +0 -0
  666. package/lib/{components → setters}/SetLayout.d.ts +0 -0
  667. package/lib/{components → setters}/SetProvider.d.ts +0 -0
  668. package/lib/{components → setters}/SetRedirect.d.ts +0 -0
  669. package/src/{components → defaults}/DefaultLayout.tsx +1 -1
  670. /package/src/{components/DefaultLoader.tsx → defaults/DefaultLoadingIndicator.tsx} +0 -0
  671. /package/src/{components → setters}/SetErrors.tsx +0 -0
  672. /package/src/{components → setters}/SetLayout.tsx +0 -0
@@ -1,22 +1,45 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { isfunc } from 'piral-base';
4
- import { useGlobalState } from '../hooks';
5
- import { defaultRender } from '../utils';
3
+ import { wrapComponent } from './wrapComponent';
4
+ import { useGlobalState, useGlobalStateContext } from '../hooks';
5
+ import { defaultRender, none } from '../utils';
6
+ const wrapper = ({ children }) => defaultRender(children);
7
+ const renderExtensions = [
8
+ {
9
+ component: (props) => {
10
+ const context = useGlobalStateContext();
11
+ const converters = context.converters;
12
+ const piral = context.apis._;
13
+ const { component, props: args } = props.params;
14
+ const Component = React.useMemo(() => wrapComponent(converters, component, { piral }, wrapper), [component]);
15
+ return React.createElement(Component, Object.assign({}, args));
16
+ },
17
+ defaults: {},
18
+ pilet: '',
19
+ reference: {
20
+ displayName: 'AnyComponent',
21
+ },
22
+ },
23
+ ];
24
+ function defaultOrder(extensions) {
25
+ return extensions;
26
+ }
6
27
  /**
7
28
  * The extension slot component to be used when the available
8
29
  * extensions of a given name should be rendered at a specific
9
30
  * location.
10
31
  */
11
32
  export function ExtensionSlot(props) {
12
- var name = props.name, _a = props.render, render = _a === void 0 ? defaultRender : _a, empty = props.empty, params = props.params;
13
- var extensions = useGlobalState(function (s) { return s.registry.extensions[name] || []; });
14
- return render(extensions.length === 0 && isfunc(empty)
33
+ const { name, render = defaultRender, empty, params, children, emptySkipsRender = false, order = defaultOrder, } = props;
34
+ const extensions = useGlobalState((s) => (name ? s.registry.extensions[name] || none : renderExtensions));
35
+ const isEmpty = extensions.length === 0 && isfunc(empty);
36
+ const content = isEmpty
15
37
  ? [defaultRender(empty(), 'empty')]
16
- : extensions.map(function (_a, i) {
17
- var Component = _a.component, reference = _a.reference, _b = _a.defaults, defaults = _b === void 0 ? {} : _b;
18
- return (React.createElement(Component, { key: "" + ((reference === null || reference === void 0 ? void 0 : reference.displayName) || '_') + i, params: __assign(__assign({}, defaults), (params || {})) }));
19
- }));
38
+ : order(extensions).map(({ component: Component, reference, defaults = {} }, i) => (React.createElement(Component, { key: `${(reference === null || reference === void 0 ? void 0 : reference.displayName) || '_'}${i}`, children: children, params: Object.assign(Object.assign({}, defaults), params) })));
39
+ if (isEmpty && emptySkipsRender) {
40
+ return content[0];
41
+ }
42
+ return render(content);
20
43
  }
21
- ExtensionSlot.displayName = "ExtensionSlot";
44
+ ExtensionSlot.displayName = `ExtensionSlot`;
22
45
  //# sourceMappingURL=ExtensionSlot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionSlot.js","sourceRoot":"","sources":["../../src/components/ExtensionSlot.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAmB,KAA4B;IAClE,IAAA,IAAI,GAA4C,KAAK,KAAjD,EAAE,KAA0C,KAAK,OAAzB,EAAtB,MAAM,mBAAG,aAAa,KAAA,EAAE,KAAK,GAAa,KAAK,MAAlB,EAAE,MAAM,GAAK,KAAK,OAAV,CAAW;IAC9D,IAA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AC,aAAa,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAC/E,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,KAAI,GAAG,GAAG,CAAC,EAAE,EAC3C,QAAQ,EAAE,QAAQ,EAClB,MAAM,kCACD,QAAQ,GACR,MAAM,IAEX,CACH,CAAC,CAAC;IAEP,IAAI,OAAO,IAAI,gBAAgB,EAAE;QAC/B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;KACnB;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import type { ForeignComponent, BaseComponentProps, ComponentContext } from '../types';
3
+ interface ForeignComponentContainerProps<T> {
4
+ $portalId: string;
5
+ $component: ForeignComponent<T>;
6
+ $context: ComponentContext;
7
+ innerProps: T & BaseComponentProps;
8
+ }
9
+ export declare class ForeignComponentContainer<T> extends React.Component<ForeignComponentContainerProps<T>> {
10
+ private locals?;
11
+ private current?;
12
+ private previous?;
13
+ private setNode;
14
+ componentDidMount(): void;
15
+ componentDidUpdate(): void;
16
+ componentWillUnmount(): void;
17
+ render(): JSX.Element;
18
+ }
19
+ export {};
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import { isfunc } from 'piral-base';
3
+ export class ForeignComponentContainer extends React.Component {
4
+ constructor() {
5
+ super(...arguments);
6
+ this.locals = {};
7
+ this.setNode = (node) => {
8
+ this.current = node;
9
+ };
10
+ }
11
+ componentDidMount() {
12
+ const { current } = this;
13
+ const { $component, $context, innerProps } = this.props;
14
+ const { mount } = $component;
15
+ if (current && isfunc(mount)) {
16
+ mount(current, innerProps, $context, this.locals);
17
+ }
18
+ this.previous = current;
19
+ }
20
+ componentDidUpdate() {
21
+ const { current, previous } = this;
22
+ const { $component, $context, innerProps } = this.props;
23
+ const { update } = $component;
24
+ if (current !== previous) {
25
+ previous && this.componentWillUnmount();
26
+ current && this.componentDidMount();
27
+ }
28
+ else if (isfunc(update)) {
29
+ update(current, innerProps, $context, this.locals);
30
+ }
31
+ }
32
+ componentWillUnmount() {
33
+ const { previous } = this;
34
+ const { $component } = this.props;
35
+ const { unmount } = $component;
36
+ if (previous && isfunc(unmount)) {
37
+ unmount(previous, this.locals);
38
+ }
39
+ this.previous = undefined;
40
+ }
41
+ render() {
42
+ const { $portalId } = this.props;
43
+ return React.createElement("piral-portal", { pid: $portalId, ref: this.setNode });
44
+ }
45
+ }
46
+ //# sourceMappingURL=ForeignComponentContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForeignComponentContainer.js","sourceRoot":"","sources":["../../src/components/ForeignComponentContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAWpC,MAAM,OAAO,yBAA6B,SAAQ,KAAK,CAAC,SAA4C;IAApG;;QACU,WAAM,GAAyB,EAAE,CAAC;QAIlC,YAAO,GAAG,CAAC,IAAoB,EAAE,EAAE;YACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC;IA2CJ,CAAC;IAzCC,iBAAiB;QACf,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACzB,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxD,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;QAE7B,IAAI,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EA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Pilets } from 'piral-base';
3
- import { useAction } from '../hooks';
3
+ import { useGlobalStateContext } from '../hooks';
4
+ import { none } from '../utils';
4
5
  /**
5
6
  * The Mediator component for interfacing with pilets loading.
6
7
  */
7
- export var Mediator = function (_a) {
8
- var options = _a.options;
9
- var initialize = useAction('initialize');
10
- React.useEffect(function () {
11
- var _a = startLoadingPilets(options), connect = _a.connect, disconnect = _a.disconnect;
12
- var notifier = function (error, pilets, loaded) {
13
- initialize(!loaded, error, pilets);
14
- };
15
- connect(notifier);
16
- return function () { return disconnect(notifier); };
17
- }, []);
8
+ export const Mediator = ({ options }) => {
9
+ const { initialize, readState } = useGlobalStateContext();
10
+ React.useEffect(() => {
11
+ const shouldLoad = readState(s => s.app.loading);
12
+ if (shouldLoad) {
13
+ const { connect, disconnect } = startLoadingPilets(options);
14
+ const notifier = (error, pilets, loaded) => {
15
+ initialize(!loaded, error, pilets);
16
+ };
17
+ connect(notifier);
18
+ return () => disconnect(notifier);
19
+ }
20
+ }, none);
18
21
  // tslint:disable-next-line:no-null-keyword
19
22
  return null;
20
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Mediator.js","sourceRoot":"","sources":["../../src/components/Mediator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAqB,kBAAkB,EAAiB,MAAM,YAAY,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAYrC;;GAEG;AACH,MAAM,CAAC,IAAM,QAAQ,GAA4B,UAAC,EAAW;QAAT,OAAO,aAAA;IACzD,IAAM,UAAU,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;IAC3C,KAAK,CAAC,SAAS,CAAC;QACR,IAAA,KAA0B,kBAAkB,CAAC,OAAO,CAAC,EAAnD,OAAO,aAAA,EAAE,UAAU,gBAAgC,CAAC;QAC5D,IAAM,QAAQ,GAAkB,UAAC,KAAK,EAAE,MAAM,EAAE,MAAM;YACpD,UAAU,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AI,CAAC,CAAC;IAET,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Integrates the global portal renderer and the debug utilities
4
+ * (if registered).
5
+ */
6
+ export declare const PiralGlobals: React.FC;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { PortalRenderer } from './PortalRenderer';
3
+ import { RegisteredDebug } from './components';
4
+ /**
5
+ * Integrates the global portal renderer and the debug utilities
6
+ * (if registered).
7
+ */
8
+ export const PiralGlobals = () => {
9
+ return (React.createElement(React.Fragment, null,
10
+ React.createElement(PortalRenderer, { id: "root" }),
11
+ React.createElement(RegisteredDebug, null)));
12
+ };
13
+ //# sourceMappingURL=PiralGlobals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PiralGlobals.js","sourceRoot":"","sources":["../../src/components/PiralGlobals.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa,GAAG,EAAE;IACzC,OAAO,CACL;QACE,oBAAC,cAAc,IAAC,EAAE,EAAC,MAAM,GAAG;QAC5B,oBAAC,eAAe,OAAG,CAClB,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { RouteComponentProps, SwitchProps } from 'react-router';
3
+ import { RouteSwitchProps } from '../types';
3
4
  /**
4
5
  * The props used by the PiralRoutes component.
5
6
  */
@@ -8,6 +9,10 @@ export interface RoutesProps extends SwitchProps {
8
9
  * Sets the component for showing the not found page.
9
10
  */
10
11
  NotFound: React.ComponentType<RouteComponentProps>;
12
+ /**
13
+ * Sets the component for actually switching the routes.
14
+ */
15
+ RouteSwitch: React.ComponentType<RouteSwitchProps>;
11
16
  }
12
17
  /**
13
18
  * The component for defining the exclusive routes to be used.
@@ -1,18 +1,13 @@
1
- import { __assign, __rest } from "tslib";
1
+ import { __rest } from "tslib";
2
2
  import * as React from 'react';
3
- import { Route, Switch } from 'react-router';
4
- import { useGlobalState } from '../hooks';
3
+ import { useRoutes } from '../hooks';
5
4
  /**
6
5
  * The component for defining the exclusive routes to be used.
7
6
  */
8
- export var PiralRoutes = function (_a) {
9
- var NotFound = _a.NotFound, props = __rest(_a, ["NotFound"]);
10
- var routes = useGlobalState(function (s) { return s.routes; });
11
- var pages = useGlobalState(function (s) { return s.registry.pages; });
12
- return (React.createElement(Switch, __assign({}, props),
13
- Object.keys(routes).map(function (url) { return (React.createElement(Route, { exact: true, key: url, path: url, component: routes[url] })); }),
14
- Object.keys(pages).map(function (url) { return (React.createElement(Route, { exact: true, key: url, path: url, component: pages[url].component })); }),
15
- React.createElement(Route, { component: NotFound })));
7
+ export const PiralRoutes = (_a) => {
8
+ var { NotFound, RouteSwitch } = _a, props = __rest(_a, ["NotFound", "RouteSwitch"]);
9
+ const paths = useRoutes();
10
+ return React.createElement(RouteSwitch, Object.assign({ NotFound: NotFound, paths: paths }, props));
16
11
  };
17
12
  PiralRoutes.displayName = 'Routes';
18
13
  //# sourceMappingURL=PiralRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAoC,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAY1C;;GAEG;AACH,MAAM,CAAC,IAAM,WAAW,GAA0B,UAAC,EAAsB;IAApB,IAAA,QAAQ,cAAA,EAAK,KAAK,cAApB,YAAsB,CAAF;IACrE,IAAM,MAAM,GAAG,cAAc,CAAC,UA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W,kBAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,IAAM,KAAK,EAAI,CAAC;AACtE,CAAC,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface PiralSuspenseProps {
3
+ children?: React.ReactNode;
4
+ }
5
+ export declare const PiralSuspense: React.FC<PiralSuspenseProps>;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { RegisteredErrorInfo, RegisteredLoadingIndicator } from './components';
3
+ import { useGlobalState } from '../hooks';
4
+ export const PiralSuspense = ({ children }) => {
5
+ const { error, loading } = useGlobalState((m) => m.app);
6
+ return error ? (React.createElement(RegisteredErrorInfo, { type: "loading", error: error })) : loading ? (React.createElement(RegisteredLoadingIndicator, null)) : (React.createElement(React.Fragment, null, children));
7
+ };
8
+ //# sourceMappingURL=PiralSuspense.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PiralSuspense.js","sourceRoot":"","sources":["../../src/components/PiralSuspense.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM1C,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1E,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAExD,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,mBAAmB,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,GAAI,CACrD,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,oBAAC,0BAA0B,OAAG,CAC/B,CAAC,CAAC,CAAC,CACF,0CAAG,QAAQ,CAAI,CAChB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,11 +1,20 @@
1
1
  import * as React from 'react';
2
+ import { LayoutBreakpoints } from '../types';
2
3
  /**
3
4
  * The props for the PiralView component.
4
5
  */
5
6
  export interface PiralViewProps {
7
+ /**
8
+ * The custom breakpoints for the different layout modi.
9
+ */
10
+ breakpoints?: LayoutBreakpoints;
11
+ /**
12
+ * The extra content.
13
+ */
14
+ children: React.ReactNode;
6
15
  }
7
16
  /**
8
17
  * The component responsible for the generic view of the application.
9
- * This includes the global providers, the used Router, the current content and some convenience.
18
+ * This includes the used the current content and some convenience.
10
19
  */
11
20
  export declare const PiralView: React.FC<PiralViewProps>;
@@ -1,32 +1,19 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
- import { StaticRouter } from 'react-router';
4
- import { PiralError, PiralRouter, PiralLoadingIndicator, PiralLayout, PiralDebug } from './components';
2
+ import { PiralGlobals } from './PiralGlobals';
5
3
  import { PiralRoutes } from './PiralRoutes';
6
- import { useGlobalState } from '../hooks';
7
- var NotFound = function (props) { return React.createElement(PiralError, __assign({ type: "not_found" }, props)); };
8
- var PiralContent = function () {
9
- var _a = useGlobalState(function (m) { return m.app; }), error = _a.error, loading = _a.loading, layout = _a.layout;
10
- return error ? (React.createElement(PiralError, { type: "loading", error: error })) : loading ? (React.createElement(PiralLoadingIndicator, null)) : (React.createElement(PiralLayout, { currentLayout: layout },
11
- React.createElement(PiralRoutes, { NotFound: NotFound })));
12
- };
13
- var Router = typeof window === 'undefined' ? function (props) { return React.createElement(StaticRouter, __assign({ location: "/" }, props)); } : PiralRouter;
14
- var PiralProvider = function (_a) {
15
- var children = _a.children;
16
- var provider = useGlobalState(function (m) { return m.provider; }) || React.Fragment;
17
- return React.createElement(provider, undefined, children);
18
- };
4
+ import { PiralSuspense } from './PiralSuspense';
5
+ import { ResponsiveLayout } from './ResponsiveLayout';
6
+ import { RegisteredErrorInfo, RegisteredRouteSwitch, RegisteredLayout } from './components';
7
+ const NotFound = (props) => React.createElement(RegisteredErrorInfo, Object.assign({ type: "not_found" }, props));
19
8
  /**
20
9
  * The component responsible for the generic view of the application.
21
- * This includes the global providers, the used Router, the current content and some convenience.
10
+ * This includes the used the current content and some convenience.
22
11
  */
23
- export var PiralView = function (_a) {
24
- var children = _a.children;
25
- return (React.createElement(PiralProvider, null,
26
- React.createElement(Router, null,
27
- React.createElement(PiralContent, null),
28
- children,
29
- React.createElement(PiralDebug, null))));
30
- };
12
+ export const PiralView = ({ breakpoints, children }) => (React.createElement(React.Fragment, null,
13
+ React.createElement(PiralGlobals, null),
14
+ React.createElement(PiralSuspense, null,
15
+ React.createElement(ResponsiveLayout, { breakpoints: breakpoints, Layout: RegisteredLayout },
16
+ React.createElement(PiralRoutes, { NotFound: NotFound, RouteSwitch: RegisteredRouteSwitch }))),
17
+ children));
31
18
  PiralView.displayName = 'PiralView';
32
19
  //# sourceMappingURL=PiralView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PiralView.js","sourceRoot":"","sources":["../../src/components/PiralView.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAuB,YAAY,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,qBAAqB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,IAAM,QAAQ,GAAkC,UAAC,KAAK,IAAK,OAAA,oBAAC,UAAU,aAAC,IAAI,EAAC,WAAW,IAAK,KAAK,EAAI,EAA1C,CAA0C,CAAC;AAEtG,IAAM,YAAY,GAAa;IACvB,IAAA,KAA6B,cAAc,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,GAAG,EAAL,CAAK,CAAC,EA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O,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5F,MAAM,QAAQ,GAAkC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,mBAAmB,kBAAC,IAAI,EAAC,WAAW,IAAK,KAAK,EAAI,CAAC;AAgB/G;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAChF;IACE,oBAAC,YAAY,OAAG;IAChB,oBAAC,aAAa;QACZ,oBAAC,gBAAgB,IAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB;YAClE,oBAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,GAAI,CACtD,CACL;IACf,QAAQ,CACR,CACJ,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface PortalRendererProps {
3
+ id: string;
4
+ }
5
+ export declare const PortalRenderer: React.FC<PortalRendererProps>;
@@ -0,0 +1,7 @@
1
+ import { useGlobalState } from '../hooks';
2
+ import { defaultRender, none } from '../utils';
3
+ export const PortalRenderer = ({ id }) => {
4
+ const children = useGlobalState((m) => m.portals[id]) || none;
5
+ return defaultRender(children);
6
+ };
7
+ //# sourceMappingURL=PortalRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalRenderer.js","sourceRoot":"","sources":["../../src/components/PortalRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAM/C,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IACtE,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;IAC9D,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { LayoutBreakpoints } from '../types';
2
+ import { LayoutBreakpoints, LayoutProps } from '../types';
3
3
  /**
4
4
  * The props for the ResponsiveLayout component.
5
5
  */
@@ -8,6 +8,14 @@ export interface ResponsiveLayoutProps {
8
8
  * The individual breakpoints to be used for the different layouts.
9
9
  */
10
10
  breakpoints?: LayoutBreakpoints;
11
+ /**
12
+ * The actual layout component to render to transport.
13
+ */
14
+ Layout: React.ComponentType<LayoutProps>;
15
+ /**
16
+ * The content to display.
17
+ */
18
+ children: React.ReactNode;
11
19
  }
12
20
  /**
13
21
  * The component capable of identifying and switching the currently used layout.
@@ -1,20 +1,12 @@
1
1
  import * as React from 'react';
2
- import { useMedia, useGlobalState, useAction } from '../hooks';
3
- import { defaultLayouts, defaultRender, defaultBreakpoints } from '../utils';
2
+ import { useMedia } from '../hooks';
3
+ import { defaultLayouts, defaultBreakpoints } from '../utils';
4
4
  /**
5
5
  * The component capable of identifying and switching the currently used layout.
6
6
  */
7
- export var ResponsiveLayout = function (_a) {
8
- var _b = _a.breakpoints, breakpoints = _b === void 0 ? defaultBreakpoints : _b, children = _a.children;
9
- var current = useGlobalState(function (m) { return m.app.layout; }) || 'desktop';
10
- var changeTo = useAction('changeLayout');
11
- var selected = useMedia(breakpoints, defaultLayouts, current);
12
- React.useEffect(function () {
13
- if (selected !== current) {
14
- changeTo(selected);
15
- }
16
- }, [selected]);
17
- return defaultRender(children);
7
+ export const ResponsiveLayout = ({ breakpoints = defaultBreakpoints, Layout, children, }) => {
8
+ const selected = useMedia(breakpoints, defaultLayouts, 'desktop');
9
+ return React.createElement(Layout, { currentLayout: selected }, children);
18
10
  };
19
11
  ResponsiveLayout.displayName = 'ResponsiveLayout';
20
12
  //# sourceMappingURL=ResponsiveLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsiveLayout.js","sourceRoot":"","sources":["../../src/components/ResponsiveLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAa7E;;GAEG;AACH,MAAM,CAAC,IAAM,gBAAgB,GAAoC,UAAC,EAA8C;QAA5C,mBAAgC,EAAhC,WAAW,mBAAG,kBAAkB,KAAA,EAAE,QAAQ,cAAA;IAC5G,IAAM,OAAO,GAAG,cAAc,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,GAAG,CAAC,MAAM,EAAZ,CAAY,CAAC,IAAI,SAAS,CAAC;IACjE,IAAM,QAAQ,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAEhE,KAAK,CAAC,SAAS,CAAC;QACd,IAAI,QAAQ,KAAK,OAAO,EAAE;YACxB,QAAQ,CAAC,QAAQ,CAAC,CAAC;SACpB;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC,CAAC;AACF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ResponsiveLayout.js","sourceRoot":"","sources":["../../src/components/ResponsiveLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAqB9D;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAChE,WAAW,GAAG,kBAAkB,EAChC,MAAM,EACN,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAClE,OAAO,oBAAC,MAAM,IAAC,aAAa,EAAE,QAAQ,IAAG,QAAQ,CAAU,CAAC;AAC9D,CAAC,CAAC;AACF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
@@ -1,21 +1,23 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { useGlobalState } from '../hooks';
4
- import { defaultRender } from '../utils';
3
+ import { defaultRender, none } from '../utils';
5
4
  function renderComponent(components, props) {
6
- var name = props.type;
7
- var Component = components[name];
5
+ const name = props.type;
6
+ const Component = components[name];
7
+ if (process.env.NODE_ENV === 'development') {
8
+ React.useEffect(() => console.error('[dev-info] An error occurred in the Piral instance.', props), none);
9
+ }
8
10
  if (!Component) {
9
- var Unknown = components.unknown;
11
+ const Unknown = components.unknown;
10
12
  if (Unknown) {
11
- return React.createElement(Unknown, __assign({}, props, { type: "unknown" }));
13
+ return React.createElement(Unknown, Object.assign({}, props, { type: "unknown" }));
12
14
  }
13
- return defaultRender("Error: " + props.type);
15
+ return defaultRender(`Error: ${props.type}`);
14
16
  }
15
- return React.createElement(Component, __assign({}, props));
17
+ return React.createElement(Component, Object.assign({}, props));
16
18
  }
17
- export var SwitchErrorInfo = function (props) {
18
- var components = useGlobalState(function (m) { return m.errorComponents; });
19
+ export const SwitchErrorInfo = (props) => {
20
+ const components = useGlobalState((m) => m.errorComponents);
19
21
  return renderComponent(components, props);
20
22
  };
21
23
  //# sourceMappingURL=SwitchErrorInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchErrorInfo.js","sourceRoot":"","sources":["../../src/components/SwitchErrorInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,SAAS,eAAe,CACtB,UAAgC,EAChC,KAAmB;IAEnB,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,IAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,CAAC,SAAS,EAAE;QACd,IAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAEnC,IAAI,OAAO,EAAE;YACX,OAAO,oBAAC,OAAO,eAAM,KAAa,IAAE,IAAI,EAAC,SAAS,IAAG,CAAC;SACvD;QAED,OAAO,aAAa,CAAC,YAAU,KAAK,CAAC,IAAM,CAAC,CAAC;KAC9C;IAED,OAAO,oBAAC,SAAS,eAAM,KAAa,EAAI,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,IAAM,eAAe,GAA6B,UAAC,KAAK;IAC7D,IAAM,UAAU,GAAG,cAAc,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,eAAe,EAAjB,CAAiB,CAAC,CAAC;IAC5D,OAAO,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAC"}
1
+ {"version":3,"file":"SwitchErrorInfo.js","sourceRoot":"","sources":["../../src/components/SwitchErrorInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAG/C,SAAS,eAAe,CACtB,UAAgC,EAChC,KAAmB;IAEnB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,qDAAqD,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;KAC1G;IAED,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAEnC,IAAI,OAAO,EAAE;YACX,OAAO,oBAAC,OAAO,oBAAM,KAAa,IAAE,IAAI,EAAC,SAAS,IAAG,CAAC;SACvD;QAED,OAAO,aAAa,CAAC,UAAU,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,oBAAC,SAAS,oBAAM,KAAa,EAAI,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAA6B,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5D,OAAO,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAC"}
@@ -1,28 +1,40 @@
1
1
  import * as React from 'react';
2
- import { ComponentsState, ErrorInfoProps, LoadingIndicatorProps, RouterProps, LayoutProps } from '../types';
2
+ import { ComponentsState } from '../types';
3
+ /**
4
+ * Gets a registered layout component by its name.
5
+ * This will always return a valid component. If nothing is found
6
+ * then the returned component will just return null.
7
+ * @param name The name of the registered layout component.
8
+ * @returns The registered layout component or an empty stub component.
9
+ */
3
10
  export declare function getPiralComponent<TKey extends keyof ComponentsState>(name: TKey): ComponentsState[TKey];
4
11
  /**
5
12
  * Gets the currently registered ErrorInfo component.
6
13
  * By default the DefaultErrorInfo component is used.
7
14
  */
8
- export declare const PiralError: React.ComponentType<ErrorInfoProps>;
15
+ export declare const RegisteredErrorInfo: React.ComponentType<import("../types").ErrorInfoProps>;
9
16
  /**
10
17
  * Gets the currently registered LoadingIndicator component.
11
18
  * By default only Loading is rendered.
12
19
  */
13
- export declare const PiralLoadingIndicator: React.ComponentType<LoadingIndicatorProps>;
20
+ export declare const RegisteredLoadingIndicator: React.ComponentType<import("../types").LoadingIndicatorProps>;
14
21
  /**
15
22
  * Gets the currently registered Router component.
16
23
  * By default the BrowserRouter is used.
17
24
  */
18
- export declare const PiralRouter: React.ComponentType<RouterProps>;
25
+ export declare const RegisteredRouter: React.ComponentType<import("../types").RouterProps>;
26
+ /**
27
+ * Gets the currently registered Route Switch component.
28
+ * By default the DefaultRouteSwitch component is used.
29
+ */
30
+ export declare const RegisteredRouteSwitch: React.ComponentType<import("../types").RouteSwitchProps>;
19
31
  /**
20
32
  * Gets the currently registered Layout component.
21
33
  * By default the children are rendered.
22
34
  */
23
- export declare const PiralLayout: React.ComponentType<LayoutProps>;
35
+ export declare const RegisteredLayout: React.ComponentType<import("../types").LayoutProps>;
24
36
  /**
25
37
  * Gets the currently registered Debug component.
26
38
  * By default nothing is used.
27
39
  */
28
- export declare const PiralDebug: React.ComponentType;
40
+ export declare const RegisteredDebug: React.ComponentType;
@@ -1,35 +1,47 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { useGlobalState } from '../hooks';
3
+ /**
4
+ * Gets a registered layout component by its name.
5
+ * This will always return a valid component. If nothing is found
6
+ * then the returned component will just return null.
7
+ * @param name The name of the registered layout component.
8
+ * @returns The registered layout component or an empty stub component.
9
+ */
4
10
  export function getPiralComponent(name) {
5
- return function (props) {
6
- var Component = useGlobalState(function (s) { return s.components[name]; });
7
- return Component ? React.createElement(Component, __assign({}, props)) : null;
11
+ return (props) => {
12
+ const Component = useGlobalState((s) => s.components[name]);
13
+ // tslint:disable-next-line:no-null-keyword
14
+ return Component ? React.createElement(Component, Object.assign({}, props)) : null;
8
15
  };
9
16
  }
10
17
  /**
11
18
  * Gets the currently registered ErrorInfo component.
12
19
  * By default the DefaultErrorInfo component is used.
13
20
  */
14
- export var PiralError = getPiralComponent('ErrorInfo');
21
+ export const RegisteredErrorInfo = getPiralComponent('ErrorInfo');
15
22
  /**
16
23
  * Gets the currently registered LoadingIndicator component.
17
24
  * By default only Loading is rendered.
18
25
  */
19
- export var PiralLoadingIndicator = getPiralComponent('LoadingIndicator');
26
+ export const RegisteredLoadingIndicator = getPiralComponent('LoadingIndicator');
20
27
  /**
21
28
  * Gets the currently registered Router component.
22
29
  * By default the BrowserRouter is used.
23
30
  */
24
- export var PiralRouter = getPiralComponent('Router');
31
+ export const RegisteredRouter = getPiralComponent('Router');
32
+ /**
33
+ * Gets the currently registered Route Switch component.
34
+ * By default the DefaultRouteSwitch component is used.
35
+ */
36
+ export const RegisteredRouteSwitch = getPiralComponent('RouteSwitch');
25
37
  /**
26
38
  * Gets the currently registered Layout component.
27
39
  * By default the children are rendered.
28
40
  */
29
- export var PiralLayout = getPiralComponent('Layout');
41
+ export const RegisteredLayout = getPiralComponent('Layout');
30
42
  /**
31
43
  * Gets the currently registered Debug component.
32
44
  * By default nothing is used.
33
45
  */
34
- export var PiralDebug = getPiralComponent('Debug');
46
+ export const RegisteredDebug = getPiralComponent('Debug');
35
47
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,UAAU,iBAAiB,CAAqC,IAAU;IAC9E,OAAO,UAAC,KAAK;QACX,IAAM,SAAS,GA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