minimal-piral 1.6.0-beta.7193 → 1.6.0-beta.7201
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.1372cf.js → index.6dc892.js} +255 -20
- package/app/index.6dc892.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 +5 -5
- package/app/index.1372cf.js.map +0 -1
|
@@ -573,7 +573,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
573
573
|
/* harmony export */ });
|
|
574
574
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
575
575
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
576
|
-
/* harmony import */ var
|
|
576
|
+
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "../../../node_modules/react-dom/index.js");
|
|
577
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/components.js");
|
|
578
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/foreign.js");
|
|
577
579
|
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); }
|
|
578
580
|
var _excluded = ["children", "piral", "errorType"];
|
|
579
581
|
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; }
|
|
@@ -595,6 +597,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
595
597
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
596
598
|
|
|
597
599
|
|
|
600
|
+
|
|
601
|
+
|
|
598
602
|
/**
|
|
599
603
|
* The component for catching errors and displaying error information.
|
|
600
604
|
*/
|
|
@@ -622,26 +626,47 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
622
626
|
error: error
|
|
623
627
|
});
|
|
624
628
|
}
|
|
629
|
+
}, {
|
|
630
|
+
key: "componentDidUpdate",
|
|
631
|
+
value: function componentDidUpdate(_, prevState) {
|
|
632
|
+
var _this2 = this;
|
|
633
|
+
var error = this.state.error;
|
|
634
|
+
if (error && !prevState.error) {
|
|
635
|
+
var _this$props2 = this.props,
|
|
636
|
+
piral = _this$props2.piral,
|
|
637
|
+
errorType = _this$props2.errorType;
|
|
638
|
+
var pilet = piral.meta.name;
|
|
639
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.defer)(function () {
|
|
640
|
+
var container = (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode)(_this2);
|
|
641
|
+
piral.emit('unhandled-error', {
|
|
642
|
+
container: container,
|
|
643
|
+
errorType: errorType,
|
|
644
|
+
error: error,
|
|
645
|
+
pilet: pilet
|
|
646
|
+
});
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
}
|
|
625
650
|
}, {
|
|
626
651
|
key: "render",
|
|
627
652
|
value: function render() {
|
|
628
|
-
var _this$
|
|
629
|
-
children = _this$
|
|
630
|
-
piral = _this$
|
|
631
|
-
errorType = _this$
|
|
632
|
-
renderProps = _objectWithoutProperties(_this$
|
|
653
|
+
var _this$props3 = this.props,
|
|
654
|
+
children = _this$props3.children,
|
|
655
|
+
piral = _this$props3.piral,
|
|
656
|
+
errorType = _this$props3.errorType,
|
|
657
|
+
renderProps = _objectWithoutProperties(_this$props3, _excluded);
|
|
633
658
|
var error = this.state.error;
|
|
634
659
|
var rest = renderProps;
|
|
635
660
|
if (error) {
|
|
636
661
|
var pilet = piral.meta.name;
|
|
637
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
662
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_3__.RegisteredErrorInfo, _objectSpread({
|
|
638
663
|
type: errorType,
|
|
639
664
|
error: error,
|
|
640
665
|
pilet: pilet
|
|
641
666
|
}, rest));
|
|
642
667
|
}
|
|
643
668
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
|
|
644
|
-
fallback: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
669
|
+
fallback: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_3__.RegisteredLoadingIndicator, null)
|
|
645
670
|
}, children);
|
|
646
671
|
}
|
|
647
672
|
}]);
|
|
@@ -2421,9 +2446,9 @@ if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
|
2421
2446
|
origin: this.origin
|
|
2422
2447
|
}
|
|
2423
2448
|
});
|
|
2424
|
-
|
|
2449
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_3__.defer)(function () {
|
|
2425
2450
|
return window.dispatchEvent(ev);
|
|
2426
|
-
}
|
|
2451
|
+
});
|
|
2427
2452
|
}
|
|
2428
2453
|
}]);
|
|
2429
2454
|
return PiralComponent;
|
|
@@ -2958,6 +2983,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2958
2983
|
/* harmony export */ componentName: () => (/* binding */ componentName),
|
|
2959
2984
|
/* harmony export */ contentName: () => (/* binding */ contentName),
|
|
2960
2985
|
/* harmony export */ convertComponent: () => (/* binding */ convertComponent),
|
|
2986
|
+
/* harmony export */ defer: () => (/* binding */ defer),
|
|
2961
2987
|
/* harmony export */ extensionName: () => (/* binding */ extensionName),
|
|
2962
2988
|
/* harmony export */ portalName: () => (/* binding */ portalName),
|
|
2963
2989
|
/* harmony export */ renderInDom: () => (/* binding */ renderInDom),
|
|
@@ -3001,6 +3027,9 @@ function renderInDom(context, element, component, props) {
|
|
|
3001
3027
|
}
|
|
3002
3028
|
return attachDomPortal('root', context, element, component, props);
|
|
3003
3029
|
}
|
|
3030
|
+
function defer(cb) {
|
|
3031
|
+
setTimeout(cb, 0);
|
|
3032
|
+
}
|
|
3004
3033
|
|
|
3005
3034
|
/***/ }),
|
|
3006
3035
|
|
|
@@ -3429,8 +3458,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3429
3458
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3430
3459
|
/* harmony export */ installPiralDebug: () => (/* binding */ installPiralDebug)
|
|
3431
3460
|
/* harmony export */ });
|
|
3432
|
-
/* harmony import */ var
|
|
3461
|
+
/* harmony import */ var _ExtensionCatalogue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ExtensionCatalogue */ "../../utilities/piral-debug-utils/esm/ExtensionCatalogue.js");
|
|
3433
3462
|
/* harmony import */ var _decycle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./decycle */ "../../utilities/piral-debug-utils/esm/decycle.js");
|
|
3463
|
+
/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./overlay */ "../../utilities/piral-debug-utils/esm/overlay.js");
|
|
3434
3464
|
/* harmony import */ var _visualizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizer */ "../../utilities/piral-debug-utils/esm/visualizer.js");
|
|
3435
3465
|
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./state */ "../../utilities/piral-debug-utils/esm/state.js");
|
|
3436
3466
|
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); }
|
|
@@ -3443,6 +3473,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
3443
3473
|
|
|
3444
3474
|
|
|
3445
3475
|
|
|
3476
|
+
|
|
3446
3477
|
function installPiralDebug(options) {
|
|
3447
3478
|
var getGlobalState = options.getGlobalState,
|
|
3448
3479
|
getExtensions = options.getExtensions,
|
|
@@ -3510,6 +3541,15 @@ function installPiralDebug(options) {
|
|
|
3510
3541
|
}
|
|
3511
3542
|
}
|
|
3512
3543
|
},
|
|
3544
|
+
errorOverlay: {
|
|
3545
|
+
value: initialSettings.errorOverlay,
|
|
3546
|
+
type: 'boolean',
|
|
3547
|
+
label: 'Show error overlay',
|
|
3548
|
+
group: 'extensions',
|
|
3549
|
+
onChange: function onChange(value) {
|
|
3550
|
+
setValue(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.errorOverlay, value ? 'on' : 'off');
|
|
3551
|
+
}
|
|
3552
|
+
},
|
|
3513
3553
|
extensionCatalogue: {
|
|
3514
3554
|
value: initialSettings.extensionCatalogue,
|
|
3515
3555
|
type: 'boolean',
|
|
@@ -3662,12 +3702,12 @@ function installPiralDebug(options) {
|
|
|
3662
3702
|
debug: debugApiVersion,
|
|
3663
3703
|
instance: {
|
|
3664
3704
|
name: "minimal-piral",
|
|
3665
|
-
version: "1.6.0-beta.
|
|
3705
|
+
version: "1.6.0-beta.7201",
|
|
3666
3706
|
dependencies: "tslib,react,react-dom,react-router,react-router-dom"
|
|
3667
3707
|
},
|
|
3668
3708
|
build: {
|
|
3669
|
-
date: "2024-06-
|
|
3670
|
-
cli: "1.6.0-beta.
|
|
3709
|
+
date: "2024-06-21T14:24:39.799Z",
|
|
3710
|
+
cli: "1.6.0-beta.7201",
|
|
3671
3711
|
compat: "1"
|
|
3672
3712
|
}
|
|
3673
3713
|
};
|
|
@@ -3764,12 +3804,18 @@ function installPiralDebug(options) {
|
|
|
3764
3804
|
};
|
|
3765
3805
|
document.body.dispatchEvent = function (ev) {
|
|
3766
3806
|
if (ev.type.startsWith('piral-')) {
|
|
3807
|
+
var name = ev.type.replace('piral-', '');
|
|
3808
|
+
var args = ev.detail.arg;
|
|
3767
3809
|
events.unshift({
|
|
3768
3810
|
id: events.length.toString(),
|
|
3769
|
-
name:
|
|
3770
|
-
args: (0,_decycle__WEBPACK_IMPORTED_MODULE_2__.decycle)(
|
|
3811
|
+
name: name,
|
|
3812
|
+
args: (0,_decycle__WEBPACK_IMPORTED_MODULE_2__.decycle)(args),
|
|
3771
3813
|
time: Date.now()
|
|
3772
3814
|
});
|
|
3815
|
+
if (name === 'unhandled-error' && args.errorType && typeof customElements !== 'undefined' && sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.errorOverlay) !== 'off') {
|
|
3816
|
+
var ErrorOverlay = customElements.get(_overlay__WEBPACK_IMPORTED_MODULE_3__.overlayId);
|
|
3817
|
+
document.body.appendChild(new ErrorOverlay(args));
|
|
3818
|
+
}
|
|
3773
3819
|
sendMessage({
|
|
3774
3820
|
events: events,
|
|
3775
3821
|
type: 'events'
|
|
@@ -3786,7 +3832,8 @@ function installPiralDebug(options) {
|
|
|
3786
3832
|
hardRefresh: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.hardRefresh) === 'on',
|
|
3787
3833
|
viewOrigins: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.viewOrigins) === 'on',
|
|
3788
3834
|
extensionCatalogue: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.extensionCatalogue) !== 'off',
|
|
3789
|
-
clearConsole: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.clearConsole) === 'on'
|
|
3835
|
+
clearConsole: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.clearConsole) === 'on',
|
|
3836
|
+
errorOverlay: sessionStorage.getItem(_state__WEBPACK_IMPORTED_MODULE_0__.settingsKeys.errorOverlay) !== 'off'
|
|
3790
3837
|
});
|
|
3791
3838
|
}
|
|
3792
3839
|
});
|
|
@@ -3821,7 +3868,7 @@ function installPiralDebug(options) {
|
|
|
3821
3868
|
}
|
|
3822
3869
|
});
|
|
3823
3870
|
integrate({
|
|
3824
|
-
routes: _defineProperty({}, initialSettings.cataloguePath,
|
|
3871
|
+
routes: _defineProperty({}, initialSettings.cataloguePath, _ExtensionCatalogue__WEBPACK_IMPORTED_MODULE_4__.ExtensionCatalogue),
|
|
3825
3872
|
onChange: function onChange(previous, current, changed) {
|
|
3826
3873
|
if (changed.state) {
|
|
3827
3874
|
if (settings.viewState.value) {
|
|
@@ -4049,6 +4096,192 @@ function installPiletEmulator(requestPilets, options) {
|
|
|
4049
4096
|
|
|
4050
4097
|
/***/ }),
|
|
4051
4098
|
|
|
4099
|
+
/***/ "../../utilities/piral-debug-utils/esm/overlay.js":
|
|
4100
|
+
/*!********************************************************!*\
|
|
4101
|
+
!*** ../../utilities/piral-debug-utils/esm/overlay.js ***!
|
|
4102
|
+
\********************************************************/
|
|
4103
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4104
|
+
|
|
4105
|
+
"use strict";
|
|
4106
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4107
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4108
|
+
/* harmony export */ overlayId: () => (/* binding */ overlayId)
|
|
4109
|
+
/* harmony export */ });
|
|
4110
|
+
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); }
|
|
4111
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4112
|
+
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); } }
|
|
4113
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4114
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4115
|
+
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); }
|
|
4116
|
+
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); }
|
|
4117
|
+
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); }; }
|
|
4118
|
+
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); }
|
|
4119
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4120
|
+
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); }
|
|
4121
|
+
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); }
|
|
4122
|
+
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; } }
|
|
4123
|
+
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
|
|
4124
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
4125
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
4126
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4127
|
+
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."); }
|
|
4128
|
+
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); }
|
|
4129
|
+
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; }
|
|
4130
|
+
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; } }
|
|
4131
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
4132
|
+
// Create an element with provided attributes and optional children
|
|
4133
|
+
function h(e) {
|
|
4134
|
+
var attrs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
4135
|
+
var elem = document.createElement(e);
|
|
4136
|
+
for (var _i = 0, _Object$entries = Object.entries(attrs); _i < _Object$entries.length; _i++) {
|
|
4137
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
4138
|
+
k = _Object$entries$_i[0],
|
|
4139
|
+
v = _Object$entries$_i[1];
|
|
4140
|
+
elem.setAttribute(k, v);
|
|
4141
|
+
}
|
|
4142
|
+
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
4143
|
+
children[_key - 2] = arguments[_key];
|
|
4144
|
+
}
|
|
4145
|
+
elem.append.apply(elem, children);
|
|
4146
|
+
return elem;
|
|
4147
|
+
}
|
|
4148
|
+
// set :host styles to make playwright detect the element as visible
|
|
4149
|
+
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";
|
|
4150
|
+
// Error Template
|
|
4151
|
+
var createTemplate = function createTemplate() {
|
|
4152
|
+
return h('div', {
|
|
4153
|
+
"class": 'backdrop',
|
|
4154
|
+
part: 'backdrop'
|
|
4155
|
+
}, h('div', {
|
|
4156
|
+
"class": 'window',
|
|
4157
|
+
part: 'window'
|
|
4158
|
+
}, h('pre', {
|
|
4159
|
+
"class": 'message',
|
|
4160
|
+
part: 'message'
|
|
4161
|
+
}, h('span', {
|
|
4162
|
+
"class": 'plugin',
|
|
4163
|
+
part: 'plugin'
|
|
4164
|
+
}), h('span', {
|
|
4165
|
+
"class": 'message-body',
|
|
4166
|
+
part: 'message-body'
|
|
4167
|
+
})), h('pre', {
|
|
4168
|
+
"class": 'file',
|
|
4169
|
+
part: 'file'
|
|
4170
|
+
}), h('pre', {
|
|
4171
|
+
"class": 'frame',
|
|
4172
|
+
part: 'frame'
|
|
4173
|
+
}), h('pre', {
|
|
4174
|
+
"class": 'stack',
|
|
4175
|
+
part: 'stack'
|
|
4176
|
+
}), h('div', {
|
|
4177
|
+
"class": 'tip',
|
|
4178
|
+
part: 'tip'
|
|
4179
|
+
}, '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', {
|
|
4180
|
+
part: 'config-option-name'
|
|
4181
|
+
}, 'dbg:error-overlay'), ' to ', h('code', {
|
|
4182
|
+
part: 'config-option-value'
|
|
4183
|
+
}, '"off"'), ' in ', h('code', {
|
|
4184
|
+
part: 'config-file-name'
|
|
4185
|
+
}, 'sessionStorage'), '.')), h('style', {}, templateStyle));
|
|
4186
|
+
};
|
|
4187
|
+
var fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
|
|
4188
|
+
var codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
|
|
4189
|
+
var overlayId = 'piral-error-overlay';
|
|
4190
|
+
if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
4191
|
+
var ErrorOverlay = /*#__PURE__*/function (_HTMLElement) {
|
|
4192
|
+
_inherits(ErrorOverlay, _HTMLElement);
|
|
4193
|
+
var _super = _createSuper(ErrorOverlay);
|
|
4194
|
+
function ErrorOverlay(props) {
|
|
4195
|
+
var _error$loc;
|
|
4196
|
+
var _this;
|
|
4197
|
+
var links = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
4198
|
+
_classCallCheck(this, ErrorOverlay);
|
|
4199
|
+
_this = _super.call(this);
|
|
4200
|
+
var error = props.error,
|
|
4201
|
+
pilet = props.pilet,
|
|
4202
|
+
errorType = props.errorType;
|
|
4203
|
+
_this.root = _this.attachShadow({
|
|
4204
|
+
mode: 'open'
|
|
4205
|
+
});
|
|
4206
|
+
_this.root.appendChild(createTemplate());
|
|
4207
|
+
codeframeRE.lastIndex = 0;
|
|
4208
|
+
var hasFrame = error.frame && codeframeRE.test(error.frame);
|
|
4209
|
+
var message = hasFrame ? error.message.replace(codeframeRE, '') : error.message;
|
|
4210
|
+
if (pilet) {
|
|
4211
|
+
_this.text('.plugin', "[".concat(pilet, "] "));
|
|
4212
|
+
}
|
|
4213
|
+
_this.text('.message-body', message.trim());
|
|
4214
|
+
var _split = (((_error$loc = error.loc) === null || _error$loc === void 0 ? void 0 : _error$loc.file) || error.id || 'unknown file').split("?"),
|
|
4215
|
+
_split2 = _slicedToArray(_split, 1),
|
|
4216
|
+
file = _split2[0];
|
|
4217
|
+
if (error.loc) {
|
|
4218
|
+
_this.text('.file', "".concat(file, ":").concat(error.loc.line, ":").concat(error.loc.column), links);
|
|
4219
|
+
} else if (error.id) {
|
|
4220
|
+
_this.text('.file', file);
|
|
4221
|
+
}
|
|
4222
|
+
if (hasFrame) {
|
|
4223
|
+
_this.text('.frame', error.frame.trim());
|
|
4224
|
+
}
|
|
4225
|
+
_this.text('.stack', error.stack, links);
|
|
4226
|
+
_this.root.querySelector('.window').addEventListener('click', function (e) {
|
|
4227
|
+
e.stopPropagation();
|
|
4228
|
+
});
|
|
4229
|
+
_this.addEventListener('click', function () {
|
|
4230
|
+
_this.close();
|
|
4231
|
+
});
|
|
4232
|
+
_this.closeOnEsc = function (e) {
|
|
4233
|
+
if (e.key === 'Escape' || e.code === 'Escape') {
|
|
4234
|
+
_this.close();
|
|
4235
|
+
}
|
|
4236
|
+
};
|
|
4237
|
+
document.addEventListener('keydown', _this.closeOnEsc);
|
|
4238
|
+
return _this;
|
|
4239
|
+
}
|
|
4240
|
+
_createClass(ErrorOverlay, [{
|
|
4241
|
+
key: "text",
|
|
4242
|
+
value: function text(selector, _text) {
|
|
4243
|
+
var linkFiles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
4244
|
+
var el = this.root.querySelector(selector);
|
|
4245
|
+
if (linkFiles) {
|
|
4246
|
+
var curIndex = 0;
|
|
4247
|
+
var match;
|
|
4248
|
+
fileRE.lastIndex = 0;
|
|
4249
|
+
while (match = fileRE.exec(_text)) {
|
|
4250
|
+
var _match = match,
|
|
4251
|
+
file = _match[0],
|
|
4252
|
+
index = _match.index;
|
|
4253
|
+
if (index != null) {
|
|
4254
|
+
var frag = _text.slice(curIndex, index);
|
|
4255
|
+
el.appendChild(document.createTextNode(frag));
|
|
4256
|
+
var link = document.createElement('a');
|
|
4257
|
+
link.textContent = file;
|
|
4258
|
+
link.className = 'file-link';
|
|
4259
|
+
link.onclick = function () {
|
|
4260
|
+
console.log('Clicked');
|
|
4261
|
+
};
|
|
4262
|
+
el.appendChild(link);
|
|
4263
|
+
curIndex += frag.length + file.length;
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
} else {
|
|
4267
|
+
el.textContent = _text;
|
|
4268
|
+
}
|
|
4269
|
+
}
|
|
4270
|
+
}, {
|
|
4271
|
+
key: "close",
|
|
4272
|
+
value: function close() {
|
|
4273
|
+
var _this$parentNode;
|
|
4274
|
+
(_this$parentNode = this.parentNode) === null || _this$parentNode === void 0 || _this$parentNode.removeChild(this);
|
|
4275
|
+
document.removeEventListener('keydown', this.closeOnEsc);
|
|
4276
|
+
}
|
|
4277
|
+
}]);
|
|
4278
|
+
return ErrorOverlay;
|
|
4279
|
+
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
4280
|
+
customElements.define(overlayId, ErrorOverlay);
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
/***/ }),
|
|
4284
|
+
|
|
4052
4285
|
/***/ "../../utilities/piral-debug-utils/esm/routeRefresh.js":
|
|
4053
4286
|
/*!*************************************************************!*\
|
|
4054
4287
|
!*** ../../utilities/piral-debug-utils/esm/routeRefresh.js ***!
|
|
@@ -4103,7 +4336,8 @@ var settingsKeys = {
|
|
|
4103
4336
|
viewOrigins: 'dbg:view-origins',
|
|
4104
4337
|
extensionCatalogue: 'dbg:extension-catalogue',
|
|
4105
4338
|
clearConsole: 'dbg:clear-console',
|
|
4106
|
-
persistSettings: 'dbg:persist-settings-data'
|
|
4339
|
+
persistSettings: 'dbg:persist-settings-data',
|
|
4340
|
+
errorOverlay: 'dbg:error-overlay'
|
|
4107
4341
|
};
|
|
4108
4342
|
var persistKey = settingsKeys.persistSettings;
|
|
4109
4343
|
var persistSettings = !!localStorage.getItem(persistKey);
|
|
@@ -4168,6 +4402,7 @@ function getInitialSettings(defaultValues) {
|
|
|
4168
4402
|
viewOrigins: getValue(settingsKeys.viewOrigins, defaultValues.viewOrigins, false),
|
|
4169
4403
|
extensionCatalogue: getValue(settingsKeys.extensionCatalogue, defaultValues.extensionCatalogue, true),
|
|
4170
4404
|
clearConsole: getValue(settingsKeys.clearConsole, defaultValues.clearConsole, false),
|
|
4405
|
+
errorOverlay: getValue(settingsKeys.errorOverlay, defaultValues.errorOverlay, true),
|
|
4171
4406
|
persistSettings: persistSettings,
|
|
4172
4407
|
cataloguePath: '/$debug-extension-catalogue'
|
|
4173
4408
|
};
|
|
@@ -44780,4 +45015,4 @@ var instance = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.createInstance)({
|
|
|
44780
45015
|
|
|
44781
45016
|
/******/ })()
|
|
44782
45017
|
;
|
|
44783
|
-
//# sourceMappingURL=index.
|
|
45018
|
+
//# sourceMappingURL=index.6dc892.js.map
|