sample-piral 0.14.8-beta.3504 → 0.14.8-beta.3513
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.1a4f84.js → index.a1ff64.js} +382 -186
- package/app/index.a1ff64.js.map +1 -0
- package/app/index.d.ts +4 -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 +1 -1
- package/app/index.1a4f84.js.map +0 -1
|
@@ -1812,8 +1812,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1812
1812
|
/* harmony import */ var _createInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createInstance */ "../../framework/piral-core/esm/createInstance.js");
|
|
1813
1813
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/ResponsiveLayout.js");
|
|
1814
1814
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/Mediator.js");
|
|
1815
|
-
/* harmony import */ var
|
|
1816
|
-
/* harmony import */ var
|
|
1815
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/PiralView.js");
|
|
1816
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/PortalRenderer.js");
|
|
1817
|
+
/* harmony import */ var _RootListener__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RootListener */ "../../framework/piral-core/esm/RootListener.js");
|
|
1818
|
+
|
|
1817
1819
|
|
|
1818
1820
|
|
|
1819
1821
|
|
|
@@ -1846,7 +1848,7 @@ var Piral = function Piral(_ref) {
|
|
|
1846
1848
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_4__.Mediator, {
|
|
1847
1849
|
options: instance.options,
|
|
1848
1850
|
key: instance.id
|
|
1849
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
1851
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_RootListener__WEBPACK_IMPORTED_MODULE_5__.RootListener, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_6__.PiralView, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_7__.PortalRenderer, {
|
|
1850
1852
|
id: "root"
|
|
1851
1853
|
}), children));
|
|
1852
1854
|
};
|
|
@@ -1854,6 +1856,65 @@ Piral.displayName = 'Piral';
|
|
|
1854
1856
|
|
|
1855
1857
|
/***/ }),
|
|
1856
1858
|
|
|
1859
|
+
/***/ "../../framework/piral-core/esm/RootListener.js":
|
|
1860
|
+
/*!******************************************************!*\
|
|
1861
|
+
!*** ../../framework/piral-core/esm/RootListener.js ***!
|
|
1862
|
+
\******************************************************/
|
|
1863
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1864
|
+
|
|
1865
|
+
"use strict";
|
|
1866
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1867
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1868
|
+
/* harmony export */ "RootListener": () => (/* binding */ RootListener)
|
|
1869
|
+
/* harmony export */ });
|
|
1870
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
1871
|
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! . */ "../../framework/piral-core/esm/hooks/globalState.js");
|
|
1872
|
+
/* harmony import */ var _modules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules */ "../../framework/piral-core/esm/modules/element.js");
|
|
1873
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
1874
|
+
|
|
1875
|
+
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."); }
|
|
1876
|
+
|
|
1877
|
+
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); }
|
|
1878
|
+
|
|
1879
|
+
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; }
|
|
1880
|
+
|
|
1881
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
1882
|
+
|
|
1883
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
|
|
1887
|
+
|
|
1888
|
+
var RootListener = function RootListener() {
|
|
1889
|
+
var context = (0,___WEBPACK_IMPORTED_MODULE_1__.useGlobalStateContext)();
|
|
1890
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(function () {
|
|
1891
|
+
if (typeof document !== 'undefined') {
|
|
1892
|
+
var handler = function handler(ev) {
|
|
1893
|
+
ev.stopPropagation();
|
|
1894
|
+
var _ev$detail = ev.detail,
|
|
1895
|
+
target = _ev$detail.target,
|
|
1896
|
+
props = _ev$detail.props;
|
|
1897
|
+
|
|
1898
|
+
var _renderElement = (0,_modules__WEBPACK_IMPORTED_MODULE_2__.renderElement)(context, target, props),
|
|
1899
|
+
_renderElement2 = _slicedToArray(_renderElement, 2),
|
|
1900
|
+
dispose = _renderElement2[0],
|
|
1901
|
+
update = _renderElement2[1];
|
|
1902
|
+
|
|
1903
|
+
target.dispose = dispose;
|
|
1904
|
+
target.update = update;
|
|
1905
|
+
};
|
|
1906
|
+
|
|
1907
|
+
document.body.addEventListener('render-html', handler, false);
|
|
1908
|
+
return function () {
|
|
1909
|
+
document.body.removeEventListener('render-html', handler, false);
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
}, [context]);
|
|
1913
|
+
return null;
|
|
1914
|
+
};
|
|
1915
|
+
|
|
1916
|
+
/***/ }),
|
|
1917
|
+
|
|
1857
1918
|
/***/ "../../framework/piral-core/esm/actions/app.js":
|
|
1858
1919
|
/*!*****************************************************!*\
|
|
1859
1920
|
!*** ../../framework/piral-core/esm/actions/app.js ***!
|
|
@@ -2428,7 +2489,8 @@ function ExtensionSlot(props) {
|
|
|
2428
2489
|
_props$render = props.render,
|
|
2429
2490
|
render = _props$render === void 0 ? _utils__WEBPACK_IMPORTED_MODULE_1__.defaultRender : _props$render,
|
|
2430
2491
|
empty = props.empty,
|
|
2431
|
-
params = props.params
|
|
2492
|
+
params = props.params,
|
|
2493
|
+
children = props.children;
|
|
2432
2494
|
var extensions = (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.useGlobalState)(function (s) {
|
|
2433
2495
|
return s.registry.extensions[name] || _utils__WEBPACK_IMPORTED_MODULE_3__.none;
|
|
2434
2496
|
});
|
|
@@ -2439,6 +2501,7 @@ function ExtensionSlot(props) {
|
|
|
2439
2501
|
defaults = _ref$defaults === void 0 ? {} : _ref$defaults;
|
|
2440
2502
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, {
|
|
2441
2503
|
key: "".concat((reference === null || reference === void 0 ? void 0 : reference.displayName) || '_').concat(i),
|
|
2504
|
+
children: children,
|
|
2442
2505
|
params: Object.assign(Object.assign({}, defaults), params || {})
|
|
2443
2506
|
});
|
|
2444
2507
|
}));
|
|
@@ -3222,7 +3285,7 @@ function createInstance() {
|
|
|
3222
3285
|
var createApi = apiFactory(context, usedPlugins);
|
|
3223
3286
|
var root = createApi({
|
|
3224
3287
|
name: 'root',
|
|
3225
|
-
version: "0.14.8-beta.
|
|
3288
|
+
version: "0.14.8-beta.3513" || 0,
|
|
3226
3289
|
spec: ''
|
|
3227
3290
|
});
|
|
3228
3291
|
var options = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.createPiletOptions)({
|
|
@@ -3638,6 +3701,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3638
3701
|
/* harmony export */ "noop": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.noop),
|
|
3639
3702
|
/* harmony export */ "prependItem": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.prependItem),
|
|
3640
3703
|
/* harmony export */ "prependItems": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.prependItems),
|
|
3704
|
+
/* harmony export */ "reactifyContent": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.reactifyContent),
|
|
3641
3705
|
/* harmony export */ "removeIndicator": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.removeIndicator),
|
|
3642
3706
|
/* harmony export */ "removeNested": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.removeNested),
|
|
3643
3707
|
/* harmony export */ "renderInDom": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.renderInDom),
|
|
@@ -3684,201 +3748,103 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3684
3748
|
"use strict";
|
|
3685
3749
|
__webpack_require__.r(__webpack_exports__);
|
|
3686
3750
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3687
|
-
/* harmony export */ "createCoreApi": () => (/* binding */ createCoreApi),
|
|
3688
3751
|
/* harmony export */ "createExtenders": () => (/* binding */ createExtenders),
|
|
3689
3752
|
/* harmony export */ "defaultApiFactory": () => (/* binding */ defaultApiFactory)
|
|
3690
3753
|
/* harmony export */ });
|
|
3691
|
-
/* harmony import */ var
|
|
3692
|
-
/* harmony import */ var
|
|
3693
|
-
/* harmony import */ var
|
|
3694
|
-
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components */ "../../framework/piral-core/esm/components/ExtensionSlot.js");
|
|
3695
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
|
|
3696
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/foreign.js");
|
|
3697
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/data.js");
|
|
3698
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
3699
|
-
|
|
3754
|
+
/* harmony import */ var piral_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! piral-base */ "../../framework/piral-base/esm/utils.js");
|
|
3755
|
+
/* harmony import */ var piral_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-base */ "../../framework/piral-base/esm/api.js");
|
|
3756
|
+
/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ "../../framework/piral-core/esm/modules/core.js");
|
|
3700
3757
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3701
3758
|
|
|
3702
3759
|
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."); }
|
|
3703
3760
|
|
|
3761
|
+
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); }
|
|
3762
|
+
|
|
3704
3763
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
3705
3764
|
|
|
3706
3765
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
3707
3766
|
|
|
3708
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3709
|
-
|
|
3710
|
-
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."); }
|
|
3711
|
-
|
|
3712
|
-
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); }
|
|
3713
|
-
|
|
3714
3767
|
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; }
|
|
3715
3768
|
|
|
3716
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3717
|
-
|
|
3718
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3719
|
-
|
|
3720
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3721
3769
|
|
|
3722
|
-
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, descriptor.key, descriptor); } }
|
|
3723
|
-
|
|
3724
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
3725
|
-
|
|
3726
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
3727
|
-
|
|
3728
|
-
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); }; }
|
|
3729
|
-
|
|
3730
|
-
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); }
|
|
3731
|
-
|
|
3732
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3733
|
-
|
|
3734
|
-
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); }
|
|
3735
|
-
|
|
3736
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } 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); }
|
|
3737
|
-
|
|
3738
|
-
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; } }
|
|
3739
|
-
|
|
3740
|
-
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
3741
|
-
|
|
3742
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
3743
3770
|
|
|
3744
|
-
function
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
3752
|
-
var PiralExtension = /*#__PURE__*/function (_HTMLElement) {
|
|
3753
|
-
_inherits(PiralExtension, _HTMLElement);
|
|
3754
|
-
|
|
3755
|
-
var _super = _createSuper(PiralExtension);
|
|
3756
|
-
|
|
3757
|
-
function PiralExtension() {
|
|
3758
|
-
var _this;
|
|
3759
|
-
|
|
3760
|
-
_classCallCheck(this, PiralExtension);
|
|
3771
|
+
function createExtenders(context, apis) {
|
|
3772
|
+
var creators = [_core__WEBPACK_IMPORTED_MODULE_0__.createCoreApi].concat(_toConsumableArray(apis.filter(piral_base__WEBPACK_IMPORTED_MODULE_1__.isfunc)));
|
|
3773
|
+
return creators.map(function (c) {
|
|
3774
|
+
var ctx = c(context);
|
|
3761
3775
|
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
return
|
|
3776
|
+
if ((0,piral_base__WEBPACK_IMPORTED_MODULE_1__.isfunc)(ctx)) {
|
|
3777
|
+
return ctx;
|
|
3778
|
+
} else {
|
|
3779
|
+
return function () {
|
|
3780
|
+
return Object.assign({}, ctx);
|
|
3781
|
+
};
|
|
3766
3782
|
}
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
};
|
|
3777
|
-
}
|
|
3778
|
-
}, {
|
|
3779
|
-
key: "connectedCallback",
|
|
3780
|
-
value: function connectedCallback() {
|
|
3781
|
-
if (this.isConnected) {
|
|
3782
|
-
this.dispatchEvent(new CustomEvent('render-html', {
|
|
3783
|
-
bubbles: true,
|
|
3784
|
-
detail: {
|
|
3785
|
-
target: this,
|
|
3786
|
-
props: this.getProps()
|
|
3787
|
-
}
|
|
3788
|
-
}));
|
|
3789
|
-
}
|
|
3790
|
-
}
|
|
3791
|
-
}, {
|
|
3792
|
-
key: "disconnectedCallback",
|
|
3793
|
-
value: function disconnectedCallback() {
|
|
3794
|
-
this.dispose();
|
|
3795
|
-
this.dispose = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
3796
|
-
this.update = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
3797
|
-
}
|
|
3798
|
-
}, {
|
|
3799
|
-
key: "attributeChangedCallback",
|
|
3800
|
-
value: function attributeChangedCallback() {
|
|
3801
|
-
this.update(this.getProps());
|
|
3802
|
-
}
|
|
3803
|
-
}], [{
|
|
3804
|
-
key: "observedAttributes",
|
|
3805
|
-
get: function get() {
|
|
3806
|
-
return ['name', 'params'];
|
|
3807
|
-
}
|
|
3808
|
-
}]);
|
|
3809
|
-
|
|
3810
|
-
return PiralExtension;
|
|
3811
|
-
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
3812
|
-
|
|
3813
|
-
customElements.define('piral-extension', PiralExtension);
|
|
3783
|
+
});
|
|
3784
|
+
}
|
|
3785
|
+
function defaultApiFactory(context, apis) {
|
|
3786
|
+
var extenders = createExtenders(context, apis);
|
|
3787
|
+
return function (target) {
|
|
3788
|
+
var api = (0,piral_base__WEBPACK_IMPORTED_MODULE_2__.initializeApi)(target, context);
|
|
3789
|
+
context.apis[target.name] = api;
|
|
3790
|
+
return (0,piral_base__WEBPACK_IMPORTED_MODULE_2__.mergeApis)(api, extenders, target);
|
|
3791
|
+
};
|
|
3814
3792
|
}
|
|
3815
3793
|
|
|
3816
|
-
|
|
3817
|
-
var _renderInDom = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.renderInDom)(context, element, _components__WEBPACK_IMPORTED_MODULE_2__.ExtensionSlot, props),
|
|
3818
|
-
_renderInDom2 = _slicedToArray(_renderInDom, 2),
|
|
3819
|
-
id = _renderInDom2[0],
|
|
3820
|
-
portal = _renderInDom2[1];
|
|
3794
|
+
/***/ }),
|
|
3821
3795
|
|
|
3822
|
-
|
|
3796
|
+
/***/ "../../framework/piral-core/esm/modules/core.js":
|
|
3797
|
+
/*!******************************************************!*\
|
|
3798
|
+
!*** ../../framework/piral-core/esm/modules/core.js ***!
|
|
3799
|
+
\******************************************************/
|
|
3800
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3823
3801
|
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3802
|
+
"use strict";
|
|
3803
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3804
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3805
|
+
/* harmony export */ "createCoreApi": () => (/* binding */ createCoreApi)
|
|
3806
|
+
/* harmony export */ });
|
|
3807
|
+
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ "../../framework/piral-core/esm/modules/element.js");
|
|
3808
|
+
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../state */ "../../framework/piral-core/esm/state/withApi.js");
|
|
3809
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components */ "../../framework/piral-core/esm/components/ExtensionSlot.js");
|
|
3810
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/data.js");
|
|
3811
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3827
3812
|
|
|
3828
|
-
|
|
3829
|
-
context.hidePortal(id, portal);
|
|
3830
|
-
element.removeEventListener(evName, handler);
|
|
3831
|
-
};
|
|
3813
|
+
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."); }
|
|
3832
3814
|
|
|
3833
|
-
|
|
3834
|
-
var _changeDomPortal = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.changeDomPortal)(id, portal, context, element, _components__WEBPACK_IMPORTED_MODULE_2__.ExtensionSlot, newProps);
|
|
3815
|
+
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); }
|
|
3835
3816
|
|
|
3836
|
-
|
|
3817
|
+
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; }
|
|
3837
3818
|
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3819
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3820
|
+
|
|
3821
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3841
3822
|
|
|
3842
|
-
element.addEventListener(evName, handler);
|
|
3843
|
-
return [dispose, update];
|
|
3844
|
-
}
|
|
3845
3823
|
|
|
3846
|
-
function createCoreApi(context) {
|
|
3847
|
-
if (typeof document !== 'undefined') {
|
|
3848
|
-
document.body.addEventListener('render-html', function (ev) {
|
|
3849
|
-
ev.stopPropagation();
|
|
3850
|
-
var container = ev.detail.target;
|
|
3851
3824
|
|
|
3852
|
-
var _render = render(context, container, ev.detail.props),
|
|
3853
|
-
_render2 = _slicedToArray(_render, 2),
|
|
3854
|
-
dispose = _render2[0],
|
|
3855
|
-
update = _render2[1];
|
|
3856
3825
|
|
|
3857
|
-
container.dispose = dispose;
|
|
3858
|
-
container.update = update;
|
|
3859
|
-
}, false);
|
|
3860
|
-
}
|
|
3861
3826
|
|
|
3862
|
-
|
|
3863
|
-
|
|
3827
|
+
function createCoreApi(context) {
|
|
3828
|
+
return function (api, meta) {
|
|
3829
|
+
var pilet = meta.name;
|
|
3864
3830
|
return {
|
|
3865
3831
|
getData: function getData(name) {
|
|
3866
3832
|
return context.readDataValue(name);
|
|
3867
3833
|
},
|
|
3868
3834
|
setData: function setData(name, value, options) {
|
|
3869
|
-
var _createDataOptions = (0,
|
|
3835
|
+
var _createDataOptions = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.createDataOptions)(options),
|
|
3870
3836
|
_createDataOptions$ta = _createDataOptions.target,
|
|
3871
3837
|
target = _createDataOptions$ta === void 0 ? 'memory' : _createDataOptions$ta,
|
|
3872
3838
|
expires = _createDataOptions.expires;
|
|
3873
3839
|
|
|
3874
|
-
var expiration = (0,
|
|
3840
|
+
var expiration = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.getDataExpiration)(expires);
|
|
3875
3841
|
return context.tryWriteDataItem(name, value, pilet, target, expiration);
|
|
3876
3842
|
},
|
|
3877
3843
|
registerPage: function registerPage(route, arg, meta) {
|
|
3878
3844
|
context.registerPage(route, {
|
|
3879
3845
|
pilet: pilet,
|
|
3880
3846
|
meta: meta,
|
|
3881
|
-
component: (0,
|
|
3847
|
+
component: (0,_state__WEBPACK_IMPORTED_MODULE_1__.withApi)(context, arg, api, 'page')
|
|
3882
3848
|
});
|
|
3883
3849
|
return function () {
|
|
3884
3850
|
return api.unregisterPage(route);
|
|
@@ -3890,7 +3856,7 @@ function createCoreApi(context) {
|
|
|
3890
3856
|
registerExtension: function registerExtension(name, arg, defaults) {
|
|
3891
3857
|
context.registerExtension(name, {
|
|
3892
3858
|
pilet: pilet,
|
|
3893
|
-
component: (0,
|
|
3859
|
+
component: (0,_state__WEBPACK_IMPORTED_MODULE_1__.withApi)(context, arg, api, 'extension'),
|
|
3894
3860
|
reference: arg,
|
|
3895
3861
|
defaults: defaults
|
|
3896
3862
|
});
|
|
@@ -3902,38 +3868,16 @@ function createCoreApi(context) {
|
|
|
3902
3868
|
context.unregisterExtension(name, arg);
|
|
3903
3869
|
},
|
|
3904
3870
|
renderHtmlExtension: function renderHtmlExtension(element, props) {
|
|
3905
|
-
var
|
|
3906
|
-
|
|
3907
|
-
dispose =
|
|
3871
|
+
var _renderElement = (0,_element__WEBPACK_IMPORTED_MODULE_2__.renderElement)(context, element, props),
|
|
3872
|
+
_renderElement2 = _slicedToArray(_renderElement, 1),
|
|
3873
|
+
dispose = _renderElement2[0];
|
|
3908
3874
|
|
|
3909
3875
|
return dispose;
|
|
3910
3876
|
},
|
|
3911
|
-
Extension:
|
|
3877
|
+
Extension: _components__WEBPACK_IMPORTED_MODULE_3__.ExtensionSlot
|
|
3912
3878
|
};
|
|
3913
3879
|
};
|
|
3914
3880
|
}
|
|
3915
|
-
function createExtenders(context, apis) {
|
|
3916
|
-
var creators = [createCoreApi].concat(_toConsumableArray(apis.filter(piral_base__WEBPACK_IMPORTED_MODULE_5__.isfunc)));
|
|
3917
|
-
return creators.map(function (c) {
|
|
3918
|
-
var ctx = c(context);
|
|
3919
|
-
|
|
3920
|
-
if ((0,piral_base__WEBPACK_IMPORTED_MODULE_5__.isfunc)(ctx)) {
|
|
3921
|
-
return ctx;
|
|
3922
|
-
} else {
|
|
3923
|
-
return function () {
|
|
3924
|
-
return Object.assign({}, ctx);
|
|
3925
|
-
};
|
|
3926
|
-
}
|
|
3927
|
-
});
|
|
3928
|
-
}
|
|
3929
|
-
function defaultApiFactory(context, apis) {
|
|
3930
|
-
var extenders = createExtenders(context, apis);
|
|
3931
|
-
return function (target) {
|
|
3932
|
-
var api = (0,piral_base__WEBPACK_IMPORTED_MODULE_6__.initializeApi)(target, context);
|
|
3933
|
-
context.apis[target.name] = api;
|
|
3934
|
-
return (0,piral_base__WEBPACK_IMPORTED_MODULE_6__.mergeApis)(api, extenders, target);
|
|
3935
|
-
};
|
|
3936
|
-
}
|
|
3937
3881
|
|
|
3938
3882
|
/***/ }),
|
|
3939
3883
|
|
|
@@ -4008,6 +3952,192 @@ function defaultModuleRequester() {
|
|
|
4008
3952
|
|
|
4009
3953
|
/***/ }),
|
|
4010
3954
|
|
|
3955
|
+
/***/ "../../framework/piral-core/esm/modules/element.js":
|
|
3956
|
+
/*!*********************************************************!*\
|
|
3957
|
+
!*** ../../framework/piral-core/esm/modules/element.js ***!
|
|
3958
|
+
\*********************************************************/
|
|
3959
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3960
|
+
|
|
3961
|
+
"use strict";
|
|
3962
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3963
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3964
|
+
/* harmony export */ "renderElement": () => (/* binding */ renderElement)
|
|
3965
|
+
/* harmony export */ });
|
|
3966
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components */ "../../framework/piral-core/esm/components/ExtensionSlot.js");
|
|
3967
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
|
|
3968
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/extension.js");
|
|
3969
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/foreign.js");
|
|
3970
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
3971
|
+
|
|
3972
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3973
|
+
|
|
3974
|
+
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."); }
|
|
3975
|
+
|
|
3976
|
+
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); }
|
|
3977
|
+
|
|
3978
|
+
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; }
|
|
3979
|
+
|
|
3980
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3981
|
+
|
|
3982
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3983
|
+
|
|
3984
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3985
|
+
|
|
3986
|
+
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, descriptor.key, descriptor); } }
|
|
3987
|
+
|
|
3988
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
3989
|
+
|
|
3990
|
+
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
3991
|
+
|
|
3992
|
+
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); }; }
|
|
3993
|
+
|
|
3994
|
+
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); }
|
|
3995
|
+
|
|
3996
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3997
|
+
|
|
3998
|
+
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); }
|
|
3999
|
+
|
|
4000
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } 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); }
|
|
4001
|
+
|
|
4002
|
+
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; } }
|
|
4003
|
+
|
|
4004
|
+
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
4005
|
+
|
|
4006
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
4007
|
+
|
|
4008
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
4009
|
+
|
|
4010
|
+
|
|
4011
|
+
|
|
4012
|
+
|
|
4013
|
+
if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
4014
|
+
var PiralExtension = /*#__PURE__*/function (_HTMLElement) {
|
|
4015
|
+
_inherits(PiralExtension, _HTMLElement);
|
|
4016
|
+
|
|
4017
|
+
var _super = _createSuper(PiralExtension);
|
|
4018
|
+
|
|
4019
|
+
function PiralExtension() {
|
|
4020
|
+
var _this;
|
|
4021
|
+
|
|
4022
|
+
_classCallCheck(this, PiralExtension);
|
|
4023
|
+
|
|
4024
|
+
_this = _super.apply(this, arguments);
|
|
4025
|
+
_this.dispose = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
4026
|
+
_this.update = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
4027
|
+
_this.props = {
|
|
4028
|
+
name: _this.getAttribute('name'),
|
|
4029
|
+
params: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.tryParseJson)(_this.getAttribute('params')),
|
|
4030
|
+
empty: undefined,
|
|
4031
|
+
children: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.reactifyContent)(_this.childNodes)
|
|
4032
|
+
};
|
|
4033
|
+
return _this;
|
|
4034
|
+
}
|
|
4035
|
+
|
|
4036
|
+
_createClass(PiralExtension, [{
|
|
4037
|
+
key: "params",
|
|
4038
|
+
get: function get() {
|
|
4039
|
+
return this.props.params;
|
|
4040
|
+
},
|
|
4041
|
+
set: function set(value) {
|
|
4042
|
+
this.props.params = value;
|
|
4043
|
+
this.update(this.props);
|
|
4044
|
+
}
|
|
4045
|
+
}, {
|
|
4046
|
+
key: "name",
|
|
4047
|
+
get: function get() {
|
|
4048
|
+
return this.props.name;
|
|
4049
|
+
},
|
|
4050
|
+
set: function set(value) {
|
|
4051
|
+
this.props.name = value;
|
|
4052
|
+
this.update(this.props);
|
|
4053
|
+
}
|
|
4054
|
+
}, {
|
|
4055
|
+
key: "empty",
|
|
4056
|
+
get: function get() {
|
|
4057
|
+
return this.props.empty;
|
|
4058
|
+
},
|
|
4059
|
+
set: function set(value) {
|
|
4060
|
+
this.props.empty = value;
|
|
4061
|
+
this.update(this.props);
|
|
4062
|
+
}
|
|
4063
|
+
}, {
|
|
4064
|
+
key: "connectedCallback",
|
|
4065
|
+
value: function connectedCallback() {
|
|
4066
|
+
if (this.isConnected) {
|
|
4067
|
+
this.dispatchEvent(new CustomEvent('render-html', {
|
|
4068
|
+
bubbles: true,
|
|
4069
|
+
detail: {
|
|
4070
|
+
target: this,
|
|
4071
|
+
props: this.props
|
|
4072
|
+
}
|
|
4073
|
+
}));
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
}, {
|
|
4077
|
+
key: "disconnectedCallback",
|
|
4078
|
+
value: function disconnectedCallback() {
|
|
4079
|
+
this.dispose();
|
|
4080
|
+
this.dispose = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
4081
|
+
this.update = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
4082
|
+
}
|
|
4083
|
+
}, {
|
|
4084
|
+
key: "attributeChangedCallback",
|
|
4085
|
+
value: function attributeChangedCallback(name, _, newValue) {
|
|
4086
|
+
switch (name) {
|
|
4087
|
+
case 'name':
|
|
4088
|
+
this.name = newValue;
|
|
4089
|
+
break;
|
|
4090
|
+
|
|
4091
|
+
case 'params':
|
|
4092
|
+
this.params = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.tryParseJson)(newValue);
|
|
4093
|
+
break;
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
}], [{
|
|
4097
|
+
key: "observedAttributes",
|
|
4098
|
+
get: function get() {
|
|
4099
|
+
return ['name', 'params'];
|
|
4100
|
+
}
|
|
4101
|
+
}]);
|
|
4102
|
+
|
|
4103
|
+
return PiralExtension;
|
|
4104
|
+
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
4105
|
+
|
|
4106
|
+
customElements.define('piral-extension', PiralExtension);
|
|
4107
|
+
}
|
|
4108
|
+
|
|
4109
|
+
function renderElement(context, element, props) {
|
|
4110
|
+
var _renderInDom = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.renderInDom)(context, element, _components__WEBPACK_IMPORTED_MODULE_3__.ExtensionSlot, props),
|
|
4111
|
+
_renderInDom2 = _slicedToArray(_renderInDom, 2),
|
|
4112
|
+
id = _renderInDom2[0],
|
|
4113
|
+
portal = _renderInDom2[1];
|
|
4114
|
+
|
|
4115
|
+
var evName = 'extension-props-changed';
|
|
4116
|
+
|
|
4117
|
+
var handler = function handler(ev) {
|
|
4118
|
+
return update(ev.detail);
|
|
4119
|
+
};
|
|
4120
|
+
|
|
4121
|
+
var dispose = function dispose() {
|
|
4122
|
+
context.hidePortal(id, portal);
|
|
4123
|
+
element.removeEventListener(evName, handler);
|
|
4124
|
+
};
|
|
4125
|
+
|
|
4126
|
+
var update = function update(newProps) {
|
|
4127
|
+
var _changeDomPortal = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.changeDomPortal)(id, portal, context, element, _components__WEBPACK_IMPORTED_MODULE_3__.ExtensionSlot, newProps);
|
|
4128
|
+
|
|
4129
|
+
var _changeDomPortal2 = _slicedToArray(_changeDomPortal, 2);
|
|
4130
|
+
|
|
4131
|
+
id = _changeDomPortal2[0];
|
|
4132
|
+
portal = _changeDomPortal2[1];
|
|
4133
|
+
};
|
|
4134
|
+
|
|
4135
|
+
element.addEventListener(evName, handler);
|
|
4136
|
+
return [dispose, update];
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
/***/ }),
|
|
4140
|
+
|
|
4011
4141
|
/***/ "../../framework/piral-core/esm/state/createActions.js":
|
|
4012
4142
|
/*!*************************************************************!*\
|
|
4013
4143
|
!*** ../../framework/piral-core/esm/state/createActions.js ***!
|
|
@@ -4528,15 +4658,79 @@ function getDataExpiration(expires) {
|
|
|
4528
4658
|
"use strict";
|
|
4529
4659
|
__webpack_require__.r(__webpack_exports__);
|
|
4530
4660
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4531
|
-
/* harmony export */ "toExtension": () => (/* binding */ toExtension)
|
|
4661
|
+
/* harmony export */ "toExtension": () => (/* binding */ toExtension),
|
|
4662
|
+
/* harmony export */ "reactifyContent": () => (/* binding */ reactifyContent)
|
|
4532
4663
|
/* harmony export */ });
|
|
4533
4664
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
4665
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4666
|
+
|
|
4667
|
+
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."); }
|
|
4668
|
+
|
|
4669
|
+
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); }
|
|
4670
|
+
|
|
4671
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4672
|
+
|
|
4673
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
4674
|
+
|
|
4675
|
+
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; }
|
|
4676
|
+
|
|
4677
|
+
|
|
4678
|
+
|
|
4679
|
+
function removeAll(nodes) {
|
|
4680
|
+
nodes.forEach(function (node) {
|
|
4681
|
+
return node.remove();
|
|
4682
|
+
});
|
|
4683
|
+
}
|
|
4684
|
+
|
|
4685
|
+
var SlotCarrier = function SlotCarrier(_ref) {
|
|
4686
|
+
var nodes = _ref.nodes;
|
|
4687
|
+
var host = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
|
|
4688
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () {
|
|
4689
|
+
var _a2;
|
|
4690
|
+
|
|
4691
|
+
var _a;
|
|
4692
|
+
|
|
4693
|
+
(_a = host.current) === null || _a === void 0 ? void 0 : (_a2 = _a).append.apply(_a2, _toConsumableArray(nodes));
|
|
4694
|
+
return function () {
|
|
4695
|
+
return removeAll(nodes);
|
|
4696
|
+
};
|
|
4697
|
+
}, [nodes]);
|
|
4698
|
+
|
|
4699
|
+
if (nodes.length) {
|
|
4700
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("slot", {
|
|
4701
|
+
ref: host
|
|
4702
|
+
});
|
|
4703
|
+
}
|
|
4704
|
+
|
|
4705
|
+
return null;
|
|
4706
|
+
};
|
|
4707
|
+
/**
|
|
4708
|
+
* Transforms the given component to an extension component.
|
|
4709
|
+
* @param Component The component to transform.
|
|
4710
|
+
* @returns The extension component (receiving its props via params).
|
|
4711
|
+
*/
|
|
4712
|
+
|
|
4534
4713
|
|
|
4535
4714
|
function toExtension(Component) {
|
|
4536
4715
|
return function (props) {
|
|
4537
4716
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, Object.assign({}, props.params));
|
|
4538
4717
|
};
|
|
4539
4718
|
}
|
|
4719
|
+
/**
|
|
4720
|
+
* Reactifies the list of child nodes to a React Node by removing the
|
|
4721
|
+
* nodes from the DOM and carrying it in a React Node, where it would be
|
|
4722
|
+
* attached at a slot.
|
|
4723
|
+
* @param childNodes The child nodes to reactify.
|
|
4724
|
+
* @returns The React Node.
|
|
4725
|
+
*/
|
|
4726
|
+
|
|
4727
|
+
function reactifyContent(childNodes) {
|
|
4728
|
+
var nodes = Array.prototype.filter.call(childNodes, Boolean);
|
|
4729
|
+
removeAll(nodes);
|
|
4730
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(SlotCarrier, {
|
|
4731
|
+
nodes: nodes
|
|
4732
|
+
});
|
|
4733
|
+
}
|
|
4540
4734
|
|
|
4541
4735
|
/***/ }),
|
|
4542
4736
|
|
|
@@ -4762,6 +4956,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4762
4956
|
/* harmony export */ "createDataOptions": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.createDataOptions),
|
|
4763
4957
|
/* harmony export */ "createDataView": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.createDataView),
|
|
4764
4958
|
/* harmony export */ "getDataExpiration": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.getDataExpiration),
|
|
4959
|
+
/* harmony export */ "reactifyContent": () => (/* reexport safe */ _extension__WEBPACK_IMPORTED_MODULE_2__.reactifyContent),
|
|
4765
4960
|
/* harmony export */ "toExtension": () => (/* reexport safe */ _extension__WEBPACK_IMPORTED_MODULE_2__.toExtension),
|
|
4766
4961
|
/* harmony export */ "attachDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.attachDomPortal),
|
|
4767
4962
|
/* harmony export */ "changeDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.changeDomPortal),
|
|
@@ -5457,6 +5652,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5457
5652
|
/* harmony export */ "noop": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.noop),
|
|
5458
5653
|
/* harmony export */ "prependItem": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.prependItem),
|
|
5459
5654
|
/* harmony export */ "prependItems": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.prependItems),
|
|
5655
|
+
/* harmony export */ "reactifyContent": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.reactifyContent),
|
|
5460
5656
|
/* harmony export */ "removeIndicator": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.removeIndicator),
|
|
5461
5657
|
/* harmony export */ "removeNested": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.removeNested),
|
|
5462
5658
|
/* harmony export */ "renderInDom": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.renderInDom),
|
|
@@ -9028,11 +9224,11 @@ function installPiralDebug(options) {
|
|
|
9028
9224
|
debug: debugApiVersion,
|
|
9029
9225
|
instance: {
|
|
9030
9226
|
name: "sample-piral",
|
|
9031
|
-
version: "0.14.8-beta.
|
|
9227
|
+
version: "0.14.8-beta.3513",
|
|
9032
9228
|
dependencies: "reactstrap,react,react-dom,react-router,react-router-dom,history,tslib,path-to-regexp,@libre/atom,@dbeining/react-atom"
|
|
9033
9229
|
},
|
|
9034
9230
|
build: {
|
|
9035
|
-
date: "2022-01-
|
|
9231
|
+
date: "2022-01-20T10:25:04.567Z",
|
|
9036
9232
|
cli: "0.14.7",
|
|
9037
9233
|
compat: "0.14"
|
|
9038
9234
|
},
|
|
@@ -80337,4 +80533,4 @@ var layout_1 = __webpack_require__(/*! ./layout */ "./src/layout.tsx");
|
|
|
80337
80533
|
|
|
80338
80534
|
/******/ })()
|
|
80339
80535
|
;
|
|
80340
|
-
//# sourceMappingURL=index.
|
|
80536
|
+
//# sourceMappingURL=index.a1ff64.js.map
|