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.
- package/debug-pilet.d.ts +3 -0
- package/debug-pilet.js +12 -0
- package/debug-piral.d.ts +4 -0
- package/debug-piral.js +59 -0
- package/dependencies.codegen +1 -1
- package/esm/Piral.js +6 -8
- package/esm/Piral.js.map +1 -1
- package/esm/actions/app.js +9 -10
- package/esm/actions/app.js.map +1 -1
- package/esm/actions/components.js +4 -5
- package/esm/actions/components.js.map +1 -1
- package/esm/actions/data.js +16 -17
- package/esm/actions/data.js.map +1 -1
- package/esm/actions/define.js +2 -3
- package/esm/actions/define.js.map +1 -1
- package/esm/actions/portal.d.ts +2 -0
- package/esm/actions/portal.js +9 -4
- package/esm/actions/portal.js.map +1 -1
- package/esm/actions/state.js +1 -1
- package/esm/actions/state.js.map +1 -1
- package/esm/components/DefaultErrorInfo.js +1 -2
- package/esm/components/DefaultErrorInfo.js.map +1 -1
- package/esm/components/DefaultLayout.js +1 -4
- package/esm/components/DefaultLayout.js.map +1 -1
- package/esm/components/DefaultLoader.js +1 -1
- package/esm/components/DefaultLoader.js.map +1 -1
- package/esm/components/ErrorBoundary.js +13 -18
- package/esm/components/ErrorBoundary.js.map +1 -1
- package/esm/components/ExtensionSlot.js +5 -9
- package/esm/components/ExtensionSlot.js.map +1 -1
- package/esm/components/Mediator.js +8 -8
- package/esm/components/Mediator.js.map +1 -1
- package/esm/components/PiralRoutes.js +8 -8
- package/esm/components/PiralRoutes.js.map +1 -1
- package/esm/components/PiralView.js +11 -16
- package/esm/components/PiralView.js.map +1 -1
- package/esm/components/PortalRenderer.d.ts +5 -0
- package/esm/components/PortalRenderer.js +7 -0
- package/esm/components/PortalRenderer.js.map +1 -0
- package/esm/components/ResponsiveLayout.js +5 -6
- package/esm/components/ResponsiveLayout.js.map +1 -1
- package/esm/components/SetComponent.js +3 -4
- package/esm/components/SetComponent.js.map +1 -1
- package/esm/components/SetError.js +3 -4
- package/esm/components/SetError.js.map +1 -1
- package/esm/components/SetErrors.js +2 -3
- package/esm/components/SetErrors.js.map +1 -1
- package/esm/components/SetLayout.js +2 -3
- package/esm/components/SetLayout.js.map +1 -1
- package/esm/components/SetProvider.js +3 -4
- package/esm/components/SetProvider.js.map +1 -1
- package/esm/components/SetRedirect.js +3 -4
- package/esm/components/SetRedirect.js.map +1 -1
- package/esm/components/SetRoute.js +3 -4
- package/esm/components/SetRoute.js.map +1 -1
- package/esm/components/SwitchErrorInfo.js +12 -10
- package/esm/components/SwitchErrorInfo.js.map +1 -1
- package/esm/components/components.js +8 -9
- package/esm/components/components.js.map +1 -1
- package/esm/components/index.d.ts +1 -0
- package/esm/components/index.js +1 -0
- package/esm/components/index.js.map +1 -1
- package/esm/createInstance.js +24 -25
- package/esm/createInstance.js.map +1 -1
- package/esm/helpers.d.ts +11 -26
- package/esm/helpers.js +18 -56
- package/esm/helpers.js.map +1 -1
- package/esm/hooks/action.js +1 -1
- package/esm/hooks/action.js.map +1 -1
- package/esm/hooks/actions.js +1 -1
- package/esm/hooks/actions.js.map +1 -1
- package/esm/hooks/globalState.js +5 -5
- package/esm/hooks/globalState.js.map +1 -1
- package/esm/hooks/index.d.ts +0 -5
- package/esm/hooks/index.js +0 -5
- package/esm/hooks/index.js.map +1 -1
- package/esm/hooks/media.js +8 -7
- package/esm/hooks/media.js.map +1 -1
- package/esm/hooks/setter.js +3 -2
- package/esm/hooks/setter.js.map +1 -1
- package/esm/hooks/sharedData.js +2 -2
- package/esm/hooks/sharedData.js.map +1 -1
- package/esm/modules/api.js +79 -28
- package/esm/modules/api.js.map +1 -1
- package/esm/modules/dependencies.d.ts +3 -4
- package/esm/modules/dependencies.js +11 -14
- package/esm/modules/dependencies.js.map +1 -1
- package/esm/state/createActions.js +7 -12
- package/esm/state/createActions.js.map +1 -1
- package/esm/state/createGlobalState.js +6 -8
- package/esm/state/createGlobalState.js.map +1 -1
- package/esm/state/stateContext.js +1 -1
- package/esm/state/stateContext.js.map +1 -1
- package/esm/state/withApi.js +59 -62
- package/esm/state/withApi.js.map +1 -1
- package/esm/types/config.d.ts +23 -16
- package/esm/types/state.d.ts +13 -0
- package/esm/utils/compare.js +4 -4
- package/esm/utils/compare.js.map +1 -1
- package/esm/utils/data.js +6 -7
- package/esm/utils/data.js.map +1 -1
- package/esm/utils/foreign.d.ts +4 -2
- package/esm/utils/foreign.js +16 -8
- package/esm/utils/foreign.js.map +1 -1
- package/esm/utils/guid.js +3 -3
- package/esm/utils/guid.js.map +1 -1
- package/esm/utils/helpers.d.ts +11 -8
- package/esm/utils/helpers.js +28 -17
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/media.js +8 -7
- package/esm/utils/media.js.map +1 -1
- package/esm/utils/storage.js +13 -14
- package/esm/utils/storage.js.map +1 -1
- package/lib/Piral.js +9 -11
- package/lib/Piral.js.map +1 -1
- package/lib/actions/app.js +11 -12
- package/lib/actions/app.js.map +1 -1
- package/lib/actions/components.js +5 -6
- package/lib/actions/components.js.map +1 -1
- package/lib/actions/data.js +17 -18
- package/lib/actions/data.js.map +1 -1
- package/lib/actions/define.js +2 -3
- package/lib/actions/define.js.map +1 -1
- package/lib/actions/index.js +7 -7
- package/lib/actions/index.js.map +1 -1
- package/lib/actions/portal.d.ts +2 -0
- package/lib/actions/portal.js +12 -5
- package/lib/actions/portal.js.map +1 -1
- package/lib/actions/state.js +3 -3
- package/lib/actions/state.js.map +1 -1
- package/lib/components/DefaultErrorInfo.js +4 -5
- package/lib/components/DefaultErrorInfo.js.map +1 -1
- package/lib/components/DefaultLayout.js +2 -5
- package/lib/components/DefaultLayout.js.map +1 -1
- package/lib/components/DefaultLoader.js +2 -2
- package/lib/components/DefaultLoader.js.map +1 -1
- package/lib/components/ErrorBoundary.js +18 -22
- package/lib/components/ErrorBoundary.js.map +1 -1
- package/lib/components/ExtensionSlot.js +10 -14
- package/lib/components/ExtensionSlot.js.map +1 -1
- package/lib/components/Mediator.js +11 -11
- package/lib/components/Mediator.js.map +1 -1
- package/lib/components/PiralRoutes.js +11 -11
- package/lib/components/PiralRoutes.js.map +1 -1
- package/lib/components/PiralView.js +16 -21
- package/lib/components/PiralView.js.map +1 -1
- package/lib/components/PortalRenderer.d.ts +5 -0
- package/lib/components/PortalRenderer.js +11 -0
- package/lib/components/PortalRenderer.js.map +1 -0
- package/lib/components/ResponsiveLayout.js +9 -10
- package/lib/components/ResponsiveLayout.js.map +1 -1
- package/lib/components/SetComponent.js +4 -5
- package/lib/components/SetComponent.js.map +1 -1
- package/lib/components/SetError.js +4 -5
- package/lib/components/SetError.js.map +1 -1
- package/lib/components/SetErrors.js +4 -5
- package/lib/components/SetErrors.js.map +1 -1
- package/lib/components/SetLayout.js +4 -5
- package/lib/components/SetLayout.js.map +1 -1
- package/lib/components/SetProvider.js +4 -5
- package/lib/components/SetProvider.js.map +1 -1
- package/lib/components/SetRedirect.js +6 -7
- package/lib/components/SetRedirect.js.map +1 -1
- package/lib/components/SetRoute.js +4 -5
- package/lib/components/SetRoute.js.map +1 -1
- package/lib/components/SwitchErrorInfo.js +14 -12
- package/lib/components/SwitchErrorInfo.js.map +1 -1
- package/lib/components/components.js +5 -6
- package/lib/components/components.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +20 -19
- package/lib/components/index.js.map +1 -1
- package/lib/createInstance.js +31 -32
- package/lib/createInstance.js.map +1 -1
- package/lib/helpers.d.ts +11 -26
- package/lib/helpers.js +19 -59
- package/lib/helpers.js.map +1 -1
- package/lib/hooks/action.js +3 -3
- package/lib/hooks/action.js.map +1 -1
- package/lib/hooks/actions.js +4 -4
- package/lib/hooks/actions.js.map +1 -1
- package/lib/hooks/globalState.js +8 -8
- package/lib/hooks/globalState.js.map +1 -1
- package/lib/hooks/index.d.ts +0 -5
- package/lib/hooks/index.js +7 -12
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/media.js +10 -9
- package/lib/hooks/media.js.map +1 -1
- package/lib/hooks/setter.js +4 -3
- package/lib/hooks/setter.js.map +1 -1
- package/lib/hooks/sharedData.js +3 -3
- package/lib/hooks/sharedData.js.map +1 -1
- package/lib/index.js +9 -9
- package/lib/index.js.map +1 -1
- package/lib/modules/api.js +86 -35
- package/lib/modules/api.js.map +1 -1
- package/lib/modules/dependencies.d.ts +3 -4
- package/lib/modules/dependencies.js +13 -16
- package/lib/modules/dependencies.js.map +1 -1
- package/lib/modules/index.js +3 -3
- package/lib/modules/index.js.map +1 -1
- package/lib/state/createActions.js +8 -13
- package/lib/state/createActions.js.map +1 -1
- package/lib/state/createGlobalState.js +9 -11
- package/lib/state/createGlobalState.js.map +1 -1
- package/lib/state/index.js +5 -5
- package/lib/state/index.js.map +1 -1
- package/lib/state/stateContext.js +1 -1
- package/lib/state/stateContext.js.map +1 -1
- package/lib/state/withApi.js +67 -70
- package/lib/state/withApi.js.map +1 -1
- package/lib/types/config.d.ts +23 -16
- package/lib/types/index.js +13 -13
- package/lib/types/index.js.map +1 -1
- package/lib/types/state.d.ts +13 -0
- package/lib/utils/compare.js +4 -4
- package/lib/utils/compare.js.map +1 -1
- package/lib/utils/data.js +6 -7
- package/lib/utils/data.js.map +1 -1
- package/lib/utils/foreign.d.ts +4 -2
- package/lib/utils/foreign.js +21 -11
- package/lib/utils/foreign.js.map +1 -1
- package/lib/utils/guid.js +3 -3
- package/lib/utils/guid.js.map +1 -1
- package/lib/utils/helpers.d.ts +11 -8
- package/lib/utils/helpers.js +30 -17
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/index.js +9 -9
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/media.js +7 -6
- package/lib/utils/media.js.map +1 -1
- package/lib/utils/react.js +1 -1
- package/lib/utils/react.js.map +1 -1
- package/lib/utils/storage.js +11 -12
- package/lib/utils/storage.js.map +1 -1
- package/package.json +21 -5
- package/src/Piral.tsx +2 -1
- package/src/actions/portal.ts +19 -1
- package/src/components/ExtensionSlot.tsx +2 -2
- package/src/components/Mediator.tsx +2 -1
- package/src/components/PortalRenderer.tsx +12 -0
- package/src/components/SwitchErrorInfo.tsx +5 -1
- package/src/components/index.ts +1 -0
- package/src/createInstance.tsx +6 -7
- package/src/helpers.test.tsx +7 -39
- package/src/helpers.tsx +32 -85
- package/src/hooks/index.ts +0 -5
- package/src/hooks/media.ts +2 -1
- package/src/hooks/setter.ts +2 -1
- package/src/modules/api.ts +72 -4
- package/src/modules/dependencies.test.ts +18 -5
- package/src/modules/dependencies.ts +12 -18
- package/src/state/withApi.tsx +12 -14
- package/src/types/config.ts +23 -17
- package/src/types/state.ts +13 -0
- package/src/utils/foreign.test.ts +4 -4
- package/src/utils/foreign.ts +28 -5
- package/src/utils/helpers.ts +21 -7
- package/src/utils/media.ts +2 -1
- package/esm/hooks/debounce.d.ts +0 -8
- package/esm/hooks/debounce.js +0 -18
- package/esm/hooks/debounce.js.map +0 -1
- package/esm/hooks/lockBodyScroll.d.ts +0 -6
- package/esm/hooks/lockBodyScroll.js +0 -15
- package/esm/hooks/lockBodyScroll.js.map +0 -1
- package/esm/hooks/onClickOutside.d.ts +0 -8
- package/esm/hooks/onClickOutside.js +0 -23
- package/esm/hooks/onClickOutside.js.map +0 -1
- package/esm/hooks/onScreenVisible.d.ts +0 -11
- package/esm/hooks/onScreenVisible.js +0 -28
- package/esm/hooks/onScreenVisible.js.map +0 -1
- package/esm/hooks/promise.d.ts +0 -13
- package/esm/hooks/promise.js +0 -21
- package/esm/hooks/promise.js.map +0 -1
- package/lib/hooks/debounce.d.ts +0 -8
- package/lib/hooks/debounce.js +0 -22
- package/lib/hooks/debounce.js.map +0 -1
- package/lib/hooks/lockBodyScroll.d.ts +0 -6
- package/lib/hooks/lockBodyScroll.js +0 -19
- package/lib/hooks/lockBodyScroll.js.map +0 -1
- package/lib/hooks/onClickOutside.d.ts +0 -8
- package/lib/hooks/onClickOutside.js +0 -27
- package/lib/hooks/onClickOutside.js.map +0 -1
- package/lib/hooks/onScreenVisible.d.ts +0 -11
- package/lib/hooks/onScreenVisible.js +0 -32
- package/lib/hooks/onScreenVisible.js.map +0 -1
- package/lib/hooks/promise.d.ts +0 -13
- package/lib/hooks/promise.js +0 -25
- package/lib/hooks/promise.js.map +0 -1
- package/src/hooks/debounce.test.ts +0 -67
- package/src/hooks/debounce.ts +0 -19
- package/src/hooks/lockBodyScroll.test.ts +0 -24
- package/src/hooks/lockBodyScroll.ts +0 -15
- package/src/hooks/onClickOutside.test.ts +0 -113
- package/src/hooks/onClickOutside.ts +0 -25
- package/src/hooks/onScreenVisible.test.ts +0 -68
- package/src/hooks/onScreenVisible.ts +0 -28
- package/src/hooks/promise.test.ts +0 -76
- package/src/hooks/promise.ts +0 -35
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Mediator = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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");
|
|
7
8
|
/**
|
|
8
9
|
* The Mediator component for interfacing with pilets loading.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var notifier = function (error, pilets, loaded) {
|
|
11
|
+
const Mediator = ({ options }) => {
|
|
12
|
+
const initialize = (0, hooks_1.useAction)('initialize');
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
const { connect, disconnect } = (0, piral_base_1.startLoadingPilets)(options);
|
|
15
|
+
const notifier = (error, pilets, loaded) => {
|
|
16
16
|
initialize(!loaded, error, pilets);
|
|
17
17
|
};
|
|
18
18
|
connect(notifier);
|
|
19
|
-
return
|
|
20
|
-
},
|
|
19
|
+
return () => disconnect(notifier);
|
|
20
|
+
}, utils_1.none);
|
|
21
21
|
// tslint:disable-next-line:no-null-keyword
|
|
22
22
|
return null;
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mediator.js","sourceRoot":"","sources":["../../src/components/Mediator.tsx"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"Mediator.js","sourceRoot":"","sources":["../../src/components/Mediator.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,2CAAkF;AAClF,oCAAqC;AACrC,oCAAgC;AAYhC;;GAEG;AACI,MAAM,QAAQ,GAA4B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IAC/D,MAAM,UAAU,GAAG,IAAA,iBAAS,EAAC,YAAY,CAAC,CAAC;IAC3C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAA,+BAAkB,EAAC,OAAO,CAAC,CAAC;QAC5D,MAAM,QAAQ,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACxD,UAAU,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACrC,CAAC,CAAC;QACF,OAAO,CAAC,QAAQ,CAAC,CAAC;QAClB,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC,EAAE,YAAI,CAAC,CAAC;IACT,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAZW,QAAA,QAAQ,YAYnB"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PiralRoutes = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const react_router_1 = require("react-router");
|
|
7
|
+
const hooks_1 = require("../hooks");
|
|
8
8
|
/**
|
|
9
9
|
* The component for defining the exclusive routes to be used.
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
var NotFound = _a
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return (React.createElement(react_router_1.Switch,
|
|
16
|
-
Object.keys(routes).map(
|
|
17
|
-
Object.keys(pages).map(
|
|
11
|
+
const PiralRoutes = (_a) => {
|
|
12
|
+
var { NotFound } = _a, props = (0, tslib_1.__rest)(_a, ["NotFound"]);
|
|
13
|
+
const routes = (0, hooks_1.useGlobalState)((s) => s.routes);
|
|
14
|
+
const pages = (0, hooks_1.useGlobalState)((s) => s.registry.pages);
|
|
15
|
+
return (React.createElement(react_router_1.Switch, Object.assign({}, props),
|
|
16
|
+
Object.keys(routes).map((url) => (React.createElement(react_router_1.Route, { exact: true, key: url, path: url, component: routes[url] }))),
|
|
17
|
+
Object.keys(pages).map((url) => (React.createElement(react_router_1.Route, { exact: true, key: url, path: url, component: pages[url].component }))),
|
|
18
18
|
React.createElement(react_router_1.Route, { component: NotFound })));
|
|
19
19
|
};
|
|
20
20
|
exports.PiralRoutes = PiralRoutes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAC/B,+CAA+E;AAC/E,oCAA0C;AAY1C;;GAEG;AACI,MAAM,WAAW,GAA0B,CAAC,EAAsB,EAAE,EAAE;QAA1B,EAAE,QAAQ,OAAY,EAAP,KAAK,2BAApB,YAAsB,CAAF;IACrE,MAAM,MAAM,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,OAAO,CACL,oBAAC,qBAAM,oBAAK,KAAK;QACd,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAChC,oBAAC,oBAAK,IAAC,KAAK,QAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,GAAI,CAC7D,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC/B,oBAAC,oBAAK,IAAC,KAAK,QAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,SAAS,GAAI,CACtE,CAAC;QACF,oBAAC,oBAAK,IAAC,SAAS,EAAE,QAAQ,GAAI,CACvB,CACV,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,WAAW,eAetB;AACF,mBAAW,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PiralView = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _a = hooks_1.useGlobalState(function (m) { return m.app; }), error = _a.error, loading = _a.loading, layout = _a.layout;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_router_1 = require("react-router");
|
|
6
|
+
const components_1 = require("./components");
|
|
7
|
+
const PiralRoutes_1 = require("./PiralRoutes");
|
|
8
|
+
const hooks_1 = require("../hooks");
|
|
9
|
+
const NotFound = (props) => React.createElement(components_1.PiralError, Object.assign({ type: "not_found" }, props));
|
|
10
|
+
const PiralContent = () => {
|
|
11
|
+
const { error, loading, layout } = (0, hooks_1.useGlobalState)((m) => m.app);
|
|
13
12
|
return error ? (React.createElement(components_1.PiralError, { type: "loading", error: error })) : loading ? (React.createElement(components_1.PiralLoadingIndicator, null)) : (React.createElement(components_1.PiralLayout, { currentLayout: layout },
|
|
14
13
|
React.createElement(PiralRoutes_1.PiralRoutes, { NotFound: NotFound })));
|
|
15
14
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var provider = hooks_1.useGlobalState(function (m) { return m.provider; }) || React.Fragment;
|
|
15
|
+
const Router = typeof window === 'undefined' ? (props) => React.createElement(react_router_1.StaticRouter, Object.assign({ location: "/" }, props)) : components_1.PiralRouter;
|
|
16
|
+
const PiralProvider = ({ children }) => {
|
|
17
|
+
const provider = (0, hooks_1.useGlobalState)((m) => m.provider) || React.Fragment;
|
|
20
18
|
return React.createElement(provider, undefined, children);
|
|
21
19
|
};
|
|
22
20
|
/**
|
|
23
21
|
* The component responsible for the generic view of the application.
|
|
24
22
|
* This includes the global providers, the used Router, the current content and some convenience.
|
|
25
23
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
children,
|
|
32
|
-
React.createElement(components_1.PiralDebug, null))));
|
|
33
|
-
};
|
|
24
|
+
const PiralView = ({ children }) => (React.createElement(PiralProvider, null,
|
|
25
|
+
React.createElement(Router, null,
|
|
26
|
+
React.createElement(PiralContent, null),
|
|
27
|
+
children,
|
|
28
|
+
React.createElement(components_1.PiralDebug, null))));
|
|
34
29
|
exports.PiralView = PiralView;
|
|
35
30
|
exports.PiralView.displayName = 'PiralView';
|
|
36
31
|
//# sourceMappingURL=PiralView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PiralView.js","sourceRoot":"","sources":["../../src/components/PiralView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PiralView.js","sourceRoot":"","sources":["../../src/components/PiralView.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+CAAiE;AACjE,6CAAuG;AACvG,+CAA4C;AAC5C,oCAA0C;AAE1C,MAAM,QAAQ,GAAkC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,uBAAU,kBAAC,IAAI,EAAC,WAAW,IAAK,KAAK,EAAI,CAAC;AAEtG,MAAM,YAAY,GAAa,GAAG,EAAE;IAClC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAEhE,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,uBAAU,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,GAAI,CAC5C,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,oBAAC,kCAAqB,OAAG,CAC1B,CAAC,CAAC,CAAC,CACF,oBAAC,wBAAW,IAAC,aAAa,EAAE,MAAM;QAChC,oBAAC,yBAAW,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,2BAAY,kBAAC,QAAQ,EAAC,GAAG,IAAK,KAAK,EAAI,CAAC,CAAC,CAAC,wBAAW,CAAC;AAEjH,MAAM,aAAa,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC;IACrE,OAAO,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC5D,CAAC,CAAC;AAOF;;;GAGG;AACI,MAAM,SAAS,GAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACnE,oBAAC,aAAa;IACZ,oBAAC,MAAM;QACL,oBAAC,YAAY,OAAG;QACf,QAAQ;QACT,oBAAC,uBAAU,OAAG,CACP,CACK,CACjB,CAAC;AARW,QAAA,SAAS,aAQpB;AACF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PortalRenderer = void 0;
|
|
4
|
+
const hooks_1 = require("../hooks");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const PortalRenderer = ({ id }) => {
|
|
7
|
+
const children = (0, hooks_1.useGlobalState)((m) => m.portals[id]) || utils_1.none;
|
|
8
|
+
return (0, utils_1.defaultRender)(children);
|
|
9
|
+
};
|
|
10
|
+
exports.PortalRenderer = PortalRenderer;
|
|
11
|
+
//# sourceMappingURL=PortalRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PortalRenderer.js","sourceRoot":"","sources":["../../src/components/PortalRenderer.tsx"],"names":[],"mappings":";;;AACA,oCAA0C;AAC1C,oCAA+C;AAMxC,MAAM,cAAc,GAAkC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IACtE,MAAM,QAAQ,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,YAAI,CAAC;IAC9D,OAAO,IAAA,qBAAa,EAAC,QAAQ,CAAC,CAAC;AACjC,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ResponsiveLayout = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const hooks_1 = require("../hooks");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
7
|
/**
|
|
8
8
|
* The component capable of identifying and switching the currently used layout.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
React.useEffect(function () {
|
|
10
|
+
const ResponsiveLayout = ({ breakpoints = utils_1.defaultBreakpoints, children }) => {
|
|
11
|
+
const current = (0, hooks_1.useGlobalState)((m) => m.app.layout) || 'desktop';
|
|
12
|
+
const changeTo = (0, hooks_1.useAction)('changeLayout');
|
|
13
|
+
const selected = (0, hooks_1.useMedia)(breakpoints, utils_1.defaultLayouts, current);
|
|
14
|
+
React.useEffect(() => {
|
|
16
15
|
if (selected !== current) {
|
|
17
16
|
changeTo(selected);
|
|
18
17
|
}
|
|
19
18
|
}, [selected]);
|
|
20
|
-
return utils_1.defaultRender(children);
|
|
19
|
+
return (0, utils_1.defaultRender)(children);
|
|
21
20
|
};
|
|
22
21
|
exports.ResponsiveLayout = ResponsiveLayout;
|
|
23
22
|
exports.ResponsiveLayout.displayName = 'ResponsiveLayout';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveLayout.js","sourceRoot":"","sources":["../../src/components/ResponsiveLayout.tsx"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"ResponsiveLayout.js","sourceRoot":"","sources":["../../src/components/ResponsiveLayout.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAA+D;AAC/D,oCAA6E;AAa7E;;GAEG;AACI,MAAM,gBAAgB,GAAoC,CAAC,EAAE,WAAW,GAAG,0BAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClH,MAAM,OAAO,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;IACjE,MAAM,QAAQ,GAAG,IAAA,iBAAS,EAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,IAAA,gBAAQ,EAAC,WAAW,EAAE,sBAAc,EAAE,OAAO,CAAC,CAAC;IAEhE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,KAAK,OAAO,EAAE;YACxB,QAAQ,CAAC,QAAQ,CAAC,CAAC;SACpB;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,IAAA,qBAAa,EAAC,QAAQ,CAAC,CAAC;AACjC,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B;AACF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetComponent = void 0;
|
|
4
|
-
|
|
4
|
+
const hooks_1 = require("../hooks");
|
|
5
5
|
/**
|
|
6
6
|
* The component capable of setting a layout component at mounting.
|
|
7
7
|
*/
|
|
8
|
-
function SetComponent(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
hooks_1.useSetter(function () { return component && setComponent(name, component); });
|
|
8
|
+
function SetComponent({ name, component, }) {
|
|
9
|
+
const setComponent = (0, hooks_1.useAction)('setComponent');
|
|
10
|
+
(0, hooks_1.useSetter)(() => component && setComponent(name, component));
|
|
12
11
|
// tslint:disable-next-line:no-null-keyword
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetComponent.js","sourceRoot":"","sources":["../../src/components/SetComponent.tsx"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"SetComponent.js","sourceRoot":"","sources":["../../src/components/SetComponent.tsx"],"names":[],"mappings":";;;AACA,oCAAgD;AAiBhD;;GAEG;AACH,SAAgB,YAAY,CAAqC,EAC/D,IAAI,EACJ,SAAS,GACe;IACxB,MAAM,YAAY,GAAG,IAAA,iBAAS,EAAC,cAAc,CAAC,CAAC;IAC/C,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,SAAS,IAAI,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IAC5D,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AARD,oCAQC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetError = void 0;
|
|
4
|
-
|
|
4
|
+
const hooks_1 = require("../hooks");
|
|
5
5
|
/**
|
|
6
6
|
* The component capable of setting a globally defined error handler component at mounting.
|
|
7
7
|
*/
|
|
8
|
-
function SetError(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
hooks_1.useSetter(function () { return component && setErrorComponent(type, component); });
|
|
8
|
+
function SetError({ type, component, }) {
|
|
9
|
+
const setErrorComponent = (0, hooks_1.useAction)('setErrorComponent');
|
|
10
|
+
(0, hooks_1.useSetter)(() => component && setErrorComponent(type, component));
|
|
12
11
|
// tslint:disable-next-line:no-null-keyword
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetError.js","sourceRoot":"","sources":["../../src/components/SetError.tsx"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"SetError.js","sourceRoot":"","sources":["../../src/components/SetError.tsx"],"names":[],"mappings":";;;AACA,oCAAgD;AAiBhD;;GAEG;AACH,SAAgB,QAAQ,CAA0C,EAChE,IAAI,EACJ,SAAS,GACW;IACpB,MAAM,iBAAiB,GAAG,IAAA,iBAAS,EAAC,mBAAmB,CAAC,CAAC;IACzD,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,SAAS,IAAI,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IACjE,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AARD,4BAQC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetErrors = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const SetError_1 = require("./SetError");
|
|
6
6
|
/**
|
|
7
7
|
* The component capable of batch setting error handling components.
|
|
8
8
|
*/
|
|
9
|
-
function SetErrors(
|
|
10
|
-
|
|
11
|
-
return (React.createElement(React.Fragment, null, Object.keys(errors).map(function (key) { return (React.createElement(SetError_1.SetError, { type: key, component: errors[key], key: key })); })));
|
|
9
|
+
function SetErrors({ errors = {} }) {
|
|
10
|
+
return (React.createElement(React.Fragment, null, Object.keys(errors).map((key) => (React.createElement(SetError_1.SetError, { type: key, component: errors[key], key: key })))));
|
|
12
11
|
}
|
|
13
12
|
exports.SetErrors = SetErrors;
|
|
14
13
|
//# sourceMappingURL=SetErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetErrors.js","sourceRoot":"","sources":["../../src/components/SetErrors.tsx"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"SetErrors.js","sourceRoot":"","sources":["../../src/components/SetErrors.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,yCAAsC;AAatC;;GAEG;AACH,SAAgB,SAAS,CAAC,EAAE,MAAM,GAAG,EAAE,EAAkB;IACvD,OAAO,CACL,0CACG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CACrC,oBAAC,mBAAQ,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAC1D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AARD,8BAQC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetLayout = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const SetComponent_1 = require("./SetComponent");
|
|
6
6
|
/**
|
|
7
7
|
* The component capable of batch setting layout components.
|
|
8
8
|
*/
|
|
9
|
-
function SetLayout(
|
|
10
|
-
|
|
11
|
-
return (React.createElement(React.Fragment, null, Object.keys(layout).map(function (key) { return (React.createElement(SetComponent_1.SetComponent, { name: key, component: layout[key], key: key })); })));
|
|
9
|
+
function SetLayout({ layout = {} }) {
|
|
10
|
+
return (React.createElement(React.Fragment, null, Object.keys(layout).map((key) => (React.createElement(SetComponent_1.SetComponent, { name: key, component: layout[key], key: key })))));
|
|
12
11
|
}
|
|
13
12
|
exports.SetLayout = SetLayout;
|
|
14
13
|
//# sourceMappingURL=SetLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetLayout.js","sourceRoot":"","sources":["../../src/components/SetLayout.tsx"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"SetLayout.js","sourceRoot":"","sources":["../../src/components/SetLayout.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iDAA8C;AAa9C;;GAEG;AACH,SAAgB,SAAS,CAAC,EAAE,MAAM,GAAG,EAAE,EAAkB;IACvD,OAAO,CACL,0CACG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CACrC,oBAAC,2BAAY,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAC9D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AARD,8BAQC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetProvider = void 0;
|
|
4
|
-
|
|
4
|
+
const hooks_1 = require("../hooks");
|
|
5
5
|
/**
|
|
6
6
|
* The component capable of setting a global provider at mounting.
|
|
7
7
|
*/
|
|
8
|
-
function SetProvider(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
hooks_1.useSetter(function () { return provider && includeProvider(provider); });
|
|
8
|
+
function SetProvider({ provider }) {
|
|
9
|
+
const includeProvider = (0, hooks_1.useAction)('includeProvider');
|
|
10
|
+
(0, hooks_1.useSetter)(() => provider && includeProvider(provider));
|
|
12
11
|
// tslint:disable-next-line:no-null-keyword
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetProvider.js","sourceRoot":"","sources":["../../src/components/SetProvider.tsx"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"SetProvider.js","sourceRoot":"","sources":["../../src/components/SetProvider.tsx"],"names":[],"mappings":";;;AACA,oCAAgD;AAYhD;;GAEG;AACH,SAAgB,WAAW,CAAC,EAAE,QAAQ,EAAoB;IACxD,MAAM,eAAe,GAAG,IAAA,iBAAS,EAAC,iBAAiB,CAAC,CAAC;IACrD,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AALD,kCAKC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetRedirect = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_router_1 = require("react-router");
|
|
6
|
+
const hooks_1 = require("../hooks");
|
|
7
7
|
/**
|
|
8
8
|
* The component capable of setting a global redirect route at mounting.
|
|
9
9
|
*/
|
|
10
|
-
function SetRedirect(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
hooks_1.useSetter(function () { return setRoute(from, function () { return React.createElement(react_router_1.Redirect, { to: to }); }); });
|
|
10
|
+
function SetRedirect({ from, to }) {
|
|
11
|
+
const setRoute = (0, hooks_1.useAction)('setRoute');
|
|
12
|
+
(0, hooks_1.useSetter)(() => setRoute(from, () => React.createElement(react_router_1.Redirect, { to: to })));
|
|
14
13
|
// tslint:disable-next-line:no-null-keyword
|
|
15
14
|
return null;
|
|
16
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetRedirect.js","sourceRoot":"","sources":["../../src/components/SetRedirect.tsx"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"SetRedirect.js","sourceRoot":"","sources":["../../src/components/SetRedirect.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+CAAwC;AACxC,oCAAgD;AAgBhD;;GAEG;AACH,SAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,EAAoB;IACxD,MAAM,QAAQ,GAAG,IAAA,iBAAS,EAAC,UAAU,CAAC,CAAC;IACvC,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAC,uBAAQ,IAAC,EAAE,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC;IAC5D,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AALD,kCAKC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetRoute = void 0;
|
|
4
|
-
|
|
4
|
+
const hooks_1 = require("../hooks");
|
|
5
5
|
/**
|
|
6
6
|
* The component capable of setting a global route at mounting.
|
|
7
7
|
*/
|
|
8
|
-
function SetRoute(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
hooks_1.useSetter(function () { return component && setRoute(path, component); });
|
|
8
|
+
function SetRoute({ path, component }) {
|
|
9
|
+
const setRoute = (0, hooks_1.useAction)('setRoute');
|
|
10
|
+
(0, hooks_1.useSetter)(() => component && setRoute(path, component));
|
|
12
11
|
// tslint:disable-next-line:no-null-keyword
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetRoute.js","sourceRoot":"","sources":["../../src/components/SetRoute.tsx"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"SetRoute.js","sourceRoot":"","sources":["../../src/components/SetRoute.tsx"],"names":[],"mappings":";;;AAEA,oCAAgD;AAgBhD;;GAEG;AACH,SAAgB,QAAQ,CAAS,EAAE,IAAI,EAAE,SAAS,EAAoB;IACpE,MAAM,QAAQ,GAAG,IAAA,iBAAS,EAAC,UAAU,CAAC,CAAC;IACvC,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IACxD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AALD,4BAKC"}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SwitchErrorInfo = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var utils_1 = require("../utils");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const hooks_1 = require("../hooks");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
8
7
|
function renderComponent(components, props) {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const name = props.type;
|
|
9
|
+
const Component = components[name];
|
|
10
|
+
if (process.env.NODE_ENV === 'development') {
|
|
11
|
+
React.useEffect(() => console.error('[dev-info] An error occurred in the Piral instance.', props), utils_1.none);
|
|
12
|
+
}
|
|
11
13
|
if (!Component) {
|
|
12
|
-
|
|
14
|
+
const Unknown = components.unknown;
|
|
13
15
|
if (Unknown) {
|
|
14
|
-
return React.createElement(Unknown,
|
|
16
|
+
return React.createElement(Unknown, Object.assign({}, props, { type: "unknown" }));
|
|
15
17
|
}
|
|
16
|
-
return utils_1.defaultRender(
|
|
18
|
+
return (0, utils_1.defaultRender)(`Error: ${props.type}`);
|
|
17
19
|
}
|
|
18
|
-
return React.createElement(Component,
|
|
20
|
+
return React.createElement(Component, Object.assign({}, props));
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
const SwitchErrorInfo = (props) => {
|
|
23
|
+
const components = (0, hooks_1.useGlobalState)((m) => m.errorComponents);
|
|
22
24
|
return renderComponent(components, props);
|
|
23
25
|
};
|
|
24
26
|
exports.SwitchErrorInfo = SwitchErrorInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchErrorInfo.js","sourceRoot":"","sources":["../../src/components/SwitchErrorInfo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwitchErrorInfo.js","sourceRoot":"","sources":["../../src/components/SwitchErrorInfo.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAA0C;AAC1C,oCAA+C;AAG/C,SAAS,eAAe,CACtB,UAAgC,EAChC,KAAmB;IAEnB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,qDAAqD,EAAE,KAAK,CAAC,EAAE,YAAI,CAAC,CAAC;KAC1G;IAED,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAEnC,IAAI,OAAO,EAAE;YACX,OAAO,oBAAC,OAAO,oBAAM,KAAa,IAAE,IAAI,EAAC,SAAS,IAAG,CAAC;SACvD;QAED,OAAO,IAAA,qBAAa,EAAC,UAAU,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,oBAAC,SAAS,oBAAM,KAAa,EAAI,CAAC;AAC3C,CAAC;AAEM,MAAM,eAAe,GAA6B,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,UAAU,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5D,OAAO,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PiralDebug = exports.PiralLayout = exports.PiralRouter = exports.PiralLoadingIndicator = exports.PiralError = exports.getPiralComponent = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var hooks_1 = require("../hooks");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const hooks_1 = require("../hooks");
|
|
7
6
|
function getPiralComponent(name) {
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
return Component ? React.createElement(Component,
|
|
7
|
+
return (props) => {
|
|
8
|
+
const Component = (0, hooks_1.useGlobalState)((s) => s.components[name]);
|
|
9
|
+
return Component ? React.createElement(Component, Object.assign({}, props)) : null;
|
|
11
10
|
};
|
|
12
11
|
}
|
|
13
12
|
exports.getPiralComponent = getPiralComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAA0C;AAG1C,SAAgB,iBAAiB,CAAqC,IAAU;IAC9E,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5D,OAAO,SAAS,CAAC,CAAC,CAAC,oBAAC,SAAS,oBAAK,KAAK,EAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC;AALD,8CAKC;AAED;;;GAGG;AACU,QAAA,UAAU,GAAwC,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAE9F;;;GAGG;AACU,QAAA,qBAAqB,GAA+C,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAEvH;;;GAGG;AACU,QAAA,WAAW,GAAqC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEzF;;;GAGG;AACU,QAAA,WAAW,GAAqC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEzF;;;GAGG;AACU,QAAA,UAAU,GAAwB,iBAAiB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -7,6 +7,7 @@ export * from './ExtensionSlot';
|
|
|
7
7
|
export * from './Mediator';
|
|
8
8
|
export * from './PiralRoutes';
|
|
9
9
|
export * from './PiralView';
|
|
10
|
+
export * from './PortalRenderer';
|
|
10
11
|
export * from './ResponsiveLayout';
|
|
11
12
|
export * from './SetComponent';
|
|
12
13
|
export * from './SetError';
|
package/lib/components/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./components"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./DefaultErrorInfo"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./DefaultLayout"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./DefaultLoader"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./ErrorBoundary"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./ExtensionSlot"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./Mediator"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./PiralRoutes"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./PiralView"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./
|
|
14
|
-
tslib_1.__exportStar(require("./
|
|
15
|
-
tslib_1.__exportStar(require("./
|
|
16
|
-
tslib_1.__exportStar(require("./
|
|
17
|
-
tslib_1.__exportStar(require("./
|
|
18
|
-
tslib_1.__exportStar(require("./
|
|
19
|
-
tslib_1.__exportStar(require("./
|
|
20
|
-
tslib_1.__exportStar(require("./
|
|
21
|
-
tslib_1.__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./components"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./DefaultErrorInfo"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./DefaultLayout"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./DefaultLoader"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./ErrorBoundary"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./ExtensionSlot"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./Mediator"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./PiralRoutes"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./PiralView"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./PortalRenderer"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./ResponsiveLayout"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./SetComponent"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./SetError"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./SetErrors"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./SetLayout"), exports);
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./SetProvider"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./SetRedirect"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./SetRoute"), exports);
|
|
22
|
+
(0, tslib_1.__exportStar)(require("./SwitchErrorInfo"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,kEAAmC;AACnC,+DAAgC;AAChC,+DAAgC;AAChC,+DAAgC;AAChC,+DAAgC;AAChC,0DAA2B;AAC3B,6DAA8B;AAC9B,2DAA4B;AAC5B,gEAAiC;AACjC,kEAAmC;AACnC,8DAA+B;AAC/B,0DAA2B;AAC3B,2DAA4B;AAC5B,2DAA4B;AAC5B,6DAA8B;AAC9B,6DAA8B;AAC9B,0DAA2B;AAC3B,iEAAkC"}
|