| @@ -1,1078 +1,1687 @@ | ||
| 1 | -(function() { | |
| 1 | +/*! elementor - v3.13.2 - 11-05-2023 */ | |
| 2 | +/******/ (() => { // webpackBootstrap | |
| 3 | +/******/ var __webpack_modules__ = ({ | |
| 2 | 4 | |
| 3 | -//#region \0rolldown/runtime.js | |
| 4 | - var __defProp = Object.defineProperty; | |
| 5 | - var __name = (target, value) => __defProp(target, "name", { | |
| 6 | - value, | |
| 7 | - configurable: true | |
| 8 | - }); | |
| 5 | +/***/ "../assets/dev/js/editor/command-bases/command-container-base.js": | |
| 6 | +/*!***********************************************************************!*\ | |
| 7 | + !*** ../assets/dev/js/editor/command-bases/command-container-base.js ***! | |
| 8 | + \***********************************************************************/ | |
| 9 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9 | 10 | |
| 10 | -//#endregion | |
| 11 | +"use strict"; | |
| 11 | 12 | |
| 12 | -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js | |
| 13 | - function _classCallCheck(a, n) { | |
| 14 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 15 | - } | |
| 16 | 13 | |
| 17 | -//#endregion | |
| 18 | -//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 19 | - function _typeof(o) { | |
| 20 | - "@babel/helpers - typeof"; | |
| 21 | - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 22 | - return typeof o; | |
| 23 | - } : function(o) { | |
| 24 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 25 | - }, _typeof(o); | |
| 26 | - } | |
| 14 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 15 | +Object.defineProperty(exports, "__esModule", ({ | |
| 16 | + value: true | |
| 17 | +})); | |
| 18 | +exports["default"] = void 0; | |
| 19 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 20 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 21 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 22 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 23 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 24 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 25 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 26 | +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; } } | |
| 27 | +/** | |
| 28 | + * @name $e.modules.editor.CommandContainerBase | |
| 29 | + */ | |
| 30 | +var CommandContainerBase = /*#__PURE__*/function (_CommandBase) { | |
| 31 | + (0, _inherits2.default)(CommandContainerBase, _CommandBase); | |
| 32 | + var _super = _createSuper(CommandContainerBase); | |
| 33 | + function CommandContainerBase() { | |
| 34 | + (0, _classCallCheck2.default)(this, CommandContainerBase); | |
| 35 | + return _super.apply(this, arguments); | |
| 36 | + } | |
| 37 | + (0, _createClass2.default)(CommandContainerBase, [{ | |
| 38 | + key: "requireContainer", | |
| 39 | + value: | |
| 40 | + /** | |
| 41 | + * Function requireContainer(). | |
| 42 | + * | |
| 43 | + * Validate `arg.container` & `arg.containers`. | |
| 44 | + * | |
| 45 | + * @param {{}} args | |
| 46 | + * | |
| 47 | + * @throws {Error} | |
| 48 | + */ | |
| 49 | + function requireContainer() { | |
| 50 | + var _this = this; | |
| 51 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args; | |
| 52 | + if (!args.container && !args.containers) { | |
| 53 | + throw Error('container or containers are required.'); | |
| 54 | + } | |
| 55 | + if (args.container && args.containers) { | |
| 56 | + throw Error('container and containers cannot go together please select one of them.'); | |
| 57 | + } | |
| 58 | + var containers = args.containers || [args.container]; | |
| 59 | + containers.forEach(function (container) { | |
| 60 | + _this.requireArgumentInstance('container', elementorModules.editor.Container, { | |
| 61 | + container: container | |
| 62 | + }); | |
| 63 | + }); | |
| 64 | + } | |
| 65 | + }], [{ | |
| 66 | + key: "getInstanceType", | |
| 67 | + value: function getInstanceType() { | |
| 68 | + return 'CommandContainerBase'; | |
| 69 | + } | |
| 70 | + }]); | |
| 71 | + return CommandContainerBase; | |
| 72 | +}(_commandBase.default); | |
| 73 | +exports["default"] = CommandContainerBase; | |
| 27 | 74 | |
| 28 | -//#endregion | |
| 29 | -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 30 | - function toPrimitive(t, r) { | |
| 31 | - if ("object" != _typeof(t) || !t) return t; | |
| 32 | - var e = t[Symbol.toPrimitive]; | |
| 33 | - if (void 0 !== e) { | |
| 34 | - var i = e.call(t, r || "default"); | |
| 35 | - if ("object" != _typeof(i)) return i; | |
| 36 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 37 | - } | |
| 38 | - return ("string" === r ? String : Number)(t); | |
| 39 | - } | |
| 75 | +/***/ }), | |
| 40 | 76 | |
| 41 | -//#endregion | |
| 42 | -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 43 | - function toPropertyKey(t) { | |
| 44 | - var i = toPrimitive(t, "string"); | |
| 45 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 46 | - } | |
| 77 | +/***/ "../assets/dev/js/editor/command-bases/command-container-internal-base.js": | |
| 78 | +/*!********************************************************************************!*\ | |
| 79 | + !*** ../assets/dev/js/editor/command-bases/command-container-internal-base.js ***! | |
| 80 | + \********************************************************************************/ | |
| 81 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 47 | 82 | |
| 48 | -//#endregion | |
| 49 | -//#region node_modules/@babel/runtime/helpers/esm/createClass.js | |
| 50 | - function _defineProperties(e, r) { | |
| 51 | - for (var t = 0; t < r.length; t++) { | |
| 52 | - var o = r[t]; | |
| 53 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 54 | - } | |
| 55 | - } | |
| 56 | - function _createClass(e, r, t) { | |
| 57 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; | |
| 58 | - } | |
| 83 | +"use strict"; | |
| 59 | 84 | |
| 60 | -//#endregion | |
| 61 | -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js | |
| 62 | - function _assertThisInitialized(e) { | |
| 63 | - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 64 | - return e; | |
| 65 | - } | |
| 66 | 85 | |
| 67 | -//#endregion | |
| 68 | -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js | |
| 69 | - function _possibleConstructorReturn(t, e) { | |
| 70 | - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; | |
| 71 | - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 72 | - return _assertThisInitialized(t); | |
| 73 | - } | |
| 86 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 87 | +Object.defineProperty(exports, "__esModule", ({ | |
| 88 | + value: true | |
| 89 | +})); | |
| 90 | +exports["default"] = void 0; | |
| 91 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 92 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 93 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 94 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 95 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 96 | +var _commandContainerBase = _interopRequireDefault(__webpack_require__(/*! ./command-container-base */ "../assets/dev/js/editor/command-bases/command-container-base.js")); | |
| 97 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 98 | +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; } } | |
| 99 | +/** | |
| 100 | + * @name $e.modules.editor.CommandContainerInternalBase | |
| 101 | + */ | |
| 102 | +var CommandContainerInternalBase = /*#__PURE__*/function (_CommandContainerBase) { | |
| 103 | + (0, _inherits2.default)(CommandContainerInternalBase, _CommandContainerBase); | |
| 104 | + var _super = _createSuper(CommandContainerInternalBase); | |
| 105 | + function CommandContainerInternalBase(args) { | |
| 106 | + (0, _classCallCheck2.default)(this, CommandContainerInternalBase); | |
| 107 | + return _super.call(this, args, $e.commandsInternal); | |
| 108 | + } | |
| 109 | + (0, _createClass2.default)(CommandContainerInternalBase, null, [{ | |
| 110 | + key: "getInstanceType", | |
| 111 | + value: function getInstanceType() { | |
| 112 | + return 'CommandContainerInternalBase'; | |
| 113 | + } | |
| 114 | + }]); | |
| 115 | + return CommandContainerInternalBase; | |
| 116 | +}(_commandContainerBase.default); | |
| 117 | +exports["default"] = CommandContainerInternalBase; | |
| 74 | 118 | |
| 75 | -//#endregion | |
| 76 | -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js | |
| 77 | - function _getPrototypeOf(t) { | |
| 78 | - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { | |
| 79 | - return t.__proto__ || Object.getPrototypeOf(t); | |
| 80 | - }, _getPrototypeOf(t); | |
| 81 | - } | |
| 119 | +/***/ }), | |
| 82 | 120 | |
| 83 | -//#endregion | |
| 84 | -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js | |
| 85 | - function _setPrototypeOf(t, e) { | |
| 86 | - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { | |
| 87 | - return t.__proto__ = e, t; | |
| 88 | - }, _setPrototypeOf(t, e); | |
| 89 | - } | |
| 121 | +/***/ "../assets/dev/js/editor/document/command-bases/command-history-base.js": | |
| 122 | +/*!******************************************************************************!*\ | |
| 123 | + !*** ../assets/dev/js/editor/document/command-bases/command-history-base.js ***! | |
| 124 | + \******************************************************************************/ | |
| 125 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 90 | 126 | |
| 91 | -//#endregion | |
| 92 | -//#region node_modules/@babel/runtime/helpers/esm/inherits.js | |
| 93 | - function _inherits(t, e) { | |
| 94 | - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 95 | - t.prototype = Object.create(e && e.prototype, { constructor: { | |
| 96 | - value: t, | |
| 97 | - writable: !0, | |
| 98 | - configurable: !0 | |
| 99 | - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); | |
| 100 | - } | |
| 127 | +"use strict"; | |
| 101 | 128 | |
| 102 | -//#endregion | |
| 103 | -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 104 | - function _defineProperty(e, r, t) { | |
| 105 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 106 | - value: t, | |
| 107 | - enumerable: !0, | |
| 108 | - configurable: !0, | |
| 109 | - writable: !0 | |
| 110 | - }) : e[r] = t, e; | |
| 111 | - } | |
| 112 | 129 | |
| 113 | -//#endregion | |
| 114 | -//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js | |
| 115 | - function _superPropBase(t, o) { | |
| 116 | - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); | |
| 117 | - return t; | |
| 118 | - } | |
| 130 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 131 | +Object.defineProperty(exports, "__esModule", ({ | |
| 132 | + value: true | |
| 133 | +})); | |
| 134 | +exports["default"] = void 0; | |
| 135 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 136 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 137 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 138 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 139 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 140 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 141 | +var _commandContainerBase = _interopRequireDefault(__webpack_require__(/*! elementor-editor/command-bases/command-container-base */ "../assets/dev/js/editor/command-bases/command-container-base.js")); | |
| 142 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 143 | +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; } } | |
| 144 | +/** | |
| 145 | + * @name $e.modules.editor.document.CommandHistoryBase | |
| 146 | + */ | |
| 147 | +var CommandHistoryBase = /*#__PURE__*/function (_CommandContainerBase) { | |
| 148 | + (0, _inherits2.default)(CommandHistoryBase, _CommandContainerBase); | |
| 149 | + var _super = _createSuper(CommandHistoryBase); | |
| 150 | + function CommandHistoryBase() { | |
| 151 | + (0, _classCallCheck2.default)(this, CommandHistoryBase); | |
| 152 | + return _super.apply(this, arguments); | |
| 153 | + } | |
| 154 | + (0, _createClass2.default)(CommandHistoryBase, [{ | |
| 155 | + key: "initialize", | |
| 156 | + value: function initialize() { | |
| 157 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 158 | + var _args$options = args.options, | |
| 159 | + options = _args$options === void 0 ? {} : _args$options, | |
| 160 | + _options$useHistory = options.useHistory, | |
| 161 | + useHistory = _options$useHistory === void 0 ? true : _options$useHistory; | |
| 162 | + if (useHistory) { | |
| 163 | + /** | |
| 164 | + * Get History from child command. | |
| 165 | + * | |
| 166 | + * @type {{}|boolean} | |
| 167 | + */ | |
| 168 | + this.history = this.getHistory(args); | |
| 119 | 169 | |
| 120 | -//#endregion | |
| 121 | -//#region node_modules/@babel/runtime/helpers/esm/get.js | |
| 122 | - function _get() { | |
| 123 | - return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { | |
| 124 | - var p = _superPropBase(e, t); | |
| 125 | - if (p) { | |
| 126 | - var n = Object.getOwnPropertyDescriptor(p, t); | |
| 127 | - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 128 | - } | |
| 129 | - }, _get.apply(null, arguments); | |
| 130 | - } | |
| 170 | + /** | |
| 171 | + * @type {number|boolean} | |
| 172 | + */ | |
| 173 | + this.historyId = false; | |
| 174 | + } | |
| 175 | + } | |
| 131 | 176 | |
| 132 | -//#endregion | |
| 133 | -//#region assets/dev/js/modules/imports/instance-type.js | |
| 134 | - function _superPropGet$2(t, o, e, r) { | |
| 135 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 136 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 137 | - return p.apply(e, t); | |
| 138 | - } : p; | |
| 139 | - } | |
| 140 | - __name(_superPropGet$2, "_superPropGet"); | |
| 141 | - var InstanceType = /*#__PURE__*/ function() { | |
| 142 | - function InstanceType() { | |
| 143 | - var _this = this; | |
| 144 | - _classCallCheck(this, InstanceType); | |
| 145 | - var target = this instanceof InstanceType ? this.constructor : void 0; | |
| 146 | - var prototypes = []; | |
| 147 | - while (target.__proto__ && target.__proto__.name) { | |
| 148 | - prototypes.push(target.__proto__); | |
| 149 | - target = target.__proto__; | |
| 150 | - } | |
| 151 | - prototypes.reverse().forEach(function(proto) { | |
| 152 | - return _this instanceof proto; | |
| 153 | - }); | |
| 154 | - } | |
| 155 | - return _createClass(InstanceType, null, [{ | |
| 156 | - key: Symbol.hasInstance, | |
| 157 | - value: function value(target) { | |
| 158 | - /** | |
| 159 | - * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class | |
| 160 | - * its give's opportunity to mange capabilities of instanceOf operator. | |
| 161 | - * saving current class each time will give option later to handle instanceOf manually. | |
| 162 | - */ | |
| 163 | - var result = _superPropGet$2(InstanceType, Symbol.hasInstance, this, 2)([target]); | |
| 164 | - if (target && !target.constructor.getInstanceType) return result; | |
| 165 | - if (target) { | |
| 166 | - if (!target.instanceTypes) target.instanceTypes = []; | |
| 167 | - if (!result) { | |
| 168 | - if (this.getInstanceType() === target.constructor.getInstanceType()) result = true; | |
| 169 | - } | |
| 170 | - if (result) { | |
| 171 | - var name = this.getInstanceType === InstanceType.getInstanceType ? "BaseInstanceType" : this.getInstanceType(); | |
| 172 | - if (-1 === target.instanceTypes.indexOf(name)) target.instanceTypes.push(name); | |
| 173 | - } | |
| 174 | - } | |
| 175 | - if (!result && target) result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType()); | |
| 176 | - return result; | |
| 177 | - } | |
| 178 | - }, { | |
| 179 | - key: "getInstanceType", | |
| 180 | - value: function getInstanceType() { | |
| 181 | - elementorModules.ForceMethodImplementation(); | |
| 182 | - } | |
| 183 | - }]); | |
| 184 | - }(); | |
| 177 | + // eslint-disable-next-line jsdoc/require-returns-check | |
| 178 | + /** | |
| 179 | + * Function getHistory(). | |
| 180 | + * | |
| 181 | + * Get history object from child, do nothing if it false. | |
| 182 | + * | |
| 183 | + * @param {*} [args={}] | |
| 184 | + * | |
| 185 | + * @return {({}|boolean)} history object | |
| 186 | + */ | |
| 187 | + }, { | |
| 188 | + key: "getHistory", | |
| 189 | + value: function getHistory() { | |
| 190 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 191 | + // eslint-disable-line no-unused-vars | |
| 192 | + elementorModules.ForceMethodImplementation(); | |
| 193 | + } | |
| 185 | 194 | |
| 186 | -//#endregion | |
| 187 | -//#region assets/dev/js/editor/utils/is-instanceof.js | |
| 188 | - function _createForOfIteratorHelper(r, e) { | |
| 189 | - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 190 | - if (!t) { | |
| 191 | - if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { | |
| 192 | - t && (r = t); | |
| 193 | - var _n = 0; | |
| 194 | - var F = function F() {}; | |
| 195 | - return { | |
| 196 | - s: F, | |
| 197 | - n: function n() { | |
| 198 | - return _n >= r.length ? { done: !0 } : { | |
| 199 | - done: !1, | |
| 200 | - value: r[_n++] | |
| 201 | - }; | |
| 202 | - }, | |
| 203 | - e: function e(r) { | |
| 204 | - throw r; | |
| 205 | - }, | |
| 206 | - f: F | |
| 207 | - }; | |
| 208 | - } | |
| 209 | - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 210 | - } | |
| 211 | - var o; | |
| 212 | - var a = !0; | |
| 213 | - var u = !1; | |
| 214 | - return { | |
| 215 | - s: function s() { | |
| 216 | - t = t.call(r); | |
| 217 | - }, | |
| 218 | - n: function n() { | |
| 219 | - var r = t.next(); | |
| 220 | - return a = r.done, r; | |
| 221 | - }, | |
| 222 | - e: function e(r) { | |
| 223 | - u = !0, o = r; | |
| 224 | - }, | |
| 225 | - f: function f() { | |
| 226 | - try { | |
| 227 | - a || null == t.return || t.return(); | |
| 228 | - } finally { | |
| 229 | - if (u) throw o; | |
| 230 | - } | |
| 231 | - } | |
| 232 | - }; | |
| 233 | - } | |
| 234 | - function _unsupportedIterableToArray$1(r, a) { | |
| 235 | - if (r) { | |
| 236 | - if ("string" == typeof r) return _arrayLikeToArray$1(r, a); | |
| 237 | - var t = {}.toString.call(r).slice(8, -1); | |
| 238 | - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; | |
| 239 | - } | |
| 240 | - } | |
| 241 | - __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray"); | |
| 242 | - function _arrayLikeToArray$1(r, a) { | |
| 243 | - (null == a || a > r.length) && (a = r.length); | |
| 244 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 245 | - return n; | |
| 246 | - } | |
| 247 | - __name(_arrayLikeToArray$1, "_arrayLikeToArray"); | |
| 248 | - /** | |
| 249 | - * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved | |
| 250 | - * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can | |
| 251 | - * check whether it's instanceof by using the objects constructor and prototype names. | |
| 252 | - * | |
| 253 | - * @param object | |
| 254 | - * @param constructors | |
| 255 | - * @return {boolean} | |
| 256 | - */ | |
| 257 | - var is_instanceof_default = /* @__PURE__ */ __name((function(object, constructors) { | |
| 258 | - constructors = Array.isArray(constructors) ? constructors : [constructors]; | |
| 259 | - var _iterator = _createForOfIteratorHelper(constructors); | |
| 260 | - var _step; | |
| 261 | - try { | |
| 262 | - for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 263 | - var constructor = _step.value; | |
| 264 | - if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) return true; | |
| 265 | - } | |
| 266 | - } catch (err) { | |
| 267 | - _iterator.e(err); | |
| 268 | - } finally { | |
| 269 | - _iterator.f(); | |
| 270 | - } | |
| 271 | - return false; | |
| 272 | - }), "default"); | |
| 195 | + /** | |
| 196 | + * Function isHistoryActive(). | |
| 197 | + * | |
| 198 | + * Return `elementor.documents.getCurrent().history.getActive()`. | |
| 199 | + * | |
| 200 | + * @return {boolean} is history active | |
| 201 | + */ | |
| 202 | + }, { | |
| 203 | + key: "isHistoryActive", | |
| 204 | + value: function isHistoryActive() { | |
| 205 | + return elementor.documents.getCurrent().history.getActive(); | |
| 206 | + } | |
| 207 | + }, { | |
| 208 | + key: "onBeforeRun", | |
| 209 | + value: function onBeforeRun(args) { | |
| 210 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistoryBase.prototype), "onBeforeRun", this).call(this, args); | |
| 211 | + if (this.history && this.isHistoryActive()) { | |
| 212 | + this.historyId = $e.internal('document/history/start-log', this.history); | |
| 213 | + } | |
| 214 | + } | |
| 215 | + }, { | |
| 216 | + key: "onAfterRun", | |
| 217 | + value: function onAfterRun(args, result) { | |
| 218 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistoryBase.prototype), "onAfterRun", this).call(this, args, result); | |
| 219 | + if (this.history && this.isHistoryActive()) { | |
| 220 | + $e.internal('document/history/end-log', { | |
| 221 | + id: this.historyId | |
| 222 | + }); | |
| 223 | + } | |
| 224 | + } | |
| 225 | + }, { | |
| 226 | + key: "onAfterApply", | |
| 227 | + value: function onAfterApply() { | |
| 228 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 229 | + var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 230 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistoryBase.prototype), "onAfterApply", this).call(this, args, result); | |
| 231 | + if (this.isDataChanged()) { | |
| 232 | + $e.internal('document/save/set-is-modified', { | |
| 233 | + status: true | |
| 234 | + }); | |
| 235 | + } | |
| 236 | + } | |
| 237 | + }, { | |
| 238 | + key: "onCatchApply", | |
| 239 | + value: function onCatchApply(e) { | |
| 240 | + // Rollback history on failure. | |
| 241 | + if (e instanceof $e.modules.HookBreak && this.historyId) { | |
| 242 | + $e.internal('document/history/delete-log', { | |
| 243 | + id: this.historyId | |
| 244 | + }); | |
| 245 | + } | |
| 246 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistoryBase.prototype), "onCatchApply", this).call(this, e); | |
| 247 | + } | |
| 248 | + }, { | |
| 249 | + key: "isDataChanged", | |
| 250 | + value: function isDataChanged() { | |
| 251 | + // All the commands who use history are commands that changing the data. | |
| 252 | + return true; | |
| 253 | + } | |
| 254 | + }], [{ | |
| 255 | + key: "getInstanceType", | |
| 256 | + value: function getInstanceType() { | |
| 257 | + return 'CommandHistoryBase'; | |
| 258 | + } | |
| 259 | + }]); | |
| 260 | + return CommandHistoryBase; | |
| 261 | +}(_commandContainerBase.default); | |
| 262 | +exports["default"] = CommandHistoryBase; | |
| 273 | 263 | |
| 274 | -//#endregion | |
| 275 | -//#region assets/dev/js/modules/imports/args-object.js | |
| 276 | - function _callSuper$6(t, o, e) { | |
| 277 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 278 | - } | |
| 279 | - __name(_callSuper$6, "_callSuper"); | |
| 280 | - function _isNativeReflectConstruct$6() { | |
| 281 | - try { | |
| 282 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 283 | - } catch (t) {} | |
| 284 | - return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { | |
| 285 | - return !!t; | |
| 286 | - })(); | |
| 287 | - } | |
| 288 | - __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct"); | |
| 289 | - var ArgsObject = /*#__PURE__*/ function(_InstanceType) { | |
| 290 | - /** | |
| 291 | - * Function constructor(). | |
| 292 | - * | |
| 293 | - * Create ArgsObject. | |
| 294 | - * | |
| 295 | - * @param {{}} args | |
| 296 | - */ | |
| 297 | - function ArgsObject(args) { | |
| 298 | - var _this; | |
| 299 | - _classCallCheck(this, ArgsObject); | |
| 300 | - _this = _callSuper$6(this, ArgsObject); | |
| 301 | - _this.args = args; | |
| 302 | - return _this; | |
| 303 | - } | |
| 304 | - /** | |
| 305 | - * Function requireArgument(). | |
| 306 | - * | |
| 307 | - * Validate property in args. | |
| 308 | - * | |
| 309 | - * @param {string} property | |
| 310 | - * @param {{}} args | |
| 311 | - * | |
| 312 | - * @throws {Error} | |
| 313 | - */ | |
| 314 | - _inherits(ArgsObject, _InstanceType); | |
| 315 | - return _createClass(ArgsObject, [ | |
| 316 | - { | |
| 317 | - key: "requireArgument", | |
| 318 | - value: function requireArgument(property) { | |
| 319 | - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.args; | |
| 320 | - if (!Object.prototype.hasOwnProperty.call(args, property)) throw Error("".concat(property, " is required.")); | |
| 321 | - } | |
| 322 | - }, | |
| 323 | - { | |
| 324 | - key: "requireArgumentType", | |
| 325 | - value: function requireArgumentType(property, type) { | |
| 326 | - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args; | |
| 327 | - this.requireArgument(property, args); | |
| 328 | - if (_typeof(args[property]) !== type) throw Error("".concat(property, " invalid type: ").concat(type, ".")); | |
| 329 | - } | |
| 330 | - }, | |
| 331 | - { | |
| 332 | - key: "requireArgumentInstance", | |
| 333 | - value: function requireArgumentInstance(property, instance) { | |
| 334 | - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args; | |
| 335 | - this.requireArgument(property, args); | |
| 336 | - if (!(args[property] instanceof instance) && !is_instanceof_default(args[property], instance)) throw Error("".concat(property, " invalid instance.")); | |
| 337 | - } | |
| 338 | - }, | |
| 339 | - { | |
| 340 | - key: "requireArgumentConstructor", | |
| 341 | - value: function requireArgumentConstructor(property, type) { | |
| 342 | - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args; | |
| 343 | - this.requireArgument(property, args); | |
| 344 | - if (args[property].constructor.toString() !== type.prototype.constructor.toString()) throw Error("".concat(property, " invalid constructor type.")); | |
| 345 | - } | |
| 346 | - } | |
| 347 | - ], [{ | |
| 348 | - key: "getInstanceType", | |
| 349 | - value: function getInstanceType() { | |
| 350 | - return "ArgsObject"; | |
| 351 | - } | |
| 352 | - }]); | |
| 353 | - }(InstanceType); | |
| 264 | +/***/ }), | |
| 354 | 265 | |
| 355 | -//#endregion | |
| 356 | -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | |
| 357 | - function _arrayWithHoles(r) { | |
| 358 | - if (Array.isArray(r)) return r; | |
| 359 | - } | |
| 266 | +/***/ "../assets/dev/js/editor/document/command-bases/command-history-debounce-base.js": | |
| 267 | +/*!***************************************************************************************!*\ | |
| 268 | + !*** ../assets/dev/js/editor/document/command-bases/command-history-debounce-base.js ***! | |
| 269 | + \***************************************************************************************/ | |
| 270 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 360 | 271 | |
| 361 | -//#endregion | |
| 362 | -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js | |
| 363 | - function _iterableToArrayLimit(r, l) { | |
| 364 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 365 | - if (null != t) { | |
| 366 | - var e; | |
| 367 | - var n; | |
| 368 | - var i; | |
| 369 | - var u; | |
| 370 | - var a = []; | |
| 371 | - var f = !0; | |
| 372 | - var o = !1; | |
| 373 | - try { | |
| 374 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 375 | - if (Object(t) !== t) return; | |
| 376 | - f = !1; | |
| 377 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 378 | - } catch (r) { | |
| 379 | - o = !0, n = r; | |
| 380 | - } finally { | |
| 381 | - try { | |
| 382 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 383 | - } finally { | |
| 384 | - if (o) throw n; | |
| 385 | - } | |
| 386 | - } | |
| 387 | - return a; | |
| 388 | - } | |
| 389 | - } | |
| 272 | +"use strict"; | |
| 390 | 273 | |
| 391 | -//#endregion | |
| 392 | -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js | |
| 393 | - function _arrayLikeToArray(r, a) { | |
| 394 | - (null == a || a > r.length) && (a = r.length); | |
| 395 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 396 | - return n; | |
| 397 | - } | |
| 398 | 274 | |
| 399 | -//#endregion | |
| 400 | -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js | |
| 401 | - function _unsupportedIterableToArray(r, a) { | |
| 402 | - if (r) { | |
| 403 | - if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 404 | - var t = {}.toString.call(r).slice(8, -1); | |
| 405 | - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; | |
| 406 | - } | |
| 407 | - } | |
| 275 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 276 | +Object.defineProperty(exports, "__esModule", ({ | |
| 277 | + value: true | |
| 278 | +})); | |
| 279 | +exports.getDefaultDebounceDelay = exports["default"] = exports.DEFAULT_DEBOUNCE_DELAY = void 0; | |
| 280 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 281 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 282 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 283 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 284 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 285 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 286 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 287 | +var _commandHistoryBase = _interopRequireDefault(__webpack_require__(/*! ./command-history-base */ "../assets/dev/js/editor/document/command-bases/command-history-base.js")); | |
| 288 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 289 | +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; } } | |
| 290 | +var DEFAULT_DEBOUNCE_DELAY = 800; | |
| 408 | 291 | |
| 409 | -//#endregion | |
| 410 | -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js | |
| 411 | - function _nonIterableRest() { | |
| 412 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 413 | - } | |
| 292 | +/** | |
| 293 | + * Function getDefaultDebounceDelay(). | |
| 294 | + * | |
| 295 | + * Returns default debounce delay time, if exists in config override. | |
| 296 | + * | |
| 297 | + * @return {number} default debounce delay time | |
| 298 | + */ | |
| 299 | +exports.DEFAULT_DEBOUNCE_DELAY = DEFAULT_DEBOUNCE_DELAY; | |
| 300 | +var getDefaultDebounceDelay = function getDefaultDebounceDelay() { | |
| 301 | + var result = DEFAULT_DEBOUNCE_DELAY; | |
| 302 | + if (elementor.config.document && undefined !== elementor.config.document.debounceDelay) { | |
| 303 | + result = elementor.config.document.debounceDelay; | |
| 304 | + } | |
| 305 | + return result; | |
| 306 | +}; | |
| 414 | 307 | |
| 415 | -//#endregion | |
| 416 | -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js | |
| 417 | - function _slicedToArray(r, e) { | |
| 418 | - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | |
| 419 | - } | |
| 308 | +/** | |
| 309 | + * @name $e.modules.editor.document.CommandHistoryDebounceBase | |
| 310 | + */ | |
| 311 | +exports.getDefaultDebounceDelay = getDefaultDebounceDelay; | |
| 312 | +var CommandHistoryDebounceBase = /*#__PURE__*/function (_CommandHistoryBase) { | |
| 313 | + (0, _inherits2.default)(CommandHistoryDebounceBase, _CommandHistoryBase); | |
| 314 | + var _super = _createSuper(CommandHistoryDebounceBase); | |
| 315 | + function CommandHistoryDebounceBase() { | |
| 316 | + (0, _classCallCheck2.default)(this, CommandHistoryDebounceBase); | |
| 317 | + return _super.apply(this, arguments); | |
| 318 | + } | |
| 319 | + (0, _createClass2.default)(CommandHistoryDebounceBase, [{ | |
| 320 | + key: "initialize", | |
| 321 | + value: function initialize(args) { | |
| 322 | + var _args$options = args.options, | |
| 323 | + options = _args$options === void 0 ? {} : _args$options; | |
| 324 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistoryDebounceBase.prototype), "initialize", this).call(this, args); | |
| 325 | + if (!this.constructor.debounce) { | |
| 326 | + this.constructor.debounce = _.debounce(function (fn) { | |
| 327 | + return fn(); | |
| 328 | + }, getDefaultDebounceDelay()); | |
| 329 | + } | |
| 420 | 330 | |
| 421 | -//#endregion | |
| 422 | -//#region modules/web-cli/assets/js/utils/console.js | |
| 423 | - var Console = /*#__PURE__*/ function() { | |
| 424 | - function Console() { | |
| 425 | - _classCallCheck(this, Console); | |
| 426 | - } | |
| 427 | - return _createClass(Console, null, [{ | |
| 428 | - key: "error", | |
| 429 | - value: function error(message) { | |
| 430 | - if ($e.devTools) $e.devTools.log.error(message); | |
| 431 | - if (!(message instanceof $e.modules.HookBreak)) console.error(message); | |
| 432 | - } | |
| 433 | - }, { | |
| 434 | - key: "warn", | |
| 435 | - value: function warn() { | |
| 436 | - var _console; | |
| 437 | - var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;"); | |
| 438 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 439 | - args.unshift("%c %c", style, ""); | |
| 440 | - (_console = console).warn.apply(_console, args); | |
| 441 | - } | |
| 442 | - }]); | |
| 443 | - }(); | |
| 331 | + // If its head command, and not called within another command. | |
| 332 | + if (1 === $e.commands.currentTrace.length || options.debounce) { | |
| 333 | + this.isDebounceRequired = true; | |
| 334 | + } | |
| 335 | + } | |
| 336 | + }, { | |
| 337 | + key: "onBeforeRun", | |
| 338 | + value: function onBeforeRun(args) { | |
| 339 | + $e.modules.CommandBase.prototype.onBeforeRun.call(this, args); | |
| 340 | + if (this.history && this.isHistoryActive()) { | |
| 341 | + $e.internal('document/history/add-transaction', this.history); | |
| 342 | + } | |
| 343 | + } | |
| 344 | + }, { | |
| 345 | + key: "onAfterRun", | |
| 346 | + value: function onAfterRun(args, result) { | |
| 347 | + $e.modules.CommandBase.prototype.onAfterRun.call(this, args, result); | |
| 348 | + if (this.isHistoryActive()) { | |
| 349 | + if (this.isDebounceRequired) { | |
| 350 | + this.constructor.debounce(function () { | |
| 351 | + return $e.internal('document/history/end-transaction'); | |
| 352 | + }); | |
| 353 | + } else { | |
| 354 | + $e.internal('document/history/end-transaction'); | |
| 355 | + } | |
| 356 | + } | |
| 357 | + } | |
| 358 | + }, { | |
| 359 | + key: "onCatchApply", | |
| 360 | + value: function onCatchApply(e) { | |
| 361 | + $e.modules.CommandBase.prototype.onCatchApply.call(this, e); | |
| 444 | 362 | |
| 445 | -//#endregion | |
| 446 | -//#region modules/web-cli/assets/js/utils/deprecation.js | |
| 363 | + // Rollback history on failure. | |
| 364 | + if (e instanceof $e.modules.HookBreak && this.history) { | |
| 365 | + if (this.isDebounceRequired) { | |
| 366 | + // `clear-transaction` is under debounce, because it should `clear-transaction` after `end-transaction`. | |
| 367 | + this.constructor.debounce(function () { | |
| 368 | + return $e.internal('document/history/clear-transaction'); | |
| 369 | + }); | |
| 370 | + } else { | |
| 371 | + $e.internal('document/history/clear-transaction'); | |
| 372 | + } | |
| 373 | + } | |
| 374 | + } | |
| 375 | + }], [{ | |
| 376 | + key: "getInstanceType", | |
| 377 | + value: function getInstanceType() { | |
| 378 | + return 'CommandHistoryDebounceBase'; | |
| 379 | + } | |
| 380 | + }]); | |
| 381 | + return CommandHistoryDebounceBase; | |
| 382 | +}(_commandHistoryBase.default); | |
| 383 | +exports["default"] = CommandHistoryDebounceBase; | |
| 447 | 384 | /** |
| 448 | - * @typedef {Object} Version | |
| 449 | - * @property {number} major1 The first number | |
| 450 | - * @property {number} major2 The second number | |
| 451 | - * @property {number} minor The third number | |
| 452 | - * @property {string} build The fourth number | |
| 453 | - */ | |
| 454 | - var softDeprecated = function softDeprecated(name, version, replacement) { | |
| 455 | - if (elementorWebCliConfig.isDebug) deprecatedMessage("soft", name, version, replacement); | |
| 456 | - }; | |
| 457 | - var hardDeprecated = function hardDeprecated(name, version, replacement) { | |
| 458 | - deprecatedMessage("hard", name, version, replacement); | |
| 459 | - }; | |
| 460 | - var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) { | |
| 461 | - var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version); | |
| 462 | - if (replacement) message += " - Use `".concat(replacement, "` instead"); | |
| 463 | - Console.warn(message); | |
| 464 | - }; | |
| 465 | - var Deprecation = /*#__PURE__*/ function() { | |
| 466 | - function Deprecation() { | |
| 467 | - _classCallCheck(this, Deprecation); | |
| 468 | - } | |
| 469 | - return _createClass(Deprecation, null, [ | |
| 470 | - { | |
| 471 | - key: "deprecated", | |
| 472 | - value: function deprecated(name, version, replacement) { | |
| 473 | - if (this.isHardDeprecated(version)) hardDeprecated(name, version, replacement); | |
| 474 | - else softDeprecated(name, version, replacement); | |
| 475 | - } | |
| 476 | - }, | |
| 477 | - { | |
| 478 | - key: "parseVersion", | |
| 479 | - value: function parseVersion(version) { | |
| 480 | - var versionParts = version.split("."); | |
| 481 | - if (versionParts.length < 3 || versionParts.length > 4) throw new RangeError("Invalid Semantic Version string provided"); | |
| 482 | - var _versionParts = _slicedToArray(versionParts, 4); | |
| 483 | - var major1 = _versionParts[0]; | |
| 484 | - var major2 = _versionParts[1]; | |
| 485 | - var minor = _versionParts[2]; | |
| 486 | - var _versionParts$ = _versionParts[3]; | |
| 487 | - return { | |
| 488 | - major1: parseInt(major1), | |
| 489 | - major2: parseInt(major2), | |
| 490 | - minor: parseInt(minor), | |
| 491 | - build: _versionParts$ === void 0 ? "" : _versionParts$ | |
| 492 | - }; | |
| 493 | - } | |
| 494 | - }, | |
| 495 | - { | |
| 496 | - key: "getTotalMajor", | |
| 497 | - value: function getTotalMajor(versionObj) { | |
| 498 | - var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0")); | |
| 499 | - total = Number((total / 10).toFixed(0)); | |
| 500 | - if (versionObj.major2 > 9) total = versionObj.major2 - 9; | |
| 501 | - return total; | |
| 502 | - } | |
| 503 | - }, | |
| 504 | - { | |
| 505 | - key: "compareVersion", | |
| 506 | - value: function compareVersion(version1, version2) { | |
| 507 | - var _this = this; | |
| 508 | - return [this.parseVersion(version1), this.parseVersion(version2)].map(function(versionObj) { | |
| 509 | - return _this.getTotalMajor(versionObj); | |
| 510 | - }).reduce(function(acc, major) { | |
| 511 | - return acc - major; | |
| 512 | - }); | |
| 513 | - } | |
| 514 | - }, | |
| 515 | - { | |
| 516 | - key: "isSoftDeprecated", | |
| 517 | - value: function isSoftDeprecated(version) { | |
| 518 | - return this.compareVersion(version, elementorWebCliConfig.version) <= 4; | |
| 519 | - } | |
| 520 | - }, | |
| 521 | - { | |
| 522 | - key: "isHardDeprecated", | |
| 523 | - value: function isHardDeprecated(version) { | |
| 524 | - var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 525 | - return total < 0 || total >= 8; | |
| 526 | - } | |
| 527 | - } | |
| 528 | - ]); | |
| 529 | - }(); | |
| 385 | + * Function debounce(). | |
| 386 | + * | |
| 387 | + * Will debounce every function you pass in, at the same debounce flow. | |
| 388 | + * | |
| 389 | + * @param {Function} | |
| 390 | + */ | |
| 391 | +(0, _defineProperty2.default)(CommandHistoryDebounceBase, "debounce", undefined); | |
| 530 | 392 | |
| 531 | -//#endregion | |
| 532 | -//#region modules/web-cli/assets/js/modules/command-infra.js | |
| 533 | - function _callSuper$5(t, o, e) { | |
| 534 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 535 | - } | |
| 536 | - __name(_callSuper$5, "_callSuper"); | |
| 537 | - function _isNativeReflectConstruct$5() { | |
| 538 | - try { | |
| 539 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 540 | - } catch (t) {} | |
| 541 | - return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() { | |
| 542 | - return !!t; | |
| 543 | - })(); | |
| 544 | - } | |
| 545 | - __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct"); | |
| 546 | - /** | |
| 547 | - * @typedef {import('../modules/component-base')} ComponentBase | |
| 548 | - */ | |
| 549 | - var CommandInfra = /*#__PURE__*/ function(_ArgsObject) { | |
| 550 | - /** | |
| 551 | - * Function constructor(). | |
| 552 | - * | |
| 553 | - * Create Commands Base. | |
| 554 | - * | |
| 555 | - * @param {{}} args | |
| 556 | - */ | |
| 557 | - function CommandInfra() { | |
| 558 | - var _this; | |
| 559 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 560 | - _classCallCheck(this, CommandInfra); | |
| 561 | - _this = _callSuper$5(this, CommandInfra, [args]); | |
| 562 | - if (!_this.constructor.registerConfig) throw RangeError("Doing it wrong: Each command type should have `registerConfig`."); | |
| 563 | - _this.command = _this.constructor.getCommand(); | |
| 564 | - _this.component = _this.constructor.getComponent(); | |
| 565 | - _this.initialize(args); | |
| 566 | - args = _this.args; | |
| 567 | - _this.validateArgs(args); | |
| 568 | - return _this; | |
| 569 | - } | |
| 570 | - /** | |
| 571 | - * Function initialize(). | |
| 572 | - * | |
| 573 | - * Initialize command, called after construction. | |
| 574 | - * | |
| 575 | - * @param {{}} args | |
| 576 | - */ | |
| 577 | - _inherits(CommandInfra, _ArgsObject); | |
| 578 | - return _createClass(CommandInfra, [ | |
| 579 | - { | |
| 580 | - key: "currentCommand", | |
| 581 | - get: function get() { | |
| 582 | - Deprecation.deprecated("this.currentCommand", "3.7.0", "this.command"); | |
| 583 | - return this.command; | |
| 584 | - } | |
| 585 | - }, | |
| 586 | - { | |
| 587 | - key: "initialize", | |
| 588 | - value: function initialize() { | |
| 589 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 590 | - } | |
| 591 | - }, | |
| 592 | - { | |
| 593 | - key: "validateArgs", | |
| 594 | - value: function validateArgs() { | |
| 595 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 596 | - } | |
| 597 | - }, | |
| 598 | - { | |
| 599 | - key: "apply", | |
| 600 | - value: function apply() { | |
| 601 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 602 | - elementorModules.ForceMethodImplementation(); | |
| 603 | - } | |
| 604 | - }, | |
| 605 | - { | |
| 606 | - key: "run", | |
| 607 | - value: function run() { | |
| 608 | - return this.apply(this.args); | |
| 609 | - } | |
| 610 | - }, | |
| 611 | - { | |
| 612 | - key: "onBeforeRun", | |
| 613 | - value: function onBeforeRun() { | |
| 614 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 615 | - } | |
| 616 | - }, | |
| 617 | - { | |
| 618 | - key: "onAfterRun", | |
| 619 | - value: function onAfterRun() { | |
| 620 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 621 | - arguments.length > 1 && arguments[1]; | |
| 622 | - } | |
| 623 | - }, | |
| 624 | - { | |
| 625 | - key: "onBeforeApply", | |
| 626 | - value: function onBeforeApply() { | |
| 627 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 628 | - } | |
| 629 | - }, | |
| 630 | - { | |
| 631 | - key: "onAfterApply", | |
| 632 | - value: function onAfterApply() { | |
| 633 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 634 | - arguments.length > 1 && arguments[1]; | |
| 635 | - } | |
| 636 | - }, | |
| 637 | - { | |
| 638 | - key: "onCatchApply", | |
| 639 | - value: function onCatchApply(e) {} | |
| 640 | - } | |
| 641 | - ], [ | |
| 642 | - { | |
| 643 | - key: "getInstanceType", | |
| 644 | - value: function getInstanceType() { | |
| 645 | - return "CommandInfra"; | |
| 646 | - } | |
| 647 | - }, | |
| 648 | - { | |
| 649 | - key: "getInfo", | |
| 650 | - value: function getInfo() { | |
| 651 | - return {}; | |
| 652 | - } | |
| 653 | - }, | |
| 654 | - { | |
| 655 | - key: "getCommand", | |
| 656 | - value: function getCommand() { | |
| 657 | - return this.registerConfig.command; | |
| 658 | - } | |
| 659 | - }, | |
| 660 | - { | |
| 661 | - key: "getComponent", | |
| 662 | - value: function getComponent() { | |
| 663 | - return this.registerConfig.component; | |
| 664 | - } | |
| 665 | - }, | |
| 666 | - { | |
| 667 | - key: "setRegisterConfig", | |
| 668 | - value: function setRegisterConfig(config) { | |
| 669 | - this.registerConfig = Object.freeze(config); | |
| 670 | - } | |
| 671 | - } | |
| 672 | - ]); | |
| 673 | - }(ArgsObject); | |
| 674 | - /** | |
| 675 | - * @type {Object} | |
| 676 | - */ | |
| 677 | - _defineProperty(CommandInfra, "registerConfig", null); | |
| 393 | +/***/ }), | |
| 678 | 394 | |
| 679 | -//#endregion | |
| 680 | -//#region modules/web-cli/assets/js/modules/command-base.js | |
| 681 | - function _callSuper$4(t, o, e) { | |
| 682 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 683 | - } | |
| 684 | - __name(_callSuper$4, "_callSuper"); | |
| 685 | - function _isNativeReflectConstruct$4() { | |
| 686 | - try { | |
| 687 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 688 | - } catch (t) {} | |
| 689 | - return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { | |
| 690 | - return !!t; | |
| 691 | - })(); | |
| 692 | - } | |
| 693 | - __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct"); | |
| 694 | - /** | |
| 695 | - * @name $e.modules.CommandBase | |
| 696 | - */ | |
| 697 | - var CommandBase = /*#__PURE__*/ function(_CommandInfra) { | |
| 698 | - function CommandBase() { | |
| 699 | - _classCallCheck(this, CommandBase); | |
| 700 | - return _callSuper$4(this, CommandBase, arguments); | |
| 701 | - } | |
| 702 | - _inherits(CommandBase, _CommandInfra); | |
| 703 | - return _createClass(CommandBase, [ | |
| 704 | - { | |
| 705 | - key: "onBeforeRun", | |
| 706 | - value: function onBeforeRun() { | |
| 707 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 708 | - $e.hooks.runUIBefore(this.command, args); | |
| 709 | - } | |
| 710 | - }, | |
| 711 | - { | |
| 712 | - key: "onAfterRun", | |
| 713 | - value: function onAfterRun() { | |
| 714 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 715 | - var result = arguments.length > 1 ? arguments[1] : void 0; | |
| 716 | - $e.hooks.runUIAfter(this.command, args, result); | |
| 717 | - } | |
| 718 | - }, | |
| 719 | - { | |
| 720 | - key: "onBeforeApply", | |
| 721 | - value: function onBeforeApply() { | |
| 722 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 723 | - $e.hooks.runDataDependency(this.command, args); | |
| 724 | - } | |
| 725 | - }, | |
| 726 | - { | |
| 727 | - key: "onAfterApply", | |
| 728 | - value: function onAfterApply() { | |
| 729 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 730 | - var result = arguments.length > 1 ? arguments[1] : void 0; | |
| 731 | - return $e.hooks.runDataAfter(this.command, args, result); | |
| 732 | - } | |
| 733 | - }, | |
| 734 | - { | |
| 735 | - key: "onCatchApply", | |
| 736 | - value: function onCatchApply(e) { | |
| 737 | - this.runCatchHooks(e); | |
| 738 | - } | |
| 739 | - }, | |
| 740 | - { | |
| 741 | - key: "runCatchHooks", | |
| 742 | - value: function runCatchHooks(e) { | |
| 743 | - $e.hooks.runDataCatch(this.command, this.args, e); | |
| 744 | - $e.hooks.runUICatch(this.command, this.args, e); | |
| 745 | - } | |
| 746 | - }, | |
| 747 | - { | |
| 748 | - key: "requireContainer", | |
| 749 | - value: function requireContainer() { | |
| 750 | - var _this = this; | |
| 751 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args; | |
| 752 | - Deprecation.deprecated("requireContainer()", "3.7.0", "Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`"); | |
| 753 | - if (!args.container && !args.containers) throw Error("container or containers are required."); | |
| 754 | - if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them."); | |
| 755 | - (args.containers || [args.container]).forEach(function(container) { | |
| 756 | - _this.requireArgumentInstance("container", elementorModules.editor.Container, { container }); | |
| 757 | - }); | |
| 758 | - } | |
| 759 | - } | |
| 760 | - ], [{ | |
| 761 | - key: "getInstanceType", | |
| 762 | - value: function getInstanceType() { | |
| 763 | - return "CommandBase"; | |
| 764 | - } | |
| 765 | - }]); | |
| 766 | - }(CommandInfra); | |
| 395 | +/***/ "../assets/dev/js/editor/utils/is-instanceof.js": | |
| 396 | +/*!******************************************************!*\ | |
| 397 | + !*** ../assets/dev/js/editor/utils/is-instanceof.js ***! | |
| 398 | + \******************************************************/ | |
| 399 | +/***/ ((__unused_webpack_module, exports) => { | |
| 767 | 400 | |
| 768 | -//#endregion | |
| 769 | -//#region assets/dev/js/editor/command-bases/command-container-base.js | |
| 770 | - function _callSuper$3(t, o, e) { | |
| 771 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 772 | - } | |
| 773 | - __name(_callSuper$3, "_callSuper"); | |
| 774 | - function _isNativeReflectConstruct$3() { | |
| 775 | - try { | |
| 776 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 777 | - } catch (t) {} | |
| 778 | - return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { | |
| 779 | - return !!t; | |
| 780 | - })(); | |
| 781 | - } | |
| 782 | - __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct"); | |
| 783 | - /** | |
| 784 | - * @name $e.modules.editor.CommandContainerBase | |
| 785 | - */ | |
| 786 | - var CommandContainerBase = /*#__PURE__*/ function(_CommandBase) { | |
| 787 | - function CommandContainerBase() { | |
| 788 | - _classCallCheck(this, CommandContainerBase); | |
| 789 | - return _callSuper$3(this, CommandContainerBase, arguments); | |
| 790 | - } | |
| 791 | - _inherits(CommandContainerBase, _CommandBase); | |
| 792 | - return _createClass(CommandContainerBase, [{ | |
| 793 | - key: "requireContainer", | |
| 794 | - value: function requireContainer() { | |
| 795 | - var _this = this; | |
| 796 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args; | |
| 797 | - if (!args.container && !args.containers) throw Error("container or containers are required."); | |
| 798 | - if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them."); | |
| 799 | - (args.containers || [args.container]).forEach(function(container) { | |
| 800 | - _this.requireArgumentInstance("container", elementorModules.editor.Container, { container }); | |
| 801 | - }); | |
| 802 | - } | |
| 803 | - }], [{ | |
| 804 | - key: "getInstanceType", | |
| 805 | - value: function getInstanceType() { | |
| 806 | - return "CommandContainerBase"; | |
| 807 | - } | |
| 808 | - }]); | |
| 809 | - }(CommandBase); | |
| 401 | +"use strict"; | |
| 810 | 402 | |
| 811 | -//#endregion | |
| 812 | -//#region assets/dev/js/editor/command-bases/command-container-internal-base.js | |
| 813 | - function _callSuper$2(t, o, e) { | |
| 814 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 815 | - } | |
| 816 | - __name(_callSuper$2, "_callSuper"); | |
| 817 | - function _isNativeReflectConstruct$2() { | |
| 818 | - try { | |
| 819 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 820 | - } catch (t) {} | |
| 821 | - return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { | |
| 822 | - return !!t; | |
| 823 | - })(); | |
| 824 | - } | |
| 825 | - __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct"); | |
| 826 | - /** | |
| 827 | - * @name $e.modules.editor.CommandContainerInternalBase | |
| 828 | - */ | |
| 829 | - var CommandContainerInternalBase = /*#__PURE__*/ function(_CommandContainerBase) { | |
| 830 | - function CommandContainerInternalBase(args) { | |
| 831 | - _classCallCheck(this, CommandContainerInternalBase); | |
| 832 | - return _callSuper$2(this, CommandContainerInternalBase, [args, $e.commandsInternal]); | |
| 833 | - } | |
| 834 | - _inherits(CommandContainerInternalBase, _CommandContainerBase); | |
| 835 | - return _createClass(CommandContainerInternalBase, null, [{ | |
| 836 | - key: "getInstanceType", | |
| 837 | - value: function getInstanceType() { | |
| 838 | - return "CommandContainerInternalBase"; | |
| 839 | - } | |
| 840 | - }]); | |
| 841 | - }(CommandContainerBase); | |
| 842 | 403 | |
| 843 | -//#endregion | |
| 844 | -//#region assets/dev/js/editor/document/command-bases/command-history-base.js | |
| 845 | - function _callSuper$1(t, o, e) { | |
| 846 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 847 | - } | |
| 848 | - __name(_callSuper$1, "_callSuper"); | |
| 849 | - function _isNativeReflectConstruct$1() { | |
| 850 | - try { | |
| 851 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 852 | - } catch (t) {} | |
| 853 | - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { | |
| 854 | - return !!t; | |
| 855 | - })(); | |
| 856 | - } | |
| 857 | - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); | |
| 858 | - function _superPropGet$1(t, o, e, r) { | |
| 859 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 860 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 861 | - return p.apply(e, t); | |
| 862 | - } : p; | |
| 863 | - } | |
| 864 | - __name(_superPropGet$1, "_superPropGet"); | |
| 865 | - /** | |
| 866 | - * @name $e.modules.editor.document.CommandHistoryBase | |
| 867 | - */ | |
| 868 | - var CommandHistoryBase = /*#__PURE__*/ function(_CommandContainerBase) { | |
| 869 | - function CommandHistoryBase() { | |
| 870 | - _classCallCheck(this, CommandHistoryBase); | |
| 871 | - return _callSuper$1(this, CommandHistoryBase, arguments); | |
| 872 | - } | |
| 873 | - _inherits(CommandHistoryBase, _CommandContainerBase); | |
| 874 | - return _createClass(CommandHistoryBase, [ | |
| 875 | - { | |
| 876 | - key: "initialize", | |
| 877 | - value: function initialize() { | |
| 878 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 879 | - var _args$options = args.options; | |
| 880 | - var _options$useHistory = (_args$options === void 0 ? {} : _args$options).useHistory; | |
| 881 | - if (_options$useHistory === void 0 ? true : _options$useHistory) { | |
| 882 | - /** | |
| 883 | - * Get History from child command. | |
| 884 | - * | |
| 885 | - * @type {{}|boolean} | |
| 886 | - */ | |
| 887 | - this.history = this.getHistory(args); | |
| 888 | - /** | |
| 889 | - * @type {number|boolean} | |
| 890 | - */ | |
| 891 | - this.historyId = false; | |
| 892 | - } | |
| 893 | - } | |
| 894 | - }, | |
| 895 | - { | |
| 896 | - key: "getHistory", | |
| 897 | - value: function getHistory() { | |
| 898 | - arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 899 | - elementorModules.ForceMethodImplementation(); | |
| 900 | - } | |
| 901 | - }, | |
| 902 | - { | |
| 903 | - key: "isHistoryActive", | |
| 904 | - value: function isHistoryActive() { | |
| 905 | - return elementor.documents.getCurrent().history.getActive(); | |
| 906 | - } | |
| 907 | - }, | |
| 908 | - { | |
| 909 | - key: "onBeforeRun", | |
| 910 | - value: function onBeforeRun(args) { | |
| 911 | - _superPropGet$1(CommandHistoryBase, "onBeforeRun", this, 3)([args]); | |
| 912 | - if (this.history && this.isHistoryActive()) this.historyId = $e.internal("document/history/start-log", this.history); | |
| 913 | - } | |
| 914 | - }, | |
| 915 | - { | |
| 916 | - key: "onAfterRun", | |
| 917 | - value: function onAfterRun(args, result) { | |
| 918 | - _superPropGet$1(CommandHistoryBase, "onAfterRun", this, 3)([args, result]); | |
| 919 | - if (this.history && this.isHistoryActive()) $e.internal("document/history/end-log", { id: this.historyId }); | |
| 920 | - } | |
| 921 | - }, | |
| 922 | - { | |
| 923 | - key: "onAfterApply", | |
| 924 | - value: function onAfterApply() { | |
| 925 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 926 | - var result = arguments.length > 1 ? arguments[1] : void 0; | |
| 927 | - _superPropGet$1(CommandHistoryBase, "onAfterApply", this, 3)([args, result]); | |
| 928 | - if (this.isDataChanged()) $e.internal("document/save/set-is-modified", { status: true }); | |
| 929 | - } | |
| 930 | - }, | |
| 931 | - { | |
| 932 | - key: "onCatchApply", | |
| 933 | - value: function onCatchApply(e) { | |
| 934 | - if (e instanceof $e.modules.HookBreak && this.historyId) $e.internal("document/history/delete-log", { id: this.historyId }); | |
| 935 | - _superPropGet$1(CommandHistoryBase, "onCatchApply", this, 3)([e]); | |
| 936 | - } | |
| 937 | - }, | |
| 938 | - { | |
| 939 | - key: "isDataChanged", | |
| 940 | - value: function isDataChanged() { | |
| 941 | - return true; | |
| 942 | - } | |
| 943 | - } | |
| 944 | - ], [{ | |
| 945 | - key: "getInstanceType", | |
| 946 | - value: function getInstanceType() { | |
| 947 | - return "CommandHistoryBase"; | |
| 948 | - } | |
| 949 | - }]); | |
| 950 | - }(CommandContainerBase); | |
| 404 | +Object.defineProperty(exports, "__esModule", ({ | |
| 405 | + value: true | |
| 406 | +})); | |
| 407 | +exports["default"] = void 0; | |
| 408 | +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | |
| 409 | +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); } | |
| 410 | +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; } | |
| 411 | +/** | |
| 412 | + * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved | |
| 413 | + * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can | |
| 414 | + * check whether it's instanceof by using the objects constructor and prototype names. | |
| 415 | + * | |
| 416 | + * @param object | |
| 417 | + * @param constructors | |
| 418 | + * @return {boolean} | |
| 419 | + */ | |
| 420 | +var _default = function _default(object, constructors) { | |
| 421 | + constructors = Array.isArray(constructors) ? constructors : [constructors]; | |
| 422 | + var _iterator = _createForOfIteratorHelper(constructors), | |
| 423 | + _step; | |
| 424 | + try { | |
| 425 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 426 | + var _constructor = _step.value; | |
| 427 | + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) { | |
| 428 | + return true; | |
| 429 | + } | |
| 430 | + } | |
| 431 | + } catch (err) { | |
| 432 | + _iterator.e(err); | |
| 433 | + } finally { | |
| 434 | + _iterator.f(); | |
| 435 | + } | |
| 436 | + return false; | |
| 437 | +}; | |
| 438 | +exports["default"] = _default; | |
| 951 | 439 | |
| 952 | -//#endregion | |
| 953 | -//#region assets/dev/js/editor/document/command-bases/command-history-debounce-base.js | |
| 954 | - function _callSuper(t, o, e) { | |
| 955 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 956 | - } | |
| 957 | - function _isNativeReflectConstruct() { | |
| 958 | - try { | |
| 959 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 960 | - } catch (t) {} | |
| 961 | - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { | |
| 962 | - return !!t; | |
| 963 | - })(); | |
| 964 | - } | |
| 965 | - function _superPropGet(t, o, e, r) { | |
| 966 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 967 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 968 | - return p.apply(e, t); | |
| 969 | - } : p; | |
| 970 | - } | |
| 971 | - var DEFAULT_DEBOUNCE_DELAY = 800; | |
| 972 | - /** | |
| 973 | - * Function getDefaultDebounceDelay(). | |
| 974 | - * | |
| 975 | - * Returns default debounce delay time, if exists in config override. | |
| 976 | - * | |
| 977 | - * @return {number} default debounce delay time | |
| 978 | - */ | |
| 979 | - var getDefaultDebounceDelay = function getDefaultDebounceDelay() { | |
| 980 | - var result = 800; | |
| 981 | - if (elementor.config.document && void 0 !== elementor.config.document.debounceDelay) result = elementor.config.document.debounceDelay; | |
| 982 | - return result; | |
| 983 | - }; | |
| 984 | - /** | |
| 985 | - * @name $e.modules.editor.document.CommandHistoryDebounceBase | |
| 986 | - */ | |
| 987 | - var CommandHistoryDebounceBase = /*#__PURE__*/ function(_CommandHistoryBase) { | |
| 988 | - function CommandHistoryDebounceBase() { | |
| 989 | - _classCallCheck(this, CommandHistoryDebounceBase); | |
| 990 | - return _callSuper(this, CommandHistoryDebounceBase, arguments); | |
| 991 | - } | |
| 992 | - _inherits(CommandHistoryDebounceBase, _CommandHistoryBase); | |
| 993 | - return _createClass(CommandHistoryDebounceBase, [ | |
| 994 | - { | |
| 995 | - key: "initialize", | |
| 996 | - value: function initialize(args) { | |
| 997 | - var _args$options = args.options; | |
| 998 | - var options = _args$options === void 0 ? {} : _args$options; | |
| 999 | - _superPropGet(CommandHistoryDebounceBase, "initialize", this, 3)([args]); | |
| 1000 | - if (!this.constructor.debounce) this.constructor.debounce = _.debounce(function(fn) { | |
| 1001 | - return fn(); | |
| 1002 | - }, getDefaultDebounceDelay()); | |
| 1003 | - if (1 === $e.commands.currentTrace.length || options.debounce) this.isDebounceRequired = true; | |
| 1004 | - } | |
| 1005 | - }, | |
| 1006 | - { | |
| 1007 | - key: "onBeforeRun", | |
| 1008 | - value: function onBeforeRun(args) { | |
| 1009 | - $e.modules.CommandBase.prototype.onBeforeRun.call(this, args); | |
| 1010 | - if (this.history && this.isHistoryActive()) $e.internal("document/history/add-transaction", this.history); | |
| 1011 | - } | |
| 1012 | - }, | |
| 1013 | - { | |
| 1014 | - key: "onAfterRun", | |
| 1015 | - value: function onAfterRun(args, result) { | |
| 1016 | - $e.modules.CommandBase.prototype.onAfterRun.call(this, args, result); | |
| 1017 | - if (this.isHistoryActive()) if (this.isDebounceRequired) this.constructor.debounce(function() { | |
| 1018 | - return $e.internal("document/history/end-transaction"); | |
| 1019 | - }); | |
| 1020 | - else $e.internal("document/history/end-transaction"); | |
| 1021 | - } | |
| 1022 | - }, | |
| 1023 | - { | |
| 1024 | - key: "onCatchApply", | |
| 1025 | - value: function onCatchApply(e) { | |
| 1026 | - $e.modules.CommandBase.prototype.onCatchApply.call(this, e); | |
| 1027 | - if (e instanceof $e.modules.HookBreak && this.history) if (this.isDebounceRequired) this.constructor.debounce(function() { | |
| 1028 | - return $e.internal("document/history/clear-transaction"); | |
| 1029 | - }); | |
| 1030 | - else $e.internal("document/history/clear-transaction"); | |
| 1031 | - } | |
| 1032 | - } | |
| 1033 | - ], [{ | |
| 1034 | - key: "getInstanceType", | |
| 1035 | - value: function getInstanceType() { | |
| 1036 | - return "CommandHistoryDebounceBase"; | |
| 1037 | - } | |
| 1038 | - }]); | |
| 1039 | - }(CommandHistoryBase); | |
| 1040 | - /** | |
| 1041 | - * Function debounce(). | |
| 1042 | - * | |
| 1043 | - * Will debounce every function you pass in, at the same debounce flow. | |
| 1044 | - * | |
| 1045 | - * @param {Function} | |
| 1046 | - */ | |
| 1047 | - _defineProperty(CommandHistoryDebounceBase, "debounce", void 0); | |
| 440 | +/***/ }), | |
| 1048 | 441 | |
| 1049 | -//#endregion | |
| 1050 | -//#region assets/dev/js/editor/editor-document.js | |
| 1051 | - $e.modules.editor = { | |
| 1052 | - CommandContainerBase, | |
| 1053 | - CommandContainerInternalBase, | |
| 1054 | - document: { | |
| 1055 | - CommandHistoryBase, | |
| 1056 | - CommandHistoryDebounceBase | |
| 1057 | - } | |
| 1058 | - }; | |
| 1059 | - $e.modules.document = { | |
| 1060 | - /** | |
| 1061 | - * @deprecated since 3.7.0, use `$e.modules.editor.document.CommandHistoryBase` instead. | |
| 1062 | - */ | |
| 1063 | - get CommandHistory() { | |
| 1064 | - elementorDevTools.deprecation.deprecated("$e.modules.document.CommandHistory", "3.7.0", "$e.modules.editor.document.CommandHistoryBase"); | |
| 1065 | - return $e.modules.editor.document.CommandHistoryBase; | |
| 1066 | - }, | |
| 1067 | - /** | |
| 1068 | - * @deprecated since 3.7.0, use `$e.modules.editor.document.CommandHistoryDebounceBase` instead. | |
| 1069 | - */ | |
| 1070 | - get CommandHistoryDebounce() { | |
| 1071 | - elementorDevTools.deprecation.deprecated("$e.modules.CommandHistoryDebounce", "3.7.0", "$e.modules.editor.document.CommandHistoryDebounceBase"); | |
| 1072 | - return $e.modules.editor.document.CommandHistoryDebounceBase; | |
| 1073 | - } | |
| 1074 | - }; | |
| 442 | +/***/ "../assets/dev/js/modules/imports/args-object.js": | |
| 443 | +/*!*******************************************************!*\ | |
| 444 | + !*** ../assets/dev/js/modules/imports/args-object.js ***! | |
| 445 | + \*******************************************************/ | |
| 446 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1075 | 447 | |
| 1076 | -//#endregion | |
| 448 | +"use strict"; | |
| 449 | + | |
| 450 | + | |
| 451 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 452 | +Object.defineProperty(exports, "__esModule", ({ | |
| 453 | + value: true | |
| 454 | +})); | |
| 455 | +exports["default"] = void 0; | |
| 456 | +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 457 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 458 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 459 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 460 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 461 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 462 | +var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js")); | |
| 463 | +var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js")); | |
| 464 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 465 | +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; } } | |
| 466 | +var ArgsObject = /*#__PURE__*/function (_InstanceType) { | |
| 467 | + (0, _inherits2.default)(ArgsObject, _InstanceType); | |
| 468 | + var _super = _createSuper(ArgsObject); | |
| 469 | + /** | |
| 470 | + * Function constructor(). | |
| 471 | + * | |
| 472 | + * Create ArgsObject. | |
| 473 | + * | |
| 474 | + * @param {{}} args | |
| 475 | + */ | |
| 476 | + function ArgsObject(args) { | |
| 477 | + var _this; | |
| 478 | + (0, _classCallCheck2.default)(this, ArgsObject); | |
| 479 | + _this = _super.call(this); | |
| 480 | + _this.args = args; | |
| 481 | + return _this; | |
| 482 | + } | |
| 483 | + | |
| 484 | + /** | |
| 485 | + * Function requireArgument(). | |
| 486 | + * | |
| 487 | + * Validate property in args. | |
| 488 | + * | |
| 489 | + * @param {string} property | |
| 490 | + * @param {{}} args | |
| 491 | + * | |
| 492 | + * @throws {Error} | |
| 493 | + * | |
| 494 | + */ | |
| 495 | + (0, _createClass2.default)(ArgsObject, [{ | |
| 496 | + key: "requireArgument", | |
| 497 | + value: function requireArgument(property) { | |
| 498 | + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args; | |
| 499 | + if (!Object.prototype.hasOwnProperty.call(args, property)) { | |
| 500 | + throw Error("".concat(property, " is required.")); | |
| 501 | + } | |
| 502 | + } | |
| 503 | + | |
| 504 | + /** | |
| 505 | + * Function requireArgumentType(). | |
| 506 | + * | |
| 507 | + * Validate property in args using `type === typeof(args.whatever)`. | |
| 508 | + * | |
| 509 | + * @param {string} property | |
| 510 | + * @param {string} type | |
| 511 | + * @param {{}} args | |
| 512 | + * | |
| 513 | + * @throws {Error} | |
| 514 | + * | |
| 515 | + */ | |
| 516 | + }, { | |
| 517 | + key: "requireArgumentType", | |
| 518 | + value: function requireArgumentType(property, type) { | |
| 519 | + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; | |
| 520 | + this.requireArgument(property, args); | |
| 521 | + if ((0, _typeof2.default)(args[property]) !== type) { | |
| 522 | + throw Error("".concat(property, " invalid type: ").concat(type, ".")); | |
| 523 | + } | |
| 524 | + } | |
| 525 | + | |
| 526 | + /** | |
| 527 | + * Function requireArgumentInstance(). | |
| 528 | + * | |
| 529 | + * Validate property in args using `args.whatever instanceof instance`. | |
| 530 | + * | |
| 531 | + * @param {string} property | |
| 532 | + * @param {*} instance | |
| 533 | + * @param {{}} args | |
| 534 | + * | |
| 535 | + * @throws {Error} | |
| 536 | + * | |
| 537 | + */ | |
| 538 | + }, { | |
| 539 | + key: "requireArgumentInstance", | |
| 540 | + value: function requireArgumentInstance(property, instance) { | |
| 541 | + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; | |
| 542 | + this.requireArgument(property, args); | |
| 543 | + if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) { | |
| 544 | + throw Error("".concat(property, " invalid instance.")); | |
| 545 | + } | |
| 546 | + } | |
| 547 | + | |
| 548 | + /** | |
| 549 | + * Function requireArgumentConstructor(). | |
| 550 | + * | |
| 551 | + * Validate property in args using `type === args.whatever.constructor`. | |
| 552 | + * | |
| 553 | + * @param {string} property | |
| 554 | + * @param {*} type | |
| 555 | + * @param {{}} args | |
| 556 | + * | |
| 557 | + * @throws {Error} | |
| 558 | + * | |
| 559 | + */ | |
| 560 | + }, { | |
| 561 | + key: "requireArgumentConstructor", | |
| 562 | + value: function requireArgumentConstructor(property, type) { | |
| 563 | + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; | |
| 564 | + this.requireArgument(property, args); | |
| 565 | + | |
| 566 | + // Note: Converting the constructor to string in order to avoid equation issues | |
| 567 | + // due to different memory addresses between iframes (window.Object !== window.top.Object). | |
| 568 | + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) { | |
| 569 | + throw Error("".concat(property, " invalid constructor type.")); | |
| 570 | + } | |
| 571 | + } | |
| 572 | + }], [{ | |
| 573 | + key: "getInstanceType", | |
| 574 | + value: function getInstanceType() { | |
| 575 | + return 'ArgsObject'; | |
| 576 | + } | |
| 577 | + }]); | |
| 578 | + return ArgsObject; | |
| 579 | +}(_instanceType.default); | |
| 580 | +exports["default"] = ArgsObject; | |
| 581 | + | |
| 582 | +/***/ }), | |
| 583 | + | |
| 584 | +/***/ "../assets/dev/js/modules/imports/instance-type.js": | |
| 585 | +/*!*********************************************************!*\ | |
| 586 | + !*** ../assets/dev/js/modules/imports/instance-type.js ***! | |
| 587 | + \*********************************************************/ | |
| 588 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 589 | + | |
| 590 | +"use strict"; | |
| 591 | + | |
| 592 | + | |
| 593 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 594 | +Object.defineProperty(exports, "__esModule", ({ | |
| 595 | + value: true | |
| 596 | +})); | |
| 597 | +exports["default"] = void 0; | |
| 598 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 599 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 600 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 601 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 602 | +var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) { | |
| 603 | + function InstanceType() { | |
| 604 | + var _this = this; | |
| 605 | + (0, _classCallCheck2.default)(this, InstanceType); | |
| 606 | + // Since anonymous classes sometimes do not get validated by babel, do it manually. | |
| 607 | + var target = this instanceof InstanceType ? this.constructor : void 0; | |
| 608 | + var prototypes = []; | |
| 609 | + while (target.__proto__ && target.__proto__.name) { | |
| 610 | + prototypes.push(target.__proto__); | |
| 611 | + target = target.__proto__; | |
| 612 | + } | |
| 613 | + prototypes.reverse().forEach(function (proto) { | |
| 614 | + return _this instanceof proto; | |
| 615 | + }); | |
| 616 | + } | |
| 617 | + (0, _createClass2.default)(InstanceType, null, [{ | |
| 618 | + key: _Symbol$hasInstance, | |
| 619 | + value: function value(target) { | |
| 620 | + /** | |
| 621 | + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class | |
| 622 | + * its give's opportunity to mange capabilities of instanceOf operator. | |
| 623 | + * saving current class each time will give option later to handle instanceOf manually. | |
| 624 | + */ | |
| 625 | + var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target); | |
| 626 | + | |
| 627 | + // Act normal when validate a class, which does not have instance type. | |
| 628 | + if (target && !target.constructor.getInstanceType) { | |
| 629 | + return result; | |
| 630 | + } | |
| 631 | + if (target) { | |
| 632 | + if (!target.instanceTypes) { | |
| 633 | + target.instanceTypes = []; | |
| 634 | + } | |
| 635 | + if (!result) { | |
| 636 | + if (this.getInstanceType() === target.constructor.getInstanceType()) { | |
| 637 | + result = true; | |
| 638 | + } | |
| 639 | + } | |
| 640 | + if (result) { | |
| 641 | + var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType(); | |
| 642 | + if (-1 === target.instanceTypes.indexOf(name)) { | |
| 643 | + target.instanceTypes.push(name); | |
| 644 | + } | |
| 645 | + } | |
| 646 | + } | |
| 647 | + if (!result && target) { | |
| 648 | + // Check if the given 'target', is instance of known types. | |
| 649 | + result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType()); | |
| 650 | + } | |
| 651 | + return result; | |
| 652 | + } | |
| 653 | + }, { | |
| 654 | + key: "getInstanceType", | |
| 655 | + value: function getInstanceType() { | |
| 656 | + elementorModules.ForceMethodImplementation(); | |
| 657 | + } | |
| 658 | + }]); | |
| 659 | + return InstanceType; | |
| 660 | +}(Symbol.hasInstance); | |
| 661 | +exports["default"] = InstanceType; | |
| 662 | + | |
| 663 | +/***/ }), | |
| 664 | + | |
| 665 | +/***/ "../modules/web-cli/assets/js/modules/command-base.js": | |
| 666 | +/*!************************************************************!*\ | |
| 667 | + !*** ../modules/web-cli/assets/js/modules/command-base.js ***! | |
| 668 | + \************************************************************/ | |
| 669 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 670 | + | |
| 671 | +"use strict"; | |
| 672 | + | |
| 673 | + | |
| 674 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 675 | +Object.defineProperty(exports, "__esModule", ({ | |
| 676 | + value: true | |
| 677 | +})); | |
| 678 | +exports["default"] = void 0; | |
| 679 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 680 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 681 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 682 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 683 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 684 | +var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js")); | |
| 685 | +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 686 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 687 | +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; } } | |
| 688 | +/** | |
| 689 | + * @name $e.modules.CommandBase | |
| 690 | + */ | |
| 691 | +var CommandBase = /*#__PURE__*/function (_CommandInfra) { | |
| 692 | + (0, _inherits2.default)(CommandBase, _CommandInfra); | |
| 693 | + var _super = _createSuper(CommandBase); | |
| 694 | + function CommandBase() { | |
| 695 | + (0, _classCallCheck2.default)(this, CommandBase); | |
| 696 | + return _super.apply(this, arguments); | |
| 697 | + } | |
| 698 | + (0, _createClass2.default)(CommandBase, [{ | |
| 699 | + key: "onBeforeRun", | |
| 700 | + value: function onBeforeRun() { | |
| 701 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 702 | + $e.hooks.runUIBefore(this.command, args); | |
| 703 | + } | |
| 704 | + }, { | |
| 705 | + key: "onAfterRun", | |
| 706 | + value: function onAfterRun() { | |
| 707 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 708 | + var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 709 | + $e.hooks.runUIAfter(this.command, args, result); | |
| 710 | + } | |
| 711 | + }, { | |
| 712 | + key: "onBeforeApply", | |
| 713 | + value: function onBeforeApply() { | |
| 714 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 715 | + $e.hooks.runDataDependency(this.command, args); | |
| 716 | + } | |
| 717 | + }, { | |
| 718 | + key: "onAfterApply", | |
| 719 | + value: function onAfterApply() { | |
| 720 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 721 | + var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 722 | + $e.hooks.runDataAfter(this.command, args, result); | |
| 723 | + } | |
| 724 | + }, { | |
| 725 | + key: "onCatchApply", | |
| 726 | + value: function onCatchApply(e) { | |
| 727 | + this.runCatchHooks(e); | |
| 728 | + } | |
| 729 | + | |
| 730 | + /** | |
| 731 | + * Run all the catch hooks. | |
| 732 | + * | |
| 733 | + * @param {Error} e | |
| 734 | + */ | |
| 735 | + }, { | |
| 736 | + key: "runCatchHooks", | |
| 737 | + value: function runCatchHooks(e) { | |
| 738 | + $e.hooks.runDataCatch(this.command, this.args, e); | |
| 739 | + $e.hooks.runUICatch(this.command, this.args, e); | |
| 740 | + } | |
| 741 | + | |
| 742 | + /** | |
| 743 | + * TODO - Remove - Backwards compatibility. | |
| 744 | + * | |
| 745 | + * Function requireContainer(). | |
| 746 | + * | |
| 747 | + * Validate `arg.container` & `arg.containers`. | |
| 748 | + * | |
| 749 | + * @param {{}} args | |
| 750 | + * | |
| 751 | + * @throws {Error} | |
| 752 | + */ | |
| 753 | + }, { | |
| 754 | + key: "requireContainer", | |
| 755 | + value: function requireContainer() { | |
| 756 | + var _this = this; | |
| 757 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args; | |
| 758 | + _deprecation.default.deprecated('requireContainer', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`'); | |
| 759 | + if (!args.container && !args.containers) { | |
| 760 | + throw Error('container or containers are required.'); | |
| 761 | + } | |
| 762 | + if (args.container && args.containers) { | |
| 763 | + throw Error('container and containers cannot go together please select one of them.'); | |
| 764 | + } | |
| 765 | + var containers = args.containers || [args.container]; | |
| 766 | + containers.forEach(function (container) { | |
| 767 | + _this.requireArgumentInstance('container', elementorModules.editor.Container, { | |
| 768 | + container: container | |
| 769 | + }); | |
| 770 | + }); | |
| 771 | + } | |
| 772 | + }], [{ | |
| 773 | + key: "getInstanceType", | |
| 774 | + value: function getInstanceType() { | |
| 775 | + return 'CommandBase'; | |
| 776 | + } | |
| 777 | + }]); | |
| 778 | + return CommandBase; | |
| 779 | +}(_commandInfra.default); | |
| 780 | +exports["default"] = CommandBase; | |
| 781 | + | |
| 782 | +/***/ }), | |
| 783 | + | |
| 784 | +/***/ "../modules/web-cli/assets/js/modules/command-infra.js": | |
| 785 | +/*!*************************************************************!*\ | |
| 786 | + !*** ../modules/web-cli/assets/js/modules/command-infra.js ***! | |
| 787 | + \*************************************************************/ | |
| 788 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 789 | + | |
| 790 | +"use strict"; | |
| 791 | + | |
| 792 | + | |
| 793 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 794 | +Object.defineProperty(exports, "__esModule", ({ | |
| 795 | + value: true | |
| 796 | +})); | |
| 797 | +exports["default"] = void 0; | |
| 798 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 799 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 800 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 801 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 802 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 803 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 804 | +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js")); | |
| 805 | +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 806 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 807 | +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; } } | |
| 808 | +/** | |
| 809 | + * @typedef {import('../modules/component-base')} ComponentBase | |
| 810 | + */ | |
| 811 | +var CommandInfra = /*#__PURE__*/function (_ArgsObject) { | |
| 812 | + (0, _inherits2.default)(CommandInfra, _ArgsObject); | |
| 813 | + var _super = _createSuper(CommandInfra); | |
| 814 | + /** | |
| 815 | + * Function constructor(). | |
| 816 | + * | |
| 817 | + * Create Commands Base. | |
| 818 | + * | |
| 819 | + * @param {{}} args | |
| 820 | + */ | |
| 821 | + function CommandInfra() { | |
| 822 | + var _this; | |
| 823 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 824 | + (0, _classCallCheck2.default)(this, CommandInfra); | |
| 825 | + _this = _super.call(this, args); | |
| 826 | + if (!_this.constructor.registerConfig) { | |
| 827 | + throw RangeError('Doing it wrong: Each command type should have `registerConfig`.'); | |
| 828 | + } | |
| 829 | + | |
| 830 | + // Acknowledge self about which command it run. | |
| 831 | + _this.command = _this.constructor.getCommand(); | |
| 832 | + | |
| 833 | + // Assign instance of current component. | |
| 834 | + _this.component = _this.constructor.getComponent(); | |
| 835 | + | |
| 836 | + // Who ever need do something before without `super` the constructor can use `initialize` method. | |
| 837 | + _this.initialize(args); | |
| 838 | + | |
| 839 | + // Refresh args, maybe the changed via `initialize`. | |
| 840 | + args = _this.args; | |
| 841 | + | |
| 842 | + // Validate args before run. | |
| 843 | + _this.validateArgs(args); | |
| 844 | + return _this; | |
| 845 | + } | |
| 846 | + | |
| 847 | + /** | |
| 848 | + * Function initialize(). | |
| 849 | + * | |
| 850 | + * Initialize command, called after construction. | |
| 851 | + * | |
| 852 | + * @param {{}} args | |
| 853 | + */ | |
| 854 | + (0, _createClass2.default)(CommandInfra, [{ | |
| 855 | + key: "currentCommand", | |
| 856 | + get: | |
| 857 | + // TODO - Remove backwards compatibility. | |
| 858 | + function get() { | |
| 859 | + _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command'); | |
| 860 | + return this.command; | |
| 861 | + } | |
| 862 | + }, { | |
| 863 | + key: "initialize", | |
| 864 | + value: function initialize() { | |
| 865 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 866 | + } // eslint-disable-line no-unused-vars | |
| 867 | + | |
| 868 | + /** | |
| 869 | + * Function validateArgs(). | |
| 870 | + * | |
| 871 | + * Validate command arguments. | |
| 872 | + * | |
| 873 | + * @param {{}} args | |
| 874 | + */ | |
| 875 | + }, { | |
| 876 | + key: "validateArgs", | |
| 877 | + value: function validateArgs() { | |
| 878 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 879 | + } // eslint-disable-line no-unused-vars | |
| 880 | + | |
| 881 | + // eslint-disable-next-line jsdoc/require-returns-check | |
| 882 | + /** | |
| 883 | + * Function apply(). | |
| 884 | + * | |
| 885 | + * Do the actual command. | |
| 886 | + * | |
| 887 | + * @param {{}} args | |
| 888 | + * | |
| 889 | + * @return {*} Command results. | |
| 890 | + */ | |
| 891 | + }, { | |
| 892 | + key: "apply", | |
| 893 | + value: function apply() { | |
| 894 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 895 | + // eslint-disable-line no-unused-vars | |
| 896 | + elementorModules.ForceMethodImplementation(); | |
| 897 | + } | |
| 898 | + | |
| 899 | + /** | |
| 900 | + * Function run(). | |
| 901 | + * | |
| 902 | + * Run command with history & hooks. | |
| 903 | + * | |
| 904 | + * @return {*} Command results. | |
| 905 | + */ | |
| 906 | + }, { | |
| 907 | + key: "run", | |
| 908 | + value: function run() { | |
| 909 | + return this.apply(this.args); | |
| 910 | + } | |
| 911 | + | |
| 912 | + /** | |
| 913 | + * Function onBeforeRun. | |
| 914 | + * | |
| 915 | + * Called before run(). | |
| 916 | + * | |
| 917 | + * @param {{}} args | |
| 918 | + */ | |
| 919 | + }, { | |
| 920 | + key: "onBeforeRun", | |
| 921 | + value: function onBeforeRun() { | |
| 922 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 923 | + } // eslint-disable-line no-unused-vars | |
| 924 | + | |
| 925 | + /** | |
| 926 | + * Function onAfterRun. | |
| 927 | + * | |
| 928 | + * Called after run(). | |
| 929 | + * | |
| 930 | + * @param {{}} args | |
| 931 | + * @param {*} result | |
| 932 | + */ | |
| 933 | + }, { | |
| 934 | + key: "onAfterRun", | |
| 935 | + value: function onAfterRun() { | |
| 936 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 937 | + var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 938 | + } // eslint-disable-line no-unused-vars | |
| 939 | + | |
| 940 | + /** | |
| 941 | + * Function onBeforeApply. | |
| 942 | + * | |
| 943 | + * Called before apply(). | |
| 944 | + * | |
| 945 | + * @param {{}} args | |
| 946 | + */ | |
| 947 | + }, { | |
| 948 | + key: "onBeforeApply", | |
| 949 | + value: function onBeforeApply() { | |
| 950 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 951 | + } // eslint-disable-line no-unused-vars | |
| 952 | + | |
| 953 | + /** | |
| 954 | + * Function onAfterApply. | |
| 955 | + * | |
| 956 | + * Called after apply(). | |
| 957 | + * | |
| 958 | + * @param {{}} args | |
| 959 | + * @param {*} result | |
| 960 | + */ | |
| 961 | + }, { | |
| 962 | + key: "onAfterApply", | |
| 963 | + value: function onAfterApply() { | |
| 964 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 965 | + var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 966 | + } // eslint-disable-line no-unused-vars | |
| 967 | + | |
| 968 | + /** | |
| 969 | + * Function onCatchApply. | |
| 970 | + * | |
| 971 | + * Called after apply() failed. | |
| 972 | + * | |
| 973 | + * @param {Error} e | |
| 974 | + */ | |
| 975 | + }, { | |
| 976 | + key: "onCatchApply", | |
| 977 | + value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars | |
| 978 | + }], [{ | |
| 979 | + key: "getInstanceType", | |
| 980 | + value: function getInstanceType() { | |
| 981 | + return 'CommandInfra'; | |
| 982 | + } | |
| 983 | + | |
| 984 | + /** | |
| 985 | + * Get info of command. | |
| 986 | + * | |
| 987 | + * @return {Object} Extra information about the command. | |
| 988 | + */ | |
| 989 | + }, { | |
| 990 | + key: "getInfo", | |
| 991 | + value: function getInfo() { | |
| 992 | + return {}; | |
| 993 | + } | |
| 994 | + | |
| 995 | + /** | |
| 996 | + * @return {string} Self command name. | |
| 997 | + */ | |
| 998 | + }, { | |
| 999 | + key: "getCommand", | |
| 1000 | + value: function getCommand() { | |
| 1001 | + return this.registerConfig.command; | |
| 1002 | + } | |
| 1003 | + | |
| 1004 | + /** | |
| 1005 | + * @return {ComponentBase} Self component | |
| 1006 | + */ | |
| 1007 | + }, { | |
| 1008 | + key: "getComponent", | |
| 1009 | + value: function getComponent() { | |
| 1010 | + return this.registerConfig.component; | |
| 1011 | + } | |
| 1012 | + }, { | |
| 1013 | + key: "setRegisterConfig", | |
| 1014 | + value: function setRegisterConfig(config) { | |
| 1015 | + this.registerConfig = Object.freeze(config); | |
| 1016 | + } | |
| 1017 | + }]); | |
| 1018 | + return CommandInfra; | |
| 1019 | +}(_argsObject.default); | |
| 1020 | +exports["default"] = CommandInfra; | |
| 1021 | +/** | |
| 1022 | + * @type {Object} | |
| 1023 | + */ | |
| 1024 | +(0, _defineProperty2.default)(CommandInfra, "registerConfig", null); | |
| 1025 | + | |
| 1026 | +/***/ }), | |
| 1027 | + | |
| 1028 | +/***/ "../modules/web-cli/assets/js/utils/console.js": | |
| 1029 | +/*!*****************************************************!*\ | |
| 1030 | + !*** ../modules/web-cli/assets/js/utils/console.js ***! | |
| 1031 | + \*****************************************************/ | |
| 1032 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1033 | + | |
| 1034 | +"use strict"; | |
| 1035 | + | |
| 1036 | + | |
| 1037 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1038 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1039 | + value: true | |
| 1040 | +})); | |
| 1041 | +exports["default"] = void 0; | |
| 1042 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1043 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1044 | +var Console = /*#__PURE__*/function () { | |
| 1045 | + function Console() { | |
| 1046 | + (0, _classCallCheck2.default)(this, Console); | |
| 1047 | + } | |
| 1048 | + (0, _createClass2.default)(Console, null, [{ | |
| 1049 | + key: "error", | |
| 1050 | + value: function error(message) { | |
| 1051 | + // Show an error if devTools is available. | |
| 1052 | + if ($e.devTools) { | |
| 1053 | + $e.devTools.log.error(message); | |
| 1054 | + } | |
| 1055 | + | |
| 1056 | + // If not a 'Hook-Break' then show error. | |
| 1057 | + if (!(message instanceof $e.modules.HookBreak)) { | |
| 1058 | + // eslint-disable-next-line no-console | |
| 1059 | + console.error(message); | |
| 1060 | + } | |
| 1061 | + } | |
| 1062 | + }, { | |
| 1063 | + key: "warn", | |
| 1064 | + value: function warn() { | |
| 1065 | + var _console; | |
| 1066 | + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;"); | |
| 1067 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 1068 | + args[_key] = arguments[_key]; | |
| 1069 | + } | |
| 1070 | + args.unshift('%c %c', style, ''); | |
| 1071 | + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console | |
| 1072 | + } | |
| 1073 | + }]); | |
| 1074 | + return Console; | |
| 1075 | +}(); | |
| 1076 | +exports["default"] = Console; | |
| 1077 | + | |
| 1078 | +/***/ }), | |
| 1079 | + | |
| 1080 | +/***/ "../modules/web-cli/assets/js/utils/deprecation.js": | |
| 1081 | +/*!*********************************************************!*\ | |
| 1082 | + !*** ../modules/web-cli/assets/js/utils/deprecation.js ***! | |
| 1083 | + \*********************************************************/ | |
| 1084 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1085 | + | |
| 1086 | +"use strict"; | |
| 1087 | + | |
| 1088 | + | |
| 1089 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1090 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1091 | + value: true | |
| 1092 | +})); | |
| 1093 | +exports["default"] = void 0; | |
| 1094 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1095 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1096 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1097 | +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 1098 | +// Copied from `modules/dev-tools/assets/js/deprecation.js` | |
| 1099 | +/** | |
| 1100 | + * @typedef {Object} Version | |
| 1101 | + * @property {number} major1 The first number | |
| 1102 | + * @property {number} major2 The second number | |
| 1103 | + * @property {number} minor The third number | |
| 1104 | + * @property {string} build The fourth number | |
| 1105 | + */ | |
| 1106 | +var softDeprecated = function softDeprecated(name, version, replacement) { | |
| 1107 | + if (elementorWebCliConfig.isDebug) { | |
| 1108 | + deprecatedMessage('soft', name, version, replacement); | |
| 1109 | + } | |
| 1110 | +}; | |
| 1111 | +var hardDeprecated = function hardDeprecated(name, version, replacement) { | |
| 1112 | + deprecatedMessage('hard', name, version, replacement); | |
| 1113 | +}; | |
| 1114 | +var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) { | |
| 1115 | + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version); | |
| 1116 | + if (replacement) { | |
| 1117 | + message += " - Use `".concat(replacement, "` instead"); | |
| 1118 | + } | |
| 1119 | + _console.default.warn(message); | |
| 1120 | +}; | |
| 1121 | +var Deprecation = /*#__PURE__*/function () { | |
| 1122 | + function Deprecation() { | |
| 1123 | + (0, _classCallCheck2.default)(this, Deprecation); | |
| 1124 | + } | |
| 1125 | + (0, _createClass2.default)(Deprecation, null, [{ | |
| 1126 | + key: "deprecated", | |
| 1127 | + value: function deprecated(name, version, replacement) { | |
| 1128 | + if (this.isHardDeprecated(version)) { | |
| 1129 | + hardDeprecated(name, version, replacement); | |
| 1130 | + } else { | |
| 1131 | + softDeprecated(name, version, replacement); | |
| 1132 | + } | |
| 1133 | + } | |
| 1134 | + | |
| 1135 | + /** | |
| 1136 | + * @param {string} version | |
| 1137 | + * | |
| 1138 | + * @return {Version} | |
| 1139 | + */ | |
| 1140 | + }, { | |
| 1141 | + key: "parseVersion", | |
| 1142 | + value: function parseVersion(version) { | |
| 1143 | + var versionParts = version.split('.'); | |
| 1144 | + if (versionParts.length < 3 || versionParts.length > 4) { | |
| 1145 | + throw new RangeError('Invalid Semantic Version string provided'); | |
| 1146 | + } | |
| 1147 | + var _versionParts = (0, _slicedToArray2.default)(versionParts, 4), | |
| 1148 | + major1 = _versionParts[0], | |
| 1149 | + major2 = _versionParts[1], | |
| 1150 | + minor = _versionParts[2], | |
| 1151 | + _versionParts$ = _versionParts[3], | |
| 1152 | + build = _versionParts$ === void 0 ? '' : _versionParts$; | |
| 1153 | + return { | |
| 1154 | + major1: parseInt(major1), | |
| 1155 | + major2: parseInt(major2), | |
| 1156 | + minor: parseInt(minor), | |
| 1157 | + build: build | |
| 1158 | + }; | |
| 1159 | + } | |
| 1160 | + | |
| 1161 | + /** | |
| 1162 | + * Get total of major. | |
| 1163 | + * | |
| 1164 | + * Since `get_total_major` cannot determine how much really versions between 2.9.0 and 3.3.0 if there is 2.10.0 version for example, | |
| 1165 | + * versions with major2 more then 9 will be added to total. | |
| 1166 | + * | |
| 1167 | + * @param {Version} versionObj | |
| 1168 | + * | |
| 1169 | + * @return {number} | |
| 1170 | + */ | |
| 1171 | + }, { | |
| 1172 | + key: "getTotalMajor", | |
| 1173 | + value: function getTotalMajor(versionObj) { | |
| 1174 | + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0")); | |
| 1175 | + total = Number((total / 10).toFixed(0)); | |
| 1176 | + if (versionObj.major2 > 9) { | |
| 1177 | + total = versionObj.major2 - 9; | |
| 1178 | + } | |
| 1179 | + return total; | |
| 1180 | + } | |
| 1181 | + | |
| 1182 | + /** | |
| 1183 | + * @param {string} version1 | |
| 1184 | + * @param {string} version2 | |
| 1185 | + * | |
| 1186 | + * @return {number} | |
| 1187 | + */ | |
| 1188 | + }, { | |
| 1189 | + key: "compareVersion", | |
| 1190 | + value: function compareVersion(version1, version2) { | |
| 1191 | + var _this = this; | |
| 1192 | + return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) { | |
| 1193 | + return _this.getTotalMajor(versionObj); | |
| 1194 | + }).reduce(function (acc, major) { | |
| 1195 | + return acc - major; | |
| 1196 | + }); | |
| 1197 | + } | |
| 1198 | + | |
| 1199 | + /** | |
| 1200 | + * @param {string} version | |
| 1201 | + * | |
| 1202 | + * @return {boolean} | |
| 1203 | + */ | |
| 1204 | + }, { | |
| 1205 | + key: "isSoftDeprecated", | |
| 1206 | + value: function isSoftDeprecated(version) { | |
| 1207 | + var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 1208 | + return total <= 4; | |
| 1209 | + } | |
| 1210 | + | |
| 1211 | + /** | |
| 1212 | + * @param {string} version | |
| 1213 | + * @return {boolean} | |
| 1214 | + */ | |
| 1215 | + }, { | |
| 1216 | + key: "isHardDeprecated", | |
| 1217 | + value: function isHardDeprecated(version) { | |
| 1218 | + var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 1219 | + return total < 0 || total >= 8; | |
| 1220 | + } | |
| 1221 | + }]); | |
| 1222 | + return Deprecation; | |
| 1223 | +}(); | |
| 1224 | +exports["default"] = Deprecation; | |
| 1225 | + | |
| 1226 | +/***/ }), | |
| 1227 | + | |
| 1228 | +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 1229 | +/*!******************************************************************!*\ | |
| 1230 | + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 1231 | + \******************************************************************/ | |
| 1232 | +/***/ ((module) => { | |
| 1233 | + | |
| 1234 | +function _arrayLikeToArray(arr, len) { | |
| 1235 | + if (len == null || len > arr.length) len = arr.length; | |
| 1236 | + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | |
| 1237 | + return arr2; | |
| 1238 | +} | |
| 1239 | +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1240 | + | |
| 1241 | +/***/ }), | |
| 1242 | + | |
| 1243 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 1244 | +/*!****************************************************************!*\ | |
| 1245 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 1246 | + \****************************************************************/ | |
| 1247 | +/***/ ((module) => { | |
| 1248 | + | |
| 1249 | +function _arrayWithHoles(arr) { | |
| 1250 | + if (Array.isArray(arr)) return arr; | |
| 1251 | +} | |
| 1252 | +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1253 | + | |
| 1254 | +/***/ }), | |
| 1255 | + | |
| 1256 | +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 1257 | +/*!***********************************************************************!*\ | |
| 1258 | + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 1259 | + \***********************************************************************/ | |
| 1260 | +/***/ ((module) => { | |
| 1261 | + | |
| 1262 | +function _assertThisInitialized(self) { | |
| 1263 | + if (self === void 0) { | |
| 1264 | + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 1265 | + } | |
| 1266 | + return self; | |
| 1267 | +} | |
| 1268 | +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1269 | + | |
| 1270 | +/***/ }), | |
| 1271 | + | |
| 1272 | +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 1273 | +/*!****************************************************************!*\ | |
| 1274 | + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 1275 | + \****************************************************************/ | |
| 1276 | +/***/ ((module) => { | |
| 1277 | + | |
| 1278 | +function _classCallCheck(instance, Constructor) { | |
| 1279 | + if (!(instance instanceof Constructor)) { | |
| 1280 | + throw new TypeError("Cannot call a class as a function"); | |
| 1281 | + } | |
| 1282 | +} | |
| 1283 | +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1284 | + | |
| 1285 | +/***/ }), | |
| 1286 | + | |
| 1287 | +/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 1288 | +/*!*************************************************************!*\ | |
| 1289 | + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 1290 | + \*************************************************************/ | |
| 1291 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1292 | + | |
| 1293 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 1294 | +function _defineProperties(target, props) { | |
| 1295 | + for (var i = 0; i < props.length; i++) { | |
| 1296 | + var descriptor = props[i]; | |
| 1297 | + descriptor.enumerable = descriptor.enumerable || false; | |
| 1298 | + descriptor.configurable = true; | |
| 1299 | + if ("value" in descriptor) descriptor.writable = true; | |
| 1300 | + Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor); | |
| 1301 | + } | |
| 1302 | +} | |
| 1303 | +function _createClass(Constructor, protoProps, staticProps) { | |
| 1304 | + if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
| 1305 | + if (staticProps) _defineProperties(Constructor, staticProps); | |
| 1306 | + Object.defineProperty(Constructor, "prototype", { | |
| 1307 | + writable: false | |
| 1308 | + }); | |
| 1309 | + return Constructor; | |
| 1310 | +} | |
| 1311 | +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1312 | + | |
| 1313 | +/***/ }), | |
| 1314 | + | |
| 1315 | +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 1316 | +/*!****************************************************************!*\ | |
| 1317 | + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 1318 | + \****************************************************************/ | |
| 1319 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1320 | + | |
| 1321 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 1322 | +function _defineProperty(obj, key, value) { | |
| 1323 | + key = toPropertyKey(key); | |
| 1324 | + if (key in obj) { | |
| 1325 | + Object.defineProperty(obj, key, { | |
| 1326 | + value: value, | |
| 1327 | + enumerable: true, | |
| 1328 | + configurable: true, | |
| 1329 | + writable: true | |
| 1330 | + }); | |
| 1331 | + } else { | |
| 1332 | + obj[key] = value; | |
| 1333 | + } | |
| 1334 | + return obj; | |
| 1335 | +} | |
| 1336 | +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1337 | + | |
| 1338 | +/***/ }), | |
| 1339 | + | |
| 1340 | +/***/ "../node_modules/@babel/runtime/helpers/get.js": | |
| 1341 | +/*!*****************************************************!*\ | |
| 1342 | + !*** ../node_modules/@babel/runtime/helpers/get.js ***! | |
| 1343 | + \*****************************************************/ | |
| 1344 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1345 | + | |
| 1346 | +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); | |
| 1347 | +function _get() { | |
| 1348 | + if (typeof Reflect !== "undefined" && Reflect.get) { | |
| 1349 | + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1350 | + } else { | |
| 1351 | + module.exports = _get = function _get(target, property, receiver) { | |
| 1352 | + var base = superPropBase(target, property); | |
| 1353 | + if (!base) return; | |
| 1354 | + var desc = Object.getOwnPropertyDescriptor(base, property); | |
| 1355 | + if (desc.get) { | |
| 1356 | + return desc.get.call(arguments.length < 3 ? target : receiver); | |
| 1357 | + } | |
| 1358 | + return desc.value; | |
| 1359 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1360 | + } | |
| 1361 | + return _get.apply(this, arguments); | |
| 1362 | +} | |
| 1363 | +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1364 | + | |
| 1365 | +/***/ }), | |
| 1366 | + | |
| 1367 | +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 1368 | +/*!****************************************************************!*\ | |
| 1369 | + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 1370 | + \****************************************************************/ | |
| 1371 | +/***/ ((module) => { | |
| 1372 | + | |
| 1373 | +function _getPrototypeOf(o) { | |
| 1374 | + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | |
| 1375 | + return o.__proto__ || Object.getPrototypeOf(o); | |
| 1376 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1377 | + return _getPrototypeOf(o); | |
| 1378 | +} | |
| 1379 | +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1380 | + | |
| 1381 | +/***/ }), | |
| 1382 | + | |
| 1383 | +/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 1384 | +/*!**********************************************************!*\ | |
| 1385 | + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 1386 | + \**********************************************************/ | |
| 1387 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1388 | + | |
| 1389 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 1390 | +function _inherits(subClass, superClass) { | |
| 1391 | + if (typeof superClass !== "function" && superClass !== null) { | |
| 1392 | + throw new TypeError("Super expression must either be null or a function"); | |
| 1393 | + } | |
| 1394 | + subClass.prototype = Object.create(superClass && superClass.prototype, { | |
| 1395 | + constructor: { | |
| 1396 | + value: subClass, | |
| 1397 | + writable: true, | |
| 1398 | + configurable: true | |
| 1399 | + } | |
| 1400 | + }); | |
| 1401 | + Object.defineProperty(subClass, "prototype", { | |
| 1402 | + writable: false | |
| 1403 | + }); | |
| 1404 | + if (superClass) setPrototypeOf(subClass, superClass); | |
| 1405 | +} | |
| 1406 | +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1407 | + | |
| 1408 | +/***/ }), | |
| 1409 | + | |
| 1410 | +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 1411 | +/*!***********************************************************************!*\ | |
| 1412 | + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 1413 | + \***********************************************************************/ | |
| 1414 | +/***/ ((module) => { | |
| 1415 | + | |
| 1416 | +function _interopRequireDefault(obj) { | |
| 1417 | + return obj && obj.__esModule ? obj : { | |
| 1418 | + "default": obj | |
| 1419 | + }; | |
| 1420 | +} | |
| 1421 | +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1422 | + | |
| 1423 | +/***/ }), | |
| 1424 | + | |
| 1425 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 1426 | +/*!**********************************************************************!*\ | |
| 1427 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 1428 | + \**********************************************************************/ | |
| 1429 | +/***/ ((module) => { | |
| 1430 | + | |
| 1431 | +function _iterableToArrayLimit(arr, i) { | |
| 1432 | + var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; | |
| 1433 | + if (null != _i) { | |
| 1434 | + var _s, | |
| 1435 | + _e, | |
| 1436 | + _x, | |
| 1437 | + _r, | |
| 1438 | + _arr = [], | |
| 1439 | + _n = !0, | |
| 1440 | + _d = !1; | |
| 1441 | + try { | |
| 1442 | + if (_x = (_i = _i.call(arr)).next, 0 === i) { | |
| 1443 | + if (Object(_i) !== _i) return; | |
| 1444 | + _n = !1; | |
| 1445 | + } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); | |
| 1446 | + } catch (err) { | |
| 1447 | + _d = !0, _e = err; | |
| 1448 | + } finally { | |
| 1449 | + try { | |
| 1450 | + if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; | |
| 1451 | + } finally { | |
| 1452 | + if (_d) throw _e; | |
| 1453 | + } | |
| 1454 | + } | |
| 1455 | + return _arr; | |
| 1456 | + } | |
| 1457 | +} | |
| 1458 | +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1459 | + | |
| 1460 | +/***/ }), | |
| 1461 | + | |
| 1462 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 1463 | +/*!*****************************************************************!*\ | |
| 1464 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 1465 | + \*****************************************************************/ | |
| 1466 | +/***/ ((module) => { | |
| 1467 | + | |
| 1468 | +function _nonIterableRest() { | |
| 1469 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 1470 | +} | |
| 1471 | +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1472 | + | |
| 1473 | +/***/ }), | |
| 1474 | + | |
| 1475 | +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": | |
| 1476 | +/*!***************************************************************************!*\ | |
| 1477 | + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! | |
| 1478 | + \***************************************************************************/ | |
| 1479 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1480 | + | |
| 1481 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1482 | +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); | |
| 1483 | +function _possibleConstructorReturn(self, call) { | |
| 1484 | + if (call && (_typeof(call) === "object" || typeof call === "function")) { | |
| 1485 | + return call; | |
| 1486 | + } else if (call !== void 0) { | |
| 1487 | + throw new TypeError("Derived constructors may only return object or undefined"); | |
| 1488 | + } | |
| 1489 | + return assertThisInitialized(self); | |
| 1490 | +} | |
| 1491 | +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1492 | + | |
| 1493 | +/***/ }), | |
| 1494 | + | |
| 1495 | +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 1496 | +/*!****************************************************************!*\ | |
| 1497 | + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 1498 | + \****************************************************************/ | |
| 1499 | +/***/ ((module) => { | |
| 1500 | + | |
| 1501 | +function _setPrototypeOf(o, p) { | |
| 1502 | + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | |
| 1503 | + o.__proto__ = p; | |
| 1504 | + return o; | |
| 1505 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1506 | + return _setPrototypeOf(o, p); | |
| 1507 | +} | |
| 1508 | +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1509 | + | |
| 1510 | +/***/ }), | |
| 1511 | + | |
| 1512 | +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 1513 | +/*!***************************************************************!*\ | |
| 1514 | + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 1515 | + \***************************************************************/ | |
| 1516 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1517 | + | |
| 1518 | +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 1519 | +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 1520 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 1521 | +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 1522 | +function _slicedToArray(arr, i) { | |
| 1523 | + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); | |
| 1524 | +} | |
| 1525 | +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1526 | + | |
| 1527 | +/***/ }), | |
| 1528 | + | |
| 1529 | +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": | |
| 1530 | +/*!***************************************************************!*\ | |
| 1531 | + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! | |
| 1532 | + \***************************************************************/ | |
| 1533 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1534 | + | |
| 1535 | +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 1536 | +function _superPropBase(object, property) { | |
| 1537 | + while (!Object.prototype.hasOwnProperty.call(object, property)) { | |
| 1538 | + object = getPrototypeOf(object); | |
| 1539 | + if (object === null) break; | |
| 1540 | + } | |
| 1541 | + return object; | |
| 1542 | +} | |
| 1543 | +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1544 | + | |
| 1545 | +/***/ }), | |
| 1546 | + | |
| 1547 | +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 1548 | +/*!*************************************************************!*\ | |
| 1549 | + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 1550 | + \*************************************************************/ | |
| 1551 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1552 | + | |
| 1553 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1554 | +function _toPrimitive(input, hint) { | |
| 1555 | + if (_typeof(input) !== "object" || input === null) return input; | |
| 1556 | + var prim = input[Symbol.toPrimitive]; | |
| 1557 | + if (prim !== undefined) { | |
| 1558 | + var res = prim.call(input, hint || "default"); | |
| 1559 | + if (_typeof(res) !== "object") return res; | |
| 1560 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 1561 | + } | |
| 1562 | + return (hint === "string" ? String : Number)(input); | |
| 1563 | +} | |
| 1564 | +module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1565 | + | |
| 1566 | +/***/ }), | |
| 1567 | + | |
| 1568 | +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 1569 | +/*!***************************************************************!*\ | |
| 1570 | + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 1571 | + \***************************************************************/ | |
| 1572 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1573 | + | |
| 1574 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1575 | +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 1576 | +function _toPropertyKey(arg) { | |
| 1577 | + var key = toPrimitive(arg, "string"); | |
| 1578 | + return _typeof(key) === "symbol" ? key : String(key); | |
| 1579 | +} | |
| 1580 | +module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1581 | + | |
| 1582 | +/***/ }), | |
| 1583 | + | |
| 1584 | +/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 1585 | +/*!********************************************************!*\ | |
| 1586 | + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 1587 | + \********************************************************/ | |
| 1588 | +/***/ ((module) => { | |
| 1589 | + | |
| 1590 | +function _typeof(obj) { | |
| 1591 | + "@babel/helpers - typeof"; | |
| 1592 | + | |
| 1593 | + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | |
| 1594 | + return typeof obj; | |
| 1595 | + } : function (obj) { | |
| 1596 | + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | |
| 1597 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj); | |
| 1598 | +} | |
| 1599 | +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1600 | + | |
| 1601 | +/***/ }), | |
| 1602 | + | |
| 1603 | +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 1604 | +/*!****************************************************************************!*\ | |
| 1605 | + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 1606 | + \****************************************************************************/ | |
| 1607 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1608 | + | |
| 1609 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 1610 | +function _unsupportedIterableToArray(o, minLen) { | |
| 1611 | + if (!o) return; | |
| 1612 | + if (typeof o === "string") return arrayLikeToArray(o, minLen); | |
| 1613 | + var n = Object.prototype.toString.call(o).slice(8, -1); | |
| 1614 | + if (n === "Object" && o.constructor) n = o.constructor.name; | |
| 1615 | + if (n === "Map" || n === "Set") return Array.from(o); | |
| 1616 | + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); | |
| 1617 | +} | |
| 1618 | +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1619 | + | |
| 1620 | +/***/ }) | |
| 1621 | + | |
| 1622 | +/******/ }); | |
| 1623 | +/************************************************************************/ | |
| 1624 | +/******/ // The module cache | |
| 1625 | +/******/ var __webpack_module_cache__ = {}; | |
| 1626 | +/******/ | |
| 1627 | +/******/ // The require function | |
| 1628 | +/******/ function __webpack_require__(moduleId) { | |
| 1629 | +/******/ // Check if module is in cache | |
| 1630 | +/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 1631 | +/******/ if (cachedModule !== undefined) { | |
| 1632 | +/******/ return cachedModule.exports; | |
| 1633 | +/******/ } | |
| 1634 | +/******/ // Create a new module (and put it into the cache) | |
| 1635 | +/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 1636 | +/******/ // no module.id needed | |
| 1637 | +/******/ // no module.loaded needed | |
| 1638 | +/******/ exports: {} | |
| 1639 | +/******/ }; | |
| 1640 | +/******/ | |
| 1641 | +/******/ // Execute the module function | |
| 1642 | +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 1643 | +/******/ | |
| 1644 | +/******/ // Return the exports of the module | |
| 1645 | +/******/ return module.exports; | |
| 1646 | +/******/ } | |
| 1647 | +/******/ | |
| 1648 | +/************************************************************************/ | |
| 1649 | +var __webpack_exports__ = {}; | |
| 1650 | +// This entry need to be wrapped in an IIFE because it need to be in strict mode. | |
| 1651 | +(() => { | |
| 1652 | +"use strict"; | |
| 1653 | +/*!**************************************************!*\ | |
| 1654 | + !*** ../assets/dev/js/editor/editor-document.js ***! | |
| 1655 | + \**************************************************/ | |
| 1656 | + | |
| 1657 | + | |
| 1658 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1659 | +var _commandContainerBase = _interopRequireDefault(__webpack_require__(/*! ./command-bases/command-container-base */ "../assets/dev/js/editor/command-bases/command-container-base.js")); | |
| 1660 | +var _commandContainerInternalBase = _interopRequireDefault(__webpack_require__(/*! ./command-bases/command-container-internal-base */ "../assets/dev/js/editor/command-bases/command-container-internal-base.js")); | |
| 1661 | +var _commandHistoryBase = _interopRequireDefault(__webpack_require__(/*! elementor-document/command-bases/command-history-base */ "../assets/dev/js/editor/document/command-bases/command-history-base.js")); | |
| 1662 | +var _commandHistoryDebounceBase = _interopRequireDefault(__webpack_require__(/*! elementor-document/command-bases/command-history-debounce-base */ "../assets/dev/js/editor/document/command-bases/command-history-debounce-base.js")); | |
| 1663 | +$e.modules.editor = { | |
| 1664 | + CommandContainerBase: _commandContainerBase.default, | |
| 1665 | + CommandContainerInternalBase: _commandContainerInternalBase.default, | |
| 1666 | + document: { | |
| 1667 | + CommandHistoryBase: _commandHistoryBase.default, | |
| 1668 | + CommandHistoryDebounceBase: _commandHistoryDebounceBase.default | |
| 1669 | + } | |
| 1670 | +}; | |
| 1671 | + | |
| 1672 | +// TODO: Remove, BC. | |
| 1673 | +$e.modules.document = { | |
| 1674 | + get CommandHistory() { | |
| 1675 | + elementorDevTools.deprecation.deprecated('$e.modules.document.CommandHistory', '3.7.0', '$e.modules.editor.document.CommandHistoryBase'); | |
| 1676 | + return $e.modules.editor.document.CommandHistoryBase; | |
| 1677 | + }, | |
| 1678 | + get CommandHistoryDebounce() { | |
| 1679 | + elementorDevTools.deprecation.deprecated('$e.modules.CommandHistoryDebounce', '3.7.0', '$e.modules.editor.document.CommandHistoryDebounceBase'); | |
| 1680 | + return $e.modules.editor.document.CommandHistoryDebounceBase; | |
| 1681 | + } | |
| 1682 | +}; | |
| 1077 | 1683 | })(); |
| 1684 | + | |
| 1685 | +/******/ })() | |
| 1686 | +; | |
| 1078 | 1687 | //# sourceMappingURL=editor-document.js.map |