piral-core 0.15.0-alpha.4034 → 0.15.0-alpha.4098

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 (273) hide show
  1. package/esm/Piral.d.ts +2 -2
  2. package/esm/Piral.js +14 -12
  3. package/esm/Piral.js.map +1 -1
  4. package/esm/PiralContext.d.ts +21 -0
  5. package/esm/PiralContext.js +34 -0
  6. package/esm/PiralContext.js.map +1 -0
  7. package/esm/actions/app.d.ts +1 -2
  8. package/esm/actions/app.js +0 -3
  9. package/esm/actions/app.js.map +1 -1
  10. package/esm/actions/state.js +5 -1
  11. package/esm/actions/state.js.map +1 -1
  12. package/esm/components/ErrorBoundary.d.ts +4 -0
  13. package/esm/components/ErrorBoundary.js +3 -3
  14. package/esm/components/ErrorBoundary.js.map +1 -1
  15. package/esm/components/PiralGlobals.d.ts +6 -0
  16. package/esm/components/PiralGlobals.js +13 -0
  17. package/esm/components/PiralGlobals.js.map +1 -0
  18. package/esm/components/PiralSuspense.d.ts +5 -0
  19. package/esm/components/PiralSuspense.js +8 -0
  20. package/esm/components/PiralSuspense.js.map +1 -0
  21. package/esm/components/PiralView.d.ts +10 -1
  22. package/esm/components/PiralView.js +12 -24
  23. package/esm/components/PiralView.js.map +1 -1
  24. package/esm/components/ResponsiveLayout.d.ts +9 -1
  25. package/esm/components/ResponsiveLayout.js +5 -12
  26. package/esm/components/ResponsiveLayout.js.map +1 -1
  27. package/esm/components/components.d.ts +13 -6
  28. package/esm/components/components.js +13 -6
  29. package/esm/components/components.js.map +1 -1
  30. package/esm/components/index.d.ts +2 -12
  31. package/esm/components/index.js +2 -12
  32. package/esm/components/index.js.map +1 -1
  33. package/esm/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
  34. package/esm/{components → defaults}/DefaultErrorInfo.js +1 -2
  35. package/esm/defaults/DefaultErrorInfo.js.map +1 -0
  36. package/esm/{components → defaults}/DefaultLayout.d.ts +0 -0
  37. package/esm/{components → defaults}/DefaultLayout.js +0 -0
  38. package/esm/defaults/DefaultLayout.js.map +1 -0
  39. package/esm/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
  40. package/esm/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +1 -1
  41. package/esm/defaults/DefaultLoadingIndicator.js.map +1 -0
  42. package/esm/{components → defaults}/DefaultRouteSwitch.d.ts +0 -0
  43. package/esm/{components → defaults}/DefaultRouteSwitch.js +0 -0
  44. package/esm/defaults/DefaultRouteSwitch.js.map +1 -0
  45. package/esm/defaults/DefaultRouter.d.ts +3 -0
  46. package/esm/{components → defaults}/DefaultRouter.js +0 -0
  47. package/esm/defaults/DefaultRouter.js.map +1 -0
  48. package/esm/defaults/index.d.ts +5 -0
  49. package/esm/defaults/index.js +6 -0
  50. package/esm/defaults/index.js.map +1 -0
  51. package/esm/index.d.ts +1 -0
  52. package/esm/index.js +1 -0
  53. package/esm/index.js.map +1 -1
  54. package/esm/{components → setters}/SetComponent.d.ts +0 -0
  55. package/esm/{components → setters}/SetComponent.js +0 -0
  56. package/esm/setters/SetComponent.js.map +1 -0
  57. package/esm/{components → setters}/SetError.d.ts +0 -0
  58. package/esm/{components → setters}/SetError.js +0 -0
  59. package/esm/setters/SetError.js.map +1 -0
  60. package/esm/{components → setters}/SetErrors.d.ts +0 -0
  61. package/esm/{components → setters}/SetErrors.js +0 -0
  62. package/esm/setters/SetErrors.js.map +1 -0
  63. package/esm/{components → setters}/SetLayout.d.ts +0 -0
  64. package/esm/{components → setters}/SetLayout.js +0 -0
  65. package/esm/setters/SetLayout.js.map +1 -0
  66. package/esm/{components → setters}/SetProvider.d.ts +0 -0
  67. package/esm/{components → setters}/SetProvider.js +0 -0
  68. package/esm/setters/SetProvider.js.map +1 -0
  69. package/esm/{components → setters}/SetRedirect.d.ts +0 -0
  70. package/esm/{components → setters}/SetRedirect.js +0 -0
  71. package/esm/setters/SetRedirect.js.map +1 -0
  72. package/esm/{components → setters}/SetRoute.d.ts +0 -0
  73. package/esm/{components → setters}/SetRoute.js +0 -0
  74. package/esm/setters/SetRoute.js.map +1 -0
  75. package/esm/setters/index.d.ts +7 -0
  76. package/esm/setters/index.js +8 -0
  77. package/esm/setters/index.js.map +1 -0
  78. package/esm/state/createGlobalState.js +1 -2
  79. package/esm/state/createGlobalState.js.map +1 -1
  80. package/esm/state/withApi.js.map +1 -1
  81. package/esm/types/components.d.ts +9 -1
  82. package/esm/types/instance.d.ts +10 -3
  83. package/esm/types/state.d.ts +2 -12
  84. package/esm/utils/compare.d.ts +1 -1
  85. package/esm/utils/compare.js +20 -3
  86. package/esm/utils/compare.js.map +1 -1
  87. package/esm/utils/media.js +1 -1
  88. package/esm/utils/media.js.map +1 -1
  89. package/lib/Piral.d.ts +2 -2
  90. package/lib/Piral.js +13 -11
  91. package/lib/Piral.js.map +1 -1
  92. package/lib/PiralContext.d.ts +21 -0
  93. package/lib/PiralContext.js +38 -0
  94. package/lib/PiralContext.js.map +1 -0
  95. package/lib/actions/app.d.ts +1 -2
  96. package/lib/actions/app.js +1 -5
  97. package/lib/actions/app.js.map +1 -1
  98. package/lib/actions/index.js +6 -6
  99. package/lib/actions/index.js.map +1 -1
  100. package/lib/actions/state.js +5 -1
  101. package/lib/actions/state.js.map +1 -1
  102. package/lib/components/ErrorBoundary.d.ts +4 -0
  103. package/lib/components/ErrorBoundary.js +3 -3
  104. package/lib/components/ErrorBoundary.js.map +1 -1
  105. package/lib/components/PiralGlobals.d.ts +6 -0
  106. package/lib/components/PiralGlobals.js +17 -0
  107. package/lib/components/PiralGlobals.js.map +1 -0
  108. package/lib/components/PiralRoutes.js +1 -1
  109. package/lib/components/PiralRoutes.js.map +1 -1
  110. package/lib/components/PiralSuspense.d.ts +5 -0
  111. package/lib/components/PiralSuspense.js +12 -0
  112. package/lib/components/PiralSuspense.js.map +1 -0
  113. package/lib/components/PiralView.d.ts +10 -1
  114. package/lib/components/PiralView.js +11 -23
  115. package/lib/components/PiralView.js.map +1 -1
  116. package/lib/components/ResponsiveLayout.d.ts +9 -1
  117. package/lib/components/ResponsiveLayout.js +3 -10
  118. package/lib/components/ResponsiveLayout.js.map +1 -1
  119. package/lib/components/components.d.ts +13 -6
  120. package/lib/components/components.js +14 -7
  121. package/lib/components/components.js.map +1 -1
  122. package/lib/components/index.d.ts +2 -12
  123. package/lib/components/index.js +12 -22
  124. package/lib/components/index.js.map +1 -1
  125. package/lib/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
  126. package/lib/{components → defaults}/DefaultErrorInfo.js +2 -3
  127. package/lib/defaults/DefaultErrorInfo.js.map +1 -0
  128. package/lib/{components → defaults}/DefaultLayout.d.ts +0 -0
  129. package/lib/{components → defaults}/DefaultLayout.js +0 -0
  130. package/lib/defaults/DefaultLayout.js.map +1 -0
  131. package/lib/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
  132. package/lib/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +1 -1
  133. package/lib/defaults/DefaultLoadingIndicator.js.map +1 -0
  134. package/lib/{components → defaults}/DefaultRouteSwitch.d.ts +0 -0
  135. package/lib/{components → defaults}/DefaultRouteSwitch.js +1 -1
  136. package/lib/defaults/DefaultRouteSwitch.js.map +1 -0
  137. package/lib/defaults/DefaultRouter.d.ts +3 -0
  138. package/lib/{components → defaults}/DefaultRouter.js +0 -0
  139. package/lib/defaults/DefaultRouter.js.map +1 -0
  140. package/lib/defaults/index.d.ts +5 -0
  141. package/lib/defaults/index.js +9 -0
  142. package/lib/defaults/index.js.map +1 -0
  143. package/lib/hooks/actions.js +1 -1
  144. package/lib/hooks/actions.js.map +1 -1
  145. package/lib/hooks/index.js +6 -6
  146. package/lib/hooks/index.js.map +1 -1
  147. package/lib/index.d.ts +1 -0
  148. package/lib/index.js +9 -8
  149. package/lib/index.js.map +1 -1
  150. package/lib/modules/index.js +3 -3
  151. package/lib/modules/index.js.map +1 -1
  152. package/lib/{components → setters}/SetComponent.d.ts +0 -0
  153. package/lib/{components → setters}/SetComponent.js +0 -0
  154. package/lib/setters/SetComponent.js.map +1 -0
  155. package/lib/{components → setters}/SetError.d.ts +0 -0
  156. package/lib/{components → setters}/SetError.js +0 -0
  157. package/lib/setters/SetError.js.map +1 -0
  158. package/lib/{components → setters}/SetErrors.d.ts +0 -0
  159. package/lib/{components → setters}/SetErrors.js +0 -0
  160. package/lib/setters/SetErrors.js.map +1 -0
  161. package/lib/{components → setters}/SetLayout.d.ts +0 -0
  162. package/lib/{components → setters}/SetLayout.js +0 -0
  163. package/lib/setters/SetLayout.js.map +1 -0
  164. package/lib/{components → setters}/SetProvider.d.ts +0 -0
  165. package/lib/{components → setters}/SetProvider.js +0 -0
  166. package/lib/setters/SetProvider.js.map +1 -0
  167. package/lib/{components → setters}/SetRedirect.d.ts +0 -0
  168. package/lib/{components → setters}/SetRedirect.js +0 -0
  169. package/lib/setters/SetRedirect.js.map +1 -0
  170. package/lib/{components → setters}/SetRoute.d.ts +0 -0
  171. package/lib/{components → setters}/SetRoute.js +0 -0
  172. package/lib/setters/SetRoute.js.map +1 -0
  173. package/lib/setters/index.d.ts +7 -0
  174. package/lib/setters/index.js +11 -0
  175. package/lib/setters/index.js.map +1 -0
  176. package/lib/state/createGlobalState.js +6 -7
  177. package/lib/state/createGlobalState.js.map +1 -1
  178. package/lib/state/index.js +4 -4
  179. package/lib/state/index.js.map +1 -1
  180. package/lib/state/withApi.js.map +1 -1
  181. package/lib/types/components.d.ts +9 -1
  182. package/lib/types/index.js +12 -12
  183. package/lib/types/index.js.map +1 -1
  184. package/lib/types/instance.d.ts +10 -3
  185. package/lib/types/state.d.ts +2 -12
  186. package/lib/utils/compare.d.ts +1 -1
  187. package/lib/utils/compare.js +22 -5
  188. package/lib/utils/compare.js.map +1 -1
  189. package/lib/utils/helpers.js +1 -1
  190. package/lib/utils/helpers.js.map +1 -1
  191. package/lib/utils/index.js +10 -10
  192. package/lib/utils/index.js.map +1 -1
  193. package/lib/utils/media.js +1 -1
  194. package/lib/utils/media.js.map +1 -1
  195. package/package.json +20 -8
  196. package/src/Piral.test.tsx +3 -3
  197. package/src/Piral.tsx +18 -14
  198. package/src/PiralContext.tsx +43 -0
  199. package/src/actions/app.test.ts +0 -18
  200. package/src/actions/app.ts +0 -8
  201. package/src/actions/state.ts +6 -1
  202. package/src/components/ErrorBoundary.tsx +7 -3
  203. package/src/components/PiralGlobals.tsx +16 -0
  204. package/src/components/PiralRoutes.test.tsx +1 -1
  205. package/src/components/PiralSuspense.tsx +19 -0
  206. package/src/components/PiralView-server.test.tsx +1 -0
  207. package/src/components/PiralView.test.tsx +1 -0
  208. package/src/components/PiralView.tsx +28 -47
  209. package/src/components/ResponsiveLayout.test.tsx +14 -43
  210. package/src/components/ResponsiveLayout.tsx +18 -15
  211. package/src/components/components.tsx +13 -6
  212. package/src/components/index.ts +2 -12
  213. package/src/{components → defaults}/DefaultErrorInfo.test.tsx +0 -0
  214. package/src/{components → defaults}/DefaultErrorInfo.tsx +1 -2
  215. package/src/{components → defaults}/DefaultLayout.test.tsx +0 -0
  216. package/src/{components → defaults}/DefaultLayout.tsx +1 -1
  217. package/src/{components/DefaultLoader.test.tsx → defaults/DefaultLoadingIndicator.test.tsx} +2 -2
  218. package/src/{components/DefaultLoader.tsx → defaults/DefaultLoadingIndicator.tsx} +0 -0
  219. package/src/{components → defaults}/DefaultRouteSwitch.tsx +0 -0
  220. package/src/{components → defaults}/DefaultRouter.tsx +2 -1
  221. package/src/defaults/index.ts +5 -0
  222. package/src/index.tsx +1 -0
  223. package/src/{components → setters}/SetComponent.test.tsx +0 -0
  224. package/src/{components → setters}/SetComponent.tsx +0 -0
  225. package/src/{components → setters}/SetError.test.tsx +0 -0
  226. package/src/{components → setters}/SetError.tsx +0 -0
  227. package/src/{components → setters}/SetErrors.test.tsx +0 -0
  228. package/src/{components → setters}/SetErrors.tsx +0 -0
  229. package/src/{components → setters}/SetLayout.test.tsx +0 -0
  230. package/src/{components → setters}/SetLayout.tsx +0 -0
  231. package/src/{components → setters}/SetProvider.test.tsx +0 -0
  232. package/src/{components → setters}/SetProvider.tsx +0 -0
  233. package/src/{components → setters}/SetRedirect.test.tsx +0 -0
  234. package/src/{components → setters}/SetRedirect.tsx +0 -0
  235. package/src/{components → setters}/SetRoute.test.tsx +0 -0
  236. package/src/{components → setters}/SetRoute.tsx +0 -0
  237. package/src/setters/index.ts +7 -0
  238. package/src/state/createGlobalState.test.ts +1 -10
  239. package/src/state/createGlobalState.ts +2 -3
  240. package/src/state/withApi.tsx +2 -2
  241. package/src/types/components.ts +11 -2
  242. package/src/types/instance.ts +11 -3
  243. package/src/types/state.ts +2 -12
  244. package/src/utils/compare.test.ts +15 -15
  245. package/src/utils/compare.ts +23 -3
  246. package/src/utils/foreign.test.ts +1 -1
  247. package/src/utils/media.ts +1 -1
  248. package/esm/components/DefaultErrorInfo.js.map +0 -1
  249. package/esm/components/DefaultLayout.js.map +0 -1
  250. package/esm/components/DefaultLoader.js.map +0 -1
  251. package/esm/components/DefaultRouteSwitch.js.map +0 -1
  252. package/esm/components/DefaultRouter.d.ts +0 -2
  253. package/esm/components/DefaultRouter.js.map +0 -1
  254. package/esm/components/SetComponent.js.map +0 -1
  255. package/esm/components/SetError.js.map +0 -1
  256. package/esm/components/SetErrors.js.map +0 -1
  257. package/esm/components/SetLayout.js.map +0 -1
  258. package/esm/components/SetProvider.js.map +0 -1
  259. package/esm/components/SetRedirect.js.map +0 -1
  260. package/esm/components/SetRoute.js.map +0 -1
  261. package/lib/components/DefaultErrorInfo.js.map +0 -1
  262. package/lib/components/DefaultLayout.js.map +0 -1
  263. package/lib/components/DefaultLoader.js.map +0 -1
  264. package/lib/components/DefaultRouteSwitch.js.map +0 -1
  265. package/lib/components/DefaultRouter.d.ts +0 -2
  266. package/lib/components/DefaultRouter.js.map +0 -1
  267. package/lib/components/SetComponent.js.map +0 -1
  268. package/lib/components/SetError.js.map +0 -1
  269. package/lib/components/SetErrors.js.map +0 -1
  270. package/lib/components/SetLayout.js.map +0 -1
  271. package/lib/components/SetProvider.js.map +0 -1
  272. package/lib/components/SetRedirect.js.map +0 -1
  273. package/lib/components/SetRoute.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PiralGlobals = void 0;
4
+ const React = require("react");
5
+ const PortalRenderer_1 = require("./PortalRenderer");
6
+ const components_1 = require("./components");
7
+ /**
8
+ * Integrates the global portal renderer and the debug utilities
9
+ * (if registered).
10
+ */
11
+ const PiralGlobals = () => {
12
+ return (React.createElement(React.Fragment, null,
13
+ React.createElement(PortalRenderer_1.PortalRenderer, { id: "root" }),
14
+ React.createElement(components_1.RegisteredDebug, null)));
15
+ };
16
+ exports.PiralGlobals = PiralGlobals;
17
+ //# sourceMappingURL=PiralGlobals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PiralGlobals.js","sourceRoot":"","sources":["../../src/components/PiralGlobals.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,qDAAkD;AAClD,6CAA+C;AAE/C;;;GAGG;AACI,MAAM,YAAY,GAAa,GAAG,EAAE;IACzC,OAAO,CACL;QACE,oBAAC,+BAAc,IAAC,EAAE,EAAC,MAAM,GAAG;QAC5B,oBAAC,4BAAe,OAAG,CAClB,CACJ,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,YAAY,gBAOvB"}
@@ -8,7 +8,7 @@ const hooks_1 = require("../hooks");
8
8
  * The component for defining the exclusive routes to be used.
9
9
  */
10
10
  const PiralRoutes = (_a) => {
11
- var { NotFound, RouteSwitch } = _a, props = (0, tslib_1.__rest)(_a, ["NotFound", "RouteSwitch"]);
11
+ var { NotFound, RouteSwitch } = _a, props = tslib_1.__rest(_a, ["NotFound", "RouteSwitch"]);
12
12
  const routes = (0, hooks_1.useGlobalState)((s) => s.routes);
13
13
  const pages = (0, hooks_1.useGlobalState)((s) => s.registry.pages);
14
14
  const paths = [];
@@ -1 +1 @@
1
- {"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAE/B,oCAA0C;AAiB1C;;GAEG;AACI,MAAM,WAAW,GAA0B,CAAC,EAAmC,EAAE,EAAE;QAAvC,EAAE,QAAQ,EAAE,WAAW,OAAY,EAAP,KAAK,2BAAjC,2BAAmC,CAAF;IAClF,MAAM,MAAM,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACjF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAEzF,OAAO,oBAAC,WAAW,kBAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,IAAM,KAAK,EAAI,CAAC;AACtE,CAAC,CAAC;AATW,QAAA,WAAW,eAStB;AACF,mBAAW,CAAC,WAAW,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAE/B,oCAA0C;AAiB1C;;GAEG;AACI,MAAM,WAAW,GAA0B,CAAC,EAAmC,EAAE,EAAE;QAAvC,EAAE,QAAQ,EAAE,WAAW,OAAY,EAAP,KAAK,sBAAjC,2BAAmC,CAAF;IAClF,MAAM,MAAM,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACjF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAEzF,OAAO,oBAAC,WAAW,kBAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,IAAM,KAAK,EAAI,CAAC;AACtE,CAAC,CAAC;AATW,QAAA,WAAW,eAStB;AACF,mBAAW,CAAC,WAAW,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface PiralSuspenseProps {
3
+ children?: React.ReactNode;
4
+ }
5
+ export declare const PiralSuspense: React.FC<PiralSuspenseProps>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PiralSuspense = void 0;
4
+ const React = require("react");
5
+ const components_1 = require("./components");
6
+ const hooks_1 = require("../hooks");
7
+ const PiralSuspense = ({ children }) => {
8
+ const { error, loading } = (0, hooks_1.useGlobalState)((m) => m.app);
9
+ return error ? (React.createElement(components_1.RegisteredErrorInfo, { type: "loading", error: error })) : loading ? (React.createElement(components_1.RegisteredLoadingIndicator, null)) : (React.createElement(React.Fragment, null, children));
10
+ };
11
+ exports.PiralSuspense = PiralSuspense;
12
+ //# sourceMappingURL=PiralSuspense.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PiralSuspense.js","sourceRoot":"","sources":["../../src/components/PiralSuspense.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,6CAA+E;AAC/E,oCAA0C;AAMnC,MAAM,aAAa,GAAiC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1E,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAExD,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,gCAAmB,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,GAAI,CACrD,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,oBAAC,uCAA0B,OAAG,CAC/B,CAAC,CAAC,CAAC,CACF,0CAAG,QAAQ,CAAI,CAChB,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,aAAa,iBAUxB"}
@@ -1,11 +1,20 @@
1
1
  import * as React from 'react';
2
+ import { LayoutBreakpoints } from '../types';
2
3
  /**
3
4
  * The props for the PiralView component.
4
5
  */
5
6
  export interface PiralViewProps {
7
+ /**
8
+ * The custom breakpoints for the different layout modi.
9
+ */
10
+ breakpoints?: LayoutBreakpoints;
11
+ /**
12
+ * The extra content.
13
+ */
14
+ children: React.ReactNode;
6
15
  }
7
16
  /**
8
17
  * The component responsible for the generic view of the application.
9
- * This includes the global providers, the used Router, the current content and some convenience.
18
+ * This includes the used the current content and some convenience.
10
19
  */
11
20
  export declare const PiralView: React.FC<PiralViewProps>;
@@ -2,34 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PiralView = void 0;
4
4
  const React = require("react");
5
- const react_router_1 = require("react-router");
5
+ const PiralGlobals_1 = require("./PiralGlobals");
6
6
  const PiralRoutes_1 = require("./PiralRoutes");
7
+ const PiralSuspense_1 = require("./PiralSuspense");
8
+ const ResponsiveLayout_1 = require("./ResponsiveLayout");
7
9
  const components_1 = require("./components");
8
- const hooks_1 = require("../hooks");
9
- const NotFound = (props) => React.createElement(components_1.PiralError, Object.assign({ type: "not_found" }, props));
10
- const PiralContent = () => {
11
- const { error, loading, layout } = (0, hooks_1.useGlobalState)((m) => m.app);
12
- return error ? (React.createElement(components_1.PiralError, { type: "loading", error: error })) : loading ? (React.createElement(components_1.PiralLoadingIndicator, null)) : (React.createElement(components_1.PiralLayout, { currentLayout: layout },
13
- React.createElement(PiralRoutes_1.PiralRoutes, { NotFound: NotFound, RouteSwitch: components_1.PiralRouteSwitch })));
14
- };
15
- const FallbackRouter = (props) => {
16
- const publicPath = (0, hooks_1.useGlobalState)((s) => s.app.publicPath);
17
- return React.createElement(react_router_1.StaticRouter, Object.assign({ location: "/" }, props, { basename: publicPath }));
18
- };
19
- const Router = typeof window === 'undefined' ? FallbackRouter : components_1.PiralRouter;
20
- const PiralProvider = ({ children }) => {
21
- const provider = (0, hooks_1.useGlobalState)((m) => m.provider) || React.Fragment;
22
- return React.createElement(provider, undefined, children);
23
- };
10
+ const NotFound = (props) => React.createElement(components_1.RegisteredErrorInfo, Object.assign({ type: "not_found" }, props));
24
11
  /**
25
12
  * The component responsible for the generic view of the application.
26
- * This includes the global providers, the used Router, the current content and some convenience.
13
+ * This includes the used the current content and some convenience.
27
14
  */
28
- const PiralView = ({ children }) => (React.createElement(PiralProvider, null,
29
- React.createElement(Router, null,
30
- React.createElement(PiralContent, null),
31
- children,
32
- React.createElement(components_1.PiralDebug, null))));
15
+ const PiralView = ({ breakpoints, children }) => (React.createElement(React.Fragment, null,
16
+ React.createElement(PiralGlobals_1.PiralGlobals, null),
17
+ React.createElement(PiralSuspense_1.PiralSuspense, null,
18
+ React.createElement(ResponsiveLayout_1.ResponsiveLayout, { breakpoints: breakpoints, Layout: components_1.RegisteredLayout },
19
+ React.createElement(PiralRoutes_1.PiralRoutes, { NotFound: NotFound, RouteSwitch: components_1.RegisteredRouteSwitch }))),
20
+ children));
33
21
  exports.PiralView = PiralView;
34
22
  exports.PiralView.displayName = 'PiralView';
35
23
  //# sourceMappingURL=PiralView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PiralView.js","sourceRoot":"","sources":["../../src/components/PiralView.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+CAAiE;AACjE,+CAA4C;AAC5C,6CAOsB;AACtB,oCAA0C;AAE1C,MAAM,QAAQ,GAAkC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,uBAAU,kBAAC,IAAI,EAAC,WAAW,IAAK,KAAK,EAAI,CAAC;AAEtG,MAAM,YAAY,GAAa,GAAG,EAAE;IAClC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAEhE,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,uBAAU,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,GAAI,CAC5C,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,oBAAC,kCAAqB,OAAG,CAC1B,CAAC,CAAC,CAAC,CACF,oBAAC,wBAAW,IAAC,aAAa,EAAE,MAAM;QAChC,oBAAC,yBAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAAgB,GAAI,CACtD,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAa,CAAC,KAAK,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC3D,OAAO,oBAAC,2BAAY,kBAAC,QAAQ,EAAC,GAAG,IAAK,KAAK,IAAE,QAAQ,EAAE,UAAU,IAAI,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,wBAAW,CAAC;AAE5E,MAAM,aAAa,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC;IACrE,OAAO,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC5D,CAAC,CAAC;AAOF;;;GAGG;AACI,MAAM,SAAS,GAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACnE,oBAAC,aAAa;IACZ,oBAAC,MAAM;QACL,oBAAC,YAAY,OAAG;QACf,QAAQ;QACT,oBAAC,uBAAU,OAAG,CACP,CACK,CACjB,CAAC;AARW,QAAA,SAAS,aAQpB;AACF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
1
+ {"version":3,"file":"PiralView.js","sourceRoot":"","sources":["../../src/components/PiralView.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,iDAA8C;AAC9C,+CAA4C;AAC5C,mDAAgD;AAChD,yDAAsD;AACtD,6CAA4F;AAG5F,MAAM,QAAQ,GAAkC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,gCAAmB,kBAAC,IAAI,EAAC,WAAW,IAAK,KAAK,EAAI,CAAC;AAgB/G;;;GAGG;AACI,MAAM,SAAS,GAA6B,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAChF;IACE,oBAAC,2BAAY,OAAG;IAChB,oBAAC,6BAAa;QACZ,oBAAC,mCAAgB,IAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,6BAAgB;YAClE,oBAAC,yBAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAqB,GAAI,CACtD,CACL;IACf,QAAQ,CACR,CACJ,CAAC;AAVW,QAAA,SAAS,aAUpB;AACF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { LayoutBreakpoints } from '../types';
2
+ import { LayoutBreakpoints, LayoutProps } from '../types';
3
3
  /**
4
4
  * The props for the ResponsiveLayout component.
5
5
  */
@@ -8,6 +8,14 @@ export interface ResponsiveLayoutProps {
8
8
  * The individual breakpoints to be used for the different layouts.
9
9
  */
10
10
  breakpoints?: LayoutBreakpoints;
11
+ /**
12
+ * The actual layout component to render to transport.
13
+ */
14
+ Layout: React.ComponentType<LayoutProps>;
15
+ /**
16
+ * The content to display.
17
+ */
18
+ children: React.ReactNode;
11
19
  }
12
20
  /**
13
21
  * The component capable of identifying and switching the currently used layout.
@@ -7,16 +7,9 @@ const utils_1 = require("../utils");
7
7
  /**
8
8
  * The component capable of identifying and switching the currently used layout.
9
9
  */
10
- const ResponsiveLayout = ({ breakpoints = utils_1.defaultBreakpoints, children }) => {
11
- const current = (0, hooks_1.useGlobalState)((m) => m.app.layout) || 'desktop';
12
- const { changeLayout } = (0, hooks_1.useGlobalStateContext)();
13
- const selected = (0, hooks_1.useMedia)(breakpoints, utils_1.defaultLayouts, current);
14
- React.useEffect(() => {
15
- if (selected !== current) {
16
- changeLayout(selected);
17
- }
18
- }, [selected]);
19
- return (0, utils_1.defaultRender)(children);
10
+ const ResponsiveLayout = ({ breakpoints = utils_1.defaultBreakpoints, Layout, children, }) => {
11
+ const selected = (0, hooks_1.useMedia)(breakpoints, utils_1.defaultLayouts, 'desktop');
12
+ return React.createElement(Layout, { currentLayout: selected }, children);
20
13
  };
21
14
  exports.ResponsiveLayout = ResponsiveLayout;
22
15
  exports.ResponsiveLayout.displayName = 'ResponsiveLayout';
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsiveLayout.js","sourceRoot":"","sources":["../../src/components/ResponsiveLayout.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAA2E;AAC3E,oCAA6E;AAa7E;;GAEG;AACI,MAAM,gBAAgB,GAAoC,CAAC,EAAE,WAAW,GAAG,0BAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClH,MAAM,OAAO,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;IACjE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,6BAAqB,GAAE,CAAC;IACjD,MAAM,QAAQ,GAAG,IAAA,gBAAQ,EAAC,WAAW,EAAE,sBAAc,EAAE,OAAO,CAAC,CAAC;IAEhE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,KAAK,OAAO,EAAE;YACxB,YAAY,CAAC,QAAQ,CAAC,CAAC;SACxB;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,IAAA,qBAAa,EAAC,QAAQ,CAAC,CAAC;AACjC,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B;AACF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ResponsiveLayout.js","sourceRoot":"","sources":["../../src/components/ResponsiveLayout.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAAoC;AACpC,oCAA8D;AAqB9D;;GAEG;AACI,MAAM,gBAAgB,GAAoC,CAAC,EAChE,WAAW,GAAG,0BAAkB,EAChC,MAAM,EACN,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,IAAA,gBAAQ,EAAC,WAAW,EAAE,sBAAc,EAAE,SAAS,CAAC,CAAC;IAClE,OAAO,oBAAC,MAAM,IAAC,aAAa,EAAE,QAAQ,IAAG,QAAQ,CAAU,CAAC;AAC9D,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B;AACF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
@@ -1,33 +1,40 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentsState } from '../types';
3
+ /**
4
+ * Gets a registered layout component by its name.
5
+ * This will always return a valid component. If nothing is found
6
+ * then the returned component will just return null.
7
+ * @param name The name of the registered layout component.
8
+ * @returns The registered layout component or an empty stub component.
9
+ */
3
10
  export declare function getPiralComponent<TKey extends keyof ComponentsState>(name: TKey): ComponentsState[TKey];
4
11
  /**
5
12
  * Gets the currently registered ErrorInfo component.
6
13
  * By default the DefaultErrorInfo component is used.
7
14
  */
8
- export declare const PiralError: React.ComponentType<import("../types").ErrorInfoProps>;
15
+ export declare const RegisteredErrorInfo: React.ComponentType<import("../types").ErrorInfoProps>;
9
16
  /**
10
17
  * Gets the currently registered LoadingIndicator component.
11
18
  * By default only Loading is rendered.
12
19
  */
13
- export declare const PiralLoadingIndicator: React.ComponentType<import("../types").LoadingIndicatorProps>;
20
+ export declare const RegisteredLoadingIndicator: React.ComponentType<import("../types").LoadingIndicatorProps>;
14
21
  /**
15
22
  * Gets the currently registered Router component.
16
23
  * By default the BrowserRouter is used.
17
24
  */
18
- export declare const PiralRouter: React.ComponentType<import("../types").RouterProps>;
25
+ export declare const RegisteredRouter: React.ComponentType<import("../types").RouterProps>;
19
26
  /**
20
27
  * Gets the currently registered Route Switch component.
21
28
  * By default the DefaultRouteSwitch component is used.
22
29
  */
23
- export declare const PiralRouteSwitch: React.ComponentType<import("../types").RouteSwitchProps>;
30
+ export declare const RegisteredRouteSwitch: React.ComponentType<import("../types").RouteSwitchProps>;
24
31
  /**
25
32
  * Gets the currently registered Layout component.
26
33
  * By default the children are rendered.
27
34
  */
28
- export declare const PiralLayout: React.ComponentType<import("../types").LayoutProps>;
35
+ export declare const RegisteredLayout: React.ComponentType<import("../types").LayoutProps>;
29
36
  /**
30
37
  * Gets the currently registered Debug component.
31
38
  * By default nothing is used.
32
39
  */
33
- export declare const PiralDebug: React.ComponentType<{}>;
40
+ export declare const RegisteredDebug: React.ComponentType<{}>;
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PiralDebug = exports.PiralLayout = exports.PiralRouteSwitch = exports.PiralRouter = exports.PiralLoadingIndicator = exports.PiralError = exports.getPiralComponent = void 0;
3
+ exports.RegisteredDebug = exports.RegisteredLayout = exports.RegisteredRouteSwitch = exports.RegisteredRouter = exports.RegisteredLoadingIndicator = exports.RegisteredErrorInfo = exports.getPiralComponent = void 0;
4
4
  const React = require("react");
5
5
  const hooks_1 = require("../hooks");
6
+ /**
7
+ * Gets a registered layout component by its name.
8
+ * This will always return a valid component. If nothing is found
9
+ * then the returned component will just return null.
10
+ * @param name The name of the registered layout component.
11
+ * @returns The registered layout component or an empty stub component.
12
+ */
6
13
  function getPiralComponent(name) {
7
14
  return (props) => {
8
15
  const Component = (0, hooks_1.useGlobalState)((s) => s.components[name]);
@@ -15,30 +22,30 @@ exports.getPiralComponent = getPiralComponent;
15
22
  * Gets the currently registered ErrorInfo component.
16
23
  * By default the DefaultErrorInfo component is used.
17
24
  */
18
- exports.PiralError = getPiralComponent('ErrorInfo');
25
+ exports.RegisteredErrorInfo = getPiralComponent('ErrorInfo');
19
26
  /**
20
27
  * Gets the currently registered LoadingIndicator component.
21
28
  * By default only Loading is rendered.
22
29
  */
23
- exports.PiralLoadingIndicator = getPiralComponent('LoadingIndicator');
30
+ exports.RegisteredLoadingIndicator = getPiralComponent('LoadingIndicator');
24
31
  /**
25
32
  * Gets the currently registered Router component.
26
33
  * By default the BrowserRouter is used.
27
34
  */
28
- exports.PiralRouter = getPiralComponent('Router');
35
+ exports.RegisteredRouter = getPiralComponent('Router');
29
36
  /**
30
37
  * Gets the currently registered Route Switch component.
31
38
  * By default the DefaultRouteSwitch component is used.
32
39
  */
33
- exports.PiralRouteSwitch = getPiralComponent('RouteSwitch');
40
+ exports.RegisteredRouteSwitch = getPiralComponent('RouteSwitch');
34
41
  /**
35
42
  * Gets the currently registered Layout component.
36
43
  * By default the children are rendered.
37
44
  */
38
- exports.PiralLayout = getPiralComponent('Layout');
45
+ exports.RegisteredLayout = getPiralComponent('Layout');
39
46
  /**
40
47
  * Gets the currently registered Debug component.
41
48
  * By default nothing is used.
42
49
  */
43
- exports.PiralDebug = getPiralComponent('Debug');
50
+ exports.RegisteredDebug = getPiralComponent('Debug');
44
51
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAA0C;AAG1C,SAAgB,iBAAiB,CAAqC,IAAU;IAC9E,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5D,2CAA2C;QAC3C,OAAO,SAAS,CAAC,CAAC,CAAC,oBAAC,SAAS,oBAAK,KAAK,EAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC;AAND,8CAMC;AAED;;;GAGG;AACU,QAAA,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAEzD;;;GAGG;AACU,QAAA,qBAAqB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAE3E;;;GAGG;AACU,QAAA,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEvD;;;GAGG;AACU,QAAA,gBAAgB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEjE;;;GAGG;AACU,QAAA,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEvD;;;GAGG;AACU,QAAA,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAA0C;AAG1C;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAqC,IAAU;IAC9E,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5D,2CAA2C;QAC3C,OAAO,SAAS,CAAC,CAAC,CAAC,oBAAC,SAAS,oBAAK,KAAK,EAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC;AAND,8CAMC;AAED;;;GAGG;AACU,QAAA,mBAAmB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAElE;;;GAGG;AACU,QAAA,0BAA0B,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAEhF;;;GAGG;AACU,QAAA,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAE5D;;;GAGG;AACU,QAAA,qBAAqB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEtE;;;GAGG;AACU,QAAA,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAE5D;;;GAGG;AACU,QAAA,eAAe,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC"}
@@ -1,22 +1,12 @@
1
1
  export * from './components';
2
- export * from './DefaultErrorInfo';
3
- export * from './DefaultLayout';
4
- export * from './DefaultLoader';
5
- export * from './DefaultRouter';
6
- export * from './DefaultRouteSwitch';
7
2
  export * from './ErrorBoundary';
8
3
  export * from './ExtensionSlot';
9
4
  export * from './Mediator';
5
+ export * from './PiralGlobals';
10
6
  export * from './PiralRoutes';
7
+ export * from './PiralSuspense';
11
8
  export * from './PiralView';
12
9
  export * from './PortalRenderer';
13
10
  export * from './ResponsiveLayout';
14
- export * from './SetComponent';
15
- export * from './SetError';
16
- export * from './SetErrors';
17
- export * from './SetLayout';
18
- export * from './SetProvider';
19
- export * from './SetRedirect';
20
- export * from './SetRoute';
21
11
  export * from './SwitchErrorInfo';
22
12
  export * from './wrapComponent';
@@ -1,26 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./components"), exports);
5
- (0, tslib_1.__exportStar)(require("./DefaultErrorInfo"), exports);
6
- (0, tslib_1.__exportStar)(require("./DefaultLayout"), exports);
7
- (0, tslib_1.__exportStar)(require("./DefaultLoader"), exports);
8
- (0, tslib_1.__exportStar)(require("./DefaultRouter"), exports);
9
- (0, tslib_1.__exportStar)(require("./DefaultRouteSwitch"), exports);
10
- (0, tslib_1.__exportStar)(require("./ErrorBoundary"), exports);
11
- (0, tslib_1.__exportStar)(require("./ExtensionSlot"), exports);
12
- (0, tslib_1.__exportStar)(require("./Mediator"), exports);
13
- (0, tslib_1.__exportStar)(require("./PiralRoutes"), exports);
14
- (0, tslib_1.__exportStar)(require("./PiralView"), exports);
15
- (0, tslib_1.__exportStar)(require("./PortalRenderer"), exports);
16
- (0, tslib_1.__exportStar)(require("./ResponsiveLayout"), exports);
17
- (0, tslib_1.__exportStar)(require("./SetComponent"), exports);
18
- (0, tslib_1.__exportStar)(require("./SetError"), exports);
19
- (0, tslib_1.__exportStar)(require("./SetErrors"), exports);
20
- (0, tslib_1.__exportStar)(require("./SetLayout"), exports);
21
- (0, tslib_1.__exportStar)(require("./SetProvider"), exports);
22
- (0, tslib_1.__exportStar)(require("./SetRedirect"), exports);
23
- (0, tslib_1.__exportStar)(require("./SetRoute"), exports);
24
- (0, tslib_1.__exportStar)(require("./SwitchErrorInfo"), exports);
25
- (0, tslib_1.__exportStar)(require("./wrapComponent"), exports);
4
+ tslib_1.__exportStar(require("./components"), exports);
5
+ tslib_1.__exportStar(require("./ErrorBoundary"), exports);
6
+ tslib_1.__exportStar(require("./ExtensionSlot"), exports);
7
+ tslib_1.__exportStar(require("./Mediator"), exports);
8
+ tslib_1.__exportStar(require("./PiralGlobals"), exports);
9
+ tslib_1.__exportStar(require("./PiralRoutes"), exports);
10
+ tslib_1.__exportStar(require("./PiralSuspense"), exports);
11
+ tslib_1.__exportStar(require("./PiralView"), exports);
12
+ tslib_1.__exportStar(require("./PortalRenderer"), exports);
13
+ tslib_1.__exportStar(require("./ResponsiveLayout"), exports);
14
+ tslib_1.__exportStar(require("./SwitchErrorInfo"), exports);
15
+ tslib_1.__exportStar(require("./wrapComponent"), exports);
26
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,kEAAmC;AACnC,+DAAgC;AAChC,+DAAgC;AAChC,+DAAgC;AAChC,oEAAqC;AACrC,+DAAgC;AAChC,+DAAgC;AAChC,0DAA2B;AAC3B,6DAA8B;AAC9B,2DAA4B;AAC5B,gEAAiC;AACjC,kEAAmC;AACnC,8DAA+B;AAC/B,0DAA2B;AAC3B,2DAA4B;AAC5B,2DAA4B;AAC5B,6DAA8B;AAC9B,6DAA8B;AAC9B,0DAA2B;AAC3B,iEAAkC;AAClC,+DAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,0DAAgC;AAChC,0DAAgC;AAChC,qDAA2B;AAC3B,yDAA+B;AAC/B,wDAA8B;AAC9B,0DAAgC;AAChC,sDAA4B;AAC5B,2DAAiC;AACjC,6DAAmC;AACnC,4DAAkC;AAClC,0DAAgC"}
@@ -2,14 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultErrorInfo = void 0;
4
4
  const React = require("react");
5
- const ExtensionSlot_1 = require("./ExtensionSlot");
6
- const SwitchErrorInfo_1 = require("./SwitchErrorInfo");
5
+ const components_1 = require("../components");
7
6
  /**
8
7
  * The default error info component. Just uses the "error" extension slot.
9
8
  * Leverage the default one by registration of respective extensions using
10
9
  * the "error" name.
11
10
  */
12
- const DefaultErrorInfo = (props) => (React.createElement(ExtensionSlot_1.ExtensionSlot, { name: "error", params: props, empty: () => React.createElement(SwitchErrorInfo_1.SwitchErrorInfo, Object.assign({ key: "default_error" }, props)) }));
11
+ const DefaultErrorInfo = (props) => (React.createElement(components_1.ExtensionSlot, { name: "error", params: props, empty: () => React.createElement(components_1.SwitchErrorInfo, Object.assign({ key: "default_error" }, props)) }));
13
12
  exports.DefaultErrorInfo = DefaultErrorInfo;
14
13
  exports.DefaultErrorInfo.displayName = 'DefaultErrorInfo';
15
14
  //# sourceMappingURL=DefaultErrorInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultErrorInfo.js","sourceRoot":"","sources":["../../src/defaults/DefaultErrorInfo.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,8CAA+D;AAG/D;;;;GAIG;AACI,MAAM,gBAAgB,GAA6B,CAAC,KAAK,EAAE,EAAE,CAAC,CACnE,oBAAC,0BAAa,IAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,oBAAC,4BAAe,kBAAC,GAAG,EAAC,eAAe,IAAK,KAAK,EAAI,GAAI,CAC/G,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AACF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultLayout.js","sourceRoot":"","sources":["../../src/defaults/DefaultLayout.tsx"],"names":[],"mappings":";;;AACA,oCAAyC;AAGzC;;GAEG;AACI,MAAM,aAAa,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,QAAQ,CAAC,CAAC;AAAjF,QAAA,aAAa,iBAAoE;AAC9F,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
@@ -8,4 +8,4 @@ const React = require("react");
8
8
  const DefaultLoadingIndicator = () => React.createElement("div", null, "Loading");
9
9
  exports.DefaultLoadingIndicator = DefaultLoadingIndicator;
10
10
  exports.DefaultLoadingIndicator.displayName = 'DefaultLoadingIndicator';
11
- //# sourceMappingURL=DefaultLoader.js.map
11
+ //# sourceMappingURL=DefaultLoadingIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultLoadingIndicator.js","sourceRoot":"","sources":["../../src/defaults/DefaultLoadingIndicator.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAG/B;;GAEG;AACI,MAAM,uBAAuB,GAAoC,GAAG,EAAE,CAAC,2CAAkB,CAAC;AAApF,QAAA,uBAAuB,2BAA6D;AACjG,+BAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC"}
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const React = require("react");
6
6
  const react_router_1 = require("react-router");
7
7
  const DefaultRouteSwitch = (_a) => {
8
- var { paths, NotFound } = _a, props = (0, tslib_1.__rest)(_a, ["paths", "NotFound"]);
8
+ var { paths, NotFound } = _a, props = tslib_1.__rest(_a, ["paths", "NotFound"]);
9
9
  return (React.createElement(react_router_1.Switch, Object.assign({}, props),
10
10
  paths.map(({ path, Component }) => (React.createElement(react_router_1.Route, { exact: true, key: path, path: path, component: Component }))),
11
11
  React.createElement(react_router_1.Route, { component: NotFound })));
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultRouteSwitch.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouteSwitch.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAC/B,+CAA6C;AAGtC,MAAM,kBAAkB,GAA+B,CAAC,EAA6B,EAAE,EAAE;QAAjC,EAAE,KAAK,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAA3B,qBAA6B,CAAF;IACxF,OAAO,CACL,oBAAC,qBAAM,oBAAK,KAAK;QACd,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAClC,oBAAC,oBAAK,IAAC,KAAK,QAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAC7D,CAAC;QACF,oBAAC,oBAAK,IAAC,SAAS,EAAE,QAAQ,GAAI,CACvB,CACV,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B"}
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { RouterProps } from '../types';
3
+ export declare const DefaultRouter: React.FC<RouterProps>;
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultRouter.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouter.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,uDAAiD;AACjD,oCAA0C;AAGnC,MAAM,aAAa,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnE,MAAM,UAAU,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC3D,OAAO,oBAAC,gCAAa,IAAC,QAAQ,EAAE,UAAU,IAAG,QAAQ,CAAiB,CAAC;AACzE,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB"}
@@ -0,0 +1,5 @@
1
+ export * from './DefaultErrorInfo';
2
+ export * from './DefaultLayout';
3
+ export * from './DefaultLoadingIndicator';
4
+ export * from './DefaultRouter';
5
+ export * from './DefaultRouteSwitch';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./DefaultErrorInfo"), exports);
5
+ tslib_1.__exportStar(require("./DefaultLayout"), exports);
6
+ tslib_1.__exportStar(require("./DefaultLoadingIndicator"), exports);
7
+ tslib_1.__exportStar(require("./DefaultRouter"), exports);
8
+ tslib_1.__exportStar(require("./DefaultRouteSwitch"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/defaults/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,0DAAgC;AAChC,oEAA0C;AAC1C,0DAAgC;AAChC,+DAAqC"}
@@ -8,7 +8,7 @@ const stateContext_1 = require("../state/stateContext");
8
8
  * Hook that gets the actions for manipulating the global state.
9
9
  */
10
10
  function useActions() {
11
- const _a = (0, react_1.useContext)(stateContext_1.StateContext), { state } = _a, actions = (0, tslib_1.__rest)(_a, ["state"]);
11
+ const _a = (0, react_1.useContext)(stateContext_1.StateContext), { state } = _a, actions = tslib_1.__rest(_a, ["state"]);
12
12
  return actions;
13
13
  }
14
14
  exports.useActions = useActions;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/hooks/actions.ts"],"names":[],"mappings":";;;;AAAA,iCAAmC;AACnC,wDAAqD;AAGrD;;GAEG;AACH,SAAgB,UAAU;IACxB,MAAM,KAAwB,IAAA,kBAAU,EAAqB,2BAAY,CAAC,EAApE,EAAE,KAAK,OAA6D,EAAxD,OAAO,2BAAnB,SAAqB,CAA+C,CAAC;IAC3E,OAAO,OAAuB,CAAC;AACjC,CAAC;AAHD,gCAGC"}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/hooks/actions.ts"],"names":[],"mappings":";;;;AAAA,iCAAmC;AACnC,wDAAqD;AAGrD;;GAEG;AACH,SAAgB,UAAU;IACxB,MAAM,KAAwB,IAAA,kBAAU,EAAqB,2BAAY,CAAC,EAApE,EAAE,KAAK,OAA6D,EAAxD,OAAO,sBAAnB,SAAqB,CAA+C,CAAC;IAC3E,OAAO,OAAuB,CAAC;AACjC,CAAC;AAHD,gCAGC"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./action"), exports);
5
- (0, tslib_1.__exportStar)(require("./actions"), exports);
6
- (0, tslib_1.__exportStar)(require("./globalState"), exports);
7
- (0, tslib_1.__exportStar)(require("./media"), exports);
8
- (0, tslib_1.__exportStar)(require("./setter"), exports);
9
- (0, tslib_1.__exportStar)(require("./sharedData"), exports);
4
+ tslib_1.__exportStar(require("./action"), exports);
5
+ tslib_1.__exportStar(require("./actions"), exports);
6
+ tslib_1.__exportStar(require("./globalState"), exports);
7
+ tslib_1.__exportStar(require("./media"), exports);
8
+ tslib_1.__exportStar(require("./setter"), exports);
9
+ tslib_1.__exportStar(require("./sharedData"), exports);
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;AAAA,wDAAyB;AACzB,yDAA0B;AAC1B,6DAA8B;AAC9B,uDAAwB;AACxB,wDAAyB;AACzB,4DAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,oDAA0B;AAC1B,wDAA8B;AAC9B,kDAAwB;AACxB,mDAAyB;AACzB,uDAA6B"}
package/lib/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './Piral';
3
3
  export * from './helpers';
4
4
  export * from './components';
5
5
  export * from './hooks';
6
+ export * from './setters';
6
7
  export * from './state';
7
8
  export * from './utils';
8
9
  export * from './types';
package/lib/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./createInstance"), exports);
5
- (0, tslib_1.__exportStar)(require("./Piral"), exports);
6
- (0, tslib_1.__exportStar)(require("./helpers"), exports);
7
- (0, tslib_1.__exportStar)(require("./components"), exports);
8
- (0, tslib_1.__exportStar)(require("./hooks"), exports);
9
- (0, tslib_1.__exportStar)(require("./state"), exports);
10
- (0, tslib_1.__exportStar)(require("./utils"), exports);
11
- (0, tslib_1.__exportStar)(require("./types"), exports);
4
+ tslib_1.__exportStar(require("./createInstance"), exports);
5
+ tslib_1.__exportStar(require("./Piral"), exports);
6
+ tslib_1.__exportStar(require("./helpers"), exports);
7
+ tslib_1.__exportStar(require("./components"), exports);
8
+ tslib_1.__exportStar(require("./hooks"), exports);
9
+ tslib_1.__exportStar(require("./setters"), exports);
10
+ tslib_1.__exportStar(require("./state"), exports);
11
+ tslib_1.__exportStar(require("./utils"), exports);
12
+ tslib_1.__exportStar(require("./types"), exports);
12
13
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;AAAA,gEAAiC;AACjC,uDAAwB;AACxB,yDAA0B;AAC1B,4DAA6B;AAC7B,uDAAwB;AACxB,uDAAwB;AACxB,uDAAwB;AACxB,uDAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,kDAAwB;AACxB,oDAA0B;AAC1B,uDAA6B;AAC7B,kDAAwB;AACxB,oDAA0B;AAC1B,kDAAwB;AACxB,kDAAwB;AACxB,kDAAwB"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./api"), exports);
5
- (0, tslib_1.__exportStar)(require("./dependencies"), exports);
6
- (0, tslib_1.__exportStar)(require("./element"), exports);
4
+ tslib_1.__exportStar(require("./api"), exports);
5
+ tslib_1.__exportStar(require("./dependencies"), exports);
6
+ tslib_1.__exportStar(require("./element"), exports);
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;AAAA,qDAAsB;AACtB,8DAA+B;AAC/B,yDAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,yDAA+B;AAC/B,oDAA0B"}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetComponent.js","sourceRoot":"","sources":["../../src/setters/SetComponent.tsx"],"names":[],"mappings":";;;AACA,oCAA4D;AAiB5D;;GAEG;AACH,SAAgB,YAAY,CAAqC,EAC/D,IAAI,EACJ,SAAS,GACe;IACxB,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,6BAAqB,GAAE,CAAC;IACjD,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,SAAS,IAAI,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IAC5D,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AARD,oCAQC"}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetError.js","sourceRoot":"","sources":["../../src/setters/SetError.tsx"],"names":[],"mappings":";;;AACA,oCAA4D;AAiB5D;;GAEG;AACH,SAAgB,QAAQ,CAA0C,EAChE,IAAI,EACJ,SAAS,GACW;IACpB,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,6BAAqB,GAAE,CAAC;IACtD,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,SAAS,IAAI,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IACjE,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AARD,4BAQC"}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetErrors.js","sourceRoot":"","sources":["../../src/setters/SetErrors.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,yCAAsC;AAatC;;GAEG;AACH,SAAgB,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,mBAAQ,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAC1D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AARD,8BAQC"}
File without changes
File without changes