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,84 +0,0 @@
1
- import type { PiralCustomEventMap } from './custom';
2
- /**
3
- * A key value store that can be abstracted onto a storage solution (e.g. cookie).
4
- */
5
- export interface PiralStorage {
6
- /**
7
- * Sets the value of an item.
8
- * @param name The name of the item to set.
9
- * @param data The new value of the item.
10
- * @param expires Optional expiration information.
11
- */
12
- setItem(name: string, data: string, expires?: string): void;
13
- /**
14
- * Gets the value of an item.
15
- * @param name The name of the item to look for.
16
- */
17
- getItem(name: string): string | null;
18
- /**
19
- * Removes an item from the storage.
20
- * @param name The name of the item to remove.
21
- */
22
- removeItem(name: string): void;
23
- }
24
- /**
25
- * Can be implemented by functions to be used for disposal purposes.
26
- */
27
- export interface Disposable {
28
- /**
29
- * Disposes the created resource.
30
- */
31
- (): void;
32
- }
33
- /**
34
- * Gets fired when a data item gets stored in piral.
35
- */
36
- export interface PiralStoreDataEvent<TValue = any> {
37
- /**
38
- * The name of the item that was stored.
39
- */
40
- name: string;
41
- /**
42
- * The storage target of the item.
43
- */
44
- target: string;
45
- /**
46
- * The value that was stored.
47
- */
48
- value: TValue;
49
- /**
50
- * The owner of the item.
51
- */
52
- owner: string;
53
- /**
54
- * The expiration of the item.
55
- */
56
- expires: number;
57
- }
58
- /**
59
- * Gets fired when an unhandled error in a component has been prevented.
60
- */
61
- export interface PiralUnhandledErrorEvent {
62
- /**
63
- * The container showing the error / containing the component.
64
- */
65
- container: any;
66
- /**
67
- * The type of the error, i.e., the type of component that crashed.
68
- */
69
- errorType: string;
70
- /**
71
- * The actual error that was emitted.
72
- */
73
- error: Error;
74
- /**
75
- * The name of the pilet containing the problematic component.
76
- */
77
- pilet: string;
78
- }
79
- declare module 'piral-base/lib/types/api' {
80
- interface PiralEventMap extends PiralCustomEventMap {
81
- 'store-data': PiralStoreDataEvent;
82
- 'unhandled-error': PiralUnhandledErrorEvent;
83
- }
84
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":""}
@@ -1,47 +0,0 @@
1
- import type { HTMLAttributes } from 'react';
2
- export interface PiralComponentProps extends HTMLAttributes<{}> {
3
- name?: string;
4
- origin: string;
5
- }
6
- export interface PiralExtensionProps extends HTMLAttributes<{}> {
7
- name: string;
8
- params: string;
9
- }
10
- export interface PiralPortalProps extends HTMLAttributes<{}> {
11
- pid: string;
12
- }
13
- export interface PiralSlotProps extends HTMLAttributes<{}> {
14
- }
15
- declare global {
16
- namespace JSX {
17
- interface IntrinsicElements {
18
- 'piral-component': React.DetailedHTMLProps<PiralComponentProps, {}>;
19
- 'piral-extension': React.DetailedHTMLProps<PiralExtensionProps, {}>;
20
- 'piral-portal': React.DetailedHTMLProps<PiralPortalProps, {}>;
21
- 'piral-slot': React.DetailedHTMLProps<PiralSlotProps, {}>;
22
- }
23
- }
24
- interface Window {
25
- /**
26
- * Assigns content in form a ReactChild to be rendered later
27
- * from a foreign container / element in an piral-content
28
- * child.
29
- * @param cid The ID of the piral-content node.
30
- * @param content The ReactChild to be rendered.
31
- */
32
- assignContent(cid: string, content: any): void;
33
- }
34
- interface HTMLElementTagNameMap {
35
- 'piral-component': HTMLElement & {
36
- name?: string;
37
- origin: string;
38
- };
39
- 'piral-extension': HTMLElement & {
40
- params: any;
41
- name: string;
42
- empty: any;
43
- };
44
- 'piral-portal': HTMLElement;
45
- 'piral-slot': HTMLElement;
46
- }
47
- }
package/esm/types/web.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/types/web.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export declare function isSame<T>(a: T, b: T): boolean;
@@ -1,42 +0,0 @@
1
- function compareObjects(a, b) {
2
- for (const i in a) {
3
- if (!(i in b)) {
4
- return false;
5
- }
6
- }
7
- for (const i in b) {
8
- if (!isSame(a[i], b[i])) {
9
- return false;
10
- }
11
- }
12
- return true;
13
- }
14
- function compareArrays(a, b) {
15
- const l = a.length;
16
- if (l === b.length) {
17
- for (let i = 0; i < l; i++) {
18
- if (!isSame(a[i], b[i])) {
19
- return false;
20
- }
21
- }
22
- return true;
23
- }
24
- return false;
25
- }
26
- export function isSame(a, b) {
27
- if (a !== b) {
28
- const ta = typeof a;
29
- const tb = typeof b;
30
- if (ta === tb && ta === 'object' && a && b) {
31
- if (Array.isArray(a) && Array.isArray(b)) {
32
- return compareArrays(a, b);
33
- }
34
- else {
35
- return compareObjects(a, b);
36
- }
37
- }
38
- return false;
39
- }
40
- return true;
41
- }
42
- //# sourceMappingURL=compare.js.map
@@ -1 +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AAa,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"}
@@ -1,4 +0,0 @@
1
- import { DataStoreOptions, CustomDataStoreOptions, Dict, SharedDataItem } from '../types';
2
- export declare function createDataView(data: Dict<SharedDataItem>): Readonly<Dict<any>>;
3
- export declare function createDataOptions(options?: DataStoreOptions): CustomDataStoreOptions;
4
- export declare function getDataExpiration(expires?: number | Date | 'never'): number;
package/esm/utils/data.js DELETED
@@ -1,39 +0,0 @@
1
- const defaultTarget = 'memory';
2
- export function createDataView(data) {
3
- const proxyName = 'Proxy';
4
- return (window[proxyName] &&
5
- new Proxy(data, {
6
- get(target, name) {
7
- const item = target[name];
8
- return item && item.value;
9
- },
10
- set(_target, _name, _value) {
11
- return true;
12
- },
13
- }));
14
- }
15
- export function createDataOptions(options = defaultTarget) {
16
- if (typeof options === 'string') {
17
- return {
18
- target: options,
19
- };
20
- }
21
- else if (options && typeof options === 'object' && !Array.isArray(options)) {
22
- return options;
23
- }
24
- else {
25
- return {
26
- target: defaultTarget,
27
- };
28
- }
29
- }
30
- export function getDataExpiration(expires) {
31
- if (typeof expires === 'number') {
32
- return expires;
33
- }
34
- else if (expires instanceof Date) {
35
- return expires.valueOf();
36
- }
37
- return -1;
38
- }
39
- //# sourceMappingURL=data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/utils/data.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAoB,QAAQ,CAAC;AAEhD,MAAM,UAAU,cAAc,CAAC,IAA0B;IACvD,MAAM,SAAS,GAAG,OAAO,CAAC;IAC1B,OAAO,CACL,MAAM,CAAC,SAAS,CAAC;QACjB,IAAI,KAAK,CAAC,IAAI,EAAE;YACd,GAAG,CAAC,MAAM,EAAE,IAAI;gBACd,MAAM,IAAI,GAAG,MAAM,CAAC,IAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC;YAC5B,CAAC;YACD,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAA4B,aAAa;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;SACtB,CAAC;KACH;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IACjE,IAAI,OAAO,OAAO,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"}
@@ -1,16 +0,0 @@
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;
@@ -1,36 +0,0 @@
1
- import * as React from 'react';
2
- function removeAll(nodes) {
3
- nodes.forEach((node) => node.remove());
4
- }
5
- const SlotCarrier = ({ nodes }) => {
6
- const host = React.useRef();
7
- React.useEffect(() => {
8
- host.current?.append(...nodes);
9
- return () => removeAll(nodes);
10
- }, [nodes]);
11
- if (nodes.length) {
12
- return React.createElement("piral-slot", { ref: host });
13
- }
14
- return null;
15
- };
16
- /**
17
- * Transforms the given component to an extension component.
18
- * @param Component The component to transform.
19
- * @returns The extension component (receiving its props via params).
20
- */
21
- export function toExtension(Component) {
22
- return (props) => React.createElement(Component, { ...props.params });
23
- }
24
- /**
25
- * Reactifies the list of child nodes to a React Node by removing the
26
- * nodes from the DOM and carrying it in a React Node, where it would be
27
- * attached at a slot.
28
- * @param childNodes The child nodes to reactify.
29
- * @returns The React Node.
30
- */
31
- export function reactifyContent(childNodes) {
32
- const nodes = Array.prototype.filter.call(childNodes, Boolean);
33
- removeAll(nodes);
34
- return React.createElement(SlotCarrier, { nodes: nodes });
35
- }
36
- //# sourceMappingURL=extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/utils/extension.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;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,IAAI,CAAC,OAAO,EAAE,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,MAAM,UAAU,WAAW,CAAI,SAAiC;IAC9D,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,SAAS,OAAK,KAAK,CAAC,MAAM,GAAI,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,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"}
@@ -1,14 +0,0 @@
1
- import { ComponentType, ReactPortal } from 'react';
2
- import { GlobalStateContext, ForeignComponent } from '../types';
3
- export declare const extensionName = "piral-extension";
4
- export declare const componentName = "piral-component";
5
- export declare const contentName = "piral-content";
6
- export declare const portalName = "piral-portal";
7
- export declare const slotName = "piral-slot";
8
- export declare function attachDomPortal<TProps>(id: string, context: GlobalStateContext, element: HTMLElement | ShadowRoot, component: ComponentType<TProps>, props: TProps): [string, ReactPortal];
9
- export declare function changeDomPortal<TProps>(id: string, current: ReactPortal, context: GlobalStateContext, element: HTMLElement | ShadowRoot, component: ComponentType<TProps>, props: TProps): [string, ReactPortal];
10
- export declare function convertComponent<T extends {
11
- type: string;
12
- }, U>(converter: (component: T) => ForeignComponent<U>, component: T): ForeignComponent<U>;
13
- export declare function renderInDom<TProps>(context: GlobalStateContext, element: HTMLElement | ShadowRoot, component: ComponentType<TProps>, props: TProps): [string, ReactPortal];
14
- export declare function defer(cb: () => void): void;
@@ -1,39 +0,0 @@
1
- import { createElement } from 'react';
2
- import { createPortal } from 'react-dom';
3
- export const extensionName = 'piral-extension';
4
- export const componentName = 'piral-component';
5
- export const contentName = 'piral-content';
6
- export const portalName = 'piral-portal';
7
- export const slotName = 'piral-slot';
8
- export function attachDomPortal(id, context, element, component, props) {
9
- const portal = createPortal(createElement(component, props), element);
10
- context.showPortal(id, portal);
11
- return [id, portal];
12
- }
13
- export function changeDomPortal(id, current, context, element, component, props) {
14
- const next = createPortal(createElement(component, props), element);
15
- context.updatePortal(id, current, next);
16
- return [id, next];
17
- }
18
- export function convertComponent(converter, component) {
19
- if (typeof converter !== 'function') {
20
- throw new Error(`No converter for component of type "${component.type}" registered.`);
21
- }
22
- return converter(component);
23
- }
24
- export function renderInDom(context, element, component, props) {
25
- const portalId = 'pid';
26
- let parent = element;
27
- while (parent) {
28
- if (parent instanceof Element && parent.localName === portalName && parent.hasAttribute(portalId)) {
29
- const id = parent.getAttribute(portalId);
30
- return attachDomPortal(id, context, element, component, props);
31
- }
32
- parent = parent.parentNode || parent.host;
33
- }
34
- return attachDomPortal('root', context, element, component, props);
35
- }
36
- export function defer(cb) {
37
- setTimeout(cb, 0);
38
- }
39
- //# sourceMappingURL=foreign.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"foreign.js","sourceRoot":"","sources":["../../src/utils/foreign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAC/C,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC;AACzC,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,MAAM,UAAU,eAAe,CAC7B,EAAU,EACV,OAA2B,EAC3B,OAAiC,EACj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AK,CAAC,CAAC;SAChE;QAED,MAAM,GAAG,MAAM,CAAC,UAAU,IAAK,MAAqB,CAAC,IAAI,CAAC;KAC3D;IAED,OAAO,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EAAc;IAClC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function generateId(): string;
2
- export declare function buildName(prefix: string, name: string | number): string;
package/esm/utils/guid.js DELETED
@@ -1,12 +0,0 @@
1
- function rand(c) {
2
- const r = (Math.random() * 16) | 0;
3
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
4
- return v.toString(16);
5
- }
6
- export function generateId() {
7
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, rand);
8
- }
9
- export function buildName(prefix, name) {
10
- return `${prefix}://${name}`;
11
- }
12
- //# sourceMappingURL=guid.js.map
@@ -1 +0,0 @@
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,MAAM,UAAU,UAAU;IACxB,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,IAAqB;IAC7D,OAAO,GAAG,MAAM,MAAM,IAAI,EAAE,CAAC;AAC/B,CAAC"}
@@ -1,16 +0,0 @@
1
- export declare const removeIndicator: any;
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[];
11
- export declare function removeNested<T, U = any>(obj: T, predicate: (item: U) => boolean): T;
12
- export declare function excludeOn<T>(items: Array<T>, predicate: (item: T) => boolean): any[];
13
- export declare function updateKey<T, TKey extends keyof T>(obj: T, key: TKey, value: T[TKey]): T;
14
- export declare function withKey<T, TKey extends keyof T>(obj: T, key: TKey, value: T[TKey]): T;
15
- export declare function withoutKey<T, TKey extends keyof T>(obj: T, key: TKey): T;
16
- export declare function tryParseJson(content: string): any;
@@ -1,76 +0,0 @@
1
- // tslint:disable-next-line
2
- export const removeIndicator = null;
3
- // to avoid creating unnecessary empty arrays
4
- export const none = [];
5
- // to avoid creating unnecessary empty functions
6
- export const noop = () => { };
7
- export function prependItem(items, item) {
8
- return [item, ...(items || none)];
9
- }
10
- export function appendItem(items, item) {
11
- return [...(items || none), item];
12
- }
13
- export function prependItems(items, newItems) {
14
- return [...newItems, ...(items || none)];
15
- }
16
- export function appendItems(items, newItems) {
17
- return [...(items || none), ...newItems];
18
- }
19
- export function excludeItem(items, item) {
20
- return (items || none).filter((m) => m !== item);
21
- }
22
- export function includeItem(items, item) {
23
- return appendItem(excludeItem(items, item), item);
24
- }
25
- export function replaceOrAddItem(items, item, predicate) {
26
- const newItems = [...(items || none)];
27
- for (let i = 0; i < newItems.length; i++) {
28
- if (predicate(newItems[i])) {
29
- newItems[i] = item;
30
- return newItems;
31
- }
32
- }
33
- newItems.push(item);
34
- return newItems;
35
- }
36
- export function removeNested(obj, predicate) {
37
- return Object.keys(obj).reduce((entries, key) => {
38
- const item = obj[key];
39
- entries[key] = Object.keys(item).reduce((all, key) => {
40
- const value = item[key];
41
- if (Array.isArray(value)) {
42
- all[key] = excludeOn(value, predicate);
43
- }
44
- else if (!value || !predicate(value)) {
45
- all[key] = value;
46
- }
47
- return all;
48
- }, {});
49
- return entries;
50
- }, {});
51
- }
52
- export function excludeOn(items, predicate) {
53
- return (items || none).filter((m) => !predicate(m));
54
- }
55
- export function updateKey(obj, key, value) {
56
- return value === removeIndicator ? withoutKey(obj, key) : withKey(obj, key, value);
57
- }
58
- export function withKey(obj, key, value) {
59
- return {
60
- ...obj,
61
- [key]: value,
62
- };
63
- }
64
- export function withoutKey(obj, key) {
65
- const { [key]: _, ...newObj } = obj || {};
66
- return newObj;
67
- }
68
- export function tryParseJson(content) {
69
- try {
70
- return JSON.parse(content);
71
- }
72
- catch {
73
- return {};
74
- }
75
- }
76
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;AAEvB,gDAAgD;AAChD,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAE7B,MAAM,UAAU,WAAW,CAAI,KAAe,EAAE,IAAO;IACrD,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,UAAU,CAAI,KAAe,EAAE,IAAO;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,EAA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,CAAC;AAED,MAAM,UAAU,UAAU,CAA0B,GAAM,EAAE,GAAS;IACnE,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,GAAG,IAAI,EAAE,CAAC;IAC1C,OAAO,MAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC5B;IAAC,MAAM;QACN,OAAO,EAAE,CAAC;KACX;AACH,CAAC"}
@@ -1,12 +0,0 @@
1
- export { isfunc, requireModule } from 'piral-base';
2
- export * from './compare';
3
- export * from './data';
4
- export * from './extension';
5
- export * from './foreign';
6
- export * from './guid';
7
- export * from './helpers';
8
- export * from './media';
9
- export * from './react';
10
- export * from './routes';
11
- export * from './state';
12
- export * from './storage';
@@ -1,13 +0,0 @@
1
- export { isfunc, requireModule } from 'piral-base';
2
- export * from './compare';
3
- export * from './data';
4
- export * from './extension';
5
- export * from './foreign';
6
- export * from './guid';
7
- export * from './helpers';
8
- export * from './media';
9
- export * from './react';
10
- export * from './routes';
11
- export * from './state';
12
- export * from './storage';
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEnD,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -1,4 +0,0 @@
1
- import { LayoutTypes, LayoutBreakpoints } from '../types';
2
- export declare const defaultLayouts: LayoutTypes;
3
- export declare const defaultBreakpoints: LayoutBreakpoints;
4
- export declare function getCurrentLayout<T>(breakpoints: Array<string>, layouts: Array<T>, defaultLayout: T): T;
@@ -1,12 +0,0 @@
1
- import { isfunc } from 'piral-base';
2
- export const defaultLayouts = ['desktop', 'tablet', 'mobile'];
3
- export const defaultBreakpoints = ['(min-width: 991px)', '(min-width: 481px)', '(max-width: 480px)'];
4
- const mm = typeof window === 'undefined' || !isfunc(window.matchMedia)
5
- ? () => ({ matches: undefined })
6
- : (q) => window.matchMedia(q);
7
- export function getCurrentLayout(breakpoints = defaultBreakpoints, layouts, defaultLayout) {
8
- const query = breakpoints.findIndex((q) => mm(q).matches);
9
- const layout = layouts[query];
10
- return layout !== undefined ? layout : defaultLayout;
11
- }
12
- //# sourceMappingURL=media.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/utils/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,MAAM,CAAC,MAAM,cAAc,GAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,kBAAkB,GAAsB,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;AAExH,MAAM,EAAE,GACN,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;IACzD,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAE1C,MAAM,UAAU,gBAAgB,CAAI,cAA6B,kBAAkB,EAAE,OAAiB,EAAE,aAAgB;IACtH,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC;AACvD,CAAC"}
@@ -1,2 +0,0 @@
1
- import * as React from 'react';
2
- export declare function defaultRender(children: React.ReactNode, key?: string): React.JSX.Element;
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export function defaultRender(children, key) {
3
- return React.createElement(React.Fragment, { key: key }, children);
4
- }
5
- //# sourceMappingURL=react.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/utils/react.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,aAAa,CAAC,QAAyB,EAAE,GAAY;IACnE,OAAO,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,GAAG,IAAG,QAAQ,CAAkB,CAAC;AAC/D,CAAC"}
@@ -1 +0,0 @@
1
- export declare function createRouteMatcher(path: string): RegExp;
@@ -1,5 +0,0 @@
1
- import ptr from 'path-to-regexp';
2
- export function createRouteMatcher(path) {
3
- return ptr(path);
4
- }
5
- //# sourceMappingURL=routes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/utils/routes.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAEjC,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;AACnB,CAAC"}
@@ -1,57 +0,0 @@
1
- import { ComponentType } from 'react';
2
- import { RouteComponentProps } from 'react-router';
3
- import { GlobalState, PageRegistration, ExtensionRegistration } from '../types';
4
- /**
5
- * Returns a dispatcher that includes all mentioned dispatchers.
6
- * @param dispatchers The dispatchers to include.
7
- */
8
- export declare function withAll(...dispatchers: Array<(state: GlobalState) => GlobalState>): (state: GlobalState) => GlobalState;
9
- /**
10
- * Returns a dispatcher that adds a page registration.
11
- * @param name The path of the page to register.
12
- * @param value The value of the page to register.
13
- * @returns The dispatcher.
14
- */
15
- export declare function withPage(name: string, value: PageRegistration): (state: GlobalState) => GlobalState;
16
- /**
17
- * Returns a dispatcher that removes a page registration.
18
- * @param name The path of the page to unregister.
19
- * @returns The dispatcher.
20
- */
21
- export declare function withoutPage(name: string): (state: GlobalState) => GlobalState;
22
- /**
23
- * Returns a dispatcher that adds an extension registration.
24
- * @param name The name of the extension to register.
25
- * @param value The value of the extension to register.
26
- * @returns The dispatcher.
27
- */
28
- export declare function withExtension(name: string, value: ExtensionRegistration): (state: GlobalState) => GlobalState;
29
- /**
30
- * Returns a dispatcher that removes an extension registration.
31
- * @param name The name of the extension to unregister.
32
- * @param reference The reference for the extension.
33
- * @returns The dispatcher.
34
- */
35
- export declare function withoutExtension(name: string, reference: any): (state: GlobalState) => GlobalState;
36
- /**
37
- * Returns a dispatcher that adds an extension registration from the root (no Pilet API).
38
- * @param name The name of the extension to register.
39
- * @param component The extension's component to use.
40
- * @returns The dispatcher.
41
- */
42
- export declare function withRootExtension<T>(name: string, component: ComponentType<T>): (state: GlobalState) => GlobalState;
43
- /**
44
- * Returns a dispatcher that adds another provider.
45
- * @param provider The provider to include.
46
- * @returns The dispatcher.
47
- */
48
- export declare function withProvider(provider: JSX.Element): (state: GlobalState) => GlobalState;
49
- /**
50
- * Returns a dispatcher that registers another route.
51
- * @param path The path of the route to register.
52
- * @param component The component representing the route.
53
- * @returns The dispatcher.
54
- */
55
- export declare function withRoute<T extends {
56
- [K in keyof T]?: string;
57
- } = {}>(path: string, component: ComponentType<RouteComponentProps<T>>): (state: GlobalState) => GlobalState;