piral-core 1.0.0-pre.2296 → 1.0.1-beta.5640

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 +12 -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 -69
  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 +34 -9
  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 -75
  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 +34 -9
  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 +51 -20
  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 -66
  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 +47 -10
  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,41 +1,54 @@
1
- import type { ComponentType, ReactPortal } from 'react';
1
+ import type { ComponentType, ReactPortal, PropsWithChildren } from 'react';
2
2
  import type { RouteComponentProps } from 'react-router';
3
- import type { Atom } from '@dbeining/react-atom';
4
3
  import type { LoadPiletsOptions } from 'piral-base';
4
+ import type { UseBoundStore } from 'zustand';
5
5
  import type { Dict, Without } from './common';
6
- import type { LayoutType } from './layout';
6
+ import type { NavigationApi } from './navigation';
7
7
  import type { SharedDataItem, DataStoreTarget } from './data';
8
8
  import type { PiralCustomActions, PiralCustomState, PiralCustomRegistryState, PiralCustomComponentsState } from './custom';
9
- import type { PiletMetadata, EventEmitter, Pilet, BaseComponentProps, PageComponentProps, ExtensionComponentProps, PiletsBag, PiralPageMeta } from './api';
10
- import type { ComponentConverters, LoadingIndicatorProps, ErrorInfoProps, RouterProps, LayoutProps, Errors } from './components';
9
+ import type { EventEmitter, Pilet, BaseComponentProps, PageComponentProps, ExtensionComponentProps, PiletsBag, PiralPageMeta, PiletEntry } from './api';
10
+ import type { ComponentConverters, LoadingIndicatorProps, ErrorInfoProps, RouterProps, LayoutProps, Errors, RouteSwitchProps } from './components';
11
11
  export interface StateDispatcher<TState> {
12
12
  (state: TState): Partial<TState>;
13
13
  }
14
- declare module './components' {
15
- interface ComponentContext {
16
- state: Atom<GlobalState>;
17
- }
18
- }
19
- export declare type WrappedComponent<TProps> = ComponentType<Without<TProps, keyof BaseComponentProps>>;
14
+ export type WrappedComponent<TProps> = ComponentType<PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
20
15
  /**
21
16
  * The base type for pilet component registration in the global state context.
22
17
  */
23
18
  export interface BaseRegistration {
19
+ /**
20
+ * The pilet registering the component.
21
+ */
24
22
  pilet: string;
25
23
  }
26
24
  /**
27
25
  * The interface modeling the registration of a pilet page component.
28
26
  */
29
27
  export interface PageRegistration extends BaseRegistration {
28
+ /**
29
+ * The registered page component.
30
+ */
30
31
  component: WrappedComponent<PageComponentProps>;
32
+ /**
33
+ * The page's associated metadata.
34
+ */
31
35
  meta: PiralPageMeta;
32
36
  }
33
37
  /**
34
38
  * The interface modeling the registration of a pilet extension component.
35
39
  */
36
40
  export interface ExtensionRegistration extends BaseRegistration {
41
+ /**
42
+ * The wrapped registered extension component.
43
+ */
37
44
  component: WrappedComponent<ExtensionComponentProps<string>>;
45
+ /**
46
+ * The original extension component that has been registered.
47
+ */
38
48
  reference: any;
49
+ /**
50
+ * The default params (i.e., meta) of the extension.
51
+ */
39
52
  defaults: any;
40
53
  }
41
54
  /**
@@ -58,6 +71,10 @@ export interface ComponentsState extends PiralCustomComponentsState {
58
71
  * The layout used for pages.
59
72
  */
60
73
  Layout: ComponentType<LayoutProps>;
74
+ /**
75
+ * The route switch used for determining the route registration.
76
+ */
77
+ RouteSwitch: ComponentType<RouteSwitchProps>;
61
78
  /**
62
79
  * A component that can be used for debugging purposes.
63
80
  */
@@ -67,10 +84,6 @@ export interface ComponentsState extends PiralCustomComponentsState {
67
84
  * The Piral global app sub-state container for app information.
68
85
  */
69
86
  export interface AppState {
70
- /**
71
- * Information for the layout computation.
72
- */
73
- layout: LayoutType;
74
87
  /**
75
88
  * Gets if the application is currently performing a background loading
76
89
  * activity, e.g., for loading modules asynchronously or fetching
@@ -99,7 +112,7 @@ export interface RegistryState extends PiralCustomRegistryState {
99
112
  */
100
113
  wrappers: Dict<ComponentType<any>>;
101
114
  }
102
- export declare type ErrorComponentsState = {
115
+ export type ErrorComponentsState = {
103
116
  [P in keyof Errors]?: ComponentType<Errors[P]>;
104
117
  };
105
118
  /**
@@ -125,7 +138,7 @@ export interface GlobalState extends PiralCustomState {
125
138
  /**
126
139
  * Gets the loaded modules.
127
140
  */
128
- modules: Array<PiletMetadata>;
141
+ modules: Array<Pilet>;
129
142
  /**
130
143
  * The foreign component portals to render.
131
144
  */
@@ -152,7 +165,7 @@ export interface PiralAction<T extends (...args: any) => any> {
152
165
  /**
153
166
  * A subset of the available app actions in Piral.
154
167
  */
155
- export declare type PiralDefineActions = Partial<{
168
+ export type PiralDefineActions = Partial<{
156
169
  [P in keyof PiralActions]: PiralAction<PiralActions[P]>;
157
170
  }>;
158
171
  /**
@@ -167,10 +180,22 @@ export interface PiralActions extends PiralCustomActions {
167
180
  */
168
181
  initialize(loading: boolean, error: Error | undefined, modules: Array<Pilet>): void;
169
182
  /**
170
- * Injects a pilet at runtime - removes the pilet from registry first if available.
183
+ * Injects an evaluated pilet at runtime - removes the pilet from registry first if available.
171
184
  * @param pilet The pilet to be injected.
185
+ * @returns The injected pilet.
186
+ */
187
+ injectPilet(pilet: Pilet): Pilet;
188
+ /**
189
+ * Adds a pilet at runtime by loading it, evaluating it, and then injecting it.
190
+ * @param pilet The pilet to be added.
191
+ * @returns The promise indicating when the pilet was fully added.
192
+ */
193
+ addPilet(pilet: PiletEntry): Promise<void>;
194
+ /**
195
+ * Removes a pilet by unloading it and deleting all component registrations.
196
+ * @param name The name of the pilet to remove.
172
197
  */
173
- injectPilet(pilet: Pilet): void;
198
+ removePilet(name: string): Promise<void>;
174
199
  /**
175
200
  * Defines a single action for Piral.
176
201
  * @param actionName The name of the action to define.
@@ -199,11 +224,6 @@ export interface PiralActions extends PiralCustomActions {
199
224
  * @param expiration The time for when to dispose the shared item.
200
225
  */
201
226
  tryWriteDataItem(name: string, value: any, owner: string, target: DataStoreTarget, expiration: number): boolean;
202
- /**
203
- * Performs a layout change.
204
- * @param current The layout to take.
205
- */
206
- changeLayout(current: LayoutType): void;
207
227
  /**
208
228
  * Registers a new route to be resolved.
209
229
  * @param route The route to register.
@@ -244,7 +264,9 @@ export interface PiralActions extends PiralCustomActions {
244
264
  * @param path The name of the component.
245
265
  * @param component The component to use for rendering.
246
266
  */
247
- setRoute<T = {}>(path: string, component: ComponentType<RouteComponentProps<T>>): void;
267
+ setRoute<T extends {
268
+ [K in keyof T]?: string;
269
+ } = {}>(path: string, component: ComponentType<RouteComponentProps<T>>): void;
248
270
  /**
249
271
  * Includes a new provider as a sub-provider to the current provider.
250
272
  * @param provider The provider to include.
@@ -261,6 +283,19 @@ export interface PiralActions extends PiralCustomActions {
261
283
  * @param entry The child to render.
262
284
  */
263
285
  showPortal(id: string, entry: ReactPortal): void;
286
+ /**
287
+ * Hides the provided portal in the rendering pipeline.
288
+ * @param id The id of the portal to use.
289
+ * @param entry The child to remove.
290
+ */
291
+ hidePortal(id: string, entry: ReactPortal): void;
292
+ /**
293
+ * Updates the provided portal in the rendering pipeline.
294
+ * @param id The id of the portal to use.
295
+ * @param current The currently displayed child.
296
+ * @param next The updated child that should be displayed.
297
+ */
298
+ updatePortal(id: string, current: ReactPortal, next: ReactPortal): void;
264
299
  /**
265
300
  * Dispatches a state change.
266
301
  * @param update The update function creating a new state.
@@ -281,7 +316,7 @@ export interface GlobalStateContext extends PiralActions, EventEmitter {
281
316
  * The global state context atom.
282
317
  * Changes to the state should always be dispatched via the `dispatch` action.
283
318
  */
284
- state: Atom<GlobalState>;
319
+ state: UseBoundStore<GlobalState>;
285
320
  /**
286
321
  * The API objects created for the loaded pilets.
287
322
  */
@@ -290,6 +325,10 @@ export interface GlobalStateContext extends PiralActions, EventEmitter {
290
325
  * The available component converters.
291
326
  */
292
327
  converters: ComponentConverters<any>;
328
+ /**
329
+ * The navigation manager for the whole instance.
330
+ */
331
+ navigation: NavigationApi;
293
332
  /**
294
333
  * The initial options.
295
334
  */
@@ -55,7 +55,7 @@ export interface PiralStoreDataEvent<TValue = any> {
55
55
  */
56
56
  expires: number;
57
57
  }
58
- declare module 'piral-base/lib/types' {
58
+ declare module 'piral-base/lib/types/api' {
59
59
  interface PiralEventMap extends PiralCustomEventMap {
60
60
  'store-data': PiralStoreDataEvent;
61
61
  }
@@ -1 +1 @@
1
- export declare function compare<T>(a: T, b: T): boolean;
1
+ export declare function isSame<T>(a: T, b: T): boolean;
@@ -1,29 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compare = void 0;
3
+ exports.isSame = void 0;
4
4
  function compareObjects(a, b) {
5
- for (var i in a) {
5
+ for (const i in a) {
6
6
  if (!(i in b)) {
7
7
  return false;
8
8
  }
9
9
  }
10
- for (var i in b) {
11
- if (!compare(a[i], b[i])) {
10
+ for (const i in b) {
11
+ if (!isSame(a[i], b[i])) {
12
12
  return false;
13
13
  }
14
14
  }
15
15
  return true;
16
16
  }
17
- function compare(a, b) {
17
+ function compareArrays(a, b) {
18
+ const l = a.length;
19
+ if (l === b.length) {
20
+ for (let i = 0; i < l; i++) {
21
+ if (!isSame(a[i], b[i])) {
22
+ return false;
23
+ }
24
+ }
25
+ return true;
26
+ }
27
+ return false;
28
+ }
29
+ function isSame(a, b) {
18
30
  if (a !== b) {
19
- var ta = typeof a;
20
- var tb = typeof b;
31
+ const ta = typeof a;
32
+ const tb = typeof b;
21
33
  if (ta === tb && ta === 'object' && a && b) {
22
- return compareObjects(a, b);
34
+ if (Array.isArray(a) && Array.isArray(b)) {
35
+ return compareArrays(a, b);
36
+ }
37
+ else {
38
+ return compareObjects(a, b);
39
+ }
23
40
  }
24
41
  return false;
25
42
  }
26
43
  return true;
27
44
  }
28
- exports.compare = compare;
45
+ exports.isSame = isSame;
29
46
  //# sourceMappingURL=compare.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/utils/compare.ts"],"names":[],"mappings":";;;AAAA,SAAS,cAAc,CAAC,CAAM,EAAE,CAAM;IACpC,KAAK,IAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;YACb,OAAO,KAAK,CAAC;SACd;KACF;IAED,KAAK,IAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACxB,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,OAAO,CAAI,CAAI,EAAE,CAAI;IACnC,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,IAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QACpB,IAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QAEpB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC7B;QAED,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,0BAaC"}
1
+ {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/utils/compare.ts"],"names":[],"mappings":";;;AAAA,SAAS,cAAc,CAAC,CAAM,EAAE,CAAM;IACpC,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;YACb,OAAO,KAAK,CAAC;SACd;KACF;IAED,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa,CAAC,CAAa,EAAE,CAAa;IACjD,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IAEnB,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gBACvB,OAAO,KAAK,CAAC;aACd;SACF;QAED,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,MAAM,CAAI,CAAI,EAAE,CAAI;IAClC,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QACpB,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QAEpB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBACxC,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC5B;iBAAM;gBACL,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC7B;SACF;QAED,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAjBD,wBAiBC"}
package/lib/utils/data.js CHANGED
@@ -1,23 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDataExpiration = exports.createDataOptions = exports.createDataView = void 0;
4
- var defaultTarget = 'memory';
4
+ const defaultTarget = 'memory';
5
5
  function createDataView(data) {
6
- var proxyName = 'Proxy';
6
+ const proxyName = 'Proxy';
7
7
  return (window[proxyName] &&
8
8
  new Proxy(data, {
9
- get: function (target, name) {
10
- var item = target[name];
9
+ get(target, name) {
10
+ const item = target[name];
11
11
  return item && item.value;
12
12
  },
13
- set: function (_target, _name, _value) {
13
+ set(_target, _name, _value) {
14
14
  return true;
15
15
  },
16
16
  }));
17
17
  }
18
18
  exports.createDataView = createDataView;
19
- function createDataOptions(options) {
20
- if (options === void 0) { options = defaultTarget; }
19
+ function createDataOptions(options = defaultTarget) {
21
20
  if (typeof options === 'string') {
22
21
  return {
23
22
  target: options,
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/utils/data.ts"],"names":[],"mappings":";;;AAEA,IAAM,aAAa,GAAoB,QAAQ,CAAC;AAEhD,SAAgB,cAAc,CAAC,IAA0B;IACvD,IAAM,SAAS,GAAG,OAAO,CAAC;IAC1B,OAAO,CACL,MAAM,CAAC,SAAS,CAAC;QACjB,IAAI,KAAK,CAAC,IAAI,EAAE;YACd,GAAG,EAAH,UAAI,MAAM,EAAE,IAAI;gBACd,IAAM,IAAI,GAAG,MAAM,CAAC,IAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC;YAC5B,CAAC;YACD,GAAG,YAAC,OAAO,EAAE,KAAK,EAAE,MAAM;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CACH,CAAC;AACJ,CAAC;AAdD,wCAcC;AAED,SAAgB,iBAAiB,CAAC,OAAyC;IAAzC,wBAAA,EAAA,uBAAyC;IACzE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO;YACL,MAAM,EAAE,OAAO;SAChB,CAAC;KACH;SAAM,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC5E,OAAO,OAAO,CAAC;KAChB;SAAM;QACL,OAAO;YACL,MAAM,EAAE,aAAa;SACt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KAAK,QAAQ,EAAE;QAC/B,OAAO,OAAO,CAAC;KAChB;SAAM,IAAI,OAAO,YAAY,IAAI,EAAE;QAClC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;IAED,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AARD,8CAQC"}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import type { ExtensionComponentProps, WrappedComponent } from '../types';
3
+ /**
4
+ * Transforms the given component to an extension component.
5
+ * @param Component The component to transform.
6
+ * @returns The extension component (receiving its props via params).
7
+ */
8
+ export declare function toExtension<T>(Component: React.ComponentType<T>): WrappedComponent<ExtensionComponentProps<T>>;
9
+ /**
10
+ * Reactifies the list of child nodes to a React Node by removing the
11
+ * nodes from the DOM and carrying it in a React Node, where it would be
12
+ * attached at a slot.
13
+ * @param childNodes The child nodes to reactify.
14
+ * @returns The React Node.
15
+ */
16
+ export declare function reactifyContent(childNodes: NodeListOf<ChildNode>): React.ReactNode;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reactifyContent = exports.toExtension = void 0;
4
+ const React = require("react");
5
+ function removeAll(nodes) {
6
+ nodes.forEach((node) => node.remove());
7
+ }
8
+ const SlotCarrier = ({ nodes }) => {
9
+ const host = React.useRef();
10
+ React.useEffect(() => {
11
+ var _a;
12
+ (_a = host.current) === null || _a === void 0 ? void 0 : _a.append(...nodes);
13
+ return () => removeAll(nodes);
14
+ }, [nodes]);
15
+ if (nodes.length) {
16
+ return React.createElement("piral-slot", { ref: host });
17
+ }
18
+ return null;
19
+ };
20
+ /**
21
+ * Transforms the given component to an extension component.
22
+ * @param Component The component to transform.
23
+ * @returns The extension component (receiving its props via params).
24
+ */
25
+ function toExtension(Component) {
26
+ return (props) => React.createElement(Component, Object.assign({}, props.params));
27
+ }
28
+ exports.toExtension = toExtension;
29
+ /**
30
+ * Reactifies the list of child nodes to a React Node by removing the
31
+ * nodes from the DOM and carrying it in a React Node, where it would be
32
+ * attached at a slot.
33
+ * @param childNodes The child nodes to reactify.
34
+ * @returns The React Node.
35
+ */
36
+ function reactifyContent(childNodes) {
37
+ const nodes = Array.prototype.filter.call(childNodes, Boolean);
38
+ removeAll(nodes);
39
+ return React.createElement(SlotCarrier, { nodes: nodes });
40
+ }
41
+ exports.reactifyContent = reactifyContent;
42
+ //# sourceMappingURL=extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/utils/extension.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAI/B,SAAS,SAAS,CAAC,KAAuB;IACxC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACzC,CAAC;AAMD,MAAM,WAAW,GAA+B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,EAAmB,CAAC;IAE7C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;;QACnB,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;QAC/B,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,IAAI,KAAK,CAAC,MAAM,EAAE;QAChB,OAAO,oCAAY,GAAG,EAAE,IAAI,GAAI,CAAC;KAClC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;;;GAIG;AACH,SAAgB,WAAW,CAAI,SAAiC;IAC9D,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,SAAS,oBAAK,KAAK,CAAC,MAAM,EAAI,CAAC;AACpD,CAAC;AAFD,kCAEC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,UAAiC;IAC/D,MAAM,KAAK,GAAqB,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACjF,SAAS,CAAC,KAAK,CAAC,CAAC;IACjB,OAAO,oBAAC,WAAW,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AACvC,CAAC;AAJD,0CAIC"}
@@ -1,6 +1,11 @@
1
- import { ComponentType } from 'react';
1
+ import { ComponentType, ReactPortal } from 'react';
2
2
  import { GlobalStateContext, ForeignComponent } from '../types';
3
+ export declare const extensionName = "piral-extension";
4
+ export declare const portalName = "piral-portal";
5
+ export declare const slotName = "piral-slot";
6
+ export declare function attachDomPortal<TProps>(id: string, context: GlobalStateContext, element: HTMLElement | ShadowRoot, component: ComponentType<TProps>, props: TProps): [string, ReactPortal];
7
+ export declare function changeDomPortal<TProps>(id: string, current: ReactPortal, context: GlobalStateContext, element: HTMLElement | ShadowRoot, component: ComponentType<TProps>, props: TProps): [string, ReactPortal];
3
8
  export declare function convertComponent<T extends {
4
9
  type: string;
5
10
  }, U>(converter: (component: T) => ForeignComponent<U>, component: T): ForeignComponent<U>;
6
- export declare function renderInDom<TProps>(context: GlobalStateContext, element: HTMLElement | ShadowRoot, component: ComponentType<TProps>, props: TProps): string;
11
+ export declare function renderInDom<TProps>(context: GlobalStateContext, element: HTMLElement | ShadowRoot, component: ComponentType<TProps>, props: TProps): [string, ReactPortal];
@@ -1,28 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderInDom = exports.convertComponent = void 0;
4
- var react_1 = require("react");
5
- var react_dom_1 = require("react-dom");
3
+ exports.renderInDom = exports.convertComponent = exports.changeDomPortal = exports.attachDomPortal = exports.slotName = exports.portalName = exports.extensionName = void 0;
4
+ const react_1 = require("react");
5
+ const react_dom_1 = require("react-dom");
6
+ exports.extensionName = 'piral-extension';
7
+ exports.portalName = 'piral-portal';
8
+ exports.slotName = 'piral-slot';
9
+ function attachDomPortal(id, context, element, component, props) {
10
+ const portal = (0, react_dom_1.createPortal)((0, react_1.createElement)(component, props), element);
11
+ context.showPortal(id, portal);
12
+ return [id, portal];
13
+ }
14
+ exports.attachDomPortal = attachDomPortal;
15
+ function changeDomPortal(id, current, context, element, component, props) {
16
+ const next = (0, react_dom_1.createPortal)((0, react_1.createElement)(component, props), element);
17
+ context.updatePortal(id, current, next);
18
+ return [id, next];
19
+ }
20
+ exports.changeDomPortal = changeDomPortal;
6
21
  function convertComponent(converter, component) {
7
22
  if (typeof converter !== 'function') {
8
- throw new Error("No converter for component of type \"" + component.type + "\" registered.");
23
+ throw new Error(`No converter for component of type "${component.type}" registered.`);
9
24
  }
10
25
  return converter(component);
11
26
  }
12
27
  exports.convertComponent = convertComponent;
13
28
  function renderInDom(context, element, component, props) {
14
- var portalId = 'data-portal-id';
15
- var parent = element;
29
+ const portalId = 'pid';
30
+ let parent = element;
16
31
  while (parent) {
17
- if (parent instanceof Element && parent.hasAttribute(portalId)) {
18
- var portal = react_dom_1.createPortal(react_1.createElement(component, props), element);
19
- var id = parent.getAttribute(portalId);
20
- context.showPortal(id, portal);
21
- return id;
32
+ if (parent instanceof Element && parent.localName === exports.portalName && parent.hasAttribute(portalId)) {
33
+ const id = parent.getAttribute(portalId);
34
+ return attachDomPortal(id, context, element, component, props);
22
35
  }
23
36
  parent = parent.parentNode || parent.host;
24
37
  }
25
- return undefined;
38
+ return attachDomPortal('root', context, element, component, props);
26
39
  }
27
40
  exports.renderInDom = renderInDom;
28
41
  //# sourceMappingURL=foreign.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"foreign.js","sourceRoot":"","sources":["../../src/utils/foreign.ts"],"names":[],"mappings":";;;AAAA,+BAAqD;AACrD,uCAAyC;AAGzC,SAAgB,gBAAgB,CAC9B,SAAgD,EAChD,SAAY;IAEZ,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,0CAAuC,SAAS,CAAC,IAAI,mBAAe,CAAC,CAAC;KACvF;IAED,OAAO,SAAS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lib/utils/guid.js CHANGED
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildName = exports.generateId = void 0;
4
4
  function rand(c) {
5
- var r = (Math.random() * 16) | 0;
6
- var v = c === 'x' ? r : (r & 0x3) | 0x8;
5
+ const r = (Math.random() * 16) | 0;
6
+ const v = c === 'x' ? r : (r & 0x3) | 0x8;
7
7
  return v.toString(16);
8
8
  }
9
9
  function generateId() {
@@ -11,7 +11,7 @@ function generateId() {
11
11
  }
12
12
  exports.generateId = generateId;
13
13
  function buildName(prefix, name) {
14
- return prefix + "://" + name;
14
+ return `${prefix}://${name}`;
15
15
  }
16
16
  exports.buildName = buildName;
17
17
  //# sourceMappingURL=guid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"guid.js","sourceRoot":"","sources":["../../src/utils/guid.ts"],"names":[],"mappings":";;;AAAA,SAAS,IAAI,CAAC,CAAY;IACxB,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACnC,IAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC;AAFD,gCAEC;AAED,SAAgB,SAAS,CAAC,MAAc,EAAE,IAAqB;IAC7D,OAAU,MAAM,WAAM,IAAM,CAAC;AAC/B,CAAC;AAFD,8BAEC"}
1
+ {"version":3,"file":"guid.js","sourceRoot":"","sources":["../../src/utils/guid.ts"],"names":[],"mappings":";;;AAAA,SAAS,IAAI,CAAC,CAAY;IACxB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC;AAFD,gCAEC;AAED,SAAgB,SAAS,CAAC,MAAc,EAAE,IAAqB;IAC7D,OAAO,GAAG,MAAM,MAAM,IAAI,EAAE,CAAC;AAC/B,CAAC;AAFD,8BAEC"}
@@ -1,13 +1,16 @@
1
1
  export declare const removeIndicator: any;
2
- export declare function prependItem<T>(items: Array<T>, item: T): T[];
3
- export declare function appendItem<T>(items: Array<T>, item: T): T[];
4
- export declare function prependItems<T>(items: Array<T>, newItems: Array<T>): T[];
5
- export declare function appendItems<T>(items: Array<T>, newItems: Array<T>): T[];
6
- export declare function excludeItem<T>(items: Array<T>, item: T): T[];
7
- export declare function includeItem<T>(items: Array<T>, item: T): T[];
8
- export declare function replaceOrAddItem<T>(items: Array<T>, item: T, predicate: (item: T) => boolean): T[];
2
+ export declare const none: any[];
3
+ export declare const noop: () => void;
4
+ export declare function prependItem<T>(items: Array<T>, item: T): any[];
5
+ export declare function appendItem<T>(items: Array<T>, item: T): any[];
6
+ export declare function prependItems<T>(items: Array<T>, newItems: Array<T>): any[];
7
+ export declare function appendItems<T>(items: Array<T>, newItems: Array<T>): any[];
8
+ export declare function excludeItem<T>(items: Array<T>, item: T): any[];
9
+ export declare function includeItem<T>(items: Array<T>, item: T): any[];
10
+ export declare function replaceOrAddItem<T>(items: Array<T>, item: T, predicate: (item: T) => boolean): any[];
9
11
  export declare function removeNested<T, U = any>(obj: T, predicate: (item: U) => boolean): T;
10
- export declare function excludeOn<T>(items: Array<T>, predicate: (item: T) => boolean): T[];
12
+ export declare function excludeOn<T>(items: Array<T>, predicate: (item: T) => boolean): any[];
11
13
  export declare function updateKey<T, TKey extends keyof T>(obj: T, key: TKey, value: T[TKey]): T;
12
14
  export declare function withKey<T, TKey extends keyof T>(obj: T, key: TKey, value: T[TKey]): T;
13
15
  export declare function withoutKey<T, TKey extends keyof T>(obj: T, key: TKey): T;
16
+ export declare function tryParseJson(content: string): any;
@@ -1,36 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withoutKey = exports.withKey = exports.updateKey = exports.excludeOn = exports.removeNested = exports.replaceOrAddItem = exports.includeItem = exports.excludeItem = exports.appendItems = exports.prependItems = exports.appendItem = exports.prependItem = exports.removeIndicator = void 0;
4
- var tslib_1 = require("tslib");
3
+ exports.tryParseJson = exports.withoutKey = exports.withKey = exports.updateKey = exports.excludeOn = exports.removeNested = exports.replaceOrAddItem = exports.includeItem = exports.excludeItem = exports.appendItems = exports.prependItems = exports.appendItem = exports.prependItem = exports.noop = exports.none = exports.removeIndicator = void 0;
4
+ const tslib_1 = require("tslib");
5
5
  // tslint:disable-next-line
6
6
  exports.removeIndicator = null;
7
+ // to avoid creating unnecessary empty arrays
8
+ exports.none = [];
9
+ // to avoid creating unnecessary empty functions
10
+ const noop = () => { };
11
+ exports.noop = noop;
7
12
  function prependItem(items, item) {
8
- return tslib_1.__spreadArrays([item], (items || []));
13
+ return [item, ...(items || exports.none)];
9
14
  }
10
15
  exports.prependItem = prependItem;
11
16
  function appendItem(items, item) {
12
- return tslib_1.__spreadArrays((items || []), [item]);
17
+ return [...(items || exports.none), item];
13
18
  }
14
19
  exports.appendItem = appendItem;
15
20
  function prependItems(items, newItems) {
16
- return tslib_1.__spreadArrays(newItems, (items || []));
21
+ return [...newItems, ...(items || exports.none)];
17
22
  }
18
23
  exports.prependItems = prependItems;
19
24
  function appendItems(items, newItems) {
20
- return tslib_1.__spreadArrays((items || []), newItems);
25
+ return [...(items || exports.none), ...newItems];
21
26
  }
22
27
  exports.appendItems = appendItems;
23
28
  function excludeItem(items, item) {
24
- return (items || []).filter(function (m) { return m !== item; });
29
+ return (items || exports.none).filter((m) => m !== item);
25
30
  }
26
31
  exports.excludeItem = excludeItem;
27
32
  function includeItem(items, item) {
28
- return prependItem(excludeItem(items, item), item);
33
+ return appendItem(excludeItem(items, item), item);
29
34
  }
30
35
  exports.includeItem = includeItem;
31
36
  function replaceOrAddItem(items, item, predicate) {
32
- var newItems = tslib_1.__spreadArrays((items || []));
33
- for (var i = 0; i < newItems.length; i++) {
37
+ const newItems = [...(items || exports.none)];
38
+ for (let i = 0; i < newItems.length; i++) {
34
39
  if (predicate(newItems[i])) {
35
40
  newItems[i] = item;
36
41
  return newItems;
@@ -41,10 +46,10 @@ function replaceOrAddItem(items, item, predicate) {
41
46
  }
42
47
  exports.replaceOrAddItem = replaceOrAddItem;
43
48
  function removeNested(obj, predicate) {
44
- return Object.keys(obj).reduce(function (entries, key) {
45
- var item = obj[key];
46
- entries[key] = Object.keys(item).reduce(function (all, key) {
47
- var value = item[key];
49
+ return Object.keys(obj).reduce((entries, key) => {
50
+ const item = obj[key];
51
+ entries[key] = Object.keys(item).reduce((all, key) => {
52
+ const value = item[key];
48
53
  if (Array.isArray(value)) {
49
54
  all[key] = excludeOn(value, predicate);
50
55
  }
@@ -58,7 +63,7 @@ function removeNested(obj, predicate) {
58
63
  }
59
64
  exports.removeNested = removeNested;
60
65
  function excludeOn(items, predicate) {
61
- return (items || []).filter(function (m) { return !predicate(m); });
66
+ return (items || exports.none).filter((m) => !predicate(m));
62
67
  }
63
68
  exports.excludeOn = excludeOn;
64
69
  function updateKey(obj, key, value) {
@@ -66,13 +71,21 @@ function updateKey(obj, key, value) {
66
71
  }
67
72
  exports.updateKey = updateKey;
68
73
  function withKey(obj, key, value) {
69
- var _a;
70
- return tslib_1.__assign(tslib_1.__assign({}, obj), (_a = {}, _a[key] = value, _a));
74
+ return Object.assign(Object.assign({}, obj), { [key]: value });
71
75
  }
72
76
  exports.withKey = withKey;
73
77
  function withoutKey(obj, key) {
74
- var _a = obj || {}, _b = key, _ = _a[_b], newObj = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
78
+ const _a = obj || {}, _b = key, _ = _a[_b], newObj = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
75
79
  return newObj;
76
80
  }
77
81
  exports.withoutKey = withoutKey;
82
+ function tryParseJson(content) {
83
+ try {
84
+ return JSON.parse(content);
85
+ }
86
+ catch (_a) {
87
+ return {};
88
+ }
89
+ }
90
+ exports.tryParseJson = tryParseJson;
78
91
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":";;;;AAAA,2BAA2B;AACd,QAAA,eAAe,GAAG,IAAI,CAAC;AAEpC,SAAgB,WAAW,CAAI,KAAe,EAAE,IAAO;IACrD,+BAAQ,IAAI,GAAK,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE;AAClC,CAAC;AAFD,kCAEC;AAED,SAAgB,UAAU,CAAI,KAAe,EAAE,IAAO;IACpD,8BAAW,CAAC,KAAK,IAAI,EAAE,CAAC,GAAE,IAAI,GAAE;AAClC,CAAC;AAFD,gCAEC;AAED,SAAgB,YAAY,CAAI,KAAe,EAAE,QAAkB;IACjE,8BAAW,QAAQ,EAAK,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE;AACzC,CAAC;AAFD,oCAEC;AAED,SAAgB,WAAW,CAAI,KAAe,EAAE,QAAkB;IAChE,8BAAW,CAAC,KAAK,IAAI,EAAE,CAAC,EAAK,QAAQ,EAAE;AACzC,CAAC;AAFD,kCAEC;AAED,SAAgB,WAAW,CAAI,KAAe,EAAE,IAAO;IACrD,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC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