piral-core 0.15.0-alpha.4036 → 0.15.0-alpha.4041

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 (245) 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.js +3 -3
  13. package/esm/components/ErrorBoundary.js.map +1 -1
  14. package/esm/components/PiralGlobals.d.ts +6 -0
  15. package/esm/components/PiralGlobals.js +13 -0
  16. package/esm/components/PiralGlobals.js.map +1 -0
  17. package/esm/components/PiralSuspense.d.ts +2 -0
  18. package/esm/components/PiralSuspense.js +8 -0
  19. package/esm/components/PiralSuspense.js.map +1 -0
  20. package/esm/components/PiralView.d.ts +6 -1
  21. package/esm/components/PiralView.js +12 -24
  22. package/esm/components/PiralView.js.map +1 -1
  23. package/esm/components/ResponsiveLayout.d.ts +2 -1
  24. package/esm/components/ResponsiveLayout.js +5 -12
  25. package/esm/components/ResponsiveLayout.js.map +1 -1
  26. package/esm/components/components.d.ts +13 -6
  27. package/esm/components/components.js +13 -6
  28. package/esm/components/components.js.map +1 -1
  29. package/esm/components/index.d.ts +2 -12
  30. package/esm/components/index.js +2 -12
  31. package/esm/components/index.js.map +1 -1
  32. package/esm/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
  33. package/esm/{components → defaults}/DefaultErrorInfo.js +1 -2
  34. package/esm/defaults/DefaultErrorInfo.js.map +1 -0
  35. package/esm/{components → defaults}/DefaultLayout.d.ts +0 -0
  36. package/esm/{components → defaults}/DefaultLayout.js +0 -0
  37. package/esm/defaults/DefaultLayout.js.map +1 -0
  38. package/esm/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
  39. package/esm/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +1 -1
  40. package/esm/defaults/DefaultLoadingIndicator.js.map +1 -0
  41. package/esm/{components → defaults}/DefaultRouteSwitch.d.ts +0 -0
  42. package/esm/{components → defaults}/DefaultRouteSwitch.js +0 -0
  43. package/esm/defaults/DefaultRouteSwitch.js.map +1 -0
  44. package/esm/{components → defaults}/DefaultRouter.d.ts +0 -0
  45. package/esm/{components → defaults}/DefaultRouter.js +0 -0
  46. package/esm/defaults/DefaultRouter.js.map +1 -0
  47. package/esm/defaults/index.d.ts +5 -0
  48. package/esm/defaults/index.js +6 -0
  49. package/esm/defaults/index.js.map +1 -0
  50. package/esm/index.d.ts +1 -0
  51. package/esm/index.js +1 -0
  52. package/esm/index.js.map +1 -1
  53. package/esm/{components → setters}/SetComponent.d.ts +0 -0
  54. package/esm/{components → setters}/SetComponent.js +0 -0
  55. package/esm/setters/SetComponent.js.map +1 -0
  56. package/esm/{components → setters}/SetError.d.ts +0 -0
  57. package/esm/{components → setters}/SetError.js +0 -0
  58. package/esm/setters/SetError.js.map +1 -0
  59. package/esm/{components → setters}/SetErrors.d.ts +0 -0
  60. package/esm/{components → setters}/SetErrors.js +0 -0
  61. package/esm/setters/SetErrors.js.map +1 -0
  62. package/esm/{components → setters}/SetLayout.d.ts +0 -0
  63. package/esm/{components → setters}/SetLayout.js +0 -0
  64. package/esm/setters/SetLayout.js.map +1 -0
  65. package/esm/{components → setters}/SetProvider.d.ts +0 -0
  66. package/esm/{components → setters}/SetProvider.js +0 -0
  67. package/esm/setters/SetProvider.js.map +1 -0
  68. package/esm/{components → setters}/SetRedirect.d.ts +0 -0
  69. package/esm/{components → setters}/SetRedirect.js +0 -0
  70. package/esm/setters/SetRedirect.js.map +1 -0
  71. package/esm/{components → setters}/SetRoute.d.ts +0 -0
  72. package/esm/{components → setters}/SetRoute.js +0 -0
  73. package/esm/setters/SetRoute.js.map +1 -0
  74. package/esm/setters/index.d.ts +7 -0
  75. package/esm/setters/index.js +8 -0
  76. package/esm/setters/index.js.map +1 -0
  77. package/esm/state/createGlobalState.js +1 -2
  78. package/esm/state/createGlobalState.js.map +1 -1
  79. package/esm/types/instance.d.ts +7 -2
  80. package/esm/types/state.d.ts +0 -10
  81. package/esm/utils/compare.d.ts +1 -1
  82. package/esm/utils/compare.js +20 -3
  83. package/esm/utils/compare.js.map +1 -1
  84. package/esm/utils/media.js +1 -1
  85. package/esm/utils/media.js.map +1 -1
  86. package/lib/Piral.d.ts +2 -2
  87. package/lib/Piral.js +13 -11
  88. package/lib/Piral.js.map +1 -1
  89. package/lib/PiralContext.d.ts +21 -0
  90. package/lib/PiralContext.js +38 -0
  91. package/lib/PiralContext.js.map +1 -0
  92. package/lib/actions/app.d.ts +1 -2
  93. package/lib/actions/app.js +1 -5
  94. package/lib/actions/app.js.map +1 -1
  95. package/lib/actions/state.js +5 -1
  96. package/lib/actions/state.js.map +1 -1
  97. package/lib/components/ErrorBoundary.js +2 -2
  98. package/lib/components/ErrorBoundary.js.map +1 -1
  99. package/lib/components/PiralGlobals.d.ts +6 -0
  100. package/lib/components/PiralGlobals.js +17 -0
  101. package/lib/components/PiralGlobals.js.map +1 -0
  102. package/lib/components/PiralSuspense.d.ts +2 -0
  103. package/lib/components/PiralSuspense.js +12 -0
  104. package/lib/components/PiralSuspense.js.map +1 -0
  105. package/lib/components/PiralView.d.ts +6 -1
  106. package/lib/components/PiralView.js +11 -23
  107. package/lib/components/PiralView.js.map +1 -1
  108. package/lib/components/ResponsiveLayout.d.ts +2 -1
  109. package/lib/components/ResponsiveLayout.js +3 -10
  110. package/lib/components/ResponsiveLayout.js.map +1 -1
  111. package/lib/components/components.d.ts +13 -6
  112. package/lib/components/components.js +14 -7
  113. package/lib/components/components.js.map +1 -1
  114. package/lib/components/index.d.ts +2 -12
  115. package/lib/components/index.js +2 -12
  116. package/lib/components/index.js.map +1 -1
  117. package/lib/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
  118. package/lib/{components → defaults}/DefaultErrorInfo.js +2 -3
  119. package/lib/defaults/DefaultErrorInfo.js.map +1 -0
  120. package/lib/{components → defaults}/DefaultLayout.d.ts +0 -0
  121. package/lib/{components → defaults}/DefaultLayout.js +0 -0
  122. package/lib/defaults/DefaultLayout.js.map +1 -0
  123. package/lib/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
  124. package/lib/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +1 -1
  125. package/lib/defaults/DefaultLoadingIndicator.js.map +1 -0
  126. package/lib/{components → defaults}/DefaultRouteSwitch.d.ts +0 -0
  127. package/lib/{components → defaults}/DefaultRouteSwitch.js +0 -0
  128. package/lib/defaults/DefaultRouteSwitch.js.map +1 -0
  129. package/lib/{components → defaults}/DefaultRouter.d.ts +0 -0
  130. package/lib/{components → defaults}/DefaultRouter.js +0 -0
  131. package/lib/defaults/DefaultRouter.js.map +1 -0
  132. package/lib/defaults/index.d.ts +5 -0
  133. package/lib/defaults/index.js +9 -0
  134. package/lib/defaults/index.js.map +1 -0
  135. package/lib/index.d.ts +1 -0
  136. package/lib/index.js +1 -0
  137. package/lib/index.js.map +1 -1
  138. package/lib/{components → setters}/SetComponent.d.ts +0 -0
  139. package/lib/{components → setters}/SetComponent.js +0 -0
  140. package/lib/setters/SetComponent.js.map +1 -0
  141. package/lib/{components → setters}/SetError.d.ts +0 -0
  142. package/lib/{components → setters}/SetError.js +0 -0
  143. package/lib/setters/SetError.js.map +1 -0
  144. package/lib/{components → setters}/SetErrors.d.ts +0 -0
  145. package/lib/{components → setters}/SetErrors.js +0 -0
  146. package/lib/setters/SetErrors.js.map +1 -0
  147. package/lib/{components → setters}/SetLayout.d.ts +0 -0
  148. package/lib/{components → setters}/SetLayout.js +0 -0
  149. package/lib/setters/SetLayout.js.map +1 -0
  150. package/lib/{components → setters}/SetProvider.d.ts +0 -0
  151. package/lib/{components → setters}/SetProvider.js +0 -0
  152. package/lib/setters/SetProvider.js.map +1 -0
  153. package/lib/{components → setters}/SetRedirect.d.ts +0 -0
  154. package/lib/{components → setters}/SetRedirect.js +0 -0
  155. package/lib/setters/SetRedirect.js.map +1 -0
  156. package/lib/{components → setters}/SetRoute.d.ts +0 -0
  157. package/lib/{components → setters}/SetRoute.js +0 -0
  158. package/lib/setters/SetRoute.js.map +1 -0
  159. package/lib/setters/index.d.ts +7 -0
  160. package/lib/setters/index.js +11 -0
  161. package/lib/setters/index.js.map +1 -0
  162. package/lib/state/createGlobalState.js +6 -7
  163. package/lib/state/createGlobalState.js.map +1 -1
  164. package/lib/types/instance.d.ts +7 -2
  165. package/lib/types/state.d.ts +0 -10
  166. package/lib/utils/compare.d.ts +1 -1
  167. package/lib/utils/compare.js +22 -5
  168. package/lib/utils/compare.js.map +1 -1
  169. package/lib/utils/media.js +1 -1
  170. package/lib/utils/media.js.map +1 -1
  171. package/package.json +16 -4
  172. package/src/Piral.test.tsx +3 -3
  173. package/src/Piral.tsx +18 -14
  174. package/src/PiralContext.tsx +39 -0
  175. package/src/actions/app.test.ts +0 -18
  176. package/src/actions/app.ts +0 -8
  177. package/src/actions/state.ts +6 -1
  178. package/src/components/ErrorBoundary.tsx +3 -3
  179. package/src/components/PiralGlobals.tsx +16 -0
  180. package/src/components/PiralRoutes.test.tsx +1 -1
  181. package/src/components/PiralSuspense.tsx +15 -0
  182. package/src/components/PiralView-server.test.tsx +1 -0
  183. package/src/components/PiralView.test.tsx +1 -0
  184. package/src/components/PiralView.tsx +24 -47
  185. package/src/components/ResponsiveLayout.test.tsx +14 -43
  186. package/src/components/ResponsiveLayout.tsx +11 -15
  187. package/src/components/components.tsx +13 -6
  188. package/src/components/index.ts +2 -12
  189. package/src/{components → defaults}/DefaultErrorInfo.test.tsx +0 -0
  190. package/src/{components → defaults}/DefaultErrorInfo.tsx +1 -2
  191. package/src/{components → defaults}/DefaultLayout.test.tsx +0 -0
  192. package/src/{components → defaults}/DefaultLayout.tsx +1 -1
  193. package/src/{components/DefaultLoader.test.tsx → defaults/DefaultLoadingIndicator.test.tsx} +2 -2
  194. package/src/{components/DefaultLoader.tsx → defaults/DefaultLoadingIndicator.tsx} +0 -0
  195. package/src/{components → defaults}/DefaultRouteSwitch.tsx +0 -0
  196. package/src/{components → defaults}/DefaultRouter.tsx +0 -0
  197. package/src/defaults/index.ts +5 -0
  198. package/src/index.tsx +1 -0
  199. package/src/{components → setters}/SetComponent.test.tsx +0 -0
  200. package/src/{components → setters}/SetComponent.tsx +0 -0
  201. package/src/{components → setters}/SetError.test.tsx +0 -0
  202. package/src/{components → setters}/SetError.tsx +0 -0
  203. package/src/{components → setters}/SetErrors.test.tsx +0 -0
  204. package/src/{components → setters}/SetErrors.tsx +0 -0
  205. package/src/{components → setters}/SetLayout.test.tsx +0 -0
  206. package/src/{components → setters}/SetLayout.tsx +0 -0
  207. package/src/{components → setters}/SetProvider.test.tsx +0 -0
  208. package/src/{components → setters}/SetProvider.tsx +0 -0
  209. package/src/{components → setters}/SetRedirect.test.tsx +0 -0
  210. package/src/{components → setters}/SetRedirect.tsx +0 -0
  211. package/src/{components → setters}/SetRoute.test.tsx +0 -0
  212. package/src/{components → setters}/SetRoute.tsx +0 -0
  213. package/src/setters/index.ts +7 -0
  214. package/src/state/createGlobalState.test.ts +1 -10
  215. package/src/state/createGlobalState.ts +2 -3
  216. package/src/types/instance.ts +8 -2
  217. package/src/types/state.ts +0 -10
  218. package/src/utils/compare.test.ts +15 -15
  219. package/src/utils/compare.ts +23 -3
  220. package/src/utils/foreign.test.ts +1 -1
  221. package/src/utils/media.ts +1 -1
  222. package/esm/components/DefaultErrorInfo.js.map +0 -1
  223. package/esm/components/DefaultLayout.js.map +0 -1
  224. package/esm/components/DefaultLoader.js.map +0 -1
  225. package/esm/components/DefaultRouteSwitch.js.map +0 -1
  226. package/esm/components/DefaultRouter.js.map +0 -1
  227. package/esm/components/SetComponent.js.map +0 -1
  228. package/esm/components/SetError.js.map +0 -1
  229. package/esm/components/SetErrors.js.map +0 -1
  230. package/esm/components/SetLayout.js.map +0 -1
  231. package/esm/components/SetProvider.js.map +0 -1
  232. package/esm/components/SetRedirect.js.map +0 -1
  233. package/esm/components/SetRoute.js.map +0 -1
  234. package/lib/components/DefaultErrorInfo.js.map +0 -1
  235. package/lib/components/DefaultLayout.js.map +0 -1
  236. package/lib/components/DefaultLoader.js.map +0 -1
  237. package/lib/components/DefaultRouteSwitch.js.map +0 -1
  238. package/lib/components/DefaultRouter.js.map +0 -1
  239. package/lib/components/SetComponent.js.map +0 -1
  240. package/lib/components/SetError.js.map +0 -1
  241. package/lib/components/SetErrors.js.map +0 -1
  242. package/lib/components/SetLayout.js.map +0 -1
  243. package/lib/components/SetProvider.js.map +0 -1
  244. package/lib/components/SetRedirect.js.map +0 -1
  245. package/lib/components/SetRoute.js.map +0 -1
package/esm/Piral.d.ts CHANGED
@@ -3,8 +3,8 @@ import type { PiralProps } from './types';
3
3
  /**
4
4
  * Represents the Piral app shell frame. Use this component together
5
5
  * with an existing instance to render the app shell.
6
- * Includes layout and routing handling. Wires the state container
7
- * to the generated views.
6
+ * Includes layout and routing handling. Connects the Piral context
7
+ * and the React router to the generated views.
8
8
  *
9
9
  * @example
10
10
  ```jsx
package/esm/Piral.js CHANGED
@@ -1,13 +1,19 @@
1
1
  import * as React from 'react';
2
- import { StateContext } from './state';
2
+ import { StaticRouter } from 'react-router';
3
3
  import { createInstance } from './createInstance';
4
- import { PiralView, Mediator, ResponsiveLayout, PortalRenderer } from './components';
5
- import { RootListener } from './RootListener';
4
+ import { PiralView, RegisteredRouter } from './components';
5
+ import { useGlobalState } from './hooks';
6
+ import { PiralContext } from './PiralContext';
7
+ const FallbackRouter = (props) => {
8
+ const publicPath = useGlobalState((s) => s.app.publicPath);
9
+ return React.createElement(StaticRouter, Object.assign({ location: "/" }, props, { basename: publicPath }));
10
+ };
11
+ const Router = typeof window === 'undefined' ? FallbackRouter : RegisteredRouter;
6
12
  /**
7
13
  * Represents the Piral app shell frame. Use this component together
8
14
  * with an existing instance to render the app shell.
9
- * Includes layout and routing handling. Wires the state container
10
- * to the generated views.
15
+ * Includes layout and routing handling. Connects the Piral context
16
+ * and the React router to the generated views.
11
17
  *
12
18
  * @example
13
19
  ```jsx
@@ -18,12 +24,8 @@ const app = (
18
24
  );
19
25
  ```
20
26
  */
21
- export const Piral = ({ instance = createInstance(), breakpoints, children }) => (React.createElement(StateContext.Provider, { value: instance.context },
22
- React.createElement(ResponsiveLayout, { breakpoints: breakpoints }),
23
- React.createElement(Mediator, { options: instance.options, key: instance.id }),
24
- React.createElement(RootListener, null),
25
- React.createElement(PiralView, null,
26
- React.createElement(PortalRenderer, { id: "root" }),
27
- children)));
27
+ export const Piral = ({ instance = createInstance(), breakpoints, children }) => (React.createElement(PiralContext, { instance: instance },
28
+ React.createElement(Router, null,
29
+ React.createElement(PiralView, { breakpoints: breakpoints }, children))));
28
30
  Piral.displayName = 'Piral';
29
31
  //# sourceMappingURL=Piral.js.map
package/esm/Piral.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Piral.js","sourceRoot":"","sources":["../src/Piral.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAAE,QAAQ,GAAG,cAAc,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACrG,oBAAC,YAAY,CAAC,QAAQ,IAA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AAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACrG,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ;IAC9B,oBAAC,MAAM;QACL,oBAAC,SAAS,IAAC,WAAW,EAAE,WAAW,IAAG,QAAQ,CAAa,CACpD,CACI,CAChB,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC"}
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import type { PiralContextProps } from './types';
3
+ /**
4
+ * Represents the Piral app shell frame. Use this component together
5
+ * with an existing instance to render components from micro frontends
6
+ * in your app.
7
+ * Wires the state container together with the global providers.
8
+ *
9
+ * @example
10
+ ```jsx
11
+ const app = (
12
+ <MyRouter>
13
+ <PiralContext instance={yourPiralInstance}>
14
+ <PiralGlobals />
15
+ <MyAppContent />
16
+ </PiralContext>
17
+ </MyRouter>
18
+ );
19
+ ```
20
+ */
21
+ export declare const PiralContext: React.FC<PiralContextProps>;
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ import { StateContext } from './state';
3
+ import { createInstance } from './createInstance';
4
+ import { Mediator } from './components';
5
+ import { useGlobalState } from './hooks';
6
+ import { RootListener } from './RootListener';
7
+ const PiralProvider = ({ children }) => {
8
+ const Provider = useGlobalState((m) => m.provider || React.Fragment);
9
+ return React.createElement(Provider, null, children);
10
+ };
11
+ /**
12
+ * Represents the Piral app shell frame. Use this component together
13
+ * with an existing instance to render components from micro frontends
14
+ * in your app.
15
+ * Wires the state container together with the global providers.
16
+ *
17
+ * @example
18
+ ```jsx
19
+ const app = (
20
+ <MyRouter>
21
+ <PiralContext instance={yourPiralInstance}>
22
+ <PiralGlobals />
23
+ <MyAppContent />
24
+ </PiralContext>
25
+ </MyRouter>
26
+ );
27
+ ```
28
+ */
29
+ export const PiralContext = ({ instance = createInstance(), children }) => (React.createElement(StateContext.Provider, { value: instance.context },
30
+ React.createElement(Mediator, { options: instance.options, key: instance.id }),
31
+ React.createElement(RootListener, null),
32
+ React.createElement(PiralProvider, null, children)));
33
+ PiralContext.displayName = 'PiralContext';
34
+ //# sourceMappingURL=PiralContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PiralContext.js","sourceRoot":"","sources":["../src/PiralContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,aAAa,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrE,OAAO,oBAAC,QAAQ,QAAE,QAAQ,CAAY,CAAC;AACzC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,QAAQ,GAAG,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACtG,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,CAAC,OAAO;IAC5C,oBAAC,QAAQ,IAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAI;IACzD,oBAAC,YAAY,OAAG;IAChB,oBAAC,aAAa,QAAE,QAAQ,CAAiB,CACnB,CACzB,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { RouteComponentProps } from 'react-router';
3
- import { LayoutType, ComponentsState, ErrorComponentsState, GlobalStateContext, Pilet, PiletEntry } from '../types';
4
- export declare function changeLayout(ctx: GlobalStateContext, current: LayoutType): void;
3
+ import { ComponentsState, ErrorComponentsState, GlobalStateContext, Pilet, PiletEntry } from '../types';
5
4
  export declare function initialize(ctx: GlobalStateContext, loading: boolean, error: Error | undefined, modules: Array<Pilet>): void;
6
5
  export declare function addPilet(ctx: GlobalStateContext, meta: PiletEntry): Promise<void>;
7
6
  export declare function removePilet(ctx: GlobalStateContext, name: string): Promise<void>;
@@ -1,8 +1,5 @@
1
1
  import { runPilet } from 'piral-base';
2
2
  import { withKey, replaceOrAddItem, removeNested, withProvider, withRoute, noop } from '../utils';
3
- export function changeLayout(ctx, current) {
4
- ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { app: withKey(state.app, 'layout', current) })));
5
- }
6
3
  export function initialize(ctx, loading, error, modules) {
7
4
  ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { app: Object.assign(Object.assign({}, state.app), { error,
8
5
  loading }), modules })));
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/actions/app.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAYlG,MAAM,UAAU,YAAY,CAAC,GAAuB,EAAE,OAAmB;IACvE,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCACnB,KAAK,KACR,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,IAC1C,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAuB,EAAE,OAAgB,EAAE,KAAwB,EAAE,OAAqB;IACnH,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,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S,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAuB,EAAE,QAAqB;IAC5E,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvC,CAAC"}
@@ -1,6 +1,10 @@
1
1
  import { swap, deref } from '@dbeining/react-atom';
2
+ import { isSame } from '../utils';
3
+ function onlyChangedState(oldState, newState) {
4
+ return isSame(oldState, newState) ? oldState : newState;
5
+ }
2
6
  export function dispatch(ctx, update) {
3
- swap(ctx.state, update);
7
+ swap(ctx.state, oldState => onlyChangedState(oldState, update(oldState)));
4
8
  }
5
9
  export function readState(ctx, read) {
6
10
  const state = deref(ctx.state);
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/actions/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAGnD,MAAM,UAAU,QAAQ,CAAC,GAAuB,EAAE,MAA2C;IAC3F,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,SAAS,CAAI,GAAuB,EAAE,IAA+B;IACnF,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/actions/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,SAAS,gBAAgB,CAAC,QAAqB,EAAE,QAAqB;IACpE,OAAO,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAuB,EAAE,MAA2C;IAC3F,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,SAAS,CAAI,GAAuB,EAAE,IAA+B;IACnF,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import * as React from 'react';
3
- import { PiralError, PiralLoadingIndicator } from './components';
3
+ import { RegisteredErrorInfo, RegisteredLoadingIndicator } from './components';
4
4
  /**
5
5
  * The component for catching errors and displaying error information.
6
6
  */
@@ -25,9 +25,9 @@ export class ErrorBoundary extends React.Component {
25
25
  const rest = renderProps;
26
26
  if (error) {
27
27
  const pilet = piral.meta.name;
28
- return React.createElement(PiralError, Object.assign({ type: errorType, error: error, pilet: pilet }, rest));
28
+ return React.createElement(RegisteredErrorInfo, Object.assign({ type: errorType, error: error, pilet: pilet }, rest));
29
29
  }
30
- return React.createElement(React.Suspense, { fallback: React.createElement(PiralLoadingIndicator, null) }, children);
30
+ return React.createElement(React.Suspense, { fallback: React.createElement(RegisteredLoadingIndicator, null) }, children);
31
31
  }
32
32
  }
33
33
  //# sourceMappingURL=ErrorBoundary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAqBjE;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAiD;IAA1F;;QACE,UAAK,G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AG;YACN,KAAK,EAAE,SAAS;SACjB,CAAC;IAwBJ,CAAC;IAtBC,iBAAiB,CAAC,KAAY;QAC5B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,qCAAqC,SAAS,IAAI,EAAE,KAAK,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC;YACZ,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,MAAM,KAAiD,IAAI,CAAC,KAAK,EAA3D,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,OAA+B,EAA1B,WAAW,cAA5C,kCAA8C,CAAa,CAAC;QAClE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,MAAM,IAAI,GAAQ,WAAW,CAAC;QAE9B,IAAI,KAAK,EAAE;YACT,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9B,OAAO,oBAAC,mBAAmB,kBAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAAM,IAAI,EAAI,CAAC;SACvF;QAED,OAAO,oBAAC,KAAK,CAAC,QAAQ,IAAC,QAAQ,EAAE,oBAAC,0BAA0B,OAAG,IAAG,QAAQ,CAAkB,CAAC;IAC/F,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Integrates the global portal renderer and the debug utilities
4
+ * (if registered).
5
+ */
6
+ export declare const PiralGlobals: React.FC;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { PortalRenderer } from './PortalRenderer';
3
+ import { RegisteredDebug } from './components';
4
+ /**
5
+ * Integrates the global portal renderer and the debug utilities
6
+ * (if registered).
7
+ */
8
+ export const PiralGlobals = () => {
9
+ return (React.createElement(React.Fragment, null,
10
+ React.createElement(PortalRenderer, { id: "root" }),
11
+ React.createElement(RegisteredDebug, null)));
12
+ };
13
+ //# sourceMappingURL=PiralGlobals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PiralGlobals.js","sourceRoot":"","sources":["../../src/components/PiralGlobals.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa,GAAG,EAAE;IACzC,OAAO,CACL;QACE,oBAAC,cAAc,IAAC,EAAE,EAAC,MAAM,GAAG;QAC5B,oBAAC,eAAe,OAAG,CAClB,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const PiralSuspense: React.FC;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { RegisteredErrorInfo, RegisteredLoadingIndicator } from './components';
3
+ import { useGlobalState } from '../hooks';
4
+ export const PiralSuspense = ({ children }) => {
5
+ const { error, loading } = useGlobalState((m) => m.app);
6
+ return error ? (React.createElement(RegisteredErrorInfo, { type: "loading", error: error })) : loading ? (React.createElement(RegisteredLoadingIndicator, null)) : (React.createElement(React.Fragment, null, children));
7
+ };
8
+ //# sourceMappingURL=PiralSuspense.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PiralSuspense.js","sourceRoot":"","sources":["../../src/components/PiralSuspense.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAExD,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,mBAAmB,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,GAAI,CACrD,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,oBAAC,0BAA0B,OAAG,CAC/B,CAAC,CAAC,CAAC,CACF,0CAAG,QAAQ,CAAI,CAChB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,11 +1,16 @@
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;
6
11
  }
7
12
  /**
8
13
  * 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.
14
+ * This includes the used the current content and some convenience.
10
15
  */
11
16
  export declare const PiralView: React.FC<PiralViewProps>;
@@ -1,31 +1,19 @@
1
1
  import * as React from 'react';
2
- import { StaticRouter } from 'react-router';
2
+ import { PiralGlobals } from './PiralGlobals';
3
3
  import { PiralRoutes } from './PiralRoutes';
4
- import { PiralError, PiralRouter, PiralLoadingIndicator, PiralRouteSwitch, PiralLayout, PiralDebug, } from './components';
5
- import { useGlobalState } from '../hooks';
6
- const NotFound = (props) => React.createElement(PiralError, Object.assign({ type: "not_found" }, props));
7
- const PiralContent = () => {
8
- const { error, loading, layout } = useGlobalState((m) => m.app);
9
- return error ? (React.createElement(PiralError, { type: "loading", error: error })) : loading ? (React.createElement(PiralLoadingIndicator, null)) : (React.createElement(PiralLayout, { currentLayout: layout },
10
- React.createElement(PiralRoutes, { NotFound: NotFound, RouteSwitch: PiralRouteSwitch })));
11
- };
12
- const FallbackRouter = (props) => {
13
- const publicPath = useGlobalState((s) => s.app.publicPath);
14
- return React.createElement(StaticRouter, Object.assign({ location: "/" }, props, { basename: publicPath }));
15
- };
16
- const Router = typeof window === 'undefined' ? FallbackRouter : PiralRouter;
17
- const PiralProvider = ({ children }) => {
18
- const provider = useGlobalState((m) => m.provider) || React.Fragment;
19
- return React.createElement(provider, undefined, children);
20
- };
4
+ import { PiralSuspense } from './PiralSuspense';
5
+ import { ResponsiveLayout } from './ResponsiveLayout';
6
+ import { RegisteredErrorInfo, RegisteredRouteSwitch, RegisteredLayout } from './components';
7
+ const NotFound = (props) => React.createElement(RegisteredErrorInfo, Object.assign({ type: "not_found" }, props));
21
8
  /**
22
9
  * The component responsible for the generic view of the application.
23
- * This includes the global providers, the used Router, the current content and some convenience.
10
+ * This includes the used the current content and some convenience.
24
11
  */
25
- export const PiralView = ({ children }) => (React.createElement(PiralProvider, null,
26
- React.createElement(Router, null,
27
- React.createElement(PiralContent, null),
28
- children,
29
- React.createElement(PiralDebug, null))));
12
+ export const PiralView = ({ breakpoints, children }) => (React.createElement(React.Fragment, null,
13
+ React.createElement(PiralGlobals, null),
14
+ React.createElement(PiralSuspense, null,
15
+ React.createElement(ResponsiveLayout, { breakpoints: breakpoints, Layout: RegisteredLayout },
16
+ React.createElement(PiralRoutes, { NotFound: NotFound, RouteSwitch: RegisteredRouteSwitch }))),
17
+ children));
30
18
  PiralView.displayName = 'PiralView';
31
19
  //# sourceMappingURL=PiralView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PiralView.js","sourceRoot":"","sources":["../../src/components/PiralView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAuB,YAAY,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,UAAU,EACV,WAAW,EACX,qBAAqB,EACr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AAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,GAAI,CACtD,CACL;IACf,QAAQ,CACR,CACJ,CAAC;AACF,SAAS,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,7 @@ export interface ResponsiveLayoutProps {
8
8
  * The individual breakpoints to be used for the different layouts.
9
9
  */
10
10
  breakpoints?: LayoutBreakpoints;
11
+ Layout: React.ComponentType<LayoutProps>;
11
12
  }
12
13
  /**
13
14
  * The component capable of identifying and switching the currently used layout.
@@ -1,19 +1,12 @@
1
1
  import * as React from 'react';
2
- import { useMedia, useGlobalState, useGlobalStateContext } from '../hooks';
3
- import { defaultLayouts, defaultRender, defaultBreakpoints } from '../utils';
2
+ import { useMedia } from '../hooks';
3
+ import { defaultLayouts, defaultBreakpoints } from '../utils';
4
4
  /**
5
5
  * The component capable of identifying and switching the currently used layout.
6
6
  */
7
- export const ResponsiveLayout = ({ breakpoints = defaultBreakpoints, children }) => {
8
- const current = useGlobalState((m) => m.app.layout) || 'desktop';
9
- const { changeLayout } = useGlobalStateContext();
10
- const selected = useMedia(breakpoints, defaultLayouts, current);
11
- React.useEffect(() => {
12
- if (selected !== current) {
13
- changeLayout(selected);
14
- }
15
- }, [selected]);
16
- return defaultRender(children);
7
+ export const ResponsiveLayout = ({ breakpoints = defaultBreakpoints, Layout, children, }) => {
8
+ const selected = useMedia(breakpoints, defaultLayouts, 'desktop');
9
+ return React.createElement(Layout, { currentLayout: selected }, children);
17
10
  };
18
11
  ResponsiveLayout.displayName = 'ResponsiveLayout';
19
12
  //# sourceMappingURL=ResponsiveLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsiveLayout.js","sourceRoot":"","sources":["../../src/components/ResponsiveLayout.tsx"],"names":[],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AM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAClE,OAAO,oBAAC,MAAM,IAAC,aAAa,EAAE,QAAQ,IAAG,QAAQ,CAAU,CAAC;AAC9D,CAAC,CAAC;AACF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
@@ -1,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,5 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { useGlobalState } from '../hooks';
3
+ /**
4
+ * Gets a registered layout component by its name.
5
+ * This will always return a valid component. If nothing is found
6
+ * then the returned component will just return null.
7
+ * @param name The name of the registered layout component.
8
+ * @returns The registered layout component or an empty stub component.
9
+ */
3
10
  export function getPiralComponent(name) {
4
11
  return (props) => {
5
12
  const Component = useGlobalState((s) => s.components[name]);
@@ -11,30 +18,30 @@ export function getPiralComponent(name) {
11
18
  * Gets the currently registered ErrorInfo component.
12
19
  * By default the DefaultErrorInfo component is used.
13
20
  */
14
- export const PiralError = getPiralComponent('ErrorInfo');
21
+ export const RegisteredErrorInfo = getPiralComponent('ErrorInfo');
15
22
  /**
16
23
  * Gets the currently registered LoadingIndicator component.
17
24
  * By default only Loading is rendered.
18
25
  */
19
- export const PiralLoadingIndicator = getPiralComponent('LoadingIndicator');
26
+ export const RegisteredLoadingIndicator = getPiralComponent('LoadingIndicator');
20
27
  /**
21
28
  * Gets the currently registered Router component.
22
29
  * By default the BrowserRouter is used.
23
30
  */
24
- export const PiralRouter = getPiralComponent('Router');
31
+ export const RegisteredRouter = getPiralComponent('Router');
25
32
  /**
26
33
  * Gets the currently registered Route Switch component.
27
34
  * By default the DefaultRouteSwitch component is used.
28
35
  */
29
- export const PiralRouteSwitch = getPiralComponent('RouteSwitch');
36
+ export const RegisteredRouteSwitch = getPiralComponent('RouteSwitch');
30
37
  /**
31
38
  * Gets the currently registered Layout component.
32
39
  * By default the children are rendered.
33
40
  */
34
- export const PiralLayout = getPiralComponent('Layout');
41
+ export const RegisteredLayout = getPiralComponent('Layout');
35
42
  /**
36
43
  * Gets the currently registered Debug component.
37
44
  * By default nothing is used.
38
45
  */
39
- export const PiralDebug = getPiralComponent('Debug');
46
+ export const RegisteredDebug = getPiralComponent('Debug');
40
47
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,UAAU,iBAAiB,CAAqC,IAAU;IAC9E,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,SAAS,GAAG,cAAc,CAAC,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;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAqC,IAAU;IAC9E,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,SAAS,GAAG,cAAc,CAAC,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;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAElE;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEtE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,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,23 +1,13 @@
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';
23
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ExtensionSlot } from './ExtensionSlot';
3
- import { SwitchErrorInfo } from './SwitchErrorInfo';
2
+ import { ExtensionSlot, SwitchErrorInfo } from '../components';
4
3
  /**
5
4
  * The default error info component. Just uses the "error" extension slot.
6
5
  * Leverage the default one by registration of respective extensions using
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultErrorInfo.js","sourceRoot":"","sources":["../../src/defaults/DefaultErrorInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAG/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B,CAAC,KAAK,EAAE,EAAE,CAAC,CACnE,oBAAC,aAAa,IAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,oBAAC,eAAe,kBAAC,GAAG,EAAC,eAAe,IAAK,KAAK,EAAI,GAAI,CAC/G,CAAC;AACF,gBAAgB,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,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC9F,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
@@ -4,4 +4,4 @@ import * as React from 'react';
4
4
  */
5
5
  export const DefaultLoadingIndicator = () => React.createElement("div", null, "Loading");
6
6
  DefaultLoadingIndicator.displayName = 'DefaultLoadingIndicator';
7
- //# sourceMappingURL=DefaultLoader.js.map
7
+ //# sourceMappingURL=DefaultLoadingIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultLoadingIndicator.js","sourceRoot":"","sources":["../../src/defaults/DefaultLoadingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAoC,GAAG,EAAE,CAAC,2CAAkB,CAAC;AACjG,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultRouteSwitch.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouteSwitch.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAAC,EAA6B,EAAE,EAAE;QAAjC,EAAE,KAAK,EAAE,QAAQ,OAAY,EAAP,KAAK,cAA3B,qBAA6B,CAAF;IACxF,OAAO,CACL,oBAAC,MAAM,oBAAK,KAAK;QACd,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAClC,oBAAC,KAAK,IAAC,KAAK,QAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAC7D,CAAC;QACF,oBAAC,KAAK,IAAC,SAAS,EAAE,QAAQ,GAAI,CACvB,CACV,CAAC;AACJ,CAAC,CAAC"}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultRouter.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC3D,OAAO,oBAAC,aAAa,IAAC,QAAQ,EAAE,UAAU,IAAG,QAAQ,CAAiB,CAAC;AACzE,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './DefaultErrorInfo';
2
+ export * from './DefaultLayout';
3
+ export * from './DefaultLoadingIndicator';
4
+ export * from './DefaultRouter';
5
+ export * from './DefaultRouteSwitch';