piral-core 1.6.0-beta.7240 → 1.6.0-beta.7244

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 (454) hide show
  1. package/app.codegen +2 -3
  2. package/lib/Piral.js +8 -13
  3. package/lib/Piral.js.map +1 -1
  4. package/lib/PiralContext.js +11 -16
  5. package/lib/PiralContext.js.map +1 -1
  6. package/lib/RootListener.js +8 -13
  7. package/lib/RootListener.js.map +1 -1
  8. package/lib/actions/app.js +19 -30
  9. package/lib/actions/app.js.map +1 -1
  10. package/lib/actions/components.js +9 -16
  11. package/lib/actions/components.js.map +1 -1
  12. package/lib/actions/data.js +7 -15
  13. package/lib/actions/data.js.map +1 -1
  14. package/lib/actions/define.js +2 -7
  15. package/lib/actions/define.js.map +1 -1
  16. package/lib/actions/index.js +6 -9
  17. package/lib/actions/index.js.map +1 -1
  18. package/lib/actions/portal.js +9 -16
  19. package/lib/actions/portal.js.map +1 -1
  20. package/lib/actions/state.js +4 -9
  21. package/lib/actions/state.js.map +1 -1
  22. package/lib/components/ErrorBoundary.js +9 -14
  23. package/lib/components/ErrorBoundary.js.map +1 -1
  24. package/lib/components/ExtensionSlot.js +9 -14
  25. package/lib/components/ExtensionSlot.js.map +1 -1
  26. package/lib/components/ForeignComponentContainer.js +6 -11
  27. package/lib/components/ForeignComponentContainer.js.map +1 -1
  28. package/lib/components/Mediator.js +8 -13
  29. package/lib/components/Mediator.js.map +1 -1
  30. package/lib/components/PiralGlobals.js +6 -11
  31. package/lib/components/PiralGlobals.js.map +1 -1
  32. package/lib/components/PiralRoutes.js +11 -16
  33. package/lib/components/PiralRoutes.js.map +1 -1
  34. package/lib/components/PiralSuspense.js +6 -11
  35. package/lib/components/PiralSuspense.js.map +1 -1
  36. package/lib/components/PiralView.js +13 -18
  37. package/lib/components/PiralView.js.map +1 -1
  38. package/lib/components/PortalRenderer.js +5 -9
  39. package/lib/components/PortalRenderer.js.map +1 -1
  40. package/lib/components/ResponsiveLayout.js +6 -11
  41. package/lib/components/ResponsiveLayout.js.map +1 -1
  42. package/lib/components/SwitchErrorInfo.js +7 -12
  43. package/lib/components/SwitchErrorInfo.js.map +1 -1
  44. package/lib/components/components.js +10 -15
  45. package/lib/components/components.js.map +1 -1
  46. package/lib/components/index.js +12 -15
  47. package/lib/components/index.js.map +1 -1
  48. package/lib/components/wrapComponent.js +12 -17
  49. package/lib/components/wrapComponent.js.map +1 -1
  50. package/lib/createInstance.js +15 -19
  51. package/lib/createInstance.js.map +1 -1
  52. package/lib/defaults/DefaultErrorInfo.js +5 -10
  53. package/lib/defaults/DefaultErrorInfo.js.map +1 -1
  54. package/lib/defaults/DefaultLayout.js +3 -7
  55. package/lib/defaults/DefaultLayout.js.map +1 -1
  56. package/lib/defaults/DefaultLoadingIndicator.js +3 -8
  57. package/lib/defaults/DefaultLoadingIndicator.js.map +1 -1
  58. package/lib/defaults/DefaultRouteSwitch_v5.js +7 -12
  59. package/lib/defaults/DefaultRouteSwitch_v5.js.map +1 -1
  60. package/lib/defaults/DefaultRouteSwitch_v6.js +7 -12
  61. package/lib/defaults/DefaultRouteSwitch_v6.js.map +1 -1
  62. package/lib/defaults/DefaultRouter_v5.js +5 -10
  63. package/lib/defaults/DefaultRouter_v5.js.map +1 -1
  64. package/lib/defaults/DefaultRouter_v6.js +5 -10
  65. package/lib/defaults/DefaultRouter_v6.js.map +1 -1
  66. package/lib/defaults/navigator_none.js +4 -11
  67. package/lib/defaults/navigator_none.js.map +1 -1
  68. package/lib/defaults/navigator_v5.js +9 -17
  69. package/lib/defaults/navigator_v5.js.map +1 -1
  70. package/lib/defaults/navigator_v6.js +9 -17
  71. package/lib/defaults/navigator_v6.js.map +1 -1
  72. package/lib/helpers.js +8 -12
  73. package/lib/helpers.js.map +1 -1
  74. package/lib/hooks/action.js +3 -7
  75. package/lib/hooks/action.js.map +1 -1
  76. package/lib/hooks/actions.js +4 -8
  77. package/lib/hooks/actions.js.map +1 -1
  78. package/lib/hooks/globalState.js +5 -10
  79. package/lib/hooks/globalState.js.map +1 -1
  80. package/lib/hooks/index.js +7 -10
  81. package/lib/hooks/index.js.map +1 -1
  82. package/lib/hooks/media.js +8 -12
  83. package/lib/hooks/media.js.map +1 -1
  84. package/lib/hooks/piletApi.js +5 -9
  85. package/lib/hooks/piletApi.js.map +1 -1
  86. package/lib/hooks/setter.js +5 -9
  87. package/lib/hooks/setter.js.map +1 -1
  88. package/lib/hooks/sharedData.js +3 -7
  89. package/lib/hooks/sharedData.js.map +1 -1
  90. package/lib/index.js +10 -13
  91. package/lib/index.js.map +1 -1
  92. package/lib/modules/api.js +8 -13
  93. package/lib/modules/api.js.map +1 -1
  94. package/lib/modules/core.js +11 -15
  95. package/lib/modules/core.js.map +1 -1
  96. package/lib/modules/dependencies.js +7 -12
  97. package/lib/modules/dependencies.js.map +1 -1
  98. package/lib/modules/element.js +22 -26
  99. package/lib/modules/element.js.map +1 -1
  100. package/lib/modules/index.js +3 -6
  101. package/lib/modules/index.js.map +1 -1
  102. package/lib/setters/SetComponent.js +4 -8
  103. package/lib/setters/SetComponent.js.map +1 -1
  104. package/lib/setters/SetError.js +4 -8
  105. package/lib/setters/SetError.js.map +1 -1
  106. package/lib/setters/SetErrors.js +4 -9
  107. package/lib/setters/SetErrors.js.map +1 -1
  108. package/lib/setters/SetLayout.js +4 -9
  109. package/lib/setters/SetLayout.js.map +1 -1
  110. package/lib/setters/SetProvider.js +4 -8
  111. package/lib/setters/SetProvider.js.map +1 -1
  112. package/lib/setters/SetRedirect.js +5 -9
  113. package/lib/setters/SetRedirect.js.map +1 -1
  114. package/lib/setters/SetRoute.js +4 -8
  115. package/lib/setters/SetRoute.js.map +1 -1
  116. package/lib/setters/index.js +7 -10
  117. package/lib/setters/index.js.map +1 -1
  118. package/lib/state/createActions.js +5 -11
  119. package/lib/state/createActions.js.map +1 -1
  120. package/lib/state/createGlobalState.js +5 -10
  121. package/lib/state/createGlobalState.js.map +1 -1
  122. package/lib/state/index.js +4 -7
  123. package/lib/state/index.js.map +1 -1
  124. package/lib/state/stateContext.js +3 -7
  125. package/lib/state/stateContext.js.map +1 -1
  126. package/lib/state/withApi.js +7 -12
  127. package/lib/state/withApi.js.map +1 -1
  128. package/lib/tools/codegen.js +15 -22
  129. package/lib/tools/codegen.js.map +1 -1
  130. package/lib/tools/debugger.js +3 -7
  131. package/lib/tools/debugger.js.map +1 -1
  132. package/lib/tools/emulator.js +3 -7
  133. package/lib/tools/emulator.js.map +1 -1
  134. package/lib/types/api.js +1 -2
  135. package/lib/types/common.js +1 -2
  136. package/lib/types/components.js +1 -2
  137. package/lib/types/config.js +1 -2
  138. package/lib/types/custom.js +1 -2
  139. package/lib/types/data.js +1 -2
  140. package/lib/types/extension.js +1 -2
  141. package/lib/types/index.js +14 -17
  142. package/lib/types/index.js.map +1 -1
  143. package/lib/types/instance.js +1 -2
  144. package/lib/types/layout.js +1 -2
  145. package/lib/types/navigation.js +1 -2
  146. package/lib/types/plugin.js +1 -2
  147. package/lib/types/state.js +1 -2
  148. package/lib/types/utils.js +1 -2
  149. package/lib/types/web.js +1 -2
  150. package/lib/utils/compare.js +1 -5
  151. package/lib/utils/compare.js.map +1 -1
  152. package/lib/utils/data.js +3 -9
  153. package/lib/utils/data.js.map +1 -1
  154. package/lib/utils/extension.js +3 -9
  155. package/lib/utils/extension.js.map +1 -1
  156. package/lib/utils/foreign.js +15 -23
  157. package/lib/utils/foreign.js.map +1 -1
  158. package/lib/utils/guid.js +2 -7
  159. package/lib/utils/guid.js.map +1 -1
  160. package/lib/utils/helpers.js +24 -41
  161. package/lib/utils/helpers.js.map +1 -1
  162. package/lib/utils/index.js +12 -18
  163. package/lib/utils/index.js.map +1 -1
  164. package/lib/utils/media.js +5 -9
  165. package/lib/utils/media.js.map +1 -1
  166. package/lib/utils/react.js +2 -7
  167. package/lib/utils/react.js.map +1 -1
  168. package/lib/utils/routes.js +3 -8
  169. package/lib/utils/routes.js.map +1 -1
  170. package/lib/utils/state.js +19 -30
  171. package/lib/utils/state.js.map +1 -1
  172. package/lib/utils/storage.js +2 -5
  173. package/lib/utils/storage.js.map +1 -1
  174. package/package.json +11 -26
  175. package/esm/Piral.d.ts +0 -18
  176. package/esm/Piral.js +0 -24
  177. package/esm/Piral.js.map +0 -1
  178. package/esm/PiralContext.d.ts +0 -21
  179. package/esm/PiralContext.js +0 -34
  180. package/esm/PiralContext.js.map +0 -1
  181. package/esm/RootListener.d.ts +0 -2
  182. package/esm/RootListener.js +0 -44
  183. package/esm/RootListener.js.map +0 -1
  184. package/esm/actions/app.d.ts +0 -13
  185. package/esm/actions/app.js +0 -61
  186. package/esm/actions/app.js.map +0 -1
  187. package/esm/actions/components.d.ts +0 -5
  188. package/esm/actions/components.js +0 -14
  189. package/esm/actions/components.js.map +0 -1
  190. package/esm/actions/data.d.ts +0 -6
  191. package/esm/actions/data.js +0 -46
  192. package/esm/actions/data.js.map +0 -1
  193. package/esm/actions/define.d.ts +0 -3
  194. package/esm/actions/define.js +0 -10
  195. package/esm/actions/define.js.map +0 -1
  196. package/esm/actions/index.d.ts +0 -6
  197. package/esm/actions/index.js +0 -7
  198. package/esm/actions/index.js.map +0 -1
  199. package/esm/actions/portal.d.ts +0 -6
  200. package/esm/actions/portal.js +0 -26
  201. package/esm/actions/portal.js.map +0 -1
  202. package/esm/actions/state.d.ts +0 -3
  203. package/esm/actions/state.js +0 -12
  204. package/esm/actions/state.js.map +0 -1
  205. package/esm/components/ErrorBoundary.d.ts +0 -33
  206. package/esm/components/ErrorBoundary.js +0 -50
  207. package/esm/components/ErrorBoundary.js.map +0 -1
  208. package/esm/components/ExtensionSlot.d.ts +0 -11
  209. package/esm/components/ExtensionSlot.js +0 -29
  210. package/esm/components/ExtensionSlot.js.map +0 -1
  211. package/esm/components/ForeignComponentContainer.d.ts +0 -19
  212. package/esm/components/ForeignComponentContainer.js +0 -46
  213. package/esm/components/ForeignComponentContainer.js.map +0 -1
  214. package/esm/components/Mediator.d.ts +0 -15
  215. package/esm/components/Mediator.js +0 -24
  216. package/esm/components/Mediator.js.map +0 -1
  217. package/esm/components/PiralGlobals.d.ts +0 -6
  218. package/esm/components/PiralGlobals.js +0 -13
  219. package/esm/components/PiralGlobals.js.map +0 -1
  220. package/esm/components/PiralRoutes.d.ts +0 -20
  221. package/esm/components/PiralRoutes.js +0 -36
  222. package/esm/components/PiralRoutes.js.map +0 -1
  223. package/esm/components/PiralSuspense.d.ts +0 -5
  224. package/esm/components/PiralSuspense.js +0 -8
  225. package/esm/components/PiralSuspense.js.map +0 -1
  226. package/esm/components/PiralView.d.ts +0 -20
  227. package/esm/components/PiralView.js +0 -19
  228. package/esm/components/PiralView.js.map +0 -1
  229. package/esm/components/PortalRenderer.d.ts +0 -5
  230. package/esm/components/PortalRenderer.js +0 -7
  231. package/esm/components/PortalRenderer.js.map +0 -1
  232. package/esm/components/ResponsiveLayout.d.ts +0 -23
  233. package/esm/components/ResponsiveLayout.js +0 -12
  234. package/esm/components/ResponsiveLayout.js.map +0 -1
  235. package/esm/components/SwitchErrorInfo.d.ts +0 -3
  236. package/esm/components/SwitchErrorInfo.js +0 -23
  237. package/esm/components/SwitchErrorInfo.js.map +0 -1
  238. package/esm/components/components.d.ts +0 -40
  239. package/esm/components/components.js +0 -47
  240. package/esm/components/components.js.map +0 -1
  241. package/esm/components/index.d.ts +0 -12
  242. package/esm/components/index.js +0 -13
  243. package/esm/components/index.js.map +0 -1
  244. package/esm/components/wrapComponent.d.ts +0 -7
  245. package/esm/components/wrapComponent.js +0 -41
  246. package/esm/components/wrapComponent.js.map +0 -1
  247. package/esm/createInstance.d.ts +0 -22
  248. package/esm/createInstance.js +0 -68
  249. package/esm/createInstance.js.map +0 -1
  250. package/esm/defaults/DefaultErrorInfo.d.ts +0 -8
  251. package/esm/defaults/DefaultErrorInfo.js +0 -11
  252. package/esm/defaults/DefaultErrorInfo.js.map +0 -1
  253. package/esm/defaults/DefaultLayout.d.ts +0 -6
  254. package/esm/defaults/DefaultLayout.js +0 -7
  255. package/esm/defaults/DefaultLayout.js.map +0 -1
  256. package/esm/defaults/DefaultLoadingIndicator.d.ts +0 -6
  257. package/esm/defaults/DefaultLoadingIndicator.js +0 -7
  258. package/esm/defaults/DefaultLoadingIndicator.js.map +0 -1
  259. package/esm/defaults/DefaultRouteSwitch_v5.d.ts +0 -3
  260. package/esm/defaults/DefaultRouteSwitch_v5.js +0 -9
  261. package/esm/defaults/DefaultRouteSwitch_v5.js.map +0 -1
  262. package/esm/defaults/DefaultRouteSwitch_v6.d.ts +0 -3
  263. package/esm/defaults/DefaultRouteSwitch_v6.js +0 -13
  264. package/esm/defaults/DefaultRouteSwitch_v6.js.map +0 -1
  265. package/esm/defaults/DefaultRouter_v5.d.ts +0 -3
  266. package/esm/defaults/DefaultRouter_v5.js +0 -7
  267. package/esm/defaults/DefaultRouter_v5.js.map +0 -1
  268. package/esm/defaults/DefaultRouter_v6.d.ts +0 -3
  269. package/esm/defaults/DefaultRouter_v6.js +0 -7
  270. package/esm/defaults/DefaultRouter_v6.js.map +0 -1
  271. package/esm/defaults/navigator_none.d.ts +0 -5
  272. package/esm/defaults/navigator_none.js +0 -31
  273. package/esm/defaults/navigator_none.js.map +0 -1
  274. package/esm/defaults/navigator_v5.d.ts +0 -6
  275. package/esm/defaults/navigator_v5.js +0 -85
  276. package/esm/defaults/navigator_v5.js.map +0 -1
  277. package/esm/defaults/navigator_v6.d.ts +0 -6
  278. package/esm/defaults/navigator_v6.js +0 -84
  279. package/esm/defaults/navigator_v6.js.map +0 -1
  280. package/esm/helpers.d.ts +0 -17
  281. package/esm/helpers.js +0 -19
  282. package/esm/helpers.js.map +0 -1
  283. package/esm/hooks/action.d.ts +0 -6
  284. package/esm/hooks/action.js +0 -10
  285. package/esm/hooks/action.js.map +0 -1
  286. package/esm/hooks/actions.d.ts +0 -5
  287. package/esm/hooks/actions.js +0 -10
  288. package/esm/hooks/actions.js.map +0 -1
  289. package/esm/hooks/globalState.d.ts +0 -19
  290. package/esm/hooks/globalState.js +0 -16
  291. package/esm/hooks/globalState.js.map +0 -1
  292. package/esm/hooks/index.d.ts +0 -7
  293. package/esm/hooks/index.js +0 -8
  294. package/esm/hooks/index.js.map +0 -1
  295. package/esm/hooks/media.d.ts +0 -7
  296. package/esm/hooks/media.js +0 -22
  297. package/esm/hooks/media.js.map +0 -1
  298. package/esm/hooks/piletApi.d.ts +0 -7
  299. package/esm/hooks/piletApi.js +0 -14
  300. package/esm/hooks/piletApi.js.map +0 -1
  301. package/esm/hooks/setter.d.ts +0 -5
  302. package/esm/hooks/setter.js +0 -14
  303. package/esm/hooks/setter.js.map +0 -1
  304. package/esm/hooks/sharedData.d.ts +0 -12
  305. package/esm/hooks/sharedData.js +0 -6
  306. package/esm/hooks/sharedData.js.map +0 -1
  307. package/esm/index.d.ts +0 -10
  308. package/esm/index.js +0 -11
  309. package/esm/index.js.map +0 -1
  310. package/esm/modules/api.d.ts +0 -4
  311. package/esm/modules/api.js +0 -25
  312. package/esm/modules/api.js.map +0 -1
  313. package/esm/modules/core.d.ts +0 -3
  314. package/esm/modules/core.js +0 -50
  315. package/esm/modules/core.js.map +0 -1
  316. package/esm/modules/dependencies.d.ts +0 -23
  317. package/esm/modules/dependencies.js +0 -32
  318. package/esm/modules/dependencies.js.map +0 -1
  319. package/esm/modules/element.d.ts +0 -5
  320. package/esm/modules/element.js +0 -248
  321. package/esm/modules/element.js.map +0 -1
  322. package/esm/modules/index.d.ts +0 -3
  323. package/esm/modules/index.js +0 -4
  324. package/esm/modules/index.js.map +0 -1
  325. package/esm/setters/SetComponent.d.ts +0 -19
  326. package/esm/setters/SetComponent.js +0 -11
  327. package/esm/setters/SetComponent.js.map +0 -1
  328. package/esm/setters/SetError.d.ts +0 -19
  329. package/esm/setters/SetError.js +0 -11
  330. package/esm/setters/SetError.js.map +0 -1
  331. package/esm/setters/SetErrors.d.ts +0 -15
  332. package/esm/setters/SetErrors.js +0 -9
  333. package/esm/setters/SetErrors.js.map +0 -1
  334. package/esm/setters/SetLayout.d.ts +0 -15
  335. package/esm/setters/SetLayout.js +0 -9
  336. package/esm/setters/SetLayout.js.map +0 -1
  337. package/esm/setters/SetProvider.d.ts +0 -14
  338. package/esm/setters/SetProvider.js +0 -11
  339. package/esm/setters/SetProvider.js.map +0 -1
  340. package/esm/setters/SetRedirect.d.ts +0 -18
  341. package/esm/setters/SetRedirect.js +0 -12
  342. package/esm/setters/SetRedirect.js.map +0 -1
  343. package/esm/setters/SetRoute.d.ts +0 -23
  344. package/esm/setters/SetRoute.js +0 -11
  345. package/esm/setters/SetRoute.js.map +0 -1
  346. package/esm/setters/index.d.ts +0 -7
  347. package/esm/setters/index.js +0 -8
  348. package/esm/setters/index.js.map +0 -1
  349. package/esm/state/createActions.d.ts +0 -4
  350. package/esm/state/createActions.js +0 -27
  351. package/esm/state/createActions.js.map +0 -1
  352. package/esm/state/createGlobalState.d.ts +0 -2
  353. package/esm/state/createGlobalState.js +0 -19
  354. package/esm/state/createGlobalState.js.map +0 -1
  355. package/esm/state/index.d.ts +0 -4
  356. package/esm/state/index.js +0 -5
  357. package/esm/state/index.js.map +0 -1
  358. package/esm/state/stateContext.d.ts +0 -4
  359. package/esm/state/stateContext.js +0 -4
  360. package/esm/state/stateContext.js.map +0 -1
  361. package/esm/state/withApi.d.ts +0 -3
  362. package/esm/state/withApi.js +0 -30
  363. package/esm/state/withApi.js.map +0 -1
  364. package/esm/tools/codegen.d.ts +0 -23
  365. package/esm/tools/codegen.js +0 -194
  366. package/esm/tools/codegen.js.map +0 -1
  367. package/esm/tools/debugger.d.ts +0 -4
  368. package/esm/tools/debugger.js +0 -61
  369. package/esm/tools/debugger.js.map +0 -1
  370. package/esm/tools/emulator.d.ts +0 -4
  371. package/esm/tools/emulator.js +0 -12
  372. package/esm/tools/emulator.js.map +0 -1
  373. package/esm/types/api.d.ts +0 -141
  374. package/esm/types/api.js +0 -2
  375. package/esm/types/api.js.map +0 -1
  376. package/esm/types/common.d.ts +0 -21
  377. package/esm/types/common.js +0 -2
  378. package/esm/types/common.js.map +0 -1
  379. package/esm/types/components.d.ts +0 -250
  380. package/esm/types/components.js +0 -2
  381. package/esm/types/components.js.map +0 -1
  382. package/esm/types/config.d.ts +0 -94
  383. package/esm/types/config.js +0 -2
  384. package/esm/types/config.js.map +0 -1
  385. package/esm/types/custom.d.ts +0 -50
  386. package/esm/types/custom.js +0 -2
  387. package/esm/types/custom.js.map +0 -1
  388. package/esm/types/data.d.ts +0 -51
  389. package/esm/types/data.js +0 -2
  390. package/esm/types/data.js.map +0 -1
  391. package/esm/types/extension.d.ts +0 -61
  392. package/esm/types/extension.js +0 -2
  393. package/esm/types/extension.js.map +0 -1
  394. package/esm/types/index.d.ts +0 -14
  395. package/esm/types/index.js +0 -15
  396. package/esm/types/index.js.map +0 -1
  397. package/esm/types/instance.d.ts +0 -60
  398. package/esm/types/instance.js +0 -2
  399. package/esm/types/instance.js.map +0 -1
  400. package/esm/types/layout.d.ts +0 -12
  401. package/esm/types/layout.js +0 -2
  402. package/esm/types/layout.js.map +0 -1
  403. package/esm/types/navigation.d.ts +0 -98
  404. package/esm/types/navigation.js +0 -2
  405. package/esm/types/navigation.js.map +0 -1
  406. package/esm/types/plugin.d.ts +0 -14
  407. package/esm/types/plugin.js +0 -2
  408. package/esm/types/plugin.js.map +0 -1
  409. package/esm/types/state.d.ts +0 -346
  410. package/esm/types/state.js +0 -2
  411. package/esm/types/state.js.map +0 -1
  412. package/esm/types/utils.d.ts +0 -84
  413. package/esm/types/utils.js +0 -2
  414. package/esm/types/utils.js.map +0 -1
  415. package/esm/types/web.d.ts +0 -47
  416. package/esm/types/web.js +0 -2
  417. package/esm/types/web.js.map +0 -1
  418. package/esm/utils/compare.d.ts +0 -1
  419. package/esm/utils/compare.js +0 -42
  420. package/esm/utils/compare.js.map +0 -1
  421. package/esm/utils/data.d.ts +0 -4
  422. package/esm/utils/data.js +0 -39
  423. package/esm/utils/data.js.map +0 -1
  424. package/esm/utils/extension.d.ts +0 -16
  425. package/esm/utils/extension.js +0 -36
  426. package/esm/utils/extension.js.map +0 -1
  427. package/esm/utils/foreign.d.ts +0 -14
  428. package/esm/utils/foreign.js +0 -39
  429. package/esm/utils/foreign.js.map +0 -1
  430. package/esm/utils/guid.d.ts +0 -2
  431. package/esm/utils/guid.js +0 -12
  432. package/esm/utils/guid.js.map +0 -1
  433. package/esm/utils/helpers.d.ts +0 -16
  434. package/esm/utils/helpers.js +0 -76
  435. package/esm/utils/helpers.js.map +0 -1
  436. package/esm/utils/index.d.ts +0 -12
  437. package/esm/utils/index.js +0 -13
  438. package/esm/utils/index.js.map +0 -1
  439. package/esm/utils/media.d.ts +0 -4
  440. package/esm/utils/media.js +0 -12
  441. package/esm/utils/media.js.map +0 -1
  442. package/esm/utils/react.d.ts +0 -2
  443. package/esm/utils/react.js +0 -5
  444. package/esm/utils/react.js.map +0 -1
  445. package/esm/utils/routes.d.ts +0 -1
  446. package/esm/utils/routes.js +0 -5
  447. package/esm/utils/routes.js.map +0 -1
  448. package/esm/utils/state.d.ts +0 -57
  449. package/esm/utils/state.js +0 -113
  450. package/esm/utils/state.js.map +0 -1
  451. package/esm/utils/storage.d.ts +0 -3
  452. package/esm/utils/storage.js +0 -26
  453. package/esm/utils/storage.js.map +0 -1
  454. /package/{dist → lib}/codegen.js +0 -0
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import { ErrorComponentsState } from '../types';
3
- /**
4
- * The props for the SetErrors component.
5
- */
6
- export interface SetErrorsProps {
7
- /**
8
- * The error views of the Piral instance.
9
- */
10
- errors?: Partial<ErrorComponentsState>;
11
- }
12
- /**
13
- * The component capable of batch setting error handling components.
14
- */
15
- export declare function SetErrors({ errors }: SetErrorsProps): React.ReactElement;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { SetError } from './SetError';
3
- /**
4
- * The component capable of batch setting error handling components.
5
- */
6
- export function SetErrors({ errors = {} }) {
7
- return (React.createElement(React.Fragment, null, Object.keys(errors).map((key) => (React.createElement(SetError, { type: key, component: errors[key], key: key })))));
8
- }
9
- //# sourceMappingURL=SetErrors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetErrors.js","sourceRoot":"","sources":["../../src/setters/SetErrors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAatC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,GAAG,EAAE,EAAkB;IACvD,OAAO,CACL,0CACG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CACrC,oBAAC,QAAQ,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAC1D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC"}
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentsState } from '../types';
3
- /**
4
- * The props for the SetLayout component.
5
- */
6
- export interface SetLayoutProps {
7
- /**
8
- * The layout of the Piral instance.
9
- */
10
- layout?: Partial<ComponentsState>;
11
- }
12
- /**
13
- * The component capable of batch setting layout components.
14
- */
15
- export declare function SetLayout({ layout }: SetLayoutProps): React.ReactElement;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { SetComponent } from './SetComponent';
3
- /**
4
- * The component capable of batch setting layout components.
5
- */
6
- export function SetLayout({ layout = {} }) {
7
- return (React.createElement(React.Fragment, null, Object.keys(layout).map((key) => (React.createElement(SetComponent, { name: key, component: layout[key], key: key })))));
8
- }
9
- //# sourceMappingURL=SetLayout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetLayout.js","sourceRoot":"","sources":["../../src/setters/SetLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAa9C;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,GAAG,EAAE,EAAkB;IACvD,OAAO,CACL,0CACG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CACrC,oBAAC,YAAY,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAC9D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC"}
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * The props for the SetProvider component.
4
- */
5
- export interface SetProviderProps {
6
- /**
7
- * The provider to register.
8
- */
9
- provider: JSX.Element;
10
- }
11
- /**
12
- * The component capable of setting a global provider at mounting.
13
- */
14
- export declare function SetProvider({ provider }: SetProviderProps): React.ReactElement;
@@ -1,11 +0,0 @@
1
- import { useGlobalStateContext, useSetter } from '../hooks';
2
- /**
3
- * The component capable of setting a global provider at mounting.
4
- */
5
- export function SetProvider({ provider }) {
6
- const { includeProvider } = useGlobalStateContext();
7
- useSetter(() => provider && includeProvider(provider));
8
- // tslint:disable-next-line:no-null-keyword
9
- return null;
10
- }
11
- //# sourceMappingURL=SetProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetProvider.js","sourceRoot":"","sources":["../../src/setters/SetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAY5D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAoB;IACxD,MAAM,EAAC,eAAe,EAAC,GAAG,qBAAqB,EAAE,CAAC;IAClD,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * The props for the SetRedirect component.
4
- */
5
- export interface SetRedirectProps {
6
- /**
7
- * The path of the seen route.
8
- */
9
- from: string;
10
- /**
11
- * The path of the target route.
12
- */
13
- to: string;
14
- }
15
- /**
16
- * The component capable of setting a global redirect route at mounting.
17
- */
18
- export declare function SetRedirect({ from, to }: SetRedirectProps): React.ReactElement;
@@ -1,12 +0,0 @@
1
- import { useGlobalStateContext, useSetter } from '../hooks';
2
- import { createRedirect } from '../../app.codegen';
3
- /**
4
- * The component capable of setting a global redirect route at mounting.
5
- */
6
- export function SetRedirect({ from, to }) {
7
- const { setRoute } = useGlobalStateContext();
8
- useSetter(() => setRoute(from, createRedirect(to)));
9
- // tslint:disable-next-line:no-null-keyword
10
- return null;
11
- }
12
- //# sourceMappingURL=SetRedirect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetRedirect.js","sourceRoot":"","sources":["../../src/setters/SetRedirect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAgBnD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,EAAoB;IACxD,MAAM,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
- import { RouteComponentProps } from 'react-router';
3
- /**
4
- * The props for the SetRoute component.
5
- */
6
- export interface SetRouteProps<T extends {
7
- [K in keyof T]?: string;
8
- } = {}> {
9
- /**
10
- * The path to the route.
11
- */
12
- path: string;
13
- /**
14
- * The component to render.
15
- */
16
- component: React.ComponentType<RouteComponentProps<T>>;
17
- }
18
- /**
19
- * The component capable of setting a global route at mounting.
20
- */
21
- export declare function SetRoute<T extends {
22
- [K in keyof T]?: string;
23
- } = {}>({ path, component, }: SetRouteProps<T>): React.ReactElement;
@@ -1,11 +0,0 @@
1
- import { useGlobalStateContext, useSetter } from '../hooks';
2
- /**
3
- * The component capable of setting a global route at mounting.
4
- */
5
- export function SetRoute({ path, component, }) {
6
- const { setRoute } = useGlobalStateContext();
7
- useSetter(() => component && setRoute(path, component));
8
- // tslint:disable-next-line:no-null-keyword
9
- return null;
10
- }
11
- //# sourceMappingURL=SetRoute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetRoute.js","sourceRoot":"","sources":["../../src/setters/SetRoute.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAgB5D;;GAEG;AACH,MAAM,UAAU,QAAQ,CAA6C,EACnE,IAAI,EACJ,SAAS,GACQ;IACjB,MAAM,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IACxD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,7 +0,0 @@
1
- export * from './SetComponent';
2
- export * from './SetError';
3
- export * from './SetErrors';
4
- export * from './SetLayout';
5
- export * from './SetProvider';
6
- export * from './SetRedirect';
7
- export * from './SetRoute';
@@ -1,8 +0,0 @@
1
- export * from './SetComponent';
2
- export * from './SetError';
3
- export * from './SetErrors';
4
- export * from './SetLayout';
5
- export * from './SetProvider';
6
- export * from './SetRedirect';
7
- export * from './SetRoute';
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/setters/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
@@ -1,4 +0,0 @@
1
- import { UseBoundStore } from 'zustand';
2
- import { EventEmitter, GlobalState, GlobalStateContext, PiralDefineActions } from '../types';
3
- export declare function includeActions(ctx: GlobalStateContext, actions: PiralDefineActions): void;
4
- export declare function createActions(state: UseBoundStore<GlobalState>, events: EventEmitter): GlobalStateContext;
@@ -1,27 +0,0 @@
1
- import * as actions from '../actions';
2
- import { createNavigation, publicPath } from '../../app.codegen';
3
- function createContext(state, events) {
4
- const ctx = {
5
- ...events,
6
- apis: {},
7
- converters: {
8
- html: ({ component }) => component,
9
- },
10
- navigation: createNavigation(publicPath),
11
- state,
12
- };
13
- return ctx;
14
- }
15
- export function includeActions(ctx, actions) {
16
- const actionNames = Object.keys(actions);
17
- for (const actionName of actionNames) {
18
- const action = actions[actionName];
19
- ctx[actionName] = action.bind(ctx, ctx);
20
- }
21
- }
22
- export function createActions(state, events) {
23
- const context = createContext(state, events);
24
- includeActions(context, actions);
25
- return context;
26
- }
27
- //# sourceMappingURL=createActions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createActions.js","sourceRoot":"","sources":["../../src/state/createActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGjE,SAAS,aAAa,CAAC,KAAiC,EAAE,MAAoB;IAC5E,MAAM,GAAG,GAAG;QACV,GAAG,MAAM;QACT,IAAI,EAAE,EAAE;QACR,UAAU,EAAE;YACV,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS;SACnC;QACD,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,KAAK;KACgB,CAAC;IACxB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAuB,EAAE,OAA2B;IACjF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEzC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;QACpC,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACnC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;KACzC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAiC,EAAE,MAAoB;IACnF,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC7C,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { GlobalState, NestedPartial } from '../types';
2
- export declare function createGlobalState(customState?: NestedPartial<GlobalState>): import("zustand").UseBoundStore<GlobalState, import("zustand").StoreApi<GlobalState>>;
@@ -1,19 +0,0 @@
1
- import create from 'zustand';
2
- import { createDefaultState } from '../../app.codegen';
3
- function extend(defaultState, customState) {
4
- for (const key of Object.keys(customState)) {
5
- if (key === '__proto__' || key === 'constructor') {
6
- continue;
7
- }
8
- const value = customState[key];
9
- const original = defaultState[key];
10
- const nested = typeof original === 'object' && typeof value === 'object';
11
- defaultState[key] = nested ? extend(original, value) : value;
12
- }
13
- return defaultState;
14
- }
15
- export function createGlobalState(customState = {}) {
16
- const defaultState = createDefaultState();
17
- return create(() => extend(defaultState, customState));
18
- }
19
- //# sourceMappingURL=createGlobalState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createGlobalState.js","sourceRoot":"","sources":["../../src/state/createGlobalState.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,SAAS,MAAM,CAAI,YAAe,EAAE,WAA6B;IAC/D,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAC1C,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,aAAa,EAAE;YAChD,SAAS;SACV;QAED,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;QACzE,YAAY,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;KAC9D;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,cAA0C,EAAE;IAC5E,MAAM,YAAY,GAAgB,kBAAkB,EAAE,CAAC;IACvD,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './createActions';
2
- export * from './createGlobalState';
3
- export * from './stateContext';
4
- export * from './withApi';
@@ -1,5 +0,0 @@
1
- export * from './createActions';
2
- export * from './createGlobalState';
3
- export * from './stateContext';
4
- export * from './withApi';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- import { GlobalStateContext } from '../types';
3
- export declare const StateContext: React.Context<GlobalStateContext>;
4
- export default StateContext;
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- export const StateContext = React.createContext(undefined);
3
- export default StateContext;
4
- //# sourceMappingURL=stateContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stateContext.js","sourceRoot":"","sources":["../../src/state/stateContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAqB,SAAS,CAAC,CAAC;AAE/E,eAAe,YAAY,CAAC"}
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import { AnyComponent, Errors, PiletApi, BaseComponentProps, GlobalStateContext } from '../types';
3
- export declare function withApi<TProps>(context: GlobalStateContext, component: AnyComponent<TProps & BaseComponentProps>, piral: PiletApi, errorType: keyof Errors, wrapperType?: string, captured?: {}): React.MemoExoticComponent<(props: TProps) => React.JSX.Element> | React.ComponentType<TProps>;
@@ -1,30 +0,0 @@
1
- import * as React from 'react';
2
- import { ErrorBoundary, wrapComponent } from '../components';
3
- import { defaultRender } from '../utils';
4
- const DefaultWrapper = (props) => defaultRender(props.children);
5
- function getWrapper(wrappers, wrapperType) {
6
- const WrapAll = wrappers['*'];
7
- const WrapType = wrappers[wrapperType];
8
- if (WrapAll && WrapType) {
9
- return (props) => (React.createElement(WrapAll, { ...props },
10
- React.createElement(WrapType, { ...props })));
11
- }
12
- return WrapType || WrapAll || DefaultWrapper;
13
- }
14
- function makeWrapper(context, outerProps, wrapperType, errorType) {
15
- const wrapped = context.readState((m) => m.app.wrap);
16
- const OuterWrapper = context.readState((m) => getWrapper(m.registry.wrappers, wrapperType));
17
- const Wrapper = (props) => (React.createElement(OuterWrapper, { ...outerProps, ...props },
18
- React.createElement(ErrorBoundary, { ...outerProps, ...props, errorType: errorType }, props.children)));
19
- return wrapped
20
- ? (props) => (React.createElement("piral-component", { origin: outerProps.piral.meta.name },
21
- React.createElement(Wrapper, { ...props })))
22
- : Wrapper;
23
- }
24
- export function withApi(context, component, piral, errorType, wrapperType = errorType, captured = {}) {
25
- const outerProps = { ...captured, piral };
26
- const converters = context.converters;
27
- const Wrapper = makeWrapper(context, outerProps, wrapperType, errorType);
28
- return wrapComponent(converters, component, outerProps, Wrapper);
29
- }
30
- //# sourceMappingURL=withApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withApi.js","sourceRoot":"","sources":["../../src/state/withApi.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,cAAc,GAA0C,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAEvG,SAAS,UAAU,CAAC,QAAkD,EAAE,WAAmB;IACzF,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEvC,IAAI,OAAO,IAAI,QAAQ,EAAE;QACvB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAChB,oBAAC,OAAO,OAAK,KAAK;YAChB,oBAAC,QAAQ,OAAK,KAAK,GAAI,CACf,CACX,CAAC;KACH;IAED,OAAO,QAAQ,IAAI,OAAO,IAAI,cAAc,CAAC;AAC/C,CAAC;AAED,SAAS,WAAW,CAClB,OAA2B,EAC3B,UAA8B,EAC9B,WAAmB,EACnB,SAAuB;IAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5F,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CACzB,oBAAC,YAAY,OAAK,UAAU,KAAM,KAAK;QACrC,oBAAC,aAAa,OAAK,UAAU,KAAM,KAAK,EAAE,SAAS,EAAE,SAAS,IAC3D,KAAK,CAAC,QAAQ,CACD,CACH,CAChB,CAAC;IAEF,OAAO,OAAO;QACZ,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,yCAAiB,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;YACjD,oBAAC,OAAO,OAAK,KAAK,GAAI,CACN,CACnB;QACH,CAAC,CAAC,OAAO,CAAC;AACd,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,OAA2B,EAC3B,SAAoD,EACpD,KAAe,EACf,SAAuB,EACvB,cAAsB,SAAS,EAC/B,QAAQ,GAAG,EAAE;IAEb,MAAM,UAAU,GAAG,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,MAAM,OAAO,GAAG,WAAW,CAAS,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IACjF,OAAO,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC"}
@@ -1,23 +0,0 @@
1
- interface CodegenOptions {
2
- root: string;
3
- origin: string;
4
- cat: string;
5
- appName: string;
6
- externals: Array<string>;
7
- publicPath: string;
8
- isolation: 'classic' | 'modern';
9
- debug?: {
10
- viewState?: boolean;
11
- loadPilets?: boolean;
12
- hardRefresh?: boolean;
13
- viewOrigins?: boolean;
14
- extensionCatalogue?: boolean;
15
- clearConsole?: boolean;
16
- };
17
- emulator: boolean;
18
- }
19
- export declare function createDependencies(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
20
- export declare function createDefaultState(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
21
- export declare function createDebugHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
22
- export declare function createRouteHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
23
- export {};
@@ -1,194 +0,0 @@
1
- // this file is bundled, so the references here will not be at runtime (i.e., for a user)
2
- import { getModulePath } from 'piral-cli/src/external/resolve';
3
- import { readFileSync, existsSync } from 'fs';
4
- import { resolve, relative, dirname, sep, posix } from 'path';
5
- function findPackagePath(moduleDir) {
6
- const packageJson = 'package.json';
7
- const packagePath = resolve(moduleDir, packageJson);
8
- if (existsSync(packagePath)) {
9
- return packagePath;
10
- }
11
- const newDir = resolve(moduleDir, '..');
12
- if (newDir !== moduleDir) {
13
- return findPackagePath(newDir);
14
- }
15
- return undefined;
16
- }
17
- function getPackageJson(root, packageName) {
18
- const moduleDir = dirname(getModulePath(root, packageName));
19
- try {
20
- const packagePath = findPackagePath(moduleDir);
21
- const content = readFileSync(packagePath, 'utf8');
22
- return JSON.parse(content) || {};
23
- }
24
- catch {
25
- return {};
26
- }
27
- }
28
- function getRouterVersion(root) {
29
- const router = 'react-router';
30
- try {
31
- const { version } = getPackageJson(root, router);
32
- const [major] = version.split('.');
33
- return parseInt(major, 10);
34
- }
35
- catch {
36
- console.warn(`⚠ Could not determine version of ${router}. Falling back to v5.`);
37
- return 5;
38
- }
39
- }
40
- function getIdentifiers(root, packageName) {
41
- const identifiers = [packageName];
42
- try {
43
- const details = getPackageJson(root, packageName);
44
- if (details.version) {
45
- identifiers.push(`${packageName}@${details.version}`);
46
- if (details.name && details.name !== packageName) {
47
- identifiers.push(`${details.name}@${details.version}`);
48
- }
49
- }
50
- }
51
- catch { }
52
- return identifiers;
53
- }
54
- function getModulePathOrDefault(root, origin, name) {
55
- try {
56
- const absPath = getModulePath(root, name);
57
- const relPath = relative(origin, absPath);
58
- // The relative path is to be used in an import statement,
59
- // so it should be normalized back to use posix path separators.
60
- const path = relPath.split(sep).join(posix.sep);
61
- return path;
62
- }
63
- catch {
64
- return name;
65
- }
66
- }
67
- export function createDependencies(imports, exports, opts) {
68
- const { root, appName, externals, origin } = opts;
69
- const assignments = [];
70
- const asyncAssignments = [];
71
- if (appName) {
72
- assignments.push(`deps['${appName}']={}`);
73
- }
74
- for (const external of externals) {
75
- if (external.endsWith('?')) {
76
- const name = external.replace(/\?+$/, '');
77
- const identifiers = getIdentifiers(root, name);
78
- const path = getModulePathOrDefault(root, origin, name);
79
- for (const id of identifiers) {
80
- asyncAssignments.push(`registerModule(${JSON.stringify(id)}, () => import(${JSON.stringify(path)}))`);
81
- }
82
- }
83
- else {
84
- const name = external;
85
- const identifiers = getIdentifiers(root, name);
86
- const path = getModulePathOrDefault(root, origin, name);
87
- const ref = `_${imports.length}`;
88
- imports.push(`import * as ${ref} from ${JSON.stringify(path)}`);
89
- for (const id of identifiers) {
90
- assignments.push(`deps[${JSON.stringify(id)}]=${ref}`);
91
- }
92
- }
93
- }
94
- if (asyncAssignments.length) {
95
- imports.push(`import { registerModule } from 'piral-base'`);
96
- assignments.push(...asyncAssignments);
97
- }
98
- exports.push(`
99
- export function fillDependencies(deps) {
100
- ${assignments.join(';')}
101
- }
102
- `);
103
- }
104
- export function createDefaultState(imports, exports, opts) {
105
- const { root, cat, publicPath, isolation } = opts;
106
- const routerVersion = getRouterVersion(root);
107
- const wrap = isolation === 'modern' ? 'true' : 'false';
108
- imports.push(`import { DefaultErrorInfo } from 'piral-core/${cat}/defaults/DefaultErrorInfo';`, `import { DefaultLoadingIndicator } from 'piral-core/${cat}/defaults/DefaultLoadingIndicator';`, `import { DefaultLayout } from 'piral-core/${cat}/defaults/DefaultLayout';`);
109
- if (routerVersion < 6) {
110
- imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v5';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v5';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v5'`);
111
- }
112
- else {
113
- imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v6';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v6';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v6'`);
114
- }
115
- exports.push(`
116
- export { createRedirect, createNavigation, useRouterContext };
117
- `);
118
- exports.push(`
119
- export const publicPath = ${JSON.stringify(publicPath)};
120
- `);
121
- exports.push(`
122
- export function createDefaultState() {
123
- return {
124
- app: {
125
- error: undefined,
126
- loading: typeof window !== 'undefined',
127
- wrap: ${wrap},
128
- },
129
- components: {
130
- ErrorInfo: DefaultErrorInfo,
131
- LoadingIndicator: DefaultLoadingIndicator,
132
- Router: DefaultRouter,
133
- RouteSwitch: DefaultRouteSwitch,
134
- Layout: DefaultLayout,
135
- },
136
- errorComponents: {},
137
- registry: {
138
- extensions: {},
139
- pages: {},
140
- wrappers: {},
141
- },
142
- routes: {},
143
- data: {},
144
- portals: {},
145
- modules: [],
146
- };
147
- }
148
- `);
149
- }
150
- export function createDebugHandler(imports, exports, opts) {
151
- const { cat, debug, emulator } = opts;
152
- // if we build the debug version of piral (debug and emulator build)
153
- if (debug) {
154
- const originalCall = `originalDebugger(context, options, {
155
- defaultSettings: ${JSON.stringify(debug)},
156
- emulator: ${JSON.stringify(emulator)},
157
- ...debug,
158
- })`;
159
- imports.push(`import { integrateDebugger as originalDebugger } from "piral-core/${cat}/tools/debugger"`);
160
- exports.push(`export function integrateDebugger(context, options, debug) { return ${originalCall}; }`);
161
- }
162
- else {
163
- exports.push(`export function integrateDebugger() {}`);
164
- }
165
- // if we build the emulator version of piral (shipped to pilets)
166
- if (emulator) {
167
- imports.push(`import { integrateEmulator } from "piral-core/${cat}/tools/emulator"`);
168
- exports.push(`export { integrateEmulator }`);
169
- }
170
- else {
171
- exports.push(`export function integrateEmulator() {}`);
172
- }
173
- }
174
- export function createRouteHandler(imports, exports, opts) {
175
- const { cat, emulator } = opts;
176
- const assignments = [];
177
- imports.push(`import { useGlobalStateContext } from 'piral-core/${cat}/hooks/globalState';`);
178
- assignments.push(`
179
- useCurrentNavigation();
180
- `);
181
- if (emulator) {
182
- imports.push(`import { useDebugRouteFilter } from 'piral-debug-utils';`);
183
- assignments.push('return useDebugRouteFilter(paths);');
184
- }
185
- else {
186
- assignments.push('return paths;');
187
- }
188
- exports.push(`
189
- export function useRouteFilter(paths) {
190
- ${assignments.join('\n')}
191
- }
192
- `);
193
- }
194
- //# sourceMappingURL=codegen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/tools/codegen.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE9D,SAAS,eAAe,CAAC,SAAiB;IACxC,MAAM,WAAW,GAAG,cAAc,CAAC;IACnC,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEpD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE;QAC3B,OAAO,WAAW,CAAC;KACpB;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAExC,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;KAChC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CAAC,IAAY,EAAE,WAAmB;IACvD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,IA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,CAAC,wCAAwC,CAAC,CAAC;KACxD;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAsB,EAAE,OAAsB,EAAE,IAAoB;IACrG,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,OAAO,CAAC,IAAI,CAAC,qDAAqD,GAAG,sBAAsB,CAAC,CAAC;IAE7F,WAAW,CAAC,IAAI,CAAC;;GAEhB,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QACzE,WAAW,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;KACxD;SAAM;QACL,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACnC;IAED,OAAO,CAAC,IAAI,CAAC;;QAEP,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;;GAE3B,CAAC,CAAC;AACL,CAAC"}
@@ -1,4 +0,0 @@
1
- import { LoadPiletsOptions } from 'piral-base';
2
- import { DebuggerExtensionOptions } from 'piral-debug-utils';
3
- import { GlobalStateContext } from '../types';
4
- export declare function integrateDebugger(context: GlobalStateContext, options: LoadPiletsOptions, debug?: DebuggerExtensionOptions): void;
@@ -1,61 +0,0 @@
1
- import { installPiralDebug } from 'piral-debug-utils';
2
- export function integrateDebugger(context, options, debug = {}) {
3
- installPiralDebug({
4
- emulator: debug.emulator,
5
- customSettings: debug.customSettings,
6
- defaultSettings: debug.defaultSettings,
7
- addPilet: context.addPilet,
8
- removePilet: context.removePilet,
9
- updatePilet(pilet) {
10
- if (!pilet.disabled) {
11
- context.addPilet(pilet);
12
- }
13
- else {
14
- context.injectPilet(pilet);
15
- }
16
- },
17
- fireEvent: context.emit,
18
- getDependencies() {
19
- return Object.keys(options.dependencies);
20
- },
21
- getExtensions() {
22
- return context.readState((s) => Object.keys(s.registry.extensions));
23
- },
24
- getRoutes() {
25
- const registeredRoutes = context.readState((state) => Object.keys(state.registry.pages));
26
- const componentRoutes = context.readState((state) => Object.keys(state.routes));
27
- return [...componentRoutes, ...registeredRoutes];
28
- },
29
- getGlobalState() {
30
- return context.readState((s) => s);
31
- },
32
- navigate(path, state) {
33
- return context.navigation.push(path, state);
34
- },
35
- getPilets() {
36
- return context.readState((s) => s.modules);
37
- },
38
- integrate(dbg) {
39
- context.dispatch((s) => ({
40
- ...s,
41
- routes: {
42
- ...s.routes,
43
- ...dbg.routes,
44
- },
45
- }));
46
- context.state.subscribe((current, previous) => {
47
- const pilets = current.modules !== previous.modules;
48
- const pages = current.registry.pages !== previous.registry.pages || current.routes !== previous.routes;
49
- const extensions = current.registry.extensions !== previous.registry.extensions;
50
- const state = current !== previous;
51
- dbg.onChange(previous, current, {
52
- pilets,
53
- pages,
54
- extensions,
55
- state,
56
- });
57
- });
58
- },
59
- });
60
- }
61
- //# sourceMappingURL=debugger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debugger.js","sourceRoot":"","sources":["../../src/tools/debugger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAA4B,MAAM,mBAAmB,CAAC;AAGhF,MAAM,UAAU,iBAAiB,CAC/B,OAA2B,EAC3B,OAA0B,EAC1B,QAAkC,EAAE;IAEpC,iBAAiB,CAAC;QAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,WAAW,CAAC,KAAK;YACf,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACnB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aACzB;iBAAM;gBACL,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;aAC5B;QACH,CAAC;QACD,SAAS,EAAE,OAAO,CAA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