piral-core 0.13.9 → 0.14.0-beta.3157

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 (299) hide show
  1. package/debug-pilet.d.ts +3 -0
  2. package/debug-pilet.js +12 -0
  3. package/debug-piral.d.ts +4 -0
  4. package/debug-piral.js +59 -0
  5. package/dependencies.codegen +1 -1
  6. package/esm/Piral.js +6 -8
  7. package/esm/Piral.js.map +1 -1
  8. package/esm/actions/app.js +9 -10
  9. package/esm/actions/app.js.map +1 -1
  10. package/esm/actions/components.js +4 -5
  11. package/esm/actions/components.js.map +1 -1
  12. package/esm/actions/data.js +16 -17
  13. package/esm/actions/data.js.map +1 -1
  14. package/esm/actions/define.js +2 -3
  15. package/esm/actions/define.js.map +1 -1
  16. package/esm/actions/portal.d.ts +2 -0
  17. package/esm/actions/portal.js +9 -4
  18. package/esm/actions/portal.js.map +1 -1
  19. package/esm/actions/state.js +1 -1
  20. package/esm/actions/state.js.map +1 -1
  21. package/esm/components/DefaultErrorInfo.js +1 -2
  22. package/esm/components/DefaultErrorInfo.js.map +1 -1
  23. package/esm/components/DefaultLayout.js +1 -4
  24. package/esm/components/DefaultLayout.js.map +1 -1
  25. package/esm/components/DefaultLoader.js +1 -1
  26. package/esm/components/DefaultLoader.js.map +1 -1
  27. package/esm/components/ErrorBoundary.js +13 -18
  28. package/esm/components/ErrorBoundary.js.map +1 -1
  29. package/esm/components/ExtensionSlot.js +5 -9
  30. package/esm/components/ExtensionSlot.js.map +1 -1
  31. package/esm/components/Mediator.js +8 -8
  32. package/esm/components/Mediator.js.map +1 -1
  33. package/esm/components/PiralRoutes.js +8 -8
  34. package/esm/components/PiralRoutes.js.map +1 -1
  35. package/esm/components/PiralView.js +11 -16
  36. package/esm/components/PiralView.js.map +1 -1
  37. package/esm/components/PortalRenderer.d.ts +5 -0
  38. package/esm/components/PortalRenderer.js +7 -0
  39. package/esm/components/PortalRenderer.js.map +1 -0
  40. package/esm/components/ResponsiveLayout.js +5 -6
  41. package/esm/components/ResponsiveLayout.js.map +1 -1
  42. package/esm/components/SetComponent.js +3 -4
  43. package/esm/components/SetComponent.js.map +1 -1
  44. package/esm/components/SetError.js +3 -4
  45. package/esm/components/SetError.js.map +1 -1
  46. package/esm/components/SetErrors.js +2 -3
  47. package/esm/components/SetErrors.js.map +1 -1
  48. package/esm/components/SetLayout.js +2 -3
  49. package/esm/components/SetLayout.js.map +1 -1
  50. package/esm/components/SetProvider.js +3 -4
  51. package/esm/components/SetProvider.js.map +1 -1
  52. package/esm/components/SetRedirect.js +3 -4
  53. package/esm/components/SetRedirect.js.map +1 -1
  54. package/esm/components/SetRoute.js +3 -4
  55. package/esm/components/SetRoute.js.map +1 -1
  56. package/esm/components/SwitchErrorInfo.js +12 -10
  57. package/esm/components/SwitchErrorInfo.js.map +1 -1
  58. package/esm/components/components.js +8 -9
  59. package/esm/components/components.js.map +1 -1
  60. package/esm/components/index.d.ts +1 -0
  61. package/esm/components/index.js +1 -0
  62. package/esm/components/index.js.map +1 -1
  63. package/esm/createInstance.js +24 -25
  64. package/esm/createInstance.js.map +1 -1
  65. package/esm/helpers.d.ts +11 -26
  66. package/esm/helpers.js +18 -56
  67. package/esm/helpers.js.map +1 -1
  68. package/esm/hooks/action.js +1 -1
  69. package/esm/hooks/action.js.map +1 -1
  70. package/esm/hooks/actions.js +1 -1
  71. package/esm/hooks/actions.js.map +1 -1
  72. package/esm/hooks/globalState.js +5 -5
  73. package/esm/hooks/globalState.js.map +1 -1
  74. package/esm/hooks/index.d.ts +0 -5
  75. package/esm/hooks/index.js +0 -5
  76. package/esm/hooks/index.js.map +1 -1
  77. package/esm/hooks/media.js +8 -7
  78. package/esm/hooks/media.js.map +1 -1
  79. package/esm/hooks/setter.js +3 -2
  80. package/esm/hooks/setter.js.map +1 -1
  81. package/esm/hooks/sharedData.js +2 -2
  82. package/esm/hooks/sharedData.js.map +1 -1
  83. package/esm/modules/api.js +79 -28
  84. package/esm/modules/api.js.map +1 -1
  85. package/esm/modules/dependencies.d.ts +3 -4
  86. package/esm/modules/dependencies.js +11 -14
  87. package/esm/modules/dependencies.js.map +1 -1
  88. package/esm/state/createActions.js +7 -12
  89. package/esm/state/createActions.js.map +1 -1
  90. package/esm/state/createGlobalState.js +6 -8
  91. package/esm/state/createGlobalState.js.map +1 -1
  92. package/esm/state/stateContext.js +1 -1
  93. package/esm/state/stateContext.js.map +1 -1
  94. package/esm/state/withApi.js +59 -62
  95. package/esm/state/withApi.js.map +1 -1
  96. package/esm/types/config.d.ts +23 -16
  97. package/esm/types/state.d.ts +13 -0
  98. package/esm/utils/compare.js +4 -4
  99. package/esm/utils/compare.js.map +1 -1
  100. package/esm/utils/data.js +6 -7
  101. package/esm/utils/data.js.map +1 -1
  102. package/esm/utils/foreign.d.ts +4 -2
  103. package/esm/utils/foreign.js +16 -8
  104. package/esm/utils/foreign.js.map +1 -1
  105. package/esm/utils/guid.js +3 -3
  106. package/esm/utils/guid.js.map +1 -1
  107. package/esm/utils/helpers.d.ts +11 -8
  108. package/esm/utils/helpers.js +28 -17
  109. package/esm/utils/helpers.js.map +1 -1
  110. package/esm/utils/media.js +8 -7
  111. package/esm/utils/media.js.map +1 -1
  112. package/esm/utils/storage.js +13 -14
  113. package/esm/utils/storage.js.map +1 -1
  114. package/lib/Piral.js +9 -11
  115. package/lib/Piral.js.map +1 -1
  116. package/lib/actions/app.js +11 -12
  117. package/lib/actions/app.js.map +1 -1
  118. package/lib/actions/components.js +5 -6
  119. package/lib/actions/components.js.map +1 -1
  120. package/lib/actions/data.js +17 -18
  121. package/lib/actions/data.js.map +1 -1
  122. package/lib/actions/define.js +2 -3
  123. package/lib/actions/define.js.map +1 -1
  124. package/lib/actions/index.js +7 -7
  125. package/lib/actions/index.js.map +1 -1
  126. package/lib/actions/portal.d.ts +2 -0
  127. package/lib/actions/portal.js +12 -5
  128. package/lib/actions/portal.js.map +1 -1
  129. package/lib/actions/state.js +3 -3
  130. package/lib/actions/state.js.map +1 -1
  131. package/lib/components/DefaultErrorInfo.js +4 -5
  132. package/lib/components/DefaultErrorInfo.js.map +1 -1
  133. package/lib/components/DefaultLayout.js +2 -5
  134. package/lib/components/DefaultLayout.js.map +1 -1
  135. package/lib/components/DefaultLoader.js +2 -2
  136. package/lib/components/DefaultLoader.js.map +1 -1
  137. package/lib/components/ErrorBoundary.js +18 -22
  138. package/lib/components/ErrorBoundary.js.map +1 -1
  139. package/lib/components/ExtensionSlot.js +10 -14
  140. package/lib/components/ExtensionSlot.js.map +1 -1
  141. package/lib/components/Mediator.js +11 -11
  142. package/lib/components/Mediator.js.map +1 -1
  143. package/lib/components/PiralRoutes.js +11 -11
  144. package/lib/components/PiralRoutes.js.map +1 -1
  145. package/lib/components/PiralView.js +16 -21
  146. package/lib/components/PiralView.js.map +1 -1
  147. package/lib/components/PortalRenderer.d.ts +5 -0
  148. package/lib/components/PortalRenderer.js +11 -0
  149. package/lib/components/PortalRenderer.js.map +1 -0
  150. package/lib/components/ResponsiveLayout.js +9 -10
  151. package/lib/components/ResponsiveLayout.js.map +1 -1
  152. package/lib/components/SetComponent.js +4 -5
  153. package/lib/components/SetComponent.js.map +1 -1
  154. package/lib/components/SetError.js +4 -5
  155. package/lib/components/SetError.js.map +1 -1
  156. package/lib/components/SetErrors.js +4 -5
  157. package/lib/components/SetErrors.js.map +1 -1
  158. package/lib/components/SetLayout.js +4 -5
  159. package/lib/components/SetLayout.js.map +1 -1
  160. package/lib/components/SetProvider.js +4 -5
  161. package/lib/components/SetProvider.js.map +1 -1
  162. package/lib/components/SetRedirect.js +6 -7
  163. package/lib/components/SetRedirect.js.map +1 -1
  164. package/lib/components/SetRoute.js +4 -5
  165. package/lib/components/SetRoute.js.map +1 -1
  166. package/lib/components/SwitchErrorInfo.js +14 -12
  167. package/lib/components/SwitchErrorInfo.js.map +1 -1
  168. package/lib/components/components.js +5 -6
  169. package/lib/components/components.js.map +1 -1
  170. package/lib/components/index.d.ts +1 -0
  171. package/lib/components/index.js +20 -19
  172. package/lib/components/index.js.map +1 -1
  173. package/lib/createInstance.js +31 -32
  174. package/lib/createInstance.js.map +1 -1
  175. package/lib/helpers.d.ts +11 -26
  176. package/lib/helpers.js +19 -59
  177. package/lib/helpers.js.map +1 -1
  178. package/lib/hooks/action.js +3 -3
  179. package/lib/hooks/action.js.map +1 -1
  180. package/lib/hooks/actions.js +4 -4
  181. package/lib/hooks/actions.js.map +1 -1
  182. package/lib/hooks/globalState.js +8 -8
  183. package/lib/hooks/globalState.js.map +1 -1
  184. package/lib/hooks/index.d.ts +0 -5
  185. package/lib/hooks/index.js +7 -12
  186. package/lib/hooks/index.js.map +1 -1
  187. package/lib/hooks/media.js +10 -9
  188. package/lib/hooks/media.js.map +1 -1
  189. package/lib/hooks/setter.js +4 -3
  190. package/lib/hooks/setter.js.map +1 -1
  191. package/lib/hooks/sharedData.js +3 -3
  192. package/lib/hooks/sharedData.js.map +1 -1
  193. package/lib/index.js +9 -9
  194. package/lib/index.js.map +1 -1
  195. package/lib/modules/api.js +86 -35
  196. package/lib/modules/api.js.map +1 -1
  197. package/lib/modules/dependencies.d.ts +3 -4
  198. package/lib/modules/dependencies.js +13 -16
  199. package/lib/modules/dependencies.js.map +1 -1
  200. package/lib/modules/index.js +3 -3
  201. package/lib/modules/index.js.map +1 -1
  202. package/lib/state/createActions.js +8 -13
  203. package/lib/state/createActions.js.map +1 -1
  204. package/lib/state/createGlobalState.js +9 -11
  205. package/lib/state/createGlobalState.js.map +1 -1
  206. package/lib/state/index.js +5 -5
  207. package/lib/state/index.js.map +1 -1
  208. package/lib/state/stateContext.js +1 -1
  209. package/lib/state/stateContext.js.map +1 -1
  210. package/lib/state/withApi.js +67 -70
  211. package/lib/state/withApi.js.map +1 -1
  212. package/lib/types/config.d.ts +23 -16
  213. package/lib/types/index.js +13 -13
  214. package/lib/types/index.js.map +1 -1
  215. package/lib/types/state.d.ts +13 -0
  216. package/lib/utils/compare.js +4 -4
  217. package/lib/utils/compare.js.map +1 -1
  218. package/lib/utils/data.js +6 -7
  219. package/lib/utils/data.js.map +1 -1
  220. package/lib/utils/foreign.d.ts +4 -2
  221. package/lib/utils/foreign.js +21 -11
  222. package/lib/utils/foreign.js.map +1 -1
  223. package/lib/utils/guid.js +3 -3
  224. package/lib/utils/guid.js.map +1 -1
  225. package/lib/utils/helpers.d.ts +11 -8
  226. package/lib/utils/helpers.js +30 -17
  227. package/lib/utils/helpers.js.map +1 -1
  228. package/lib/utils/index.js +9 -9
  229. package/lib/utils/index.js.map +1 -1
  230. package/lib/utils/media.js +7 -6
  231. package/lib/utils/media.js.map +1 -1
  232. package/lib/utils/react.js +1 -1
  233. package/lib/utils/react.js.map +1 -1
  234. package/lib/utils/storage.js +11 -12
  235. package/lib/utils/storage.js.map +1 -1
  236. package/package.json +21 -5
  237. package/src/Piral.tsx +2 -1
  238. package/src/actions/portal.ts +19 -1
  239. package/src/components/ExtensionSlot.tsx +2 -2
  240. package/src/components/Mediator.tsx +2 -1
  241. package/src/components/PortalRenderer.tsx +12 -0
  242. package/src/components/SwitchErrorInfo.tsx +5 -1
  243. package/src/components/index.ts +1 -0
  244. package/src/createInstance.tsx +6 -7
  245. package/src/helpers.test.tsx +7 -39
  246. package/src/helpers.tsx +32 -85
  247. package/src/hooks/index.ts +0 -5
  248. package/src/hooks/media.ts +2 -1
  249. package/src/hooks/setter.ts +2 -1
  250. package/src/modules/api.ts +72 -4
  251. package/src/modules/dependencies.test.ts +18 -5
  252. package/src/modules/dependencies.ts +12 -18
  253. package/src/state/withApi.tsx +12 -14
  254. package/src/types/config.ts +23 -17
  255. package/src/types/state.ts +13 -0
  256. package/src/utils/foreign.test.ts +4 -4
  257. package/src/utils/foreign.ts +28 -5
  258. package/src/utils/helpers.ts +21 -7
  259. package/src/utils/media.ts +2 -1
  260. package/esm/hooks/debounce.d.ts +0 -8
  261. package/esm/hooks/debounce.js +0 -18
  262. package/esm/hooks/debounce.js.map +0 -1
  263. package/esm/hooks/lockBodyScroll.d.ts +0 -6
  264. package/esm/hooks/lockBodyScroll.js +0 -15
  265. package/esm/hooks/lockBodyScroll.js.map +0 -1
  266. package/esm/hooks/onClickOutside.d.ts +0 -8
  267. package/esm/hooks/onClickOutside.js +0 -23
  268. package/esm/hooks/onClickOutside.js.map +0 -1
  269. package/esm/hooks/onScreenVisible.d.ts +0 -11
  270. package/esm/hooks/onScreenVisible.js +0 -28
  271. package/esm/hooks/onScreenVisible.js.map +0 -1
  272. package/esm/hooks/promise.d.ts +0 -13
  273. package/esm/hooks/promise.js +0 -21
  274. package/esm/hooks/promise.js.map +0 -1
  275. package/lib/hooks/debounce.d.ts +0 -8
  276. package/lib/hooks/debounce.js +0 -22
  277. package/lib/hooks/debounce.js.map +0 -1
  278. package/lib/hooks/lockBodyScroll.d.ts +0 -6
  279. package/lib/hooks/lockBodyScroll.js +0 -19
  280. package/lib/hooks/lockBodyScroll.js.map +0 -1
  281. package/lib/hooks/onClickOutside.d.ts +0 -8
  282. package/lib/hooks/onClickOutside.js +0 -27
  283. package/lib/hooks/onClickOutside.js.map +0 -1
  284. package/lib/hooks/onScreenVisible.d.ts +0 -11
  285. package/lib/hooks/onScreenVisible.js +0 -32
  286. package/lib/hooks/onScreenVisible.js.map +0 -1
  287. package/lib/hooks/promise.d.ts +0 -13
  288. package/lib/hooks/promise.js +0 -25
  289. package/lib/hooks/promise.js.map +0 -1
  290. package/src/hooks/debounce.test.ts +0 -67
  291. package/src/hooks/debounce.ts +0 -19
  292. package/src/hooks/lockBodyScroll.test.ts +0 -24
  293. package/src/hooks/lockBodyScroll.ts +0 -15
  294. package/src/hooks/onClickOutside.test.ts +0 -113
  295. package/src/hooks/onClickOutside.ts +0 -25
  296. package/src/hooks/onScreenVisible.test.ts +0 -68
  297. package/src/hooks/onScreenVisible.ts +0 -28
  298. package/src/hooks/promise.test.ts +0 -76
  299. package/src/hooks/promise.ts +0 -35
@@ -1,26 +1,25 @@
1
- var crx = /\s*(.*?)=(.*?)($|;|,(?! ))/g;
2
- export var storage = {
3
- setItem: function (name, data) {
1
+ const crx = /\s*(.*?)=(.*?)($|;|,(?! ))/g;
2
+ export const storage = {
3
+ setItem(name, data) {
4
4
  return localStorage.setItem(name, data);
5
5
  },
6
- getItem: function (name) {
6
+ getItem(name) {
7
7
  return localStorage.getItem(name);
8
8
  },
9
- removeItem: function (name) {
9
+ removeItem(name) {
10
10
  return localStorage.removeItem(name);
11
11
  },
12
12
  };
13
- export var cookie = {
14
- setItem: function (name, data, expires) {
15
- if (expires === void 0) { expires = ''; }
16
- var domain = location.hostname;
17
- var domainPart = domain ? "domain=." + domain + ";" : '';
18
- document.cookie = name + "=" + encodeURIComponent(data) + ";expires=\"" + expires + "\";path=/;" + domainPart;
13
+ export const cookie = {
14
+ setItem(name, data, expires = '') {
15
+ const domain = location.hostname;
16
+ const domainPart = domain ? `domain=.${domain};` : '';
17
+ document.cookie = `${name}=${encodeURIComponent(data)};expires="${expires}";path=/;${domainPart}`;
19
18
  },
20
- getItem: function (name) {
21
- return document.cookie.replace(crx, function (_m, p1, p2) { return (name === p1 ? p2 : ''); });
19
+ getItem(name) {
20
+ return document.cookie.replace(crx, (_m, p1, p2) => (name === p1 ? p2 : ''));
22
21
  },
23
- removeItem: function (name) {
22
+ removeItem(name) {
24
23
  this.setItem(name, '', '-1');
25
24
  },
26
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/utils/storage.ts"],"names":[],"mappings":"AAEA,IAAM,GAAG,GAAG,6BAA6B,CAAC;AAE1C,MAAM,CAAC,IAAM,OAAO,GAAiB;IACnC,OAAO,EAAP,UAAQ,IAAY,EAAE,IAAY;QAChC,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,EAAP,UAAQ,IAAY;QAClB,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,UAAU,EAAV,UAAW,IAAY;QACrB,OAAO,YA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AAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,OAAO,CAAC,IAAY,EAAE,IAAY,EAAE,OAAO,GAAG,EAAE;QAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACjC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,IAAI,kBAAkB,CAAC,IAAI,CAAC,aAAa,OAAO,YAAY,UAAU,EAAE,CAAC;IACpG,CAAC;IACD,OAAO,CAAC,IAAY;QAClB,OAAO,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAO,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpG,CAAC;IACD,UAAU,CAAC,IAAY;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC"}
package/lib/Piral.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Piral = void 0;
4
- var React = require("react");
5
- var state_1 = require("./state");
6
- var createInstance_1 = require("./createInstance");
7
- var components_1 = require("./components");
4
+ const React = require("react");
5
+ const state_1 = require("./state");
6
+ const createInstance_1 = require("./createInstance");
7
+ const components_1 = require("./components");
8
8
  /**
9
9
  * Represents the Piral app shell frame. Use this component together
10
10
  * with an existing instance to render the app shell.
@@ -20,13 +20,11 @@ const app = (
20
20
  );
21
21
  ```
22
22
  */
23
- var Piral = function (_a) {
24
- var _b = _a.instance, instance = _b === void 0 ? createInstance_1.createInstance() : _b, breakpoints = _a.breakpoints, children = _a.children;
25
- return (React.createElement(state_1.StateContext.Provider, { value: instance.context },
26
- React.createElement(components_1.ResponsiveLayout, { breakpoints: breakpoints }),
27
- React.createElement(components_1.Mediator, { options: instance.options }),
28
- React.createElement(components_1.PiralView, null, children)));
29
- };
23
+ const Piral = ({ instance = (0, createInstance_1.createInstance)(), breakpoints, children }) => (React.createElement(state_1.StateContext.Provider, { value: instance.context },
24
+ React.createElement(components_1.PortalRenderer, { id: "root" }),
25
+ React.createElement(components_1.ResponsiveLayout, { breakpoints: breakpoints }),
26
+ React.createElement(components_1.Mediator, { options: instance.options }),
27
+ React.createElement(components_1.PiralView, null, children)));
30
28
  exports.Piral = Piral;
31
29
  exports.Piral.displayName = 'Piral';
32
30
  //# sourceMappingURL=Piral.js.map
package/lib/Piral.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Piral.js","sourceRoot":"","sources":["../src/Piral.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,iCAAuC;AACvC,mDAAkD;AAClD,2CAAqE;AAGrE;;;;;;;;;;;;;;GAcG;AACI,IAAM,KAAK,GAA0B,UAAC,EAAsD;QAApD,gBAA2B,EAA3B,QAAQ,mBAAG,+BAAc,EAAE,KAAA,EAAE,WAAW,iBAAA,EAAE,QAAQ,cAAA;IAAO,OAAA,CACtG,oBAAC,oBAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,CAAC,OAAO;QAC5C,oBAAC,6BAAgB,IAAC,WAAW,EAAE,WAAW,GAAI;QAC9C,oBAAC,qBAAQ,IAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,GAAI;QACvC,oBAAC,sBAAS,QAAE,QAAQ,CAAa,CACX,CACzB;AANuG,CAMvG,CAAC;AANW,QAAA,KAAK,SAMhB;AACF,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"Piral.js","sourceRoot":"","sources":["../src/Piral.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,mCAAuC;AACvC,qDAAkD;AAClD,6CAAqF;AAGrF;;;;;;;;;;;;;;GAcG;AACI,MAAM,KAAK,GAA0B,CAAC,EAAE,QAAQ,GAAG,IAAA,+BAAc,GAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACtG,oBAAC,oBAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,CAAC,OAAO;IAC5C,oBAAC,2BAAc,IAAC,EAAE,EAAC,MAAM,GAAG;IAC5B,oBAAC,6BAAgB,IAAC,WAAW,EAAE,WAAW,GAAI;IAC9C,oBAAC,qBAAQ,IAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,GAAI;IACvC,oBAAC,sBAAS,QAAE,QAAQ,CAAa,CACX,CACzB,CAAC;AAPW,QAAA,KAAK,SAOhB;AACF,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC"}
@@ -1,40 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.includeProvider = exports.setRoute = exports.setErrorComponent = exports.setComponent = exports.injectPilet = exports.initialize = exports.changeLayout = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = require("react");
6
- var utils_1 = require("../utils");
4
+ const react_1 = require("react");
5
+ const utils_1 = require("../utils");
7
6
  function changeLayout(ctx, current) {
8
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { app: utils_1.withKey(state.app, 'layout', current) })); });
7
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { app: (0, utils_1.withKey)(state.app, 'layout', current) })));
9
8
  }
10
9
  exports.changeLayout = changeLayout;
11
10
  function initialize(ctx, loading, error, modules) {
12
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { app: tslib_1.__assign(tslib_1.__assign({}, state.app), { error: error,
13
- loading: loading }), modules: modules })); });
11
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { app: Object.assign(Object.assign({}, state.app), { error,
12
+ loading }), modules })));
14
13
  }
15
14
  exports.initialize = initialize;
16
15
  function injectPilet(ctx, pilet) {
17
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { modules: utils_1.replaceOrAddItem(state.modules, pilet, function (m) { return m.name === pilet.name; }), registry: utils_1.removeNested(state.registry, function (m) { return m.pilet === pilet.name; }) })); });
16
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { modules: (0, utils_1.replaceOrAddItem)(state.modules, pilet, (m) => m.name === pilet.name), registry: (0, utils_1.removeNested)(state.registry, (m) => m.pilet === pilet.name) })));
18
17
  ctx.emit('unload-pilet', {
19
18
  name: pilet.name,
20
19
  });
21
20
  }
22
21
  exports.injectPilet = injectPilet;
23
22
  function setComponent(ctx, name, component) {
24
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { components: utils_1.withKey(state.components, name, component) })); });
23
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { components: (0, utils_1.withKey)(state.components, name, component) })));
25
24
  }
26
25
  exports.setComponent = setComponent;
27
26
  function setErrorComponent(ctx, type, component) {
28
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { errorComponents: utils_1.withKey(state.errorComponents, type, component) })); });
27
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { errorComponents: (0, utils_1.withKey)(state.errorComponents, type, component) })));
29
28
  }
30
29
  exports.setErrorComponent = setErrorComponent;
31
30
  function setRoute(ctx, path, component) {
32
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { routes: utils_1.withKey(state.routes, path, component) })); });
31
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { routes: (0, utils_1.withKey)(state.routes, path, component) })));
33
32
  }
34
33
  exports.setRoute = setRoute;
35
34
  function includeProvider(ctx, provider) {
36
- var wrapper = function (props) { return react_1.cloneElement(provider, props); };
37
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { provider: !state.provider ? wrapper : function (props) { return react_1.createElement(state.provider, undefined, wrapper(props)); } })); });
35
+ const wrapper = (props) => (0, react_1.cloneElement)(provider, props);
36
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { provider: !state.provider ? wrapper : (props) => (0, react_1.createElement)(state.provider, undefined, wrapper(props)) })));
38
37
  }
39
38
  exports.includeProvider = includeProvider;
40
39
  //# sourceMappingURL=app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/actions/app.ts"],"names":[],"mappings":";;;;AAAA,+BAAmE;AAEnE,kCAAmE;AAWnE,SAAgB,YAAY,CAAC,GAAuB,EAAE,OAAmB;IACvE,GAAG,CAAC,QAAQ,CAAC,UAAC,KAAK,IAAK,OAAA,uCACnB,KAAK,KACR,GAAG,EAAE,eAAO,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,IAC1C,EAHsB,CAGtB,CAAC,CAAC;AACN,CAAC;AALD,oCAKC;AAED,SAAgB,UAAU,CAAC,GAAuB,EAAE,OAAgB,EAAE,KAAwB,EAAE,OAAqB;IACnH,GAAG,CAAC,QAAQ,CAAC,UAAC,KAAK,IAAK,OAAA,uCACnB,KAAK,KACR,GAAG,wCACE,KAAK,CAAC,GAAG,KACZ,KAAK,OAAA;YACL,OAAO,SAAA,KAET,OAAO,SAAA,IACP,EARsB,CAQtB,CAAC,CAAC;AACN,CAAC;AAVD,gCAUC;AAED,SAAgB,WAAW,CAAC,GAAuB,EAAE,KAAY;IAC/D,GAAG,CAAC,QAAQ,CAAC,UAAC,KAAK,IAAK,OAAA,uCACnB,KAAK,KACR,OAAO,EAAE,wBAAgB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAArB,CAAqB,CAAC,EAC7E,QAAQ,EAAE,oBAAY,CAAkC,KAAK,CAA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K,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,IACzG,CAAC,CAAC;AACN,CAAC;AAPD,0CAOC"}
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.unregisterExtension = exports.registerExtension = exports.unregisterPage = exports.registerPage = void 0;
4
- var tslib_1 = require("tslib");
5
- var utils_1 = require("../utils");
4
+ const utils_1 = require("../utils");
6
5
  function registerPage(ctx, name, value) {
7
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { registry: tslib_1.__assign(tslib_1.__assign({}, state.registry), { pages: utils_1.withKey(state.registry.pages, name, value) }) })); });
6
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { pages: (0, utils_1.withKey)(state.registry.pages, name, value) }) })));
8
7
  }
9
8
  exports.registerPage = registerPage;
10
9
  function unregisterPage(ctx, name) {
11
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { registry: tslib_1.__assign(tslib_1.__assign({}, state.registry), { pages: utils_1.withoutKey(state.registry.pages, name) }) })); });
10
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { pages: (0, utils_1.withoutKey)(state.registry.pages, name) }) })));
12
11
  }
13
12
  exports.unregisterPage = unregisterPage;
14
13
  function registerExtension(ctx, name, value) {
15
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { registry: tslib_1.__assign(tslib_1.__assign({}, state.registry), { extensions: utils_1.withKey(state.registry.extensions, name, utils_1.appendItem(state.registry.extensions[name], value)) }) })); });
14
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { extensions: (0, utils_1.withKey)(state.registry.extensions, name, (0, utils_1.appendItem)(state.registry.extensions[name], value)) }) })));
16
15
  }
17
16
  exports.registerExtension = registerExtension;
18
17
  function unregisterExtension(ctx, name, reference) {
19
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { registry: tslib_1.__assign(tslib_1.__assign({}, state.registry), { extensions: utils_1.withKey(state.registry.extensions, name, utils_1.excludeOn(state.registry.extensions[name], function (m) { return m.reference === reference; })) }) })); });
18
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { extensions: (0, utils_1.withKey)(state.registry.extensions, name, (0, utils_1.excludeOn)(state.registry.extensions[name], (m) => m.reference === reference)) }) })));
20
19
  }
21
20
  exports.unregisterExtension = unregisterExtension;
22
21
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/actions/components.ts"],"names":[],"mappings":";;;;AAAA,kCAAsE;AAGtE,SAAgB,YAAY,CAAC,GAAuB,EAAE,IAAY,EAAE,KAAuB;IACzF,GAAG,CAAC,QAAQ,CAAC,UAAC,KAAK,IAAK,OAAA,uCACnB,KAAK,KACR,QAAQ,wCACH,KAAK,CAAC,QAAQ,KACjB,KAAK,EAAE,eAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,OAEnD,EANsB,CAMtB,CAAC,CAAC;AACN,CAAC;AARD,oCAQC;AAED,SAAgB,cAAc,CAAC,GAAuB,EAAE,IAAY;IAClE,GAAG,CAAC,QAAQ,CAAC,UAAC,KAAK,IAAK,OAAA,uCACnB,KAAK,KACR,QAAQ,wCACH,KAAK,CAAC,QAAQ,KACjB,KAAK,EAAE,kBAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,OAE/C,EANsB,CAMtB,CAAC,CAAC;AACN,CAAC;AARD,wC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readDataValue = exports.readDataItem = exports.resetData = void 0;
4
- var tslib_1 = require("tslib");
5
- var utils_1 = require("../utils");
4
+ const utils_1 = require("../utils");
6
5
  function resetData(ctx) {
7
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { data: {} })); });
6
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { data: {} })));
8
7
  }
9
8
  exports.resetData = resetData;
10
9
  function readDataItem(ctx, key) {
11
- return ctx.readState(function (state) { return state.data[key]; });
10
+ return ctx.readState((state) => state.data[key]);
12
11
  }
13
12
  exports.readDataItem = readDataItem;
14
13
  function readDataValue(ctx, key) {
15
- var item = readDataItem(ctx, key);
14
+ const item = readDataItem(ctx, key);
16
15
  return item && item.value;
17
16
  }
18
17
  exports.readDataValue = readDataValue;
19
18
  function writeDataItem(ctx, key, value, owner, target, expires) {
20
- var isNull = !value && typeof value === 'object';
21
- var data = isNull
19
+ const isNull = !value && typeof value === 'object';
20
+ const data = isNull
22
21
  ? value
23
22
  : {
24
- value: value,
25
- owner: owner,
26
- target: target,
27
- expires: expires,
23
+ value,
24
+ owner,
25
+ target,
26
+ expires,
28
27
  };
29
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { data: utils_1.updateKey(state.data, key, data) })); });
28
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { data: (0, utils_1.updateKey)(state.data, key, data) })));
30
29
  ctx.emit('store-data', {
31
30
  name: key,
32
- target: target,
33
- value: value,
34
- owner: owner,
35
- expires: expires,
31
+ target,
32
+ value,
33
+ owner,
34
+ expires,
36
35
  });
37
36
  }
38
37
  exports.writeDataItem = writeDataItem;
39
38
  function tryWriteDataItem(ctx, key, value, owner, target, expires) {
40
- var item = readDataItem(ctx, key);
39
+ const item = readDataItem(ctx, key);
41
40
  if (item && item.owner !== owner) {
42
- console.error("Invalid data write to '" + key + "'. This item currently belongs to '" + item.owner + "' (write attempted from '" + owner + "'). The action has been ignored.");
41
+ console.error(`Invalid data write to '${key}'. This item currently belongs to '${item.owner}' (write attempted from '${owner}'). The action has been ignored.`);
43
42
  return false;
44
43
  }
45
44
  writeDataItem(ctx, key, value, owner, target, expires);
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/actions/data.ts"],"names":[],"mappings":";;;;AAAA,kCAAqC;AAGrC,SAAgB,SAAS,CAAC,GAAuB;IAC/C,GAAG,CAAC,QAAQ,CAAC,UAAC,KAAK,IAAK,OAAA,uCACnB,KAAK,KACR,IAAI,EAAE,EAAE,IACR,EAHsB,CAGtB,CAAC,CAAC;AACN,CAAC;AALD,8BAKC;AAED,SAAgB,YAAY,CAAC,GAAuB,EAAE,GAAW;IAC/D,OAAO,GAAG,CAAC,SAAS,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAf,CAAe,CAAC,CAAC;AACnD,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa,CAAC,GAAuB,EAAE,GAAW;IAChE,IAAM,IAAI,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC;AAC5B,CAAC;AAHD,sCAGC;AAED,SAAgB,aAAa,CAC3B,GAAuB,EACvB,GAAW,EACX,KAAU,EACV,KAAa,EACb,MAAuB,EACvB,OAAe;IAEf,IAAM,MAAM,GAAG,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;IACnD,IAAM,IAAI,GAAG,MAAM;QACjB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC;YACE,KAAK,OAAA;YACL,KAAK,OAAA;YACL,MAAM,QAAA;YACN,OAAO,SAAA;SACR,CAAC;IACN,GAAG,CAAC,QAAQ,CAAC,UAAC,KAAK,IAAK,OAAA,uCACnB,KAAK,KACR,IAAI,EAAE,iBAAS,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,IACtC,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 @@ function defineAction(ctx, actionName, action) {
6
6
  }
7
7
  exports.defineAction = defineAction;
8
8
  function defineActions(ctx, actions) {
9
- for (var _i = 0, _a = Object.keys(actions); _i < _a.length; _i++) {
10
- var actionName = _a[_i];
11
- var action = actions[actionName];
9
+ for (const actionName of Object.keys(actions)) {
10
+ const action = actions[actionName];
12
11
  defineAction(ctx, actionName, action);
13
12
  }
14
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/actions/define.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAC,GAAuB,EAAE,UAAkB,EAAE,MAAW;IACnF,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa,CAAC,GAAuB,EAAE,OAAY;IACjE,KAAyB,UAAoB,EAApB,KAAA,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAApB,cAAoB,EAApB,IAAoB,EAAE;QAA1C,IAAM,UAAU,SAAA;QACnB,IAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACnC,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;KACvC;AACH,CAAC;AALD,sCAKC"}
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/actions/define.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAC,GAAuB,EAAE,UAAkB,EAAE,MAAW;IACnF,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa,CAAC,GAAuB,EAAE,OAAY;IACjE,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACnC,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;KACvC;AACH,CAAC;AALD,sCAKC"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./app"), exports);
5
- tslib_1.__exportStar(require("./components"), exports);
6
- tslib_1.__exportStar(require("./data"), exports);
7
- tslib_1.__exportStar(require("./define"), exports);
8
- tslib_1.__exportStar(require("./portal"), exports);
9
- tslib_1.__exportStar(require("./state"), exports);
3
+ const tslib_1 = require("tslib");
4
+ (0, tslib_1.__exportStar)(require("./app"), exports);
5
+ (0, tslib_1.__exportStar)(require("./components"), exports);
6
+ (0, tslib_1.__exportStar)(require("./data"), exports);
7
+ (0, tslib_1.__exportStar)(require("./define"), exports);
8
+ (0, tslib_1.__exportStar)(require("./portal"), exports);
9
+ (0, tslib_1.__exportStar)(require("./state"), exports);
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,uDAA6B;AAC7B,iDAAuB;AACvB,mDAAyB;AACzB,mDAAyB;AACzB,kDAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":";;;AAAA,qDAAsB;AACtB,4DAA6B;AAC7B,sDAAuB;AACvB,wDAAyB;AACzB,wDAAyB;AACzB,uDAAwB"}
@@ -1,4 +1,6 @@
1
1
  import { ReactPortal } from 'react';
2
2
  import { GlobalStateContext } from '../types';
3
3
  export declare function destroyPortal(ctx: GlobalStateContext, id: string): void;
4
+ export declare function hidePortal(ctx: GlobalStateContext, id: string, entry: ReactPortal): void;
5
+ export declare function updatePortal(ctx: GlobalStateContext, id: string, current: ReactPortal, next: ReactPortal): void;
4
6
  export declare function showPortal(ctx: GlobalStateContext, id: string, entry: ReactPortal): void;
@@ -1,14 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.showPortal = exports.destroyPortal = void 0;
4
- var tslib_1 = require("tslib");
5
- var utils_1 = require("../utils");
3
+ exports.showPortal = exports.updatePortal = exports.hidePortal = exports.destroyPortal = void 0;
4
+ const utils_1 = require("../utils");
6
5
  function destroyPortal(ctx, id) {
7
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { portals: utils_1.withoutKey(state.portals, id) })); });
6
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withoutKey)(state.portals, id) })));
8
7
  }
9
8
  exports.destroyPortal = destroyPortal;
9
+ function hidePortal(ctx, id, entry) {
10
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withKey)(state.portals, id, (0, utils_1.excludeItem)(state.portals[id], entry)) })));
11
+ }
12
+ exports.hidePortal = hidePortal;
13
+ function updatePortal(ctx, id, current, next) {
14
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withKey)(state.portals, id, (0, utils_1.replaceOrAddItem)(state.portals[id], next, (m) => m === current)) })));
15
+ }
16
+ exports.updatePortal = updatePortal;
10
17
  function showPortal(ctx, id, entry) {
11
- ctx.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { portals: utils_1.withKey(state.portals, id, utils_1.includeItem(state.portals[id], entry)) })); });
18
+ ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withKey)(state.portals, id, (0, utils_1.includeItem)(state.portals[id], entry)) })));
12
19
  }
13
20
  exports.showPortal = showPortal;
14
21
  //# sourceMappingURL=portal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"portal.js","sourceRoot":"","sources":["../../src/actions/portal.ts"],"names":[],"mappings":";;;;AACA,kCAA4D;AAG5D,SAAgB,aAAa,CAAC,GAAuB,EAAE,EAAU;IAC/D,G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AC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCACnB,KAAK,KACR,OAAO,EAAE,IAAA,eAAO,EACd,KAAK,CAAC,OAAO,EACb,EAAE,EACF,IAAA,wBAAgB,EAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAChE,IACD,CAAC,CAAC;AACN,CAAC;AATD,oCASC;AAED,SAAgB,UAAU,CAAC,GAAuB,EAAE,EAAU,EAAE,KAAkB;IAChF,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCACnB,KAAK,KACR,OAAO,EAAE,IAAA,eAAO,EAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,IAAA,mBAAW,EAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,IAC1E,CAAC,CAAC;AACN,CAAC;AALD,gCAKC"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readState = exports.dispatch = void 0;
4
- var react_atom_1 = require("@dbeining/react-atom");
4
+ const react_atom_1 = require("@dbeining/react-atom");
5
5
  function dispatch(ctx, update) {
6
- react_atom_1.swap(ctx.state, update);
6
+ (0, react_atom_1.swap)(ctx.state, update);
7
7
  }
8
8
  exports.dispatch = dispatch;
9
9
  function readState(ctx, read) {
10
- var state = react_atom_1.deref(ctx.state);
10
+ const state = (0, react_atom_1.deref)(ctx.state);
11
11
  return read(state);
12
12
  }
13
13
  exports.readState = readState;
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/actions/state.ts"],"names":[],"mappings":";;;AAAA,mDAAmD;AAGnD,SAAgB,QAAQ,CAAC,GAAuB,EAAE,MAA2C;IAC3F,iBAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC1B,CAAC;AAFD,4BAEC;AAED,SAAgB,SAAS,CAAI,GAAuB,EAAE,IAA+B;IACnF,IAAM,KAAK,GAAG,kBAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC;AAHD,8BAGC"}
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/actions/state.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAGnD,SAAgB,QAAQ,CAAC,GAAuB,EAAE,MAA2C;IAC3F,IAAA,iBAAI,EAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC1B,CAAC;AAFD,4BAEC;AAED,SAAgB,SAAS,CAAI,GAAuB,EAAE,IAA+B;IACnF,MAAM,KAAK,GAAG,IAAA,kBAAK,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC;AAHD,8BAGC"}
@@ -1,16 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultErrorInfo = void 0;
4
- var tslib_1 = require("tslib");
5
- var React = require("react");
6
- var ExtensionSlot_1 = require("./ExtensionSlot");
7
- var SwitchErrorInfo_1 = require("./SwitchErrorInfo");
4
+ const React = require("react");
5
+ const ExtensionSlot_1 = require("./ExtensionSlot");
6
+ const SwitchErrorInfo_1 = require("./SwitchErrorInfo");
8
7
  /**
9
8
  * The default error info component. Just uses the "error" extension slot.
10
9
  * Leverage the default one by registration of respective extensions using
11
10
  * the "error" name.
12
11
  */
13
- var DefaultErrorInfo = function (props) { return (React.createElement(ExtensionSlot_1.ExtensionSlot, { name: "error", params: props, empty: function () { return React.createElement(SwitchErrorInfo_1.SwitchErrorInfo, tslib_1.__assign({ key: "default_error" }, props)); } })); };
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)) }));
14
13
  exports.DefaultErrorInfo = DefaultErrorInfo;
15
14
  exports.DefaultErrorInfo.displayName = 'DefaultErrorInfo';
16
15
  //# sourceMappingURL=DefaultErrorInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultErrorInfo.js","sourceRoot":"","sources":["../../src/components/DefaultErrorInfo.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,iDAAgD;AAChD,qDAAoD;AAGpD;;;;GAIG;AACI,IAAM,gBAAgB,GAA6B,UAAC,KAAK,IAAK,OAAA,CACnE,oBAAC,6BAAa,IAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,cAAM,OAAA,oBAAC,iCAAe,qBAAC,GAAG,EAAC,eAAe,IAAK,KAAK,EAAI,EAAlD,CAAkD,GAAI,CAC/G,EAFoE,CAEpE,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AACF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"DefaultErrorInfo.js","sourceRoot":"","sources":["../../src/components/DefaultErrorInfo.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,mDAAgD;AAChD,uDAAoD;AAGpD;;;;GAIG;AACI,MAAM,gBAAgB,GAA6B,CAAC,KAAK,EAAE,EAAE,CAAC,CACnE,oBAAC,6BAAa,IAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,oBAAC,iCAAe,kBAAC,GAAG,EAAC,eAAe,IAAK,KAAK,EAAI,GAAI,CAC/G,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AACF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultLayout = void 0;
4
- var utils_1 = require("../utils");
4
+ const utils_1 = require("../utils");
5
5
  /**
6
6
  * The default layout only rendering the provided children.
7
7
  */
8
- var DefaultLayout = function (_a) {
9
- var children = _a.children;
10
- return utils_1.defaultRender(children);
11
- };
8
+ const DefaultLayout = ({ children }) => (0, utils_1.defaultRender)(children);
12
9
  exports.DefaultLayout = DefaultLayout;
13
10
  exports.DefaultLayout.displayName = 'DefaultLayout';
14
11
  //# sourceMappingURL=DefaultLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultLayout.js","sourceRoot":"","sources":["../../src/components/DefaultLayout.tsx"],"names":[],"mappings":";;;AAEA,kCAAyC;AAEzC;;GAEG;AACI,IAAM,aAAa,GAA0B,UAAC,EAAY;QAAV,QAAQ,cAAA;IAAO,OAAA,qBAAa,CAAC,QAAQ,CAAC;AAAvB,CAAuB,CAAC;AAAjF,QAAA,aAAa,iBAAoE;AAC9F,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"DefaultLayout.js","sourceRoot":"","sources":["../../src/components/DefaultLayout.tsx"],"names":[],"mappings":";;;AAEA,oCAAyC;AAEzC;;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"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultLoadingIndicator = void 0;
4
- var React = require("react");
4
+ const React = require("react");
5
5
  /**
6
6
  * The default loading indicator only displaying "Loading".
7
7
  */
8
- var DefaultLoadingIndicator = function () { return React.createElement("div", null, "Loading"); };
8
+ const DefaultLoadingIndicator = () => React.createElement("div", null, "Loading");
9
9
  exports.DefaultLoadingIndicator = DefaultLoadingIndicator;
10
10
  exports.DefaultLoadingIndicator.displayName = 'DefaultLoadingIndicator';
11
11
  //# sourceMappingURL=DefaultLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultLoader.js","sourceRoot":"","sources":["../../src/components/DefaultLoader.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAG/B;;GAEG;AACI,IAAM,uBAAuB,GAAoC,cAAM,OAAA,2CAAkB,EAAlB,CAAkB,CAAC;AAApF,QAAA,uBAAuB,2BAA6D;AACjG,+BAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"DefaultLoader.js","sourceRoot":"","sources":["../../src/components/DefaultLoader.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"}
@@ -1,42 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ErrorBoundary = void 0;
4
- var tslib_1 = require("tslib");
5
- var React = require("react");
6
- var piral_base_1 = require("piral-base");
4
+ const React = require("react");
5
+ const piral_base_1 = require("piral-base");
7
6
  /**
8
7
  * The React component for catching errors and displaying error information.
9
8
  */
10
- var ErrorBoundary = /** @class */ (function (_super) {
11
- tslib_1.__extends(ErrorBoundary, _super);
12
- function ErrorBoundary(props) {
13
- var _this = _super.call(this, props) || this;
14
- _this.state = {
9
+ class ErrorBoundary extends React.Component {
10
+ constructor(props) {
11
+ super(props);
12
+ this.state = {
15
13
  error: undefined,
16
14
  };
17
- return _this;
18
15
  }
19
- ErrorBoundary.prototype.componentDidCatch = function (error) {
20
- var onError = this.props.onError;
21
- if (piral_base_1.isfunc(onError)) {
16
+ componentDidCatch(error) {
17
+ const { onError } = this.props;
18
+ if ((0, piral_base_1.isfunc)(onError)) {
22
19
  onError(error);
23
20
  }
24
21
  this.setState({
25
- error: error,
22
+ error,
26
23
  });
27
- };
28
- ErrorBoundary.prototype.render = function () {
29
- var _a = this.props, children = _a.children, renderError = _a.renderError, renderChild = _a.renderChild, renderProps = _a.renderProps;
30
- var error = this.state.error;
24
+ }
25
+ render() {
26
+ const { children, renderError, renderChild, renderProps } = this.props;
27
+ const { error } = this.state;
31
28
  if (error) {
32
- if (piral_base_1.isfunc(renderError)) {
29
+ if ((0, piral_base_1.isfunc)(renderError)) {
33
30
  return renderError(error, renderProps);
34
31
  }
35
32
  return React.createElement("div", { style: { whiteSpace: 'pre-wrap' } }, error && error.message);
36
33
  }
37
- return piral_base_1.isfunc(renderChild) ? renderChild(children, renderProps) : children;
38
- };
39
- return ErrorBoundary;
40
- }(React.Component));
34
+ return (0, piral_base_1.isfunc)(renderChild) ? renderChild(children, renderProps) : children;
35
+ }
36
+ }
41
37
  exports.ErrorBoundary = ErrorBoundary;
42
38
  //# sourceMappingURL=ErrorBoundary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,yCAAoC;AA6CpC;;GAEG;AACH;IAAsC,yCAA0D;IAC9F,uBAAY,KAA4B;QAAxC,YACE,kBAAM,KAAK,CAAC,SAIb;QAHC,KAAI,CAAC,KAAK,GAAG;YACX,KAAK,EAAE,SAAS;SACjB,CAAC;;IACJ,CAAC;IAED,yCAAiB,GAAjB,UAAkB,KAAY;QACpB,IAAA,OAAO,GAAK,IAAI,CAAC,KAAK,QAAf,CAAgB;QAE/B,IAAI,mBAAM,CAAC,OAAO,CAAC,EAAE;YACnB,OAAO,CAAC,KAAK,CAAC,CAAC;SAChB;QAED,IAAI,CAAC,QAAQ,CAAC;YACZ,KAAK,OAAA;SACN,CAAC,CAAC;IACL,CAAC;IAED,8BAAM,GAAN;QACQ,IAAA,KAAsD,IAAI,CAAC,KAAK,EAA9D,QAAQ,cAAA,EA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,KAAK,CAAC;QACvE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE7B,IAAI,KAAK,EAAE;YACT,IAAI,IAAA,mBAAM,EAAC,WAAW,CAAC,EAAE;gBACvB,OAAO,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;aACxC;YAED,OAAO,6BAAK,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,IAAG,KAAK,IAAI,KAAK,CAAC,OAAO,CAAO,CAAC;SAC/E;QAED,OAAO,IAAA,mBAAM,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;CACF;AAlCD,sCAkCC"}
@@ -1,26 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExtensionSlot = void 0;
4
- var tslib_1 = require("tslib");
5
- var React = require("react");
6
- var piral_base_1 = require("piral-base");
7
- var hooks_1 = require("../hooks");
8
- var utils_1 = require("../utils");
4
+ const React = require("react");
5
+ const piral_base_1 = require("piral-base");
6
+ const hooks_1 = require("../hooks");
7
+ const utils_1 = require("../utils");
9
8
  /**
10
9
  * The extension slot component to be used when the available
11
10
  * extensions of a given name should be rendered at a specific
12
11
  * location.
13
12
  */
14
13
  function ExtensionSlot(props) {
15
- var name = props.name, _a = props.render, render = _a === void 0 ? utils_1.defaultRender : _a, empty = props.empty, params = props.params;
16
- var extensions = hooks_1.useGlobalState(function (s) { return s.registry.extensions[name] || []; });
17
- return render(extensions.length === 0 && piral_base_1.isfunc(empty)
18
- ? [utils_1.defaultRender(empty(), 'empty')]
19
- : extensions.map(function (_a, i) {
20
- var Component = _a.component, reference = _a.reference, _b = _a.defaults, defaults = _b === void 0 ? {} : _b;
21
- return (React.createElement(Component, { key: "" + ((reference === null || reference === void 0 ? void 0 : reference.displayName) || '_') + i, params: tslib_1.__assign(tslib_1.__assign({}, defaults), (params || {})) }));
22
- }));
14
+ const { name, render = utils_1.defaultRender, empty, params } = props;
15
+ const extensions = (0, hooks_1.useGlobalState)((s) => s.registry.extensions[name] || utils_1.none);
16
+ return render(extensions.length === 0 && (0, piral_base_1.isfunc)(empty)
17
+ ? [(0, utils_1.defaultRender)(empty(), 'empty')]
18
+ : extensions.map(({ component: Component, reference, defaults = {} }, i) => (React.createElement(Component, { key: `${(reference === null || reference === void 0 ? void 0 : reference.displayName) || '_'}${i}`, params: Object.assign(Object.assign({}, defaults), (params || {})) }))));
23
19
  }
24
20
  exports.ExtensionSlot = ExtensionSlot;
25
- ExtensionSlot.displayName = "ExtensionSlot";
21
+ ExtensionSlot.displayName = `ExtensionSlot`;
26
22
  //# sourceMappingURL=ExtensionSlot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionSlot.js","sourceRoot":"","sources":["../../src/components/ExtensionSlot.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,yCAAoC;AACpC,kCAA0C;AAC1C,kCAAyC;AAGzC;;;;GAIG;AACH,SAAgB,aAAa,CAAmB,KAA4B;IAClE,IAAA,IAAI,GAA4C,KAAK,KAAjD,EAAE,KAA0C,KAAK,OAAzB,EAAtB,MAAM,mBAAG,qBAAa,KAAA,EAAE,KAAK,GAAa,KAAK,MAAlB,EAAE,MAAM,GAAK,KAAK,OAAV,CAAW;IAC9D,IAAM,UAAU,GAAG,sBAAc,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAjC,CAAiC,CAAC,CAAC;IAC5E,OAAO,MAAM,CACX,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,mBAAM,CAAC,KAAK,CAAC;QACtC,CAAC,CAAC,CAAC,qBAAa,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,UAAC,EAAk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