minimal-piral 1.0.2 → 1.1.0-beta.5756
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/app/index.d.ts +4 -0
- package/app/{index.a49f01.js → index.df8967.js} +54 -71
- package/app/index.df8967.js.map +1 -0
- package/app/index.html +1 -1
- package/app/index.js +1 -1
- package/files.tar +0 -0
- package/files_once.tar +0 -0
- package/package.json +6 -5
- package/app/index.a49f01.js.map +0 -1
package/app/index.d.ts
CHANGED
|
@@ -545,6 +545,10 @@ export interface NavigationApi {
|
|
|
545
545
|
* as the implementation is router specific and may change over time.
|
|
546
546
|
*/
|
|
547
547
|
router: any;
|
|
548
|
+
/**
|
|
549
|
+
* Gets the public path of the application.
|
|
550
|
+
*/
|
|
551
|
+
publicPath: string;
|
|
548
552
|
}
|
|
549
553
|
|
|
550
554
|
export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
@@ -16,10 +16,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16
16
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
17
17
|
/* harmony import */ var _createInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createInstance */ "../../framework/piral-core/esm/createInstance.js");
|
|
18
18
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/components.js");
|
|
19
|
-
/* harmony import */ var
|
|
19
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/PiralView.js");
|
|
20
20
|
/* harmony import */ var _PiralContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PiralContext */ "../../framework/piral-core/esm/PiralContext.js");
|
|
21
|
-
/* harmony import */ var _app_codegen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../app.codegen */ "../../framework/piral-core/app.codegen");
|
|
22
|
-
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
|
|
@@ -47,8 +45,8 @@ var Piral = function Piral(_ref) {
|
|
|
47
45
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PiralContext__WEBPACK_IMPORTED_MODULE_2__.PiralContext, {
|
|
48
46
|
instance: instance
|
|
49
47
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_3__.RegisteredRouter, {
|
|
50
|
-
publicPath:
|
|
51
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
48
|
+
publicPath: instance.context.navigation.publicPath
|
|
49
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_4__.PiralView, {
|
|
52
50
|
breakpoints: breakpoints
|
|
53
51
|
}, children)));
|
|
54
52
|
};
|
|
@@ -884,21 +882,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
884
882
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
885
883
|
/* harmony export */ "PiralRoutes": () => (/* binding */ PiralRoutes)
|
|
886
884
|
/* harmony export */ });
|
|
887
|
-
/* harmony import */ var
|
|
885
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js");
|
|
888
886
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
889
887
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
890
|
-
/* harmony import */ var
|
|
888
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hooks */ "../../framework/piral-core/esm/hooks/globalState.js");
|
|
889
|
+
/* harmony import */ var _app_codegen__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../app.codegen */ "../../framework/piral-core/app.codegen");
|
|
890
|
+
|
|
891
891
|
|
|
892
892
|
|
|
893
893
|
|
|
894
|
+
function useRoutes() {
|
|
895
|
+
var routes = (0,_hooks__WEBPACK_IMPORTED_MODULE_1__.useGlobalState)(function (s) {
|
|
896
|
+
return s.routes;
|
|
897
|
+
});
|
|
898
|
+
var pages = (0,_hooks__WEBPACK_IMPORTED_MODULE_1__.useGlobalState)(function (s) {
|
|
899
|
+
return s.registry.pages;
|
|
900
|
+
});
|
|
901
|
+
var paths = [];
|
|
902
|
+
Object.keys(routes).map(function (path) {
|
|
903
|
+
return paths.push({
|
|
904
|
+
path: path,
|
|
905
|
+
Component: routes[path]
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
Object.keys(pages).map(function (path) {
|
|
909
|
+
return paths.push({
|
|
910
|
+
path: path,
|
|
911
|
+
Component: pages[path].component
|
|
912
|
+
});
|
|
913
|
+
});
|
|
914
|
+
return (0,_app_codegen__WEBPACK_IMPORTED_MODULE_2__.useRouteFilter)(paths);
|
|
915
|
+
}
|
|
894
916
|
/**
|
|
895
917
|
* The component for defining the exclusive routes to be used.
|
|
896
918
|
*/
|
|
897
919
|
var PiralRoutes = function PiralRoutes(_a) {
|
|
898
920
|
var NotFound = _a.NotFound,
|
|
899
921
|
RouteSwitch = _a.RouteSwitch,
|
|
900
|
-
props = (0,
|
|
901
|
-
var paths =
|
|
922
|
+
props = (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__rest)(_a, ["NotFound", "RouteSwitch"]);
|
|
923
|
+
var paths = useRoutes();
|
|
902
924
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteSwitch, Object.assign({
|
|
903
925
|
NotFound: NotFound,
|
|
904
926
|
paths: paths
|
|
@@ -1181,19 +1203,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1181
1203
|
/* harmony export */ });
|
|
1182
1204
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
1183
1205
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1184
|
-
/* harmony import */ var
|
|
1185
|
-
/* harmony import */ var
|
|
1206
|
+
/* harmony import */ var _PortalRenderer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PortalRenderer */ "../../framework/piral-core/esm/components/PortalRenderer.js");
|
|
1207
|
+
/* harmony import */ var _ForeignComponentContainer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ForeignComponentContainer */ "../../framework/piral-core/esm/components/ForeignComponentContainer.js");
|
|
1186
1208
|
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hooks */ "../../framework/piral-core/esm/hooks/globalState.js");
|
|
1187
1209
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
|
|
1188
|
-
/* harmony import */ var
|
|
1189
|
-
/* harmony import */ var _app_codegen__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../app.codegen */ "../../framework/piral-core/app.codegen");
|
|
1210
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/foreign.js");
|
|
1190
1211
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1191
1212
|
|
|
1192
1213
|
|
|
1193
1214
|
|
|
1194
1215
|
|
|
1195
1216
|
|
|
1196
|
-
|
|
1197
1217
|
// this is an arbitrary start number to have 6 digits
|
|
1198
1218
|
var portalIdBase = 123456;
|
|
1199
1219
|
function wrapReactComponent(Component, captured, Wrapper) {
|
|
@@ -1212,7 +1232,7 @@ function wrapForeignComponent(component, captured, Wrapper) {
|
|
|
1212
1232
|
// router added for backwards compatibility
|
|
1213
1233
|
var context = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(function () {
|
|
1214
1234
|
return {
|
|
1215
|
-
publicPath:
|
|
1235
|
+
publicPath: navigation.publicPath,
|
|
1216
1236
|
navigation: navigation,
|
|
1217
1237
|
router: navigation.router
|
|
1218
1238
|
};
|
|
@@ -1225,9 +1245,9 @@ function wrapForeignComponent(component, captured, Wrapper) {
|
|
|
1225
1245
|
return destroyPortal(id);
|
|
1226
1246
|
};
|
|
1227
1247
|
}, _utils__WEBPACK_IMPORTED_MODULE_2__.none);
|
|
1228
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Wrapper, Object.assign({}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
1248
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Wrapper, Object.assign({}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PortalRenderer__WEBPACK_IMPORTED_MODULE_3__.PortalRenderer, {
|
|
1229
1249
|
id: id
|
|
1230
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
1250
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ForeignComponentContainer__WEBPACK_IMPORTED_MODULE_4__.ForeignComponentContainer, {
|
|
1231
1251
|
innerProps: innerProps,
|
|
1232
1252
|
"$portalId": id,
|
|
1233
1253
|
"$component": component,
|
|
@@ -1248,7 +1268,7 @@ function wrapComponent(converters, component, captured, Wrapper) {
|
|
|
1248
1268
|
};
|
|
1249
1269
|
}
|
|
1250
1270
|
if (_typeof(component) === 'object' && isNotExotic(component)) {
|
|
1251
|
-
var result = (0,
|
|
1271
|
+
var result = (0,_utils__WEBPACK_IMPORTED_MODULE_5__.convertComponent)(converters[component.type], component);
|
|
1252
1272
|
return wrapForeignComponent(result, captured, Wrapper);
|
|
1253
1273
|
}
|
|
1254
1274
|
return wrapReactComponent(component, captured, Wrapper);
|
|
@@ -1377,8 +1397,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1377
1397
|
/* harmony export */ });
|
|
1378
1398
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
1379
1399
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1380
|
-
/* harmony import */ var
|
|
1381
|
-
/* harmony import */ var
|
|
1400
|
+
/* harmony import */ var _components_ExtensionSlot__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/ExtensionSlot */ "../../framework/piral-core/esm/components/ExtensionSlot.js");
|
|
1401
|
+
/* harmony import */ var _components_SwitchErrorInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/SwitchErrorInfo */ "../../framework/piral-core/esm/components/SwitchErrorInfo.js");
|
|
1402
|
+
|
|
1382
1403
|
|
|
1383
1404
|
|
|
1384
1405
|
/**
|
|
@@ -1387,11 +1408,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1387
1408
|
* the "error" name.
|
|
1388
1409
|
*/
|
|
1389
1410
|
var DefaultErrorInfo = function DefaultErrorInfo(props) {
|
|
1390
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
1411
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_ExtensionSlot__WEBPACK_IMPORTED_MODULE_1__.ExtensionSlot, {
|
|
1391
1412
|
name: "error",
|
|
1392
1413
|
params: props,
|
|
1393
1414
|
empty: function empty() {
|
|
1394
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
1415
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_SwitchErrorInfo__WEBPACK_IMPORTED_MODULE_2__.SwitchErrorInfo, Object.assign({}, props));
|
|
1395
1416
|
}
|
|
1396
1417
|
});
|
|
1397
1418
|
};
|
|
@@ -1563,7 +1584,7 @@ function createRedirect(to) {
|
|
|
1563
1584
|
});
|
|
1564
1585
|
};
|
|
1565
1586
|
}
|
|
1566
|
-
function createNavigation() {
|
|
1587
|
+
function createNavigation(publicPath) {
|
|
1567
1588
|
var enhance = function enhance(location, action) {
|
|
1568
1589
|
return {
|
|
1569
1590
|
action: action,
|
|
@@ -1619,7 +1640,8 @@ function createNavigation() {
|
|
|
1619
1640
|
get history() {
|
|
1620
1641
|
return _nav;
|
|
1621
1642
|
}
|
|
1622
|
-
}
|
|
1643
|
+
},
|
|
1644
|
+
publicPath: publicPath
|
|
1623
1645
|
};
|
|
1624
1646
|
}
|
|
1625
1647
|
|
|
@@ -1760,46 +1782,6 @@ function useMedia(queries, values, defaultValue) {
|
|
|
1760
1782
|
|
|
1761
1783
|
/***/ }),
|
|
1762
1784
|
|
|
1763
|
-
/***/ "../../framework/piral-core/esm/hooks/routes.js":
|
|
1764
|
-
/*!******************************************************!*\
|
|
1765
|
-
!*** ../../framework/piral-core/esm/hooks/routes.js ***!
|
|
1766
|
-
\******************************************************/
|
|
1767
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1768
|
-
|
|
1769
|
-
"use strict";
|
|
1770
|
-
__webpack_require__.r(__webpack_exports__);
|
|
1771
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1772
|
-
/* harmony export */ "useRoutes": () => (/* binding */ useRoutes)
|
|
1773
|
-
/* harmony export */ });
|
|
1774
|
-
/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globalState */ "../../framework/piral-core/esm/hooks/globalState.js");
|
|
1775
|
-
/* harmony import */ var _app_codegen__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../app.codegen */ "../../framework/piral-core/app.codegen");
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
function useRoutes() {
|
|
1779
|
-
var routes = (0,_globalState__WEBPACK_IMPORTED_MODULE_0__.useGlobalState)(function (s) {
|
|
1780
|
-
return s.routes;
|
|
1781
|
-
});
|
|
1782
|
-
var pages = (0,_globalState__WEBPACK_IMPORTED_MODULE_0__.useGlobalState)(function (s) {
|
|
1783
|
-
return s.registry.pages;
|
|
1784
|
-
});
|
|
1785
|
-
var paths = [];
|
|
1786
|
-
Object.keys(routes).map(function (path) {
|
|
1787
|
-
return paths.push({
|
|
1788
|
-
path: path,
|
|
1789
|
-
Component: routes[path]
|
|
1790
|
-
});
|
|
1791
|
-
});
|
|
1792
|
-
Object.keys(pages).map(function (path) {
|
|
1793
|
-
return paths.push({
|
|
1794
|
-
path: path,
|
|
1795
|
-
Component: pages[path].component
|
|
1796
|
-
});
|
|
1797
|
-
});
|
|
1798
|
-
return (0,_app_codegen__WEBPACK_IMPORTED_MODULE_1__.useRouteFilter)(paths);
|
|
1799
|
-
}
|
|
1800
|
-
|
|
1801
|
-
/***/ }),
|
|
1802
|
-
|
|
1803
1785
|
/***/ "../../framework/piral-core/esm/modules/api.js":
|
|
1804
1786
|
/*!*****************************************************!*\
|
|
1805
1787
|
!*** ../../framework/piral-core/esm/modules/api.js ***!
|
|
@@ -2257,8 +2239,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2257
2239
|
/* harmony export */ "createActions": () => (/* binding */ createActions),
|
|
2258
2240
|
/* harmony export */ "includeActions": () => (/* binding */ includeActions)
|
|
2259
2241
|
/* harmony export */ });
|
|
2260
|
-
/* harmony import */ var
|
|
2242
|
+
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions */ "../../framework/piral-core/esm/actions/index.js");
|
|
2261
2243
|
/* harmony import */ var _app_codegen__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app.codegen */ "../../framework/piral-core/esm/defaults/navigator_v5.js");
|
|
2244
|
+
/* harmony import */ var _app_codegen__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../app.codegen */ "../../framework/piral-core/app.codegen");
|
|
2262
2245
|
|
|
2263
2246
|
|
|
2264
2247
|
function createContext(state, events) {
|
|
@@ -2270,7 +2253,7 @@ function createContext(state, events) {
|
|
|
2270
2253
|
return component;
|
|
2271
2254
|
}
|
|
2272
2255
|
},
|
|
2273
|
-
navigation: (0,_app_codegen__WEBPACK_IMPORTED_MODULE_0__.createNavigation)(),
|
|
2256
|
+
navigation: (0,_app_codegen__WEBPACK_IMPORTED_MODULE_0__.createNavigation)(_app_codegen__WEBPACK_IMPORTED_MODULE_1__.publicPath),
|
|
2274
2257
|
state: state
|
|
2275
2258
|
});
|
|
2276
2259
|
return ctx;
|
|
@@ -2285,7 +2268,7 @@ function includeActions(ctx, actions) {
|
|
|
2285
2268
|
}
|
|
2286
2269
|
function createActions(state, events) {
|
|
2287
2270
|
var context = createContext(state, events);
|
|
2288
|
-
includeActions(context,
|
|
2271
|
+
includeActions(context, _actions__WEBPACK_IMPORTED_MODULE_2__);
|
|
2289
2272
|
return context;
|
|
2290
2273
|
}
|
|
2291
2274
|
|
|
@@ -3564,12 +3547,12 @@ function installPiralDebug(options) {
|
|
|
3564
3547
|
debug: debugApiVersion,
|
|
3565
3548
|
instance: {
|
|
3566
3549
|
name: "minimal-piral",
|
|
3567
|
-
version: "1.0.
|
|
3550
|
+
version: "1.1.0-beta.5756",
|
|
3568
3551
|
dependencies: "tslib,react,react-dom,react-router,react-router-dom"
|
|
3569
3552
|
},
|
|
3570
3553
|
build: {
|
|
3571
|
-
date: "2023-
|
|
3572
|
-
cli: "1.0.
|
|
3554
|
+
date: "2023-07-07T13:38:04.021Z",
|
|
3555
|
+
cli: "1.1.0-beta.5756",
|
|
3573
3556
|
compat: "1"
|
|
3574
3557
|
}
|
|
3575
3558
|
};
|
|
@@ -44457,4 +44440,4 @@ var instance = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.createInstance)({
|
|
|
44457
44440
|
|
|
44458
44441
|
/******/ })()
|
|
44459
44442
|
;
|
|
44460
|
-
//# sourceMappingURL=index.
|
|
44443
|
+
//# sourceMappingURL=index.df8967.js.map
|