sample-piral 1.6.0-beta.7190 → 1.6.0-beta.7199
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.cfe352.js → index.5bae88.js} +255 -20
- package/app/index.5bae88.js.map +1 -0
- package/app/index.d.ts +23 -0
- package/app/index.html +1 -1
- package/files.tar +0 -0
- package/files_once.tar +0 -0
- package/package.json +8 -8
- package/app/index.cfe352.js.map +0 -1
|
@@ -805,7 +805,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
805
805
|
/* harmony export */ });
|
|
806
806
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
807
807
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
808
|
-
/* harmony import */ var
|
|
808
|
+
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "../../../node_modules/react-dom/index.js");
|
|
809
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/components.js");
|
|
810
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/foreign.js");
|
|
809
811
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
810
812
|
var _excluded = ["children", "piral", "errorType"];
|
|
811
813
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -827,6 +829,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
827
829
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
828
830
|
|
|
829
831
|
|
|
832
|
+
|
|
833
|
+
|
|
830
834
|
/**
|
|
831
835
|
* The component for catching errors and displaying error information.
|
|
832
836
|
*/
|
|
@@ -854,26 +858,47 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
854
858
|
error: error
|
|
855
859
|
});
|
|
856
860
|
}
|
|
861
|
+
}, {
|
|
862
|
+
key: "componentDidUpdate",
|
|
863
|
+
value: function componentDidUpdate(_, prevState) {
|
|
864
|
+
var _this2 = this;
|
|
865
|
+
var error = this.state.error;
|
|
866
|
+
if (error && !prevState.error) {
|
|
867
|
+
var _this$props2 = this.props,
|
|
868
|
+
piral = _this$props2.piral,
|
|
869
|
+
errorType = _this$props2.errorType;
|
|
870
|
+
var pilet = piral.meta.name;
|
|
871
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.defer)(function () {
|
|
872
|
+
var container = (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode)(_this2);
|
|
873
|
+
piral.emit('unhandled-error', {
|
|
874
|
+
container: container,
|
|
875
|
+
errorType: errorType,
|
|
876
|
+
error: error,
|
|
877
|
+
pilet: pilet
|
|
878
|
+
});
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
}
|
|
857
882
|
}, {
|
|
858
883
|
key: "render",
|
|
859
884
|
value: function render() {
|
|
860
|
-
var _this$
|
|
861
|
-
children = _this$
|
|
862
|
-
piral = _this$
|
|
863
|
-
errorType = _this$
|
|
864
|
-
renderProps = _objectWithoutProperties(_this$
|
|
885
|
+
var _this$props3 = this.props,
|
|
886
|
+
children = _this$props3.children,
|
|
887
|
+
piral = _this$props3.piral,
|
|
888
|
+
errorType = _this$props3.errorType,
|
|
889
|
+
renderProps = _objectWithoutProperties(_this$props3, _excluded);
|
|
865
890
|
var error = this.state.error;
|
|
866
891
|
var rest = renderProps;
|
|
867
892
|
if (error) {
|
|
868
893
|
var pilet = piral.meta.name;
|
|
869
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
894
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_3__.RegisteredErrorInfo, _objectSpread({
|
|
870
895
|
type: errorType,
|
|
871
896
|
error: error,
|
|
872
897
|
pilet: pilet
|
|
873
898
|
}, rest));
|
|
874
899
|
}
|
|
875
900
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
|
|
876
|
-
fallback: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
901
|
+
fallback: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_3__.RegisteredLoadingIndicator, null)
|
|
877
902
|
}, children);
|
|
878
903
|
}
|
|
879
904
|
}]);
|
|
@@ -2708,9 +2733,9 @@ if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
|
2708
2733
|
origin: this.origin
|
|
2709
2734
|
}
|
|
2710
2735
|
});
|
|
2711
|
-
|
|
2736
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {
|
|
2712
2737
|
return window.dispatchEvent(ev);
|
|
2713
|
-
}
|
|
2738
|
+
});
|
|
2714
2739
|
}
|
|
2715
2740
|
}]);
|
|
2716
2741
|
return PiralComponent;
|
|
@@ -3245,6 +3270,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3245
3270
|
/* harmony export */ componentName: () => (/* binding */ componentName),
|
|
3246
3271
|
/* harmony export */ contentName: () => (/* binding */ contentName),
|
|
3247
3272
|
/* harmony export */ convertComponent: () => (/* binding */ convertComponent),
|
|
3273
|
+
/* harmony export */ defer: () => (/* binding */ defer),
|
|
3248
3274
|
/* harmony export */ extensionName: () => (/* binding */ extensionName),
|
|
3249
3275
|
/* harmony export */ portalName: () => (/* binding */ portalName),
|
|
3250
3276
|
/* harmony export */ renderInDom: () => (/* binding */ renderInDom),
|
|
@@ -3288,6 +3314,9 @@ function renderInDom(context, element, component, props) {
|
|
|
3288
3314
|
}
|
|
3289
3315
|
return attachDomPortal('root', context, element, component, props);
|
|
3290
3316
|
}
|
|
3317
|
+
function defer(cb) {
|
|
3318
|
+
setTimeout(cb, 0);
|
|
3319
|
+
}
|
|
3291
3320
|
|
|
3292
3321
|
/***/ }),
|
|
3293
3322
|
|
|
@@ -6383,8 +6412,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6383
6412
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6384
6413
|
/* harmony export */ installPiralDebug: () => (/* binding */ installPiralDebug)
|
|
6385
6414
|
/* harmony export */ });
|
|
6386
|
-
/* harmony import */ var
|
|
6415
|
+
/* harmony import */ var _ExtensionCatalogue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ExtensionCatalogue */ "../../utilities/piral-debug-utils/esm/ExtensionCatalogue.js");
|
|
6387
6416
|
/* harmony import */ var _decycle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./decycle */ "../../utilities/piral-debug-utils/esm/decycle.js");
|
|
6417
|
+
/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./overlay */ "../../utilities/piral-debug-utils/esm/overlay.js");
|
|
6388
6418
|
/* harmony import */ var _visualizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizer */ "../../utilities/piral-debug-utils/esm/visualizer.js");
|
|
6389
6419
|
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./state */ "../../utilities/piral-debug-utils/esm/state.js");
|
|
6390
6420
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -6397,6 +6427,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
6397
6427
|
|
|
6398
6428
|
|
|
6399
6429
|
|
|
6430
|
+
|
|
6400
6431
|
function installPiralDebug(options) {
|
|
6401
6432
|
var getGlobalState = options.getGlobalState,
|
|
6402
6433
|
getExtensions = options.getExtensions,
|
|
@@ -6464,6 +6495,15 @@ function installPiralDebug(options) {
|
|
|
6464
6495
|
}
|
|
6465
6496
|
}
|
|
6466
6497
|
},
|
|
6498
|
+
errorOverlay: {
|
|
6499
|
+
value: initialSettings.errorOverlay,
|
|
6500
|
+
type: 'boolean',
|
|
6501
|
+
label: 'Show error overlay',
|
|
6502
|
+
group: 'extensions',
|
|
6503
|
+
onChange: function onChange(value) {
|
|
6504
|
+
setValue(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.errorOverlay, value ? 'on' : 'off');
|
|
6505
|
+
}
|
|
6506
|
+
},
|
|
6467
6507
|
extensionCatalogue: {
|
|
6468
6508
|
value: initialSettings.extensionCatalogue,
|
|
6469
6509
|
type: 'boolean',
|
|
@@ -6616,12 +6656,12 @@ function installPiralDebug(options) {
|
|
|
6616
6656
|
debug: debugApiVersion,
|
|
6617
6657
|
instance: {
|
|
6618
6658
|
name: "sample-piral",
|
|
6619
|
-
version: "1.6.0-beta.
|
|
6659
|
+
version: "1.6.0-beta.7199",
|
|
6620
6660
|
dependencies: "reactstrap,tslib,react,react-dom,react-router,react-router-dom"
|
|
6621
6661
|
},
|
|
6622
6662
|
build: {
|
|
6623
|
-
date: "2024-06-
|
|
6624
|
-
cli: "1.6.0-beta.
|
|
6663
|
+
date: "2024-06-21T09:01:44.799Z",
|
|
6664
|
+
cli: "1.6.0-beta.7199",
|
|
6625
6665
|
compat: "1"
|
|
6626
6666
|
}
|
|
6627
6667
|
};
|
|
@@ -6718,12 +6758,18 @@ function installPiralDebug(options) {
|
|
|
6718
6758
|
};
|
|
6719
6759
|
document.body.dispatchEvent = function (ev) {
|
|
6720
6760
|
if (ev.type.startsWith('piral-')) {
|
|
6761
|
+
var name = ev.type.replace('piral-', '');
|
|
6762
|
+
var args = ev.detail.arg;
|
|
6721
6763
|
events.unshift({
|
|
6722
6764
|
id: events.length.toString(),
|
|
6723
|
-
name:
|
|
6724
|
-
args: (0,_decycle__WEBPACK_IMPORTED_MODULE_2__.decycle)(
|
|
6765
|
+
name: name,
|
|
6766
|
+
args: (0,_decycle__WEBPACK_IMPORTED_MODULE_2__.decycle)(args),
|
|
6725
6767
|
time: Date.now()
|
|
6726
6768
|
});
|
|
6769
|
+
if (name === 'unhandled-error' && args.errorType && typeof customElements !== 'undefined' && sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.errorOverlay) !== 'off') {
|
|
6770
|
+
var ErrorOverlay = customElements.get(_overlay__WEBPACK_IMPORTED_MODULE_3__.overlayId);
|
|
6771
|
+
document.body.appendChild(new ErrorOverlay(args));
|
|
6772
|
+
}
|
|
6727
6773
|
sendMessage({
|
|
6728
6774
|
events: events,
|
|
6729
6775
|
type: 'events'
|
|
@@ -6740,7 +6786,8 @@ function installPiralDebug(options) {
|
|
|
6740
6786
|
hardRefresh: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.hardRefresh) === 'on',
|
|
6741
6787
|
viewOrigins: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.viewOrigins) === 'on',
|
|
6742
6788
|
extensionCatalogue: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.extensionCatalogue) !== 'off',
|
|
6743
|
-
clearConsole: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.clearConsole) === 'on'
|
|
6789
|
+
clearConsole: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.clearConsole) === 'on',
|
|
6790
|
+
errorOverlay: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.errorOverlay) !== 'off'
|
|
6744
6791
|
});
|
|
6745
6792
|
}
|
|
6746
6793
|
});
|
|
@@ -6775,7 +6822,7 @@ function installPiralDebug(options) {
|
|
|
6775
6822
|
}
|
|
6776
6823
|
});
|
|
6777
6824
|
integrate({
|
|
6778
|
-
routes: _defineProperty({}, initialSettings.cataloguePath,
|
|
6825
|
+
routes: _defineProperty({}, initialSettings.cataloguePath, _ExtensionCatalogue__WEBPACK_IMPORTED_MODULE_4__.ExtensionCatalogue),
|
|
6779
6826
|
onChange: function onChange(previous, current, changed) {
|
|
6780
6827
|
if (changed.state) {
|
|
6781
6828
|
if (settings.viewState.value) {
|
|
@@ -7003,6 +7050,192 @@ function installPiletEmulator(requestPilets, options) {
|
|
|
7003
7050
|
|
|
7004
7051
|
/***/ }),
|
|
7005
7052
|
|
|
7053
|
+
/***/ "../../utilities/piral-debug-utils/esm/overlay.js":
|
|
7054
|
+
/*!********************************************************!*\
|
|
7055
|
+
!*** ../../utilities/piral-debug-utils/esm/overlay.js ***!
|
|
7056
|
+
\********************************************************/
|
|
7057
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7058
|
+
|
|
7059
|
+
"use strict";
|
|
7060
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7061
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7062
|
+
/* harmony export */ overlayId: () => (/* binding */ overlayId)
|
|
7063
|
+
/* harmony export */ });
|
|
7064
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7065
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7066
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7067
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7068
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7069
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7070
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
7071
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7072
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
7073
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
7074
|
+
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
7075
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
7076
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
7077
|
+
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
|
|
7078
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
7079
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
7080
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7081
|
+
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."); }
|
|
7082
|
+
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); }
|
|
7083
|
+
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; }
|
|
7084
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7085
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7086
|
+
// Create an element with provided attributes and optional children
|
|
7087
|
+
function h(e) {
|
|
7088
|
+
var attrs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7089
|
+
var elem = document.createElement(e);
|
|
7090
|
+
for (var _i = 0, _Object$entries = Object.entries(attrs); _i < _Object$entries.length; _i++) {
|
|
7091
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
7092
|
+
k = _Object$entries$_i[0],
|
|
7093
|
+
v = _Object$entries$_i[1];
|
|
7094
|
+
elem.setAttribute(k, v);
|
|
7095
|
+
}
|
|
7096
|
+
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
7097
|
+
children[_key - 2] = arguments[_key];
|
|
7098
|
+
}
|
|
7099
|
+
elem.append.apply(elem, children);
|
|
7100
|
+
return elem;
|
|
7101
|
+
}
|
|
7102
|
+
// set :host styles to make playwright detect the element as visible
|
|
7103
|
+
var templateStyle = /*css*/"\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 99999;\n --monospace: 'SFMono-Regular', Consolas,\n 'Liberation Mono', Menlo, Courier, monospace;\n --red: #ff5555;\n --yellow: #e2aa53;\n --purple: #cfa4ff;\n --cyan: #2dd9da;\n --dim: #c9c9c9;\n\n --window-background: #181818;\n --window-color: #d8d8d8;\n}\n\n.backdrop {\n position: fixed;\n z-index: 99999;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n margin: 0;\n background: rgba(0, 0, 0, 0.66);\n}\n\n.window {\n font-family: var(--monospace);\n line-height: 1.5;\n max-width: 80vw;\n color: var(--window-color);\n box-sizing: border-box;\n margin: 30px auto;\n padding: 2.5vh 4vw;\n position: relative;\n background: var(--window-background);\n border-radius: 6px 6px 8px 8px;\n box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\n overflow: hidden;\n border-top: 8px solid var(--red);\n direction: ltr;\n text-align: left;\n}\n\npre {\n font-family: var(--monospace);\n font-size: 16px;\n margin-top: 0;\n margin-bottom: 1em;\n overflow-x: scroll;\n scrollbar-width: none;\n}\n\npre::-webkit-scrollbar {\n display: none;\n}\n\npre.frame::-webkit-scrollbar {\n display: block;\n height: 5px;\n}\n\npre.frame::-webkit-scrollbar-thumb {\n background: #999;\n border-radius: 5px;\n}\n\npre.frame {\n scrollbar-width: thin;\n}\n\n.message {\n line-height: 1.3;\n font-weight: 600;\n white-space: pre-wrap;\n}\n\n.message-body {\n color: var(--red);\n}\n\n.plugin {\n color: var(--purple);\n}\n\n.file {\n color: var(--cyan);\n margin-bottom: 0;\n white-space: pre-wrap;\n word-break: break-all;\n}\n\n.frame {\n color: var(--yellow);\n}\n\n.stack {\n font-size: 13px;\n color: var(--dim);\n}\n\n.tip {\n font-size: 13px;\n color: #999;\n border-top: 1px dotted #999;\n padding-top: 13px;\n line-height: 1.8;\n}\n\ncode {\n font-size: 13px;\n font-family: var(--monospace);\n color: var(--yellow);\n}\n\n.file-link {\n text-decoration: underline;\n cursor: pointer;\n}\n\nkbd {\n line-height: 1.5;\n font-family: ui-monospace, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: 0.75rem;\n font-weight: 700;\n background-color: rgb(38, 40, 44);\n color: rgb(166, 167, 171);\n padding: 0.15rem 0.3rem;\n border-radius: 0.25rem;\n border-width: 0.0625rem 0.0625rem 0.1875rem;\n border-style: solid;\n border-color: rgb(54, 57, 64);\n border-image: initial;\n}\n";
|
|
7104
|
+
// Error Template
|
|
7105
|
+
var createTemplate = function createTemplate() {
|
|
7106
|
+
return h('div', {
|
|
7107
|
+
"class": 'backdrop',
|
|
7108
|
+
part: 'backdrop'
|
|
7109
|
+
}, h('div', {
|
|
7110
|
+
"class": 'window',
|
|
7111
|
+
part: 'window'
|
|
7112
|
+
}, h('pre', {
|
|
7113
|
+
"class": 'message',
|
|
7114
|
+
part: 'message'
|
|
7115
|
+
}, h('span', {
|
|
7116
|
+
"class": 'plugin',
|
|
7117
|
+
part: 'plugin'
|
|
7118
|
+
}), h('span', {
|
|
7119
|
+
"class": 'message-body',
|
|
7120
|
+
part: 'message-body'
|
|
7121
|
+
})), h('pre', {
|
|
7122
|
+
"class": 'file',
|
|
7123
|
+
part: 'file'
|
|
7124
|
+
}), h('pre', {
|
|
7125
|
+
"class": 'frame',
|
|
7126
|
+
part: 'frame'
|
|
7127
|
+
}), h('pre', {
|
|
7128
|
+
"class": 'stack',
|
|
7129
|
+
part: 'stack'
|
|
7130
|
+
}), h('div', {
|
|
7131
|
+
"class": 'tip',
|
|
7132
|
+
part: 'tip'
|
|
7133
|
+
}, 'Click outside, press ', h('kbd', {}, 'Esc'), ' key, or fix the code to dismiss.', h('br'), 'You can also disable this overlay by setting ', h('code', {
|
|
7134
|
+
part: 'config-option-name'
|
|
7135
|
+
}, 'dbg:error-overlay'), ' to ', h('code', {
|
|
7136
|
+
part: 'config-option-value'
|
|
7137
|
+
}, '"off"'), ' in ', h('code', {
|
|
7138
|
+
part: 'config-file-name'
|
|
7139
|
+
}, 'sessionStorage'), '.')), h('style', {}, templateStyle));
|
|
7140
|
+
};
|
|
7141
|
+
var fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
|
|
7142
|
+
var codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
|
|
7143
|
+
var overlayId = 'piral-error-overlay';
|
|
7144
|
+
if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
7145
|
+
var ErrorOverlay = /*#__PURE__*/function (_HTMLElement) {
|
|
7146
|
+
_inherits(ErrorOverlay, _HTMLElement);
|
|
7147
|
+
var _super = _createSuper(ErrorOverlay);
|
|
7148
|
+
function ErrorOverlay(props) {
|
|
7149
|
+
var _error$loc;
|
|
7150
|
+
var _this;
|
|
7151
|
+
var links = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
7152
|
+
_classCallCheck(this, ErrorOverlay);
|
|
7153
|
+
_this = _super.call(this);
|
|
7154
|
+
var error = props.error,
|
|
7155
|
+
pilet = props.pilet,
|
|
7156
|
+
errorType = props.errorType;
|
|
7157
|
+
_this.root = _this.attachShadow({
|
|
7158
|
+
mode: 'open'
|
|
7159
|
+
});
|
|
7160
|
+
_this.root.appendChild(createTemplate());
|
|
7161
|
+
codeframeRE.lastIndex = 0;
|
|
7162
|
+
var hasFrame = error.frame && codeframeRE.test(error.frame);
|
|
7163
|
+
var message = hasFrame ? error.message.replace(codeframeRE, '') : error.message;
|
|
7164
|
+
if (pilet) {
|
|
7165
|
+
_this.text('.plugin', "[".concat(pilet, "] "));
|
|
7166
|
+
}
|
|
7167
|
+
_this.text('.message-body', message.trim());
|
|
7168
|
+
var _split = (((_error$loc = error.loc) === null || _error$loc === void 0 ? void 0 : _error$loc.file) || error.id || 'unknown file').split("?"),
|
|
7169
|
+
_split2 = _slicedToArray(_split, 1),
|
|
7170
|
+
file = _split2[0];
|
|
7171
|
+
if (error.loc) {
|
|
7172
|
+
_this.text('.file', "".concat(file, ":").concat(error.loc.line, ":").concat(error.loc.column), links);
|
|
7173
|
+
} else if (error.id) {
|
|
7174
|
+
_this.text('.file', file);
|
|
7175
|
+
}
|
|
7176
|
+
if (hasFrame) {
|
|
7177
|
+
_this.text('.frame', error.frame.trim());
|
|
7178
|
+
}
|
|
7179
|
+
_this.text('.stack', error.stack, links);
|
|
7180
|
+
_this.root.querySelector('.window').addEventListener('click', function (e) {
|
|
7181
|
+
e.stopPropagation();
|
|
7182
|
+
});
|
|
7183
|
+
_this.addEventListener('click', function () {
|
|
7184
|
+
_this.close();
|
|
7185
|
+
});
|
|
7186
|
+
_this.closeOnEsc = function (e) {
|
|
7187
|
+
if (e.key === 'Escape' || e.code === 'Escape') {
|
|
7188
|
+
_this.close();
|
|
7189
|
+
}
|
|
7190
|
+
};
|
|
7191
|
+
document.addEventListener('keydown', _this.closeOnEsc);
|
|
7192
|
+
return _this;
|
|
7193
|
+
}
|
|
7194
|
+
_createClass(ErrorOverlay, [{
|
|
7195
|
+
key: "text",
|
|
7196
|
+
value: function text(selector, _text) {
|
|
7197
|
+
var linkFiles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7198
|
+
var el = this.root.querySelector(selector);
|
|
7199
|
+
if (linkFiles) {
|
|
7200
|
+
var curIndex = 0;
|
|
7201
|
+
var match;
|
|
7202
|
+
fileRE.lastIndex = 0;
|
|
7203
|
+
while (match = fileRE.exec(_text)) {
|
|
7204
|
+
var _match = match,
|
|
7205
|
+
file = _match[0],
|
|
7206
|
+
index = _match.index;
|
|
7207
|
+
if (index != null) {
|
|
7208
|
+
var frag = _text.slice(curIndex, index);
|
|
7209
|
+
el.appendChild(document.createTextNode(frag));
|
|
7210
|
+
var link = document.createElement('a');
|
|
7211
|
+
link.textContent = file;
|
|
7212
|
+
link.className = 'file-link';
|
|
7213
|
+
link.onclick = function () {
|
|
7214
|
+
console.log('Clicked');
|
|
7215
|
+
};
|
|
7216
|
+
el.appendChild(link);
|
|
7217
|
+
curIndex += frag.length + file.length;
|
|
7218
|
+
}
|
|
7219
|
+
}
|
|
7220
|
+
} else {
|
|
7221
|
+
el.textContent = _text;
|
|
7222
|
+
}
|
|
7223
|
+
}
|
|
7224
|
+
}, {
|
|
7225
|
+
key: "close",
|
|
7226
|
+
value: function close() {
|
|
7227
|
+
var _this$parentNode;
|
|
7228
|
+
(_this$parentNode = this.parentNode) === null || _this$parentNode === void 0 || _this$parentNode.removeChild(this);
|
|
7229
|
+
document.removeEventListener('keydown', this.closeOnEsc);
|
|
7230
|
+
}
|
|
7231
|
+
}]);
|
|
7232
|
+
return ErrorOverlay;
|
|
7233
|
+
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
7234
|
+
customElements.define(overlayId, ErrorOverlay);
|
|
7235
|
+
}
|
|
7236
|
+
|
|
7237
|
+
/***/ }),
|
|
7238
|
+
|
|
7006
7239
|
/***/ "../../utilities/piral-debug-utils/esm/routeRefresh.js":
|
|
7007
7240
|
/*!*************************************************************!*\
|
|
7008
7241
|
!*** ../../utilities/piral-debug-utils/esm/routeRefresh.js ***!
|
|
@@ -7057,7 +7290,8 @@ var settingsKeys = {
|
|
|
7057
7290
|
viewOrigins: 'dbg:view-origins',
|
|
7058
7291
|
extensionCatalogue: 'dbg:extension-catalogue',
|
|
7059
7292
|
clearConsole: 'dbg:clear-console',
|
|
7060
|
-
persistSettings: 'dbg:persist-settings-data'
|
|
7293
|
+
persistSettings: 'dbg:persist-settings-data',
|
|
7294
|
+
errorOverlay: 'dbg:error-overlay'
|
|
7061
7295
|
};
|
|
7062
7296
|
var persistKey = settingsKeys.persistSettings;
|
|
7063
7297
|
var persistSettings = !!localStorage.getItem(persistKey);
|
|
@@ -7122,6 +7356,7 @@ function getInitialSettings(defaultValues) {
|
|
|
7122
7356
|
viewOrigins: getValue(settingsKeys.viewOrigins, defaultValues.viewOrigins, false),
|
|
7123
7357
|
extensionCatalogue: getValue(settingsKeys.extensionCatalogue, defaultValues.extensionCatalogue, true),
|
|
7124
7358
|
clearConsole: getValue(settingsKeys.clearConsole, defaultValues.clearConsole, false),
|
|
7359
|
+
errorOverlay: getValue(settingsKeys.errorOverlay, defaultValues.errorOverlay, true),
|
|
7125
7360
|
persistSettings: persistSettings,
|
|
7126
7361
|
cataloguePath: '/$debug-extension-catalogue'
|
|
7127
7362
|
};
|
|
@@ -66681,4 +66916,4 @@ root.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(piral
|
|
|
66681
66916
|
|
|
66682
66917
|
/******/ })()
|
|
66683
66918
|
;
|
|
66684
|
-
//# sourceMappingURL=index.
|
|
66919
|
+
//# sourceMappingURL=index.5bae88.js.map
|