sample-piral 1.3.0-beta.6050 → 1.3.0-beta.6062

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 CHANGED
@@ -363,7 +363,7 @@ export interface PageComponentProps<T extends {
363
363
  /**
364
364
  * The meta data registered for a page.
365
365
  */
366
- export interface PiralPageMeta extends PiralCustomPageMeta, PiralCustomPageMeta {}
366
+ export interface PiralPageMeta extends PiralCustomPageMeta {}
367
367
 
368
368
  /**
369
369
  * The shape of an implicit unregister function.
@@ -1104,11 +1104,23 @@ __webpack_require__.r(__webpack_exports__);
1104
1104
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1105
1105
  /* harmony export */ "PiralRoutes": () => (/* binding */ PiralRoutes)
1106
1106
  /* harmony export */ });
1107
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js");
1107
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js");
1108
1108
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
1109
1109
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1110
1110
  /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hooks */ "../../framework/piral-core/esm/hooks/globalState.js");
1111
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/routes.js");
1111
1112
  /* harmony import */ var _app_codegen__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../app.codegen */ "../../framework/piral-core/app.codegen");
1113
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1114
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1115
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
1116
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1117
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1118
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1119
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1120
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1121
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1122
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
1123
+
1112
1124
 
1113
1125
 
1114
1126
 
@@ -1120,20 +1132,27 @@ function useRoutes() {
1120
1132
  var pages = (0,_hooks__WEBPACK_IMPORTED_MODULE_1__.useGlobalState)(function (s) {
1121
1133
  return s.registry.pages;
1122
1134
  });
1123
- var paths = [];
1124
- Object.keys(routes).map(function (path) {
1125
- return paths.push({
1135
+ return (0,_app_codegen__WEBPACK_IMPORTED_MODULE_2__.useRouteFilter)([].concat(_toConsumableArray(Object.entries(routes).map(function (_ref) {
1136
+ var _ref2 = _slicedToArray(_ref, 2),
1137
+ path = _ref2[0],
1138
+ Component = _ref2[1];
1139
+ return {
1126
1140
  path: path,
1127
- Component: routes[path]
1128
- });
1129
- });
1130
- Object.keys(pages).map(function (path) {
1131
- return paths.push({
1141
+ Component: Component,
1142
+ meta: {},
1143
+ matcher: (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createRouteMatcher)(path)
1144
+ };
1145
+ })), _toConsumableArray(Object.entries(pages).map(function (_ref3) {
1146
+ var _ref4 = _slicedToArray(_ref3, 2),
1147
+ path = _ref4[0],
1148
+ entry = _ref4[1];
1149
+ return {
1132
1150
  path: path,
1133
- Component: pages[path].component
1134
- });
1135
- });
1136
- return (0,_app_codegen__WEBPACK_IMPORTED_MODULE_2__.useRouteFilter)(paths);
1151
+ Component: entry.component,
1152
+ meta: entry.meta,
1153
+ matcher: (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createRouteMatcher)(path)
1154
+ };
1155
+ }))));
1137
1156
  }
1138
1157
  /**
1139
1158
  * The component for defining the exclusive routes to be used.
@@ -1141,7 +1160,7 @@ function useRoutes() {
1141
1160
  var PiralRoutes = function PiralRoutes(_a) {
1142
1161
  var NotFound = _a.NotFound,
1143
1162
  RouteSwitch = _a.RouteSwitch,
1144
- props = (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__rest)(_a, ["NotFound", "RouteSwitch"]);
1163
+ props = (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__rest)(_a, ["NotFound", "RouteSwitch"]);
1145
1164
  var paths = useRoutes();
1146
1165
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteSwitch, Object.assign({
1147
1166
  NotFound: NotFound,
@@ -3277,6 +3296,26 @@ function defaultRender(children, key) {
3277
3296
 
3278
3297
  /***/ }),
3279
3298
 
3299
+ /***/ "../../framework/piral-core/esm/utils/routes.js":
3300
+ /*!******************************************************!*\
3301
+ !*** ../../framework/piral-core/esm/utils/routes.js ***!
3302
+ \******************************************************/
3303
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3304
+
3305
+ "use strict";
3306
+ __webpack_require__.r(__webpack_exports__);
3307
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3308
+ /* harmony export */ "createRouteMatcher": () => (/* binding */ createRouteMatcher)
3309
+ /* harmony export */ });
3310
+ // Unfortunately `require`d:
3311
+ // * exports are otherwise potentially converted by, e.g., Parcel (see #385)
3312
+ var ptr = __webpack_require__(/*! path-to-regexp */ "../../../node_modules/path-to-regexp/index.js");
3313
+ function createRouteMatcher(path) {
3314
+ return ptr(path);
3315
+ }
3316
+
3317
+ /***/ }),
3318
+
3280
3319
  /***/ "../../framework/piral-core/esm/utils/state.js":
3281
3320
  /*!*****************************************************!*\
3282
3321
  !*** ../../framework/piral-core/esm/utils/state.js ***!
@@ -6374,12 +6413,12 @@ function installPiralDebug(options) {
6374
6413
  debug: debugApiVersion,
6375
6414
  instance: {
6376
6415
  name: "sample-piral",
6377
- version: "1.3.0-beta.6050",
6416
+ version: "1.3.0-beta.6062",
6378
6417
  dependencies: "reactstrap,tslib,react,react-dom,react-router,react-router-dom"
6379
6418
  },
6380
6419
  build: {
6381
- date: "2023-10-02T12:06:58.026Z",
6382
- cli: "1.3.0-beta.6050",
6420
+ date: "2023-10-09T00:01:40.769Z",
6421
+ cli: "1.3.0-beta.6062",
6383
6422
  compat: "1"
6384
6423
  }
6385
6424
  };
@@ -65245,4 +65284,4 @@ root.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(piral
65245
65284
 
65246
65285
  /******/ })()
65247
65286
  ;
65248
- //# sourceMappingURL=index.85630c.js.map
65287
+ //# sourceMappingURL=index.da2dcb.js.map