| @@ -1,11 +1,2899 @@ | ||
| 1 | +/*! elementor - v3.6.7 - 03-07-2022 */ | |
| 1 | 2 | /******/ (() => { // webpackBootstrap |
| 2 | 3 | /******/ var __webpack_modules__ = ({ |
| 3 | 4 | |
| 4 | -/***/ "../assets/dev/js/editor/command-bases/command-container-base.js": | |
| 5 | +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 6 | +/*!******************************************************************!*\ | |
| 7 | + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 8 | + \******************************************************************/ | |
| 9 | +/***/ ((module) => { | |
| 10 | + | |
| 11 | +function _arrayLikeToArray(arr, len) { | |
| 12 | + if (len == null || len > arr.length) len = arr.length; | |
| 13 | + | |
| 14 | + for (var i = 0, arr2 = new Array(len); i < len; i++) { | |
| 15 | + arr2[i] = arr[i]; | |
| 16 | + } | |
| 17 | + | |
| 18 | + return arr2; | |
| 19 | +} | |
| 20 | + | |
| 21 | +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 22 | + | |
| 23 | +/***/ }), | |
| 24 | + | |
| 25 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 26 | +/*!****************************************************************!*\ | |
| 27 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 28 | + \****************************************************************/ | |
| 29 | +/***/ ((module) => { | |
| 30 | + | |
| 31 | +function _arrayWithHoles(arr) { | |
| 32 | + if (Array.isArray(arr)) return arr; | |
| 33 | +} | |
| 34 | + | |
| 35 | +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 36 | + | |
| 37 | +/***/ }), | |
| 38 | + | |
| 39 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js": | |
| 40 | +/*!*******************************************************************!*\ | |
| 41 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***! | |
| 42 | + \*******************************************************************/ | |
| 43 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 44 | + | |
| 45 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 46 | + | |
| 47 | +function _arrayWithoutHoles(arr) { | |
| 48 | + if (Array.isArray(arr)) return arrayLikeToArray(arr); | |
| 49 | +} | |
| 50 | + | |
| 51 | +module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 52 | + | |
| 53 | +/***/ }), | |
| 54 | + | |
| 55 | +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 5 | 56 | /*!***********************************************************************!*\ |
| 6 | - !*** ../assets/dev/js/editor/command-bases/command-container-base.js ***! | |
| 57 | + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 7 | 58 | \***********************************************************************/ |
| 59 | +/***/ ((module) => { | |
| 60 | + | |
| 61 | +function _assertThisInitialized(self) { | |
| 62 | + if (self === void 0) { | |
| 63 | + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 64 | + } | |
| 65 | + | |
| 66 | + return self; | |
| 67 | +} | |
| 68 | + | |
| 69 | +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 70 | + | |
| 71 | +/***/ }), | |
| 72 | + | |
| 73 | +/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": | |
| 74 | +/*!******************************************************************!*\ | |
| 75 | + !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! | |
| 76 | + \******************************************************************/ | |
| 77 | +/***/ ((module) => { | |
| 78 | + | |
| 79 | +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { | |
| 80 | + try { | |
| 81 | + var info = gen[key](arg); | |
| 82 | + var value = info.value; | |
| 83 | + } catch (error) { | |
| 84 | + reject(error); | |
| 85 | + return; | |
| 86 | + } | |
| 87 | + | |
| 88 | + if (info.done) { | |
| 89 | + resolve(value); | |
| 90 | + } else { | |
| 91 | + Promise.resolve(value).then(_next, _throw); | |
| 92 | + } | |
| 93 | +} | |
| 94 | + | |
| 95 | +function _asyncToGenerator(fn) { | |
| 96 | + return function () { | |
| 97 | + var self = this, | |
| 98 | + args = arguments; | |
| 99 | + return new Promise(function (resolve, reject) { | |
| 100 | + var gen = fn.apply(self, args); | |
| 101 | + | |
| 102 | + function _next(value) { | |
| 103 | + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); | |
| 104 | + } | |
| 105 | + | |
| 106 | + function _throw(err) { | |
| 107 | + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); | |
| 108 | + } | |
| 109 | + | |
| 110 | + _next(undefined); | |
| 111 | + }); | |
| 112 | + }; | |
| 113 | +} | |
| 114 | + | |
| 115 | +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 116 | + | |
| 117 | +/***/ }), | |
| 118 | + | |
| 119 | +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 120 | +/*!****************************************************************!*\ | |
| 121 | + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 122 | + \****************************************************************/ | |
| 123 | +/***/ ((module) => { | |
| 124 | + | |
| 125 | +function _classCallCheck(instance, Constructor) { | |
| 126 | + if (!(instance instanceof Constructor)) { | |
| 127 | + throw new TypeError("Cannot call a class as a function"); | |
| 128 | + } | |
| 129 | +} | |
| 130 | + | |
| 131 | +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 132 | + | |
| 133 | +/***/ }), | |
| 134 | + | |
| 135 | +/***/ "../node_modules/@babel/runtime/helpers/construct.js": | |
| 136 | +/*!***********************************************************!*\ | |
| 137 | + !*** ../node_modules/@babel/runtime/helpers/construct.js ***! | |
| 138 | + \***********************************************************/ | |
| 139 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 140 | + | |
| 141 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 142 | + | |
| 143 | +var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js"); | |
| 144 | + | |
| 145 | +function _construct(Parent, args, Class) { | |
| 146 | + if (isNativeReflectConstruct()) { | |
| 147 | + module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 148 | + } else { | |
| 149 | + module.exports = _construct = function _construct(Parent, args, Class) { | |
| 150 | + var a = [null]; | |
| 151 | + a.push.apply(a, args); | |
| 152 | + var Constructor = Function.bind.apply(Parent, a); | |
| 153 | + var instance = new Constructor(); | |
| 154 | + if (Class) setPrototypeOf(instance, Class.prototype); | |
| 155 | + return instance; | |
| 156 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 157 | + } | |
| 158 | + | |
| 159 | + return _construct.apply(null, arguments); | |
| 160 | +} | |
| 161 | + | |
| 162 | +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 163 | + | |
| 164 | +/***/ }), | |
| 165 | + | |
| 166 | +/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 167 | +/*!*************************************************************!*\ | |
| 168 | + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 169 | + \*************************************************************/ | |
| 170 | +/***/ ((module) => { | |
| 171 | + | |
| 172 | +function _defineProperties(target, props) { | |
| 173 | + for (var i = 0; i < props.length; i++) { | |
| 174 | + var descriptor = props[i]; | |
| 175 | + descriptor.enumerable = descriptor.enumerable || false; | |
| 176 | + descriptor.configurable = true; | |
| 177 | + if ("value" in descriptor) descriptor.writable = true; | |
| 178 | + Object.defineProperty(target, descriptor.key, descriptor); | |
| 179 | + } | |
| 180 | +} | |
| 181 | + | |
| 182 | +function _createClass(Constructor, protoProps, staticProps) { | |
| 183 | + if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
| 184 | + if (staticProps) _defineProperties(Constructor, staticProps); | |
| 185 | + Object.defineProperty(Constructor, "prototype", { | |
| 186 | + writable: false | |
| 187 | + }); | |
| 188 | + return Constructor; | |
| 189 | +} | |
| 190 | + | |
| 191 | +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 192 | + | |
| 193 | +/***/ }), | |
| 194 | + | |
| 195 | +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 196 | +/*!****************************************************************!*\ | |
| 197 | + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 198 | + \****************************************************************/ | |
| 199 | +/***/ ((module) => { | |
| 200 | + | |
| 201 | +function _defineProperty(obj, key, value) { | |
| 202 | + if (key in obj) { | |
| 203 | + Object.defineProperty(obj, key, { | |
| 204 | + value: value, | |
| 205 | + enumerable: true, | |
| 206 | + configurable: true, | |
| 207 | + writable: true | |
| 208 | + }); | |
| 209 | + } else { | |
| 210 | + obj[key] = value; | |
| 211 | + } | |
| 212 | + | |
| 213 | + return obj; | |
| 214 | +} | |
| 215 | + | |
| 216 | +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 217 | + | |
| 218 | +/***/ }), | |
| 219 | + | |
| 220 | +/***/ "../node_modules/@babel/runtime/helpers/get.js": | |
| 221 | +/*!*****************************************************!*\ | |
| 222 | + !*** ../node_modules/@babel/runtime/helpers/get.js ***! | |
| 223 | + \*****************************************************/ | |
| 224 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 225 | + | |
| 226 | +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); | |
| 227 | + | |
| 228 | +function _get() { | |
| 229 | + if (typeof Reflect !== "undefined" && Reflect.get) { | |
| 230 | + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 231 | + } else { | |
| 232 | + module.exports = _get = function _get(target, property, receiver) { | |
| 233 | + var base = superPropBase(target, property); | |
| 234 | + if (!base) return; | |
| 235 | + var desc = Object.getOwnPropertyDescriptor(base, property); | |
| 236 | + | |
| 237 | + if (desc.get) { | |
| 238 | + return desc.get.call(arguments.length < 3 ? target : receiver); | |
| 239 | + } | |
| 240 | + | |
| 241 | + return desc.value; | |
| 242 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 243 | + } | |
| 244 | + | |
| 245 | + return _get.apply(this, arguments); | |
| 246 | +} | |
| 247 | + | |
| 248 | +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 249 | + | |
| 250 | +/***/ }), | |
| 251 | + | |
| 252 | +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 253 | +/*!****************************************************************!*\ | |
| 254 | + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 255 | + \****************************************************************/ | |
| 256 | +/***/ ((module) => { | |
| 257 | + | |
| 258 | +function _getPrototypeOf(o) { | |
| 259 | + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | |
| 260 | + return o.__proto__ || Object.getPrototypeOf(o); | |
| 261 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 262 | + return _getPrototypeOf(o); | |
| 263 | +} | |
| 264 | + | |
| 265 | +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 266 | + | |
| 267 | +/***/ }), | |
| 268 | + | |
| 269 | +/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 270 | +/*!**********************************************************!*\ | |
| 271 | + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 272 | + \**********************************************************/ | |
| 273 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 274 | + | |
| 275 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 276 | + | |
| 277 | +function _inherits(subClass, superClass) { | |
| 278 | + if (typeof superClass !== "function" && superClass !== null) { | |
| 279 | + throw new TypeError("Super expression must either be null or a function"); | |
| 280 | + } | |
| 281 | + | |
| 282 | + subClass.prototype = Object.create(superClass && superClass.prototype, { | |
| 283 | + constructor: { | |
| 284 | + value: subClass, | |
| 285 | + writable: true, | |
| 286 | + configurable: true | |
| 287 | + } | |
| 288 | + }); | |
| 289 | + Object.defineProperty(subClass, "prototype", { | |
| 290 | + writable: false | |
| 291 | + }); | |
| 292 | + if (superClass) setPrototypeOf(subClass, superClass); | |
| 293 | +} | |
| 294 | + | |
| 295 | +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 296 | + | |
| 297 | +/***/ }), | |
| 298 | + | |
| 299 | +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 300 | +/*!***********************************************************************!*\ | |
| 301 | + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 302 | + \***********************************************************************/ | |
| 303 | +/***/ ((module) => { | |
| 304 | + | |
| 305 | +function _interopRequireDefault(obj) { | |
| 306 | + return obj && obj.__esModule ? obj : { | |
| 307 | + "default": obj | |
| 308 | + }; | |
| 309 | +} | |
| 310 | + | |
| 311 | +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 312 | + | |
| 313 | +/***/ }), | |
| 314 | + | |
| 315 | +/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js": | |
| 316 | +/*!******************************************************************!*\ | |
| 317 | + !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***! | |
| 318 | + \******************************************************************/ | |
| 319 | +/***/ ((module) => { | |
| 320 | + | |
| 321 | +function _isNativeFunction(fn) { | |
| 322 | + return Function.toString.call(fn).indexOf("[native code]") !== -1; | |
| 323 | +} | |
| 324 | + | |
| 325 | +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 326 | + | |
| 327 | +/***/ }), | |
| 328 | + | |
| 329 | +/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js": | |
| 330 | +/*!**************************************************************************!*\ | |
| 331 | + !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***! | |
| 332 | + \**************************************************************************/ | |
| 333 | +/***/ ((module) => { | |
| 334 | + | |
| 335 | +function _isNativeReflectConstruct() { | |
| 336 | + if (typeof Reflect === "undefined" || !Reflect.construct) return false; | |
| 337 | + if (Reflect.construct.sham) return false; | |
| 338 | + if (typeof Proxy === "function") return true; | |
| 339 | + | |
| 340 | + try { | |
| 341 | + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | |
| 342 | + return true; | |
| 343 | + } catch (e) { | |
| 344 | + return false; | |
| 345 | + } | |
| 346 | +} | |
| 347 | + | |
| 348 | +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 349 | + | |
| 350 | +/***/ }), | |
| 351 | + | |
| 352 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js": | |
| 353 | +/*!*****************************************************************!*\ | |
| 354 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***! | |
| 355 | + \*****************************************************************/ | |
| 356 | +/***/ ((module) => { | |
| 357 | + | |
| 358 | +function _iterableToArray(iter) { | |
| 359 | + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | |
| 360 | +} | |
| 361 | + | |
| 362 | +module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 363 | + | |
| 364 | +/***/ }), | |
| 365 | + | |
| 366 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 367 | +/*!**********************************************************************!*\ | |
| 368 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 369 | + \**********************************************************************/ | |
| 370 | +/***/ ((module) => { | |
| 371 | + | |
| 372 | +function _iterableToArrayLimit(arr, i) { | |
| 373 | + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | |
| 374 | + | |
| 375 | + if (_i == null) return; | |
| 376 | + var _arr = []; | |
| 377 | + var _n = true; | |
| 378 | + var _d = false; | |
| 379 | + | |
| 380 | + var _s, _e; | |
| 381 | + | |
| 382 | + try { | |
| 383 | + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | |
| 384 | + _arr.push(_s.value); | |
| 385 | + | |
| 386 | + if (i && _arr.length === i) break; | |
| 387 | + } | |
| 388 | + } catch (err) { | |
| 389 | + _d = true; | |
| 390 | + _e = err; | |
| 391 | + } finally { | |
| 392 | + try { | |
| 393 | + if (!_n && _i["return"] != null) _i["return"](); | |
| 394 | + } finally { | |
| 395 | + if (_d) throw _e; | |
| 396 | + } | |
| 397 | + } | |
| 398 | + | |
| 399 | + return _arr; | |
| 400 | +} | |
| 401 | + | |
| 402 | +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 403 | + | |
| 404 | +/***/ }), | |
| 405 | + | |
| 406 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 407 | +/*!*****************************************************************!*\ | |
| 408 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 409 | + \*****************************************************************/ | |
| 410 | +/***/ ((module) => { | |
| 411 | + | |
| 412 | +function _nonIterableRest() { | |
| 413 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 414 | +} | |
| 415 | + | |
| 416 | +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 417 | + | |
| 418 | +/***/ }), | |
| 419 | + | |
| 420 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js": | |
| 421 | +/*!*******************************************************************!*\ | |
| 422 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableSpread.js ***! | |
| 423 | + \*******************************************************************/ | |
| 424 | +/***/ ((module) => { | |
| 425 | + | |
| 426 | +function _nonIterableSpread() { | |
| 427 | + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 428 | +} | |
| 429 | + | |
| 430 | +module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 431 | + | |
| 432 | +/***/ }), | |
| 433 | + | |
| 434 | +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": | |
| 435 | +/*!***************************************************************************!*\ | |
| 436 | + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! | |
| 437 | + \***************************************************************************/ | |
| 438 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 439 | + | |
| 440 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 441 | + | |
| 442 | +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); | |
| 443 | + | |
| 444 | +function _possibleConstructorReturn(self, call) { | |
| 445 | + if (call && (_typeof(call) === "object" || typeof call === "function")) { | |
| 446 | + return call; | |
| 447 | + } else if (call !== void 0) { | |
| 448 | + throw new TypeError("Derived constructors may only return object or undefined"); | |
| 449 | + } | |
| 450 | + | |
| 451 | + return assertThisInitialized(self); | |
| 452 | +} | |
| 453 | + | |
| 454 | +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 455 | + | |
| 456 | +/***/ }), | |
| 457 | + | |
| 458 | +/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js": | |
| 459 | +/*!********************************************************************!*\ | |
| 460 | + !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! | |
| 461 | + \********************************************************************/ | |
| 462 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 463 | + | |
| 464 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 465 | + | |
| 466 | +function _regeneratorRuntime() { | |
| 467 | + "use strict"; | |
| 468 | + /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ | |
| 469 | + | |
| 470 | + module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 471 | + return exports; | |
| 472 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 473 | + var exports = {}, | |
| 474 | + Op = Object.prototype, | |
| 475 | + hasOwn = Op.hasOwnProperty, | |
| 476 | + $Symbol = "function" == typeof Symbol ? Symbol : {}, | |
| 477 | + iteratorSymbol = $Symbol.iterator || "@@iterator", | |
| 478 | + asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", | |
| 479 | + toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; | |
| 480 | + | |
| 481 | + function define(obj, key, value) { | |
| 482 | + return Object.defineProperty(obj, key, { | |
| 483 | + value: value, | |
| 484 | + enumerable: !0, | |
| 485 | + configurable: !0, | |
| 486 | + writable: !0 | |
| 487 | + }), obj[key]; | |
| 488 | + } | |
| 489 | + | |
| 490 | + try { | |
| 491 | + define({}, ""); | |
| 492 | + } catch (err) { | |
| 493 | + define = function define(obj, key, value) { | |
| 494 | + return obj[key] = value; | |
| 495 | + }; | |
| 496 | + } | |
| 497 | + | |
| 498 | + function wrap(innerFn, outerFn, self, tryLocsList) { | |
| 499 | + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, | |
| 500 | + generator = Object.create(protoGenerator.prototype), | |
| 501 | + context = new Context(tryLocsList || []); | |
| 502 | + return generator._invoke = function (innerFn, self, context) { | |
| 503 | + var state = "suspendedStart"; | |
| 504 | + return function (method, arg) { | |
| 505 | + if ("executing" === state) throw new Error("Generator is already running"); | |
| 506 | + | |
| 507 | + if ("completed" === state) { | |
| 508 | + if ("throw" === method) throw arg; | |
| 509 | + return doneResult(); | |
| 510 | + } | |
| 511 | + | |
| 512 | + for (context.method = method, context.arg = arg;;) { | |
| 513 | + var delegate = context.delegate; | |
| 514 | + | |
| 515 | + if (delegate) { | |
| 516 | + var delegateResult = maybeInvokeDelegate(delegate, context); | |
| 517 | + | |
| 518 | + if (delegateResult) { | |
| 519 | + if (delegateResult === ContinueSentinel) continue; | |
| 520 | + return delegateResult; | |
| 521 | + } | |
| 522 | + } | |
| 523 | + | |
| 524 | + if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { | |
| 525 | + if ("suspendedStart" === state) throw state = "completed", context.arg; | |
| 526 | + context.dispatchException(context.arg); | |
| 527 | + } else "return" === context.method && context.abrupt("return", context.arg); | |
| 528 | + state = "executing"; | |
| 529 | + var record = tryCatch(innerFn, self, context); | |
| 530 | + | |
| 531 | + if ("normal" === record.type) { | |
| 532 | + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; | |
| 533 | + return { | |
| 534 | + value: record.arg, | |
| 535 | + done: context.done | |
| 536 | + }; | |
| 537 | + } | |
| 538 | + | |
| 539 | + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); | |
| 540 | + } | |
| 541 | + }; | |
| 542 | + }(innerFn, self, context), generator; | |
| 543 | + } | |
| 544 | + | |
| 545 | + function tryCatch(fn, obj, arg) { | |
| 546 | + try { | |
| 547 | + return { | |
| 548 | + type: "normal", | |
| 549 | + arg: fn.call(obj, arg) | |
| 550 | + }; | |
| 551 | + } catch (err) { | |
| 552 | + return { | |
| 553 | + type: "throw", | |
| 554 | + arg: err | |
| 555 | + }; | |
| 556 | + } | |
| 557 | + } | |
| 558 | + | |
| 559 | + exports.wrap = wrap; | |
| 560 | + var ContinueSentinel = {}; | |
| 561 | + | |
| 562 | + function Generator() {} | |
| 563 | + | |
| 564 | + function GeneratorFunction() {} | |
| 565 | + | |
| 566 | + function GeneratorFunctionPrototype() {} | |
| 567 | + | |
| 568 | + var IteratorPrototype = {}; | |
| 569 | + define(IteratorPrototype, iteratorSymbol, function () { | |
| 570 | + return this; | |
| 571 | + }); | |
| 572 | + var getProto = Object.getPrototypeOf, | |
| 573 | + NativeIteratorPrototype = getProto && getProto(getProto(values([]))); | |
| 574 | + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); | |
| 575 | + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); | |
| 576 | + | |
| 577 | + function defineIteratorMethods(prototype) { | |
| 578 | + ["next", "throw", "return"].forEach(function (method) { | |
| 579 | + define(prototype, method, function (arg) { | |
| 580 | + return this._invoke(method, arg); | |
| 581 | + }); | |
| 582 | + }); | |
| 583 | + } | |
| 584 | + | |
| 585 | + function AsyncIterator(generator, PromiseImpl) { | |
| 586 | + function invoke(method, arg, resolve, reject) { | |
| 587 | + var record = tryCatch(generator[method], generator, arg); | |
| 588 | + | |
| 589 | + if ("throw" !== record.type) { | |
| 590 | + var result = record.arg, | |
| 591 | + value = result.value; | |
| 592 | + return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { | |
| 593 | + invoke("next", value, resolve, reject); | |
| 594 | + }, function (err) { | |
| 595 | + invoke("throw", err, resolve, reject); | |
| 596 | + }) : PromiseImpl.resolve(value).then(function (unwrapped) { | |
| 597 | + result.value = unwrapped, resolve(result); | |
| 598 | + }, function (error) { | |
| 599 | + return invoke("throw", error, resolve, reject); | |
| 600 | + }); | |
| 601 | + } | |
| 602 | + | |
| 603 | + reject(record.arg); | |
| 604 | + } | |
| 605 | + | |
| 606 | + var previousPromise; | |
| 607 | + | |
| 608 | + this._invoke = function (method, arg) { | |
| 609 | + function callInvokeWithMethodAndArg() { | |
| 610 | + return new PromiseImpl(function (resolve, reject) { | |
| 611 | + invoke(method, arg, resolve, reject); | |
| 612 | + }); | |
| 613 | + } | |
| 614 | + | |
| 615 | + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | |
| 616 | + }; | |
| 617 | + } | |
| 618 | + | |
| 619 | + function maybeInvokeDelegate(delegate, context) { | |
| 620 | + var method = delegate.iterator[context.method]; | |
| 621 | + | |
| 622 | + if (undefined === method) { | |
| 623 | + if (context.delegate = null, "throw" === context.method) { | |
| 624 | + if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; | |
| 625 | + context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); | |
| 626 | + } | |
| 627 | + | |
| 628 | + return ContinueSentinel; | |
| 629 | + } | |
| 630 | + | |
| 631 | + var record = tryCatch(method, delegate.iterator, context.arg); | |
| 632 | + if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; | |
| 633 | + var info = record.arg; | |
| 634 | + return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); | |
| 635 | + } | |
| 636 | + | |
| 637 | + function pushTryEntry(locs) { | |
| 638 | + var entry = { | |
| 639 | + tryLoc: locs[0] | |
| 640 | + }; | |
| 641 | + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); | |
| 642 | + } | |
| 643 | + | |
| 644 | + function resetTryEntry(entry) { | |
| 645 | + var record = entry.completion || {}; | |
| 646 | + record.type = "normal", delete record.arg, entry.completion = record; | |
| 647 | + } | |
| 648 | + | |
| 649 | + function Context(tryLocsList) { | |
| 650 | + this.tryEntries = [{ | |
| 651 | + tryLoc: "root" | |
| 652 | + }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); | |
| 653 | + } | |
| 654 | + | |
| 655 | + function values(iterable) { | |
| 656 | + if (iterable) { | |
| 657 | + var iteratorMethod = iterable[iteratorSymbol]; | |
| 658 | + if (iteratorMethod) return iteratorMethod.call(iterable); | |
| 659 | + if ("function" == typeof iterable.next) return iterable; | |
| 660 | + | |
| 661 | + if (!isNaN(iterable.length)) { | |
| 662 | + var i = -1, | |
| 663 | + next = function next() { | |
| 664 | + for (; ++i < iterable.length;) { | |
| 665 | + if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; | |
| 666 | + } | |
| 667 | + | |
| 668 | + return next.value = undefined, next.done = !0, next; | |
| 669 | + }; | |
| 670 | + | |
| 671 | + return next.next = next; | |
| 672 | + } | |
| 673 | + } | |
| 674 | + | |
| 675 | + return { | |
| 676 | + next: doneResult | |
| 677 | + }; | |
| 678 | + } | |
| 679 | + | |
| 680 | + function doneResult() { | |
| 681 | + return { | |
| 682 | + value: undefined, | |
| 683 | + done: !0 | |
| 684 | + }; | |
| 685 | + } | |
| 686 | + | |
| 687 | + return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { | |
| 688 | + var ctor = "function" == typeof genFun && genFun.constructor; | |
| 689 | + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); | |
| 690 | + }, exports.mark = function (genFun) { | |
| 691 | + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; | |
| 692 | + }, exports.awrap = function (arg) { | |
| 693 | + return { | |
| 694 | + __await: arg | |
| 695 | + }; | |
| 696 | + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { | |
| 697 | + return this; | |
| 698 | + }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { | |
| 699 | + void 0 === PromiseImpl && (PromiseImpl = Promise); | |
| 700 | + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); | |
| 701 | + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { | |
| 702 | + return result.done ? result.value : iter.next(); | |
| 703 | + }); | |
| 704 | + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { | |
| 705 | + return this; | |
| 706 | + }), define(Gp, "toString", function () { | |
| 707 | + return "[object Generator]"; | |
| 708 | + }), exports.keys = function (object) { | |
| 709 | + var keys = []; | |
| 710 | + | |
| 711 | + for (var key in object) { | |
| 712 | + keys.push(key); | |
| 713 | + } | |
| 714 | + | |
| 715 | + return keys.reverse(), function next() { | |
| 716 | + for (; keys.length;) { | |
| 717 | + var key = keys.pop(); | |
| 718 | + if (key in object) return next.value = key, next.done = !1, next; | |
| 719 | + } | |
| 720 | + | |
| 721 | + return next.done = !0, next; | |
| 722 | + }; | |
| 723 | + }, exports.values = values, Context.prototype = { | |
| 724 | + constructor: Context, | |
| 725 | + reset: function reset(skipTempReset) { | |
| 726 | + if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { | |
| 727 | + "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); | |
| 728 | + } | |
| 729 | + }, | |
| 730 | + stop: function stop() { | |
| 731 | + this.done = !0; | |
| 732 | + var rootRecord = this.tryEntries[0].completion; | |
| 733 | + if ("throw" === rootRecord.type) throw rootRecord.arg; | |
| 734 | + return this.rval; | |
| 735 | + }, | |
| 736 | + dispatchException: function dispatchException(exception) { | |
| 737 | + if (this.done) throw exception; | |
| 738 | + var context = this; | |
| 739 | + | |
| 740 | + function handle(loc, caught) { | |
| 741 | + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; | |
| 742 | + } | |
| 743 | + | |
| 744 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 745 | + var entry = this.tryEntries[i], | |
| 746 | + record = entry.completion; | |
| 747 | + if ("root" === entry.tryLoc) return handle("end"); | |
| 748 | + | |
| 749 | + if (entry.tryLoc <= this.prev) { | |
| 750 | + var hasCatch = hasOwn.call(entry, "catchLoc"), | |
| 751 | + hasFinally = hasOwn.call(entry, "finallyLoc"); | |
| 752 | + | |
| 753 | + if (hasCatch && hasFinally) { | |
| 754 | + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | |
| 755 | + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | |
| 756 | + } else if (hasCatch) { | |
| 757 | + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | |
| 758 | + } else { | |
| 759 | + if (!hasFinally) throw new Error("try statement without catch or finally"); | |
| 760 | + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | |
| 761 | + } | |
| 762 | + } | |
| 763 | + } | |
| 764 | + }, | |
| 765 | + abrupt: function abrupt(type, arg) { | |
| 766 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 767 | + var entry = this.tryEntries[i]; | |
| 768 | + | |
| 769 | + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { | |
| 770 | + var finallyEntry = entry; | |
| 771 | + break; | |
| 772 | + } | |
| 773 | + } | |
| 774 | + | |
| 775 | + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); | |
| 776 | + var record = finallyEntry ? finallyEntry.completion : {}; | |
| 777 | + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); | |
| 778 | + }, | |
| 779 | + complete: function complete(record, afterLoc) { | |
| 780 | + if ("throw" === record.type) throw record.arg; | |
| 781 | + return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; | |
| 782 | + }, | |
| 783 | + finish: function finish(finallyLoc) { | |
| 784 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 785 | + var entry = this.tryEntries[i]; | |
| 786 | + if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; | |
| 787 | + } | |
| 788 | + }, | |
| 789 | + "catch": function _catch(tryLoc) { | |
| 790 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 791 | + var entry = this.tryEntries[i]; | |
| 792 | + | |
| 793 | + if (entry.tryLoc === tryLoc) { | |
| 794 | + var record = entry.completion; | |
| 795 | + | |
| 796 | + if ("throw" === record.type) { | |
| 797 | + var thrown = record.arg; | |
| 798 | + resetTryEntry(entry); | |
| 799 | + } | |
| 800 | + | |
| 801 | + return thrown; | |
| 802 | + } | |
| 803 | + } | |
| 804 | + | |
| 805 | + throw new Error("illegal catch attempt"); | |
| 806 | + }, | |
| 807 | + delegateYield: function delegateYield(iterable, resultName, nextLoc) { | |
| 808 | + return this.delegate = { | |
| 809 | + iterator: values(iterable), | |
| 810 | + resultName: resultName, | |
| 811 | + nextLoc: nextLoc | |
| 812 | + }, "next" === this.method && (this.arg = undefined), ContinueSentinel; | |
| 813 | + } | |
| 814 | + }, exports; | |
| 815 | +} | |
| 816 | + | |
| 817 | +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 818 | + | |
| 819 | +/***/ }), | |
| 820 | + | |
| 821 | +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 822 | +/*!****************************************************************!*\ | |
| 823 | + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 824 | + \****************************************************************/ | |
| 825 | +/***/ ((module) => { | |
| 826 | + | |
| 827 | +function _setPrototypeOf(o, p) { | |
| 828 | + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | |
| 829 | + o.__proto__ = p; | |
| 830 | + return o; | |
| 831 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 832 | + return _setPrototypeOf(o, p); | |
| 833 | +} | |
| 834 | + | |
| 835 | +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 836 | + | |
| 837 | +/***/ }), | |
| 838 | + | |
| 839 | +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 840 | +/*!***************************************************************!*\ | |
| 841 | + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 842 | + \***************************************************************/ | |
| 843 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 844 | + | |
| 845 | +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 846 | + | |
| 847 | +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 848 | + | |
| 849 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 850 | + | |
| 851 | +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 852 | + | |
| 853 | +function _slicedToArray(arr, i) { | |
| 854 | + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); | |
| 855 | +} | |
| 856 | + | |
| 857 | +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 858 | + | |
| 859 | +/***/ }), | |
| 860 | + | |
| 861 | +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": | |
| 862 | +/*!***************************************************************!*\ | |
| 863 | + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! | |
| 864 | + \***************************************************************/ | |
| 865 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 866 | + | |
| 867 | +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 868 | + | |
| 869 | +function _superPropBase(object, property) { | |
| 870 | + while (!Object.prototype.hasOwnProperty.call(object, property)) { | |
| 871 | + object = getPrototypeOf(object); | |
| 872 | + if (object === null) break; | |
| 873 | + } | |
| 874 | + | |
| 875 | + return object; | |
| 876 | +} | |
| 877 | + | |
| 878 | +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 879 | + | |
| 880 | +/***/ }), | |
| 881 | + | |
| 882 | +/***/ "../node_modules/@babel/runtime/helpers/toConsumableArray.js": | |
| 883 | +/*!*******************************************************************!*\ | |
| 884 | + !*** ../node_modules/@babel/runtime/helpers/toConsumableArray.js ***! | |
| 885 | + \*******************************************************************/ | |
| 886 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 887 | + | |
| 888 | +var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"); | |
| 889 | + | |
| 890 | +var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "../node_modules/@babel/runtime/helpers/iterableToArray.js"); | |
| 891 | + | |
| 892 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 893 | + | |
| 894 | +var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js"); | |
| 895 | + | |
| 896 | +function _toConsumableArray(arr) { | |
| 897 | + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); | |
| 898 | +} | |
| 899 | + | |
| 900 | +module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 901 | + | |
| 902 | +/***/ }), | |
| 903 | + | |
| 904 | +/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 905 | +/*!********************************************************!*\ | |
| 906 | + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 907 | + \********************************************************/ | |
| 908 | +/***/ ((module) => { | |
| 909 | + | |
| 910 | +function _typeof(obj) { | |
| 911 | + "@babel/helpers - typeof"; | |
| 912 | + | |
| 913 | + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | |
| 914 | + return typeof obj; | |
| 915 | + } : function (obj) { | |
| 916 | + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | |
| 917 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj); | |
| 918 | +} | |
| 919 | + | |
| 920 | +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 921 | + | |
| 922 | +/***/ }), | |
| 923 | + | |
| 924 | +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 925 | +/*!****************************************************************************!*\ | |
| 926 | + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 927 | + \****************************************************************************/ | |
| 928 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 929 | + | |
| 930 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 931 | + | |
| 932 | +function _unsupportedIterableToArray(o, minLen) { | |
| 933 | + if (!o) return; | |
| 934 | + if (typeof o === "string") return arrayLikeToArray(o, minLen); | |
| 935 | + var n = Object.prototype.toString.call(o).slice(8, -1); | |
| 936 | + if (n === "Object" && o.constructor) n = o.constructor.name; | |
| 937 | + if (n === "Map" || n === "Set") return Array.from(o); | |
| 938 | + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); | |
| 939 | +} | |
| 940 | + | |
| 941 | +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 942 | + | |
| 943 | +/***/ }), | |
| 944 | + | |
| 945 | +/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js": | |
| 946 | +/*!*****************************************************************!*\ | |
| 947 | + !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***! | |
| 948 | + \*****************************************************************/ | |
| 949 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 950 | + | |
| 951 | +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 952 | + | |
| 953 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 954 | + | |
| 955 | +var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js"); | |
| 956 | + | |
| 957 | +var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js"); | |
| 958 | + | |
| 959 | +function _wrapNativeSuper(Class) { | |
| 960 | + var _cache = typeof Map === "function" ? new Map() : undefined; | |
| 961 | + | |
| 962 | + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) { | |
| 963 | + if (Class === null || !isNativeFunction(Class)) return Class; | |
| 964 | + | |
| 965 | + if (typeof Class !== "function") { | |
| 966 | + throw new TypeError("Super expression must either be null or a function"); | |
| 967 | + } | |
| 968 | + | |
| 969 | + if (typeof _cache !== "undefined") { | |
| 970 | + if (_cache.has(Class)) return _cache.get(Class); | |
| 971 | + | |
| 972 | + _cache.set(Class, Wrapper); | |
| 973 | + } | |
| 974 | + | |
| 975 | + function Wrapper() { | |
| 976 | + return construct(Class, arguments, getPrototypeOf(this).constructor); | |
| 977 | + } | |
| 978 | + | |
| 979 | + Wrapper.prototype = Object.create(Class.prototype, { | |
| 980 | + constructor: { | |
| 981 | + value: Wrapper, | |
| 982 | + enumerable: false, | |
| 983 | + writable: true, | |
| 984 | + configurable: true | |
| 985 | + } | |
| 986 | + }); | |
| 987 | + return setPrototypeOf(Wrapper, Class); | |
| 988 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 989 | + return _wrapNativeSuper(Class); | |
| 990 | +} | |
| 991 | + | |
| 992 | +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 993 | + | |
| 994 | +/***/ }), | |
| 995 | + | |
| 996 | +/***/ "../node_modules/@babel/runtime/regenerator/index.js": | |
| 997 | +/*!***********************************************************!*\ | |
| 998 | + !*** ../node_modules/@babel/runtime/regenerator/index.js ***! | |
| 999 | + \***********************************************************/ | |
| 1000 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1001 | + | |
| 1002 | +// TODO(Babel 8): Remove this file. | |
| 1003 | + | |
| 1004 | +var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); | |
| 1005 | +module.exports = runtime; | |
| 1006 | + | |
| 1007 | +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | |
| 1008 | +try { | |
| 1009 | + regeneratorRuntime = runtime; | |
| 1010 | +} catch (accidentalStrictMode) { | |
| 1011 | + if (typeof globalThis === "object") { | |
| 1012 | + globalThis.regeneratorRuntime = runtime; | |
| 1013 | + } else { | |
| 1014 | + Function("r", "regeneratorRuntime = r")(runtime); | |
| 1015 | + } | |
| 1016 | +} | |
| 1017 | + | |
| 1018 | + | |
| 1019 | +/***/ }), | |
| 1020 | + | |
| 1021 | +/***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js": | |
| 1022 | +/*!******************************************************************!*\ | |
| 1023 | + !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***! | |
| 1024 | + \******************************************************************/ | |
| 1025 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 1026 | + | |
| 1027 | +"use strict"; | |
| 1028 | +__webpack_require__.r(__webpack_exports__); | |
| 1029 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1030 | +/* harmony export */ "MiddlewareArray": () => (/* binding */ MiddlewareArray), | |
| 1031 | +/* harmony export */ "TaskAbortError": () => (/* binding */ TaskAbortError), | |
| 1032 | +/* harmony export */ "__DO_NOT_USE__ActionTypes": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.__DO_NOT_USE__ActionTypes), | |
| 1033 | +/* harmony export */ "addListener": () => (/* binding */ addListener), | |
| 1034 | +/* harmony export */ "applyMiddleware": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware), | |
| 1035 | +/* harmony export */ "bindActionCreators": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.bindActionCreators), | |
| 1036 | +/* harmony export */ "clearAllListeners": () => (/* binding */ clearAllListeners), | |
| 1037 | +/* harmony export */ "combineReducers": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers), | |
| 1038 | +/* harmony export */ "compose": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.compose), | |
| 1039 | +/* harmony export */ "configureStore": () => (/* binding */ configureStore), | |
| 1040 | +/* harmony export */ "createAction": () => (/* binding */ createAction), | |
| 1041 | +/* harmony export */ "createAsyncThunk": () => (/* binding */ createAsyncThunk), | |
| 1042 | +/* harmony export */ "createDraftSafeSelector": () => (/* binding */ createDraftSafeSelector), | |
| 1043 | +/* harmony export */ "createEntityAdapter": () => (/* binding */ createEntityAdapter), | |
| 1044 | +/* harmony export */ "createImmutableStateInvariantMiddleware": () => (/* binding */ createImmutableStateInvariantMiddleware), | |
| 1045 | +/* harmony export */ "createListenerMiddleware": () => (/* binding */ createListenerMiddleware), | |
| 1046 | +/* harmony export */ "createNextState": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]), | |
| 1047 | +/* harmony export */ "createReducer": () => (/* binding */ createReducer), | |
| 1048 | +/* harmony export */ "createSelector": () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector), | |
| 1049 | +/* harmony export */ "createSerializableStateInvariantMiddleware": () => (/* binding */ createSerializableStateInvariantMiddleware), | |
| 1050 | +/* harmony export */ "createSlice": () => (/* binding */ createSlice), | |
| 1051 | +/* harmony export */ "createStore": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore), | |
| 1052 | +/* harmony export */ "current": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current), | |
| 1053 | +/* harmony export */ "findNonSerializableValue": () => (/* binding */ findNonSerializableValue), | |
| 1054 | +/* harmony export */ "freeze": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze), | |
| 1055 | +/* harmony export */ "getDefaultMiddleware": () => (/* binding */ getDefaultMiddleware), | |
| 1056 | +/* harmony export */ "getType": () => (/* binding */ getType), | |
| 1057 | +/* harmony export */ "isAllOf": () => (/* binding */ isAllOf), | |
| 1058 | +/* harmony export */ "isAnyOf": () => (/* binding */ isAnyOf), | |
| 1059 | +/* harmony export */ "isAsyncThunkAction": () => (/* binding */ isAsyncThunkAction), | |
| 1060 | +/* harmony export */ "isDraft": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft), | |
| 1061 | +/* harmony export */ "isFulfilled": () => (/* binding */ isFulfilled), | |
| 1062 | +/* harmony export */ "isImmutableDefault": () => (/* binding */ isImmutableDefault), | |
| 1063 | +/* harmony export */ "isPending": () => (/* binding */ isPending), | |
| 1064 | +/* harmony export */ "isPlain": () => (/* binding */ isPlain), | |
| 1065 | +/* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject), | |
| 1066 | +/* harmony export */ "isRejected": () => (/* binding */ isRejected), | |
| 1067 | +/* harmony export */ "isRejectedWithValue": () => (/* binding */ isRejectedWithValue), | |
| 1068 | +/* harmony export */ "legacy_createStore": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore), | |
| 1069 | +/* harmony export */ "miniSerializeError": () => (/* binding */ miniSerializeError), | |
| 1070 | +/* harmony export */ "nanoid": () => (/* binding */ nanoid), | |
| 1071 | +/* harmony export */ "original": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original), | |
| 1072 | +/* harmony export */ "removeListener": () => (/* binding */ removeListener), | |
| 1073 | +/* harmony export */ "unwrapResult": () => (/* binding */ unwrapResult) | |
| 1074 | +/* harmony export */ }); | |
| 1075 | +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs"); | |
| 1076 | +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js"); | |
| 1077 | +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js"); | |
| 1078 | +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js"); | |
| 1079 | +var __extends = (undefined && undefined.__extends) || (function () { | |
| 1080 | + var extendStatics = function (d, b) { | |
| 1081 | + extendStatics = Object.setPrototypeOf || | |
| 1082 | + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | |
| 1083 | + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | |
| 1084 | + return extendStatics(d, b); | |
| 1085 | + }; | |
| 1086 | + return function (d, b) { | |
| 1087 | + if (typeof b !== "function" && b !== null) | |
| 1088 | + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | |
| 1089 | + extendStatics(d, b); | |
| 1090 | + function __() { this.constructor = d; } | |
| 1091 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | |
| 1092 | + }; | |
| 1093 | +})(); | |
| 1094 | +var __generator = (undefined && undefined.__generator) || function (thisArg, body) { | |
| 1095 | + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | |
| 1096 | + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | |
| 1097 | + function verb(n) { return function (v) { return step([n, v]); }; } | |
| 1098 | + function step(op) { | |
| 1099 | + if (f) throw new TypeError("Generator is already executing."); | |
| 1100 | + while (_) try { | |
| 1101 | + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | |
| 1102 | + if (y = 0, t) op = [op[0] & 2, t.value]; | |
| 1103 | + switch (op[0]) { | |
| 1104 | + case 0: case 1: t = op; break; | |
| 1105 | + case 4: _.label++; return { value: op[1], done: false }; | |
| 1106 | + case 5: _.label++; y = op[1]; op = [0]; continue; | |
| 1107 | + case 7: op = _.ops.pop(); _.trys.pop(); continue; | |
| 1108 | + default: | |
| 1109 | + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | |
| 1110 | + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | |
| 1111 | + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | |
| 1112 | + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | |
| 1113 | + if (t[2]) _.ops.pop(); | |
| 1114 | + _.trys.pop(); continue; | |
| 1115 | + } | |
| 1116 | + op = body.call(thisArg, _); | |
| 1117 | + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | |
| 1118 | + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | |
| 1119 | + } | |
| 1120 | +}; | |
| 1121 | +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) { | |
| 1122 | + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | |
| 1123 | + to[j] = from[i]; | |
| 1124 | + return to; | |
| 1125 | +}; | |
| 1126 | +var __defProp = Object.defineProperty; | |
| 1127 | +var __defProps = Object.defineProperties; | |
| 1128 | +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | |
| 1129 | +var __getOwnPropSymbols = Object.getOwnPropertySymbols; | |
| 1130 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 1131 | +var __propIsEnum = Object.prototype.propertyIsEnumerable; | |
| 1132 | +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; }; | |
| 1133 | +var __spreadValues = function (a, b) { | |
| 1134 | + for (var prop in b || (b = {})) | |
| 1135 | + if (__hasOwnProp.call(b, prop)) | |
| 1136 | + __defNormalProp(a, prop, b[prop]); | |
| 1137 | + if (__getOwnPropSymbols) | |
| 1138 | + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) { | |
| 1139 | + var prop = _c[_i]; | |
| 1140 | + if (__propIsEnum.call(b, prop)) | |
| 1141 | + __defNormalProp(a, prop, b[prop]); | |
| 1142 | + } | |
| 1143 | + return a; | |
| 1144 | +}; | |
| 1145 | +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); }; | |
| 1146 | +var __async = function (__this, __arguments, generator) { | |
| 1147 | + return new Promise(function (resolve, reject) { | |
| 1148 | + var fulfilled = function (value) { | |
| 1149 | + try { | |
| 1150 | + step(generator.next(value)); | |
| 1151 | + } | |
| 1152 | + catch (e) { | |
| 1153 | + reject(e); | |
| 1154 | + } | |
| 1155 | + }; | |
| 1156 | + var rejected = function (value) { | |
| 1157 | + try { | |
| 1158 | + step(generator.throw(value)); | |
| 1159 | + } | |
| 1160 | + catch (e) { | |
| 1161 | + reject(e); | |
| 1162 | + } | |
| 1163 | + }; | |
| 1164 | + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); }; | |
| 1165 | + step((generator = generator.apply(__this, __arguments)).next()); | |
| 1166 | + }); | |
| 1167 | +}; | |
| 1168 | +// src/index.ts | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | +// src/createDraftSafeSelector.ts | |
| 1174 | + | |
| 1175 | + | |
| 1176 | +var createDraftSafeSelector = function () { | |
| 1177 | + var args = []; | |
| 1178 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 1179 | + args[_i] = arguments[_i]; | |
| 1180 | + } | |
| 1181 | + var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args); | |
| 1182 | + var wrappedSelector = function (value) { | |
| 1183 | + var rest = []; | |
| 1184 | + for (var _i = 1; _i < arguments.length; _i++) { | |
| 1185 | + rest[_i - 1] = arguments[_i]; | |
| 1186 | + } | |
| 1187 | + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest)); | |
| 1188 | + }; | |
| 1189 | + return wrappedSelector; | |
| 1190 | +}; | |
| 1191 | +// src/configureStore.ts | |
| 1192 | + | |
| 1193 | +// src/devtoolsExtension.ts | |
| 1194 | + | |
| 1195 | +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () { | |
| 1196 | + if (arguments.length === 0) | |
| 1197 | + return void 0; | |
| 1198 | + if (typeof arguments[0] === "object") | |
| 1199 | + return redux__WEBPACK_IMPORTED_MODULE_0__.compose; | |
| 1200 | + return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments); | |
| 1201 | +}; | |
| 1202 | +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () { | |
| 1203 | + return function (noop2) { | |
| 1204 | + return noop2; | |
| 1205 | + }; | |
| 1206 | +}; | |
| 1207 | +// src/isPlainObject.ts | |
| 1208 | +function isPlainObject(value) { | |
| 1209 | + if (typeof value !== "object" || value === null) | |
| 1210 | + return false; | |
| 1211 | + var proto = Object.getPrototypeOf(value); | |
| 1212 | + if (proto === null) | |
| 1213 | + return true; | |
| 1214 | + var baseProto = proto; | |
| 1215 | + while (Object.getPrototypeOf(baseProto) !== null) { | |
| 1216 | + baseProto = Object.getPrototypeOf(baseProto); | |
| 1217 | + } | |
| 1218 | + return proto === baseProto; | |
| 1219 | +} | |
| 1220 | +// src/getDefaultMiddleware.ts | |
| 1221 | + | |
| 1222 | +// src/utils.ts | |
| 1223 | +function getTimeMeasureUtils(maxDelay, fnName) { | |
| 1224 | + var elapsed = 0; | |
| 1225 | + return { | |
| 1226 | + measureTime: function (fn) { | |
| 1227 | + var started = Date.now(); | |
| 1228 | + try { | |
| 1229 | + return fn(); | |
| 1230 | + } | |
| 1231 | + finally { | |
| 1232 | + var finished = Date.now(); | |
| 1233 | + elapsed += finished - started; | |
| 1234 | + } | |
| 1235 | + }, | |
| 1236 | + warnIfExceeded: function () { | |
| 1237 | + if (elapsed > maxDelay) { | |
| 1238 | + console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that."); | |
| 1239 | + } | |
| 1240 | + } | |
| 1241 | + }; | |
| 1242 | +} | |
| 1243 | +var MiddlewareArray = /** @class */ (function (_super) { | |
| 1244 | + __extends(MiddlewareArray, _super); | |
| 1245 | + function MiddlewareArray() { | |
| 1246 | + var args = []; | |
| 1247 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 1248 | + args[_i] = arguments[_i]; | |
| 1249 | + } | |
| 1250 | + var _this = _super.apply(this, args) || this; | |
| 1251 | + Object.setPrototypeOf(_this, MiddlewareArray.prototype); | |
| 1252 | + return _this; | |
| 1253 | + } | |
| 1254 | + Object.defineProperty(MiddlewareArray, Symbol.species, { | |
| 1255 | + get: function () { | |
| 1256 | + return MiddlewareArray; | |
| 1257 | + }, | |
| 1258 | + enumerable: false, | |
| 1259 | + configurable: true | |
| 1260 | + }); | |
| 1261 | + MiddlewareArray.prototype.concat = function () { | |
| 1262 | + var arr = []; | |
| 1263 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 1264 | + arr[_i] = arguments[_i]; | |
| 1265 | + } | |
| 1266 | + return _super.prototype.concat.apply(this, arr); | |
| 1267 | + }; | |
| 1268 | + MiddlewareArray.prototype.prepend = function () { | |
| 1269 | + var arr = []; | |
| 1270 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 1271 | + arr[_i] = arguments[_i]; | |
| 1272 | + } | |
| 1273 | + if (arr.length === 1 && Array.isArray(arr[0])) { | |
| 1274 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))(); | |
| 1275 | + } | |
| 1276 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))(); | |
| 1277 | + }; | |
| 1278 | + return MiddlewareArray; | |
| 1279 | +}(Array)); | |
| 1280 | +// src/immutableStateInvariantMiddleware.ts | |
| 1281 | +var isProduction = "development" === "production"; | |
| 1282 | +var prefix = "Invariant failed"; | |
| 1283 | +function invariant(condition, message) { | |
| 1284 | + if (condition) { | |
| 1285 | + return; | |
| 1286 | + } | |
| 1287 | + if (isProduction) { | |
| 1288 | + throw new Error(prefix); | |
| 1289 | + } | |
| 1290 | + throw new Error(prefix + ": " + (message || "")); | |
| 1291 | +} | |
| 1292 | +function stringify(obj, serializer, indent, decycler) { | |
| 1293 | + return JSON.stringify(obj, getSerialize(serializer, decycler), indent); | |
| 1294 | +} | |
| 1295 | +function getSerialize(serializer, decycler) { | |
| 1296 | + var stack = [], keys = []; | |
| 1297 | + if (!decycler) | |
| 1298 | + decycler = function (_, value) { | |
| 1299 | + if (stack[0] === value) | |
| 1300 | + return "[Circular ~]"; | |
| 1301 | + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; | |
| 1302 | + }; | |
| 1303 | + return function (key, value) { | |
| 1304 | + if (stack.length > 0) { | |
| 1305 | + var thisPos = stack.indexOf(this); | |
| 1306 | + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); | |
| 1307 | + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); | |
| 1308 | + if (~stack.indexOf(value)) | |
| 1309 | + value = decycler.call(this, key, value); | |
| 1310 | + } | |
| 1311 | + else | |
| 1312 | + stack.push(value); | |
| 1313 | + return serializer == null ? value : serializer.call(this, key, value); | |
| 1314 | + }; | |
| 1315 | +} | |
| 1316 | +function isImmutableDefault(value) { | |
| 1317 | + return typeof value !== "object" || value === null || typeof value === "undefined" || Object.isFrozen(value); | |
| 1318 | +} | |
| 1319 | +function trackForMutations(isImmutable, ignorePaths, obj) { | |
| 1320 | + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj); | |
| 1321 | + return { | |
| 1322 | + detectMutations: function () { | |
| 1323 | + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj); | |
| 1324 | + } | |
| 1325 | + }; | |
| 1326 | +} | |
| 1327 | +function trackProperties(isImmutable, ignorePaths, obj, path) { | |
| 1328 | + if (ignorePaths === void 0) { ignorePaths = []; } | |
| 1329 | + if (path === void 0) { path = ""; } | |
| 1330 | + var tracked = { value: obj }; | |
| 1331 | + if (!isImmutable(obj)) { | |
| 1332 | + tracked.children = {}; | |
| 1333 | + for (var key in obj) { | |
| 1334 | + var childPath = path ? path + "." + key : key; | |
| 1335 | + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) { | |
| 1336 | + continue; | |
| 1337 | + } | |
| 1338 | + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath); | |
| 1339 | + } | |
| 1340 | + } | |
| 1341 | + return tracked; | |
| 1342 | +} | |
| 1343 | +function detectMutations(isImmutable, ignorePaths, trackedProperty, obj, sameParentRef, path) { | |
| 1344 | + if (ignorePaths === void 0) { ignorePaths = []; } | |
| 1345 | + if (sameParentRef === void 0) { sameParentRef = false; } | |
| 1346 | + if (path === void 0) { path = ""; } | |
| 1347 | + var prevObj = trackedProperty ? trackedProperty.value : void 0; | |
| 1348 | + var sameRef = prevObj === obj; | |
| 1349 | + if (sameParentRef && !sameRef && !Number.isNaN(obj)) { | |
| 1350 | + return { wasMutated: true, path: path }; | |
| 1351 | + } | |
| 1352 | + if (isImmutable(prevObj) || isImmutable(obj)) { | |
| 1353 | + return { wasMutated: false }; | |
| 1354 | + } | |
| 1355 | + var keysToDetect = {}; | |
| 1356 | + for (var key in trackedProperty.children) { | |
| 1357 | + keysToDetect[key] = true; | |
| 1358 | + } | |
| 1359 | + for (var key in obj) { | |
| 1360 | + keysToDetect[key] = true; | |
| 1361 | + } | |
| 1362 | + for (var key in keysToDetect) { | |
| 1363 | + var childPath = path ? path + "." + key : key; | |
| 1364 | + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) { | |
| 1365 | + continue; | |
| 1366 | + } | |
| 1367 | + var result = detectMutations(isImmutable, ignorePaths, trackedProperty.children[key], obj[key], sameRef, childPath); | |
| 1368 | + if (result.wasMutated) { | |
| 1369 | + return result; | |
| 1370 | + } | |
| 1371 | + } | |
| 1372 | + return { wasMutated: false }; | |
| 1373 | +} | |
| 1374 | +function createImmutableStateInvariantMiddleware(options) { | |
| 1375 | + if (options === void 0) { options = {}; } | |
| 1376 | + if (false) {} | |
| 1377 | + var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore; | |
| 1378 | + ignoredPaths = ignoredPaths || ignore; | |
| 1379 | + var track = trackForMutations.bind(null, isImmutable, ignoredPaths); | |
| 1380 | + return function (_c) { | |
| 1381 | + var getState = _c.getState; | |
| 1382 | + var state = getState(); | |
| 1383 | + var tracker = track(state); | |
| 1384 | + var result; | |
| 1385 | + return function (next) { return function (action) { | |
| 1386 | + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); | |
| 1387 | + measureUtils.measureTime(function () { | |
| 1388 | + state = getState(); | |
| 1389 | + result = tracker.detectMutations(); | |
| 1390 | + tracker = track(state); | |
| 1391 | + invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); | |
| 1392 | + }); | |
| 1393 | + var dispatchedAction = next(action); | |
| 1394 | + measureUtils.measureTime(function () { | |
| 1395 | + state = getState(); | |
| 1396 | + result = tracker.detectMutations(); | |
| 1397 | + tracker = track(state); | |
| 1398 | + result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); | |
| 1399 | + }); | |
| 1400 | + measureUtils.warnIfExceeded(); | |
| 1401 | + return dispatchedAction; | |
| 1402 | + }; }; | |
| 1403 | + }; | |
| 1404 | +} | |
| 1405 | +// src/serializableStateInvariantMiddleware.ts | |
| 1406 | +function isPlain(val) { | |
| 1407 | + var type = typeof val; | |
| 1408 | + return type === "undefined" || val === null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val); | |
| 1409 | +} | |
| 1410 | +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths) { | |
| 1411 | + if (path === void 0) { path = ""; } | |
| 1412 | + if (isSerializable === void 0) { isSerializable = isPlain; } | |
| 1413 | + if (ignoredPaths === void 0) { ignoredPaths = []; } | |
| 1414 | + var foundNestedSerializable; | |
| 1415 | + if (!isSerializable(value)) { | |
| 1416 | + return { | |
| 1417 | + keyPath: path || "<root>", | |
| 1418 | + value: value | |
| 1419 | + }; | |
| 1420 | + } | |
| 1421 | + if (typeof value !== "object" || value === null) { | |
| 1422 | + return false; | |
| 1423 | + } | |
| 1424 | + var entries = getEntries != null ? getEntries(value) : Object.entries(value); | |
| 1425 | + var hasIgnoredPaths = ignoredPaths.length > 0; | |
| 1426 | + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | |
| 1427 | + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1]; | |
| 1428 | + var nestedPath = path ? path + "." + key : key; | |
| 1429 | + if (hasIgnoredPaths && ignoredPaths.indexOf(nestedPath) >= 0) { | |
| 1430 | + continue; | |
| 1431 | + } | |
| 1432 | + if (!isSerializable(nestedValue)) { | |
| 1433 | + return { | |
| 1434 | + keyPath: nestedPath, | |
| 1435 | + value: nestedValue | |
| 1436 | + }; | |
| 1437 | + } | |
| 1438 | + if (typeof nestedValue === "object") { | |
| 1439 | + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths); | |
| 1440 | + if (foundNestedSerializable) { | |
| 1441 | + return foundNestedSerializable; | |
| 1442 | + } | |
| 1443 | + } | |
| 1444 | + } | |
| 1445 | + return false; | |
| 1446 | +} | |
| 1447 | +function createSerializableStateInvariantMiddleware(options) { | |
| 1448 | + if (options === void 0) { options = {}; } | |
| 1449 | + if (false) {} | |
| 1450 | + var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j; | |
| 1451 | + return function (storeAPI) { return function (next) { return function (action) { | |
| 1452 | + var result = next(action); | |
| 1453 | + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); | |
| 1454 | + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) { | |
| 1455 | + measureUtils.measureTime(function () { | |
| 1456 | + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths); | |
| 1457 | + if (foundActionNonSerializableValue) { | |
| 1458 | + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value; | |
| 1459 | + console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)"); | |
| 1460 | + } | |
| 1461 | + }); | |
| 1462 | + } | |
| 1463 | + if (!ignoreState) { | |
| 1464 | + measureUtils.measureTime(function () { | |
| 1465 | + var state = storeAPI.getState(); | |
| 1466 | + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths); | |
| 1467 | + if (foundStateNonSerializableValue) { | |
| 1468 | + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value; | |
| 1469 | + console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"); | |
| 1470 | + } | |
| 1471 | + }); | |
| 1472 | + measureUtils.warnIfExceeded(); | |
| 1473 | + } | |
| 1474 | + return result; | |
| 1475 | + }; }; }; | |
| 1476 | +} | |
| 1477 | +// src/getDefaultMiddleware.ts | |
| 1478 | +function isBoolean(x) { | |
| 1479 | + return typeof x === "boolean"; | |
| 1480 | +} | |
| 1481 | +function curryGetDefaultMiddleware() { | |
| 1482 | + return function curriedGetDefaultMiddleware(options) { | |
| 1483 | + return getDefaultMiddleware(options); | |
| 1484 | + }; | |
| 1485 | +} | |
| 1486 | +function getDefaultMiddleware(options) { | |
| 1487 | + if (options === void 0) { options = {}; } | |
| 1488 | + var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e; | |
| 1489 | + var middlewareArray = new MiddlewareArray(); | |
| 1490 | + if (thunk) { | |
| 1491 | + if (isBoolean(thunk)) { | |
| 1492 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]); | |
| 1493 | + } | |
| 1494 | + else { | |
| 1495 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument)); | |
| 1496 | + } | |
| 1497 | + } | |
| 1498 | + if (true) { | |
| 1499 | + if (immutableCheck) { | |
| 1500 | + var immutableOptions = {}; | |
| 1501 | + if (!isBoolean(immutableCheck)) { | |
| 1502 | + immutableOptions = immutableCheck; | |
| 1503 | + } | |
| 1504 | + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions)); | |
| 1505 | + } | |
| 1506 | + if (serializableCheck) { | |
| 1507 | + var serializableOptions = {}; | |
| 1508 | + if (!isBoolean(serializableCheck)) { | |
| 1509 | + serializableOptions = serializableCheck; | |
| 1510 | + } | |
| 1511 | + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions)); | |
| 1512 | + } | |
| 1513 | + } | |
| 1514 | + return middlewareArray; | |
| 1515 | +} | |
| 1516 | +// src/configureStore.ts | |
| 1517 | +var IS_PRODUCTION = "development" === "production"; | |
| 1518 | +function configureStore(options) { | |
| 1519 | + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware(); | |
| 1520 | + var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h; | |
| 1521 | + var rootReducer; | |
| 1522 | + if (typeof reducer === "function") { | |
| 1523 | + rootReducer = reducer; | |
| 1524 | + } | |
| 1525 | + else if (isPlainObject(reducer)) { | |
| 1526 | + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer); | |
| 1527 | + } | |
| 1528 | + else { | |
| 1529 | + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'); | |
| 1530 | + } | |
| 1531 | + var finalMiddleware = middleware; | |
| 1532 | + if (typeof finalMiddleware === "function") { | |
| 1533 | + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware); | |
| 1534 | + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) { | |
| 1535 | + throw new Error("when using a middleware builder function, an array of middleware must be returned"); | |
| 1536 | + } | |
| 1537 | + } | |
| 1538 | + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) { | |
| 1539 | + throw new Error("each middleware provided to configureStore must be a function"); | |
| 1540 | + } | |
| 1541 | + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware); | |
| 1542 | + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose; | |
| 1543 | + if (devTools) { | |
| 1544 | + finalCompose = composeWithDevTools(__spreadValues({ | |
| 1545 | + trace: !IS_PRODUCTION | |
| 1546 | + }, typeof devTools === "object" && devTools)); | |
| 1547 | + } | |
| 1548 | + var storeEnhancers = [middlewareEnhancer]; | |
| 1549 | + if (Array.isArray(enhancers)) { | |
| 1550 | + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers); | |
| 1551 | + } | |
| 1552 | + else if (typeof enhancers === "function") { | |
| 1553 | + storeEnhancers = enhancers(storeEnhancers); | |
| 1554 | + } | |
| 1555 | + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers); | |
| 1556 | + return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer); | |
| 1557 | +} | |
| 1558 | +// src/createAction.ts | |
| 1559 | +function createAction(type, prepareAction) { | |
| 1560 | + function actionCreator() { | |
| 1561 | + var args = []; | |
| 1562 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 1563 | + args[_i] = arguments[_i]; | |
| 1564 | + } | |
| 1565 | + if (prepareAction) { | |
| 1566 | + var prepared = prepareAction.apply(void 0, args); | |
| 1567 | + if (!prepared) { | |
| 1568 | + throw new Error("prepareAction did not return an object"); | |
| 1569 | + } | |
| 1570 | + return __spreadValues(__spreadValues({ | |
| 1571 | + type: type, | |
| 1572 | + payload: prepared.payload | |
| 1573 | + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error }); | |
| 1574 | + } | |
| 1575 | + return { type: type, payload: args[0] }; | |
| 1576 | + } | |
| 1577 | + actionCreator.toString = function () { return "" + type; }; | |
| 1578 | + actionCreator.type = type; | |
| 1579 | + actionCreator.match = function (action) { return action.type === type; }; | |
| 1580 | + return actionCreator; | |
| 1581 | +} | |
| 1582 | +function isFSA(action) { | |
| 1583 | + return isPlainObject(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey); | |
| 1584 | +} | |
| 1585 | +function isValidKey(key) { | |
| 1586 | + return ["type", "payload", "error", "meta"].indexOf(key) > -1; | |
| 1587 | +} | |
| 1588 | +function getType(actionCreator) { | |
| 1589 | + return "" + actionCreator; | |
| 1590 | +} | |
| 1591 | +// src/createReducer.ts | |
| 1592 | + | |
| 1593 | +// src/mapBuilders.ts | |
| 1594 | +function executeReducerBuilderCallback(builderCallback) { | |
| 1595 | + var actionsMap = {}; | |
| 1596 | + var actionMatchers = []; | |
| 1597 | + var defaultCaseReducer; | |
| 1598 | + var builder = { | |
| 1599 | + addCase: function (typeOrActionCreator, reducer) { | |
| 1600 | + if (true) { | |
| 1601 | + if (actionMatchers.length > 0) { | |
| 1602 | + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`"); | |
| 1603 | + } | |
| 1604 | + if (defaultCaseReducer) { | |
| 1605 | + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`"); | |
| 1606 | + } | |
| 1607 | + } | |
| 1608 | + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; | |
| 1609 | + if (type in actionsMap) { | |
| 1610 | + throw new Error("addCase cannot be called with two reducers for the same action type"); | |
| 1611 | + } | |
| 1612 | + actionsMap[type] = reducer; | |
| 1613 | + return builder; | |
| 1614 | + }, | |
| 1615 | + addMatcher: function (matcher, reducer) { | |
| 1616 | + if (true) { | |
| 1617 | + if (defaultCaseReducer) { | |
| 1618 | + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`"); | |
| 1619 | + } | |
| 1620 | + } | |
| 1621 | + actionMatchers.push({ matcher: matcher, reducer: reducer }); | |
| 1622 | + return builder; | |
| 1623 | + }, | |
| 1624 | + addDefaultCase: function (reducer) { | |
| 1625 | + if (true) { | |
| 1626 | + if (defaultCaseReducer) { | |
| 1627 | + throw new Error("`builder.addDefaultCase` can only be called once"); | |
| 1628 | + } | |
| 1629 | + } | |
| 1630 | + defaultCaseReducer = reducer; | |
| 1631 | + return builder; | |
| 1632 | + } | |
| 1633 | + }; | |
| 1634 | + builderCallback(builder); | |
| 1635 | + return [actionsMap, actionMatchers, defaultCaseReducer]; | |
| 1636 | +} | |
| 1637 | +// src/createReducer.ts | |
| 1638 | +function isStateFunction(x) { | |
| 1639 | + return typeof x === "function"; | |
| 1640 | +} | |
| 1641 | +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) { | |
| 1642 | + if (actionMatchers === void 0) { actionMatchers = []; } | |
| 1643 | + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2]; | |
| 1644 | + var getInitialState; | |
| 1645 | + if (isStateFunction(initialState)) { | |
| 1646 | + getInitialState = function () { return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(initialState(), function () { | |
| 1647 | + }); }; | |
| 1648 | + } | |
| 1649 | + else { | |
| 1650 | + var frozenInitialState_1 = (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(initialState, function () { | |
| 1651 | + }); | |
| 1652 | + getInitialState = function () { return frozenInitialState_1; }; | |
| 1653 | + } | |
| 1654 | + function reducer(state, action) { | |
| 1655 | + if (state === void 0) { state = getInitialState(); } | |
| 1656 | + var caseReducers = __spreadArray([ | |
| 1657 | + actionsMap[action.type] | |
| 1658 | + ], finalActionMatchers.filter(function (_c) { | |
| 1659 | + var matcher = _c.matcher; | |
| 1660 | + return matcher(action); | |
| 1661 | + }).map(function (_c) { | |
| 1662 | + var reducer2 = _c.reducer; | |
| 1663 | + return reducer2; | |
| 1664 | + })); | |
| 1665 | + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) { | |
| 1666 | + caseReducers = [finalDefaultCaseReducer]; | |
| 1667 | + } | |
| 1668 | + return caseReducers.reduce(function (previousState, caseReducer) { | |
| 1669 | + if (caseReducer) { | |
| 1670 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) { | |
| 1671 | + var draft = previousState; | |
| 1672 | + var result = caseReducer(draft, action); | |
| 1673 | + if (typeof result === "undefined") { | |
| 1674 | + return previousState; | |
| 1675 | + } | |
| 1676 | + return result; | |
| 1677 | + } | |
| 1678 | + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) { | |
| 1679 | + var result = caseReducer(previousState, action); | |
| 1680 | + if (typeof result === "undefined") { | |
| 1681 | + if (previousState === null) { | |
| 1682 | + return previousState; | |
| 1683 | + } | |
| 1684 | + throw Error("A case reducer on a non-draftable value must not return undefined"); | |
| 1685 | + } | |
| 1686 | + return result; | |
| 1687 | + } | |
| 1688 | + else { | |
| 1689 | + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) { | |
| 1690 | + return caseReducer(draft, action); | |
| 1691 | + }); | |
| 1692 | + } | |
| 1693 | + } | |
| 1694 | + return previousState; | |
| 1695 | + }, state); | |
| 1696 | + } | |
| 1697 | + reducer.getInitialState = getInitialState; | |
| 1698 | + return reducer; | |
| 1699 | +} | |
| 1700 | +// src/createSlice.ts | |
| 1701 | +function getType2(slice, actionKey) { | |
| 1702 | + return slice + "/" + actionKey; | |
| 1703 | +} | |
| 1704 | +function createSlice(options) { | |
| 1705 | + var name = options.name; | |
| 1706 | + if (!name) { | |
| 1707 | + throw new Error("`name` is a required option for createSlice"); | |
| 1708 | + } | |
| 1709 | + var initialState = typeof options.initialState == "function" ? options.initialState : (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(options.initialState, function () { | |
| 1710 | + }); | |
| 1711 | + var reducers = options.reducers || {}; | |
| 1712 | + var reducerNames = Object.keys(reducers); | |
| 1713 | + var sliceCaseReducersByName = {}; | |
| 1714 | + var sliceCaseReducersByType = {}; | |
| 1715 | + var actionCreators = {}; | |
| 1716 | + reducerNames.forEach(function (reducerName) { | |
| 1717 | + var maybeReducerWithPrepare = reducers[reducerName]; | |
| 1718 | + var type = getType2(name, reducerName); | |
| 1719 | + var caseReducer; | |
| 1720 | + var prepareCallback; | |
| 1721 | + if ("reducer" in maybeReducerWithPrepare) { | |
| 1722 | + caseReducer = maybeReducerWithPrepare.reducer; | |
| 1723 | + prepareCallback = maybeReducerWithPrepare.prepare; | |
| 1724 | + } | |
| 1725 | + else { | |
| 1726 | + caseReducer = maybeReducerWithPrepare; | |
| 1727 | + } | |
| 1728 | + sliceCaseReducersByName[reducerName] = caseReducer; | |
| 1729 | + sliceCaseReducersByType[type] = caseReducer; | |
| 1730 | + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type); | |
| 1731 | + }); | |
| 1732 | + function buildReducer() { | |
| 1733 | + var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f; | |
| 1734 | + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType); | |
| 1735 | + return createReducer(initialState, finalCaseReducers, actionMatchers, defaultCaseReducer); | |
| 1736 | + } | |
| 1737 | + var _reducer; | |
| 1738 | + return { | |
| 1739 | + name: name, | |
| 1740 | + reducer: function (state, action) { | |
| 1741 | + if (!_reducer) | |
| 1742 | + _reducer = buildReducer(); | |
| 1743 | + return _reducer(state, action); | |
| 1744 | + }, | |
| 1745 | + actions: actionCreators, | |
| 1746 | + caseReducers: sliceCaseReducersByName, | |
| 1747 | + getInitialState: function () { | |
| 1748 | + if (!_reducer) | |
| 1749 | + _reducer = buildReducer(); | |
| 1750 | + return _reducer.getInitialState(); | |
| 1751 | + } | |
| 1752 | + }; | |
| 1753 | +} | |
| 1754 | +// src/entities/entity_state.ts | |
| 1755 | +function getInitialEntityState() { | |
| 1756 | + return { | |
| 1757 | + ids: [], | |
| 1758 | + entities: {} | |
| 1759 | + }; | |
| 1760 | +} | |
| 1761 | +function createInitialStateFactory() { | |
| 1762 | + function getInitialState(additionalState) { | |
| 1763 | + if (additionalState === void 0) { additionalState = {}; } | |
| 1764 | + return Object.assign(getInitialEntityState(), additionalState); | |
| 1765 | + } | |
| 1766 | + return { getInitialState: getInitialState }; | |
| 1767 | +} | |
| 1768 | +// src/entities/state_selectors.ts | |
| 1769 | +function createSelectorsFactory() { | |
| 1770 | + function getSelectors(selectState) { | |
| 1771 | + var selectIds = function (state) { return state.ids; }; | |
| 1772 | + var selectEntities = function (state) { return state.entities; }; | |
| 1773 | + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); }); | |
| 1774 | + var selectId = function (_, id) { return id; }; | |
| 1775 | + var selectById = function (entities, id) { return entities[id]; }; | |
| 1776 | + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; }); | |
| 1777 | + if (!selectState) { | |
| 1778 | + return { | |
| 1779 | + selectIds: selectIds, | |
| 1780 | + selectEntities: selectEntities, | |
| 1781 | + selectAll: selectAll, | |
| 1782 | + selectTotal: selectTotal, | |
| 1783 | + selectById: createDraftSafeSelector(selectEntities, selectId, selectById) | |
| 1784 | + }; | |
| 1785 | + } | |
| 1786 | + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities); | |
| 1787 | + return { | |
| 1788 | + selectIds: createDraftSafeSelector(selectState, selectIds), | |
| 1789 | + selectEntities: selectGlobalizedEntities, | |
| 1790 | + selectAll: createDraftSafeSelector(selectState, selectAll), | |
| 1791 | + selectTotal: createDraftSafeSelector(selectState, selectTotal), | |
| 1792 | + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById) | |
| 1793 | + }; | |
| 1794 | + } | |
| 1795 | + return { getSelectors: getSelectors }; | |
| 1796 | +} | |
| 1797 | +// src/entities/state_adapter.ts | |
| 1798 | + | |
| 1799 | +function createSingleArgumentStateOperator(mutator) { | |
| 1800 | + var operator = createStateOperator(function (_, state) { return mutator(state); }); | |
| 1801 | + return function operation(state) { | |
| 1802 | + return operator(state, void 0); | |
| 1803 | + }; | |
| 1804 | +} | |
| 1805 | +function createStateOperator(mutator) { | |
| 1806 | + return function operation(state, arg) { | |
| 1807 | + function isPayloadActionArgument(arg2) { | |
| 1808 | + return isFSA(arg2); | |
| 1809 | + } | |
| 1810 | + var runMutator = function (draft) { | |
| 1811 | + if (isPayloadActionArgument(arg)) { | |
| 1812 | + mutator(arg.payload, draft); | |
| 1813 | + } | |
| 1814 | + else { | |
| 1815 | + mutator(arg, draft); | |
| 1816 | + } | |
| 1817 | + }; | |
| 1818 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) { | |
| 1819 | + runMutator(state); | |
| 1820 | + return state; | |
| 1821 | + } | |
| 1822 | + else { | |
| 1823 | + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator); | |
| 1824 | + } | |
| 1825 | + }; | |
| 1826 | +} | |
| 1827 | +// src/entities/utils.ts | |
| 1828 | +function selectIdValue(entity, selectId) { | |
| 1829 | + var key = selectId(entity); | |
| 1830 | + if ( true && key === void 0) { | |
| 1831 | + console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString()); | |
| 1832 | + } | |
| 1833 | + return key; | |
| 1834 | +} | |
| 1835 | +function ensureEntitiesArray(entities) { | |
| 1836 | + if (!Array.isArray(entities)) { | |
| 1837 | + entities = Object.values(entities); | |
| 1838 | + } | |
| 1839 | + return entities; | |
| 1840 | +} | |
| 1841 | +function splitAddedUpdatedEntities(newEntities, selectId, state) { | |
| 1842 | + newEntities = ensureEntitiesArray(newEntities); | |
| 1843 | + var added = []; | |
| 1844 | + var updated = []; | |
| 1845 | + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) { | |
| 1846 | + var entity = newEntities_1[_i]; | |
| 1847 | + var id = selectIdValue(entity, selectId); | |
| 1848 | + if (id in state.entities) { | |
| 1849 | + updated.push({ id: id, changes: entity }); | |
| 1850 | + } | |
| 1851 | + else { | |
| 1852 | + added.push(entity); | |
| 1853 | + } | |
| 1854 | + } | |
| 1855 | + return [added, updated]; | |
| 1856 | +} | |
| 1857 | +// src/entities/unsorted_state_adapter.ts | |
| 1858 | +function createUnsortedStateAdapter(selectId) { | |
| 1859 | + function addOneMutably(entity, state) { | |
| 1860 | + var key = selectIdValue(entity, selectId); | |
| 1861 | + if (key in state.entities) { | |
| 1862 | + return; | |
| 1863 | + } | |
| 1864 | + state.ids.push(key); | |
| 1865 | + state.entities[key] = entity; | |
| 1866 | + } | |
| 1867 | + function addManyMutably(newEntities, state) { | |
| 1868 | + newEntities = ensureEntitiesArray(newEntities); | |
| 1869 | + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) { | |
| 1870 | + var entity = newEntities_2[_i]; | |
| 1871 | + addOneMutably(entity, state); | |
| 1872 | + } | |
| 1873 | + } | |
| 1874 | + function setOneMutably(entity, state) { | |
| 1875 | + var key = selectIdValue(entity, selectId); | |
| 1876 | + if (!(key in state.entities)) { | |
| 1877 | + state.ids.push(key); | |
| 1878 | + } | |
| 1879 | + state.entities[key] = entity; | |
| 1880 | + } | |
| 1881 | + function setManyMutably(newEntities, state) { | |
| 1882 | + newEntities = ensureEntitiesArray(newEntities); | |
| 1883 | + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) { | |
| 1884 | + var entity = newEntities_3[_i]; | |
| 1885 | + setOneMutably(entity, state); | |
| 1886 | + } | |
| 1887 | + } | |
| 1888 | + function setAllMutably(newEntities, state) { | |
| 1889 | + newEntities = ensureEntitiesArray(newEntities); | |
| 1890 | + state.ids = []; | |
| 1891 | + state.entities = {}; | |
| 1892 | + addManyMutably(newEntities, state); | |
| 1893 | + } | |
| 1894 | + function removeOneMutably(key, state) { | |
| 1895 | + return removeManyMutably([key], state); | |
| 1896 | + } | |
| 1897 | + function removeManyMutably(keys, state) { | |
| 1898 | + var didMutate = false; | |
| 1899 | + keys.forEach(function (key) { | |
| 1900 | + if (key in state.entities) { | |
| 1901 | + delete state.entities[key]; | |
| 1902 | + didMutate = true; | |
| 1903 | + } | |
| 1904 | + }); | |
| 1905 | + if (didMutate) { | |
| 1906 | + state.ids = state.ids.filter(function (id) { return id in state.entities; }); | |
| 1907 | + } | |
| 1908 | + } | |
| 1909 | + function removeAllMutably(state) { | |
| 1910 | + Object.assign(state, { | |
| 1911 | + ids: [], | |
| 1912 | + entities: {} | |
| 1913 | + }); | |
| 1914 | + } | |
| 1915 | + function takeNewKey(keys, update, state) { | |
| 1916 | + var original2 = state.entities[update.id]; | |
| 1917 | + var updated = Object.assign({}, original2, update.changes); | |
| 1918 | + var newKey = selectIdValue(updated, selectId); | |
| 1919 | + var hasNewKey = newKey !== update.id; | |
| 1920 | + if (hasNewKey) { | |
| 1921 | + keys[update.id] = newKey; | |
| 1922 | + delete state.entities[update.id]; | |
| 1923 | + } | |
| 1924 | + state.entities[newKey] = updated; | |
| 1925 | + return hasNewKey; | |
| 1926 | + } | |
| 1927 | + function updateOneMutably(update, state) { | |
| 1928 | + return updateManyMutably([update], state); | |
| 1929 | + } | |
| 1930 | + function updateManyMutably(updates, state) { | |
| 1931 | + var newKeys = {}; | |
| 1932 | + var updatesPerEntity = {}; | |
| 1933 | + updates.forEach(function (update) { | |
| 1934 | + if (update.id in state.entities) { | |
| 1935 | + updatesPerEntity[update.id] = { | |
| 1936 | + id: update.id, | |
| 1937 | + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes) | |
| 1938 | + }; | |
| 1939 | + } | |
| 1940 | + }); | |
| 1941 | + updates = Object.values(updatesPerEntity); | |
| 1942 | + var didMutateEntities = updates.length > 0; | |
| 1943 | + if (didMutateEntities) { | |
| 1944 | + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0; | |
| 1945 | + if (didMutateIds) { | |
| 1946 | + state.ids = state.ids.map(function (id) { return newKeys[id] || id; }); | |
| 1947 | + } | |
| 1948 | + } | |
| 1949 | + } | |
| 1950 | + function upsertOneMutably(entity, state) { | |
| 1951 | + return upsertManyMutably([entity], state); | |
| 1952 | + } | |
| 1953 | + function upsertManyMutably(newEntities, state) { | |
| 1954 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 1955 | + updateManyMutably(updated, state); | |
| 1956 | + addManyMutably(added, state); | |
| 1957 | + } | |
| 1958 | + return { | |
| 1959 | + removeAll: createSingleArgumentStateOperator(removeAllMutably), | |
| 1960 | + addOne: createStateOperator(addOneMutably), | |
| 1961 | + addMany: createStateOperator(addManyMutably), | |
| 1962 | + setOne: createStateOperator(setOneMutably), | |
| 1963 | + setMany: createStateOperator(setManyMutably), | |
| 1964 | + setAll: createStateOperator(setAllMutably), | |
| 1965 | + updateOne: createStateOperator(updateOneMutably), | |
| 1966 | + updateMany: createStateOperator(updateManyMutably), | |
| 1967 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 1968 | + upsertMany: createStateOperator(upsertManyMutably), | |
| 1969 | + removeOne: createStateOperator(removeOneMutably), | |
| 1970 | + removeMany: createStateOperator(removeManyMutably) | |
| 1971 | + }; | |
| 1972 | +} | |
| 1973 | +// src/entities/sorted_state_adapter.ts | |
| 1974 | +function createSortedStateAdapter(selectId, sort) { | |
| 1975 | + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll; | |
| 1976 | + function addOneMutably(entity, state) { | |
| 1977 | + return addManyMutably([entity], state); | |
| 1978 | + } | |
| 1979 | + function addManyMutably(newEntities, state) { | |
| 1980 | + newEntities = ensureEntitiesArray(newEntities); | |
| 1981 | + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); }); | |
| 1982 | + if (models.length !== 0) { | |
| 1983 | + merge(models, state); | |
| 1984 | + } | |
| 1985 | + } | |
| 1986 | + function setOneMutably(entity, state) { | |
| 1987 | + return setManyMutably([entity], state); | |
| 1988 | + } | |
| 1989 | + function setManyMutably(newEntities, state) { | |
| 1990 | + newEntities = ensureEntitiesArray(newEntities); | |
| 1991 | + if (newEntities.length !== 0) { | |
| 1992 | + merge(newEntities, state); | |
| 1993 | + } | |
| 1994 | + } | |
| 1995 | + function setAllMutably(newEntities, state) { | |
| 1996 | + newEntities = ensureEntitiesArray(newEntities); | |
| 1997 | + state.entities = {}; | |
| 1998 | + state.ids = []; | |
| 1999 | + addManyMutably(newEntities, state); | |
| 2000 | + } | |
| 2001 | + function updateOneMutably(update, state) { | |
| 2002 | + return updateManyMutably([update], state); | |
| 2003 | + } | |
| 2004 | + function takeUpdatedModel(models, update, state) { | |
| 2005 | + if (!(update.id in state.entities)) { | |
| 2006 | + return false; | |
| 2007 | + } | |
| 2008 | + var original2 = state.entities[update.id]; | |
| 2009 | + var updated = Object.assign({}, original2, update.changes); | |
| 2010 | + var newKey = selectIdValue(updated, selectId); | |
| 2011 | + delete state.entities[update.id]; | |
| 2012 | + models.push(updated); | |
| 2013 | + return newKey !== update.id; | |
| 2014 | + } | |
| 2015 | + function updateManyMutably(updates, state) { | |
| 2016 | + var models = []; | |
| 2017 | + updates.forEach(function (update) { return takeUpdatedModel(models, update, state); }); | |
| 2018 | + if (models.length !== 0) { | |
| 2019 | + merge(models, state); | |
| 2020 | + } | |
| 2021 | + } | |
| 2022 | + function upsertOneMutably(entity, state) { | |
| 2023 | + return upsertManyMutably([entity], state); | |
| 2024 | + } | |
| 2025 | + function upsertManyMutably(newEntities, state) { | |
| 2026 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 2027 | + updateManyMutably(updated, state); | |
| 2028 | + addManyMutably(added, state); | |
| 2029 | + } | |
| 2030 | + function areArraysEqual(a, b) { | |
| 2031 | + if (a.length !== b.length) { | |
| 2032 | + return false; | |
| 2033 | + } | |
| 2034 | + for (var i = 0; i < a.length && i < b.length; i++) { | |
| 2035 | + if (a[i] === b[i]) { | |
| 2036 | + continue; | |
| 2037 | + } | |
| 2038 | + return false; | |
| 2039 | + } | |
| 2040 | + return true; | |
| 2041 | + } | |
| 2042 | + function merge(models, state) { | |
| 2043 | + models.forEach(function (model) { | |
| 2044 | + state.entities[selectId(model)] = model; | |
| 2045 | + }); | |
| 2046 | + var allEntities = Object.values(state.entities); | |
| 2047 | + allEntities.sort(sort); | |
| 2048 | + var newSortedIds = allEntities.map(selectId); | |
| 2049 | + var ids = state.ids; | |
| 2050 | + if (!areArraysEqual(ids, newSortedIds)) { | |
| 2051 | + state.ids = newSortedIds; | |
| 2052 | + } | |
| 2053 | + } | |
| 2054 | + return { | |
| 2055 | + removeOne: removeOne, | |
| 2056 | + removeMany: removeMany, | |
| 2057 | + removeAll: removeAll, | |
| 2058 | + addOne: createStateOperator(addOneMutably), | |
| 2059 | + updateOne: createStateOperator(updateOneMutably), | |
| 2060 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 2061 | + setOne: createStateOperator(setOneMutably), | |
| 2062 | + setMany: createStateOperator(setManyMutably), | |
| 2063 | + setAll: createStateOperator(setAllMutably), | |
| 2064 | + addMany: createStateOperator(addManyMutably), | |
| 2065 | + updateMany: createStateOperator(updateManyMutably), | |
| 2066 | + upsertMany: createStateOperator(upsertManyMutably) | |
| 2067 | + }; | |
| 2068 | +} | |
| 2069 | +// src/entities/create_adapter.ts | |
| 2070 | +function createEntityAdapter(options) { | |
| 2071 | + if (options === void 0) { options = {}; } | |
| 2072 | + var _c = __spreadValues({ | |
| 2073 | + sortComparer: false, | |
| 2074 | + selectId: function (instance) { return instance.id; } | |
| 2075 | + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer; | |
| 2076 | + var stateFactory = createInitialStateFactory(); | |
| 2077 | + var selectorsFactory = createSelectorsFactory(); | |
| 2078 | + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId); | |
| 2079 | + return __spreadValues(__spreadValues(__spreadValues({ | |
| 2080 | + selectId: selectId, | |
| 2081 | + sortComparer: sortComparer | |
| 2082 | + }, stateFactory), selectorsFactory), stateAdapter); | |
| 2083 | +} | |
| 2084 | +// src/nanoid.ts | |
| 2085 | +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; | |
| 2086 | +var nanoid = function (size) { | |
| 2087 | + if (size === void 0) { size = 21; } | |
| 2088 | + var id = ""; | |
| 2089 | + var i = size; | |
| 2090 | + while (i--) { | |
| 2091 | + id += urlAlphabet[Math.random() * 64 | 0]; | |
| 2092 | + } | |
| 2093 | + return id; | |
| 2094 | +}; | |
| 2095 | +// src/createAsyncThunk.ts | |
| 2096 | +var commonProperties = [ | |
| 2097 | + "name", | |
| 2098 | + "message", | |
| 2099 | + "stack", | |
| 2100 | + "code" | |
| 2101 | +]; | |
| 2102 | +var RejectWithValue = /** @class */ (function () { | |
| 2103 | + function RejectWithValue(payload, meta) { | |
| 2104 | + this.payload = payload; | |
| 2105 | + this.meta = meta; | |
| 2106 | + } | |
| 2107 | + return RejectWithValue; | |
| 2108 | +}()); | |
| 2109 | +var FulfillWithMeta = /** @class */ (function () { | |
| 2110 | + function FulfillWithMeta(payload, meta) { | |
| 2111 | + this.payload = payload; | |
| 2112 | + this.meta = meta; | |
| 2113 | + } | |
| 2114 | + return FulfillWithMeta; | |
| 2115 | +}()); | |
| 2116 | +var miniSerializeError = function (value) { | |
| 2117 | + if (typeof value === "object" && value !== null) { | |
| 2118 | + var simpleError = {}; | |
| 2119 | + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) { | |
| 2120 | + var property = commonProperties_1[_i]; | |
| 2121 | + if (typeof value[property] === "string") { | |
| 2122 | + simpleError[property] = value[property]; | |
| 2123 | + } | |
| 2124 | + } | |
| 2125 | + return simpleError; | |
| 2126 | + } | |
| 2127 | + return { message: String(value) }; | |
| 2128 | +}; | |
| 2129 | +function createAsyncThunk(typePrefix, payloadCreator, options) { | |
| 2130 | + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({ | |
| 2131 | + payload: payload, | |
| 2132 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 2133 | + arg: arg, | |
| 2134 | + requestId: requestId, | |
| 2135 | + requestStatus: "fulfilled" | |
| 2136 | + }) | |
| 2137 | + }); }); | |
| 2138 | + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({ | |
| 2139 | + payload: void 0, | |
| 2140 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 2141 | + arg: arg, | |
| 2142 | + requestId: requestId, | |
| 2143 | + requestStatus: "pending" | |
| 2144 | + }) | |
| 2145 | + }); }); | |
| 2146 | + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({ | |
| 2147 | + payload: payload, | |
| 2148 | + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), | |
| 2149 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 2150 | + arg: arg, | |
| 2151 | + requestId: requestId, | |
| 2152 | + rejectedWithValue: !!payload, | |
| 2153 | + requestStatus: "rejected", | |
| 2154 | + aborted: (error == null ? void 0 : error.name) === "AbortError", | |
| 2155 | + condition: (error == null ? void 0 : error.name) === "ConditionError" | |
| 2156 | + }) | |
| 2157 | + }); }); | |
| 2158 | + var displayedWarning = false; | |
| 2159 | + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () { | |
| 2160 | + function class_1() { | |
| 2161 | + this.signal = { | |
| 2162 | + aborted: false, | |
| 2163 | + addEventListener: function () { | |
| 2164 | + }, | |
| 2165 | + dispatchEvent: function () { | |
| 2166 | + return false; | |
| 2167 | + }, | |
| 2168 | + onabort: function () { | |
| 2169 | + }, | |
| 2170 | + removeEventListener: function () { | |
| 2171 | + } | |
| 2172 | + }; | |
| 2173 | + } | |
| 2174 | + class_1.prototype.abort = function () { | |
| 2175 | + if (true) { | |
| 2176 | + if (!displayedWarning) { | |
| 2177 | + displayedWarning = true; | |
| 2178 | + console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'."); | |
| 2179 | + } | |
| 2180 | + } | |
| 2181 | + }; | |
| 2182 | + return class_1; | |
| 2183 | + }()); | |
| 2184 | + function actionCreator(arg) { | |
| 2185 | + return function (dispatch, getState, extra) { | |
| 2186 | + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid(); | |
| 2187 | + var abortController = new AC(); | |
| 2188 | + var abortReason; | |
| 2189 | + var abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({ name: "AbortError", message: abortReason || "Aborted" }); }); }); | |
| 2190 | + var started = false; | |
| 2191 | + function abort(reason) { | |
| 2192 | + if (started) { | |
| 2193 | + abortReason = reason; | |
| 2194 | + abortController.abort(); | |
| 2195 | + } | |
| 2196 | + } | |
| 2197 | + var promise = function () { | |
| 2198 | + return __async(this, null, function () { | |
| 2199 | + var _a, _b, finalAction, conditionResult, err_1, skipDispatch; | |
| 2200 | + return __generator(this, function (_c) { | |
| 2201 | + switch (_c.label) { | |
| 2202 | + case 0: | |
| 2203 | + _c.trys.push([0, 4, , 5]); | |
| 2204 | + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra }); | |
| 2205 | + if (!isThenable(conditionResult)) return [3 /*break*/, 2]; | |
| 2206 | + return [4 /*yield*/, conditionResult]; | |
| 2207 | + case 1: | |
| 2208 | + conditionResult = _c.sent(); | |
| 2209 | + _c.label = 2; | |
| 2210 | + case 2: | |
| 2211 | + if (conditionResult === false) { | |
| 2212 | + throw { | |
| 2213 | + name: "ConditionError", | |
| 2214 | + message: "Aborted due to condition callback returning false." | |
| 2215 | + }; | |
| 2216 | + } | |
| 2217 | + started = true; | |
| 2218 | + dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra }))); | |
| 2219 | + return [4 /*yield*/, Promise.race([ | |
| 2220 | + abortedPromise, | |
| 2221 | + Promise.resolve(payloadCreator(arg, { | |
| 2222 | + dispatch: dispatch, | |
| 2223 | + getState: getState, | |
| 2224 | + extra: extra, | |
| 2225 | + requestId: requestId, | |
| 2226 | + signal: abortController.signal, | |
| 2227 | + rejectWithValue: function (value, meta) { | |
| 2228 | + return new RejectWithValue(value, meta); | |
| 2229 | + }, | |
| 2230 | + fulfillWithValue: function (value, meta) { | |
| 2231 | + return new FulfillWithMeta(value, meta); | |
| 2232 | + } | |
| 2233 | + })).then(function (result) { | |
| 2234 | + if (result instanceof RejectWithValue) { | |
| 2235 | + throw result; | |
| 2236 | + } | |
| 2237 | + if (result instanceof FulfillWithMeta) { | |
| 2238 | + return fulfilled(result.payload, requestId, arg, result.meta); | |
| 2239 | + } | |
| 2240 | + return fulfilled(result, requestId, arg); | |
| 2241 | + }) | |
| 2242 | + ])]; | |
| 2243 | + case 3: | |
| 2244 | + finalAction = _c.sent(); | |
| 2245 | + return [3 /*break*/, 5]; | |
| 2246 | + case 4: | |
| 2247 | + err_1 = _c.sent(); | |
| 2248 | + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg); | |
| 2249 | + return [3 /*break*/, 5]; | |
| 2250 | + case 5: | |
| 2251 | + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; | |
| 2252 | + if (!skipDispatch) { | |
| 2253 | + dispatch(finalAction); | |
| 2254 | + } | |
| 2255 | + return [2 /*return*/, finalAction]; | |
| 2256 | + } | |
| 2257 | + }); | |
| 2258 | + }); | |
| 2259 | + }(); | |
| 2260 | + return Object.assign(promise, { | |
| 2261 | + abort: abort, | |
| 2262 | + requestId: requestId, | |
| 2263 | + arg: arg, | |
| 2264 | + unwrap: function () { | |
| 2265 | + return promise.then(unwrapResult); | |
| 2266 | + } | |
| 2267 | + }); | |
| 2268 | + }; | |
| 2269 | + } | |
| 2270 | + return Object.assign(actionCreator, { | |
| 2271 | + pending: pending, | |
| 2272 | + rejected: rejected, | |
| 2273 | + fulfilled: fulfilled, | |
| 2274 | + typePrefix: typePrefix | |
| 2275 | + }); | |
| 2276 | +} | |
| 2277 | +function unwrapResult(action) { | |
| 2278 | + if (action.meta && action.meta.rejectedWithValue) { | |
| 2279 | + throw action.payload; | |
| 2280 | + } | |
| 2281 | + if (action.error) { | |
| 2282 | + throw action.error; | |
| 2283 | + } | |
| 2284 | + return action.payload; | |
| 2285 | +} | |
| 2286 | +function isThenable(value) { | |
| 2287 | + return value !== null && typeof value === "object" && typeof value.then === "function"; | |
| 2288 | +} | |
| 2289 | +// src/tsHelpers.ts | |
| 2290 | +var hasMatchFunction = function (v) { | |
| 2291 | + return v && typeof v.match === "function"; | |
| 2292 | +}; | |
| 2293 | +// src/matchers.ts | |
| 2294 | +var matches = function (matcher, action) { | |
| 2295 | + if (hasMatchFunction(matcher)) { | |
| 2296 | + return matcher.match(action); | |
| 2297 | + } | |
| 2298 | + else { | |
| 2299 | + return matcher(action); | |
| 2300 | + } | |
| 2301 | +}; | |
| 2302 | +function isAnyOf() { | |
| 2303 | + var matchers = []; | |
| 2304 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2305 | + matchers[_i] = arguments[_i]; | |
| 2306 | + } | |
| 2307 | + return function (action) { | |
| 2308 | + return matchers.some(function (matcher) { return matches(matcher, action); }); | |
| 2309 | + }; | |
| 2310 | +} | |
| 2311 | +function isAllOf() { | |
| 2312 | + var matchers = []; | |
| 2313 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2314 | + matchers[_i] = arguments[_i]; | |
| 2315 | + } | |
| 2316 | + return function (action) { | |
| 2317 | + return matchers.every(function (matcher) { return matches(matcher, action); }); | |
| 2318 | + }; | |
| 2319 | +} | |
| 2320 | +function hasExpectedRequestMetadata(action, validStatus) { | |
| 2321 | + if (!action || !action.meta) | |
| 2322 | + return false; | |
| 2323 | + var hasValidRequestId = typeof action.meta.requestId === "string"; | |
| 2324 | + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1; | |
| 2325 | + return hasValidRequestId && hasValidRequestStatus; | |
| 2326 | +} | |
| 2327 | +function isAsyncThunkArray(a) { | |
| 2328 | + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0]; | |
| 2329 | +} | |
| 2330 | +function isPending() { | |
| 2331 | + var asyncThunks = []; | |
| 2332 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2333 | + asyncThunks[_i] = arguments[_i]; | |
| 2334 | + } | |
| 2335 | + if (asyncThunks.length === 0) { | |
| 2336 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); }; | |
| 2337 | + } | |
| 2338 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 2339 | + return isPending()(asyncThunks[0]); | |
| 2340 | + } | |
| 2341 | + return function (action) { | |
| 2342 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; }); | |
| 2343 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 2344 | + return combinedMatcher(action); | |
| 2345 | + }; | |
| 2346 | +} | |
| 2347 | +function isRejected() { | |
| 2348 | + var asyncThunks = []; | |
| 2349 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2350 | + asyncThunks[_i] = arguments[_i]; | |
| 2351 | + } | |
| 2352 | + if (asyncThunks.length === 0) { | |
| 2353 | + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); }; | |
| 2354 | + } | |
| 2355 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 2356 | + return isRejected()(asyncThunks[0]); | |
| 2357 | + } | |
| 2358 | + return function (action) { | |
| 2359 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; }); | |
| 2360 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 2361 | + return combinedMatcher(action); | |
| 2362 | + }; | |
| 2363 | +} | |
| 2364 | +function isRejectedWithValue() { | |
| 2365 | + var asyncThunks = []; | |
| 2366 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2367 | + asyncThunks[_i] = arguments[_i]; | |
| 2368 | + } | |
| 2369 | + var hasFlag = function (action) { | |
| 2370 | + return action && action.meta && action.meta.rejectedWithValue; | |
| 2371 | + }; | |
| 2372 | + if (asyncThunks.length === 0) { | |
| 2373 | + return function (action) { | |
| 2374 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 2375 | + return combinedMatcher(action); | |
| 2376 | + }; | |
| 2377 | + } | |
| 2378 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 2379 | + return isRejectedWithValue()(asyncThunks[0]); | |
| 2380 | + } | |
| 2381 | + return function (action) { | |
| 2382 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 2383 | + return combinedMatcher(action); | |
| 2384 | + }; | |
| 2385 | +} | |
| 2386 | +function isFulfilled() { | |
| 2387 | + var asyncThunks = []; | |
| 2388 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2389 | + asyncThunks[_i] = arguments[_i]; | |
| 2390 | + } | |
| 2391 | + if (asyncThunks.length === 0) { | |
| 2392 | + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); }; | |
| 2393 | + } | |
| 2394 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 2395 | + return isFulfilled()(asyncThunks[0]); | |
| 2396 | + } | |
| 2397 | + return function (action) { | |
| 2398 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; }); | |
| 2399 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 2400 | + return combinedMatcher(action); | |
| 2401 | + }; | |
| 2402 | +} | |
| 2403 | +function isAsyncThunkAction() { | |
| 2404 | + var asyncThunks = []; | |
| 2405 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2406 | + asyncThunks[_i] = arguments[_i]; | |
| 2407 | + } | |
| 2408 | + if (asyncThunks.length === 0) { | |
| 2409 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); }; | |
| 2410 | + } | |
| 2411 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 2412 | + return isAsyncThunkAction()(asyncThunks[0]); | |
| 2413 | + } | |
| 2414 | + return function (action) { | |
| 2415 | + var matchers = []; | |
| 2416 | + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) { | |
| 2417 | + var asyncThunk = asyncThunks_1[_i]; | |
| 2418 | + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled); | |
| 2419 | + } | |
| 2420 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 2421 | + return combinedMatcher(action); | |
| 2422 | + }; | |
| 2423 | +} | |
| 2424 | +// src/listenerMiddleware/utils.ts | |
| 2425 | +var assertFunction = function (func, expected) { | |
| 2426 | + if (typeof func !== "function") { | |
| 2427 | + throw new TypeError(expected + " is not a function"); | |
| 2428 | + } | |
| 2429 | +}; | |
| 2430 | +var noop = function () { | |
| 2431 | +}; | |
| 2432 | +var catchRejection = function (promise, onError) { | |
| 2433 | + if (onError === void 0) { onError = noop; } | |
| 2434 | + promise.catch(onError); | |
| 2435 | + return promise; | |
| 2436 | +}; | |
| 2437 | +var addAbortSignalListener = function (abortSignal, callback) { | |
| 2438 | + abortSignal.addEventListener("abort", callback, { once: true }); | |
| 2439 | +}; | |
| 2440 | +var abortControllerWithReason = function (abortController, reason) { | |
| 2441 | + var signal = abortController.signal; | |
| 2442 | + if (signal.aborted) { | |
| 2443 | + return; | |
| 2444 | + } | |
| 2445 | + if (!("reason" in signal)) { | |
| 2446 | + Object.defineProperty(signal, "reason", { | |
| 2447 | + enumerable: true, | |
| 2448 | + value: reason, | |
| 2449 | + configurable: true, | |
| 2450 | + writable: true | |
| 2451 | + }); | |
| 2452 | + } | |
| 2453 | + ; | |
| 2454 | + abortController.abort(reason); | |
| 2455 | +}; | |
| 2456 | +// src/listenerMiddleware/exceptions.ts | |
| 2457 | +var task = "task"; | |
| 2458 | +var listener = "listener"; | |
| 2459 | +var completed = "completed"; | |
| 2460 | +var cancelled = "cancelled"; | |
| 2461 | +var taskCancelled = "task-" + cancelled; | |
| 2462 | +var taskCompleted = "task-" + completed; | |
| 2463 | +var listenerCancelled = listener + "-" + cancelled; | |
| 2464 | +var listenerCompleted = listener + "-" + completed; | |
| 2465 | +var TaskAbortError = /** @class */ (function () { | |
| 2466 | + function TaskAbortError(code) { | |
| 2467 | + this.code = code; | |
| 2468 | + this.name = "TaskAbortError"; | |
| 2469 | + this.message = task + " " + cancelled + " (reason: " + code + ")"; | |
| 2470 | + } | |
| 2471 | + return TaskAbortError; | |
| 2472 | +}()); | |
| 2473 | +// src/listenerMiddleware/task.ts | |
| 2474 | +var validateActive = function (signal) { | |
| 2475 | + if (signal.aborted) { | |
| 2476 | + throw new TaskAbortError(signal.reason); | |
| 2477 | + } | |
| 2478 | +}; | |
| 2479 | +var promisifyAbortSignal = function (signal) { | |
| 2480 | + return catchRejection(new Promise(function (_, reject) { | |
| 2481 | + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); }; | |
| 2482 | + if (signal.aborted) { | |
| 2483 | + notifyRejection(); | |
| 2484 | + } | |
| 2485 | + else { | |
| 2486 | + addAbortSignalListener(signal, notifyRejection); | |
| 2487 | + } | |
| 2488 | + })); | |
| 2489 | +}; | |
| 2490 | +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () { | |
| 2491 | + var value, error_1; | |
| 2492 | + return __generator(this, function (_c) { | |
| 2493 | + switch (_c.label) { | |
| 2494 | + case 0: | |
| 2495 | + _c.trys.push([0, 3, 4, 5]); | |
| 2496 | + return [4 /*yield*/, Promise.resolve()]; | |
| 2497 | + case 1: | |
| 2498 | + _c.sent(); | |
| 2499 | + return [4 /*yield*/, task2()]; | |
| 2500 | + case 2: | |
| 2501 | + value = _c.sent(); | |
| 2502 | + return [2 /*return*/, { | |
| 2503 | + status: "ok", | |
| 2504 | + value: value | |
| 2505 | + }]; | |
| 2506 | + case 3: | |
| 2507 | + error_1 = _c.sent(); | |
| 2508 | + return [2 /*return*/, { | |
| 2509 | + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected", | |
| 2510 | + error: error_1 | |
| 2511 | + }]; | |
| 2512 | + case 4: | |
| 2513 | + cleanUp == null ? void 0 : cleanUp(); | |
| 2514 | + return [7 /*endfinally*/]; | |
| 2515 | + case 5: return [2 /*return*/]; | |
| 2516 | + } | |
| 2517 | + }); | |
| 2518 | +}); }; | |
| 2519 | +var createPause = function (signal) { | |
| 2520 | + return function (promise) { | |
| 2521 | + return catchRejection(Promise.race([promisifyAbortSignal(signal), promise]).then(function (output) { | |
| 2522 | + validateActive(signal); | |
| 2523 | + return output; | |
| 2524 | + })); | |
| 2525 | + }; | |
| 2526 | +}; | |
| 2527 | +var createDelay = function (signal) { | |
| 2528 | + var pause = createPause(signal); | |
| 2529 | + return function (timeoutMs) { | |
| 2530 | + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); })); | |
| 2531 | + }; | |
| 2532 | +}; | |
| 2533 | +// src/listenerMiddleware/index.ts | |
| 2534 | +var assign = Object.assign; | |
| 2535 | +var INTERNAL_NIL_TOKEN = {}; | |
| 2536 | +var alm = "listenerMiddleware"; | |
| 2537 | +var createFork = function (parentAbortSignal) { | |
| 2538 | + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); }; | |
| 2539 | + return function (taskExecutor) { | |
| 2540 | + assertFunction(taskExecutor, "taskExecutor"); | |
| 2541 | + var childAbortController = new AbortController(); | |
| 2542 | + linkControllers(childAbortController); | |
| 2543 | + var result = runTask(function () { return __async(void 0, null, function () { | |
| 2544 | + var result2; | |
| 2545 | + return __generator(this, function (_c) { | |
| 2546 | + switch (_c.label) { | |
| 2547 | + case 0: | |
| 2548 | + validateActive(parentAbortSignal); | |
| 2549 | + validateActive(childAbortController.signal); | |
| 2550 | + return [4 /*yield*/, taskExecutor({ | |
| 2551 | + pause: createPause(childAbortController.signal), | |
| 2552 | + delay: createDelay(childAbortController.signal), | |
| 2553 | + signal: childAbortController.signal | |
| 2554 | + })]; | |
| 2555 | + case 1: | |
| 2556 | + result2 = _c.sent(); | |
| 2557 | + validateActive(childAbortController.signal); | |
| 2558 | + return [2 /*return*/, result2]; | |
| 2559 | + } | |
| 2560 | + }); | |
| 2561 | + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); }); | |
| 2562 | + return { | |
| 2563 | + result: createPause(parentAbortSignal)(result), | |
| 2564 | + cancel: function () { | |
| 2565 | + abortControllerWithReason(childAbortController, taskCancelled); | |
| 2566 | + } | |
| 2567 | + }; | |
| 2568 | + }; | |
| 2569 | +}; | |
| 2570 | +var createTakePattern = function (startListening, signal) { | |
| 2571 | + var take = function (predicate, timeout) { return __async(void 0, null, function () { | |
| 2572 | + var unsubscribe, tuplePromise, promises, output; | |
| 2573 | + return __generator(this, function (_c) { | |
| 2574 | + switch (_c.label) { | |
| 2575 | + case 0: | |
| 2576 | + validateActive(signal); | |
| 2577 | + unsubscribe = function () { | |
| 2578 | + }; | |
| 2579 | + tuplePromise = new Promise(function (resolve) { | |
| 2580 | + unsubscribe = startListening({ | |
| 2581 | + predicate: predicate, | |
| 2582 | + effect: function (action, listenerApi) { | |
| 2583 | + listenerApi.unsubscribe(); | |
| 2584 | + resolve([ | |
| 2585 | + action, | |
| 2586 | + listenerApi.getState(), | |
| 2587 | + listenerApi.getOriginalState() | |
| 2588 | + ]); | |
| 2589 | + } | |
| 2590 | + }); | |
| 2591 | + }); | |
| 2592 | + promises = [ | |
| 2593 | + promisifyAbortSignal(signal), | |
| 2594 | + tuplePromise | |
| 2595 | + ]; | |
| 2596 | + if (timeout != null) { | |
| 2597 | + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); })); | |
| 2598 | + } | |
| 2599 | + _c.label = 1; | |
| 2600 | + case 1: | |
| 2601 | + _c.trys.push([1, , 3, 4]); | |
| 2602 | + return [4 /*yield*/, Promise.race(promises)]; | |
| 2603 | + case 2: | |
| 2604 | + output = _c.sent(); | |
| 2605 | + validateActive(signal); | |
| 2606 | + return [2 /*return*/, output]; | |
| 2607 | + case 3: | |
| 2608 | + unsubscribe(); | |
| 2609 | + return [7 /*endfinally*/]; | |
| 2610 | + case 4: return [2 /*return*/]; | |
| 2611 | + } | |
| 2612 | + }); | |
| 2613 | + }); }; | |
| 2614 | + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); }; | |
| 2615 | +}; | |
| 2616 | +var getListenerEntryPropsFrom = function (options) { | |
| 2617 | + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect; | |
| 2618 | + if (type) { | |
| 2619 | + predicate = createAction(type).match; | |
| 2620 | + } | |
| 2621 | + else if (actionCreator) { | |
| 2622 | + type = actionCreator.type; | |
| 2623 | + predicate = actionCreator.match; | |
| 2624 | + } | |
| 2625 | + else if (matcher) { | |
| 2626 | + predicate = matcher; | |
| 2627 | + } | |
| 2628 | + else if (predicate) { | |
| 2629 | + } | |
| 2630 | + else { | |
| 2631 | + throw new Error("Creating or removing a listener requires one of the known fields for matching an action"); | |
| 2632 | + } | |
| 2633 | + assertFunction(effect, "options.listener"); | |
| 2634 | + return { predicate: predicate, type: type, effect: effect }; | |
| 2635 | +}; | |
| 2636 | +var createListenerEntry = function (options) { | |
| 2637 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect; | |
| 2638 | + var id = nanoid(); | |
| 2639 | + var entry = { | |
| 2640 | + id: id, | |
| 2641 | + effect: effect, | |
| 2642 | + type: type, | |
| 2643 | + predicate: predicate, | |
| 2644 | + pending: new Set(), | |
| 2645 | + unsubscribe: function () { | |
| 2646 | + throw new Error("Unsubscribe not initialized"); | |
| 2647 | + } | |
| 2648 | + }; | |
| 2649 | + return entry; | |
| 2650 | +}; | |
| 2651 | +var createClearListenerMiddleware = function (listenerMap) { | |
| 2652 | + return function () { | |
| 2653 | + listenerMap.forEach(cancelActiveListeners); | |
| 2654 | + listenerMap.clear(); | |
| 2655 | + }; | |
| 2656 | +}; | |
| 2657 | +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) { | |
| 2658 | + try { | |
| 2659 | + errorHandler(errorToNotify, errorInfo); | |
| 2660 | + } | |
| 2661 | + catch (errorHandlerError) { | |
| 2662 | + setTimeout(function () { | |
| 2663 | + throw errorHandlerError; | |
| 2664 | + }, 0); | |
| 2665 | + } | |
| 2666 | +}; | |
| 2667 | +var addListener = createAction(alm + "/add"); | |
| 2668 | +var clearAllListeners = createAction(alm + "/removeAll"); | |
| 2669 | +var removeListener = createAction(alm + "/remove"); | |
| 2670 | +var defaultErrorHandler = function () { | |
| 2671 | + var args = []; | |
| 2672 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2673 | + args[_i] = arguments[_i]; | |
| 2674 | + } | |
| 2675 | + console.error.apply(console, __spreadArray([alm + "/error"], args)); | |
| 2676 | +}; | |
| 2677 | +var cancelActiveListeners = function (entry) { | |
| 2678 | + entry.pending.forEach(function (controller) { | |
| 2679 | + abortControllerWithReason(controller, listenerCancelled); | |
| 2680 | + }); | |
| 2681 | +}; | |
| 2682 | +function createListenerMiddleware(middlewareOptions) { | |
| 2683 | + var _this = this; | |
| 2684 | + if (middlewareOptions === void 0) { middlewareOptions = {}; } | |
| 2685 | + var listenerMap = new Map(); | |
| 2686 | + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c; | |
| 2687 | + assertFunction(onError, "onError"); | |
| 2688 | + var insertEntry = function (entry) { | |
| 2689 | + entry.unsubscribe = function () { return listenerMap.delete(entry.id); }; | |
| 2690 | + listenerMap.set(entry.id, entry); | |
| 2691 | + return function (cancelOptions) { | |
| 2692 | + entry.unsubscribe(); | |
| 2693 | + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) { | |
| 2694 | + cancelActiveListeners(entry); | |
| 2695 | + } | |
| 2696 | + }; | |
| 2697 | + }; | |
| 2698 | + var findListenerEntry = function (comparator) { | |
| 2699 | + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) { | |
| 2700 | + var entry = _c[_i]; | |
| 2701 | + if (comparator(entry)) { | |
| 2702 | + return entry; | |
| 2703 | + } | |
| 2704 | + } | |
| 2705 | + return void 0; | |
| 2706 | + }; | |
| 2707 | + var startListening = function (options) { | |
| 2708 | + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; }); | |
| 2709 | + if (!entry) { | |
| 2710 | + entry = createListenerEntry(options); | |
| 2711 | + } | |
| 2712 | + return insertEntry(entry); | |
| 2713 | + }; | |
| 2714 | + var stopListening = function (options) { | |
| 2715 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate; | |
| 2716 | + var entry = findListenerEntry(function (entry2) { | |
| 2717 | + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate; | |
| 2718 | + return matchPredicateOrType && entry2.effect === effect; | |
| 2719 | + }); | |
| 2720 | + if (entry) { | |
| 2721 | + entry.unsubscribe(); | |
| 2722 | + if (options.cancelActive) { | |
| 2723 | + cancelActiveListeners(entry); | |
| 2724 | + } | |
| 2725 | + } | |
| 2726 | + return !!entry; | |
| 2727 | + }; | |
| 2728 | + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () { | |
| 2729 | + var internalTaskController, take, listenerError_1; | |
| 2730 | + return __generator(this, function (_c) { | |
| 2731 | + switch (_c.label) { | |
| 2732 | + case 0: | |
| 2733 | + internalTaskController = new AbortController(); | |
| 2734 | + take = createTakePattern(startListening, internalTaskController.signal); | |
| 2735 | + _c.label = 1; | |
| 2736 | + case 1: | |
| 2737 | + _c.trys.push([1, 3, 4, 5]); | |
| 2738 | + entry.pending.add(internalTaskController); | |
| 2739 | + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, { | |
| 2740 | + getOriginalState: getOriginalState, | |
| 2741 | + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); }, | |
| 2742 | + take: take, | |
| 2743 | + delay: createDelay(internalTaskController.signal), | |
| 2744 | + pause: createPause(internalTaskController.signal), | |
| 2745 | + extra: extra, | |
| 2746 | + signal: internalTaskController.signal, | |
| 2747 | + fork: createFork(internalTaskController.signal), | |
| 2748 | + unsubscribe: entry.unsubscribe, | |
| 2749 | + subscribe: function () { | |
| 2750 | + listenerMap.set(entry.id, entry); | |
| 2751 | + }, | |
| 2752 | + cancelActiveListeners: function () { | |
| 2753 | + entry.pending.forEach(function (controller, _, set) { | |
| 2754 | + if (controller !== internalTaskController) { | |
| 2755 | + abortControllerWithReason(controller, listenerCancelled); | |
| 2756 | + set.delete(controller); | |
| 2757 | + } | |
| 2758 | + }); | |
| 2759 | + } | |
| 2760 | + })))]; | |
| 2761 | + case 2: | |
| 2762 | + _c.sent(); | |
| 2763 | + return [3 /*break*/, 5]; | |
| 2764 | + case 3: | |
| 2765 | + listenerError_1 = _c.sent(); | |
| 2766 | + if (!(listenerError_1 instanceof TaskAbortError)) { | |
| 2767 | + safelyNotifyError(onError, listenerError_1, { | |
| 2768 | + raisedBy: "effect" | |
| 2769 | + }); | |
| 2770 | + } | |
| 2771 | + return [3 /*break*/, 5]; | |
| 2772 | + case 4: | |
| 2773 | + abortControllerWithReason(internalTaskController, listenerCompleted); | |
| 2774 | + entry.pending.delete(internalTaskController); | |
| 2775 | + return [7 /*endfinally*/]; | |
| 2776 | + case 5: return [2 /*return*/]; | |
| 2777 | + } | |
| 2778 | + }); | |
| 2779 | + }); }; | |
| 2780 | + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap); | |
| 2781 | + var middleware = function (api) { return function (next) { return function (action) { | |
| 2782 | + if (addListener.match(action)) { | |
| 2783 | + return startListening(action.payload); | |
| 2784 | + } | |
| 2785 | + if (clearAllListeners.match(action)) { | |
| 2786 | + clearListenerMiddleware(); | |
| 2787 | + return; | |
| 2788 | + } | |
| 2789 | + if (removeListener.match(action)) { | |
| 2790 | + return stopListening(action.payload); | |
| 2791 | + } | |
| 2792 | + var originalState = api.getState(); | |
| 2793 | + var getOriginalState = function () { | |
| 2794 | + if (originalState === INTERNAL_NIL_TOKEN) { | |
| 2795 | + throw new Error(alm + ": getOriginalState can only be called synchronously"); | |
| 2796 | + } | |
| 2797 | + return originalState; | |
| 2798 | + }; | |
| 2799 | + var result; | |
| 2800 | + try { | |
| 2801 | + result = next(action); | |
| 2802 | + if (listenerMap.size > 0) { | |
| 2803 | + var currentState = api.getState(); | |
| 2804 | + var listenerEntries = Array.from(listenerMap.values()); | |
| 2805 | + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) { | |
| 2806 | + var entry = listenerEntries_1[_i]; | |
| 2807 | + var runListener = false; | |
| 2808 | + try { | |
| 2809 | + runListener = entry.predicate(action, currentState, originalState); | |
| 2810 | + } | |
| 2811 | + catch (predicateError) { | |
| 2812 | + runListener = false; | |
| 2813 | + safelyNotifyError(onError, predicateError, { | |
| 2814 | + raisedBy: "predicate" | |
| 2815 | + }); | |
| 2816 | + } | |
| 2817 | + if (!runListener) { | |
| 2818 | + continue; | |
| 2819 | + } | |
| 2820 | + notifyListener(entry, action, api, getOriginalState); | |
| 2821 | + } | |
| 2822 | + } | |
| 2823 | + } | |
| 2824 | + finally { | |
| 2825 | + originalState = INTERNAL_NIL_TOKEN; | |
| 2826 | + } | |
| 2827 | + return result; | |
| 2828 | + }; }; }; | |
| 2829 | + return { | |
| 2830 | + middleware: middleware, | |
| 2831 | + startListening: startListening, | |
| 2832 | + stopListening: stopListening, | |
| 2833 | + clearListeners: clearListenerMiddleware | |
| 2834 | + }; | |
| 2835 | +} | |
| 2836 | +// src/index.ts | |
| 2837 | +(0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)(); | |
| 2838 | + | |
| 2839 | +//# sourceMappingURL=redux-toolkit.esm.js.map | |
| 2840 | + | |
| 2841 | +/***/ }), | |
| 2842 | + | |
| 2843 | +/***/ "../assets/dev/js/editor/components/validator/base.js": | |
| 2844 | +/*!************************************************************!*\ | |
| 2845 | + !*** ../assets/dev/js/editor/components/validator/base.js ***! | |
| 2846 | + \************************************************************/ | |
| 2847 | +/***/ ((module) => { | |
| 2848 | + | |
| 2849 | +"use strict"; | |
| 2850 | + | |
| 2851 | + | |
| 2852 | +module.exports = elementorModules.Module.extend({ | |
| 2853 | + errors: [], | |
| 2854 | + __construct: function __construct(settings) { | |
| 2855 | + var customValidationMethod = settings.customValidationMethod; | |
| 2856 | + | |
| 2857 | + if (customValidationMethod) { | |
| 2858 | + this.validationMethod = customValidationMethod; | |
| 2859 | + } | |
| 2860 | + }, | |
| 2861 | + getDefaultSettings: function getDefaultSettings() { | |
| 2862 | + return { | |
| 2863 | + validationTerms: {} | |
| 2864 | + }; | |
| 2865 | + }, | |
| 2866 | + isValid: function isValid() { | |
| 2867 | + var validationErrors = this.validationMethod.apply(this, arguments); | |
| 2868 | + | |
| 2869 | + if (validationErrors.length) { | |
| 2870 | + this.errors = validationErrors; | |
| 2871 | + return false; | |
| 2872 | + } | |
| 2873 | + | |
| 2874 | + return true; | |
| 2875 | + }, | |
| 2876 | + validationMethod: function validationMethod(newValue) { | |
| 2877 | + var validationTerms = this.getSettings('validationTerms'), | |
| 2878 | + errors = []; | |
| 2879 | + | |
| 2880 | + if (validationTerms.required) { | |
| 2881 | + if (!('' + newValue).length) { | |
| 2882 | + errors.push('Required value is empty'); | |
| 2883 | + } | |
| 2884 | + } | |
| 2885 | + | |
| 2886 | + return errors; | |
| 2887 | + } | |
| 2888 | +}); | |
| 2889 | + | |
| 2890 | +/***/ }), | |
| 2891 | + | |
| 2892 | +/***/ "../assets/dev/js/editor/data/globals/base/create-base.js": | |
| 2893 | +/*!****************************************************************!*\ | |
| 2894 | + !*** ../assets/dev/js/editor/data/globals/base/create-base.js ***! | |
| 2895 | + \****************************************************************/ | |
| 8 | 2896 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 9 | 2897 | |
| 10 | 2898 | "use strict"; |
| 11 | 2899 | |
| @@ -10,70 +2898,706 @@ | ||
| 10 | 2898 | "use strict"; |
| 11 | 2899 | |
| 12 | 2900 | |
| 13 | 2901 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2902 | + | |
| 14 | 2903 | Object.defineProperty(exports, "__esModule", ({ |
| 15 | 2904 | value: true |
| 16 | 2905 | })); |
| 17 | 2906 | exports["default"] = void 0; |
| 2907 | + | |
| 18 | 2908 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 2909 | + | |
| 19 | 2910 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 2911 | + | |
| 2912 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 2913 | + | |
| 20 | 2914 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 2915 | + | |
| 21 | 2916 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 2917 | + | |
| 2918 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 2919 | + | |
| 2920 | +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); }; } | |
| 2921 | + | |
| 2922 | +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; } } | |
| 2923 | + | |
| 2924 | +var CreateBase = /*#__PURE__*/function (_CommandBase) { | |
| 2925 | + (0, _inherits2.default)(CreateBase, _CommandBase); | |
| 2926 | + | |
| 2927 | + var _super = _createSuper(CreateBase); | |
| 2928 | + | |
| 2929 | + function CreateBase() { | |
| 2930 | + (0, _classCallCheck2.default)(this, CreateBase); | |
| 2931 | + return _super.apply(this, arguments); | |
| 2932 | + } | |
| 2933 | + | |
| 2934 | + (0, _createClass2.default)(CreateBase, [{ | |
| 2935 | + key: "validateArgs", | |
| 2936 | + value: function validateArgs() { | |
| 2937 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 2938 | + this.requireContainer(args); | |
| 2939 | + this.requireArgumentType('setting', 'string', args); | |
| 2940 | + this.requireArgumentType('title', 'string', args); | |
| 2941 | + } | |
| 2942 | + }]); | |
| 2943 | + return CreateBase; | |
| 2944 | +}(_commandBase.default); | |
| 2945 | + | |
| 2946 | +exports["default"] = CreateBase; | |
| 2947 | + | |
| 2948 | +/***/ }), | |
| 2949 | + | |
| 2950 | +/***/ "../assets/dev/js/editor/data/globals/colors/commands/create.js": | |
| 2951 | +/*!**********************************************************************!*\ | |
| 2952 | + !*** ../assets/dev/js/editor/data/globals/colors/commands/create.js ***! | |
| 2953 | + \**********************************************************************/ | |
| 2954 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2955 | + | |
| 2956 | +"use strict"; | |
| 2957 | + | |
| 2958 | + | |
| 2959 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2960 | + | |
| 2961 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2962 | + value: true | |
| 2963 | +})); | |
| 2964 | +exports.Create = void 0; | |
| 2965 | + | |
| 2966 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2967 | + | |
| 2968 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2969 | + | |
| 22 | 2970 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 23 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 24 | -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 25 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 26 | -/** | |
| 27 | - * @name $e.modules.editor.CommandContainerBase | |
| 28 | - */ | |
| 29 | -var CommandContainerBase = exports["default"] = /*#__PURE__*/function (_CommandBase) { | |
| 30 | - function CommandContainerBase() { | |
| 31 | - (0, _classCallCheck2.default)(this, CommandContainerBase); | |
| 32 | - return _callSuper(this, CommandContainerBase, arguments); | |
| 2971 | + | |
| 2972 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 2973 | + | |
| 2974 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 2975 | + | |
| 2976 | +var _createBase = _interopRequireDefault(__webpack_require__(/*! elementor-editor/data/globals/base/create-base */ "../assets/dev/js/editor/data/globals/base/create-base.js")); | |
| 2977 | + | |
| 2978 | +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); }; } | |
| 2979 | + | |
| 2980 | +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; } } | |
| 2981 | + | |
| 2982 | +var Create = /*#__PURE__*/function (_CreateBase) { | |
| 2983 | + (0, _inherits2.default)(Create, _CreateBase); | |
| 2984 | + | |
| 2985 | + var _super = _createSuper(Create); | |
| 2986 | + | |
| 2987 | + function Create() { | |
| 2988 | + (0, _classCallCheck2.default)(this, Create); | |
| 2989 | + return _super.apply(this, arguments); | |
| 33 | 2990 | } |
| 34 | - (0, _inherits2.default)(CommandContainerBase, _CommandBase); | |
| 35 | - return (0, _createClass2.default)(CommandContainerBase, [{ | |
| 36 | - key: "requireContainer", | |
| 37 | - value: | |
| 38 | - /** | |
| 39 | - * Function requireContainer(). | |
| 40 | - * | |
| 41 | - * Validate `arg.container` & `arg.containers`. | |
| 42 | - * | |
| 43 | - * @param {{}} args | |
| 44 | - * | |
| 45 | - * @throws {Error} | |
| 46 | - */ | |
| 47 | - function requireContainer() { | |
| 2991 | + | |
| 2992 | + (0, _createClass2.default)(Create, [{ | |
| 2993 | + key: "apply", | |
| 2994 | + value: function apply() { | |
| 2995 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 2996 | + var container = args.container, | |
| 2997 | + setting = args.setting, | |
| 2998 | + title = args.title, | |
| 2999 | + controls = container.controls; | |
| 3000 | + var result = false; | |
| 3001 | + | |
| 3002 | + if (!controls[setting]) { | |
| 3003 | + throw new Error("Invalid setting: control '".concat(setting, "', not found.")); | |
| 3004 | + } // `args.id` used by tests. | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + var id = args.id || elementorCommon.helpers.getUniqueId(); | |
| 3008 | + result = $e.data.create("globals/colors?id=".concat(id), { | |
| 3009 | + title: title, | |
| 3010 | + value: container.settings.get(setting) | |
| 3011 | + }); | |
| 3012 | + return result; | |
| 3013 | + } | |
| 3014 | + }]); | |
| 3015 | + return Create; | |
| 3016 | +}(_createBase.default); | |
| 3017 | + | |
| 3018 | +exports.Create = Create; | |
| 3019 | + | |
| 3020 | +/***/ }), | |
| 3021 | + | |
| 3022 | +/***/ "../assets/dev/js/editor/data/globals/colors/commands/index.js": | |
| 3023 | +/*!*********************************************************************!*\ | |
| 3024 | + !*** ../assets/dev/js/editor/data/globals/colors/commands/index.js ***! | |
| 3025 | + \*********************************************************************/ | |
| 3026 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3027 | + | |
| 3028 | +"use strict"; | |
| 3029 | + | |
| 3030 | + | |
| 3031 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3032 | + value: true | |
| 3033 | +})); | |
| 3034 | +Object.defineProperty(exports, "Create", ({ | |
| 3035 | + enumerable: true, | |
| 3036 | + get: function get() { | |
| 3037 | + return _create.Create; | |
| 3038 | + } | |
| 3039 | +})); | |
| 3040 | + | |
| 3041 | +var _create = __webpack_require__(/*! ./create */ "../assets/dev/js/editor/data/globals/colors/commands/create.js"); | |
| 3042 | + | |
| 3043 | +/***/ }), | |
| 3044 | + | |
| 3045 | +/***/ "../assets/dev/js/editor/data/globals/colors/component.js": | |
| 3046 | +/*!****************************************************************!*\ | |
| 3047 | + !*** ../assets/dev/js/editor/data/globals/colors/component.js ***! | |
| 3048 | + \****************************************************************/ | |
| 3049 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3050 | + | |
| 3051 | +"use strict"; | |
| 3052 | + | |
| 3053 | + | |
| 3054 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3055 | + | |
| 3056 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 3057 | + | |
| 3058 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3059 | + value: true | |
| 3060 | +})); | |
| 3061 | +exports["default"] = void 0; | |
| 3062 | + | |
| 3063 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3064 | + | |
| 3065 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3066 | + | |
| 3067 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3068 | + | |
| 3069 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3070 | + | |
| 3071 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3072 | + | |
| 3073 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 3074 | + | |
| 3075 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/data/globals/colors/commands/index.js")); | |
| 3076 | + | |
| 3077 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 3078 | + | |
| 3079 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 3080 | + | |
| 3081 | +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); }; } | |
| 3082 | + | |
| 3083 | +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; } } | |
| 3084 | + | |
| 3085 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 3086 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 3087 | + | |
| 3088 | + var _super = _createSuper(Component); | |
| 3089 | + | |
| 3090 | + function Component() { | |
| 3091 | + (0, _classCallCheck2.default)(this, Component); | |
| 3092 | + return _super.apply(this, arguments); | |
| 3093 | + } | |
| 3094 | + | |
| 3095 | + (0, _createClass2.default)(Component, [{ | |
| 3096 | + key: "getNamespace", | |
| 3097 | + value: function getNamespace() { | |
| 3098 | + return 'globals/colors'; | |
| 3099 | + } | |
| 3100 | + }, { | |
| 3101 | + key: "defaultCommands", | |
| 3102 | + value: function defaultCommands() { | |
| 3103 | + return this.importCommands(commands); | |
| 3104 | + } | |
| 3105 | + }]); | |
| 3106 | + return Component; | |
| 3107 | +}(_componentBase.default); | |
| 3108 | + | |
| 3109 | +exports["default"] = Component; | |
| 3110 | + | |
| 3111 | +/***/ }), | |
| 3112 | + | |
| 3113 | +/***/ "../assets/dev/js/editor/data/globals/commands/data/colors.js": | |
| 3114 | +/*!********************************************************************!*\ | |
| 3115 | + !*** ../assets/dev/js/editor/data/globals/commands/data/colors.js ***! | |
| 3116 | + \********************************************************************/ | |
| 3117 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3118 | + | |
| 3119 | +"use strict"; | |
| 3120 | + | |
| 3121 | + | |
| 3122 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3123 | + | |
| 3124 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3125 | + value: true | |
| 3126 | +})); | |
| 3127 | +exports["default"] = exports.Colors = void 0; | |
| 3128 | + | |
| 3129 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3130 | + | |
| 3131 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3132 | + | |
| 3133 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3134 | + | |
| 3135 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3136 | + | |
| 3137 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3138 | + | |
| 3139 | +var _commandData = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js")); | |
| 3140 | + | |
| 3141 | +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); }; } | |
| 3142 | + | |
| 3143 | +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; } } | |
| 3144 | + | |
| 3145 | +var Colors = /*#__PURE__*/function (_CommandData) { | |
| 3146 | + (0, _inherits2.default)(Colors, _CommandData); | |
| 3147 | + | |
| 3148 | + var _super = _createSuper(Colors); | |
| 3149 | + | |
| 3150 | + function Colors() { | |
| 3151 | + (0, _classCallCheck2.default)(this, Colors); | |
| 3152 | + return _super.apply(this, arguments); | |
| 3153 | + } | |
| 3154 | + | |
| 3155 | + (0, _createClass2.default)(Colors, null, [{ | |
| 3156 | + key: "getEndpointFormat", | |
| 3157 | + value: function getEndpointFormat() { | |
| 3158 | + return 'globals/colors/{id}'; | |
| 3159 | + } | |
| 3160 | + }]); | |
| 3161 | + return Colors; | |
| 3162 | +}(_commandData.default); | |
| 3163 | + | |
| 3164 | +exports.Colors = Colors; | |
| 3165 | +var _default = Colors; | |
| 3166 | +exports["default"] = _default; | |
| 3167 | + | |
| 3168 | +/***/ }), | |
| 3169 | + | |
| 3170 | +/***/ "../assets/dev/js/editor/data/globals/commands/data/index.js": | |
| 3171 | +/*!*******************************************************************!*\ | |
| 3172 | + !*** ../assets/dev/js/editor/data/globals/commands/data/index.js ***! | |
| 3173 | + \*******************************************************************/ | |
| 3174 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3175 | + | |
| 3176 | +"use strict"; | |
| 3177 | + | |
| 3178 | + | |
| 3179 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3180 | + | |
| 3181 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3182 | + value: true | |
| 3183 | +})); | |
| 3184 | +Object.defineProperty(exports, "Colors", ({ | |
| 3185 | + enumerable: true, | |
| 3186 | + get: function get() { | |
| 3187 | + return _colors.Colors; | |
| 3188 | + } | |
| 3189 | +})); | |
| 3190 | +exports.Index = void 0; | |
| 3191 | +Object.defineProperty(exports, "Typography", ({ | |
| 3192 | + enumerable: true, | |
| 3193 | + get: function get() { | |
| 3194 | + return _typography.Typography; | |
| 3195 | + } | |
| 3196 | +})); | |
| 3197 | + | |
| 3198 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3199 | + | |
| 3200 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3201 | + | |
| 3202 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3203 | + | |
| 3204 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3205 | + | |
| 3206 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3207 | + | |
| 3208 | +var _commandData = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js")); | |
| 3209 | + | |
| 3210 | +var _colors = __webpack_require__(/*! ./colors */ "../assets/dev/js/editor/data/globals/commands/data/colors.js"); | |
| 3211 | + | |
| 3212 | +var _typography = __webpack_require__(/*! ./typography */ "../assets/dev/js/editor/data/globals/commands/data/typography.js"); | |
| 3213 | + | |
| 3214 | +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); }; } | |
| 3215 | + | |
| 3216 | +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; } } | |
| 3217 | + | |
| 3218 | +// TODO: Remove - Move to into base, Possible to handle using ComponentData. | |
| 3219 | +var Index = /*#__PURE__*/function (_CommandData) { | |
| 3220 | + (0, _inherits2.default)(Index, _CommandData); | |
| 3221 | + | |
| 3222 | + var _super = _createSuper(Index); | |
| 3223 | + | |
| 3224 | + function Index() { | |
| 3225 | + (0, _classCallCheck2.default)(this, Index); | |
| 3226 | + return _super.apply(this, arguments); | |
| 3227 | + } | |
| 3228 | + | |
| 3229 | + (0, _createClass2.default)(Index, null, [{ | |
| 3230 | + key: "getEndpointFormat", | |
| 3231 | + value: function getEndpointFormat() { | |
| 3232 | + // Format 'globals/index' to 'globals'. | |
| 3233 | + return 'globals'; | |
| 3234 | + } | |
| 3235 | + }]); | |
| 3236 | + return Index; | |
| 3237 | +}(_commandData.default); | |
| 3238 | + | |
| 3239 | +exports.Index = Index; | |
| 3240 | + | |
| 3241 | +/***/ }), | |
| 3242 | + | |
| 3243 | +/***/ "../assets/dev/js/editor/data/globals/commands/data/typography.js": | |
| 3244 | +/*!************************************************************************!*\ | |
| 3245 | + !*** ../assets/dev/js/editor/data/globals/commands/data/typography.js ***! | |
| 3246 | + \************************************************************************/ | |
| 3247 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3248 | + | |
| 3249 | +"use strict"; | |
| 3250 | + | |
| 3251 | + | |
| 3252 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3253 | + | |
| 3254 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3255 | + value: true | |
| 3256 | +})); | |
| 3257 | +exports["default"] = exports.Typography = void 0; | |
| 3258 | + | |
| 3259 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3260 | + | |
| 3261 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3262 | + | |
| 3263 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3264 | + | |
| 3265 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3266 | + | |
| 3267 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3268 | + | |
| 3269 | +var _commandData = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js")); | |
| 3270 | + | |
| 3271 | +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); }; } | |
| 3272 | + | |
| 3273 | +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; } } | |
| 3274 | + | |
| 3275 | +var Typography = /*#__PURE__*/function (_CommandData) { | |
| 3276 | + (0, _inherits2.default)(Typography, _CommandData); | |
| 3277 | + | |
| 3278 | + var _super = _createSuper(Typography); | |
| 3279 | + | |
| 3280 | + function Typography() { | |
| 3281 | + (0, _classCallCheck2.default)(this, Typography); | |
| 3282 | + return _super.apply(this, arguments); | |
| 3283 | + } | |
| 3284 | + | |
| 3285 | + (0, _createClass2.default)(Typography, null, [{ | |
| 3286 | + key: "getEndpointFormat", | |
| 3287 | + value: function getEndpointFormat() { | |
| 3288 | + return 'globals/typography/{id}'; | |
| 3289 | + } | |
| 3290 | + }]); | |
| 3291 | + return Typography; | |
| 3292 | +}(_commandData.default); | |
| 3293 | + | |
| 3294 | +exports.Typography = Typography; | |
| 3295 | +var _default = Typography; | |
| 3296 | +exports["default"] = _default; | |
| 3297 | + | |
| 3298 | +/***/ }), | |
| 3299 | + | |
| 3300 | +/***/ "../assets/dev/js/editor/data/globals/component.js": | |
| 3301 | +/*!*********************************************************!*\ | |
| 3302 | + !*** ../assets/dev/js/editor/data/globals/component.js ***! | |
| 3303 | + \*********************************************************/ | |
| 3304 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3305 | + | |
| 3306 | +"use strict"; | |
| 3307 | + | |
| 3308 | + | |
| 3309 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3310 | + | |
| 3311 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 3312 | + | |
| 3313 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3314 | + value: true | |
| 3315 | +})); | |
| 3316 | +exports["default"] = void 0; | |
| 3317 | + | |
| 3318 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3319 | + | |
| 3320 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3321 | + | |
| 3322 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 3323 | + | |
| 3324 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3325 | + | |
| 3326 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3327 | + | |
| 3328 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3329 | + | |
| 3330 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 3331 | + | |
| 3332 | +var _component = _interopRequireDefault(__webpack_require__(/*! ./typography/component */ "../assets/dev/js/editor/data/globals/typography/component.js")); | |
| 3333 | + | |
| 3334 | +var _component2 = _interopRequireDefault(__webpack_require__(/*! ./colors/component */ "../assets/dev/js/editor/data/globals/colors/component.js")); | |
| 3335 | + | |
| 3336 | +var commandsData = _interopRequireWildcard(__webpack_require__(/*! ./commands/data/ */ "../assets/dev/js/editor/data/globals/commands/data/index.js")); | |
| 3337 | + | |
| 3338 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 3339 | + | |
| 3340 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 3341 | + | |
| 3342 | +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); }; } | |
| 3343 | + | |
| 3344 | +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; } } | |
| 3345 | + | |
| 3346 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 3347 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 3348 | + | |
| 3349 | + var _super = _createSuper(Component); | |
| 3350 | + | |
| 3351 | + function Component() { | |
| 3352 | + (0, _classCallCheck2.default)(this, Component); | |
| 3353 | + return _super.apply(this, arguments); | |
| 3354 | + } | |
| 3355 | + | |
| 3356 | + (0, _createClass2.default)(Component, [{ | |
| 3357 | + key: "__construct", | |
| 3358 | + value: function __construct() { | |
| 48 | 3359 | var _this = this; |
| 49 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args; | |
| 50 | - if (!args.container && !args.containers) { | |
| 51 | - throw Error('container or containers are required.'); | |
| 3360 | + | |
| 3361 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 3362 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "__construct", this).call(this, args); | |
| 3363 | + elementorCommon.elements.$window.on('elementor:loaded', function () { | |
| 3364 | + return _this.refreshGlobalData(); | |
| 3365 | + }); | |
| 3366 | + } | |
| 3367 | + }, { | |
| 3368 | + key: "getNamespace", | |
| 3369 | + value: function getNamespace() { | |
| 3370 | + return 'globals'; | |
| 3371 | + } | |
| 3372 | + }, { | |
| 3373 | + key: "registerAPI", | |
| 3374 | + value: function registerAPI() { | |
| 3375 | + $e.components.register(new _component.default({ | |
| 3376 | + manager: this | |
| 3377 | + })); | |
| 3378 | + $e.components.register(new _component2.default({ | |
| 3379 | + manager: this | |
| 3380 | + })); | |
| 3381 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "registerAPI", this).call(this); | |
| 3382 | + } | |
| 3383 | + }, { | |
| 3384 | + key: "defaultData", | |
| 3385 | + value: function defaultData() { | |
| 3386 | + return this.importCommands(commandsData); | |
| 3387 | + } | |
| 3388 | + }, { | |
| 3389 | + key: "refreshGlobalData", | |
| 3390 | + value: function refreshGlobalData() { | |
| 3391 | + $e.data.deleteCache($e.components.get('globals'), 'globals/index'); | |
| 3392 | + } | |
| 3393 | + }]); | |
| 3394 | + return Component; | |
| 3395 | +}(_componentBase.default); | |
| 3396 | + | |
| 3397 | +exports["default"] = Component; | |
| 3398 | + | |
| 3399 | +/***/ }), | |
| 3400 | + | |
| 3401 | +/***/ "../assets/dev/js/editor/data/globals/typography/commands/create.js": | |
| 3402 | +/*!**************************************************************************!*\ | |
| 3403 | + !*** ../assets/dev/js/editor/data/globals/typography/commands/create.js ***! | |
| 3404 | + \**************************************************************************/ | |
| 3405 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3406 | + | |
| 3407 | +"use strict"; | |
| 3408 | + | |
| 3409 | + | |
| 3410 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3411 | + | |
| 3412 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3413 | + value: true | |
| 3414 | +})); | |
| 3415 | +exports.Create = void 0; | |
| 3416 | + | |
| 3417 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 3418 | + | |
| 3419 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3420 | + | |
| 3421 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3422 | + | |
| 3423 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3424 | + | |
| 3425 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3426 | + | |
| 3427 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3428 | + | |
| 3429 | +var _createBase = _interopRequireDefault(__webpack_require__(/*! elementor-editor/data/globals/base/create-base */ "../assets/dev/js/editor/data/globals/base/create-base.js")); | |
| 3430 | + | |
| 3431 | +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); }; } | |
| 3432 | + | |
| 3433 | +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; } } | |
| 3434 | + | |
| 3435 | +var Create = /*#__PURE__*/function (_CreateBase) { | |
| 3436 | + (0, _inherits2.default)(Create, _CreateBase); | |
| 3437 | + | |
| 3438 | + var _super = _createSuper(Create); | |
| 3439 | + | |
| 3440 | + function Create() { | |
| 3441 | + (0, _classCallCheck2.default)(this, Create); | |
| 3442 | + return _super.apply(this, arguments); | |
| 3443 | + } | |
| 3444 | + | |
| 3445 | + (0, _createClass2.default)(Create, [{ | |
| 3446 | + key: "apply", | |
| 3447 | + value: function apply() { | |
| 3448 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 3449 | + var container = args.container, | |
| 3450 | + setting = args.setting, | |
| 3451 | + title = args.title, | |
| 3452 | + controls = container.controls, | |
| 3453 | + availableControls = {}; | |
| 3454 | + var result = false, | |
| 3455 | + groupPrefix = ''; | |
| 3456 | + | |
| 3457 | + if (controls[setting] && controls[setting].groupPrefix) { | |
| 3458 | + groupPrefix = controls[setting].groupPrefix; | |
| 3459 | + } else { | |
| 3460 | + throw new Error("Invalid setting: control '".concat(setting, "', not found.")); | |
| 52 | 3461 | } |
| 53 | - if (args.container && args.containers) { | |
| 54 | - throw Error('container and containers cannot go together please select one of them.'); | |
| 3462 | + | |
| 3463 | + if (groupPrefix) { | |
| 3464 | + Object.entries(controls).forEach(function (_ref) { | |
| 3465 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 1), | |
| 3466 | + key = _ref2[0]; | |
| 3467 | + | |
| 3468 | + if (key.includes(groupPrefix)) { | |
| 3469 | + // Get values but remove defaults. | |
| 3470 | + var value = container.settings.get(key), | |
| 3471 | + defaultValue = container.controls[key].default; | |
| 3472 | + | |
| 3473 | + if (!_.isEqual(value, defaultValue)) { | |
| 3474 | + availableControls[key.replace(groupPrefix, elementor.config.kit_config.typography_prefix)] = container.settings.get(key); | |
| 3475 | + } | |
| 3476 | + } | |
| 3477 | + }); | |
| 55 | 3478 | } |
| 56 | - var containers = args.containers || [args.container]; | |
| 57 | - containers.forEach(function (container) { | |
| 58 | - _this.requireArgumentInstance('container', elementorModules.editor.Container, { | |
| 59 | - container: container | |
| 3479 | + | |
| 3480 | + if (Object.values(availableControls).length) { | |
| 3481 | + var id = elementorCommon.helpers.getUniqueId(); | |
| 3482 | + result = $e.data.create("globals/typography?id=".concat(id), { | |
| 3483 | + title: title, | |
| 3484 | + value: availableControls | |
| 60 | 3485 | }); |
| 61 | - }); | |
| 3486 | + } | |
| 3487 | + | |
| 3488 | + return result; | |
| 62 | 3489 | } |
| 63 | - }], [{ | |
| 64 | - key: "getInstanceType", | |
| 65 | - value: function getInstanceType() { | |
| 66 | - return 'CommandContainerBase'; | |
| 3490 | + }]); | |
| 3491 | + return Create; | |
| 3492 | +}(_createBase.default); | |
| 3493 | + | |
| 3494 | +exports.Create = Create; | |
| 3495 | + | |
| 3496 | +/***/ }), | |
| 3497 | + | |
| 3498 | +/***/ "../assets/dev/js/editor/data/globals/typography/commands/index.js": | |
| 3499 | +/*!*************************************************************************!*\ | |
| 3500 | + !*** ../assets/dev/js/editor/data/globals/typography/commands/index.js ***! | |
| 3501 | + \*************************************************************************/ | |
| 3502 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3503 | + | |
| 3504 | +"use strict"; | |
| 3505 | + | |
| 3506 | + | |
| 3507 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3508 | + value: true | |
| 3509 | +})); | |
| 3510 | +Object.defineProperty(exports, "Create", ({ | |
| 3511 | + enumerable: true, | |
| 3512 | + get: function get() { | |
| 3513 | + return _create.Create; | |
| 3514 | + } | |
| 3515 | +})); | |
| 3516 | + | |
| 3517 | +var _create = __webpack_require__(/*! ./create */ "../assets/dev/js/editor/data/globals/typography/commands/create.js"); | |
| 3518 | + | |
| 3519 | +/***/ }), | |
| 3520 | + | |
| 3521 | +/***/ "../assets/dev/js/editor/data/globals/typography/component.js": | |
| 3522 | +/*!********************************************************************!*\ | |
| 3523 | + !*** ../assets/dev/js/editor/data/globals/typography/component.js ***! | |
| 3524 | + \********************************************************************/ | |
| 3525 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3526 | + | |
| 3527 | +"use strict"; | |
| 3528 | + | |
| 3529 | + | |
| 3530 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3531 | + | |
| 3532 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 3533 | + | |
| 3534 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3535 | + value: true | |
| 3536 | +})); | |
| 3537 | +exports["default"] = void 0; | |
| 3538 | + | |
| 3539 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3540 | + | |
| 3541 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3542 | + | |
| 3543 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 3544 | + | |
| 3545 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3546 | + | |
| 3547 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3548 | + | |
| 3549 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3550 | + | |
| 3551 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 3552 | + | |
| 3553 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/data/globals/typography/commands/index.js")); | |
| 3554 | + | |
| 3555 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 3556 | + | |
| 3557 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 3558 | + | |
| 3559 | +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); }; } | |
| 3560 | + | |
| 3561 | +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; } } | |
| 3562 | + | |
| 3563 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 3564 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 3565 | + | |
| 3566 | + var _super = _createSuper(Component); | |
| 3567 | + | |
| 3568 | + function Component() { | |
| 3569 | + (0, _classCallCheck2.default)(this, Component); | |
| 3570 | + return _super.apply(this, arguments); | |
| 3571 | + } | |
| 3572 | + | |
| 3573 | + (0, _createClass2.default)(Component, [{ | |
| 3574 | + key: "__construct", | |
| 3575 | + value: function __construct() { | |
| 3576 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 3577 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "__construct", this).call(this, args); | |
| 67 | 3578 | } |
| 3579 | + }, { | |
| 3580 | + key: "getNamespace", | |
| 3581 | + value: function getNamespace() { | |
| 3582 | + return 'globals/typography'; | |
| 3583 | + } | |
| 3584 | + }, { | |
| 3585 | + key: "defaultCommands", | |
| 3586 | + value: function defaultCommands() { | |
| 3587 | + return this.importCommands(commands); | |
| 3588 | + } | |
| 68 | 3589 | }]); |
| 69 | -}(_commandBase.default); | |
| 3590 | + return Component; | |
| 3591 | +}(_componentBase.default); | |
| 70 | 3592 | |
| 3593 | +exports["default"] = Component; | |
| 3594 | + | |
| 71 | 3595 | /***/ }), |
| 72 | 3596 | |
| 73 | -/***/ "../assets/dev/js/editor/command-bases/command-container-internal-base.js": | |
| 3597 | +/***/ "../assets/dev/js/editor/document/commands/base/command-disable-enable.js": | |
| 74 | 3598 | /*!********************************************************************************!*\ |
| 75 | - !*** ../assets/dev/js/editor/command-bases/command-container-internal-base.js ***! | |
| 3599 | + !*** ../assets/dev/js/editor/document/commands/base/command-disable-enable.js ***! | |
| 76 | 3600 | \********************************************************************************/ |
| 77 | 3601 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 78 | 3602 | |
| 79 | 3603 | "use strict"; |
| @@ -79,43 +3603,155 @@ | ||
| 79 | 3603 | "use strict"; |
| 80 | 3604 | |
| 81 | 3605 | |
| 82 | 3606 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 3607 | + | |
| 83 | 3608 | Object.defineProperty(exports, "__esModule", ({ |
| 84 | 3609 | value: true |
| 85 | 3610 | })); |
| 86 | 3611 | exports["default"] = void 0; |
| 3612 | + | |
| 87 | 3613 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 3614 | + | |
| 88 | 3615 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 3616 | + | |
| 3617 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 3618 | + | |
| 3619 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3620 | + | |
| 89 | 3621 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 3622 | + | |
| 90 | 3623 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 91 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 92 | -var _commandContainerBase = _interopRequireDefault(__webpack_require__(/*! ./command-container-base */ "../assets/dev/js/editor/command-bases/command-container-base.js")); | |
| 93 | -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 94 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 95 | -/** | |
| 96 | - * @name $e.modules.editor.CommandContainerInternalBase | |
| 97 | - */ | |
| 98 | -var CommandContainerInternalBase = exports["default"] = /*#__PURE__*/function (_CommandContainerBase) { | |
| 99 | - function CommandContainerInternalBase(args) { | |
| 100 | - (0, _classCallCheck2.default)(this, CommandContainerInternalBase); | |
| 101 | - return _callSuper(this, CommandContainerInternalBase, [args, $e.commandsInternal]); | |
| 3624 | + | |
| 3625 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! ./command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 3626 | + | |
| 3627 | +var _settings = _interopRequireDefault(__webpack_require__(/*! elementor-document/elements/commands/settings */ "../assets/dev/js/editor/document/elements/commands/settings.js")); | |
| 3628 | + | |
| 3629 | +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); }; } | |
| 3630 | + | |
| 3631 | +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; } } | |
| 3632 | + | |
| 3633 | +var CommandDisableEnable = /*#__PURE__*/function (_CommandHistory) { | |
| 3634 | + (0, _inherits2.default)(CommandDisableEnable, _CommandHistory); | |
| 3635 | + | |
| 3636 | + var _super = _createSuper(CommandDisableEnable); | |
| 3637 | + | |
| 3638 | + function CommandDisableEnable() { | |
| 3639 | + (0, _classCallCheck2.default)(this, CommandDisableEnable); | |
| 3640 | + return _super.apply(this, arguments); | |
| 102 | 3641 | } |
| 103 | - (0, _inherits2.default)(CommandContainerInternalBase, _CommandContainerBase); | |
| 104 | - return (0, _createClass2.default)(CommandContainerInternalBase, null, [{ | |
| 105 | - key: "getInstanceType", | |
| 106 | - value: function getInstanceType() { | |
| 107 | - return 'CommandContainerInternalBase'; | |
| 3642 | + | |
| 3643 | + (0, _createClass2.default)(CommandDisableEnable, [{ | |
| 3644 | + key: "initialize", | |
| 3645 | + value: function initialize(args) { | |
| 3646 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandDisableEnable.prototype), "initialize", this).call(this, args); | |
| 3647 | + /** | |
| 3648 | + * Which command is running. | |
| 3649 | + * | |
| 3650 | + * @type {string} | |
| 3651 | + */ | |
| 3652 | + | |
| 3653 | + this.type = this.currentCommand === this.constructor.getEnableCommand() ? 'enable' : 'disable'; | |
| 108 | 3654 | } |
| 3655 | + }, { | |
| 3656 | + key: "getTitle", | |
| 3657 | + value: function getTitle() { | |
| 3658 | + elementorModules.ForceMethodImplementation(); | |
| 3659 | + } | |
| 3660 | + }, { | |
| 3661 | + key: "validateArgs", | |
| 3662 | + value: function validateArgs(args) { | |
| 3663 | + this.requireContainer(args); | |
| 3664 | + this.requireArgumentConstructor('settings', Object, args); | |
| 3665 | + } | |
| 3666 | + }, { | |
| 3667 | + key: "getHistory", | |
| 3668 | + value: function getHistory(args) { | |
| 3669 | + var settings = args.settings, | |
| 3670 | + _args$containers = args.containers, | |
| 3671 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 3672 | + changes = {}; | |
| 3673 | + containers.forEach(function (container) { | |
| 3674 | + var id = container.id; | |
| 3675 | + | |
| 3676 | + if (!changes[id]) { | |
| 3677 | + changes[id] = {}; | |
| 3678 | + } | |
| 3679 | + | |
| 3680 | + changes[id] = settings; | |
| 3681 | + }); | |
| 3682 | + | |
| 3683 | + var subTitle = this.getTitle() + ' ' + _settings.default.getSubTitle(args), | |
| 3684 | + type = this.type; | |
| 3685 | + | |
| 3686 | + return { | |
| 3687 | + containers: containers, | |
| 3688 | + subTitle: subTitle, | |
| 3689 | + data: { | |
| 3690 | + changes: changes, | |
| 3691 | + command: this.currentCommand | |
| 3692 | + }, | |
| 3693 | + type: type, | |
| 3694 | + restore: this.constructor.restore | |
| 3695 | + }; | |
| 3696 | + } | |
| 3697 | + }, { | |
| 3698 | + key: "isDataChanged", | |
| 3699 | + value: function isDataChanged() { | |
| 3700 | + return true; | |
| 3701 | + } | |
| 3702 | + }], [{ | |
| 3703 | + key: "getEnableCommand", | |
| 3704 | + value: // eslint-disable-next-line jsdoc/require-returns-check | |
| 3705 | + | |
| 3706 | + /** | |
| 3707 | + * @return {string} enable command | |
| 3708 | + */ | |
| 3709 | + function getEnableCommand() { | |
| 3710 | + elementorModules.ForceMethodImplementation(); | |
| 3711 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 3712 | + | |
| 3713 | + /** | |
| 3714 | + * @return {string} disable command | |
| 3715 | + */ | |
| 3716 | + | |
| 3717 | + }, { | |
| 3718 | + key: "getDisableCommand", | |
| 3719 | + value: function getDisableCommand() { | |
| 3720 | + elementorModules.ForceMethodImplementation(); | |
| 3721 | + } | |
| 3722 | + }, { | |
| 3723 | + key: "restore", | |
| 3724 | + value: function restore(historyItem, isRedo) { | |
| 3725 | + var data = historyItem.get('data'), | |
| 3726 | + CommandClass = $e.commands.getCommandClass(data.command); // Upon `disable` command toggle `isRedo`. | |
| 3727 | + | |
| 3728 | + if (CommandClass.getDisableCommand() === data.command) { | |
| 3729 | + isRedo = !isRedo; | |
| 3730 | + } | |
| 3731 | + | |
| 3732 | + historyItem.get('containers').forEach(function (container) { | |
| 3733 | + var settings = data.changes[container.id], | |
| 3734 | + toggle = isRedo ? CommandClass.getEnableCommand() : CommandClass.getDisableCommand(); | |
| 3735 | + $e.run(toggle, { | |
| 3736 | + container: container, | |
| 3737 | + settings: settings | |
| 3738 | + }); | |
| 3739 | + container.panel.refresh(); | |
| 3740 | + }); | |
| 3741 | + } | |
| 109 | 3742 | }]); |
| 110 | -}(_commandContainerBase.default); | |
| 3743 | + return CommandDisableEnable; | |
| 3744 | +}(_commandHistory.default); | |
| 111 | 3745 | |
| 3746 | +exports["default"] = CommandDisableEnable; | |
| 3747 | + | |
| 112 | 3748 | /***/ }), |
| 113 | 3749 | |
| 114 | -/***/ "../assets/dev/js/editor/document/command-bases/command-history-base.js": | |
| 115 | -/*!******************************************************************************!*\ | |
| 116 | - !*** ../assets/dev/js/editor/document/command-bases/command-history-base.js ***! | |
| 117 | - \******************************************************************************/ | |
| 3750 | +/***/ "../assets/dev/js/editor/document/commands/base/command-history-debounce.js": | |
| 3751 | +/*!**********************************************************************************!*\ | |
| 3752 | + !*** ../assets/dev/js/editor/document/commands/base/command-history-debounce.js ***! | |
| 3753 | + \**********************************************************************************/ | |
| 118 | 3754 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 119 | 3755 | |
| 120 | 3756 | "use strict"; |
| 121 | 3757 | |
| @@ -120,65 +3756,221 @@ | ||
| 120 | 3756 | "use strict"; |
| 121 | 3757 | |
| 122 | 3758 | |
| 123 | 3759 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 3760 | + | |
| 124 | 3761 | Object.defineProperty(exports, "__esModule", ({ |
| 125 | 3762 | value: true |
| 126 | 3763 | })); |
| 127 | -exports["default"] = void 0; | |
| 3764 | +exports.getDefaultDebounceDelay = exports["default"] = exports.DEFAULT_DEBOUNCE_DELAY = void 0; | |
| 3765 | + | |
| 128 | 3766 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 3767 | + | |
| 129 | 3768 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 3769 | + | |
| 3770 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 3771 | + | |
| 3772 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3773 | + | |
| 130 | 3774 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 3775 | + | |
| 131 | 3776 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 132 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 133 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 134 | -var _commandContainerBase = _interopRequireDefault(__webpack_require__(/*! elementor-editor/command-bases/command-container-base */ "../assets/dev/js/editor/command-bases/command-container-base.js")); | |
| 135 | -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 136 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 137 | -function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } | |
| 3777 | + | |
| 3778 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 3779 | + | |
| 3780 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 3781 | + | |
| 3782 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! ./command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 3783 | + | |
| 3784 | +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); }; } | |
| 3785 | + | |
| 3786 | +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; } } | |
| 3787 | + | |
| 3788 | +var DEFAULT_DEBOUNCE_DELAY = 800; | |
| 138 | 3789 | /** |
| 139 | - * @name $e.modules.editor.document.CommandHistoryBase | |
| 3790 | + * Function getDefaultDebounceDelay(). | |
| 3791 | + * | |
| 3792 | + * Returns default debounce delay time, if exists in config override. | |
| 3793 | + * | |
| 3794 | + * @return {number} default debounce delay time | |
| 140 | 3795 | */ |
| 141 | -var CommandHistoryBase = exports["default"] = /*#__PURE__*/function (_CommandContainerBase) { | |
| 142 | - function CommandHistoryBase() { | |
| 143 | - (0, _classCallCheck2.default)(this, CommandHistoryBase); | |
| 144 | - return _callSuper(this, CommandHistoryBase, arguments); | |
| 3796 | + | |
| 3797 | +exports.DEFAULT_DEBOUNCE_DELAY = DEFAULT_DEBOUNCE_DELAY; | |
| 3798 | + | |
| 3799 | +var getDefaultDebounceDelay = function getDefaultDebounceDelay() { | |
| 3800 | + var result = DEFAULT_DEBOUNCE_DELAY; | |
| 3801 | + | |
| 3802 | + if (elementor.config.document && undefined !== elementor.config.document.debounceDelay) { | |
| 3803 | + result = elementor.config.document.debounceDelay; | |
| 145 | 3804 | } |
| 146 | - (0, _inherits2.default)(CommandHistoryBase, _CommandContainerBase); | |
| 147 | - return (0, _createClass2.default)(CommandHistoryBase, [{ | |
| 3805 | + | |
| 3806 | + return result; | |
| 3807 | +}; | |
| 3808 | + | |
| 3809 | +exports.getDefaultDebounceDelay = getDefaultDebounceDelay; | |
| 3810 | + | |
| 3811 | +var CommandHistoryDebounce = /*#__PURE__*/function (_CommandHistory) { | |
| 3812 | + (0, _inherits2.default)(CommandHistoryDebounce, _CommandHistory); | |
| 3813 | + | |
| 3814 | + var _super = _createSuper(CommandHistoryDebounce); | |
| 3815 | + | |
| 3816 | + function CommandHistoryDebounce() { | |
| 3817 | + (0, _classCallCheck2.default)(this, CommandHistoryDebounce); | |
| 3818 | + return _super.apply(this, arguments); | |
| 3819 | + } | |
| 3820 | + | |
| 3821 | + (0, _createClass2.default)(CommandHistoryDebounce, [{ | |
| 148 | 3822 | key: "initialize", |
| 149 | - value: function initialize() { | |
| 150 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 3823 | + value: function initialize(args) { | |
| 151 | 3824 | var _args$options = args.options, |
| 152 | - options = _args$options === void 0 ? {} : _args$options, | |
| 153 | - _options$useHistory = options.useHistory, | |
| 154 | - useHistory = _options$useHistory === void 0 ? true : _options$useHistory; | |
| 155 | - if (useHistory) { | |
| 156 | - /** | |
| 157 | - * Get History from child command. | |
| 158 | - * | |
| 159 | - * @type {{}|boolean} | |
| 160 | - */ | |
| 161 | - this.history = this.getHistory(args); | |
| 3825 | + options = _args$options === void 0 ? {} : _args$options; | |
| 3826 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistoryDebounce.prototype), "initialize", this).call(this, args); | |
| 162 | 3827 | |
| 163 | - /** | |
| 164 | - * @type {number|boolean} | |
| 165 | - */ | |
| 166 | - this.historyId = false; | |
| 3828 | + if (!this.constructor.debounce) { | |
| 3829 | + this.constructor.debounce = _.debounce(function (fn) { | |
| 3830 | + return fn(); | |
| 3831 | + }, getDefaultDebounceDelay()); | |
| 3832 | + } // If its head command, and not called within another command. | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + if (1 === $e.commands.currentTrace.length || options.debounce) { | |
| 3836 | + this.isDebounceRequired = true; | |
| 167 | 3837 | } |
| 168 | 3838 | } |
| 3839 | + }, { | |
| 3840 | + key: "onBeforeRun", | |
| 3841 | + value: function onBeforeRun(args) { | |
| 3842 | + _commandBase.default.prototype.onBeforeRun.call(this, args); | |
| 169 | 3843 | |
| 170 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 3844 | + if (this.history && this.isHistoryActive()) { | |
| 3845 | + $e.internal('document/history/add-transaction', this.history); | |
| 3846 | + } | |
| 3847 | + } | |
| 3848 | + }, { | |
| 3849 | + key: "onAfterRun", | |
| 3850 | + value: function onAfterRun(args, result) { | |
| 3851 | + _commandBase.default.prototype.onAfterRun.call(this, args, result); | |
| 3852 | + | |
| 3853 | + if (this.isHistoryActive()) { | |
| 3854 | + if (this.isDebounceRequired) { | |
| 3855 | + this.constructor.debounce(function () { | |
| 3856 | + return $e.internal('document/history/end-transaction'); | |
| 3857 | + }); | |
| 3858 | + } else { | |
| 3859 | + $e.internal('document/history/end-transaction'); | |
| 3860 | + } | |
| 3861 | + } | |
| 3862 | + } | |
| 3863 | + }, { | |
| 3864 | + key: "onCatchApply", | |
| 3865 | + value: function onCatchApply(e) { | |
| 3866 | + _commandBase.default.prototype.onCatchApply.call(this, e); // Rollback history on failure. | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + if (e instanceof $e.modules.HookBreak && this.history) { | |
| 3870 | + if (this.isDebounceRequired) { | |
| 3871 | + // `clear-transaction` is under debounce, because it should `clear-transaction` after `end-transaction`. | |
| 3872 | + this.constructor.debounce(function () { | |
| 3873 | + return $e.internal('document/history/clear-transaction'); | |
| 3874 | + }); | |
| 3875 | + } else { | |
| 3876 | + $e.internal('document/history/clear-transaction'); | |
| 3877 | + } | |
| 3878 | + } | |
| 3879 | + } | |
| 3880 | + }], [{ | |
| 3881 | + key: "getInstanceType", | |
| 3882 | + value: | |
| 171 | 3883 | /** |
| 172 | - * Function getHistory(). | |
| 3884 | + * Function debounce(). | |
| 173 | 3885 | * |
| 174 | - * Get history object from child, do nothing if it false. | |
| 3886 | + * Will debounce every function you pass in, at the same debounce flow. | |
| 175 | 3887 | * |
| 176 | - * @param {*} [args={}] | |
| 3888 | + * @param {Function} | |
| 3889 | + */ | |
| 3890 | + function getInstanceType() { | |
| 3891 | + return 'CommandHistoryDebounce'; | |
| 3892 | + } | |
| 3893 | + }]); | |
| 3894 | + return CommandHistoryDebounce; | |
| 3895 | +}(_commandHistory.default); | |
| 3896 | + | |
| 3897 | +exports["default"] = CommandHistoryDebounce; | |
| 3898 | +(0, _defineProperty2.default)(CommandHistoryDebounce, "debounce", undefined); | |
| 3899 | + | |
| 3900 | +/***/ }), | |
| 3901 | + | |
| 3902 | +/***/ "../assets/dev/js/editor/document/commands/base/command-history.js": | |
| 3903 | +/*!*************************************************************************!*\ | |
| 3904 | + !*** ../assets/dev/js/editor/document/commands/base/command-history.js ***! | |
| 3905 | + \*************************************************************************/ | |
| 3906 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3907 | + | |
| 3908 | +"use strict"; | |
| 3909 | + | |
| 3910 | + | |
| 3911 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3912 | + | |
| 3913 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3914 | + value: true | |
| 3915 | +})); | |
| 3916 | +exports["default"] = void 0; | |
| 3917 | + | |
| 3918 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3919 | + | |
| 3920 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3921 | + | |
| 3922 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 3923 | + | |
| 3924 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3925 | + | |
| 3926 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3927 | + | |
| 3928 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3929 | + | |
| 3930 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 3931 | + | |
| 3932 | +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); }; } | |
| 3933 | + | |
| 3934 | +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; } } | |
| 3935 | + | |
| 3936 | +var CommandHistory = /*#__PURE__*/function (_CommandBase) { | |
| 3937 | + (0, _inherits2.default)(CommandHistory, _CommandBase); | |
| 3938 | + | |
| 3939 | + var _super = _createSuper(CommandHistory); | |
| 3940 | + | |
| 3941 | + function CommandHistory(args) { | |
| 3942 | + var _this; | |
| 3943 | + | |
| 3944 | + (0, _classCallCheck2.default)(this, CommandHistory); | |
| 3945 | + _this = _super.call(this, args); | |
| 3946 | + /** | |
| 3947 | + * Get History from child command. | |
| 177 | 3948 | * |
| 178 | - * @return {({}|boolean)} history object | |
| 3949 | + * @type {{}|boolean} | |
| 179 | 3950 | */ |
| 180 | - }, { | |
| 3951 | + | |
| 3952 | + _this.history = _this.getHistory(args); | |
| 3953 | + /** | |
| 3954 | + * @type {number|boolean} | |
| 3955 | + */ | |
| 3956 | + | |
| 3957 | + _this.historyId = false; | |
| 3958 | + return _this; | |
| 3959 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 3960 | + | |
| 3961 | + /** | |
| 3962 | + * Function getHistory(). | |
| 3963 | + * | |
| 3964 | + * Get history object from child, do nothing if it false. | |
| 3965 | + * | |
| 3966 | + * @param {*} [args={}] | |
| 3967 | + * | |
| 3968 | + * @return {({}|boolean)} history object | |
| 3969 | + */ | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + (0, _createClass2.default)(CommandHistory, [{ | |
| 181 | 3973 | key: "getHistory", |
| 182 | 3974 | value: function getHistory() { |
| 183 | 3975 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 184 | 3976 | // eslint-disable-line no-unused-vars |
| @@ -183,9 +3975,8 @@ | ||
| 183 | 3975 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 184 | 3976 | // eslint-disable-line no-unused-vars |
| 185 | 3977 | elementorModules.ForceMethodImplementation(); |
| 186 | 3978 | } |
| 187 | - | |
| 188 | 3979 | /** |
| 189 | 3980 | * Function isHistoryActive(). |
| 190 | 3981 | * |
| 191 | 3982 | * Return `elementor.documents.getCurrent().history.getActive()`. |
| @@ -191,8 +3982,9 @@ | ||
| 191 | 3982 | * Return `elementor.documents.getCurrent().history.getActive()`. |
| 192 | 3983 | * |
| 193 | 3984 | * @return {boolean} is history active |
| 194 | 3985 | */ |
| 3986 | + | |
| 195 | 3987 | }, { |
| 196 | 3988 | key: "isHistoryActive", |
| 197 | 3989 | value: function isHistoryActive() { |
| 198 | 3990 | return elementor.documents.getCurrent().history.getActive(); |
| @@ -199,9 +3991,10 @@ | ||
| 199 | 3991 | } |
| 200 | 3992 | }, { |
| 201 | 3993 | key: "onBeforeRun", |
| 202 | 3994 | value: function onBeforeRun(args) { |
| 203 | - _superPropGet(CommandHistoryBase, "onBeforeRun", this, 3)([args]); | |
| 3995 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistory.prototype), "onBeforeRun", this).call(this, args); | |
| 3996 | + | |
| 204 | 3997 | if (this.history && this.isHistoryActive()) { |
| 205 | 3998 | this.historyId = $e.internal('document/history/start-log', this.history); |
| 206 | 3999 | } |
| 207 | 4000 | } |
| @@ -207,9 +4000,10 @@ | ||
| 207 | 4000 | } |
| 208 | 4001 | }, { |
| 209 | 4002 | key: "onAfterRun", |
| 210 | 4003 | value: function onAfterRun(args, result) { |
| 211 | - _superPropGet(CommandHistoryBase, "onAfterRun", this, 3)([args, result]); | |
| 4004 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistory.prototype), "onAfterRun", this).call(this, args, result); | |
| 4005 | + | |
| 212 | 4006 | if (this.history && this.isHistoryActive()) { |
| 213 | 4007 | $e.internal('document/history/end-log', { |
| 214 | 4008 | id: this.historyId |
| 215 | 4009 | }); |
| @@ -215,49 +4009,4096 @@ | ||
| 215 | 4009 | }); |
| 216 | 4010 | } |
| 217 | 4011 | } |
| 218 | 4012 | }, { |
| 219 | - key: "onAfterApply", | |
| 220 | - value: function onAfterApply() { | |
| 4013 | + key: "onCatchApply", | |
| 4014 | + value: function onCatchApply(e) { | |
| 4015 | + (0, _get2.default)((0, _getPrototypeOf2.default)(CommandHistory.prototype), "onCatchApply", this).call(this, e); // Rollback history on failure. | |
| 4016 | + | |
| 4017 | + if (e instanceof $e.modules.HookBreak && this.historyId) { | |
| 4018 | + $e.internal('document/history/delete-log', { | |
| 4019 | + id: this.historyId | |
| 4020 | + }); | |
| 4021 | + } | |
| 4022 | + } | |
| 4023 | + }], [{ | |
| 4024 | + key: "getInstanceType", | |
| 4025 | + value: function getInstanceType() { | |
| 4026 | + return 'CommandHistory'; | |
| 4027 | + } | |
| 4028 | + }]); | |
| 4029 | + return CommandHistory; | |
| 4030 | +}(_commandBase.default); | |
| 4031 | + | |
| 4032 | +exports["default"] = CommandHistory; | |
| 4033 | + | |
| 4034 | +/***/ }), | |
| 4035 | + | |
| 4036 | +/***/ "../assets/dev/js/editor/document/component.js": | |
| 4037 | +/*!*****************************************************!*\ | |
| 4038 | + !*** ../assets/dev/js/editor/document/component.js ***! | |
| 4039 | + \*****************************************************/ | |
| 4040 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4041 | + | |
| 4042 | +"use strict"; | |
| 4043 | + | |
| 4044 | + | |
| 4045 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4046 | + | |
| 4047 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 4048 | + | |
| 4049 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4050 | + value: true | |
| 4051 | +})); | |
| 4052 | +exports["default"] = void 0; | |
| 4053 | + | |
| 4054 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4055 | + | |
| 4056 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4057 | + | |
| 4058 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 4059 | + | |
| 4060 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4061 | + | |
| 4062 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4063 | + | |
| 4064 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4065 | + | |
| 4066 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 4067 | + | |
| 4068 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! ./commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 4069 | + | |
| 4070 | +var _commandHistoryDebounce = _interopRequireDefault(__webpack_require__(/*! ./commands/base/command-history-debounce */ "../assets/dev/js/editor/document/commands/base/command-history-debounce.js")); | |
| 4071 | + | |
| 4072 | +var components = _interopRequireWildcard(__webpack_require__(/*! ./ */ "../assets/dev/js/editor/document/index.js")); | |
| 4073 | + | |
| 4074 | +var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks/ */ "../assets/dev/js/editor/document/hooks/index.js")); | |
| 4075 | + | |
| 4076 | +var uiStates = _interopRequireWildcard(__webpack_require__(/*! ./ui-states */ "../assets/dev/js/editor/document/ui-states/index.js")); | |
| 4077 | + | |
| 4078 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 4079 | + | |
| 4080 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 4081 | + | |
| 4082 | +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); }; } | |
| 4083 | + | |
| 4084 | +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; } } | |
| 4085 | + | |
| 4086 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 4087 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 4088 | + | |
| 4089 | + var _super = _createSuper(Component); | |
| 4090 | + | |
| 4091 | + function Component() { | |
| 4092 | + (0, _classCallCheck2.default)(this, Component); | |
| 4093 | + return _super.apply(this, arguments); | |
| 4094 | + } | |
| 4095 | + | |
| 4096 | + (0, _createClass2.default)(Component, [{ | |
| 4097 | + key: "getNamespace", | |
| 4098 | + value: function getNamespace() { | |
| 4099 | + return 'document'; | |
| 4100 | + } | |
| 4101 | + }, { | |
| 4102 | + key: "registerAPI", | |
| 4103 | + value: function registerAPI() { | |
| 4104 | + Object.values(components).forEach(function (ComponentClass) { | |
| 4105 | + return $e.components.register(new ComponentClass()); | |
| 4106 | + }); | |
| 4107 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "registerAPI", this).call(this); | |
| 4108 | + } | |
| 4109 | + }, { | |
| 4110 | + key: "defaultCommands", | |
| 4111 | + value: function defaultCommands() { | |
| 4112 | + return {//example: ( args ) => ( new Commands.Example( args ).run() ), | |
| 4113 | + }; | |
| 4114 | + } | |
| 4115 | + }, { | |
| 4116 | + key: "defaultHooks", | |
| 4117 | + value: function defaultHooks() { | |
| 4118 | + return this.importHooks(hooks); | |
| 4119 | + } | |
| 4120 | + }, { | |
| 4121 | + key: "defaultUiStates", | |
| 4122 | + value: function defaultUiStates() { | |
| 4123 | + return this.importUiStates(uiStates); | |
| 4124 | + } | |
| 4125 | + }, { | |
| 4126 | + key: "defaultUtils", | |
| 4127 | + value: function defaultUtils() { | |
| 4128 | + var _this = this; | |
| 4129 | + | |
| 4130 | + return { | |
| 4131 | + findViewRecursive: function findViewRecursive(parent, key, value) { | |
| 4132 | + var multiple = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; | |
| 4133 | + var found = []; | |
| 4134 | + | |
| 4135 | + for (var x in parent._views) { | |
| 4136 | + var view = parent._views[x]; | |
| 4137 | + | |
| 4138 | + if (value === view.model.get(key)) { | |
| 4139 | + found.push(view); | |
| 4140 | + | |
| 4141 | + if (!multiple) { | |
| 4142 | + return found; | |
| 4143 | + } | |
| 4144 | + } | |
| 4145 | + | |
| 4146 | + if (view.children) { | |
| 4147 | + var views = _this.utils.findViewRecursive(view.children, key, value, multiple); | |
| 4148 | + | |
| 4149 | + if (views.length) { | |
| 4150 | + found = found.concat(views); | |
| 4151 | + | |
| 4152 | + if (!multiple) { | |
| 4153 | + return found; | |
| 4154 | + } | |
| 4155 | + } | |
| 4156 | + } | |
| 4157 | + } | |
| 4158 | + | |
| 4159 | + return found; | |
| 4160 | + }, | |
| 4161 | + findViewById: function findViewById(id) { | |
| 4162 | + var elements = _this.utils.findViewRecursive(elementor.getPreviewView().children, 'id', id, false); | |
| 4163 | + | |
| 4164 | + return elements ? elements[0] : false; | |
| 4165 | + }, | |
| 4166 | + findContainerById: function findContainerById(id) { | |
| 4167 | + var result = _this.utils.findViewById(id); | |
| 4168 | + | |
| 4169 | + if (result) { | |
| 4170 | + result = result.getContainer(); | |
| 4171 | + } | |
| 4172 | + | |
| 4173 | + return result; | |
| 4174 | + } | |
| 4175 | + }; | |
| 4176 | + } | |
| 4177 | + }], [{ | |
| 4178 | + key: "getModules", | |
| 4179 | + value: function getModules() { | |
| 4180 | + var modules = { | |
| 4181 | + get CommandHistoryBase() { | |
| 4182 | + elementorCommon.helpers.hardDeprecated('$e.modules.document.CommandHistoryBase', '3.0.0', '$e.modules.document.CommandHistory'); | |
| 4183 | + return this.CommandHistory; | |
| 4184 | + }, | |
| 4185 | + | |
| 4186 | + get CommandHistoryDebounceBase() { | |
| 4187 | + elementorCommon.helpers.hardDeprecated('$e.modules.document.CommandHistoryDebounceBase', '3.0.0', '$e.modules.document.CommandHistoryDebounce'); | |
| 4188 | + return this.CommandHistoryDebounce; | |
| 4189 | + }, | |
| 4190 | + | |
| 4191 | + CommandHistory: _commandHistory.default, | |
| 4192 | + CommandHistoryDebounce: _commandHistoryDebounce.default | |
| 4193 | + }; | |
| 4194 | + return modules; | |
| 4195 | + } | |
| 4196 | + }]); | |
| 4197 | + return Component; | |
| 4198 | +}(_componentBase.default); | |
| 4199 | + | |
| 4200 | +exports["default"] = Component; | |
| 4201 | + | |
| 4202 | +/***/ }), | |
| 4203 | + | |
| 4204 | +/***/ "../assets/dev/js/editor/document/dynamic/commands/base/disable-enable.js": | |
| 4205 | +/*!********************************************************************************!*\ | |
| 4206 | + !*** ../assets/dev/js/editor/document/dynamic/commands/base/disable-enable.js ***! | |
| 4207 | + \********************************************************************************/ | |
| 4208 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4209 | + | |
| 4210 | +"use strict"; | |
| 4211 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 4212 | + | |
| 4213 | + | |
| 4214 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4215 | + | |
| 4216 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4217 | + value: true | |
| 4218 | +})); | |
| 4219 | +exports["default"] = void 0; | |
| 4220 | + | |
| 4221 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4222 | + | |
| 4223 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4224 | + | |
| 4225 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4226 | + | |
| 4227 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4228 | + | |
| 4229 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4230 | + | |
| 4231 | +var _commandDisableEnable = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-disable-enable */ "../assets/dev/js/editor/document/commands/base/command-disable-enable.js")); | |
| 4232 | + | |
| 4233 | +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); }; } | |
| 4234 | + | |
| 4235 | +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; } } | |
| 4236 | + | |
| 4237 | +var DisableEnable = /*#__PURE__*/function (_CommandDisableEnable) { | |
| 4238 | + (0, _inherits2.default)(DisableEnable, _CommandDisableEnable); | |
| 4239 | + | |
| 4240 | + var _super = _createSuper(DisableEnable); | |
| 4241 | + | |
| 4242 | + function DisableEnable() { | |
| 4243 | + (0, _classCallCheck2.default)(this, DisableEnable); | |
| 4244 | + return _super.apply(this, arguments); | |
| 4245 | + } | |
| 4246 | + | |
| 4247 | + (0, _createClass2.default)(DisableEnable, [{ | |
| 4248 | + key: "getTitle", | |
| 4249 | + value: function getTitle() { | |
| 4250 | + return __('Dynamic'); | |
| 4251 | + } | |
| 4252 | + }], [{ | |
| 4253 | + key: "getEnableCommand", | |
| 4254 | + value: function getEnableCommand() { | |
| 4255 | + return 'document/dynamic/enable'; | |
| 4256 | + } | |
| 4257 | + }, { | |
| 4258 | + key: "getDisableCommand", | |
| 4259 | + value: function getDisableCommand() { | |
| 4260 | + return 'document/dynamic/disable'; | |
| 4261 | + } | |
| 4262 | + }]); | |
| 4263 | + return DisableEnable; | |
| 4264 | +}(_commandDisableEnable.default); | |
| 4265 | + | |
| 4266 | +exports["default"] = DisableEnable; | |
| 4267 | + | |
| 4268 | +/***/ }), | |
| 4269 | + | |
| 4270 | +/***/ "../assets/dev/js/editor/document/dynamic/commands/disable.js": | |
| 4271 | +/*!********************************************************************!*\ | |
| 4272 | + !*** ../assets/dev/js/editor/document/dynamic/commands/disable.js ***! | |
| 4273 | + \********************************************************************/ | |
| 4274 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4275 | + | |
| 4276 | +"use strict"; | |
| 4277 | + | |
| 4278 | + | |
| 4279 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4280 | + | |
| 4281 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4282 | + value: true | |
| 4283 | +})); | |
| 4284 | +exports["default"] = exports.Disable = void 0; | |
| 4285 | + | |
| 4286 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4287 | + | |
| 4288 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4289 | + | |
| 4290 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4291 | + | |
| 4292 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4293 | + | |
| 4294 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4295 | + | |
| 4296 | +var _disableEnable = _interopRequireDefault(__webpack_require__(/*! ./base/disable-enable */ "../assets/dev/js/editor/document/dynamic/commands/base/disable-enable.js")); | |
| 4297 | + | |
| 4298 | +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); }; } | |
| 4299 | + | |
| 4300 | +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; } } | |
| 4301 | + | |
| 4302 | +var Disable = /*#__PURE__*/function (_DisableEnable) { | |
| 4303 | + (0, _inherits2.default)(Disable, _DisableEnable); | |
| 4304 | + | |
| 4305 | + var _super = _createSuper(Disable); | |
| 4306 | + | |
| 4307 | + function Disable() { | |
| 4308 | + (0, _classCallCheck2.default)(this, Disable); | |
| 4309 | + return _super.apply(this, arguments); | |
| 4310 | + } | |
| 4311 | + | |
| 4312 | + (0, _createClass2.default)(Disable, [{ | |
| 4313 | + key: "apply", | |
| 4314 | + value: function apply(args) { | |
| 4315 | + var settings = args.settings, | |
| 4316 | + _args$containers = args.containers, | |
| 4317 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 4318 | + containers.forEach(function (container) { | |
| 4319 | + container = container.lookup(); | |
| 4320 | + Object.keys(settings).forEach(function (setting) { | |
| 4321 | + container.dynamic.unset(setting); | |
| 4322 | + }); | |
| 4323 | + $e.internal('document/elements/set-settings', { | |
| 4324 | + container: container, | |
| 4325 | + settings: { | |
| 4326 | + __dynamic__: container.dynamic.toJSON() | |
| 4327 | + } | |
| 4328 | + }); | |
| 4329 | + }); | |
| 4330 | + } | |
| 4331 | + }]); | |
| 4332 | + return Disable; | |
| 4333 | +}(_disableEnable.default); | |
| 4334 | + | |
| 4335 | +exports.Disable = Disable; | |
| 4336 | +var _default = Disable; | |
| 4337 | +exports["default"] = _default; | |
| 4338 | + | |
| 4339 | +/***/ }), | |
| 4340 | + | |
| 4341 | +/***/ "../assets/dev/js/editor/document/dynamic/commands/enable.js": | |
| 4342 | +/*!*******************************************************************!*\ | |
| 4343 | + !*** ../assets/dev/js/editor/document/dynamic/commands/enable.js ***! | |
| 4344 | + \*******************************************************************/ | |
| 4345 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4346 | + | |
| 4347 | +"use strict"; | |
| 4348 | + | |
| 4349 | + | |
| 4350 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4351 | + | |
| 4352 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4353 | + value: true | |
| 4354 | +})); | |
| 4355 | +exports["default"] = exports.Enable = void 0; | |
| 4356 | + | |
| 4357 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4358 | + | |
| 4359 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4360 | + | |
| 4361 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4362 | + | |
| 4363 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4364 | + | |
| 4365 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4366 | + | |
| 4367 | +var _disableEnable = _interopRequireDefault(__webpack_require__(/*! ./base/disable-enable */ "../assets/dev/js/editor/document/dynamic/commands/base/disable-enable.js")); | |
| 4368 | + | |
| 4369 | +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); }; } | |
| 4370 | + | |
| 4371 | +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; } } | |
| 4372 | + | |
| 4373 | +var Enable = /*#__PURE__*/function (_DisableEnable) { | |
| 4374 | + (0, _inherits2.default)(Enable, _DisableEnable); | |
| 4375 | + | |
| 4376 | + var _super = _createSuper(Enable); | |
| 4377 | + | |
| 4378 | + function Enable() { | |
| 4379 | + (0, _classCallCheck2.default)(this, Enable); | |
| 4380 | + return _super.apply(this, arguments); | |
| 4381 | + } | |
| 4382 | + | |
| 4383 | + (0, _createClass2.default)(Enable, [{ | |
| 4384 | + key: "apply", | |
| 4385 | + value: function apply(args) { | |
| 4386 | + var settings = args.settings, | |
| 4387 | + _args$containers = args.containers, | |
| 4388 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 4389 | + containers.forEach(function (container) { | |
| 4390 | + container = container.lookup(); | |
| 4391 | + container.dynamic.set(settings); | |
| 4392 | + $e.internal('document/elements/set-settings', { | |
| 4393 | + container: container, | |
| 4394 | + settings: { | |
| 4395 | + __dynamic__: container.dynamic.toJSON() | |
| 4396 | + } | |
| 4397 | + }); | |
| 4398 | + }); | |
| 4399 | + } | |
| 4400 | + }]); | |
| 4401 | + return Enable; | |
| 4402 | +}(_disableEnable.default); | |
| 4403 | + | |
| 4404 | +exports.Enable = Enable; | |
| 4405 | +var _default = Enable; | |
| 4406 | +exports["default"] = _default; | |
| 4407 | + | |
| 4408 | +/***/ }), | |
| 4409 | + | |
| 4410 | +/***/ "../assets/dev/js/editor/document/dynamic/commands/index.js": | |
| 4411 | +/*!******************************************************************!*\ | |
| 4412 | + !*** ../assets/dev/js/editor/document/dynamic/commands/index.js ***! | |
| 4413 | + \******************************************************************/ | |
| 4414 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4415 | + | |
| 4416 | +"use strict"; | |
| 4417 | + | |
| 4418 | + | |
| 4419 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4420 | + value: true | |
| 4421 | +})); | |
| 4422 | +Object.defineProperty(exports, "Disable", ({ | |
| 4423 | + enumerable: true, | |
| 4424 | + get: function get() { | |
| 4425 | + return _disable.Disable; | |
| 4426 | + } | |
| 4427 | +})); | |
| 4428 | +Object.defineProperty(exports, "Enable", ({ | |
| 4429 | + enumerable: true, | |
| 4430 | + get: function get() { | |
| 4431 | + return _enable.Enable; | |
| 4432 | + } | |
| 4433 | +})); | |
| 4434 | +Object.defineProperty(exports, "Settings", ({ | |
| 4435 | + enumerable: true, | |
| 4436 | + get: function get() { | |
| 4437 | + return _settings.Settings; | |
| 4438 | + } | |
| 4439 | +})); | |
| 4440 | + | |
| 4441 | +var _disable = __webpack_require__(/*! ./disable */ "../assets/dev/js/editor/document/dynamic/commands/disable.js"); | |
| 4442 | + | |
| 4443 | +var _enable = __webpack_require__(/*! ./enable */ "../assets/dev/js/editor/document/dynamic/commands/enable.js"); | |
| 4444 | + | |
| 4445 | +var _settings = __webpack_require__(/*! ./settings */ "../assets/dev/js/editor/document/dynamic/commands/settings.js"); | |
| 4446 | + | |
| 4447 | +/***/ }), | |
| 4448 | + | |
| 4449 | +/***/ "../assets/dev/js/editor/document/dynamic/commands/settings.js": | |
| 4450 | +/*!*********************************************************************!*\ | |
| 4451 | + !*** ../assets/dev/js/editor/document/dynamic/commands/settings.js ***! | |
| 4452 | + \*********************************************************************/ | |
| 4453 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4454 | + | |
| 4455 | +"use strict"; | |
| 4456 | + | |
| 4457 | + | |
| 4458 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4459 | + | |
| 4460 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4461 | + value: true | |
| 4462 | +})); | |
| 4463 | +exports["default"] = exports.Settings = void 0; | |
| 4464 | + | |
| 4465 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4466 | + | |
| 4467 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4468 | + | |
| 4469 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4470 | + | |
| 4471 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4472 | + | |
| 4473 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4474 | + | |
| 4475 | +var _commandHistoryDebounce = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history-debounce */ "../assets/dev/js/editor/document/commands/base/command-history-debounce.js")); | |
| 4476 | + | |
| 4477 | +var _settings = _interopRequireDefault(__webpack_require__(/*! elementor-document/elements/commands/settings */ "../assets/dev/js/editor/document/elements/commands/settings.js")); | |
| 4478 | + | |
| 4479 | +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); }; } | |
| 4480 | + | |
| 4481 | +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; } } | |
| 4482 | + | |
| 4483 | +/** | |
| 4484 | + * The difference between 'document/elements/settings` and `document/dynamic/settings` is: | |
| 4485 | + * that `document/elements/settings` apply settings to `container.settings` and `document/dynamic/settings` affect | |
| 4486 | + * `container.settings.__dynamic__`, also clearing the dynamic if `args.settings` is empty. | |
| 4487 | + */ | |
| 4488 | +var Settings = /*#__PURE__*/function (_CommandHistoryDeboun) { | |
| 4489 | + (0, _inherits2.default)(Settings, _CommandHistoryDeboun); | |
| 4490 | + | |
| 4491 | + var _super = _createSuper(Settings); | |
| 4492 | + | |
| 4493 | + function Settings() { | |
| 4494 | + (0, _classCallCheck2.default)(this, Settings); | |
| 4495 | + return _super.apply(this, arguments); | |
| 4496 | + } | |
| 4497 | + | |
| 4498 | + (0, _createClass2.default)(Settings, [{ | |
| 4499 | + key: "validateArgs", | |
| 4500 | + value: function validateArgs(args) { | |
| 4501 | + this.requireContainer(args); | |
| 4502 | + this.requireArgumentConstructor('settings', Object, args); | |
| 4503 | + } | |
| 4504 | + }, { | |
| 4505 | + key: "getHistory", | |
| 4506 | + value: function getHistory(args) { | |
| 4507 | + var settings = args.settings, | |
| 4508 | + _args$containers = args.containers, | |
| 4509 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 4510 | + changes = {}; | |
| 4511 | + containers.forEach(function (container) { | |
| 4512 | + var id = container.id; | |
| 4513 | + | |
| 4514 | + if (!changes[id]) { | |
| 4515 | + changes[id] = {}; | |
| 4516 | + } | |
| 4517 | + | |
| 4518 | + changes[id] = { | |
| 4519 | + old: container.dynamic.toJSON(), | |
| 4520 | + new: settings | |
| 4521 | + }; | |
| 4522 | + }); | |
| 4523 | + | |
| 4524 | + var subTitle = _settings.default.getSubTitle(args); | |
| 4525 | + | |
| 4526 | + return { | |
| 4527 | + containers: containers, | |
| 4528 | + subTitle: subTitle, | |
| 4529 | + data: { | |
| 4530 | + changes: changes | |
| 4531 | + }, | |
| 4532 | + type: 'change', | |
| 4533 | + restore: this.constructor.restore | |
| 4534 | + }; | |
| 4535 | + } | |
| 4536 | + }, { | |
| 4537 | + key: "apply", | |
| 4538 | + value: function apply(args) { | |
| 4539 | + var settings = args.settings, | |
| 4540 | + _args$containers2 = args.containers, | |
| 4541 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 4542 | + containers.forEach(function (container) { | |
| 4543 | + container = container.lookup(); | |
| 4544 | + | |
| 4545 | + if (!Object.keys(settings).length) { | |
| 4546 | + container.dynamic.clear(); | |
| 4547 | + } else { | |
| 4548 | + container.dynamic.set(settings); | |
| 4549 | + } | |
| 4550 | + | |
| 4551 | + $e.internal('document/elements/set-settings', { | |
| 4552 | + container: container, | |
| 4553 | + settings: { | |
| 4554 | + __dynamic__: container.dynamic.toJSON() | |
| 4555 | + } | |
| 4556 | + }); | |
| 4557 | + }); | |
| 4558 | + } | |
| 4559 | + }], [{ | |
| 4560 | + key: "restore", | |
| 4561 | + value: function restore(historyItem, isRedo) { | |
| 4562 | + var data = historyItem.get('data'); | |
| 4563 | + historyItem.get('containers').forEach(function (container) { | |
| 4564 | + var changes = data.changes[container.id]; | |
| 4565 | + $e.run('document/dynamic/settings', { | |
| 4566 | + container: container, | |
| 4567 | + settings: isRedo ? changes.new : changes.old | |
| 4568 | + }); | |
| 4569 | + container.panel.refresh(); | |
| 4570 | + }); | |
| 4571 | + } | |
| 4572 | + }]); | |
| 4573 | + return Settings; | |
| 4574 | +}(_commandHistoryDebounce.default); | |
| 4575 | + | |
| 4576 | +exports.Settings = Settings; | |
| 4577 | +var _default = Settings; | |
| 4578 | +exports["default"] = _default; | |
| 4579 | + | |
| 4580 | +/***/ }), | |
| 4581 | + | |
| 4582 | +/***/ "../assets/dev/js/editor/document/dynamic/component.js": | |
| 4583 | +/*!*************************************************************!*\ | |
| 4584 | + !*** ../assets/dev/js/editor/document/dynamic/component.js ***! | |
| 4585 | + \*************************************************************/ | |
| 4586 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4587 | + | |
| 4588 | +"use strict"; | |
| 4589 | + | |
| 4590 | + | |
| 4591 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4592 | + | |
| 4593 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 4594 | + | |
| 4595 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4596 | + value: true | |
| 4597 | +})); | |
| 4598 | +exports["default"] = void 0; | |
| 4599 | + | |
| 4600 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4601 | + | |
| 4602 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4603 | + | |
| 4604 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4605 | + | |
| 4606 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4607 | + | |
| 4608 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4609 | + | |
| 4610 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 4611 | + | |
| 4612 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/document/dynamic/commands/index.js")); | |
| 4613 | + | |
| 4614 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 4615 | + | |
| 4616 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 4617 | + | |
| 4618 | +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); }; } | |
| 4619 | + | |
| 4620 | +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; } } | |
| 4621 | + | |
| 4622 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 4623 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 4624 | + | |
| 4625 | + var _super = _createSuper(Component); | |
| 4626 | + | |
| 4627 | + function Component() { | |
| 4628 | + (0, _classCallCheck2.default)(this, Component); | |
| 4629 | + return _super.apply(this, arguments); | |
| 4630 | + } | |
| 4631 | + | |
| 4632 | + (0, _createClass2.default)(Component, [{ | |
| 4633 | + key: "getNamespace", | |
| 4634 | + value: function getNamespace() { | |
| 4635 | + return 'document/dynamic'; | |
| 4636 | + } | |
| 4637 | + }, { | |
| 4638 | + key: "defaultCommands", | |
| 4639 | + value: function defaultCommands() { | |
| 4640 | + return this.importCommands(commands); | |
| 4641 | + } | |
| 4642 | + }]); | |
| 4643 | + return Component; | |
| 4644 | +}(_componentBase.default); | |
| 4645 | + | |
| 4646 | +exports["default"] = Component; | |
| 4647 | + | |
| 4648 | +/***/ }), | |
| 4649 | + | |
| 4650 | +/***/ "../assets/dev/js/editor/document/elements/commands-internal/index.js": | |
| 4651 | +/*!****************************************************************************!*\ | |
| 4652 | + !*** ../assets/dev/js/editor/document/elements/commands-internal/index.js ***! | |
| 4653 | + \****************************************************************************/ | |
| 4654 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4655 | + | |
| 4656 | +"use strict"; | |
| 4657 | + | |
| 4658 | + | |
| 4659 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4660 | + value: true | |
| 4661 | +})); | |
| 4662 | +Object.defineProperty(exports, "SetSettings", ({ | |
| 4663 | + enumerable: true, | |
| 4664 | + get: function get() { | |
| 4665 | + return _setSettings.SetSettings; | |
| 4666 | + } | |
| 4667 | +})); | |
| 4668 | + | |
| 4669 | +var _setSettings = __webpack_require__(/*! ./set-settings */ "../assets/dev/js/editor/document/elements/commands-internal/set-settings.js"); | |
| 4670 | + | |
| 4671 | +/***/ }), | |
| 4672 | + | |
| 4673 | +/***/ "../assets/dev/js/editor/document/elements/commands-internal/set-settings.js": | |
| 4674 | +/*!***********************************************************************************!*\ | |
| 4675 | + !*** ../assets/dev/js/editor/document/elements/commands-internal/set-settings.js ***! | |
| 4676 | + \***********************************************************************************/ | |
| 4677 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4678 | + | |
| 4679 | +"use strict"; | |
| 4680 | + | |
| 4681 | + | |
| 4682 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4683 | + | |
| 4684 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4685 | + value: true | |
| 4686 | +})); | |
| 4687 | +exports["default"] = exports.SetSettings = void 0; | |
| 4688 | + | |
| 4689 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4690 | + | |
| 4691 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4692 | + | |
| 4693 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4694 | + | |
| 4695 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4696 | + | |
| 4697 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4698 | + | |
| 4699 | +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js")); | |
| 4700 | + | |
| 4701 | +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); }; } | |
| 4702 | + | |
| 4703 | +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; } } | |
| 4704 | + | |
| 4705 | +var SetSettings = /*#__PURE__*/function (_CommandInternal) { | |
| 4706 | + (0, _inherits2.default)(SetSettings, _CommandInternal); | |
| 4707 | + | |
| 4708 | + var _super = _createSuper(SetSettings); | |
| 4709 | + | |
| 4710 | + function SetSettings() { | |
| 4711 | + (0, _classCallCheck2.default)(this, SetSettings); | |
| 4712 | + return _super.apply(this, arguments); | |
| 4713 | + } | |
| 4714 | + | |
| 4715 | + (0, _createClass2.default)(SetSettings, [{ | |
| 4716 | + key: "validateArgs", | |
| 4717 | + value: function validateArgs() { | |
| 221 | 4718 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 222 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 223 | - _superPropGet(CommandHistoryBase, "onAfterApply", this, 3)([args, result]); | |
| 224 | - if (this.isDataChanged()) { | |
| 4719 | + this.requireContainer(args); | |
| 4720 | + this.requireArgumentType('settings', 'object', args); | |
| 4721 | + | |
| 4722 | + if ('undefined' !== typeof args.render && 'undefined' !== typeof args.renderUI) { | |
| 4723 | + throw new Error('Args: `render` and `renderUI` cannot be applied together.'); | |
| 4724 | + } | |
| 4725 | + } | |
| 4726 | + }, { | |
| 4727 | + key: "apply", | |
| 4728 | + value: function apply() { | |
| 4729 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 4730 | + var _args$containers = args.containers, | |
| 4731 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 4732 | + settings = args.settings, | |
| 4733 | + _args$options = args.options, | |
| 4734 | + options = _args$options === void 0 ? {} : _args$options, | |
| 4735 | + external = options.external, | |
| 4736 | + _options$render = options.render, | |
| 4737 | + render = _options$render === void 0 ? true : _options$render, | |
| 4738 | + _options$renderUI = options.renderUI, | |
| 4739 | + renderUI = _options$renderUI === void 0 ? false : _options$renderUI; | |
| 4740 | + containers.forEach(function (container) { | |
| 4741 | + if (external) { | |
| 4742 | + container.settings.setExternalChange(settings); | |
| 4743 | + } else { | |
| 4744 | + container.settings.set(settings); | |
| 4745 | + } | |
| 4746 | + | |
| 4747 | + if (renderUI) { | |
| 4748 | + container.renderUI(); | |
| 4749 | + } else if (render) { | |
| 4750 | + container.render(); | |
| 4751 | + } | |
| 4752 | + }); | |
| 4753 | + } | |
| 4754 | + }]); | |
| 4755 | + return SetSettings; | |
| 4756 | +}(_commandInternalBase.default); | |
| 4757 | + | |
| 4758 | +exports.SetSettings = SetSettings; | |
| 4759 | +var _default = SetSettings; | |
| 4760 | +exports["default"] = _default; | |
| 4761 | + | |
| 4762 | +/***/ }), | |
| 4763 | + | |
| 4764 | +/***/ "../assets/dev/js/editor/document/elements/commands/copy-all.js": | |
| 4765 | +/*!**********************************************************************!*\ | |
| 4766 | + !*** ../assets/dev/js/editor/document/elements/commands/copy-all.js ***! | |
| 4767 | + \**********************************************************************/ | |
| 4768 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4769 | + | |
| 4770 | +"use strict"; | |
| 4771 | + | |
| 4772 | + | |
| 4773 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4774 | + | |
| 4775 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4776 | + value: true | |
| 4777 | +})); | |
| 4778 | +exports["default"] = exports.CopyAll = void 0; | |
| 4779 | + | |
| 4780 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4781 | + | |
| 4782 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4783 | + | |
| 4784 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4785 | + | |
| 4786 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4787 | + | |
| 4788 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4789 | + | |
| 4790 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 4791 | + | |
| 4792 | +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); }; } | |
| 4793 | + | |
| 4794 | +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; } } | |
| 4795 | + | |
| 4796 | +var CopyAll = /*#__PURE__*/function (_CommandBase) { | |
| 4797 | + (0, _inherits2.default)(CopyAll, _CommandBase); | |
| 4798 | + | |
| 4799 | + var _super = _createSuper(CopyAll); | |
| 4800 | + | |
| 4801 | + function CopyAll() { | |
| 4802 | + (0, _classCallCheck2.default)(this, CopyAll); | |
| 4803 | + return _super.apply(this, arguments); | |
| 4804 | + } | |
| 4805 | + | |
| 4806 | + (0, _createClass2.default)(CopyAll, [{ | |
| 4807 | + key: "apply", | |
| 4808 | + value: function apply() { | |
| 4809 | + $e.run('document/elements/copy', { | |
| 4810 | + containers: Object.values(elementor.getPreviewView().children._views).map(function (view) { | |
| 4811 | + return view.getContainer(); | |
| 4812 | + }) | |
| 4813 | + }); | |
| 4814 | + } | |
| 4815 | + }]); | |
| 4816 | + return CopyAll; | |
| 4817 | +}(_commandBase.default); | |
| 4818 | + | |
| 4819 | +exports.CopyAll = CopyAll; | |
| 4820 | +var _default = CopyAll; | |
| 4821 | +exports["default"] = _default; | |
| 4822 | + | |
| 4823 | +/***/ }), | |
| 4824 | + | |
| 4825 | +/***/ "../assets/dev/js/editor/document/elements/commands/copy.js": | |
| 4826 | +/*!******************************************************************!*\ | |
| 4827 | + !*** ../assets/dev/js/editor/document/elements/commands/copy.js ***! | |
| 4828 | + \******************************************************************/ | |
| 4829 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4830 | + | |
| 4831 | +"use strict"; | |
| 4832 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 4833 | + | |
| 4834 | + | |
| 4835 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4836 | + | |
| 4837 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4838 | + value: true | |
| 4839 | +})); | |
| 4840 | +exports["default"] = exports.Copy = void 0; | |
| 4841 | + | |
| 4842 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4843 | + | |
| 4844 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4845 | + | |
| 4846 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4847 | + | |
| 4848 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4849 | + | |
| 4850 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4851 | + | |
| 4852 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 4853 | + | |
| 4854 | +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); }; } | |
| 4855 | + | |
| 4856 | +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; } } | |
| 4857 | + | |
| 4858 | +var Copy = /*#__PURE__*/function (_CommandBase) { | |
| 4859 | + (0, _inherits2.default)(Copy, _CommandBase); | |
| 4860 | + | |
| 4861 | + var _super = _createSuper(Copy); | |
| 4862 | + | |
| 4863 | + function Copy() { | |
| 4864 | + (0, _classCallCheck2.default)(this, Copy); | |
| 4865 | + return _super.apply(this, arguments); | |
| 4866 | + } | |
| 4867 | + | |
| 4868 | + (0, _createClass2.default)(Copy, [{ | |
| 4869 | + key: "validateArgs", | |
| 4870 | + value: function validateArgs(args) { | |
| 4871 | + this.requireContainer(args); | |
| 4872 | + } | |
| 4873 | + }, { | |
| 4874 | + key: "apply", | |
| 4875 | + value: function apply(args) { | |
| 4876 | + var _args$storageKey = args.storageKey, | |
| 4877 | + storageKey = _args$storageKey === void 0 ? 'clipboard' : _args$storageKey, | |
| 4878 | + _args$containers = args.containers, | |
| 4879 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 4880 | + | |
| 4881 | + if (!elementor.selection.isSameType()) { | |
| 4882 | + elementor.notifications.showToast({ | |
| 4883 | + message: __('That didn’t work. Try copying one kind of element at a time.', 'elementor'), | |
| 4884 | + buttons: [{ | |
| 4885 | + name: 'got_it', | |
| 4886 | + text: __('Got it', 'elementor') | |
| 4887 | + }] | |
| 4888 | + }); | |
| 4889 | + return false; | |
| 4890 | + } | |
| 4891 | + | |
| 4892 | + var elements = elementor.getPreviewView().$el.find('.elementor-element'); | |
| 4893 | + elementorCommon.storage.set(storageKey, containers.sort(function (first, second) { | |
| 4894 | + return elements.index(first.view.el) - elements.index(second.view.el); | |
| 4895 | + }).map(function (container) { | |
| 4896 | + return container.model.toJSON({ | |
| 4897 | + copyHtmlCache: true | |
| 4898 | + }); | |
| 4899 | + })); | |
| 4900 | + } | |
| 4901 | + }]); | |
| 4902 | + return Copy; | |
| 4903 | +}(_commandBase.default); | |
| 4904 | + | |
| 4905 | +exports.Copy = Copy; | |
| 4906 | +var _default = Copy; | |
| 4907 | +exports["default"] = _default; | |
| 4908 | + | |
| 4909 | +/***/ }), | |
| 4910 | + | |
| 4911 | +/***/ "../assets/dev/js/editor/document/elements/commands/create.js": | |
| 4912 | +/*!********************************************************************!*\ | |
| 4913 | + !*** ../assets/dev/js/editor/document/elements/commands/create.js ***! | |
| 4914 | + \********************************************************************/ | |
| 4915 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4916 | + | |
| 4917 | +"use strict"; | |
| 4918 | + | |
| 4919 | + | |
| 4920 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4921 | + | |
| 4922 | +Object.defineProperty(exports, "__esModule", ({ | |
| 4923 | + value: true | |
| 4924 | +})); | |
| 4925 | +exports["default"] = exports.Create = void 0; | |
| 4926 | + | |
| 4927 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4928 | + | |
| 4929 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4930 | + | |
| 4931 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4932 | + | |
| 4933 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4934 | + | |
| 4935 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4936 | + | |
| 4937 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 4938 | + | |
| 4939 | +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); }; } | |
| 4940 | + | |
| 4941 | +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; } } | |
| 4942 | + | |
| 4943 | +var Create = /*#__PURE__*/function (_CommandHistory) { | |
| 4944 | + (0, _inherits2.default)(Create, _CommandHistory); | |
| 4945 | + | |
| 4946 | + var _super = _createSuper(Create); | |
| 4947 | + | |
| 4948 | + function Create() { | |
| 4949 | + (0, _classCallCheck2.default)(this, Create); | |
| 4950 | + return _super.apply(this, arguments); | |
| 4951 | + } | |
| 4952 | + | |
| 4953 | + (0, _createClass2.default)(Create, [{ | |
| 4954 | + key: "validateArgs", | |
| 4955 | + value: function validateArgs(args) { | |
| 4956 | + this.requireContainer(args); // Avoid Backbone model & etc. | |
| 4957 | + | |
| 4958 | + this.requireArgumentConstructor('model', Object, args); | |
| 4959 | + } | |
| 4960 | + }, { | |
| 4961 | + key: "getHistory", | |
| 4962 | + value: function getHistory(args) { | |
| 4963 | + var model = args.model, | |
| 4964 | + _args$containers = args.containers, | |
| 4965 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 4966 | + return { | |
| 4967 | + containers: containers, | |
| 4968 | + model: model, | |
| 4969 | + type: 'add', | |
| 4970 | + title: elementor.helpers.getModelLabel(model) | |
| 4971 | + }; | |
| 4972 | + } | |
| 4973 | + }, { | |
| 4974 | + key: "apply", | |
| 4975 | + value: function apply(args) { | |
| 4976 | + var _this = this; | |
| 4977 | + | |
| 4978 | + var model = args.model, | |
| 4979 | + _args$options = args.options, | |
| 4980 | + options = _args$options === void 0 ? {} : _args$options, | |
| 4981 | + _args$containers2 = args.containers, | |
| 4982 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 4983 | + var result = []; | |
| 4984 | + containers.forEach(function (container) { | |
| 4985 | + container = container.lookup(); | |
| 4986 | + var createdContainer = container.view.addElement(model, options).getContainer(); | |
| 4987 | + result.push(createdContainer); | |
| 4988 | + /** | |
| 4989 | + * Acknowledge history of each created item, because we cannot pass the elements when they do not exist | |
| 4990 | + * in getHistory(). | |
| 4991 | + */ | |
| 4992 | + | |
| 4993 | + if (_this.isHistoryActive()) { | |
| 4994 | + $e.internal('document/history/log-sub-item', { | |
| 4995 | + container: container, | |
| 4996 | + type: 'sub-add', | |
| 4997 | + restore: _this.constructor.restore, | |
| 4998 | + options: options, | |
| 4999 | + data: { | |
| 5000 | + containerToRestore: createdContainer, | |
| 5001 | + modelToRestore: createdContainer.model.toJSON() | |
| 5002 | + } | |
| 5003 | + }); | |
| 5004 | + } | |
| 5005 | + }); | |
| 5006 | + | |
| 5007 | + if (1 === result.length) { | |
| 5008 | + result = result[0]; | |
| 5009 | + } | |
| 5010 | + | |
| 5011 | + return result; | |
| 5012 | + } | |
| 5013 | + }, { | |
| 5014 | + key: "isDataChanged", | |
| 5015 | + value: function isDataChanged() { | |
| 5016 | + return true; | |
| 5017 | + } | |
| 5018 | + }], [{ | |
| 5019 | + key: "restore", | |
| 5020 | + value: function restore(historyItem, isRedo) { | |
| 5021 | + var data = historyItem.get('data'), | |
| 5022 | + container = historyItem.get('container'), | |
| 5023 | + options = historyItem.get('options') || {}; // No clone when restoring. e.g: duplicate will generate unique ids while restoring. | |
| 5024 | + | |
| 5025 | + if (options.clone) { | |
| 5026 | + options.clone = false; | |
| 5027 | + } | |
| 5028 | + | |
| 5029 | + if (isRedo) { | |
| 5030 | + $e.run('document/elements/create', { | |
| 5031 | + container: container, | |
| 5032 | + model: data.modelToRestore, | |
| 5033 | + options: options | |
| 5034 | + }); | |
| 5035 | + } else { | |
| 5036 | + $e.run('document/elements/delete', { | |
| 5037 | + container: data.containerToRestore | |
| 5038 | + }); | |
| 5039 | + } | |
| 5040 | + } | |
| 5041 | + }]); | |
| 5042 | + return Create; | |
| 5043 | +}(_commandHistory.default); | |
| 5044 | + | |
| 5045 | +exports.Create = Create; | |
| 5046 | +var _default = Create; | |
| 5047 | +exports["default"] = _default; | |
| 5048 | + | |
| 5049 | +/***/ }), | |
| 5050 | + | |
| 5051 | +/***/ "../assets/dev/js/editor/document/elements/commands/delete.js": | |
| 5052 | +/*!********************************************************************!*\ | |
| 5053 | + !*** ../assets/dev/js/editor/document/elements/commands/delete.js ***! | |
| 5054 | + \********************************************************************/ | |
| 5055 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5056 | + | |
| 5057 | +"use strict"; | |
| 5058 | + | |
| 5059 | + | |
| 5060 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5061 | + | |
| 5062 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5063 | + value: true | |
| 5064 | +})); | |
| 5065 | +exports["default"] = exports.Delete = void 0; | |
| 5066 | + | |
| 5067 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5068 | + | |
| 5069 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5070 | + | |
| 5071 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5072 | + | |
| 5073 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5074 | + | |
| 5075 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5076 | + | |
| 5077 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 5078 | + | |
| 5079 | +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); }; } | |
| 5080 | + | |
| 5081 | +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; } } | |
| 5082 | + | |
| 5083 | +var Delete = /*#__PURE__*/function (_CommandHistory) { | |
| 5084 | + (0, _inherits2.default)(Delete, _CommandHistory); | |
| 5085 | + | |
| 5086 | + var _super = _createSuper(Delete); | |
| 5087 | + | |
| 5088 | + function Delete() { | |
| 5089 | + (0, _classCallCheck2.default)(this, Delete); | |
| 5090 | + return _super.apply(this, arguments); | |
| 5091 | + } | |
| 5092 | + | |
| 5093 | + (0, _createClass2.default)(Delete, [{ | |
| 5094 | + key: "validateArgs", | |
| 5095 | + value: function validateArgs(args) { | |
| 5096 | + this.requireContainer(args); | |
| 5097 | + } | |
| 5098 | + }, { | |
| 5099 | + key: "getHistory", | |
| 5100 | + value: function getHistory(args) { | |
| 5101 | + var _args$containers = args.containers, | |
| 5102 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 5103 | + return { | |
| 5104 | + containers: containers, | |
| 5105 | + type: 'remove' | |
| 5106 | + }; | |
| 5107 | + } | |
| 5108 | + }, { | |
| 5109 | + key: "apply", | |
| 5110 | + value: function apply(args) { | |
| 5111 | + var _this = this; | |
| 5112 | + | |
| 5113 | + var _args$containers2 = args.containers, | |
| 5114 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 5115 | + containers.forEach(function (container) { | |
| 5116 | + container = container.lookup(); | |
| 5117 | + | |
| 5118 | + if (_this.isHistoryActive()) { | |
| 5119 | + $e.internal('document/history/log-sub-item', { | |
| 5120 | + container: container, | |
| 5121 | + type: 'sub-remove', | |
| 5122 | + restore: _this.constructor.restore, | |
| 5123 | + data: { | |
| 5124 | + model: container.model.toJSON(), | |
| 5125 | + parent: container.parent, | |
| 5126 | + at: container.view._index | |
| 5127 | + } | |
| 5128 | + }); | |
| 5129 | + } | |
| 5130 | + | |
| 5131 | + container.model.destroy(); | |
| 5132 | + container.panel.refresh(); | |
| 5133 | + }); | |
| 5134 | + | |
| 5135 | + if (1 === containers.length) { | |
| 5136 | + return containers[0]; | |
| 5137 | + } | |
| 5138 | + | |
| 5139 | + return containers; | |
| 5140 | + } | |
| 5141 | + }, { | |
| 5142 | + key: "isDataChanged", | |
| 5143 | + value: function isDataChanged() { | |
| 5144 | + return true; | |
| 5145 | + } | |
| 5146 | + }], [{ | |
| 5147 | + key: "restore", | |
| 5148 | + value: function restore(historyItem, isRedo) { | |
| 5149 | + var container = historyItem.get('container'), | |
| 5150 | + data = historyItem.get('data'); | |
| 5151 | + | |
| 5152 | + if (isRedo) { | |
| 5153 | + $e.run('document/elements/delete', { | |
| 5154 | + container: container | |
| 5155 | + }); | |
| 5156 | + } else { | |
| 5157 | + $e.run('document/elements/create', { | |
| 5158 | + container: data.parent, | |
| 5159 | + model: data.model, | |
| 5160 | + options: { | |
| 5161 | + at: data.at | |
| 5162 | + } | |
| 5163 | + }); | |
| 5164 | + } | |
| 5165 | + } | |
| 5166 | + }]); | |
| 5167 | + return Delete; | |
| 5168 | +}(_commandHistory.default); | |
| 5169 | + | |
| 5170 | +exports.Delete = Delete; | |
| 5171 | +var _default = Delete; | |
| 5172 | +exports["default"] = _default; | |
| 5173 | + | |
| 5174 | +/***/ }), | |
| 5175 | + | |
| 5176 | +/***/ "../assets/dev/js/editor/document/elements/commands/deselect-all.js": | |
| 5177 | +/*!**************************************************************************!*\ | |
| 5178 | + !*** ../assets/dev/js/editor/document/elements/commands/deselect-all.js ***! | |
| 5179 | + \**************************************************************************/ | |
| 5180 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5181 | + | |
| 5182 | +"use strict"; | |
| 5183 | + | |
| 5184 | + | |
| 5185 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5186 | + | |
| 5187 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5188 | + value: true | |
| 5189 | +})); | |
| 5190 | +exports["default"] = exports.DeselectAll = void 0; | |
| 5191 | + | |
| 5192 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5193 | + | |
| 5194 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5195 | + | |
| 5196 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5197 | + | |
| 5198 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5199 | + | |
| 5200 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5201 | + | |
| 5202 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5203 | + | |
| 5204 | +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); }; } | |
| 5205 | + | |
| 5206 | +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; } } | |
| 5207 | + | |
| 5208 | +var DeselectAll = /*#__PURE__*/function (_CommandBase) { | |
| 5209 | + (0, _inherits2.default)(DeselectAll, _CommandBase); | |
| 5210 | + | |
| 5211 | + var _super = _createSuper(DeselectAll); | |
| 5212 | + | |
| 5213 | + function DeselectAll() { | |
| 5214 | + (0, _classCallCheck2.default)(this, DeselectAll); | |
| 5215 | + return _super.apply(this, arguments); | |
| 5216 | + } | |
| 5217 | + | |
| 5218 | + (0, _createClass2.default)(DeselectAll, [{ | |
| 5219 | + key: "apply", | |
| 5220 | + value: function apply() { | |
| 5221 | + elementor.selection.remove([], true); | |
| 5222 | + } | |
| 5223 | + }]); | |
| 5224 | + return DeselectAll; | |
| 5225 | +}(_commandBase.default); | |
| 5226 | + | |
| 5227 | +exports.DeselectAll = DeselectAll; | |
| 5228 | +var _default = DeselectAll; | |
| 5229 | +exports["default"] = _default; | |
| 5230 | + | |
| 5231 | +/***/ }), | |
| 5232 | + | |
| 5233 | +/***/ "../assets/dev/js/editor/document/elements/commands/deselect.js": | |
| 5234 | +/*!**********************************************************************!*\ | |
| 5235 | + !*** ../assets/dev/js/editor/document/elements/commands/deselect.js ***! | |
| 5236 | + \**********************************************************************/ | |
| 5237 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5238 | + | |
| 5239 | +"use strict"; | |
| 5240 | + | |
| 5241 | + | |
| 5242 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5243 | + | |
| 5244 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5245 | + value: true | |
| 5246 | +})); | |
| 5247 | +exports["default"] = exports.Deselect = void 0; | |
| 5248 | + | |
| 5249 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5250 | + | |
| 5251 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5252 | + | |
| 5253 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5254 | + | |
| 5255 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5256 | + | |
| 5257 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5258 | + | |
| 5259 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5260 | + | |
| 5261 | +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); }; } | |
| 5262 | + | |
| 5263 | +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; } } | |
| 5264 | + | |
| 5265 | +var Deselect = /*#__PURE__*/function (_CommandBase) { | |
| 5266 | + (0, _inherits2.default)(Deselect, _CommandBase); | |
| 5267 | + | |
| 5268 | + var _super = _createSuper(Deselect); | |
| 5269 | + | |
| 5270 | + function Deselect() { | |
| 5271 | + (0, _classCallCheck2.default)(this, Deselect); | |
| 5272 | + return _super.apply(this, arguments); | |
| 5273 | + } | |
| 5274 | + | |
| 5275 | + (0, _createClass2.default)(Deselect, [{ | |
| 5276 | + key: "validateArgs", | |
| 5277 | + value: function validateArgs() { | |
| 5278 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5279 | + | |
| 5280 | + if (!args.all) { | |
| 5281 | + this.requireContainer(args); | |
| 5282 | + } | |
| 5283 | + } | |
| 5284 | + }, { | |
| 5285 | + key: "apply", | |
| 5286 | + value: function apply(args) { | |
| 5287 | + var _args$containers = args.containers, | |
| 5288 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 5289 | + _args$all = args.all, | |
| 5290 | + all = _args$all === void 0 ? false : _args$all; | |
| 5291 | + elementor.selection.remove(containers, all); | |
| 5292 | + } | |
| 5293 | + }]); | |
| 5294 | + return Deselect; | |
| 5295 | +}(_commandBase.default); | |
| 5296 | + | |
| 5297 | +exports.Deselect = Deselect; | |
| 5298 | +var _default = Deselect; | |
| 5299 | +exports["default"] = _default; | |
| 5300 | + | |
| 5301 | +/***/ }), | |
| 5302 | + | |
| 5303 | +/***/ "../assets/dev/js/editor/document/elements/commands/duplicate.js": | |
| 5304 | +/*!***********************************************************************!*\ | |
| 5305 | + !*** ../assets/dev/js/editor/document/elements/commands/duplicate.js ***! | |
| 5306 | + \***********************************************************************/ | |
| 5307 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5308 | + | |
| 5309 | +"use strict"; | |
| 5310 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 5311 | + | |
| 5312 | + | |
| 5313 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5314 | + | |
| 5315 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5316 | + value: true | |
| 5317 | +})); | |
| 5318 | +exports["default"] = exports.Duplicate = void 0; | |
| 5319 | + | |
| 5320 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5321 | + | |
| 5322 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5323 | + | |
| 5324 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5325 | + | |
| 5326 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5327 | + | |
| 5328 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5329 | + | |
| 5330 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 5331 | + | |
| 5332 | +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); }; } | |
| 5333 | + | |
| 5334 | +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; } } | |
| 5335 | + | |
| 5336 | +var Duplicate = /*#__PURE__*/function (_CommandHistory) { | |
| 5337 | + (0, _inherits2.default)(Duplicate, _CommandHistory); | |
| 5338 | + | |
| 5339 | + var _super = _createSuper(Duplicate); | |
| 5340 | + | |
| 5341 | + function Duplicate() { | |
| 5342 | + (0, _classCallCheck2.default)(this, Duplicate); | |
| 5343 | + return _super.apply(this, arguments); | |
| 5344 | + } | |
| 5345 | + | |
| 5346 | + (0, _createClass2.default)(Duplicate, [{ | |
| 5347 | + key: "validateArgs", | |
| 5348 | + value: function validateArgs(args) { | |
| 5349 | + this.requireContainer(args); | |
| 5350 | + } | |
| 5351 | + }, { | |
| 5352 | + key: "getHistory", | |
| 5353 | + value: function getHistory(args) { | |
| 5354 | + var _args$containers = args.containers, | |
| 5355 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 5356 | + return { | |
| 5357 | + containers: containers, | |
| 5358 | + type: 'duplicate' | |
| 5359 | + }; | |
| 5360 | + } | |
| 5361 | + }, { | |
| 5362 | + key: "apply", | |
| 5363 | + value: function apply(args) { | |
| 5364 | + var _args$containers2 = args.containers, | |
| 5365 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 5366 | + result = []; | |
| 5367 | + var at = containers[containers.length - 1].view._index; | |
| 5368 | + | |
| 5369 | + if (!elementor.selection.isSameType()) { | |
| 5370 | + elementor.notifications.showToast({ | |
| 5371 | + message: __('That didn’t work. Try duplicating one kind of element at a time.', 'elementor'), | |
| 5372 | + buttons: [{ | |
| 5373 | + name: 'got_it', | |
| 5374 | + text: __('Got it', 'elementor') | |
| 5375 | + }] | |
| 5376 | + }); | |
| 5377 | + return false; | |
| 5378 | + } | |
| 5379 | + | |
| 5380 | + containers.forEach(function (container) { | |
| 5381 | + var parent = container.parent; | |
| 5382 | + result.push($e.run('document/elements/create', { | |
| 5383 | + container: parent, | |
| 5384 | + model: container.model.toJSON(), | |
| 5385 | + options: { | |
| 5386 | + at: ++at, | |
| 5387 | + clone: true | |
| 5388 | + } | |
| 5389 | + })); | |
| 5390 | + }); | |
| 5391 | + | |
| 5392 | + if (1 === result.length) { | |
| 5393 | + return result[0]; | |
| 5394 | + } | |
| 5395 | + | |
| 5396 | + return result; | |
| 5397 | + } | |
| 5398 | + }]); | |
| 5399 | + return Duplicate; | |
| 5400 | +}(_commandHistory.default); | |
| 5401 | + | |
| 5402 | +exports.Duplicate = Duplicate; | |
| 5403 | +var _default = Duplicate; | |
| 5404 | +exports["default"] = _default; | |
| 5405 | + | |
| 5406 | +/***/ }), | |
| 5407 | + | |
| 5408 | +/***/ "../assets/dev/js/editor/document/elements/commands/empty.js": | |
| 5409 | +/*!*******************************************************************!*\ | |
| 5410 | + !*** ../assets/dev/js/editor/document/elements/commands/empty.js ***! | |
| 5411 | + \*******************************************************************/ | |
| 5412 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5413 | + | |
| 5414 | +"use strict"; | |
| 5415 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 5416 | + | |
| 5417 | + | |
| 5418 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5419 | + | |
| 5420 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5421 | + value: true | |
| 5422 | +})); | |
| 5423 | +exports["default"] = exports.Empty = void 0; | |
| 5424 | + | |
| 5425 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5426 | + | |
| 5427 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5428 | + | |
| 5429 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5430 | + | |
| 5431 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5432 | + | |
| 5433 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5434 | + | |
| 5435 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 5436 | + | |
| 5437 | +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); }; } | |
| 5438 | + | |
| 5439 | +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; } } | |
| 5440 | + | |
| 5441 | +var Empty = /*#__PURE__*/function (_CommandHistory) { | |
| 5442 | + (0, _inherits2.default)(Empty, _CommandHistory); | |
| 5443 | + | |
| 5444 | + var _super = _createSuper(Empty); | |
| 5445 | + | |
| 5446 | + function Empty() { | |
| 5447 | + (0, _classCallCheck2.default)(this, Empty); | |
| 5448 | + return _super.apply(this, arguments); | |
| 5449 | + } | |
| 5450 | + | |
| 5451 | + (0, _createClass2.default)(Empty, [{ | |
| 5452 | + key: "getHistory", | |
| 5453 | + value: function getHistory(args) { | |
| 5454 | + if (args.force) { | |
| 5455 | + return { | |
| 5456 | + type: 'remove', | |
| 5457 | + title: __('All Content', 'elementor'), | |
| 5458 | + data: elementor.elements ? elementor.elements.toJSON() : null, | |
| 5459 | + restore: this.constructor.restore | |
| 5460 | + }; | |
| 5461 | + } | |
| 5462 | + | |
| 5463 | + return false; | |
| 5464 | + } | |
| 5465 | + }, { | |
| 5466 | + key: "apply", | |
| 5467 | + value: function apply(args) { | |
| 5468 | + if (args.force && elementor.elements) { | |
| 5469 | + elementor.elements.reset(); | |
| 5470 | + elementor.getPreviewContainer().panel.closeEditor(); | |
| 5471 | + return; | |
| 5472 | + } | |
| 5473 | + | |
| 5474 | + elementor.getClearPageDialog().show(); | |
| 5475 | + } | |
| 5476 | + }, { | |
| 5477 | + key: "isDataChanged", | |
| 5478 | + value: function isDataChanged() { | |
| 5479 | + if (this.args.force) { | |
| 5480 | + return true; | |
| 5481 | + } | |
| 5482 | + } | |
| 5483 | + }], [{ | |
| 5484 | + key: "restore", | |
| 5485 | + value: function restore(historyItem, isRedo) { | |
| 5486 | + if (isRedo) { | |
| 5487 | + $e.run('document/elements/empty', { | |
| 5488 | + force: true | |
| 5489 | + }); | |
| 5490 | + } else { | |
| 5491 | + var data = historyItem.get('data'); | |
| 5492 | + | |
| 5493 | + if (data) { | |
| 5494 | + elementor.getPreviewView().addChildModel(data); | |
| 5495 | + } | |
| 5496 | + | |
| 225 | 5497 | $e.internal('document/save/set-is-modified', { |
| 226 | 5498 | status: true |
| 227 | 5499 | }); |
| 228 | 5500 | } |
| 229 | 5501 | } |
| 5502 | + }]); | |
| 5503 | + return Empty; | |
| 5504 | +}(_commandHistory.default); | |
| 5505 | + | |
| 5506 | +exports.Empty = Empty; | |
| 5507 | +var _default = Empty; | |
| 5508 | +exports["default"] = _default; | |
| 5509 | + | |
| 5510 | +/***/ }), | |
| 5511 | + | |
| 5512 | +/***/ "../assets/dev/js/editor/document/elements/commands/import.js": | |
| 5513 | +/*!********************************************************************!*\ | |
| 5514 | + !*** ../assets/dev/js/editor/document/elements/commands/import.js ***! | |
| 5515 | + \********************************************************************/ | |
| 5516 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5517 | + | |
| 5518 | +"use strict"; | |
| 5519 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 5520 | + | |
| 5521 | + | |
| 5522 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5523 | + | |
| 5524 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5525 | + value: true | |
| 5526 | +})); | |
| 5527 | +exports["default"] = exports.Import = void 0; | |
| 5528 | + | |
| 5529 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5530 | + | |
| 5531 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5532 | + | |
| 5533 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5534 | + | |
| 5535 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5536 | + | |
| 5537 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5538 | + | |
| 5539 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 5540 | + | |
| 5541 | +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); }; } | |
| 5542 | + | |
| 5543 | +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; } } | |
| 5544 | + | |
| 5545 | +var Import = /*#__PURE__*/function (_CommandHistory) { | |
| 5546 | + (0, _inherits2.default)(Import, _CommandHistory); | |
| 5547 | + | |
| 5548 | + var _super = _createSuper(Import); | |
| 5549 | + | |
| 5550 | + function Import() { | |
| 5551 | + (0, _classCallCheck2.default)(this, Import); | |
| 5552 | + return _super.apply(this, arguments); | |
| 5553 | + } | |
| 5554 | + | |
| 5555 | + (0, _createClass2.default)(Import, [{ | |
| 5556 | + key: "validateArgs", | |
| 5557 | + value: function validateArgs(args) { | |
| 5558 | + this.requireArgumentInstance('model', Backbone.Model, args); | |
| 5559 | + this.requireArgumentConstructor('data', Object, args); | |
| 5560 | + } | |
| 230 | 5561 | }, { |
| 231 | - key: "onCatchApply", | |
| 232 | - value: function onCatchApply(e) { | |
| 233 | - // Rollback history on failure. | |
| 234 | - if (e instanceof $e.modules.HookBreak && this.historyId) { | |
| 235 | - $e.internal('document/history/delete-log', { | |
| 236 | - id: this.historyId | |
| 5562 | + key: "getHistory", | |
| 5563 | + value: function getHistory(args) { | |
| 5564 | + var model = args.model; | |
| 5565 | + return { | |
| 5566 | + type: 'add', | |
| 5567 | + title: __('Template', 'elementor'), | |
| 5568 | + subTitle: model.get('title') | |
| 5569 | + }; | |
| 5570 | + } | |
| 5571 | + }, { | |
| 5572 | + key: "apply", | |
| 5573 | + value: function apply(args) { | |
| 5574 | + var data = args.data, | |
| 5575 | + _args$options = args.options, | |
| 5576 | + options = _args$options === void 0 ? args.options || {} : _args$options, | |
| 5577 | + previewContainer = elementor.getPreviewContainer(), | |
| 5578 | + result = []; | |
| 5579 | + var at = isNaN(options.at) ? previewContainer.view.collection.length : options.at; // Each `data.content`. | |
| 5580 | + | |
| 5581 | + Object.values(data.content).forEach(function (model) { | |
| 5582 | + result.push($e.run('document/elements/create', { | |
| 5583 | + container: elementor.getPreviewContainer(), | |
| 5584 | + model: model, | |
| 5585 | + options: Object.assign(options, { | |
| 5586 | + at: at | |
| 5587 | + }) | |
| 5588 | + })); | |
| 5589 | + at++; | |
| 5590 | + }); | |
| 5591 | + | |
| 5592 | + if (options.withPageSettings) { | |
| 5593 | + $e.run('document/elements/settings', { | |
| 5594 | + container: elementor.settings.page.getEditedView().getContainer(), | |
| 5595 | + settings: data.page_settings, | |
| 5596 | + options: { | |
| 5597 | + external: true | |
| 5598 | + } | |
| 237 | 5599 | }); |
| 238 | 5600 | } |
| 239 | - _superPropGet(CommandHistoryBase, "onCatchApply", this, 3)([e]); | |
| 5601 | + | |
| 5602 | + return result; | |
| 240 | 5603 | } |
| 5604 | + }]); | |
| 5605 | + return Import; | |
| 5606 | +}(_commandHistory.default); | |
| 5607 | + | |
| 5608 | +exports.Import = Import; | |
| 5609 | +var _default = Import; | |
| 5610 | +exports["default"] = _default; | |
| 5611 | + | |
| 5612 | +/***/ }), | |
| 5613 | + | |
| 5614 | +/***/ "../assets/dev/js/editor/document/elements/commands/index.js": | |
| 5615 | +/*!*******************************************************************!*\ | |
| 5616 | + !*** ../assets/dev/js/editor/document/elements/commands/index.js ***! | |
| 5617 | + \*******************************************************************/ | |
| 5618 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5619 | + | |
| 5620 | +"use strict"; | |
| 5621 | + | |
| 5622 | + | |
| 5623 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5624 | + value: true | |
| 5625 | +})); | |
| 5626 | +Object.defineProperty(exports, "Copy", ({ | |
| 5627 | + enumerable: true, | |
| 5628 | + get: function get() { | |
| 5629 | + return _copy.Copy; | |
| 5630 | + } | |
| 5631 | +})); | |
| 5632 | +Object.defineProperty(exports, "CopyAll", ({ | |
| 5633 | + enumerable: true, | |
| 5634 | + get: function get() { | |
| 5635 | + return _copyAll.CopyAll; | |
| 5636 | + } | |
| 5637 | +})); | |
| 5638 | +Object.defineProperty(exports, "Create", ({ | |
| 5639 | + enumerable: true, | |
| 5640 | + get: function get() { | |
| 5641 | + return _create.Create; | |
| 5642 | + } | |
| 5643 | +})); | |
| 5644 | +Object.defineProperty(exports, "Delete", ({ | |
| 5645 | + enumerable: true, | |
| 5646 | + get: function get() { | |
| 5647 | + return _delete.Delete; | |
| 5648 | + } | |
| 5649 | +})); | |
| 5650 | +Object.defineProperty(exports, "Deselect", ({ | |
| 5651 | + enumerable: true, | |
| 5652 | + get: function get() { | |
| 5653 | + return _deselect.Deselect; | |
| 5654 | + } | |
| 5655 | +})); | |
| 5656 | +Object.defineProperty(exports, "DeselectAll", ({ | |
| 5657 | + enumerable: true, | |
| 5658 | + get: function get() { | |
| 5659 | + return _deselectAll.DeselectAll; | |
| 5660 | + } | |
| 5661 | +})); | |
| 5662 | +Object.defineProperty(exports, "Duplicate", ({ | |
| 5663 | + enumerable: true, | |
| 5664 | + get: function get() { | |
| 5665 | + return _duplicate.Duplicate; | |
| 5666 | + } | |
| 5667 | +})); | |
| 5668 | +Object.defineProperty(exports, "Empty", ({ | |
| 5669 | + enumerable: true, | |
| 5670 | + get: function get() { | |
| 5671 | + return _empty.Empty; | |
| 5672 | + } | |
| 5673 | +})); | |
| 5674 | +Object.defineProperty(exports, "Import", ({ | |
| 5675 | + enumerable: true, | |
| 5676 | + get: function get() { | |
| 5677 | + return _import.Import; | |
| 5678 | + } | |
| 5679 | +})); | |
| 5680 | +Object.defineProperty(exports, "Move", ({ | |
| 5681 | + enumerable: true, | |
| 5682 | + get: function get() { | |
| 5683 | + return _move.Move; | |
| 5684 | + } | |
| 5685 | +})); | |
| 5686 | +Object.defineProperty(exports, "Paste", ({ | |
| 5687 | + enumerable: true, | |
| 5688 | + get: function get() { | |
| 5689 | + return _paste.Paste; | |
| 5690 | + } | |
| 5691 | +})); | |
| 5692 | +Object.defineProperty(exports, "PasteStyle", ({ | |
| 5693 | + enumerable: true, | |
| 5694 | + get: function get() { | |
| 5695 | + return _pasteStyle.PasteStyle; | |
| 5696 | + } | |
| 5697 | +})); | |
| 5698 | +Object.defineProperty(exports, "ResetSettings", ({ | |
| 5699 | + enumerable: true, | |
| 5700 | + get: function get() { | |
| 5701 | + return _resetSettings.ResetSettings; | |
| 5702 | + } | |
| 5703 | +})); | |
| 5704 | +Object.defineProperty(exports, "ResetStyle", ({ | |
| 5705 | + enumerable: true, | |
| 5706 | + get: function get() { | |
| 5707 | + return _resetStyle.ResetStyle; | |
| 5708 | + } | |
| 5709 | +})); | |
| 5710 | +Object.defineProperty(exports, "Select", ({ | |
| 5711 | + enumerable: true, | |
| 5712 | + get: function get() { | |
| 5713 | + return _select.Select; | |
| 5714 | + } | |
| 5715 | +})); | |
| 5716 | +Object.defineProperty(exports, "SelectAll", ({ | |
| 5717 | + enumerable: true, | |
| 5718 | + get: function get() { | |
| 5719 | + return _selectAll.SelectAll; | |
| 5720 | + } | |
| 5721 | +})); | |
| 5722 | +Object.defineProperty(exports, "Settings", ({ | |
| 5723 | + enumerable: true, | |
| 5724 | + get: function get() { | |
| 5725 | + return _settings.Settings; | |
| 5726 | + } | |
| 5727 | +})); | |
| 5728 | +Object.defineProperty(exports, "ToggleSelection", ({ | |
| 5729 | + enumerable: true, | |
| 5730 | + get: function get() { | |
| 5731 | + return _toggleSelection.ToggleSelection; | |
| 5732 | + } | |
| 5733 | +})); | |
| 5734 | + | |
| 5735 | +var _copy = __webpack_require__(/*! ./copy */ "../assets/dev/js/editor/document/elements/commands/copy.js"); | |
| 5736 | + | |
| 5737 | +var _copyAll = __webpack_require__(/*! ./copy-all */ "../assets/dev/js/editor/document/elements/commands/copy-all.js"); | |
| 5738 | + | |
| 5739 | +var _create = __webpack_require__(/*! ./create */ "../assets/dev/js/editor/document/elements/commands/create.js"); | |
| 5740 | + | |
| 5741 | +var _delete = __webpack_require__(/*! ./delete */ "../assets/dev/js/editor/document/elements/commands/delete.js"); | |
| 5742 | + | |
| 5743 | +var _deselect = __webpack_require__(/*! ./deselect */ "../assets/dev/js/editor/document/elements/commands/deselect.js"); | |
| 5744 | + | |
| 5745 | +var _deselectAll = __webpack_require__(/*! ./deselect-all */ "../assets/dev/js/editor/document/elements/commands/deselect-all.js"); | |
| 5746 | + | |
| 5747 | +var _duplicate = __webpack_require__(/*! ./duplicate */ "../assets/dev/js/editor/document/elements/commands/duplicate.js"); | |
| 5748 | + | |
| 5749 | +var _empty = __webpack_require__(/*! ./empty */ "../assets/dev/js/editor/document/elements/commands/empty.js"); | |
| 5750 | + | |
| 5751 | +var _import = __webpack_require__(/*! ./import */ "../assets/dev/js/editor/document/elements/commands/import.js"); | |
| 5752 | + | |
| 5753 | +var _paste = __webpack_require__(/*! ./paste */ "../assets/dev/js/editor/document/elements/commands/paste.js"); | |
| 5754 | + | |
| 5755 | +var _move = __webpack_require__(/*! ./move */ "../assets/dev/js/editor/document/elements/commands/move.js"); | |
| 5756 | + | |
| 5757 | +var _pasteStyle = __webpack_require__(/*! ./paste-style */ "../assets/dev/js/editor/document/elements/commands/paste-style.js"); | |
| 5758 | + | |
| 5759 | +var _resetSettings = __webpack_require__(/*! ./reset-settings */ "../assets/dev/js/editor/document/elements/commands/reset-settings.js"); | |
| 5760 | + | |
| 5761 | +var _resetStyle = __webpack_require__(/*! ./reset-style */ "../assets/dev/js/editor/document/elements/commands/reset-style.js"); | |
| 5762 | + | |
| 5763 | +var _select = __webpack_require__(/*! ./select */ "../assets/dev/js/editor/document/elements/commands/select.js"); | |
| 5764 | + | |
| 5765 | +var _selectAll = __webpack_require__(/*! ./select-all */ "../assets/dev/js/editor/document/elements/commands/select-all.js"); | |
| 5766 | + | |
| 5767 | +var _settings = __webpack_require__(/*! ./settings */ "../assets/dev/js/editor/document/elements/commands/settings.js"); | |
| 5768 | + | |
| 5769 | +var _toggleSelection = __webpack_require__(/*! ./toggle-selection */ "../assets/dev/js/editor/document/elements/commands/toggle-selection.js"); | |
| 5770 | + | |
| 5771 | +/***/ }), | |
| 5772 | + | |
| 5773 | +/***/ "../assets/dev/js/editor/document/elements/commands/move.js": | |
| 5774 | +/*!******************************************************************!*\ | |
| 5775 | + !*** ../assets/dev/js/editor/document/elements/commands/move.js ***! | |
| 5776 | + \******************************************************************/ | |
| 5777 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5778 | + | |
| 5779 | +"use strict"; | |
| 5780 | + | |
| 5781 | + | |
| 5782 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5783 | + | |
| 5784 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5785 | + value: true | |
| 5786 | +})); | |
| 5787 | +exports["default"] = exports.Move = void 0; | |
| 5788 | + | |
| 5789 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5790 | + | |
| 5791 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5792 | + | |
| 5793 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5794 | + | |
| 5795 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5796 | + | |
| 5797 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5798 | + | |
| 5799 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 5800 | + | |
| 5801 | +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); }; } | |
| 5802 | + | |
| 5803 | +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; } } | |
| 5804 | + | |
| 5805 | +var Move = /*#__PURE__*/function (_CommandHistory) { | |
| 5806 | + (0, _inherits2.default)(Move, _CommandHistory); | |
| 5807 | + | |
| 5808 | + var _super = _createSuper(Move); | |
| 5809 | + | |
| 5810 | + function Move() { | |
| 5811 | + (0, _classCallCheck2.default)(this, Move); | |
| 5812 | + return _super.apply(this, arguments); | |
| 5813 | + } | |
| 5814 | + | |
| 5815 | + (0, _createClass2.default)(Move, [{ | |
| 5816 | + key: "validateArgs", | |
| 5817 | + value: function validateArgs(args) { | |
| 5818 | + this.requireContainer(args); | |
| 5819 | + this.requireArgumentInstance('target', elementorModules.editor.Container, args); | |
| 5820 | + } | |
| 241 | 5821 | }, { |
| 5822 | + key: "getHistory", | |
| 5823 | + value: function getHistory(args) { | |
| 5824 | + var _args$containers = args.containers, | |
| 5825 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 5826 | + return { | |
| 5827 | + containers: containers, | |
| 5828 | + type: 'move' | |
| 5829 | + }; | |
| 5830 | + } | |
| 5831 | + }, { | |
| 5832 | + key: "apply", | |
| 5833 | + value: function apply(args) { | |
| 5834 | + var target = args.target, | |
| 5835 | + _args$options = args.options, | |
| 5836 | + options = _args$options === void 0 ? {} : _args$options, | |
| 5837 | + _args$containers2 = args.containers, | |
| 5838 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 5839 | + reCreate = []; | |
| 5840 | + containers.forEach(function (container) { | |
| 5841 | + reCreate.push(container.model.toJSON()); | |
| 5842 | + $e.run('document/elements/delete', { | |
| 5843 | + container: container | |
| 5844 | + }); | |
| 5845 | + }); | |
| 5846 | + var count = 0; | |
| 5847 | + reCreate.forEach(function (model) { | |
| 5848 | + // If multiple fix position. | |
| 5849 | + if (options.hasOwnProperty('at') && reCreate.length > 1) { | |
| 5850 | + if (0 !== count) { | |
| 5851 | + options.at += count; | |
| 5852 | + } | |
| 5853 | + } | |
| 5854 | + | |
| 5855 | + $e.run('document/elements/create', { | |
| 5856 | + container: target, | |
| 5857 | + model: model, | |
| 5858 | + options: options | |
| 5859 | + }); | |
| 5860 | + count++; | |
| 5861 | + }); | |
| 5862 | + } | |
| 5863 | + }]); | |
| 5864 | + return Move; | |
| 5865 | +}(_commandHistory.default); | |
| 5866 | + | |
| 5867 | +exports.Move = Move; | |
| 5868 | +var _default = Move; | |
| 5869 | +exports["default"] = _default; | |
| 5870 | + | |
| 5871 | +/***/ }), | |
| 5872 | + | |
| 5873 | +/***/ "../assets/dev/js/editor/document/elements/commands/paste-style.js": | |
| 5874 | +/*!*************************************************************************!*\ | |
| 5875 | + !*** ../assets/dev/js/editor/document/elements/commands/paste-style.js ***! | |
| 5876 | + \*************************************************************************/ | |
| 5877 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5878 | + | |
| 5879 | +"use strict"; | |
| 5880 | + | |
| 5881 | + | |
| 5882 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5883 | + | |
| 5884 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5885 | + value: true | |
| 5886 | +})); | |
| 5887 | +exports["default"] = exports.PasteStyle = void 0; | |
| 5888 | + | |
| 5889 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 5890 | + | |
| 5891 | +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 5892 | + | |
| 5893 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5894 | + | |
| 5895 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5896 | + | |
| 5897 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5898 | + | |
| 5899 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5900 | + | |
| 5901 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5902 | + | |
| 5903 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 5904 | + | |
| 5905 | +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); }; } | |
| 5906 | + | |
| 5907 | +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; } } | |
| 5908 | + | |
| 5909 | +/** | |
| 5910 | + * @typedef {import('../../../container/container')} Container | |
| 5911 | + */ | |
| 5912 | +var PasteStyle = /*#__PURE__*/function (_CommandHistory) { | |
| 5913 | + (0, _inherits2.default)(PasteStyle, _CommandHistory); | |
| 5914 | + | |
| 5915 | + var _super = _createSuper(PasteStyle); | |
| 5916 | + | |
| 5917 | + function PasteStyle() { | |
| 5918 | + (0, _classCallCheck2.default)(this, PasteStyle); | |
| 5919 | + return _super.apply(this, arguments); | |
| 5920 | + } | |
| 5921 | + | |
| 5922 | + (0, _createClass2.default)(PasteStyle, [{ | |
| 5923 | + key: "validateArgs", | |
| 5924 | + value: function validateArgs(args) { | |
| 5925 | + this.requireContainer(args); // Validate if storage have data. | |
| 5926 | + | |
| 5927 | + var _args$storageKey = args.storageKey, | |
| 5928 | + storageKey = _args$storageKey === void 0 ? 'clipboard' : _args$storageKey, | |
| 5929 | + storageData = elementorCommon.storage.get(storageKey); | |
| 5930 | + this.requireArgumentType('storageData', 'object', { | |
| 5931 | + storageData: storageData | |
| 5932 | + }); | |
| 5933 | + } | |
| 5934 | + }, { | |
| 5935 | + key: "validateControls", | |
| 5936 | + value: function validateControls(source, target) { | |
| 5937 | + var result = true; // Cannot use `_.isEmpty()` does not pass paste style test. | |
| 5938 | + | |
| 5939 | + if (null === source || null === target || undefined === source || undefined === target || 'object' === (0, _typeof2.default)(source) ^ 'object' === (0, _typeof2.default)(target)) { | |
| 5940 | + result = false; | |
| 5941 | + } | |
| 5942 | + | |
| 5943 | + return result; | |
| 5944 | + } | |
| 5945 | + }, { | |
| 5946 | + key: "getHistory", | |
| 5947 | + value: function getHistory(args) { | |
| 5948 | + var _args$containers = args.containers, | |
| 5949 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 5950 | + return { | |
| 5951 | + containers: containers, | |
| 5952 | + type: 'paste_style' | |
| 5953 | + }; | |
| 5954 | + } | |
| 5955 | + }, { | |
| 5956 | + key: "apply", | |
| 5957 | + value: function apply(args) { | |
| 5958 | + var _args$containers2 = args.containers, | |
| 5959 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 5960 | + _args$storageKey2 = args.storageKey, | |
| 5961 | + storageKey = _args$storageKey2 === void 0 ? 'clipboard' : _args$storageKey2, | |
| 5962 | + storageData = elementorCommon.storage.get(storageKey); | |
| 5963 | + this.applyPasteStyleData(containers, storageData); | |
| 5964 | + } | |
| 5965 | + }, { | |
| 5966 | + key: "applyPasteStyleData", | |
| 5967 | + value: function applyPasteStyleData(containers, data) { | |
| 5968 | + var _this = this; | |
| 5969 | + | |
| 5970 | + containers.forEach(function (targetContainer) { | |
| 5971 | + var targetSettings = targetContainer.settings, | |
| 5972 | + targetSettingsAttributes = targetSettings.attributes, | |
| 5973 | + targetControls = targetSettings.controls, | |
| 5974 | + diffSettings = {}, | |
| 5975 | + addExtraControls = function addExtraControls(sourceSettings, extraType) { | |
| 5976 | + if (sourceSettings[extraType]) { | |
| 5977 | + Object.entries(sourceSettings[extraType]).forEach(function (_ref) { | |
| 5978 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 5979 | + controlName = _ref2[0], | |
| 5980 | + value = _ref2[1]; | |
| 5981 | + | |
| 5982 | + var control = targetControls[controlName]; | |
| 5983 | + | |
| 5984 | + if (targetContainer.view.isStyleTransferControl(control)) { | |
| 5985 | + diffSettings[extraType] = diffSettings[extraType] || {}; | |
| 5986 | + diffSettings[extraType][controlName] = value; | |
| 5987 | + } | |
| 5988 | + }); | |
| 5989 | + } | |
| 5990 | + }; | |
| 5991 | + | |
| 5992 | + data.forEach(function (sourceModel) { | |
| 5993 | + var sourceSettings = sourceModel.settings; | |
| 5994 | + addExtraControls(sourceSettings, '__globals__'); | |
| 5995 | + addExtraControls(sourceSettings, '__dynamic__'); | |
| 5996 | + Object.entries(targetControls).forEach(function (_ref3) { | |
| 5997 | + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), | |
| 5998 | + controlName = _ref4[0], | |
| 5999 | + control = _ref4[1]; | |
| 6000 | + | |
| 6001 | + if (!targetContainer.view.isStyleTransferControl(control)) { | |
| 6002 | + return; | |
| 6003 | + } | |
| 6004 | + | |
| 6005 | + var controlSourceValue = sourceSettings[controlName], | |
| 6006 | + controlTargetValue = targetSettingsAttributes[controlName]; | |
| 6007 | + | |
| 6008 | + if (!_this.validateControls(controlSourceValue, controlTargetValue)) { | |
| 6009 | + return; | |
| 6010 | + } | |
| 6011 | + | |
| 6012 | + if ('object' === (0, _typeof2.default)(controlSourceValue)) { | |
| 6013 | + // eslint-disable-next-line array-callback-return | |
| 6014 | + var isEqual = Object.keys(controlSourceValue).some(function (propertyKey) { | |
| 6015 | + if (controlSourceValue[propertyKey] !== controlTargetValue[propertyKey]) { | |
| 6016 | + return false; | |
| 6017 | + } | |
| 6018 | + }); | |
| 6019 | + | |
| 6020 | + if (isEqual) { | |
| 6021 | + return; | |
| 6022 | + } | |
| 6023 | + } | |
| 6024 | + | |
| 6025 | + if (controlSourceValue === controlTargetValue || !elementor.getControlView(control.type).onPasteStyle(control, controlSourceValue)) { | |
| 6026 | + return; | |
| 6027 | + } | |
| 6028 | + | |
| 6029 | + diffSettings[controlName] = controlSourceValue; | |
| 6030 | + }); | |
| 6031 | + | |
| 6032 | + _this.pasteStyle(targetContainer, diffSettings); | |
| 6033 | + }); | |
| 6034 | + }); | |
| 6035 | + } | |
| 6036 | + /** | |
| 6037 | + * @param {Container} targetContainer | |
| 6038 | + * @param {{}} settings | |
| 6039 | + */ | |
| 6040 | + | |
| 6041 | + }, { | |
| 6042 | + key: "pasteStyle", | |
| 6043 | + value: function pasteStyle(targetContainer, settings) { | |
| 6044 | + var globals = settings.__globals__; | |
| 6045 | + | |
| 6046 | + if (globals) { | |
| 6047 | + delete settings.__globals__; | |
| 6048 | + } | |
| 6049 | + | |
| 6050 | + $e.run('document/elements/settings', { | |
| 6051 | + container: targetContainer, | |
| 6052 | + settings: settings, | |
| 6053 | + options: { | |
| 6054 | + external: true, | |
| 6055 | + render: false | |
| 6056 | + } | |
| 6057 | + }); | |
| 6058 | + | |
| 6059 | + if (globals) { | |
| 6060 | + $e.run('document/globals/settings', { | |
| 6061 | + container: targetContainer, | |
| 6062 | + settings: globals, | |
| 6063 | + options: { | |
| 6064 | + external: true, | |
| 6065 | + render: false | |
| 6066 | + } | |
| 6067 | + }); | |
| 6068 | + targetContainer.panel.refresh(); | |
| 6069 | + } | |
| 6070 | + | |
| 6071 | + targetContainer.render(); | |
| 6072 | + } | |
| 6073 | + }]); | |
| 6074 | + return PasteStyle; | |
| 6075 | +}(_commandHistory.default); | |
| 6076 | + | |
| 6077 | +exports.PasteStyle = PasteStyle; | |
| 6078 | +var _default = PasteStyle; | |
| 6079 | +exports["default"] = _default; | |
| 6080 | + | |
| 6081 | +/***/ }), | |
| 6082 | + | |
| 6083 | +/***/ "../assets/dev/js/editor/document/elements/commands/paste.js": | |
| 6084 | +/*!*******************************************************************!*\ | |
| 6085 | + !*** ../assets/dev/js/editor/document/elements/commands/paste.js ***! | |
| 6086 | + \*******************************************************************/ | |
| 6087 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6088 | + | |
| 6089 | +"use strict"; | |
| 6090 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 6091 | + | |
| 6092 | + | |
| 6093 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6094 | + | |
| 6095 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6096 | + value: true | |
| 6097 | +})); | |
| 6098 | +exports["default"] = exports.Paste = void 0; | |
| 6099 | + | |
| 6100 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6101 | + | |
| 6102 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6103 | + | |
| 6104 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6105 | + | |
| 6106 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6107 | + | |
| 6108 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6109 | + | |
| 6110 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 6111 | + | |
| 6112 | +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); }; } | |
| 6113 | + | |
| 6114 | +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; } } | |
| 6115 | + | |
| 6116 | +var Paste = /*#__PURE__*/function (_CommandHistory) { | |
| 6117 | + (0, _inherits2.default)(Paste, _CommandHistory); | |
| 6118 | + | |
| 6119 | + var _super = _createSuper(Paste); | |
| 6120 | + | |
| 6121 | + function Paste() { | |
| 6122 | + (0, _classCallCheck2.default)(this, Paste); | |
| 6123 | + return _super.apply(this, arguments); | |
| 6124 | + } | |
| 6125 | + | |
| 6126 | + (0, _createClass2.default)(Paste, [{ | |
| 6127 | + key: "validateArgs", | |
| 6128 | + value: function validateArgs(args) { | |
| 6129 | + this.requireContainer(args); // Validate if storage have data. | |
| 6130 | + | |
| 6131 | + var _args$storageKey = args.storageKey, | |
| 6132 | + storageKey = _args$storageKey === void 0 ? 'clipboard' : _args$storageKey, | |
| 6133 | + storageData = elementorCommon.storage.get(storageKey); | |
| 6134 | + this.requireArgumentType('storageData', 'object', { | |
| 6135 | + storageData: storageData | |
| 6136 | + }); | |
| 6137 | + } | |
| 6138 | + }, { | |
| 6139 | + key: "getHistory", | |
| 6140 | + value: function getHistory() { | |
| 6141 | + return { | |
| 6142 | + type: 'paste', | |
| 6143 | + title: __('Elements', 'elementor') | |
| 6144 | + }; | |
| 6145 | + } | |
| 6146 | + }, { | |
| 6147 | + key: "apply", | |
| 6148 | + value: function apply(args) { | |
| 6149 | + var at = args.at, | |
| 6150 | + _args$rebuild = args.rebuild, | |
| 6151 | + rebuild = _args$rebuild === void 0 ? false : _args$rebuild, | |
| 6152 | + _args$storageKey2 = args.storageKey, | |
| 6153 | + storageKey = _args$storageKey2 === void 0 ? 'clipboard' : _args$storageKey2, | |
| 6154 | + _args$containers = args.containers, | |
| 6155 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 6156 | + _args$options = args.options, | |
| 6157 | + options = _args$options === void 0 ? {} : _args$options, | |
| 6158 | + storageData = elementorCommon.storage.get(storageKey); | |
| 6159 | + var result = []; // Paste on "Add Section" area. | |
| 6160 | + | |
| 6161 | + if (rebuild) { | |
| 6162 | + result = this.rebuild(containers, storageData, at); | |
| 6163 | + } else { | |
| 6164 | + if (undefined !== at) { | |
| 6165 | + options.at = at; | |
| 6166 | + } | |
| 6167 | + | |
| 6168 | + result.push(this.pasteTo(containers, storageData, options)); | |
| 6169 | + } | |
| 6170 | + | |
| 6171 | + if (1 === result.length) { | |
| 6172 | + return result[0]; | |
| 6173 | + } | |
| 6174 | + | |
| 6175 | + return result; | |
| 6176 | + } | |
| 6177 | + }, { | |
| 6178 | + key: "rebuild", | |
| 6179 | + value: function rebuild(containers, data, at) { | |
| 6180 | + var _this = this; | |
| 6181 | + | |
| 6182 | + // Paste at each target. | |
| 6183 | + var result = []; | |
| 6184 | + containers.forEach(function (targetContainer) { | |
| 6185 | + var index = 'undefined' === typeof at ? targetContainer.view.collection.length : at; | |
| 6186 | + data.forEach(function (model) { | |
| 6187 | + switch (model.elType) { | |
| 6188 | + case 'container': | |
| 6189 | + case 'section': | |
| 6190 | + { | |
| 6191 | + // If is inner create section for `inner-section`. | |
| 6192 | + if (model.isInner) { | |
| 6193 | + var section = $e.run('document/elements/create', { | |
| 6194 | + container: targetContainer, | |
| 6195 | + model: { | |
| 6196 | + elType: 'section' | |
| 6197 | + }, | |
| 6198 | + columns: 1, | |
| 6199 | + options: { | |
| 6200 | + at: index, | |
| 6201 | + edit: false | |
| 6202 | + } | |
| 6203 | + }); // `targetContainer` = first column at `section`. | |
| 6204 | + | |
| 6205 | + targetContainer = section.view.children.findByIndex(0).getContainer(); | |
| 6206 | + } // Will be not affected by hook since it always have `model.elements`. | |
| 6207 | + | |
| 6208 | + | |
| 6209 | + result.push(_this.pasteTo([targetContainer], [model], { | |
| 6210 | + at: index, | |
| 6211 | + edit: false | |
| 6212 | + })); | |
| 6213 | + index++; | |
| 6214 | + } | |
| 6215 | + break; | |
| 6216 | + | |
| 6217 | + case 'column': | |
| 6218 | + { | |
| 6219 | + // Next code changed from original since `_checkIsEmpty()` was removed. | |
| 6220 | + var _section = $e.run('document/elements/create', { | |
| 6221 | + container: targetContainer, | |
| 6222 | + model: { | |
| 6223 | + elType: 'section' | |
| 6224 | + }, | |
| 6225 | + columns: 0, | |
| 6226 | + // section with no columns. | |
| 6227 | + options: { | |
| 6228 | + at: ++index, | |
| 6229 | + edit: false | |
| 6230 | + } | |
| 6231 | + }); | |
| 6232 | + | |
| 6233 | + result.push(_this.pasteTo([_section], [model])); | |
| 6234 | + } | |
| 6235 | + break; | |
| 6236 | + | |
| 6237 | + default: | |
| 6238 | + // In case it widget: | |
| 6239 | + var target; // If you trying to paste widget on section, then paste should be at the first column. | |
| 6240 | + | |
| 6241 | + if ('section' === targetContainer.model.get('elType')) { | |
| 6242 | + target = [targetContainer.view.children.findByIndex(0).getContainer()]; | |
| 6243 | + } else { | |
| 6244 | + // Else, create section with one column for element. | |
| 6245 | + var _section2 = $e.run('document/elements/create', { | |
| 6246 | + container: targetContainer, | |
| 6247 | + model: { | |
| 6248 | + elType: 'section' | |
| 6249 | + }, | |
| 6250 | + columns: 1, | |
| 6251 | + options: { | |
| 6252 | + at: ++index | |
| 6253 | + } | |
| 6254 | + }); // Create the element in the column that just was created. | |
| 6255 | + | |
| 6256 | + | |
| 6257 | + target = [_section2.view.children.first().getContainer()]; | |
| 6258 | + } | |
| 6259 | + | |
| 6260 | + result.push(_this.pasteTo(target, [model])); | |
| 6261 | + } | |
| 6262 | + }); | |
| 6263 | + }); | |
| 6264 | + return result; | |
| 6265 | + } | |
| 6266 | + }, { | |
| 6267 | + key: "pasteTo", | |
| 6268 | + value: function pasteTo(targetContainers, models) { | |
| 6269 | + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 6270 | + options = Object.assign({ | |
| 6271 | + at: null, | |
| 6272 | + clone: true | |
| 6273 | + }, options); | |
| 6274 | + var result = []; | |
| 6275 | + models.forEach(function (model) { | |
| 6276 | + result.push($e.run('document/elements/create', { | |
| 6277 | + containers: targetContainers, | |
| 6278 | + model: model, | |
| 6279 | + options: options | |
| 6280 | + })); // On paste sections, increase the `at` for every section. | |
| 6281 | + | |
| 6282 | + if (null !== options.at) { | |
| 6283 | + options.at++; | |
| 6284 | + } | |
| 6285 | + }); | |
| 6286 | + | |
| 6287 | + if (1 === result.length) { | |
| 6288 | + return result[0]; | |
| 6289 | + } | |
| 6290 | + | |
| 6291 | + return result; | |
| 6292 | + } | |
| 6293 | + }]); | |
| 6294 | + return Paste; | |
| 6295 | +}(_commandHistory.default); | |
| 6296 | + | |
| 6297 | +exports.Paste = Paste; | |
| 6298 | +var _default = Paste; | |
| 6299 | +exports["default"] = _default; | |
| 6300 | + | |
| 6301 | +/***/ }), | |
| 6302 | + | |
| 6303 | +/***/ "../assets/dev/js/editor/document/elements/commands/reset-settings.js": | |
| 6304 | +/*!****************************************************************************!*\ | |
| 6305 | + !*** ../assets/dev/js/editor/document/elements/commands/reset-settings.js ***! | |
| 6306 | + \****************************************************************************/ | |
| 6307 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6308 | + | |
| 6309 | +"use strict"; | |
| 6310 | + | |
| 6311 | + | |
| 6312 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6313 | + | |
| 6314 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6315 | + value: true | |
| 6316 | +})); | |
| 6317 | +exports["default"] = exports.ResetSettings = void 0; | |
| 6318 | + | |
| 6319 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 6320 | + | |
| 6321 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6322 | + | |
| 6323 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6324 | + | |
| 6325 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6326 | + | |
| 6327 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6328 | + | |
| 6329 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6330 | + | |
| 6331 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! ../../commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 6332 | + | |
| 6333 | +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); }; } | |
| 6334 | + | |
| 6335 | +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; } } | |
| 6336 | + | |
| 6337 | +var ResetSettings = /*#__PURE__*/function (_CommandHistory) { | |
| 6338 | + (0, _inherits2.default)(ResetSettings, _CommandHistory); | |
| 6339 | + | |
| 6340 | + var _super = _createSuper(ResetSettings); | |
| 6341 | + | |
| 6342 | + function ResetSettings() { | |
| 6343 | + (0, _classCallCheck2.default)(this, ResetSettings); | |
| 6344 | + return _super.apply(this, arguments); | |
| 6345 | + } | |
| 6346 | + | |
| 6347 | + (0, _createClass2.default)(ResetSettings, [{ | |
| 6348 | + key: "validateArgs", | |
| 6349 | + value: function validateArgs(args) { | |
| 6350 | + this.requireContainer(args); | |
| 6351 | + } | |
| 6352 | + }, { | |
| 6353 | + key: "getHistory", | |
| 6354 | + value: function getHistory(args) { | |
| 6355 | + var _args$containers = args.containers, | |
| 6356 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 6357 | + return { | |
| 6358 | + containers: containers, | |
| 6359 | + type: 'reset_settings' | |
| 6360 | + }; | |
| 6361 | + } | |
| 6362 | + }, { | |
| 6363 | + key: "apply", | |
| 6364 | + value: function apply(args) { | |
| 6365 | + var _args$containers2 = args.containers, | |
| 6366 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 6367 | + _args$options = args.options, | |
| 6368 | + options = _args$options === void 0 ? {} : _args$options, | |
| 6369 | + _args$settings = args.settings, | |
| 6370 | + settings = _args$settings === void 0 ? [] : _args$settings; | |
| 6371 | + containers.forEach(function (container) { | |
| 6372 | + var controls = Object.entries(container.settings.controls), | |
| 6373 | + defaultValues = {}; | |
| 6374 | + controls.forEach(function (_ref) { | |
| 6375 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 6376 | + controlName = _ref2[0], | |
| 6377 | + control = _ref2[1]; | |
| 6378 | + | |
| 6379 | + // If settings were specific, restore only them. | |
| 6380 | + if (settings && settings.length) { | |
| 6381 | + if (!settings.find(function (key) { | |
| 6382 | + return key === controlName; | |
| 6383 | + })) { | |
| 6384 | + return; | |
| 6385 | + } | |
| 6386 | + } | |
| 6387 | + | |
| 6388 | + defaultValues[controlName] = control.default; | |
| 6389 | + }); | |
| 6390 | + $e.run('document/elements/settings', { | |
| 6391 | + container: container, | |
| 6392 | + options: options, | |
| 6393 | + settings: defaultValues | |
| 6394 | + }); | |
| 6395 | + container.render(); | |
| 6396 | + }); | |
| 6397 | + } | |
| 6398 | + }]); | |
| 6399 | + return ResetSettings; | |
| 6400 | +}(_commandHistory.default); | |
| 6401 | + | |
| 6402 | +exports.ResetSettings = ResetSettings; | |
| 6403 | +var _default = ResetSettings; | |
| 6404 | +exports["default"] = _default; | |
| 6405 | + | |
| 6406 | +/***/ }), | |
| 6407 | + | |
| 6408 | +/***/ "../assets/dev/js/editor/document/elements/commands/reset-style.js": | |
| 6409 | +/*!*************************************************************************!*\ | |
| 6410 | + !*** ../assets/dev/js/editor/document/elements/commands/reset-style.js ***! | |
| 6411 | + \*************************************************************************/ | |
| 6412 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6413 | + | |
| 6414 | +"use strict"; | |
| 6415 | + | |
| 6416 | + | |
| 6417 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6418 | + | |
| 6419 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6420 | + value: true | |
| 6421 | +})); | |
| 6422 | +exports["default"] = exports.ResetStyle = void 0; | |
| 6423 | + | |
| 6424 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 6425 | + | |
| 6426 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6427 | + | |
| 6428 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6429 | + | |
| 6430 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6431 | + | |
| 6432 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6433 | + | |
| 6434 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6435 | + | |
| 6436 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 6437 | + | |
| 6438 | +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); }; } | |
| 6439 | + | |
| 6440 | +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; } } | |
| 6441 | + | |
| 6442 | +var ResetStyle = /*#__PURE__*/function (_CommandHistory) { | |
| 6443 | + (0, _inherits2.default)(ResetStyle, _CommandHistory); | |
| 6444 | + | |
| 6445 | + var _super = _createSuper(ResetStyle); | |
| 6446 | + | |
| 6447 | + function ResetStyle() { | |
| 6448 | + (0, _classCallCheck2.default)(this, ResetStyle); | |
| 6449 | + return _super.apply(this, arguments); | |
| 6450 | + } | |
| 6451 | + | |
| 6452 | + (0, _createClass2.default)(ResetStyle, [{ | |
| 6453 | + key: "validateArgs", | |
| 6454 | + value: function validateArgs(args) { | |
| 6455 | + this.requireContainer(args); | |
| 6456 | + } | |
| 6457 | + }, { | |
| 6458 | + key: "getHistory", | |
| 6459 | + value: function getHistory(args) { | |
| 6460 | + var _args$containers = args.containers, | |
| 6461 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 6462 | + return { | |
| 6463 | + containers: containers, | |
| 6464 | + type: 'reset_style' | |
| 6465 | + }; | |
| 6466 | + } | |
| 6467 | + }, { | |
| 6468 | + key: "apply", | |
| 6469 | + value: function apply(args) { | |
| 6470 | + var _args$containers2 = args.containers, | |
| 6471 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 6472 | + containers.forEach(function (container) { | |
| 6473 | + var controls = container.settings.controls, | |
| 6474 | + settingsKeys = []; | |
| 6475 | + container.view.allowRender = false; | |
| 6476 | + Object.entries(controls).forEach(function (_ref) { | |
| 6477 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 6478 | + controlName = _ref2[0], | |
| 6479 | + control = _ref2[1]; | |
| 6480 | + | |
| 6481 | + if (!container.view.isStyleTransferControl(control)) { | |
| 6482 | + return; | |
| 6483 | + } | |
| 6484 | + | |
| 6485 | + settingsKeys.push(controlName); | |
| 6486 | + }); | |
| 6487 | + $e.run('document/elements/reset-settings', { | |
| 6488 | + container: container, | |
| 6489 | + settings: settingsKeys, | |
| 6490 | + options: { | |
| 6491 | + external: true | |
| 6492 | + } | |
| 6493 | + }); | |
| 6494 | + container.view.allowRender = true; | |
| 6495 | + container.render(); | |
| 6496 | + }); | |
| 6497 | + } | |
| 6498 | + }]); | |
| 6499 | + return ResetStyle; | |
| 6500 | +}(_commandHistory.default); | |
| 6501 | + | |
| 6502 | +exports.ResetStyle = ResetStyle; | |
| 6503 | +var _default = ResetStyle; | |
| 6504 | +exports["default"] = _default; | |
| 6505 | + | |
| 6506 | +/***/ }), | |
| 6507 | + | |
| 6508 | +/***/ "../assets/dev/js/editor/document/elements/commands/select-all.js": | |
| 6509 | +/*!************************************************************************!*\ | |
| 6510 | + !*** ../assets/dev/js/editor/document/elements/commands/select-all.js ***! | |
| 6511 | + \************************************************************************/ | |
| 6512 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6513 | + | |
| 6514 | +"use strict"; | |
| 6515 | + | |
| 6516 | + | |
| 6517 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6518 | + | |
| 6519 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6520 | + value: true | |
| 6521 | +})); | |
| 6522 | +exports["default"] = exports.SelectAll = void 0; | |
| 6523 | + | |
| 6524 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6525 | + | |
| 6526 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6527 | + | |
| 6528 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6529 | + | |
| 6530 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6531 | + | |
| 6532 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6533 | + | |
| 6534 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 6535 | + | |
| 6536 | +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; } } }; } | |
| 6537 | + | |
| 6538 | +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); } | |
| 6539 | + | |
| 6540 | +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; } | |
| 6541 | + | |
| 6542 | +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); }; } | |
| 6543 | + | |
| 6544 | +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; } } | |
| 6545 | + | |
| 6546 | +var SelectAll = /*#__PURE__*/function (_CommandBase) { | |
| 6547 | + (0, _inherits2.default)(SelectAll, _CommandBase); | |
| 6548 | + | |
| 6549 | + var _super = _createSuper(SelectAll); | |
| 6550 | + | |
| 6551 | + function SelectAll() { | |
| 6552 | + (0, _classCallCheck2.default)(this, SelectAll); | |
| 6553 | + return _super.apply(this, arguments); | |
| 6554 | + } | |
| 6555 | + | |
| 6556 | + (0, _createClass2.default)(SelectAll, [{ | |
| 6557 | + key: "apply", | |
| 6558 | + value: function apply() { | |
| 6559 | + elementor.selection.add(this.flattenContainersList( // The selection mechanism keeps selected elements in a single-dimension object. Therefore, In order to | |
| 6560 | + // select all document elements, we should convert them into a flatten, single-dimension array. | |
| 6561 | + elementor.elementsModel.get('elements').map(function (element) { | |
| 6562 | + return elementor.getContainer(element.id); | |
| 6563 | + }))); | |
| 6564 | + } | |
| 6565 | + /** | |
| 6566 | + * Recursively iterate over all container children and make a flatten array of their instances. | |
| 6567 | + * | |
| 6568 | + * @param {*} containers | |
| 6569 | + * @return {*[]} flattened array of container children | |
| 6570 | + */ | |
| 6571 | + | |
| 6572 | + }, { | |
| 6573 | + key: "flattenContainersList", | |
| 6574 | + value: function flattenContainersList() { | |
| 6575 | + var containers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
| 6576 | + var flatten = []; | |
| 6577 | + | |
| 6578 | + var _iterator = _createForOfIteratorHelper(containers), | |
| 6579 | + _step; | |
| 6580 | + | |
| 6581 | + try { | |
| 6582 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 6583 | + var container = _step.value; | |
| 6584 | + flatten.push(container); | |
| 6585 | + | |
| 6586 | + if (container.children.length) { | |
| 6587 | + flatten = flatten.concat(this.flattenContainersList(container.children)); | |
| 6588 | + } | |
| 6589 | + } | |
| 6590 | + } catch (err) { | |
| 6591 | + _iterator.e(err); | |
| 6592 | + } finally { | |
| 6593 | + _iterator.f(); | |
| 6594 | + } | |
| 6595 | + | |
| 6596 | + return flatten; | |
| 6597 | + } | |
| 6598 | + }]); | |
| 6599 | + return SelectAll; | |
| 6600 | +}(_commandBase.default); | |
| 6601 | + | |
| 6602 | +exports.SelectAll = SelectAll; | |
| 6603 | +var _default = SelectAll; | |
| 6604 | +exports["default"] = _default; | |
| 6605 | + | |
| 6606 | +/***/ }), | |
| 6607 | + | |
| 6608 | +/***/ "../assets/dev/js/editor/document/elements/commands/select.js": | |
| 6609 | +/*!********************************************************************!*\ | |
| 6610 | + !*** ../assets/dev/js/editor/document/elements/commands/select.js ***! | |
| 6611 | + \********************************************************************/ | |
| 6612 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6613 | + | |
| 6614 | +"use strict"; | |
| 6615 | + | |
| 6616 | + | |
| 6617 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6618 | + | |
| 6619 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6620 | + value: true | |
| 6621 | +})); | |
| 6622 | +exports["default"] = exports.Select = void 0; | |
| 6623 | + | |
| 6624 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6625 | + | |
| 6626 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6627 | + | |
| 6628 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6629 | + | |
| 6630 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6631 | + | |
| 6632 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6633 | + | |
| 6634 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 6635 | + | |
| 6636 | +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); }; } | |
| 6637 | + | |
| 6638 | +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; } } | |
| 6639 | + | |
| 6640 | +var Select = /*#__PURE__*/function (_CommandBase) { | |
| 6641 | + (0, _inherits2.default)(Select, _CommandBase); | |
| 6642 | + | |
| 6643 | + var _super = _createSuper(Select); | |
| 6644 | + | |
| 6645 | + function Select() { | |
| 6646 | + (0, _classCallCheck2.default)(this, Select); | |
| 6647 | + return _super.apply(this, arguments); | |
| 6648 | + } | |
| 6649 | + | |
| 6650 | + (0, _createClass2.default)(Select, [{ | |
| 6651 | + key: "validateArgs", | |
| 6652 | + value: function validateArgs(args) { | |
| 6653 | + this.requireContainer(args); | |
| 6654 | + } | |
| 6655 | + }, { | |
| 6656 | + key: "apply", | |
| 6657 | + value: function apply(args) { | |
| 6658 | + var _args$containers = args.containers, | |
| 6659 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 6660 | + _args$append = args.append, | |
| 6661 | + append = _args$append === void 0 ? false : _args$append; | |
| 6662 | + elementor.selection.add(containers, append); | |
| 6663 | + } | |
| 6664 | + }]); | |
| 6665 | + return Select; | |
| 6666 | +}(_commandBase.default); | |
| 6667 | + | |
| 6668 | +exports.Select = Select; | |
| 6669 | +var _default = Select; | |
| 6670 | +exports["default"] = _default; | |
| 6671 | + | |
| 6672 | +/***/ }), | |
| 6673 | + | |
| 6674 | +/***/ "../assets/dev/js/editor/document/elements/commands/settings.js": | |
| 6675 | +/*!**********************************************************************!*\ | |
| 6676 | + !*** ../assets/dev/js/editor/document/elements/commands/settings.js ***! | |
| 6677 | + \**********************************************************************/ | |
| 6678 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6679 | + | |
| 6680 | +"use strict"; | |
| 6681 | + | |
| 6682 | + | |
| 6683 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6684 | + | |
| 6685 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6686 | + value: true | |
| 6687 | +})); | |
| 6688 | +exports["default"] = exports.Settings = void 0; | |
| 6689 | + | |
| 6690 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 6691 | + | |
| 6692 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6693 | + | |
| 6694 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6695 | + | |
| 6696 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6697 | + | |
| 6698 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6699 | + | |
| 6700 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6701 | + | |
| 6702 | +var _commandHistoryDebounce = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history-debounce */ "../assets/dev/js/editor/document/commands/base/command-history-debounce.js")); | |
| 6703 | + | |
| 6704 | +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); }; } | |
| 6705 | + | |
| 6706 | +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; } } | |
| 6707 | + | |
| 6708 | +/** | |
| 6709 | + * @typedef {import('../../../container/container')} Container | |
| 6710 | + */ | |
| 6711 | +var Settings = /*#__PURE__*/function (_CommandHistoryDeboun) { | |
| 6712 | + (0, _inherits2.default)(Settings, _CommandHistoryDeboun); | |
| 6713 | + | |
| 6714 | + var _super = _createSuper(Settings); | |
| 6715 | + | |
| 6716 | + function Settings() { | |
| 6717 | + (0, _classCallCheck2.default)(this, Settings); | |
| 6718 | + return _super.apply(this, arguments); | |
| 6719 | + } | |
| 6720 | + | |
| 6721 | + (0, _createClass2.default)(Settings, [{ | |
| 6722 | + key: "addToHistory", | |
| 6723 | + value: | |
| 6724 | + /** | |
| 6725 | + * Function addToHistory(). | |
| 6726 | + * | |
| 6727 | + * @param {Container} container | |
| 6728 | + * @param {{}} newSettings | |
| 6729 | + * @param {{}} oldSettings | |
| 6730 | + */ | |
| 6731 | + function addToHistory(container, newSettings, oldSettings) { | |
| 6732 | + var changes = (0, _defineProperty2.default)({}, container.id, { | |
| 6733 | + old: oldSettings, | |
| 6734 | + new: newSettings | |
| 6735 | + }), | |
| 6736 | + historyItem = { | |
| 6737 | + containers: [container], | |
| 6738 | + data: { | |
| 6739 | + changes: changes | |
| 6740 | + }, | |
| 6741 | + type: 'change', | |
| 6742 | + restore: Settings.restore | |
| 6743 | + }; | |
| 6744 | + $e.internal('document/history/add-transaction', historyItem); | |
| 6745 | + } | |
| 6746 | + }, { | |
| 6747 | + key: "validateArgs", | |
| 6748 | + value: function validateArgs(args) { | |
| 6749 | + this.requireContainer(args); | |
| 6750 | + this.requireArgumentConstructor('settings', Object, args); | |
| 6751 | + } | |
| 6752 | + }, { | |
| 6753 | + key: "getHistory", | |
| 6754 | + value: function getHistory(args) { | |
| 6755 | + var _args$containers = args.containers, | |
| 6756 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 6757 | + subTitle = this.constructor.getSubTitle(args); | |
| 6758 | + return { | |
| 6759 | + containers: containers, | |
| 6760 | + subTitle: subTitle, | |
| 6761 | + type: 'change' | |
| 6762 | + }; | |
| 6763 | + } | |
| 6764 | + }, { | |
| 6765 | + key: "apply", | |
| 6766 | + value: function apply(args) { | |
| 6767 | + var _this = this; | |
| 6768 | + | |
| 6769 | + var _args$containers2 = args.containers, | |
| 6770 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 6771 | + _args$settings = args.settings, | |
| 6772 | + settings = _args$settings === void 0 ? {} : _args$settings, | |
| 6773 | + _args$isMultiSettings = args.isMultiSettings, | |
| 6774 | + isMultiSettings = _args$isMultiSettings === void 0 ? false : _args$isMultiSettings, | |
| 6775 | + _args$options = args.options, | |
| 6776 | + options = _args$options === void 0 ? {} : _args$options; | |
| 6777 | + containers.forEach(function (container) { | |
| 6778 | + container = container.lookup(); | |
| 6779 | + /** | |
| 6780 | + * Settings support multi settings for each container, eg use: | |
| 6781 | + * settings: { '{ container-id }': { someSettingKey: someSettingValue } } etc. | |
| 6782 | + */ | |
| 6783 | + | |
| 6784 | + var newSettings = isMultiSettings ? settings[container.id] : settings, | |
| 6785 | + oldSettings = container.settings.toJSON(); // Clear old oldValues. | |
| 6786 | + | |
| 6787 | + container.oldValues = {}; // Set oldValues, For each setting is about to change save setting value. | |
| 6788 | + | |
| 6789 | + Object.keys(newSettings).forEach(function (key) { | |
| 6790 | + container.oldValues[key] = oldSettings[key]; | |
| 6791 | + }); // If history active, add history transaction with old and new settings. | |
| 6792 | + | |
| 6793 | + if (_this.isHistoryActive()) { | |
| 6794 | + _this.addToHistory(container, newSettings, container.oldValues); | |
| 6795 | + } | |
| 6796 | + | |
| 6797 | + $e.internal('document/elements/set-settings', { | |
| 6798 | + container: container, | |
| 6799 | + options: options, | |
| 6800 | + settings: newSettings | |
| 6801 | + }); | |
| 6802 | + }); | |
| 6803 | + } | |
| 6804 | + }, { | |
| 242 | 6805 | key: "isDataChanged", |
| 243 | 6806 | value: function isDataChanged() { |
| 244 | - // All the commands who use history are commands that changing the data. | |
| 245 | 6807 | return true; |
| 246 | 6808 | } |
| 247 | 6809 | }], [{ |
| 248 | - key: "getInstanceType", | |
| 249 | - value: function getInstanceType() { | |
| 250 | - return 'CommandHistoryBase'; | |
| 6810 | + key: "getSubTitle", | |
| 6811 | + value: | |
| 6812 | + /** | |
| 6813 | + * Function getSubTitle(). | |
| 6814 | + * | |
| 6815 | + * Get sub title by container. | |
| 6816 | + * | |
| 6817 | + * @param {{}} args | |
| 6818 | + * | |
| 6819 | + * @return {string} sub title | |
| 6820 | + */ | |
| 6821 | + function getSubTitle(args) { | |
| 6822 | + var _args$containers3 = args.containers, | |
| 6823 | + containers = _args$containers3 === void 0 ? [args.container] : _args$containers3, | |
| 6824 | + _args$settings2 = args.settings, | |
| 6825 | + settings = _args$settings2 === void 0 ? {} : _args$settings2, | |
| 6826 | + isMultiSettings = args.isMultiSettings, | |
| 6827 | + settingsKeys = Object.keys(settings), | |
| 6828 | + controls = containers[0].controls, | |
| 6829 | + firstSettingKey = settingsKeys[0]; | |
| 6830 | + var result = ''; | |
| 6831 | + | |
| 6832 | + if (!isMultiSettings && 1 === settingsKeys.length && controls && controls[firstSettingKey]) { | |
| 6833 | + result = controls[firstSettingKey].label; | |
| 6834 | + } | |
| 6835 | + | |
| 6836 | + return result; | |
| 251 | 6837 | } |
| 6838 | + /** | |
| 6839 | + * Function restore(). | |
| 6840 | + * | |
| 6841 | + * Redo/Restore. | |
| 6842 | + * | |
| 6843 | + * @param {{}} historyItem | |
| 6844 | + * @param {boolean} isRedo | |
| 6845 | + */ | |
| 6846 | + | |
| 6847 | + }, { | |
| 6848 | + key: "restore", | |
| 6849 | + value: function restore(historyItem, isRedo) { | |
| 6850 | + var data = historyItem.get('data'); | |
| 6851 | + historyItem.get('containers').forEach(function ( | |
| 6852 | + /* Container */ | |
| 6853 | + container) { | |
| 6854 | + var changes = data.changes[container.id]; | |
| 6855 | + $e.run('document/elements/settings', { | |
| 6856 | + container: container, | |
| 6857 | + settings: isRedo ? changes.new : changes.old, | |
| 6858 | + options: { | |
| 6859 | + external: true | |
| 6860 | + } | |
| 6861 | + }); | |
| 6862 | + }); | |
| 6863 | + } | |
| 252 | 6864 | }]); |
| 253 | -}(_commandContainerBase.default); | |
| 6865 | + return Settings; | |
| 6866 | +}(_commandHistoryDebounce.default); | |
| 254 | 6867 | |
| 6868 | +exports.Settings = Settings; | |
| 6869 | +var _default = Settings; | |
| 6870 | +exports["default"] = _default; | |
| 6871 | + | |
| 255 | 6872 | /***/ }), |
| 256 | 6873 | |
| 257 | -/***/ "../assets/dev/js/editor/document/command-bases/command-history-debounce-base.js": | |
| 6874 | +/***/ "../assets/dev/js/editor/document/elements/commands/toggle-selection.js": | |
| 6875 | +/*!******************************************************************************!*\ | |
| 6876 | + !*** ../assets/dev/js/editor/document/elements/commands/toggle-selection.js ***! | |
| 6877 | + \******************************************************************************/ | |
| 6878 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6879 | + | |
| 6880 | +"use strict"; | |
| 6881 | + | |
| 6882 | + | |
| 6883 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6884 | + | |
| 6885 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6886 | + value: true | |
| 6887 | +})); | |
| 6888 | +exports["default"] = exports.ToggleSelection = void 0; | |
| 6889 | + | |
| 6890 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6891 | + | |
| 6892 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6893 | + | |
| 6894 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6895 | + | |
| 6896 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6897 | + | |
| 6898 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6899 | + | |
| 6900 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 6901 | + | |
| 6902 | +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); }; } | |
| 6903 | + | |
| 6904 | +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; } } | |
| 6905 | + | |
| 6906 | +var ToggleSelection = /*#__PURE__*/function (_CommandBase) { | |
| 6907 | + (0, _inherits2.default)(ToggleSelection, _CommandBase); | |
| 6908 | + | |
| 6909 | + var _super = _createSuper(ToggleSelection); | |
| 6910 | + | |
| 6911 | + function ToggleSelection() { | |
| 6912 | + (0, _classCallCheck2.default)(this, ToggleSelection); | |
| 6913 | + return _super.apply(this, arguments); | |
| 6914 | + } | |
| 6915 | + | |
| 6916 | + (0, _createClass2.default)(ToggleSelection, [{ | |
| 6917 | + key: "validateArgs", | |
| 6918 | + value: function validateArgs(args) { | |
| 6919 | + this.requireContainer(args); | |
| 6920 | + } | |
| 6921 | + }, { | |
| 6922 | + key: "apply", | |
| 6923 | + value: function apply(args) { | |
| 6924 | + var _args$containers = args.containers, | |
| 6925 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 6926 | + _args$append = args.append, | |
| 6927 | + append = _args$append === void 0 ? false : _args$append; | |
| 6928 | + containers.forEach(function (container) { | |
| 6929 | + $e.run(elementor.selection.has(container) && append ? 'document/elements/deselect' : 'document/elements/select', args); | |
| 6930 | + }); | |
| 6931 | + } | |
| 6932 | + }]); | |
| 6933 | + return ToggleSelection; | |
| 6934 | +}(_commandBase.default); | |
| 6935 | + | |
| 6936 | +exports.ToggleSelection = ToggleSelection; | |
| 6937 | +var _default = ToggleSelection; | |
| 6938 | +exports["default"] = _default; | |
| 6939 | + | |
| 6940 | +/***/ }), | |
| 6941 | + | |
| 6942 | +/***/ "../assets/dev/js/editor/document/elements/component.js": | |
| 6943 | +/*!**************************************************************!*\ | |
| 6944 | + !*** ../assets/dev/js/editor/document/elements/component.js ***! | |
| 6945 | + \**************************************************************/ | |
| 6946 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6947 | + | |
| 6948 | +"use strict"; | |
| 6949 | + | |
| 6950 | + | |
| 6951 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6952 | + | |
| 6953 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 6954 | + | |
| 6955 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6956 | + value: true | |
| 6957 | +})); | |
| 6958 | +exports["default"] = void 0; | |
| 6959 | + | |
| 6960 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6961 | + | |
| 6962 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6963 | + | |
| 6964 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6965 | + | |
| 6966 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6967 | + | |
| 6968 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6969 | + | |
| 6970 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 6971 | + | |
| 6972 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/document/elements/commands/index.js")); | |
| 6973 | + | |
| 6974 | +var commandsInternal = _interopRequireWildcard(__webpack_require__(/*! ./commands-internal/ */ "../assets/dev/js/editor/document/elements/commands-internal/index.js")); | |
| 6975 | + | |
| 6976 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 6977 | + | |
| 6978 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 6979 | + | |
| 6980 | +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); }; } | |
| 6981 | + | |
| 6982 | +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; } } | |
| 6983 | + | |
| 6984 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 6985 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 6986 | + | |
| 6987 | + var _super = _createSuper(Component); | |
| 6988 | + | |
| 6989 | + function Component() { | |
| 6990 | + (0, _classCallCheck2.default)(this, Component); | |
| 6991 | + return _super.apply(this, arguments); | |
| 6992 | + } | |
| 6993 | + | |
| 6994 | + (0, _createClass2.default)(Component, [{ | |
| 6995 | + key: "getNamespace", | |
| 6996 | + value: function getNamespace() { | |
| 6997 | + return 'document/elements'; | |
| 6998 | + } | |
| 6999 | + }, { | |
| 7000 | + key: "defaultCommands", | |
| 7001 | + value: function defaultCommands() { | |
| 7002 | + return this.importCommands(commands); | |
| 7003 | + } | |
| 7004 | + }, { | |
| 7005 | + key: "defaultCommandsInternal", | |
| 7006 | + value: function defaultCommandsInternal() { | |
| 7007 | + return this.importCommands(commandsInternal); | |
| 7008 | + } | |
| 7009 | + }, { | |
| 7010 | + key: "defaultUtils", | |
| 7011 | + value: function defaultUtils() { | |
| 7012 | + var _this = this; | |
| 7013 | + | |
| 7014 | + return { | |
| 7015 | + isValidChild: function isValidChild(childModel, parentModel) { | |
| 7016 | + if (childModel instanceof Backbone.Model) { | |
| 7017 | + childModel = childModel.attributes; | |
| 7018 | + } | |
| 7019 | + | |
| 7020 | + if (parentModel instanceof Backbone.Model) { | |
| 7021 | + parentModel = parentModel.attributes; | |
| 7022 | + } | |
| 7023 | + | |
| 7024 | + var parentElType = parentModel.elType, | |
| 7025 | + draggedElType = childModel.elType, | |
| 7026 | + parentIsInner = parentModel.isInner, | |
| 7027 | + draggedIsInner = childModel.isInner; // Block's inner-section at inner-section column. | |
| 7028 | + | |
| 7029 | + if (draggedIsInner && 'section' === draggedElType && parentIsInner && 'column' === parentElType) { | |
| 7030 | + return false; | |
| 7031 | + } // Allow only nested containers. | |
| 7032 | + | |
| 7033 | + | |
| 7034 | + if (draggedElType === parentElType && 'container' !== draggedElType) { | |
| 7035 | + return false; | |
| 7036 | + } | |
| 7037 | + | |
| 7038 | + if ('section' === draggedElType && !draggedIsInner && 'column' === parentElType) { | |
| 7039 | + return false; | |
| 7040 | + } | |
| 7041 | + | |
| 7042 | + var childTypes = elementor.helpers.getElementChildType(parentElType); | |
| 7043 | + return childTypes && -1 !== childTypes.indexOf(draggedElType); | |
| 7044 | + }, | |
| 7045 | + isValidGrandChild: function isValidGrandChild(childModel, targetContainer) { | |
| 7046 | + var result; | |
| 7047 | + var childElType = childModel.get('elType'); | |
| 7048 | + | |
| 7049 | + switch (targetContainer.model.get('elType')) { | |
| 7050 | + case 'document': | |
| 7051 | + result = true; | |
| 7052 | + break; | |
| 7053 | + | |
| 7054 | + case 'section': | |
| 7055 | + result = 'widget' === childElType; | |
| 7056 | + break; | |
| 7057 | + | |
| 7058 | + default: | |
| 7059 | + result = false; | |
| 7060 | + } | |
| 7061 | + | |
| 7062 | + return result; | |
| 7063 | + }, | |
| 7064 | + isSameElement: function isSameElement(sourceModel, targetContainer) { | |
| 7065 | + var targetElType = targetContainer.model.get('elType'), | |
| 7066 | + sourceElType = sourceModel.get('elType'); | |
| 7067 | + | |
| 7068 | + if (targetElType !== sourceElType) { | |
| 7069 | + return false; | |
| 7070 | + } | |
| 7071 | + | |
| 7072 | + if ('column' === targetElType && 'column' === sourceElType) { | |
| 7073 | + return true; | |
| 7074 | + } | |
| 7075 | + | |
| 7076 | + return targetContainer.model.get('isInner') === sourceModel.get('isInner'); | |
| 7077 | + }, | |
| 7078 | + getPasteOptions: function getPasteOptions(sourceModel, targetContainer) { | |
| 7079 | + var result = {}; | |
| 7080 | + result.isValidChild = _this.utils.isValidChild(sourceModel, targetContainer.model); | |
| 7081 | + result.isSameElement = _this.utils.isSameElement(sourceModel, targetContainer); | |
| 7082 | + result.isValidGrandChild = _this.utils.isValidGrandChild(sourceModel, targetContainer); | |
| 7083 | + return result; | |
| 7084 | + }, | |
| 7085 | + isPasteEnabled: function isPasteEnabled(targetContainer) { | |
| 7086 | + var storage = elementorCommon.storage.get('clipboard'); // No storage? no paste. | |
| 7087 | + | |
| 7088 | + if (!storage || !storage[0]) { | |
| 7089 | + return false; | |
| 7090 | + } | |
| 7091 | + | |
| 7092 | + if (!(storage[0] instanceof Backbone.Model)) { | |
| 7093 | + storage[0] = new Backbone.Model(storage[0]); | |
| 7094 | + } | |
| 7095 | + | |
| 7096 | + var pasteOptions = _this.utils.getPasteOptions(storage[0], targetContainer); | |
| 7097 | + | |
| 7098 | + return Object.values(pasteOptions).some(function (opt) { | |
| 7099 | + return !!opt; | |
| 7100 | + }); | |
| 7101 | + } | |
| 7102 | + }; | |
| 7103 | + } | |
| 7104 | + }]); | |
| 7105 | + return Component; | |
| 7106 | +}(_componentBase.default); | |
| 7107 | + | |
| 7108 | +exports["default"] = Component; | |
| 7109 | + | |
| 7110 | +/***/ }), | |
| 7111 | + | |
| 7112 | +/***/ "../assets/dev/js/editor/document/globals/commands/base/disable-enable.js": | |
| 7113 | +/*!********************************************************************************!*\ | |
| 7114 | + !*** ../assets/dev/js/editor/document/globals/commands/base/disable-enable.js ***! | |
| 7115 | + \********************************************************************************/ | |
| 7116 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7117 | + | |
| 7118 | +"use strict"; | |
| 7119 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 7120 | + | |
| 7121 | + | |
| 7122 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7123 | + | |
| 7124 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7125 | + value: true | |
| 7126 | +})); | |
| 7127 | +exports["default"] = void 0; | |
| 7128 | + | |
| 7129 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7130 | + | |
| 7131 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7132 | + | |
| 7133 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7134 | + | |
| 7135 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7136 | + | |
| 7137 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7138 | + | |
| 7139 | +var _commandDisableEnable = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-disable-enable */ "../assets/dev/js/editor/document/commands/base/command-disable-enable.js")); | |
| 7140 | + | |
| 7141 | +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); }; } | |
| 7142 | + | |
| 7143 | +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; } } | |
| 7144 | + | |
| 7145 | +var DisableEnable = /*#__PURE__*/function (_CommandDisableEnable) { | |
| 7146 | + (0, _inherits2.default)(DisableEnable, _CommandDisableEnable); | |
| 7147 | + | |
| 7148 | + var _super = _createSuper(DisableEnable); | |
| 7149 | + | |
| 7150 | + function DisableEnable() { | |
| 7151 | + (0, _classCallCheck2.default)(this, DisableEnable); | |
| 7152 | + return _super.apply(this, arguments); | |
| 7153 | + } | |
| 7154 | + | |
| 7155 | + (0, _createClass2.default)(DisableEnable, [{ | |
| 7156 | + key: "getTitle", | |
| 7157 | + value: function getTitle() { | |
| 7158 | + return __('Global'); | |
| 7159 | + } | |
| 7160 | + }], [{ | |
| 7161 | + key: "getName", | |
| 7162 | + value: function getName() { | |
| 7163 | + return 'Global'; | |
| 7164 | + } | |
| 7165 | + }, { | |
| 7166 | + key: "getEnableCommand", | |
| 7167 | + value: function getEnableCommand() { | |
| 7168 | + return 'document/globals/enable'; | |
| 7169 | + } | |
| 7170 | + }, { | |
| 7171 | + key: "getDisableCommand", | |
| 7172 | + value: function getDisableCommand() { | |
| 7173 | + return 'document/globals/disable'; | |
| 7174 | + } | |
| 7175 | + }]); | |
| 7176 | + return DisableEnable; | |
| 7177 | +}(_commandDisableEnable.default); | |
| 7178 | + | |
| 7179 | +exports["default"] = DisableEnable; | |
| 7180 | + | |
| 7181 | +/***/ }), | |
| 7182 | + | |
| 7183 | +/***/ "../assets/dev/js/editor/document/globals/commands/disable.js": | |
| 7184 | +/*!********************************************************************!*\ | |
| 7185 | + !*** ../assets/dev/js/editor/document/globals/commands/disable.js ***! | |
| 7186 | + \********************************************************************/ | |
| 7187 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7188 | + | |
| 7189 | +"use strict"; | |
| 7190 | + | |
| 7191 | + | |
| 7192 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7193 | + | |
| 7194 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7195 | + value: true | |
| 7196 | +})); | |
| 7197 | +exports["default"] = exports.Disable = void 0; | |
| 7198 | + | |
| 7199 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 7200 | + | |
| 7201 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 7202 | + | |
| 7203 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 7204 | + | |
| 7205 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7206 | + | |
| 7207 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7208 | + | |
| 7209 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7210 | + | |
| 7211 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7212 | + | |
| 7213 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7214 | + | |
| 7215 | +var _disableEnable = _interopRequireDefault(__webpack_require__(/*! ./base/disable-enable */ "../assets/dev/js/editor/document/globals/commands/base/disable-enable.js")); | |
| 7216 | + | |
| 7217 | +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); }; } | |
| 7218 | + | |
| 7219 | +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; } } | |
| 7220 | + | |
| 7221 | +// TODO: Disable is the only command that extends DisableEnable which is async. | |
| 7222 | +var Disable = /*#__PURE__*/function (_DisableEnable) { | |
| 7223 | + (0, _inherits2.default)(Disable, _DisableEnable); | |
| 7224 | + | |
| 7225 | + var _super = _createSuper(Disable); | |
| 7226 | + | |
| 7227 | + function Disable() { | |
| 7228 | + (0, _classCallCheck2.default)(this, Disable); | |
| 7229 | + return _super.apply(this, arguments); | |
| 7230 | + } | |
| 7231 | + | |
| 7232 | + (0, _createClass2.default)(Disable, [{ | |
| 7233 | + key: "apply", | |
| 7234 | + value: function () { | |
| 7235 | + var _apply = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(args) { | |
| 7236 | + var settings, _args$containers, containers, _args$options, options, all; | |
| 7237 | + | |
| 7238 | + return _regenerator.default.wrap(function _callee3$(_context3) { | |
| 7239 | + while (1) { | |
| 7240 | + switch (_context3.prev = _context3.next) { | |
| 7241 | + case 0: | |
| 7242 | + settings = args.settings, _args$containers = args.containers, containers = _args$containers === void 0 ? [args.container] : _args$containers, _args$options = args.options, options = _args$options === void 0 ? {} : _args$options; | |
| 7243 | + all = containers.map( /*#__PURE__*/function () { | |
| 7244 | + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2( | |
| 7245 | + /* Container */ | |
| 7246 | + container) { | |
| 7247 | + var promises; | |
| 7248 | + return _regenerator.default.wrap(function _callee2$(_context2) { | |
| 7249 | + while (1) { | |
| 7250 | + switch (_context2.prev = _context2.next) { | |
| 7251 | + case 0: | |
| 7252 | + container = container.lookup(); | |
| 7253 | + promises = []; // TODO rename `options.restore` => `options.unlink`. | |
| 7254 | + | |
| 7255 | + if (!options.restore) { | |
| 7256 | + _context2.next = 6; | |
| 7257 | + break; | |
| 7258 | + } | |
| 7259 | + | |
| 7260 | + promises = Object.entries(container.globals.attributes).map( /*#__PURE__*/function () { | |
| 7261 | + var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) { | |
| 7262 | + var _ref4, globalKey, globalValue; | |
| 7263 | + | |
| 7264 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 7265 | + while (1) { | |
| 7266 | + switch (_context.prev = _context.next) { | |
| 7267 | + case 0: | |
| 7268 | + _ref4 = (0, _slicedToArray2.default)(_ref2, 2), globalKey = _ref4[0], globalValue = _ref4[1]; | |
| 7269 | + | |
| 7270 | + if (globalValue) { | |
| 7271 | + _context.next = 3; | |
| 7272 | + break; | |
| 7273 | + } | |
| 7274 | + | |
| 7275 | + return _context.abrupt("return"); | |
| 7276 | + | |
| 7277 | + case 3: | |
| 7278 | + return _context.abrupt("return", $e.run('document/globals/unlink', { | |
| 7279 | + container: container, | |
| 7280 | + options: { | |
| 7281 | + external: true | |
| 7282 | + }, | |
| 7283 | + globalValue: globalValue, | |
| 7284 | + setting: globalKey | |
| 7285 | + })); | |
| 7286 | + | |
| 7287 | + case 4: | |
| 7288 | + case "end": | |
| 7289 | + return _context.stop(); | |
| 7290 | + } | |
| 7291 | + } | |
| 7292 | + }, _callee); | |
| 7293 | + })); | |
| 7294 | + | |
| 7295 | + return function (_x3) { | |
| 7296 | + return _ref3.apply(this, arguments); | |
| 7297 | + }; | |
| 7298 | + }()); | |
| 7299 | + _context2.next = 6; | |
| 7300 | + return Promise.all(promises); | |
| 7301 | + | |
| 7302 | + case 6: | |
| 7303 | + // Clear globals. | |
| 7304 | + Object.keys(settings).forEach(function (setting) { | |
| 7305 | + return container.globals.set(setting, ''); | |
| 7306 | + }); | |
| 7307 | + $e.internal('document/elements/set-settings', { | |
| 7308 | + container: container, | |
| 7309 | + settings: { | |
| 7310 | + __globals__: container.globals.toJSON() | |
| 7311 | + }, | |
| 7312 | + options: { | |
| 7313 | + renderUI: true | |
| 7314 | + } | |
| 7315 | + }); | |
| 7316 | + | |
| 7317 | + case 8: | |
| 7318 | + case "end": | |
| 7319 | + return _context2.stop(); | |
| 7320 | + } | |
| 7321 | + } | |
| 7322 | + }, _callee2); | |
| 7323 | + })); | |
| 7324 | + | |
| 7325 | + return function (_x2) { | |
| 7326 | + return _ref.apply(this, arguments); | |
| 7327 | + }; | |
| 7328 | + }()); | |
| 7329 | + _context3.next = 4; | |
| 7330 | + return Promise.all(all); | |
| 7331 | + | |
| 7332 | + case 4: | |
| 7333 | + case "end": | |
| 7334 | + return _context3.stop(); | |
| 7335 | + } | |
| 7336 | + } | |
| 7337 | + }, _callee3); | |
| 7338 | + })); | |
| 7339 | + | |
| 7340 | + function apply(_x) { | |
| 7341 | + return _apply.apply(this, arguments); | |
| 7342 | + } | |
| 7343 | + | |
| 7344 | + return apply; | |
| 7345 | + }() | |
| 7346 | + }]); | |
| 7347 | + return Disable; | |
| 7348 | +}(_disableEnable.default); | |
| 7349 | + | |
| 7350 | +exports.Disable = Disable; | |
| 7351 | +var _default = Disable; | |
| 7352 | +exports["default"] = _default; | |
| 7353 | + | |
| 7354 | +/***/ }), | |
| 7355 | + | |
| 7356 | +/***/ "../assets/dev/js/editor/document/globals/commands/enable.js": | |
| 7357 | +/*!*******************************************************************!*\ | |
| 7358 | + !*** ../assets/dev/js/editor/document/globals/commands/enable.js ***! | |
| 7359 | + \*******************************************************************/ | |
| 7360 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7361 | + | |
| 7362 | +"use strict"; | |
| 7363 | + | |
| 7364 | + | |
| 7365 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7366 | + | |
| 7367 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7368 | + value: true | |
| 7369 | +})); | |
| 7370 | +exports["default"] = exports.Enable = void 0; | |
| 7371 | + | |
| 7372 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7373 | + | |
| 7374 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7375 | + | |
| 7376 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7377 | + | |
| 7378 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7379 | + | |
| 7380 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7381 | + | |
| 7382 | +var _disableEnable = _interopRequireDefault(__webpack_require__(/*! ./base/disable-enable */ "../assets/dev/js/editor/document/globals/commands/base/disable-enable.js")); | |
| 7383 | + | |
| 7384 | +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); }; } | |
| 7385 | + | |
| 7386 | +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; } } | |
| 7387 | + | |
| 7388 | +// Run when a global control value is chosen while the active value is custom. | |
| 7389 | +var Enable = /*#__PURE__*/function (_DisableEnable) { | |
| 7390 | + (0, _inherits2.default)(Enable, _DisableEnable); | |
| 7391 | + | |
| 7392 | + var _super = _createSuper(Enable); | |
| 7393 | + | |
| 7394 | + function Enable() { | |
| 7395 | + (0, _classCallCheck2.default)(this, Enable); | |
| 7396 | + return _super.apply(this, arguments); | |
| 7397 | + } | |
| 7398 | + | |
| 7399 | + (0, _createClass2.default)(Enable, [{ | |
| 7400 | + key: "apply", | |
| 7401 | + value: function apply(args) { | |
| 7402 | + var settings = args.settings, | |
| 7403 | + _args$containers = args.containers, | |
| 7404 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 7405 | + containers.forEach(function (container) { | |
| 7406 | + container = container.lookup(); | |
| 7407 | + container.globals.set(settings); | |
| 7408 | + $e.internal('document/elements/set-settings', { | |
| 7409 | + container: container, | |
| 7410 | + settings: { | |
| 7411 | + __globals__: container.globals.toJSON() | |
| 7412 | + }, | |
| 7413 | + options: { | |
| 7414 | + renderUI: true | |
| 7415 | + } | |
| 7416 | + }); // Clear custom local settings. | |
| 7417 | + | |
| 7418 | + Object.values(container.getGroupRelatedControls(settings)).forEach(function (control) { | |
| 7419 | + container.settings.set(control.name, control.default); | |
| 7420 | + }); | |
| 7421 | + }); | |
| 7422 | + } | |
| 7423 | + }]); | |
| 7424 | + return Enable; | |
| 7425 | +}(_disableEnable.default); | |
| 7426 | + | |
| 7427 | +exports.Enable = Enable; | |
| 7428 | +var _default = Enable; | |
| 7429 | +exports["default"] = _default; | |
| 7430 | + | |
| 7431 | +/***/ }), | |
| 7432 | + | |
| 7433 | +/***/ "../assets/dev/js/editor/document/globals/commands/index.js": | |
| 7434 | +/*!******************************************************************!*\ | |
| 7435 | + !*** ../assets/dev/js/editor/document/globals/commands/index.js ***! | |
| 7436 | + \******************************************************************/ | |
| 7437 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7438 | + | |
| 7439 | +"use strict"; | |
| 7440 | + | |
| 7441 | + | |
| 7442 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7443 | + value: true | |
| 7444 | +})); | |
| 7445 | +Object.defineProperty(exports, "Disable", ({ | |
| 7446 | + enumerable: true, | |
| 7447 | + get: function get() { | |
| 7448 | + return _disable.Disable; | |
| 7449 | + } | |
| 7450 | +})); | |
| 7451 | +Object.defineProperty(exports, "Enable", ({ | |
| 7452 | + enumerable: true, | |
| 7453 | + get: function get() { | |
| 7454 | + return _enable.Enable; | |
| 7455 | + } | |
| 7456 | +})); | |
| 7457 | +Object.defineProperty(exports, "Settings", ({ | |
| 7458 | + enumerable: true, | |
| 7459 | + get: function get() { | |
| 7460 | + return _settings.Settings; | |
| 7461 | + } | |
| 7462 | +})); | |
| 7463 | +Object.defineProperty(exports, "Unlink", ({ | |
| 7464 | + enumerable: true, | |
| 7465 | + get: function get() { | |
| 7466 | + return _unlink.Unlink; | |
| 7467 | + } | |
| 7468 | +})); | |
| 7469 | + | |
| 7470 | +var _disable = __webpack_require__(/*! ./disable */ "../assets/dev/js/editor/document/globals/commands/disable.js"); | |
| 7471 | + | |
| 7472 | +var _enable = __webpack_require__(/*! ./enable */ "../assets/dev/js/editor/document/globals/commands/enable.js"); | |
| 7473 | + | |
| 7474 | +var _settings = __webpack_require__(/*! ./settings */ "../assets/dev/js/editor/document/globals/commands/settings.js"); | |
| 7475 | + | |
| 7476 | +var _unlink = __webpack_require__(/*! ./unlink */ "../assets/dev/js/editor/document/globals/commands/unlink.js"); | |
| 7477 | + | |
| 7478 | +/***/ }), | |
| 7479 | + | |
| 7480 | +/***/ "../assets/dev/js/editor/document/globals/commands/settings.js": | |
| 7481 | +/*!*********************************************************************!*\ | |
| 7482 | + !*** ../assets/dev/js/editor/document/globals/commands/settings.js ***! | |
| 7483 | + \*********************************************************************/ | |
| 7484 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7485 | + | |
| 7486 | +"use strict"; | |
| 7487 | + | |
| 7488 | + | |
| 7489 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7490 | + | |
| 7491 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7492 | + value: true | |
| 7493 | +})); | |
| 7494 | +exports["default"] = exports.Settings = void 0; | |
| 7495 | + | |
| 7496 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7497 | + | |
| 7498 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7499 | + | |
| 7500 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7501 | + | |
| 7502 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7503 | + | |
| 7504 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7505 | + | |
| 7506 | +var _commandHistoryDebounce = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history-debounce */ "../assets/dev/js/editor/document/commands/base/command-history-debounce.js")); | |
| 7507 | + | |
| 7508 | +var _settings = _interopRequireDefault(__webpack_require__(/*! elementor-document/elements/commands/settings */ "../assets/dev/js/editor/document/elements/commands/settings.js")); | |
| 7509 | + | |
| 7510 | +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); }; } | |
| 7511 | + | |
| 7512 | +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; } } | |
| 7513 | + | |
| 7514 | +var Settings = /*#__PURE__*/function (_CommandHistoryDeboun) { | |
| 7515 | + (0, _inherits2.default)(Settings, _CommandHistoryDeboun); | |
| 7516 | + | |
| 7517 | + var _super = _createSuper(Settings); | |
| 7518 | + | |
| 7519 | + function Settings() { | |
| 7520 | + (0, _classCallCheck2.default)(this, Settings); | |
| 7521 | + return _super.apply(this, arguments); | |
| 7522 | + } | |
| 7523 | + | |
| 7524 | + (0, _createClass2.default)(Settings, [{ | |
| 7525 | + key: "validateArgs", | |
| 7526 | + value: function validateArgs(args) { | |
| 7527 | + this.requireContainer(args); | |
| 7528 | + this.requireArgumentConstructor('settings', Object, args); | |
| 7529 | + } | |
| 7530 | + }, { | |
| 7531 | + key: "getHistory", | |
| 7532 | + value: function getHistory(args) { | |
| 7533 | + var settings = args.settings, | |
| 7534 | + _args$containers = args.containers, | |
| 7535 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 7536 | + changes = {}; | |
| 7537 | + containers.forEach(function (container) { | |
| 7538 | + var id = container.id; | |
| 7539 | + | |
| 7540 | + if (!changes[id]) { | |
| 7541 | + changes[id] = {}; | |
| 7542 | + } | |
| 7543 | + | |
| 7544 | + changes[id] = { | |
| 7545 | + old: container.globals.toJSON(), | |
| 7546 | + new: settings | |
| 7547 | + }; | |
| 7548 | + }); | |
| 7549 | + | |
| 7550 | + var subTitle = _settings.default.getSubTitle(args); | |
| 7551 | + | |
| 7552 | + return { | |
| 7553 | + containers: containers, | |
| 7554 | + subTitle: subTitle, | |
| 7555 | + data: { | |
| 7556 | + changes: changes | |
| 7557 | + }, | |
| 7558 | + type: 'change', | |
| 7559 | + restore: this.constructor.restore | |
| 7560 | + }; | |
| 7561 | + } | |
| 7562 | + }, { | |
| 7563 | + key: "apply", | |
| 7564 | + value: function apply(args) { | |
| 7565 | + var settings = args.settings, | |
| 7566 | + _args$containers2 = args.containers, | |
| 7567 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 7568 | + _args$options = args.options, | |
| 7569 | + options = _args$options === void 0 ? {} : _args$options; | |
| 7570 | + containers.forEach(function (container) { | |
| 7571 | + container = container.lookup(); | |
| 7572 | + | |
| 7573 | + if (!Object.keys(settings).length) { | |
| 7574 | + container.globals.clear(); | |
| 7575 | + } else { | |
| 7576 | + container.globals.set(settings); | |
| 7577 | + } | |
| 7578 | + | |
| 7579 | + $e.internal('document/elements/set-settings', { | |
| 7580 | + container: container, | |
| 7581 | + options: options, | |
| 7582 | + settings: { | |
| 7583 | + __globals__: container.globals.toJSON() | |
| 7584 | + } | |
| 7585 | + }); | |
| 7586 | + }); | |
| 7587 | + } | |
| 7588 | + }, { | |
| 7589 | + key: "isDataChanged", | |
| 7590 | + value: function isDataChanged() { | |
| 7591 | + return true; | |
| 7592 | + } | |
| 7593 | + }], [{ | |
| 7594 | + key: "restore", | |
| 7595 | + value: function restore(historyItem, isRedo) { | |
| 7596 | + var data = historyItem.get('data'); | |
| 7597 | + historyItem.get('containers').forEach(function (container) { | |
| 7598 | + var changes = data.changes[container.id]; | |
| 7599 | + $e.run('document/globals/settings', { | |
| 7600 | + container: container, | |
| 7601 | + settings: isRedo ? changes.new : changes.old | |
| 7602 | + }); | |
| 7603 | + container.panel.refresh(); | |
| 7604 | + }); | |
| 7605 | + } | |
| 7606 | + }]); | |
| 7607 | + return Settings; | |
| 7608 | +}(_commandHistoryDebounce.default); | |
| 7609 | + | |
| 7610 | +exports.Settings = Settings; | |
| 7611 | +var _default = Settings; | |
| 7612 | +exports["default"] = _default; | |
| 7613 | + | |
| 7614 | +/***/ }), | |
| 7615 | + | |
| 7616 | +/***/ "../assets/dev/js/editor/document/globals/commands/unlink.js": | |
| 7617 | +/*!*******************************************************************!*\ | |
| 7618 | + !*** ../assets/dev/js/editor/document/globals/commands/unlink.js ***! | |
| 7619 | + \*******************************************************************/ | |
| 7620 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7621 | + | |
| 7622 | +"use strict"; | |
| 7623 | + | |
| 7624 | + | |
| 7625 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7626 | + | |
| 7627 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7628 | + value: true | |
| 7629 | +})); | |
| 7630 | +exports["default"] = exports.Unlink = void 0; | |
| 7631 | + | |
| 7632 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 7633 | + | |
| 7634 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 7635 | + | |
| 7636 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 7637 | + | |
| 7638 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7639 | + | |
| 7640 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7641 | + | |
| 7642 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7643 | + | |
| 7644 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7645 | + | |
| 7646 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7647 | + | |
| 7648 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 7649 | + | |
| 7650 | +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); }; } | |
| 7651 | + | |
| 7652 | +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; } } | |
| 7653 | + | |
| 7654 | +// TODO: Add dev-tools CSS to see if widget have globals. | |
| 7655 | +var Unlink = /*#__PURE__*/function (_CommandBase) { | |
| 7656 | + (0, _inherits2.default)(Unlink, _CommandBase); | |
| 7657 | + | |
| 7658 | + var _super = _createSuper(Unlink); | |
| 7659 | + | |
| 7660 | + function Unlink() { | |
| 7661 | + (0, _classCallCheck2.default)(this, Unlink); | |
| 7662 | + return _super.apply(this, arguments); | |
| 7663 | + } | |
| 7664 | + | |
| 7665 | + (0, _createClass2.default)(Unlink, [{ | |
| 7666 | + key: "validateArgs", | |
| 7667 | + value: function validateArgs() { | |
| 7668 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 7669 | + this.requireContainer(args); | |
| 7670 | + this.requireArgumentType('setting', 'string', args); | |
| 7671 | + this.requireArgumentType('globalValue', 'string', args); // TODO: validate global value is command format. | |
| 7672 | + } | |
| 7673 | + }, { | |
| 7674 | + key: "apply", | |
| 7675 | + value: function () { | |
| 7676 | + var _apply = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(args) { | |
| 7677 | + var _args$containers, containers, setting, globalValue, _args$options, options, localSettings; | |
| 7678 | + | |
| 7679 | + return _regenerator.default.wrap(function _callee2$(_context2) { | |
| 7680 | + while (1) { | |
| 7681 | + switch (_context2.prev = _context2.next) { | |
| 7682 | + case 0: | |
| 7683 | + _args$containers = args.containers, containers = _args$containers === void 0 ? [args.container] : _args$containers, setting = args.setting, globalValue = args.globalValue, _args$options = args.options, options = _args$options === void 0 ? {} : _args$options, localSettings = {}; | |
| 7684 | + _context2.next = 3; | |
| 7685 | + return Promise.all(containers.map( /*#__PURE__*/function () { | |
| 7686 | + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee( | |
| 7687 | + /* Container */ | |
| 7688 | + container) { | |
| 7689 | + var result, _container$controls$s, value, groupPrefix; | |
| 7690 | + | |
| 7691 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 7692 | + while (1) { | |
| 7693 | + switch (_context.prev = _context.next) { | |
| 7694 | + case 0: | |
| 7695 | + _context.next = 2; | |
| 7696 | + return $e.data.get(globalValue); | |
| 7697 | + | |
| 7698 | + case 2: | |
| 7699 | + result = _context.sent; | |
| 7700 | + | |
| 7701 | + if (result) { | |
| 7702 | + // Prepare global value to mapping. | |
| 7703 | + value = result.data.value, groupPrefix = (_container$controls$s = container.controls[setting]) === null || _container$controls$s === void 0 ? void 0 : _container$controls$s.groupPrefix; | |
| 7704 | + | |
| 7705 | + if (groupPrefix) { | |
| 7706 | + Object.entries(value).forEach(function (_ref2) { | |
| 7707 | + var _ref3 = (0, _slicedToArray2.default)(_ref2, 2), | |
| 7708 | + dataKey = _ref3[0], | |
| 7709 | + dataValue = _ref3[1]; | |
| 7710 | + | |
| 7711 | + dataKey = dataKey.replace(elementor.config.kit_config.typography_prefix, groupPrefix); | |
| 7712 | + localSettings[dataKey] = dataValue; | |
| 7713 | + }); | |
| 7714 | + } else { | |
| 7715 | + localSettings[setting] = value; | |
| 7716 | + } | |
| 7717 | + } | |
| 7718 | + | |
| 7719 | + return _context.abrupt("return", Promise.resolve()); | |
| 7720 | + | |
| 7721 | + case 5: | |
| 7722 | + case "end": | |
| 7723 | + return _context.stop(); | |
| 7724 | + } | |
| 7725 | + } | |
| 7726 | + }, _callee); | |
| 7727 | + })); | |
| 7728 | + | |
| 7729 | + return function (_x2) { | |
| 7730 | + return _ref.apply(this, arguments); | |
| 7731 | + }; | |
| 7732 | + }())); | |
| 7733 | + | |
| 7734 | + case 3: | |
| 7735 | + // Restore globals settings as custom local settings. | |
| 7736 | + if (Object.keys(localSettings).length) { | |
| 7737 | + $e.run('document/elements/settings', { | |
| 7738 | + containers: containers, | |
| 7739 | + options: options, | |
| 7740 | + settings: localSettings | |
| 7741 | + }); | |
| 7742 | + } | |
| 7743 | + | |
| 7744 | + case 4: | |
| 7745 | + case "end": | |
| 7746 | + return _context2.stop(); | |
| 7747 | + } | |
| 7748 | + } | |
| 7749 | + }, _callee2); | |
| 7750 | + })); | |
| 7751 | + | |
| 7752 | + function apply(_x) { | |
| 7753 | + return _apply.apply(this, arguments); | |
| 7754 | + } | |
| 7755 | + | |
| 7756 | + return apply; | |
| 7757 | + }() | |
| 7758 | + }, { | |
| 7759 | + key: "isDataChanged", | |
| 7760 | + value: function isDataChanged() { | |
| 7761 | + return true; | |
| 7762 | + } | |
| 7763 | + }]); | |
| 7764 | + return Unlink; | |
| 7765 | +}(_commandBase.default); | |
| 7766 | + | |
| 7767 | +exports.Unlink = Unlink; | |
| 7768 | +var _default = Unlink; | |
| 7769 | +exports["default"] = _default; | |
| 7770 | + | |
| 7771 | +/***/ }), | |
| 7772 | + | |
| 7773 | +/***/ "../assets/dev/js/editor/document/globals/component.js": | |
| 7774 | +/*!*************************************************************!*\ | |
| 7775 | + !*** ../assets/dev/js/editor/document/globals/component.js ***! | |
| 7776 | + \*************************************************************/ | |
| 7777 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7778 | + | |
| 7779 | +"use strict"; | |
| 7780 | + | |
| 7781 | + | |
| 7782 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7783 | + | |
| 7784 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 7785 | + | |
| 7786 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7787 | + value: true | |
| 7788 | +})); | |
| 7789 | +exports["default"] = void 0; | |
| 7790 | + | |
| 7791 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7792 | + | |
| 7793 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7794 | + | |
| 7795 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7796 | + | |
| 7797 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7798 | + | |
| 7799 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7800 | + | |
| 7801 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 7802 | + | |
| 7803 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/document/globals/commands/index.js")); | |
| 7804 | + | |
| 7805 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 7806 | + | |
| 7807 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 7808 | + | |
| 7809 | +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); }; } | |
| 7810 | + | |
| 7811 | +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; } } | |
| 7812 | + | |
| 7813 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 7814 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 7815 | + | |
| 7816 | + var _super = _createSuper(Component); | |
| 7817 | + | |
| 7818 | + function Component() { | |
| 7819 | + (0, _classCallCheck2.default)(this, Component); | |
| 7820 | + return _super.apply(this, arguments); | |
| 7821 | + } | |
| 7822 | + | |
| 7823 | + (0, _createClass2.default)(Component, [{ | |
| 7824 | + key: "getNamespace", | |
| 7825 | + value: function getNamespace() { | |
| 7826 | + return 'document/globals'; | |
| 7827 | + } | |
| 7828 | + }, { | |
| 7829 | + key: "defaultCommands", | |
| 7830 | + value: function defaultCommands() { | |
| 7831 | + return this.importCommands(commands); | |
| 7832 | + } | |
| 7833 | + }]); | |
| 7834 | + return Component; | |
| 7835 | +}(_componentBase.default); | |
| 7836 | + | |
| 7837 | +exports["default"] = Component; | |
| 7838 | + | |
| 7839 | +/***/ }), | |
| 7840 | + | |
| 7841 | +/***/ "../assets/dev/js/editor/document/history/commands/base/base.js": | |
| 7842 | +/*!**********************************************************************!*\ | |
| 7843 | + !*** ../assets/dev/js/editor/document/history/commands/base/base.js ***! | |
| 7844 | + \**********************************************************************/ | |
| 7845 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7846 | + | |
| 7847 | +"use strict"; | |
| 7848 | + | |
| 7849 | + | |
| 7850 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7851 | + | |
| 7852 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7853 | + value: true | |
| 7854 | +})); | |
| 7855 | +exports["default"] = void 0; | |
| 7856 | + | |
| 7857 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7858 | + | |
| 7859 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7860 | + | |
| 7861 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 7862 | + | |
| 7863 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7864 | + | |
| 7865 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7866 | + | |
| 7867 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7868 | + | |
| 7869 | +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js")); | |
| 7870 | + | |
| 7871 | +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); }; } | |
| 7872 | + | |
| 7873 | +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; } } | |
| 7874 | + | |
| 7875 | +/** | |
| 7876 | + * @typedef {import('../../../../../../../../modules/history/assets/js/history/manager')} HistoryManager | |
| 7877 | + */ | |
| 7878 | +var Base = /*#__PURE__*/function (_CommandInternalBase) { | |
| 7879 | + (0, _inherits2.default)(Base, _CommandInternalBase); | |
| 7880 | + | |
| 7881 | + var _super = _createSuper(Base); | |
| 7882 | + | |
| 7883 | + function Base() { | |
| 7884 | + (0, _classCallCheck2.default)(this, Base); | |
| 7885 | + return _super.apply(this, arguments); | |
| 7886 | + } | |
| 7887 | + | |
| 7888 | + (0, _createClass2.default)(Base, [{ | |
| 7889 | + key: "initialize", | |
| 7890 | + value: function initialize(args) { | |
| 7891 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Base.prototype), "initialize", this).call(this, args); | |
| 7892 | + /** | |
| 7893 | + * @type {HistoryManager} | |
| 7894 | + */ | |
| 7895 | + | |
| 7896 | + this.history = elementor.documents.getCurrent().history; | |
| 7897 | + } | |
| 7898 | + }]); | |
| 7899 | + return Base; | |
| 7900 | +}(_commandInternalBase.default); | |
| 7901 | + | |
| 7902 | +exports["default"] = Base; | |
| 7903 | + | |
| 7904 | +/***/ }), | |
| 7905 | + | |
| 7906 | +/***/ "../assets/dev/js/editor/document/history/commands/do.js": | |
| 7907 | +/*!***************************************************************!*\ | |
| 7908 | + !*** ../assets/dev/js/editor/document/history/commands/do.js ***! | |
| 7909 | + \***************************************************************/ | |
| 7910 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7911 | + | |
| 7912 | +"use strict"; | |
| 7913 | + | |
| 7914 | + | |
| 7915 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7916 | + | |
| 7917 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7918 | + value: true | |
| 7919 | +})); | |
| 7920 | +exports["default"] = exports.Do = void 0; | |
| 7921 | + | |
| 7922 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7923 | + | |
| 7924 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7925 | + | |
| 7926 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7927 | + | |
| 7928 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7929 | + | |
| 7930 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7931 | + | |
| 7932 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 7933 | + | |
| 7934 | +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); }; } | |
| 7935 | + | |
| 7936 | +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; } } | |
| 7937 | + | |
| 7938 | +var Do = /*#__PURE__*/function (_CommandBase) { | |
| 7939 | + (0, _inherits2.default)(Do, _CommandBase); | |
| 7940 | + | |
| 7941 | + var _super = _createSuper(Do); | |
| 7942 | + | |
| 7943 | + function Do() { | |
| 7944 | + (0, _classCallCheck2.default)(this, Do); | |
| 7945 | + return _super.apply(this, arguments); | |
| 7946 | + } | |
| 7947 | + | |
| 7948 | + (0, _createClass2.default)(Do, [{ | |
| 7949 | + key: "apply", | |
| 7950 | + value: function apply(args) { | |
| 7951 | + var index = args.index; | |
| 7952 | + return elementor.documents.getCurrent().history.doItem(index); | |
| 7953 | + } | |
| 7954 | + }]); | |
| 7955 | + return Do; | |
| 7956 | +}(_commandBase.default); | |
| 7957 | + | |
| 7958 | +exports.Do = Do; | |
| 7959 | +var _default = Do; | |
| 7960 | +exports["default"] = _default; | |
| 7961 | + | |
| 7962 | +/***/ }), | |
| 7963 | + | |
| 7964 | +/***/ "../assets/dev/js/editor/document/history/commands/index.js": | |
| 7965 | +/*!******************************************************************!*\ | |
| 7966 | + !*** ../assets/dev/js/editor/document/history/commands/index.js ***! | |
| 7967 | + \******************************************************************/ | |
| 7968 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7969 | + | |
| 7970 | +"use strict"; | |
| 7971 | + | |
| 7972 | + | |
| 7973 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7974 | + value: true | |
| 7975 | +})); | |
| 7976 | +Object.defineProperty(exports, "Do", ({ | |
| 7977 | + enumerable: true, | |
| 7978 | + get: function get() { | |
| 7979 | + return _do.Do; | |
| 7980 | + } | |
| 7981 | +})); | |
| 7982 | +Object.defineProperty(exports, "Redo", ({ | |
| 7983 | + enumerable: true, | |
| 7984 | + get: function get() { | |
| 7985 | + return _redo.Redo; | |
| 7986 | + } | |
| 7987 | +})); | |
| 7988 | +Object.defineProperty(exports, "Undo", ({ | |
| 7989 | + enumerable: true, | |
| 7990 | + get: function get() { | |
| 7991 | + return _undo.Undo; | |
| 7992 | + } | |
| 7993 | +})); | |
| 7994 | +Object.defineProperty(exports, "UndoAll", ({ | |
| 7995 | + enumerable: true, | |
| 7996 | + get: function get() { | |
| 7997 | + return _undoAll.UndoAll; | |
| 7998 | + } | |
| 7999 | +})); | |
| 8000 | + | |
| 8001 | +var _do = __webpack_require__(/*! ./do */ "../assets/dev/js/editor/document/history/commands/do.js"); | |
| 8002 | + | |
| 8003 | +var _redo = __webpack_require__(/*! ./redo */ "../assets/dev/js/editor/document/history/commands/redo.js"); | |
| 8004 | + | |
| 8005 | +var _undo = __webpack_require__(/*! ./undo */ "../assets/dev/js/editor/document/history/commands/undo.js"); | |
| 8006 | + | |
| 8007 | +var _undoAll = __webpack_require__(/*! ./undo-all */ "../assets/dev/js/editor/document/history/commands/undo-all.js"); | |
| 8008 | + | |
| 8009 | +/***/ }), | |
| 8010 | + | |
| 8011 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/add-transaction.js": | |
| 8012 | +/*!*************************************************************************************!*\ | |
| 8013 | + !*** ../assets/dev/js/editor/document/history/commands/internal/add-transaction.js ***! | |
| 8014 | + \*************************************************************************************/ | |
| 8015 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8016 | + | |
| 8017 | +"use strict"; | |
| 8018 | + | |
| 8019 | + | |
| 8020 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8021 | + | |
| 8022 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8023 | + value: true | |
| 8024 | +})); | |
| 8025 | +exports["default"] = exports.AddTransaction = void 0; | |
| 8026 | + | |
| 8027 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8028 | + | |
| 8029 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8030 | + | |
| 8031 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 8032 | + | |
| 8033 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8034 | + | |
| 8035 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8036 | + | |
| 8037 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8038 | + | |
| 8039 | +var _base = _interopRequireDefault(__webpack_require__(/*! ../base/base */ "../assets/dev/js/editor/document/history/commands/base/base.js")); | |
| 8040 | + | |
| 8041 | +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); }; } | |
| 8042 | + | |
| 8043 | +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; } } | |
| 8044 | + | |
| 8045 | +var AddTransaction = /*#__PURE__*/function (_Base) { | |
| 8046 | + (0, _inherits2.default)(AddTransaction, _Base); | |
| 8047 | + | |
| 8048 | + var _super = _createSuper(AddTransaction); | |
| 8049 | + | |
| 8050 | + function AddTransaction() { | |
| 8051 | + (0, _classCallCheck2.default)(this, AddTransaction); | |
| 8052 | + return _super.apply(this, arguments); | |
| 8053 | + } | |
| 8054 | + | |
| 8055 | + (0, _createClass2.default)(AddTransaction, [{ | |
| 8056 | + key: "initialize", | |
| 8057 | + value: function initialize(args) { | |
| 8058 | + (0, _get2.default)((0, _getPrototypeOf2.default)(AddTransaction.prototype), "initialize", this).call(this, args); | |
| 8059 | + /** | |
| 8060 | + * Debounce always send 'add-transaction' with title & subTitle, when the transaction | |
| 8061 | + * already started, there is no need to save those args they are useless. | |
| 8062 | + */ | |
| 8063 | + | |
| 8064 | + if (this.component.isTransactionStarted()) { | |
| 8065 | + delete args.title; | |
| 8066 | + delete args.subTitle; | |
| 8067 | + } | |
| 8068 | + } | |
| 8069 | + }, { | |
| 8070 | + key: "validateArgs", | |
| 8071 | + value: function validateArgs(args) { | |
| 8072 | + this.requireContainer(); | |
| 8073 | + this.requireArgumentType('type', 'string', args); | |
| 8074 | + } | |
| 8075 | + }, { | |
| 8076 | + key: "apply", | |
| 8077 | + value: function apply(args) { | |
| 8078 | + var currentId = this.history.getCurrentId(); | |
| 8079 | + | |
| 8080 | + if (currentId) { | |
| 8081 | + // If log already started chain his historyId. | |
| 8082 | + args.id = currentId; | |
| 8083 | + } | |
| 8084 | + | |
| 8085 | + args = this.component.normalizeLogTitle(args); | |
| 8086 | + this.component.transactions.push(args); | |
| 8087 | + } | |
| 8088 | + }]); | |
| 8089 | + return AddTransaction; | |
| 8090 | +}(_base.default); | |
| 8091 | + | |
| 8092 | +exports.AddTransaction = AddTransaction; | |
| 8093 | +var _default = AddTransaction; | |
| 8094 | +exports["default"] = _default; | |
| 8095 | + | |
| 8096 | +/***/ }), | |
| 8097 | + | |
| 8098 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/clear-transaction.js": | |
| 258 | 8099 | /*!***************************************************************************************!*\ |
| 259 | - !*** ../assets/dev/js/editor/document/command-bases/command-history-debounce-base.js ***! | |
| 8100 | + !*** ../assets/dev/js/editor/document/history/commands/internal/clear-transaction.js ***! | |
| 260 | 8101 | \***************************************************************************************/ |
| 261 | 8102 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 262 | 8103 | |
| 263 | 8104 | "use strict"; |
| @@ -263,123 +8104,10247 @@ | ||
| 263 | 8104 | "use strict"; |
| 264 | 8105 | |
| 265 | 8106 | |
| 266 | 8107 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 8108 | + | |
| 267 | 8109 | Object.defineProperty(exports, "__esModule", ({ |
| 268 | 8110 | value: true |
| 269 | 8111 | })); |
| 270 | -exports.getDefaultDebounceDelay = exports["default"] = exports.DEFAULT_DEBOUNCE_DELAY = void 0; | |
| 8112 | +exports["default"] = exports.ClearTransaction = void 0; | |
| 8113 | + | |
| 271 | 8114 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 8115 | + | |
| 272 | 8116 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 8117 | + | |
| 8118 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8119 | + | |
| 273 | 8120 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 8121 | + | |
| 274 | 8122 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 8123 | + | |
| 8124 | +var _base = _interopRequireDefault(__webpack_require__(/*! ../base/base */ "../assets/dev/js/editor/document/history/commands/base/base.js")); | |
| 8125 | + | |
| 8126 | +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); }; } | |
| 8127 | + | |
| 8128 | +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; } } | |
| 8129 | + | |
| 8130 | +var ClearTransaction = /*#__PURE__*/function (_Base) { | |
| 8131 | + (0, _inherits2.default)(ClearTransaction, _Base); | |
| 8132 | + | |
| 8133 | + var _super = _createSuper(ClearTransaction); | |
| 8134 | + | |
| 8135 | + function ClearTransaction() { | |
| 8136 | + (0, _classCallCheck2.default)(this, ClearTransaction); | |
| 8137 | + return _super.apply(this, arguments); | |
| 8138 | + } | |
| 8139 | + | |
| 8140 | + (0, _createClass2.default)(ClearTransaction, [{ | |
| 8141 | + key: "apply", | |
| 8142 | + value: function apply() { | |
| 8143 | + this.component.transactions = []; | |
| 8144 | + } | |
| 8145 | + }]); | |
| 8146 | + return ClearTransaction; | |
| 8147 | +}(_base.default); | |
| 8148 | + | |
| 8149 | +exports.ClearTransaction = ClearTransaction; | |
| 8150 | +var _default = ClearTransaction; | |
| 8151 | +exports["default"] = _default; | |
| 8152 | + | |
| 8153 | +/***/ }), | |
| 8154 | + | |
| 8155 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/delete-log.js": | |
| 8156 | +/*!********************************************************************************!*\ | |
| 8157 | + !*** ../assets/dev/js/editor/document/history/commands/internal/delete-log.js ***! | |
| 8158 | + \********************************************************************************/ | |
| 8159 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8160 | + | |
| 8161 | +"use strict"; | |
| 8162 | + | |
| 8163 | + | |
| 8164 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8165 | + | |
| 8166 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8167 | + value: true | |
| 8168 | +})); | |
| 8169 | +exports["default"] = exports.DeleteLog = void 0; | |
| 8170 | + | |
| 8171 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8172 | + | |
| 8173 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8174 | + | |
| 8175 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8176 | + | |
| 8177 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8178 | + | |
| 8179 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8180 | + | |
| 8181 | +var _base = _interopRequireDefault(__webpack_require__(/*! ../base/base */ "../assets/dev/js/editor/document/history/commands/base/base.js")); | |
| 8182 | + | |
| 8183 | +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); }; } | |
| 8184 | + | |
| 8185 | +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; } } | |
| 8186 | + | |
| 8187 | +var DeleteLog = /*#__PURE__*/function (_Base) { | |
| 8188 | + (0, _inherits2.default)(DeleteLog, _Base); | |
| 8189 | + | |
| 8190 | + var _super = _createSuper(DeleteLog); | |
| 8191 | + | |
| 8192 | + function DeleteLog() { | |
| 8193 | + (0, _classCallCheck2.default)(this, DeleteLog); | |
| 8194 | + return _super.apply(this, arguments); | |
| 8195 | + } | |
| 8196 | + | |
| 8197 | + (0, _createClass2.default)(DeleteLog, [{ | |
| 8198 | + key: "apply", | |
| 8199 | + value: function apply(args) { | |
| 8200 | + if (args.id) { | |
| 8201 | + this.history.deleteItem(args.id); | |
| 8202 | + } | |
| 8203 | + } | |
| 8204 | + }]); | |
| 8205 | + return DeleteLog; | |
| 8206 | +}(_base.default); | |
| 8207 | + | |
| 8208 | +exports.DeleteLog = DeleteLog; | |
| 8209 | +var _default = DeleteLog; | |
| 8210 | +exports["default"] = _default; | |
| 8211 | + | |
| 8212 | +/***/ }), | |
| 8213 | + | |
| 8214 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/end-log.js": | |
| 8215 | +/*!*****************************************************************************!*\ | |
| 8216 | + !*** ../assets/dev/js/editor/document/history/commands/internal/end-log.js ***! | |
| 8217 | + \*****************************************************************************/ | |
| 8218 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8219 | + | |
| 8220 | +"use strict"; | |
| 8221 | + | |
| 8222 | + | |
| 8223 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8224 | + | |
| 8225 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8226 | + value: true | |
| 8227 | +})); | |
| 8228 | +exports["default"] = exports.EndLog = void 0; | |
| 8229 | + | |
| 8230 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8231 | + | |
| 8232 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8233 | + | |
| 8234 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8235 | + | |
| 8236 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8237 | + | |
| 8238 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8239 | + | |
| 8240 | +var _base = _interopRequireDefault(__webpack_require__(/*! ../base/base */ "../assets/dev/js/editor/document/history/commands/base/base.js")); | |
| 8241 | + | |
| 8242 | +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); }; } | |
| 8243 | + | |
| 8244 | +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; } } | |
| 8245 | + | |
| 8246 | +var EndLog = /*#__PURE__*/function (_Base) { | |
| 8247 | + (0, _inherits2.default)(EndLog, _Base); | |
| 8248 | + | |
| 8249 | + var _super = _createSuper(EndLog); | |
| 8250 | + | |
| 8251 | + function EndLog() { | |
| 8252 | + (0, _classCallCheck2.default)(this, EndLog); | |
| 8253 | + return _super.apply(this, arguments); | |
| 8254 | + } | |
| 8255 | + | |
| 8256 | + (0, _createClass2.default)(EndLog, [{ | |
| 8257 | + key: "apply", | |
| 8258 | + value: function apply(args) { | |
| 8259 | + if (args.id) { | |
| 8260 | + this.history.endItem(args.id); | |
| 8261 | + } | |
| 8262 | + } | |
| 8263 | + }]); | |
| 8264 | + return EndLog; | |
| 8265 | +}(_base.default); | |
| 8266 | + | |
| 8267 | +exports.EndLog = EndLog; | |
| 8268 | +var _default = EndLog; | |
| 8269 | +exports["default"] = _default; | |
| 8270 | + | |
| 8271 | +/***/ }), | |
| 8272 | + | |
| 8273 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/end-transaction.js": | |
| 8274 | +/*!*************************************************************************************!*\ | |
| 8275 | + !*** ../assets/dev/js/editor/document/history/commands/internal/end-transaction.js ***! | |
| 8276 | + \*************************************************************************************/ | |
| 8277 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8278 | + | |
| 8279 | +"use strict"; | |
| 8280 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 8281 | + | |
| 8282 | + | |
| 8283 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8284 | + | |
| 8285 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8286 | + value: true | |
| 8287 | +})); | |
| 8288 | +exports["default"] = exports.EndTransaction = void 0; | |
| 8289 | + | |
| 8290 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8291 | + | |
| 8292 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8293 | + | |
| 8294 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8295 | + | |
| 8296 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8297 | + | |
| 8298 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8299 | + | |
| 8300 | +var _base = _interopRequireDefault(__webpack_require__(/*! ../base/base */ "../assets/dev/js/editor/document/history/commands/base/base.js")); | |
| 8301 | + | |
| 8302 | +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); }; } | |
| 8303 | + | |
| 8304 | +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; } } | |
| 8305 | + | |
| 8306 | +var EndTransaction = /*#__PURE__*/function (_Base) { | |
| 8307 | + (0, _inherits2.default)(EndTransaction, _Base); | |
| 8308 | + | |
| 8309 | + var _super = _createSuper(EndTransaction); | |
| 8310 | + | |
| 8311 | + function EndTransaction() { | |
| 8312 | + (0, _classCallCheck2.default)(this, EndTransaction); | |
| 8313 | + return _super.apply(this, arguments); | |
| 8314 | + } | |
| 8315 | + | |
| 8316 | + (0, _createClass2.default)(EndTransaction, [{ | |
| 8317 | + key: "apply", | |
| 8318 | + value: function apply() { | |
| 8319 | + if (!this.component.isTransactionStarted()) { | |
| 8320 | + return; | |
| 8321 | + } | |
| 8322 | + | |
| 8323 | + var firstItem = this.component.transactions[0], | |
| 8324 | + type = firstItem.type, | |
| 8325 | + transactions = this.component.mergeTransactions(this.component.transactions); | |
| 8326 | + var _firstItem$title = firstItem.title, | |
| 8327 | + title = _firstItem$title === void 0 ? '' : _firstItem$title, | |
| 8328 | + _firstItem$subTitle = firstItem.subTitle, | |
| 8329 | + subTitle = _firstItem$subTitle === void 0 ? '' : _firstItem$subTitle; // 'elements' title for multiple containers. | |
| 8330 | + | |
| 8331 | + if (transactions.length > 1) { | |
| 8332 | + title = __('Elements', 'elementor'); | |
| 8333 | + subTitle = ''; | |
| 8334 | + } | |
| 8335 | + | |
| 8336 | + var history = { | |
| 8337 | + title: title, | |
| 8338 | + subTitle: subTitle, | |
| 8339 | + type: type | |
| 8340 | + }; // If firstItem have id already it means that log already started for that transaction. | |
| 8341 | + | |
| 8342 | + if (firstItem.id) { | |
| 8343 | + history.id = firstItem.id; | |
| 8344 | + } | |
| 8345 | + | |
| 8346 | + var historyId = $e.internal('document/history/start-log', history); | |
| 8347 | + Object.values(transactions).forEach(function (item) { | |
| 8348 | + var itemArgs = item; // If log already started chain his historyId. | |
| 8349 | + | |
| 8350 | + if (firstItem.id) { | |
| 8351 | + itemArgs.id = firstItem.id; | |
| 8352 | + } | |
| 8353 | + | |
| 8354 | + $e.internal('document/history/log-sub-item', itemArgs); | |
| 8355 | + }); | |
| 8356 | + $e.internal('document/history/end-log', { | |
| 8357 | + id: historyId | |
| 8358 | + }); // Clear transactions before leave. | |
| 8359 | + | |
| 8360 | + $e.internal('document/history/clear-transaction'); | |
| 8361 | + } | |
| 8362 | + }]); | |
| 8363 | + return EndTransaction; | |
| 8364 | +}(_base.default); | |
| 8365 | + | |
| 8366 | +exports.EndTransaction = EndTransaction; | |
| 8367 | +var _default = EndTransaction; | |
| 8368 | +exports["default"] = _default; | |
| 8369 | + | |
| 8370 | +/***/ }), | |
| 8371 | + | |
| 8372 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/index.js": | |
| 8373 | +/*!***************************************************************************!*\ | |
| 8374 | + !*** ../assets/dev/js/editor/document/history/commands/internal/index.js ***! | |
| 8375 | + \***************************************************************************/ | |
| 8376 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8377 | + | |
| 8378 | +"use strict"; | |
| 8379 | + | |
| 8380 | + | |
| 8381 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8382 | + value: true | |
| 8383 | +})); | |
| 8384 | +Object.defineProperty(exports, "AddTransaction", ({ | |
| 8385 | + enumerable: true, | |
| 8386 | + get: function get() { | |
| 8387 | + return _addTransaction.AddTransaction; | |
| 8388 | + } | |
| 8389 | +})); | |
| 8390 | +Object.defineProperty(exports, "ClearTransaction", ({ | |
| 8391 | + enumerable: true, | |
| 8392 | + get: function get() { | |
| 8393 | + return _clearTransaction.ClearTransaction; | |
| 8394 | + } | |
| 8395 | +})); | |
| 8396 | +Object.defineProperty(exports, "DeleteLog", ({ | |
| 8397 | + enumerable: true, | |
| 8398 | + get: function get() { | |
| 8399 | + return _deleteLog.DeleteLog; | |
| 8400 | + } | |
| 8401 | +})); | |
| 8402 | +Object.defineProperty(exports, "EndLog", ({ | |
| 8403 | + enumerable: true, | |
| 8404 | + get: function get() { | |
| 8405 | + return _endLog.EndLog; | |
| 8406 | + } | |
| 8407 | +})); | |
| 8408 | +Object.defineProperty(exports, "EndTransaction", ({ | |
| 8409 | + enumerable: true, | |
| 8410 | + get: function get() { | |
| 8411 | + return _endTransaction.EndTransaction; | |
| 8412 | + } | |
| 8413 | +})); | |
| 8414 | +Object.defineProperty(exports, "LogSubItem", ({ | |
| 8415 | + enumerable: true, | |
| 8416 | + get: function get() { | |
| 8417 | + return _logSubItem.LogSubItem; | |
| 8418 | + } | |
| 8419 | +})); | |
| 8420 | +Object.defineProperty(exports, "StartLog", ({ | |
| 8421 | + enumerable: true, | |
| 8422 | + get: function get() { | |
| 8423 | + return _startLog.StartLog; | |
| 8424 | + } | |
| 8425 | +})); | |
| 8426 | + | |
| 8427 | +var _addTransaction = __webpack_require__(/*! ./add-transaction */ "../assets/dev/js/editor/document/history/commands/internal/add-transaction.js"); | |
| 8428 | + | |
| 8429 | +var _clearTransaction = __webpack_require__(/*! ./clear-transaction */ "../assets/dev/js/editor/document/history/commands/internal/clear-transaction.js"); | |
| 8430 | + | |
| 8431 | +var _deleteLog = __webpack_require__(/*! ./delete-log */ "../assets/dev/js/editor/document/history/commands/internal/delete-log.js"); | |
| 8432 | + | |
| 8433 | +var _endLog = __webpack_require__(/*! ./end-log */ "../assets/dev/js/editor/document/history/commands/internal/end-log.js"); | |
| 8434 | + | |
| 8435 | +var _endTransaction = __webpack_require__(/*! ./end-transaction */ "../assets/dev/js/editor/document/history/commands/internal/end-transaction.js"); | |
| 8436 | + | |
| 8437 | +var _logSubItem = __webpack_require__(/*! ./log-sub-item */ "../assets/dev/js/editor/document/history/commands/internal/log-sub-item.js"); | |
| 8438 | + | |
| 8439 | +var _startLog = __webpack_require__(/*! ./start-log */ "../assets/dev/js/editor/document/history/commands/internal/start-log.js"); | |
| 8440 | + | |
| 8441 | +/***/ }), | |
| 8442 | + | |
| 8443 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/log-sub-item.js": | |
| 8444 | +/*!**********************************************************************************!*\ | |
| 8445 | + !*** ../assets/dev/js/editor/document/history/commands/internal/log-sub-item.js ***! | |
| 8446 | + \**********************************************************************************/ | |
| 8447 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8448 | + | |
| 8449 | +"use strict"; | |
| 8450 | + | |
| 8451 | + | |
| 8452 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8453 | + | |
| 8454 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8455 | + value: true | |
| 8456 | +})); | |
| 8457 | +exports["default"] = exports.LogSubItem = void 0; | |
| 8458 | + | |
| 8459 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8460 | + | |
| 8461 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8462 | + | |
| 8463 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8464 | + | |
| 8465 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8466 | + | |
| 8467 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8468 | + | |
| 8469 | +var _base = _interopRequireDefault(__webpack_require__(/*! ../base/base */ "../assets/dev/js/editor/document/history/commands/base/base.js")); | |
| 8470 | + | |
| 8471 | +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); }; } | |
| 8472 | + | |
| 8473 | +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; } } | |
| 8474 | + | |
| 8475 | +var LogSubItem = /*#__PURE__*/function (_Base) { | |
| 8476 | + (0, _inherits2.default)(LogSubItem, _Base); | |
| 8477 | + | |
| 8478 | + var _super = _createSuper(LogSubItem); | |
| 8479 | + | |
| 8480 | + function LogSubItem() { | |
| 8481 | + (0, _classCallCheck2.default)(this, LogSubItem); | |
| 8482 | + return _super.apply(this, arguments); | |
| 8483 | + } | |
| 8484 | + | |
| 8485 | + (0, _createClass2.default)(LogSubItem, [{ | |
| 8486 | + key: "apply", | |
| 8487 | + value: function apply(args) { | |
| 8488 | + if (!this.history.getActive()) { | |
| 8489 | + return; | |
| 8490 | + } | |
| 8491 | + | |
| 8492 | + var id = args.id || this.history.getCurrentId(); | |
| 8493 | + args = this.component.normalizeLogTitle(args); | |
| 8494 | + var items = this.history.getItems(), | |
| 8495 | + item = items.findWhere({ | |
| 8496 | + id: id | |
| 8497 | + }); | |
| 8498 | + | |
| 8499 | + if (!item) { | |
| 8500 | + throw new Error('History item not found.'); | |
| 8501 | + } | |
| 8502 | + /** | |
| 8503 | + * Sometimes `args.id` passed to `LogSubItem`, to add sub item for specific id. | |
| 8504 | + * this `id` should not be passed as sub-item. | |
| 8505 | + */ | |
| 8506 | + | |
| 8507 | + | |
| 8508 | + if (args.id) { | |
| 8509 | + delete args.id; | |
| 8510 | + } | |
| 8511 | + | |
| 8512 | + item.get('items').unshift(args); | |
| 8513 | + } | |
| 8514 | + }]); | |
| 8515 | + return LogSubItem; | |
| 8516 | +}(_base.default); | |
| 8517 | + | |
| 8518 | +exports.LogSubItem = LogSubItem; | |
| 8519 | +var _default = LogSubItem; | |
| 8520 | +exports["default"] = _default; | |
| 8521 | + | |
| 8522 | +/***/ }), | |
| 8523 | + | |
| 8524 | +/***/ "../assets/dev/js/editor/document/history/commands/internal/start-log.js": | |
| 8525 | +/*!*******************************************************************************!*\ | |
| 8526 | + !*** ../assets/dev/js/editor/document/history/commands/internal/start-log.js ***! | |
| 8527 | + \*******************************************************************************/ | |
| 8528 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8529 | + | |
| 8530 | +"use strict"; | |
| 8531 | + | |
| 8532 | + | |
| 8533 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8534 | + | |
| 8535 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8536 | + value: true | |
| 8537 | +})); | |
| 8538 | +exports["default"] = exports.StartLog = void 0; | |
| 8539 | + | |
| 8540 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8541 | + | |
| 8542 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8543 | + | |
| 275 | 8544 | var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); |
| 8545 | + | |
| 276 | 8546 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 8547 | + | |
| 8548 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8549 | + | |
| 8550 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8551 | + | |
| 8552 | +var _base = _interopRequireDefault(__webpack_require__(/*! ../base/base */ "../assets/dev/js/editor/document/history/commands/base/base.js")); | |
| 8553 | + | |
| 8554 | +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); }; } | |
| 8555 | + | |
| 8556 | +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; } } | |
| 8557 | + | |
| 8558 | +var StartLog = /*#__PURE__*/function (_Base) { | |
| 8559 | + (0, _inherits2.default)(StartLog, _Base); | |
| 8560 | + | |
| 8561 | + var _super = _createSuper(StartLog); | |
| 8562 | + | |
| 8563 | + function StartLog() { | |
| 8564 | + (0, _classCallCheck2.default)(this, StartLog); | |
| 8565 | + return _super.apply(this, arguments); | |
| 8566 | + } | |
| 8567 | + | |
| 8568 | + (0, _createClass2.default)(StartLog, [{ | |
| 8569 | + key: "initialize", | |
| 8570 | + value: function initialize(args) { | |
| 8571 | + (0, _get2.default)((0, _getPrototypeOf2.default)(StartLog.prototype), "initialize", this).call(this, args); | |
| 8572 | + | |
| 8573 | + if (this.history.isItemStarted() || args.id) { | |
| 8574 | + this.isSubItem = true; | |
| 8575 | + return; | |
| 8576 | + } | |
| 8577 | + | |
| 8578 | + this.args = this.component.normalizeLogTitle(args); | |
| 8579 | + } | |
| 8580 | + }, { | |
| 8581 | + key: "validateArgs", | |
| 8582 | + value: function validateArgs(args) { | |
| 8583 | + if (!this.isSubItem) { | |
| 8584 | + this.requireArgumentType('type', 'string', args); | |
| 8585 | + this.requireArgumentType('title', 'string', args); | |
| 8586 | + } | |
| 8587 | + } | |
| 8588 | + }, { | |
| 8589 | + key: "apply", | |
| 8590 | + value: function apply(args) { | |
| 8591 | + if (this.isSubItem) { | |
| 8592 | + $e.internal('document/history/log-sub-item', args); | |
| 8593 | + return null; | |
| 8594 | + } | |
| 8595 | + | |
| 8596 | + return this.history.startItem(args); | |
| 8597 | + } | |
| 8598 | + }]); | |
| 8599 | + return StartLog; | |
| 8600 | +}(_base.default); | |
| 8601 | + | |
| 8602 | +exports.StartLog = StartLog; | |
| 8603 | +var _default = StartLog; | |
| 8604 | +exports["default"] = _default; | |
| 8605 | + | |
| 8606 | +/***/ }), | |
| 8607 | + | |
| 8608 | +/***/ "../assets/dev/js/editor/document/history/commands/redo.js": | |
| 8609 | +/*!*****************************************************************!*\ | |
| 8610 | + !*** ../assets/dev/js/editor/document/history/commands/redo.js ***! | |
| 8611 | + \*****************************************************************/ | |
| 8612 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8613 | + | |
| 8614 | +"use strict"; | |
| 8615 | + | |
| 8616 | + | |
| 8617 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8618 | + | |
| 8619 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8620 | + value: true | |
| 8621 | +})); | |
| 8622 | +exports["default"] = exports.Redo = void 0; | |
| 8623 | + | |
| 8624 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8625 | + | |
| 8626 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8627 | + | |
| 8628 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8629 | + | |
| 8630 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8631 | + | |
| 8632 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8633 | + | |
| 8634 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 8635 | + | |
| 8636 | +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); }; } | |
| 8637 | + | |
| 8638 | +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; } } | |
| 8639 | + | |
| 8640 | +var Redo = /*#__PURE__*/function (_CommandBase) { | |
| 8641 | + (0, _inherits2.default)(Redo, _CommandBase); | |
| 8642 | + | |
| 8643 | + var _super = _createSuper(Redo); | |
| 8644 | + | |
| 8645 | + function Redo() { | |
| 8646 | + (0, _classCallCheck2.default)(this, Redo); | |
| 8647 | + return _super.apply(this, arguments); | |
| 8648 | + } | |
| 8649 | + | |
| 8650 | + (0, _createClass2.default)(Redo, [{ | |
| 8651 | + key: "apply", | |
| 8652 | + value: function apply() { | |
| 8653 | + elementor.documents.getCurrent().history.navigate(true); | |
| 8654 | + } | |
| 8655 | + }]); | |
| 8656 | + return Redo; | |
| 8657 | +}(_commandBase.default); | |
| 8658 | + | |
| 8659 | +exports.Redo = Redo; | |
| 8660 | +var _default = Redo; | |
| 8661 | +exports["default"] = _default; | |
| 8662 | + | |
| 8663 | +/***/ }), | |
| 8664 | + | |
| 8665 | +/***/ "../assets/dev/js/editor/document/history/commands/undo-all.js": | |
| 8666 | +/*!*********************************************************************!*\ | |
| 8667 | + !*** ../assets/dev/js/editor/document/history/commands/undo-all.js ***! | |
| 8668 | + \*********************************************************************/ | |
| 8669 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8670 | + | |
| 8671 | +"use strict"; | |
| 8672 | + | |
| 8673 | + | |
| 8674 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8675 | + | |
| 8676 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8677 | + value: true | |
| 8678 | +})); | |
| 8679 | +exports["default"] = exports.UndoAll = void 0; | |
| 8680 | + | |
| 8681 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8682 | + | |
| 8683 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8684 | + | |
| 8685 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8686 | + | |
| 8687 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8688 | + | |
| 8689 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8690 | + | |
| 8691 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 8692 | + | |
| 8693 | +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); }; } | |
| 8694 | + | |
| 8695 | +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; } } | |
| 8696 | + | |
| 8697 | +var UndoAll = /*#__PURE__*/function (_CommandBase) { | |
| 8698 | + (0, _inherits2.default)(UndoAll, _CommandBase); | |
| 8699 | + | |
| 8700 | + var _super = _createSuper(UndoAll); | |
| 8701 | + | |
| 8702 | + function UndoAll() { | |
| 8703 | + (0, _classCallCheck2.default)(this, UndoAll); | |
| 8704 | + return _super.apply(this, arguments); | |
| 8705 | + } | |
| 8706 | + | |
| 8707 | + (0, _createClass2.default)(UndoAll, [{ | |
| 8708 | + key: "apply", | |
| 8709 | + value: function apply(args) { | |
| 8710 | + var document = args.document; | |
| 8711 | + document.history.doItem(document.history.getItems().length - 1); | |
| 8712 | + } | |
| 8713 | + }]); | |
| 8714 | + return UndoAll; | |
| 8715 | +}(_commandBase.default); | |
| 8716 | + | |
| 8717 | +exports.UndoAll = UndoAll; | |
| 8718 | +var _default = UndoAll; | |
| 8719 | +exports["default"] = _default; | |
| 8720 | + | |
| 8721 | +/***/ }), | |
| 8722 | + | |
| 8723 | +/***/ "../assets/dev/js/editor/document/history/commands/undo.js": | |
| 8724 | +/*!*****************************************************************!*\ | |
| 8725 | + !*** ../assets/dev/js/editor/document/history/commands/undo.js ***! | |
| 8726 | + \*****************************************************************/ | |
| 8727 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8728 | + | |
| 8729 | +"use strict"; | |
| 8730 | + | |
| 8731 | + | |
| 8732 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8733 | + | |
| 8734 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8735 | + value: true | |
| 8736 | +})); | |
| 8737 | +exports["default"] = exports.Undo = void 0; | |
| 8738 | + | |
| 8739 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8740 | + | |
| 8741 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8742 | + | |
| 8743 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8744 | + | |
| 8745 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8746 | + | |
| 8747 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8748 | + | |
| 8749 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 8750 | + | |
| 8751 | +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); }; } | |
| 8752 | + | |
| 8753 | +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; } } | |
| 8754 | + | |
| 8755 | +var Undo = /*#__PURE__*/function (_CommandBase) { | |
| 8756 | + (0, _inherits2.default)(Undo, _CommandBase); | |
| 8757 | + | |
| 8758 | + var _super = _createSuper(Undo); | |
| 8759 | + | |
| 8760 | + function Undo() { | |
| 8761 | + (0, _classCallCheck2.default)(this, Undo); | |
| 8762 | + return _super.apply(this, arguments); | |
| 8763 | + } | |
| 8764 | + | |
| 8765 | + (0, _createClass2.default)(Undo, [{ | |
| 8766 | + key: "apply", | |
| 8767 | + value: function apply() { | |
| 8768 | + elementor.documents.getCurrent().history.navigate(); | |
| 8769 | + } | |
| 8770 | + }]); | |
| 8771 | + return Undo; | |
| 8772 | +}(_commandBase.default); | |
| 8773 | + | |
| 8774 | +exports.Undo = Undo; | |
| 8775 | +var _default = Undo; | |
| 8776 | +exports["default"] = _default; | |
| 8777 | + | |
| 8778 | +/***/ }), | |
| 8779 | + | |
| 8780 | +/***/ "../assets/dev/js/editor/document/history/component.js": | |
| 8781 | +/*!*************************************************************!*\ | |
| 8782 | + !*** ../assets/dev/js/editor/document/history/component.js ***! | |
| 8783 | + \*************************************************************/ | |
| 8784 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8785 | + | |
| 8786 | +"use strict"; | |
| 8787 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 8788 | + | |
| 8789 | + | |
| 8790 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8791 | + | |
| 8792 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 8793 | + | |
| 8794 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8795 | + value: true | |
| 8796 | +})); | |
| 8797 | +exports["default"] = void 0; | |
| 8798 | + | |
| 8799 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8800 | + | |
| 8801 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8802 | + | |
| 8803 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 8804 | + | |
| 8805 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8806 | + | |
| 8807 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8808 | + | |
| 8809 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8810 | + | |
| 8811 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 8812 | + | |
| 8813 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/document/history/commands/index.js")); | |
| 8814 | + | |
| 8815 | +var commandsInternal = _interopRequireWildcard(__webpack_require__(/*! ./commands/internal/ */ "../assets/dev/js/editor/document/history/commands/internal/index.js")); | |
| 8816 | + | |
| 8817 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 8818 | + | |
| 8819 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 8820 | + | |
| 8821 | +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); }; } | |
| 8822 | + | |
| 8823 | +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; } } | |
| 8824 | + | |
| 8825 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 8826 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 8827 | + | |
| 8828 | + var _super = _createSuper(Component); | |
| 8829 | + | |
| 8830 | + function Component() { | |
| 8831 | + (0, _classCallCheck2.default)(this, Component); | |
| 8832 | + return _super.apply(this, arguments); | |
| 8833 | + } | |
| 8834 | + | |
| 8835 | + (0, _createClass2.default)(Component, [{ | |
| 8836 | + key: "__construct", | |
| 8837 | + value: function __construct(args) { | |
| 8838 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "__construct", this).call(this, args); | |
| 8839 | + /** | |
| 8840 | + * Transactions holder. | |
| 8841 | + * | |
| 8842 | + * @type {Array} | |
| 8843 | + */ | |
| 8844 | + | |
| 8845 | + this.transactions = []; | |
| 8846 | + } | |
| 8847 | + }, { | |
| 8848 | + key: "getNamespace", | |
| 8849 | + value: function getNamespace() { | |
| 8850 | + return 'document/history'; | |
| 8851 | + } | |
| 8852 | + }, { | |
| 8853 | + key: "defaultCommands", | |
| 8854 | + value: function defaultCommands() { | |
| 8855 | + return this.importCommands(commands); | |
| 8856 | + } | |
| 8857 | + }, { | |
| 8858 | + key: "defaultCommandsInternal", | |
| 8859 | + value: function defaultCommandsInternal() { | |
| 8860 | + return this.importCommands(commandsInternal); | |
| 8861 | + } | |
| 8862 | + }, { | |
| 8863 | + key: "normalizeLogTitle", | |
| 8864 | + value: function normalizeLogTitle(args) { | |
| 8865 | + var _args$containers = args.containers, | |
| 8866 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 8867 | + | |
| 8868 | + if (!args.title && containers[0]) { | |
| 8869 | + if (1 === containers.length) { | |
| 8870 | + args.title = containers[0].label; | |
| 8871 | + } else { | |
| 8872 | + args.title = __('Elements', 'elementor'); | |
| 8873 | + } | |
| 8874 | + } | |
| 8875 | + | |
| 8876 | + return args; | |
| 8877 | + } | |
| 8878 | + }, { | |
| 8879 | + key: "mergeTransactions", | |
| 8880 | + value: function mergeTransactions(transactions) { | |
| 8881 | + var result = {}; | |
| 8882 | + transactions.forEach(function (itemArgs) { | |
| 8883 | + // If no containers at the current transaction. | |
| 8884 | + if (!itemArgs.container && !itemArgs.containers) { | |
| 8885 | + return; | |
| 8886 | + } | |
| 8887 | + | |
| 8888 | + var _itemArgs$containers = itemArgs.containers, | |
| 8889 | + containers = _itemArgs$containers === void 0 ? [itemArgs.container] : _itemArgs$containers; | |
| 8890 | + | |
| 8891 | + if (containers) { | |
| 8892 | + containers.forEach(function (container) { | |
| 8893 | + if (!itemArgs.data) { | |
| 8894 | + return; | |
| 8895 | + } // Replace new changes by current itemArgs. | |
| 8896 | + | |
| 8897 | + | |
| 8898 | + if (result[container.id]) { | |
| 8899 | + result[container.id].data.changes[container.id].new = itemArgs.data.changes[container.id].new; | |
| 8900 | + return; | |
| 8901 | + } | |
| 8902 | + | |
| 8903 | + result[container.id] = itemArgs; | |
| 8904 | + }); | |
| 8905 | + } | |
| 8906 | + }); | |
| 8907 | + return result; | |
| 8908 | + } | |
| 8909 | + }, { | |
| 8910 | + key: "isTransactionStarted", | |
| 8911 | + value: function isTransactionStarted() { | |
| 8912 | + return Boolean(this.transactions.length); | |
| 8913 | + } | |
| 8914 | + }]); | |
| 8915 | + return Component; | |
| 8916 | +}(_componentBase.default); | |
| 8917 | + | |
| 8918 | +exports["default"] = Component; | |
| 8919 | + | |
| 8920 | +/***/ }), | |
| 8921 | + | |
| 8922 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/base/reset-layout-base.js": | |
| 8923 | +/*!***********************************************************************************************!*\ | |
| 8924 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/base/reset-layout-base.js ***! | |
| 8925 | + \***********************************************************************************************/ | |
| 8926 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8927 | + | |
| 8928 | +"use strict"; | |
| 8929 | + | |
| 8930 | + | |
| 8931 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8932 | + | |
| 8933 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8934 | + value: true | |
| 8935 | +})); | |
| 8936 | +exports["default"] = void 0; | |
| 8937 | + | |
| 8938 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8939 | + | |
| 8940 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8941 | + | |
| 8942 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8943 | + | |
| 8944 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8945 | + | |
| 8946 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8947 | + | |
| 8948 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 8949 | + | |
| 8950 | +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); }; } | |
| 8951 | + | |
| 8952 | +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; } } | |
| 8953 | + | |
| 8954 | +/** | |
| 8955 | + * @typedef {import('../../../../../../container/container')} Container | |
| 8956 | + */ | |
| 8957 | +var ResetLayoutBase = /*#__PURE__*/function (_After) { | |
| 8958 | + (0, _inherits2.default)(ResetLayoutBase, _After); | |
| 8959 | + | |
| 8960 | + var _super = _createSuper(ResetLayoutBase); | |
| 8961 | + | |
| 8962 | + function ResetLayoutBase() { | |
| 8963 | + (0, _classCallCheck2.default)(this, ResetLayoutBase); | |
| 8964 | + return _super.apply(this, arguments); | |
| 8965 | + } | |
| 8966 | + | |
| 8967 | + (0, _createClass2.default)(ResetLayoutBase, [{ | |
| 8968 | + key: "getConditions", | |
| 8969 | + value: function getConditions() { | |
| 8970 | + // On `document/elements/move` do not fire the hook!. | |
| 8971 | + return !$e.commands.isCurrentFirstTrace('document/elements/move'); | |
| 8972 | + } | |
| 8973 | + /** | |
| 8974 | + * @inheritDoc | |
| 8975 | + * | |
| 8976 | + * @param {{}} args | |
| 8977 | + * @param {Container|Array<Container>} containers | |
| 8978 | + */ | |
| 8979 | + | |
| 8980 | + }, { | |
| 8981 | + key: "apply", | |
| 8982 | + value: function apply(args, containers) { | |
| 8983 | + if (!Array.isArray(containers)) { | |
| 8984 | + containers = [containers]; | |
| 8985 | + } | |
| 8986 | + | |
| 8987 | + containers.forEach(function ( | |
| 8988 | + /**Container*/ | |
| 8989 | + container) { | |
| 8990 | + return container.parent.view.resetLayout(false); | |
| 8991 | + }); | |
| 8992 | + } | |
| 8993 | + }]); | |
| 8994 | + return ResetLayoutBase; | |
| 8995 | +}(_after.default); | |
| 8996 | + | |
| 8997 | +exports["default"] = ResetLayoutBase; | |
| 8998 | + | |
| 8999 | +/***/ }), | |
| 9000 | + | |
| 9001 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/create/create-section-columns-reset-layout.js": | |
| 9002 | +/*!*******************************************************************************************************************!*\ | |
| 9003 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/create/create-section-columns-reset-layout.js ***! | |
| 9004 | + \*******************************************************************************************************************/ | |
| 9005 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9006 | + | |
| 9007 | +"use strict"; | |
| 9008 | + | |
| 9009 | + | |
| 9010 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9011 | + | |
| 9012 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9013 | + value: true | |
| 9014 | +})); | |
| 9015 | +exports["default"] = exports.CreateSectionColumnsResetLayout = void 0; | |
| 9016 | + | |
| 9017 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9018 | + | |
| 9019 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9020 | + | |
| 9021 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9022 | + | |
| 9023 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9024 | + | |
| 9025 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9026 | + | |
| 9027 | +var _resetLayoutBase = _interopRequireDefault(__webpack_require__(/*! ../base/reset-layout-base */ "../assets/dev/js/editor/document/hooks/data/document/elements/base/reset-layout-base.js")); | |
| 9028 | + | |
| 9029 | +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); }; } | |
| 9030 | + | |
| 9031 | +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; } } | |
| 9032 | + | |
| 9033 | +var CreateSectionColumnsResetLayout = /*#__PURE__*/function (_ResetLayoutBase) { | |
| 9034 | + (0, _inherits2.default)(CreateSectionColumnsResetLayout, _ResetLayoutBase); | |
| 9035 | + | |
| 9036 | + var _super = _createSuper(CreateSectionColumnsResetLayout); | |
| 9037 | + | |
| 9038 | + function CreateSectionColumnsResetLayout() { | |
| 9039 | + (0, _classCallCheck2.default)(this, CreateSectionColumnsResetLayout); | |
| 9040 | + return _super.apply(this, arguments); | |
| 9041 | + } | |
| 9042 | + | |
| 9043 | + (0, _createClass2.default)(CreateSectionColumnsResetLayout, [{ | |
| 9044 | + key: "getCommand", | |
| 9045 | + value: function getCommand() { | |
| 9046 | + return 'document/elements/create'; | |
| 9047 | + } | |
| 9048 | + }, { | |
| 9049 | + key: "getId", | |
| 9050 | + value: function getId() { | |
| 9051 | + return 'section-columns-reset-layout--document/elements/create'; | |
| 9052 | + } | |
| 9053 | + }, { | |
| 9054 | + key: "getContainerType", | |
| 9055 | + value: function getContainerType() { | |
| 9056 | + return 'section'; | |
| 9057 | + } | |
| 9058 | + }]); | |
| 9059 | + return CreateSectionColumnsResetLayout; | |
| 9060 | +}(_resetLayoutBase.default); | |
| 9061 | + | |
| 9062 | +exports.CreateSectionColumnsResetLayout = CreateSectionColumnsResetLayout; | |
| 9063 | +var _default = CreateSectionColumnsResetLayout; | |
| 9064 | +exports["default"] = _default; | |
| 9065 | + | |
| 9066 | +/***/ }), | |
| 9067 | + | |
| 9068 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/create/index.js": | |
| 9069 | +/*!*************************************************************************************!*\ | |
| 9070 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/create/index.js ***! | |
| 9071 | + \*************************************************************************************/ | |
| 9072 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9073 | + | |
| 9074 | +"use strict"; | |
| 9075 | + | |
| 9076 | + | |
| 9077 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9078 | + value: true | |
| 9079 | +})); | |
| 9080 | +Object.defineProperty(exports, "CreateSectionColumnsResetLayout", ({ | |
| 9081 | + enumerable: true, | |
| 9082 | + get: function get() { | |
| 9083 | + return _createSectionColumnsResetLayout.CreateSectionColumnsResetLayout; | |
| 9084 | + } | |
| 9085 | +})); | |
| 9086 | +Object.defineProperty(exports, "InnerSectionColumns", ({ | |
| 9087 | + enumerable: true, | |
| 9088 | + get: function get() { | |
| 9089 | + return _innerSectionColumns.InnerSectionColumns; | |
| 9090 | + } | |
| 9091 | +})); | |
| 9092 | +Object.defineProperty(exports, "IsValidChild", ({ | |
| 9093 | + enumerable: true, | |
| 9094 | + get: function get() { | |
| 9095 | + return _isValidChild.IsValidChild; | |
| 9096 | + } | |
| 9097 | +})); | |
| 9098 | +Object.defineProperty(exports, "SectionColumns", ({ | |
| 9099 | + enumerable: true, | |
| 9100 | + get: function get() { | |
| 9101 | + return _sectionColumns.SectionColumns; | |
| 9102 | + } | |
| 9103 | +})); | |
| 9104 | +Object.defineProperty(exports, "SectionColumnsLimit", ({ | |
| 9105 | + enumerable: true, | |
| 9106 | + get: function get() { | |
| 9107 | + return _sectionColumnsLimit.SectionColumnsLimit; | |
| 9108 | + } | |
| 9109 | +})); | |
| 9110 | + | |
| 9111 | +var _createSectionColumnsResetLayout = __webpack_require__(/*! ./create-section-columns-reset-layout */ "../assets/dev/js/editor/document/hooks/data/document/elements/create/create-section-columns-reset-layout.js"); | |
| 9112 | + | |
| 9113 | +var _innerSectionColumns = __webpack_require__(/*! ./inner-section-columns */ "../assets/dev/js/editor/document/hooks/data/document/elements/create/inner-section-columns.js"); | |
| 9114 | + | |
| 9115 | +var _isValidChild = __webpack_require__(/*! ./is-valid-child */ "../assets/dev/js/editor/document/hooks/data/document/elements/create/is-valid-child.js"); | |
| 9116 | + | |
| 9117 | +var _sectionColumns = __webpack_require__(/*! ./section-columns */ "../assets/dev/js/editor/document/hooks/data/document/elements/create/section-columns.js"); | |
| 9118 | + | |
| 9119 | +var _sectionColumnsLimit = __webpack_require__(/*! ./section-columns-limit */ "../assets/dev/js/editor/document/hooks/data/document/elements/create/section-columns-limit.js"); | |
| 9120 | + | |
| 9121 | +/***/ }), | |
| 9122 | + | |
| 9123 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/create/inner-section-columns.js": | |
| 9124 | +/*!*****************************************************************************************************!*\ | |
| 9125 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/create/inner-section-columns.js ***! | |
| 9126 | + \*****************************************************************************************************/ | |
| 9127 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9128 | + | |
| 9129 | +"use strict"; | |
| 9130 | + | |
| 9131 | + | |
| 9132 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9133 | + | |
| 9134 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9135 | + value: true | |
| 9136 | +})); | |
| 9137 | +exports["default"] = exports.InnerSectionColumns = void 0; | |
| 9138 | + | |
| 9139 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9140 | + | |
| 9141 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9142 | + | |
| 9143 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9144 | + | |
| 9145 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9146 | + | |
| 9147 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9148 | + | |
| 9149 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 9150 | + | |
| 9151 | +var _helper = _interopRequireDefault(__webpack_require__(/*! ../helper */ "../assets/dev/js/editor/document/hooks/data/document/elements/helper.js")); | |
| 9152 | + | |
| 9153 | +var _section = __webpack_require__(/*! elementor-elements/views/section */ "../assets/dev/js/editor/elements/views/section.js"); | |
| 9154 | + | |
| 9155 | +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); }; } | |
| 9156 | + | |
| 9157 | +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; } } | |
| 9158 | + | |
| 9159 | +/** | |
| 9160 | + * @typedef {import('../../../../../../container/container')} Container | |
| 9161 | + */ | |
| 9162 | +var InnerSectionColumns = /*#__PURE__*/function (_After) { | |
| 9163 | + (0, _inherits2.default)(InnerSectionColumns, _After); | |
| 9164 | + | |
| 9165 | + var _super = _createSuper(InnerSectionColumns); | |
| 9166 | + | |
| 9167 | + function InnerSectionColumns() { | |
| 9168 | + (0, _classCallCheck2.default)(this, InnerSectionColumns); | |
| 9169 | + return _super.apply(this, arguments); | |
| 9170 | + } | |
| 9171 | + | |
| 9172 | + (0, _createClass2.default)(InnerSectionColumns, [{ | |
| 9173 | + key: "getCommand", | |
| 9174 | + value: function getCommand() { | |
| 9175 | + return 'document/elements/create'; | |
| 9176 | + } | |
| 9177 | + }, { | |
| 9178 | + key: "getId", | |
| 9179 | + value: function getId() { | |
| 9180 | + return 'create-inner-section-columns'; | |
| 9181 | + } | |
| 9182 | + }, { | |
| 9183 | + key: "getContainerType", | |
| 9184 | + value: function getContainerType() { | |
| 9185 | + return 'column'; | |
| 9186 | + } | |
| 9187 | + }, { | |
| 9188 | + key: "getConditions", | |
| 9189 | + value: function getConditions(args) { | |
| 9190 | + return args.model.isInner && !args.model.elements; | |
| 9191 | + } | |
| 9192 | + /** | |
| 9193 | + * @inheritDoc | |
| 9194 | + * | |
| 9195 | + * @param {{}} args | |
| 9196 | + * @param {Container|Array<Container>} containers | |
| 9197 | + */ | |
| 9198 | + | |
| 9199 | + }, { | |
| 9200 | + key: "apply", | |
| 9201 | + value: function apply(args, containers) { | |
| 9202 | + var _args$structure = args.structure, | |
| 9203 | + structure = _args$structure === void 0 ? '20' : _args$structure, | |
| 9204 | + _args$options = args.options, | |
| 9205 | + options = _args$options === void 0 ? {} : _args$options; | |
| 9206 | + | |
| 9207 | + if (!Array.isArray(containers)) { | |
| 9208 | + containers = [containers]; | |
| 9209 | + } | |
| 9210 | + | |
| 9211 | + _helper.default.createSectionColumns(containers, _section.DEFAULT_INNER_SECTION_COLUMNS, options, structure); | |
| 9212 | + } | |
| 9213 | + }]); | |
| 9214 | + return InnerSectionColumns; | |
| 9215 | +}(_after.default); | |
| 9216 | + | |
| 9217 | +exports.InnerSectionColumns = InnerSectionColumns; | |
| 9218 | +var _default = InnerSectionColumns; | |
| 9219 | +exports["default"] = _default; | |
| 9220 | + | |
| 9221 | +/***/ }), | |
| 9222 | + | |
| 9223 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/create/is-valid-child.js": | |
| 9224 | +/*!**********************************************************************************************!*\ | |
| 9225 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/create/is-valid-child.js ***! | |
| 9226 | + \**********************************************************************************************/ | |
| 9227 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9228 | + | |
| 9229 | +"use strict"; | |
| 9230 | + | |
| 9231 | + | |
| 9232 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9233 | + | |
| 9234 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9235 | + value: true | |
| 9236 | +})); | |
| 9237 | +exports["default"] = exports.IsValidChild = void 0; | |
| 9238 | + | |
| 9239 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9240 | + | |
| 9241 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9242 | + | |
| 9243 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9244 | + | |
| 9245 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9246 | + | |
| 9247 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9248 | + | |
| 9249 | +var _dependency = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js")); | |
| 9250 | + | |
| 9251 | +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); }; } | |
| 9252 | + | |
| 9253 | +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; } } | |
| 9254 | + | |
| 9255 | +var IsValidChild = /*#__PURE__*/function (_Dependency) { | |
| 9256 | + (0, _inherits2.default)(IsValidChild, _Dependency); | |
| 9257 | + | |
| 9258 | + var _super = _createSuper(IsValidChild); | |
| 9259 | + | |
| 9260 | + function IsValidChild() { | |
| 9261 | + (0, _classCallCheck2.default)(this, IsValidChild); | |
| 9262 | + return _super.apply(this, arguments); | |
| 9263 | + } | |
| 9264 | + | |
| 9265 | + (0, _createClass2.default)(IsValidChild, [{ | |
| 9266 | + key: "getCommand", | |
| 9267 | + value: function getCommand() { | |
| 9268 | + return 'document/elements/create'; | |
| 9269 | + } | |
| 9270 | + }, { | |
| 9271 | + key: "getId", | |
| 9272 | + value: function getId() { | |
| 9273 | + return 'is-valid-child'; | |
| 9274 | + } | |
| 9275 | + }, { | |
| 9276 | + key: "apply", | |
| 9277 | + value: function apply(args) { | |
| 9278 | + var _args$containers = args.containers, | |
| 9279 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 9280 | + _args$model = args.model, | |
| 9281 | + model = _args$model === void 0 ? {} : _args$model, | |
| 9282 | + modelToCreate = new Backbone.Model(model); | |
| 9283 | + return containers.some(function ( | |
| 9284 | + /* Container */ | |
| 9285 | + container) { | |
| 9286 | + return $e.components.get('document/elements').utils.isValidChild(modelToCreate, container.model); | |
| 9287 | + }); | |
| 9288 | + } | |
| 9289 | + }]); | |
| 9290 | + return IsValidChild; | |
| 9291 | +}(_dependency.default); | |
| 9292 | + | |
| 9293 | +exports.IsValidChild = IsValidChild; | |
| 9294 | +var _default = IsValidChild; | |
| 9295 | +exports["default"] = _default; | |
| 9296 | + | |
| 9297 | +/***/ }), | |
| 9298 | + | |
| 9299 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/create/section-columns-limit.js": | |
| 9300 | +/*!*****************************************************************************************************!*\ | |
| 9301 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/create/section-columns-limit.js ***! | |
| 9302 | + \*****************************************************************************************************/ | |
| 9303 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9304 | + | |
| 9305 | +"use strict"; | |
| 9306 | + | |
| 9307 | + | |
| 9308 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9309 | + | |
| 9310 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9311 | + value: true | |
| 9312 | +})); | |
| 9313 | +exports["default"] = exports.SectionColumnsLimit = void 0; | |
| 9314 | + | |
| 9315 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9316 | + | |
| 9317 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9318 | + | |
| 9319 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9320 | + | |
| 9321 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9322 | + | |
| 9323 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9324 | + | |
| 9325 | +var _dependency = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js")); | |
| 9326 | + | |
| 9327 | +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); }; } | |
| 9328 | + | |
| 9329 | +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; } } | |
| 9330 | + | |
| 9331 | +var SectionColumnsLimit = /*#__PURE__*/function (_Dependency) { | |
| 9332 | + (0, _inherits2.default)(SectionColumnsLimit, _Dependency); | |
| 9333 | + | |
| 9334 | + var _super = _createSuper(SectionColumnsLimit); | |
| 9335 | + | |
| 9336 | + function SectionColumnsLimit() { | |
| 9337 | + (0, _classCallCheck2.default)(this, SectionColumnsLimit); | |
| 9338 | + return _super.apply(this, arguments); | |
| 9339 | + } | |
| 9340 | + | |
| 9341 | + (0, _createClass2.default)(SectionColumnsLimit, [{ | |
| 9342 | + key: "getCommand", | |
| 9343 | + value: function getCommand() { | |
| 9344 | + return 'document/elements/create'; | |
| 9345 | + } | |
| 9346 | + }, { | |
| 9347 | + key: "getId", | |
| 9348 | + value: function getId() { | |
| 9349 | + return 'section-columns-limit'; | |
| 9350 | + } | |
| 9351 | + }, { | |
| 9352 | + key: "getContainerType", | |
| 9353 | + value: function getContainerType() { | |
| 9354 | + return 'section'; | |
| 9355 | + } | |
| 9356 | + }, { | |
| 9357 | + key: "apply", | |
| 9358 | + value: function apply(args) { | |
| 9359 | + var _args$containers = args.containers, | |
| 9360 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; // If one of the targets have maximum columns reached break the command. | |
| 9361 | + | |
| 9362 | + return !containers.some(function ( | |
| 9363 | + /**Container*/ | |
| 9364 | + container) { | |
| 9365 | + return container.view.isCollectionFilled(); | |
| 9366 | + }); | |
| 9367 | + } | |
| 9368 | + }]); | |
| 9369 | + return SectionColumnsLimit; | |
| 9370 | +}(_dependency.default); | |
| 9371 | + | |
| 9372 | +exports.SectionColumnsLimit = SectionColumnsLimit; | |
| 9373 | +var _default = SectionColumnsLimit; | |
| 9374 | +exports["default"] = _default; | |
| 9375 | + | |
| 9376 | +/***/ }), | |
| 9377 | + | |
| 9378 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/create/section-columns.js": | |
| 9379 | +/*!***********************************************************************************************!*\ | |
| 9380 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/create/section-columns.js ***! | |
| 9381 | + \***********************************************************************************************/ | |
| 9382 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9383 | + | |
| 9384 | +"use strict"; | |
| 9385 | + | |
| 9386 | + | |
| 9387 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9388 | + | |
| 9389 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9390 | + value: true | |
| 9391 | +})); | |
| 9392 | +exports["default"] = exports.SectionColumns = void 0; | |
| 9393 | + | |
| 9394 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9395 | + | |
| 9396 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9397 | + | |
| 9398 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9399 | + | |
| 9400 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9401 | + | |
| 9402 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9403 | + | |
| 9404 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 9405 | + | |
| 9406 | +var _helper = _interopRequireDefault(__webpack_require__(/*! ../helper */ "../assets/dev/js/editor/document/hooks/data/document/elements/helper.js")); | |
| 9407 | + | |
| 9408 | +var _section = __webpack_require__(/*! elementor-elements/views/section */ "../assets/dev/js/editor/elements/views/section.js"); | |
| 9409 | + | |
| 9410 | +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); }; } | |
| 9411 | + | |
| 9412 | +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; } } | |
| 9413 | + | |
| 9414 | +/** | |
| 9415 | + * @typedef {import('../../../../../../container/container')} Container | |
| 9416 | + */ | |
| 9417 | +var SectionColumns = /*#__PURE__*/function (_After) { | |
| 9418 | + (0, _inherits2.default)(SectionColumns, _After); | |
| 9419 | + | |
| 9420 | + var _super = _createSuper(SectionColumns); | |
| 9421 | + | |
| 9422 | + function SectionColumns() { | |
| 9423 | + (0, _classCallCheck2.default)(this, SectionColumns); | |
| 9424 | + return _super.apply(this, arguments); | |
| 9425 | + } | |
| 9426 | + | |
| 9427 | + (0, _createClass2.default)(SectionColumns, [{ | |
| 9428 | + key: "getCommand", | |
| 9429 | + value: function getCommand() { | |
| 9430 | + return 'document/elements/create'; | |
| 9431 | + } | |
| 9432 | + }, { | |
| 9433 | + key: "getId", | |
| 9434 | + value: function getId() { | |
| 9435 | + return 'create-section-columns'; | |
| 9436 | + } | |
| 9437 | + }, { | |
| 9438 | + key: "getContainerType", | |
| 9439 | + value: function getContainerType() { | |
| 9440 | + return 'document'; | |
| 9441 | + } | |
| 9442 | + }, { | |
| 9443 | + key: "getConditions", | |
| 9444 | + value: function getConditions(args) { | |
| 9445 | + return !args.model.elements && 'section' === args.model.elType; | |
| 9446 | + } | |
| 9447 | + /** | |
| 9448 | + * @inheritDoc | |
| 9449 | + * | |
| 9450 | + * @param {{}} args | |
| 9451 | + * @param {Container|Array<Container>} containers | |
| 9452 | + */ | |
| 9453 | + | |
| 9454 | + }, { | |
| 9455 | + key: "apply", | |
| 9456 | + value: function apply(args, containers) { | |
| 9457 | + var _args$structure = args.structure, | |
| 9458 | + structure = _args$structure === void 0 ? false : _args$structure, | |
| 9459 | + _args$options = args.options, | |
| 9460 | + options = _args$options === void 0 ? {} : _args$options; | |
| 9461 | + | |
| 9462 | + if (!Array.isArray(containers)) { | |
| 9463 | + containers = [containers]; | |
| 9464 | + } | |
| 9465 | + | |
| 9466 | + var _args$columns = args.columns, | |
| 9467 | + columns = _args$columns === void 0 ? 1 : _args$columns; | |
| 9468 | + | |
| 9469 | + if (args.model.isInner && 1 === columns) { | |
| 9470 | + columns = _section.DEFAULT_INNER_SECTION_COLUMNS; | |
| 9471 | + } | |
| 9472 | + | |
| 9473 | + _helper.default.createSectionColumns(containers, columns, options, structure); | |
| 9474 | + } | |
| 9475 | + }]); | |
| 9476 | + return SectionColumns; | |
| 9477 | +}(_after.default); | |
| 9478 | + | |
| 9479 | +exports.SectionColumns = SectionColumns; | |
| 9480 | +var _default = SectionColumns; | |
| 9481 | +exports["default"] = _default; | |
| 9482 | + | |
| 9483 | +/***/ }), | |
| 9484 | + | |
| 9485 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/delete/create-column-for-empty-section.js": | |
| 9486 | +/*!***************************************************************************************************************!*\ | |
| 9487 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/delete/create-column-for-empty-section.js ***! | |
| 9488 | + \***************************************************************************************************************/ | |
| 9489 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9490 | + | |
| 9491 | +"use strict"; | |
| 9492 | + | |
| 9493 | + | |
| 9494 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9495 | + | |
| 9496 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9497 | + value: true | |
| 9498 | +})); | |
| 9499 | +exports["default"] = exports.CreateColumnForEmptySection = void 0; | |
| 9500 | + | |
| 9501 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9502 | + | |
| 9503 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9504 | + | |
| 9505 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9506 | + | |
| 9507 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9508 | + | |
| 9509 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9510 | + | |
| 9511 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 9512 | + | |
| 9513 | +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); }; } | |
| 9514 | + | |
| 9515 | +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; } } | |
| 9516 | + | |
| 9517 | +/** | |
| 9518 | + * @typedef {import('../../../../../../container/container')} Container | |
| 9519 | + */ | |
| 9520 | +var CreateColumnForEmptySection = /*#__PURE__*/function (_After) { | |
| 9521 | + (0, _inherits2.default)(CreateColumnForEmptySection, _After); | |
| 9522 | + | |
| 9523 | + var _super = _createSuper(CreateColumnForEmptySection); | |
| 9524 | + | |
| 9525 | + function CreateColumnForEmptySection() { | |
| 9526 | + (0, _classCallCheck2.default)(this, CreateColumnForEmptySection); | |
| 9527 | + return _super.apply(this, arguments); | |
| 9528 | + } | |
| 9529 | + | |
| 9530 | + (0, _createClass2.default)(CreateColumnForEmptySection, [{ | |
| 9531 | + key: "getCommand", | |
| 9532 | + value: function getCommand() { | |
| 9533 | + return 'document/elements/delete'; | |
| 9534 | + } | |
| 9535 | + }, { | |
| 9536 | + key: "getId", | |
| 9537 | + value: function getId() { | |
| 9538 | + return 'create-column-for-empty-section--document/elements/delete'; | |
| 9539 | + } | |
| 9540 | + }, { | |
| 9541 | + key: "getContainerType", | |
| 9542 | + value: function getContainerType() { | |
| 9543 | + return 'column'; | |
| 9544 | + } | |
| 9545 | + }, { | |
| 9546 | + key: "getConditions", | |
| 9547 | + value: function getConditions() { | |
| 9548 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 9549 | + var _args$containers = args.containers, | |
| 9550 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; // Validate also that its a section, this is hook should not work with new flex container. | |
| 9551 | + | |
| 9552 | + return containers.some(function (container) { | |
| 9553 | + return 'section' === container.parent.type && 0 === container.parent.children.length; | |
| 9554 | + }); | |
| 9555 | + } | |
| 9556 | + /** | |
| 9557 | + * @inheritDoc | |
| 9558 | + * | |
| 9559 | + * @param {{}} args | |
| 9560 | + * @param {Container|Array<Container>} containers | |
| 9561 | + */ | |
| 9562 | + | |
| 9563 | + }, { | |
| 9564 | + key: "apply", | |
| 9565 | + value: function apply(args, containers) { | |
| 9566 | + if (!Array.isArray(containers)) { | |
| 9567 | + containers = [containers]; | |
| 9568 | + } | |
| 9569 | + | |
| 9570 | + containers.forEach(function ( | |
| 9571 | + /**Container*/ | |
| 9572 | + container) { | |
| 9573 | + var parent = container.parent; // If deleted the last column, should recreate it. | |
| 9574 | + | |
| 9575 | + if (0 === parent.children.length) { | |
| 9576 | + $e.run('document/elements/create', { | |
| 9577 | + container: parent, | |
| 9578 | + model: { | |
| 9579 | + elType: 'column' | |
| 9580 | + } | |
| 9581 | + }); | |
| 9582 | + } | |
| 9583 | + }); | |
| 9584 | + } | |
| 9585 | + }]); | |
| 9586 | + return CreateColumnForEmptySection; | |
| 9587 | +}(_after.default); | |
| 9588 | + | |
| 9589 | +exports.CreateColumnForEmptySection = CreateColumnForEmptySection; | |
| 9590 | +var _default = CreateColumnForEmptySection; | |
| 9591 | +exports["default"] = _default; | |
| 9592 | + | |
| 9593 | +/***/ }), | |
| 9594 | + | |
| 9595 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/delete/delete-column-columns-reset-layout.js": | |
| 9596 | +/*!******************************************************************************************************************!*\ | |
| 9597 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/delete/delete-column-columns-reset-layout.js ***! | |
| 9598 | + \******************************************************************************************************************/ | |
| 9599 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9600 | + | |
| 9601 | +"use strict"; | |
| 9602 | + | |
| 9603 | + | |
| 9604 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9605 | + | |
| 9606 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9607 | + value: true | |
| 9608 | +})); | |
| 9609 | +exports["default"] = exports.DeleteColumnColumnsResetLayout = void 0; | |
| 9610 | + | |
| 9611 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9612 | + | |
| 9613 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9614 | + | |
| 9615 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9616 | + | |
| 9617 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9618 | + | |
| 9619 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9620 | + | |
| 9621 | +var _resetLayoutBase = _interopRequireDefault(__webpack_require__(/*! ../base/reset-layout-base */ "../assets/dev/js/editor/document/hooks/data/document/elements/base/reset-layout-base.js")); | |
| 9622 | + | |
| 9623 | +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); }; } | |
| 9624 | + | |
| 9625 | +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; } } | |
| 9626 | + | |
| 9627 | +var DeleteColumnColumnsResetLayout = /*#__PURE__*/function (_ResetLayoutBase) { | |
| 9628 | + (0, _inherits2.default)(DeleteColumnColumnsResetLayout, _ResetLayoutBase); | |
| 9629 | + | |
| 9630 | + var _super = _createSuper(DeleteColumnColumnsResetLayout); | |
| 9631 | + | |
| 9632 | + function DeleteColumnColumnsResetLayout() { | |
| 9633 | + (0, _classCallCheck2.default)(this, DeleteColumnColumnsResetLayout); | |
| 9634 | + return _super.apply(this, arguments); | |
| 9635 | + } | |
| 9636 | + | |
| 9637 | + (0, _createClass2.default)(DeleteColumnColumnsResetLayout, [{ | |
| 9638 | + key: "getCommand", | |
| 9639 | + value: function getCommand() { | |
| 9640 | + return 'document/elements/delete'; | |
| 9641 | + } | |
| 9642 | + }, { | |
| 9643 | + key: "getId", | |
| 9644 | + value: function getId() { | |
| 9645 | + return 'section-columns-reset-layout--document/elements/delete'; | |
| 9646 | + } | |
| 9647 | + }, { | |
| 9648 | + key: "getContainerType", | |
| 9649 | + value: function getContainerType() { | |
| 9650 | + return 'column'; | |
| 9651 | + } | |
| 9652 | + }]); | |
| 9653 | + return DeleteColumnColumnsResetLayout; | |
| 9654 | +}(_resetLayoutBase.default); | |
| 9655 | + | |
| 9656 | +exports.DeleteColumnColumnsResetLayout = DeleteColumnColumnsResetLayout; | |
| 9657 | +var _default = DeleteColumnColumnsResetLayout; | |
| 9658 | +exports["default"] = _default; | |
| 9659 | + | |
| 9660 | +/***/ }), | |
| 9661 | + | |
| 9662 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/delete/index.js": | |
| 9663 | +/*!*************************************************************************************!*\ | |
| 9664 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/delete/index.js ***! | |
| 9665 | + \*************************************************************************************/ | |
| 9666 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9667 | + | |
| 9668 | +"use strict"; | |
| 9669 | + | |
| 9670 | + | |
| 9671 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9672 | + value: true | |
| 9673 | +})); | |
| 9674 | +Object.defineProperty(exports, "CreateColumnForEmptySection", ({ | |
| 9675 | + enumerable: true, | |
| 9676 | + get: function get() { | |
| 9677 | + return _createColumnForEmptySection.CreateColumnForEmptySection; | |
| 9678 | + } | |
| 9679 | +})); | |
| 9680 | +Object.defineProperty(exports, "DeleteColumnColumnsResetLayout", ({ | |
| 9681 | + enumerable: true, | |
| 9682 | + get: function get() { | |
| 9683 | + return _deleteColumnColumnsResetLayout.DeleteColumnColumnsResetLayout; | |
| 9684 | + } | |
| 9685 | +})); | |
| 9686 | + | |
| 9687 | +var _createColumnForEmptySection = __webpack_require__(/*! ./create-column-for-empty-section */ "../assets/dev/js/editor/document/hooks/data/document/elements/delete/create-column-for-empty-section.js"); | |
| 9688 | + | |
| 9689 | +var _deleteColumnColumnsResetLayout = __webpack_require__(/*! ./delete-column-columns-reset-layout */ "../assets/dev/js/editor/document/hooks/data/document/elements/delete/delete-column-columns-reset-layout.js"); | |
| 9690 | + | |
| 9691 | +/***/ }), | |
| 9692 | + | |
| 9693 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/helper.js": | |
| 9694 | +/*!*******************************************************************************!*\ | |
| 9695 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/helper.js ***! | |
| 9696 | + \*******************************************************************************/ | |
| 9697 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9698 | + | |
| 9699 | +"use strict"; | |
| 9700 | + | |
| 9701 | + | |
| 9702 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9703 | + | |
| 9704 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9705 | + value: true | |
| 9706 | +})); | |
| 9707 | +exports["default"] = void 0; | |
| 9708 | + | |
| 9709 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9710 | + | |
| 9711 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9712 | + | |
| 9713 | +var _commands = __webpack_require__(/*! elementor-document/elements/commands */ "../assets/dev/js/editor/document/elements/commands/index.js"); | |
| 9714 | + | |
| 9715 | +var Helper = /*#__PURE__*/function () { | |
| 9716 | + function Helper() { | |
| 9717 | + (0, _classCallCheck2.default)(this, Helper); | |
| 9718 | + } | |
| 9719 | + | |
| 9720 | + (0, _createClass2.default)(Helper, null, [{ | |
| 9721 | + key: "createSectionColumns", | |
| 9722 | + value: function createSectionColumns(containers, columns, options) { | |
| 9723 | + var structure = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; | |
| 9724 | + containers.forEach(function ( | |
| 9725 | + /**Container*/ | |
| 9726 | + container) { | |
| 9727 | + for (var loopIndex = 0; loopIndex < columns; loopIndex++) { | |
| 9728 | + var model = { | |
| 9729 | + id: elementorCommon.helpers.getUniqueId(), | |
| 9730 | + elType: 'column', | |
| 9731 | + settings: {}, | |
| 9732 | + elements: [] | |
| 9733 | + }; | |
| 9734 | + /** | |
| 9735 | + * TODO: Try improve performance of using 'document/elements/create` instead of manual create. | |
| 9736 | + */ | |
| 9737 | + | |
| 9738 | + container.view.addChildModel(model); | |
| 9739 | + /** | |
| 9740 | + * Manual history & not using of `$e.run('document/elements/create')` | |
| 9741 | + * For performance reasons. | |
| 9742 | + */ | |
| 9743 | + | |
| 9744 | + $e.internal('document/history/log-sub-item', { | |
| 9745 | + container: container, | |
| 9746 | + type: 'sub-add', | |
| 9747 | + restore: _commands.Create.restore, | |
| 9748 | + options: options, | |
| 9749 | + data: { | |
| 9750 | + containerToRestore: container, | |
| 9751 | + modelToRestore: model | |
| 9752 | + } | |
| 9753 | + }); | |
| 9754 | + } | |
| 9755 | + }); | |
| 9756 | + | |
| 9757 | + if (structure) { | |
| 9758 | + containers.forEach(function ( | |
| 9759 | + /* Container */ | |
| 9760 | + container) { | |
| 9761 | + container.view.setStructure(structure, false); | |
| 9762 | + }); | |
| 9763 | + } else if (columns) { | |
| 9764 | + containers.forEach(function ( | |
| 9765 | + /* Container */ | |
| 9766 | + container) { | |
| 9767 | + return container.view.resetLayout(); | |
| 9768 | + }); // Focus on last container. | |
| 9769 | + | |
| 9770 | + containers[containers.length - 1].model.trigger('request:edit'); | |
| 9771 | + } | |
| 9772 | + } | |
| 9773 | + }]); | |
| 9774 | + return Helper; | |
| 9775 | +}(); | |
| 9776 | + | |
| 9777 | +exports["default"] = Helper; | |
| 9778 | + | |
| 9779 | +/***/ }), | |
| 9780 | + | |
| 9781 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/move/index.js": | |
| 9782 | +/*!***********************************************************************************!*\ | |
| 9783 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/move/index.js ***! | |
| 9784 | + \***********************************************************************************/ | |
| 9785 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9786 | + | |
| 9787 | +"use strict"; | |
| 9788 | + | |
| 9789 | + | |
| 9790 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9791 | + value: true | |
| 9792 | +})); | |
| 9793 | +Object.defineProperty(exports, "SectionColumnsSetStructure", ({ | |
| 9794 | + enumerable: true, | |
| 9795 | + get: function get() { | |
| 9796 | + return _sectionColumnsSetStructure.SectionColumnsSetStructure; | |
| 9797 | + } | |
| 9798 | +})); | |
| 9799 | + | |
| 9800 | +var _sectionColumnsSetStructure = __webpack_require__(/*! ./section-columns-set-structure */ "../assets/dev/js/editor/document/hooks/data/document/elements/move/section-columns-set-structure.js"); | |
| 9801 | + | |
| 9802 | +/***/ }), | |
| 9803 | + | |
| 9804 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/move/section-columns-set-structure.js": | |
| 9805 | +/*!***********************************************************************************************************!*\ | |
| 9806 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/move/section-columns-set-structure.js ***! | |
| 9807 | + \***********************************************************************************************************/ | |
| 9808 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9809 | + | |
| 9810 | +"use strict"; | |
| 9811 | + | |
| 9812 | + | |
| 9813 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9814 | + | |
| 9815 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9816 | + value: true | |
| 9817 | +})); | |
| 9818 | +exports["default"] = exports.SectionColumnsSetStructure = void 0; | |
| 9819 | + | |
| 9820 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9821 | + | |
| 9822 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9823 | + | |
| 9824 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9825 | + | |
| 9826 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9827 | + | |
| 9828 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9829 | + | |
| 9830 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 9831 | + | |
| 9832 | +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); }; } | |
| 9833 | + | |
| 9834 | +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; } } | |
| 9835 | + | |
| 9836 | +var SectionColumnsSetStructure = /*#__PURE__*/function (_After) { | |
| 9837 | + (0, _inherits2.default)(SectionColumnsSetStructure, _After); | |
| 9838 | + | |
| 9839 | + var _super = _createSuper(SectionColumnsSetStructure); | |
| 9840 | + | |
| 9841 | + function SectionColumnsSetStructure() { | |
| 9842 | + (0, _classCallCheck2.default)(this, SectionColumnsSetStructure); | |
| 9843 | + return _super.apply(this, arguments); | |
| 9844 | + } | |
| 9845 | + | |
| 9846 | + (0, _createClass2.default)(SectionColumnsSetStructure, [{ | |
| 9847 | + key: "getCommand", | |
| 9848 | + value: function getCommand() { | |
| 9849 | + return 'document/elements/move'; | |
| 9850 | + } | |
| 9851 | + }, { | |
| 9852 | + key: "getId", | |
| 9853 | + value: function getId() { | |
| 9854 | + return 'section-columns-set-structure'; | |
| 9855 | + } | |
| 9856 | + }, { | |
| 9857 | + key: "getContainerType", | |
| 9858 | + value: function getContainerType() { | |
| 9859 | + return 'column'; | |
| 9860 | + } | |
| 9861 | + }, { | |
| 9862 | + key: "getConditions", | |
| 9863 | + value: function getConditions(args) { | |
| 9864 | + var _args$containers = args.containers, | |
| 9865 | + containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 9866 | + target = args.target; // Fire the hook only when target is not equals to moved container parent. | |
| 9867 | + | |
| 9868 | + return containers.some(function ( | |
| 9869 | + /* Container */ | |
| 9870 | + container) { | |
| 9871 | + return container.parent !== target; | |
| 9872 | + }); | |
| 9873 | + } | |
| 9874 | + }, { | |
| 9875 | + key: "apply", | |
| 9876 | + value: function apply(args) { | |
| 9877 | + var _args$containers2 = args.containers, | |
| 9878 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 9879 | + target = args.target; | |
| 9880 | + containers.forEach(function ( | |
| 9881 | + /* Container */ | |
| 9882 | + container) { | |
| 9883 | + return container.parent.view.resetLayout(); | |
| 9884 | + }); | |
| 9885 | + target.view.resetLayout(); | |
| 9886 | + return true; | |
| 9887 | + } | |
| 9888 | + }]); | |
| 9889 | + return SectionColumnsSetStructure; | |
| 9890 | +}(_after.default); | |
| 9891 | + | |
| 9892 | +exports.SectionColumnsSetStructure = SectionColumnsSetStructure; | |
| 9893 | +var _default = SectionColumnsSetStructure; | |
| 9894 | +exports["default"] = _default; | |
| 9895 | + | |
| 9896 | +/***/ }), | |
| 9897 | + | |
| 9898 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/paste/index.js": | |
| 9899 | +/*!************************************************************************************!*\ | |
| 9900 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/paste/index.js ***! | |
| 9901 | + \************************************************************************************/ | |
| 9902 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9903 | + | |
| 9904 | +"use strict"; | |
| 9905 | + | |
| 9906 | + | |
| 9907 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9908 | + value: true | |
| 9909 | +})); | |
| 9910 | +Object.defineProperty(exports, "IsPasteEnabled", ({ | |
| 9911 | + enumerable: true, | |
| 9912 | + get: function get() { | |
| 9913 | + return _isPasteEnabled.IsPasteEnabled; | |
| 9914 | + } | |
| 9915 | +})); | |
| 9916 | + | |
| 9917 | +var _isPasteEnabled = __webpack_require__(/*! ./is-paste-enabled */ "../assets/dev/js/editor/document/hooks/data/document/elements/paste/is-paste-enabled.js"); | |
| 9918 | + | |
| 9919 | +/***/ }), | |
| 9920 | + | |
| 9921 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/paste/is-paste-enabled.js": | |
| 9922 | +/*!***********************************************************************************************!*\ | |
| 9923 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/paste/is-paste-enabled.js ***! | |
| 9924 | + \***********************************************************************************************/ | |
| 9925 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9926 | + | |
| 9927 | +"use strict"; | |
| 9928 | + | |
| 9929 | + | |
| 9930 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 9931 | + | |
| 9932 | +Object.defineProperty(exports, "__esModule", ({ | |
| 9933 | + value: true | |
| 9934 | +})); | |
| 9935 | +exports["default"] = exports.IsPasteEnabled = void 0; | |
| 9936 | + | |
| 9937 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 9938 | + | |
| 9939 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 9940 | + | |
| 9941 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 9942 | + | |
| 9943 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 9944 | + | |
| 9945 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 9946 | + | |
| 9947 | +var _dependency = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js")); | |
| 9948 | + | |
| 9949 | +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); }; } | |
| 9950 | + | |
| 9951 | +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; } } | |
| 9952 | + | |
| 9953 | +var IsPasteEnabled = /*#__PURE__*/function (_Dependency) { | |
| 9954 | + (0, _inherits2.default)(IsPasteEnabled, _Dependency); | |
| 9955 | + | |
| 9956 | + var _super = _createSuper(IsPasteEnabled); | |
| 9957 | + | |
| 9958 | + function IsPasteEnabled() { | |
| 9959 | + (0, _classCallCheck2.default)(this, IsPasteEnabled); | |
| 9960 | + return _super.apply(this, arguments); | |
| 9961 | + } | |
| 9962 | + | |
| 9963 | + (0, _createClass2.default)(IsPasteEnabled, [{ | |
| 9964 | + key: "getCommand", | |
| 9965 | + value: function getCommand() { | |
| 9966 | + return 'document/elements/paste'; | |
| 9967 | + } | |
| 9968 | + }, { | |
| 9969 | + key: "getId", | |
| 9970 | + value: function getId() { | |
| 9971 | + return 'is-paste-enabled'; | |
| 9972 | + } | |
| 9973 | + }, { | |
| 9974 | + key: "getConditions", | |
| 9975 | + value: function getConditions(args) { | |
| 9976 | + return !args.rebuild; | |
| 9977 | + } | |
| 9978 | + }, { | |
| 9979 | + key: "apply", | |
| 9980 | + value: function apply(args) { | |
| 9981 | + var _args$containers = args.containers, | |
| 9982 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 9983 | + return containers.some(function (container) { | |
| 9984 | + return $e.components.get('document/elements').utils.isPasteEnabled(container); | |
| 9985 | + }); | |
| 9986 | + } | |
| 9987 | + }]); | |
| 9988 | + return IsPasteEnabled; | |
| 9989 | +}(_dependency.default); | |
| 9990 | + | |
| 9991 | +exports.IsPasteEnabled = IsPasteEnabled; | |
| 9992 | +var _default = IsPasteEnabled; | |
| 9993 | +exports["default"] = _default; | |
| 9994 | + | |
| 9995 | +/***/ }), | |
| 9996 | + | |
| 9997 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/handle-dynamic.js": | |
| 9998 | +/*!************************************************************************************************!*\ | |
| 9999 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/settings/handle-dynamic.js ***! | |
| 10000 | + \************************************************************************************************/ | |
| 10001 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10002 | + | |
| 10003 | +"use strict"; | |
| 10004 | + | |
| 10005 | + | |
| 10006 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10007 | + | |
| 10008 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10009 | + value: true | |
| 10010 | +})); | |
| 10011 | +exports["default"] = exports.HandleDynamic = void 0; | |
| 10012 | + | |
| 277 | 10013 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 278 | -var _commandHistoryBase = _interopRequireDefault(__webpack_require__(/*! ./command-history-base */ "../assets/dev/js/editor/document/command-bases/command-history-base.js")); | |
| 279 | -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 280 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 281 | -function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } | |
| 282 | -var DEFAULT_DEBOUNCE_DELAY = exports.DEFAULT_DEBOUNCE_DELAY = 800; | |
| 283 | 10014 | |
| 10015 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10016 | + | |
| 10017 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10018 | + | |
| 10019 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10020 | + | |
| 10021 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10022 | + | |
| 10023 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10024 | + | |
| 10025 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 10026 | + | |
| 10027 | +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); }; } | |
| 10028 | + | |
| 10029 | +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; } } | |
| 10030 | + | |
| 10031 | +var HandleDynamic = /*#__PURE__*/function (_After) { | |
| 10032 | + (0, _inherits2.default)(HandleDynamic, _After); | |
| 10033 | + | |
| 10034 | + var _super = _createSuper(HandleDynamic); | |
| 10035 | + | |
| 10036 | + function HandleDynamic() { | |
| 10037 | + (0, _classCallCheck2.default)(this, HandleDynamic); | |
| 10038 | + return _super.apply(this, arguments); | |
| 10039 | + } | |
| 10040 | + | |
| 10041 | + (0, _createClass2.default)(HandleDynamic, [{ | |
| 10042 | + key: "getCommand", | |
| 10043 | + value: function getCommand() { | |
| 10044 | + return 'document/elements/settings'; | |
| 10045 | + } | |
| 10046 | + }, { | |
| 10047 | + key: "getId", | |
| 10048 | + value: function getId() { | |
| 10049 | + return 'handle-dynamic'; | |
| 10050 | + } | |
| 10051 | + }, { | |
| 10052 | + key: "getContainerType", | |
| 10053 | + value: function getContainerType() { | |
| 10054 | + return 'dynamic'; | |
| 10055 | + } | |
| 10056 | + }, { | |
| 10057 | + key: "getConditions", | |
| 10058 | + value: function getConditions(args) { | |
| 10059 | + var _args$containers = args.containers, | |
| 10060 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 10061 | + return containers.some(function ( | |
| 10062 | + /**Container*/ | |
| 10063 | + container) { | |
| 10064 | + return 'dynamic' === container.type; | |
| 10065 | + }); | |
| 10066 | + } | |
| 10067 | + }, { | |
| 10068 | + key: "apply", | |
| 10069 | + value: function apply(args) { | |
| 10070 | + var _args$containers2 = args.containers, | |
| 10071 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 10072 | + containers.forEach(function ( | |
| 10073 | + /**Container*/ | |
| 10074 | + container) { | |
| 10075 | + if ('dynamic' === container.type) { | |
| 10076 | + var tagText = elementor.dynamicTags.tagContainerToTagText(container), | |
| 10077 | + commandArgs = { | |
| 10078 | + container: container.parent, | |
| 10079 | + settings: (0, _defineProperty2.default)({}, container.view.options.controlName, tagText) | |
| 10080 | + }; | |
| 10081 | + $e.run('document/dynamic/settings', commandArgs); | |
| 10082 | + } | |
| 10083 | + }); | |
| 10084 | + return true; | |
| 10085 | + } | |
| 10086 | + }]); | |
| 10087 | + return HandleDynamic; | |
| 10088 | +}(_after.default); | |
| 10089 | + | |
| 10090 | +exports.HandleDynamic = HandleDynamic; | |
| 10091 | +var _default = HandleDynamic; | |
| 10092 | +exports["default"] = _default; | |
| 10093 | + | |
| 10094 | +/***/ }), | |
| 10095 | + | |
| 10096 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/index.js": | |
| 10097 | +/*!***************************************************************************************!*\ | |
| 10098 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/settings/index.js ***! | |
| 10099 | + \***************************************************************************************/ | |
| 10100 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10101 | + | |
| 10102 | +"use strict"; | |
| 10103 | + | |
| 10104 | + | |
| 10105 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10106 | + value: true | |
| 10107 | +})); | |
| 10108 | +Object.defineProperty(exports, "HandleDynamic", ({ | |
| 10109 | + enumerable: true, | |
| 10110 | + get: function get() { | |
| 10111 | + return _handleDynamic.HandleDynamic; | |
| 10112 | + } | |
| 10113 | +})); | |
| 10114 | +Object.defineProperty(exports, "ResizeColumn", ({ | |
| 10115 | + enumerable: true, | |
| 10116 | + get: function get() { | |
| 10117 | + return _resizeColumn.ResizeColumn; | |
| 10118 | + } | |
| 10119 | +})); | |
| 10120 | +Object.defineProperty(exports, "ResizeColumnLimit", ({ | |
| 10121 | + enumerable: true, | |
| 10122 | + get: function get() { | |
| 10123 | + return _resizeColumnLimit.ResizeColumnLimit; | |
| 10124 | + } | |
| 10125 | +})); | |
| 10126 | +Object.defineProperty(exports, "SetStructure", ({ | |
| 10127 | + enumerable: true, | |
| 10128 | + get: function get() { | |
| 10129 | + return _setStructure.SetStructure; | |
| 10130 | + } | |
| 10131 | +})); | |
| 10132 | + | |
| 10133 | +var _handleDynamic = __webpack_require__(/*! ./handle-dynamic */ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/handle-dynamic.js"); | |
| 10134 | + | |
| 10135 | +var _resizeColumn = __webpack_require__(/*! ./resize-column */ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/resize-column.js"); | |
| 10136 | + | |
| 10137 | +var _resizeColumnLimit = __webpack_require__(/*! ./resize-column-limit */ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/resize-column-limit.js"); | |
| 10138 | + | |
| 10139 | +var _setStructure = __webpack_require__(/*! ./set-structure */ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/set-structure.js"); | |
| 10140 | + | |
| 10141 | +/***/ }), | |
| 10142 | + | |
| 10143 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/resize-column-limit.js": | |
| 10144 | +/*!*****************************************************************************************************!*\ | |
| 10145 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/settings/resize-column-limit.js ***! | |
| 10146 | + \*****************************************************************************************************/ | |
| 10147 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10148 | + | |
| 10149 | +"use strict"; | |
| 10150 | + | |
| 10151 | + | |
| 10152 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10153 | + | |
| 10154 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10155 | + value: true | |
| 10156 | +})); | |
| 10157 | +exports["default"] = exports.ResizeColumnLimit = void 0; | |
| 10158 | + | |
| 10159 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10160 | + | |
| 10161 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10162 | + | |
| 10163 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10164 | + | |
| 10165 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10166 | + | |
| 10167 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10168 | + | |
| 10169 | +var _dependency = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js")); | |
| 10170 | + | |
| 10171 | +var _section = __webpack_require__(/*! elementor-elements/views/section */ "../assets/dev/js/editor/elements/views/section.js"); | |
| 10172 | + | |
| 10173 | +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); }; } | |
| 10174 | + | |
| 10175 | +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; } } | |
| 10176 | + | |
| 10177 | +var ResizeColumnLimit = /*#__PURE__*/function (_Dependency) { | |
| 10178 | + (0, _inherits2.default)(ResizeColumnLimit, _Dependency); | |
| 10179 | + | |
| 10180 | + var _super = _createSuper(ResizeColumnLimit); | |
| 10181 | + | |
| 10182 | + function ResizeColumnLimit() { | |
| 10183 | + (0, _classCallCheck2.default)(this, ResizeColumnLimit); | |
| 10184 | + return _super.apply(this, arguments); | |
| 10185 | + } | |
| 10186 | + | |
| 10187 | + (0, _createClass2.default)(ResizeColumnLimit, [{ | |
| 10188 | + key: "getCommand", | |
| 10189 | + value: function getCommand() { | |
| 10190 | + return 'document/elements/settings'; | |
| 10191 | + } | |
| 10192 | + }, { | |
| 10193 | + key: "getId", | |
| 10194 | + value: function getId() { | |
| 10195 | + return 'resize-column-limit'; | |
| 10196 | + } | |
| 10197 | + }, { | |
| 10198 | + key: "getContainerType", | |
| 10199 | + value: function getContainerType() { | |
| 10200 | + return 'column'; | |
| 10201 | + } | |
| 10202 | + }, { | |
| 10203 | + key: "getConditions", | |
| 10204 | + value: function getConditions(args) { | |
| 10205 | + return args.settings._inline_size; | |
| 10206 | + } | |
| 10207 | + }, { | |
| 10208 | + key: "apply", | |
| 10209 | + value: function apply(args) { | |
| 10210 | + var _args$containers = args.containers, | |
| 10211 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 10212 | + return containers.some(function ( | |
| 10213 | + /**Container*/ | |
| 10214 | + container) { | |
| 10215 | + var parentView = container.parent.view, | |
| 10216 | + columnView = container.view, | |
| 10217 | + currentSize = container.settings.get('_inline_size') || container.settings.get('_column_size'), | |
| 10218 | + newSize = args.settings._inline_size, | |
| 10219 | + nextChildView = parentView.getNextColumn(columnView) || parentView.getPreviousColumn(columnView); | |
| 10220 | + | |
| 10221 | + if (!nextChildView) { | |
| 10222 | + if ($e.devTools) { | |
| 10223 | + $e.devTools.log.error('There is not any next column'); | |
| 10224 | + } | |
| 10225 | + | |
| 10226 | + return false; | |
| 10227 | + } | |
| 10228 | + | |
| 10229 | + var $nextElement = nextChildView.$el, | |
| 10230 | + nextElementCurrentSize = +nextChildView.model.getSetting('_inline_size') || parentView.getColumnPercentSize($nextElement, $nextElement[0].getBoundingClientRect().width), | |
| 10231 | + nextElementNewSize = +(currentSize + nextElementCurrentSize - newSize).toFixed(3); | |
| 10232 | + | |
| 10233 | + if (nextElementNewSize < _section.DEFAULT_INNER_SECTION_COLUMNS) { | |
| 10234 | + if ($e.devTools) { | |
| 10235 | + $e.devTools.log.error('New column width is too large'); | |
| 10236 | + } | |
| 10237 | + | |
| 10238 | + return false; | |
| 10239 | + } | |
| 10240 | + | |
| 10241 | + if (newSize < _section.DEFAULT_INNER_SECTION_COLUMNS) { | |
| 10242 | + if ($e.devTools) { | |
| 10243 | + $e.devTools.log.error('New column width is too small'); | |
| 10244 | + } | |
| 10245 | + | |
| 10246 | + return false; | |
| 10247 | + } | |
| 10248 | + | |
| 10249 | + return true; | |
| 10250 | + }); | |
| 10251 | + } | |
| 10252 | + }]); | |
| 10253 | + return ResizeColumnLimit; | |
| 10254 | +}(_dependency.default); | |
| 10255 | + | |
| 10256 | +exports.ResizeColumnLimit = ResizeColumnLimit; | |
| 10257 | +var _default = ResizeColumnLimit; | |
| 10258 | +exports["default"] = _default; | |
| 10259 | + | |
| 10260 | +/***/ }), | |
| 10261 | + | |
| 10262 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/resize-column.js": | |
| 10263 | +/*!***********************************************************************************************!*\ | |
| 10264 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/settings/resize-column.js ***! | |
| 10265 | + \***********************************************************************************************/ | |
| 10266 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10267 | + | |
| 10268 | +"use strict"; | |
| 10269 | + | |
| 10270 | + | |
| 10271 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10272 | + | |
| 10273 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10274 | + value: true | |
| 10275 | +})); | |
| 10276 | +exports["default"] = exports.ResizeColumn = void 0; | |
| 10277 | + | |
| 10278 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10279 | + | |
| 10280 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10281 | + | |
| 10282 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10283 | + | |
| 10284 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10285 | + | |
| 10286 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10287 | + | |
| 10288 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 10289 | + | |
| 10290 | +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); }; } | |
| 10291 | + | |
| 10292 | +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; } } | |
| 10293 | + | |
| 10294 | +var ResizeColumn = /*#__PURE__*/function (_After) { | |
| 10295 | + (0, _inherits2.default)(ResizeColumn, _After); | |
| 10296 | + | |
| 10297 | + var _super = _createSuper(ResizeColumn); | |
| 10298 | + | |
| 10299 | + function ResizeColumn() { | |
| 10300 | + (0, _classCallCheck2.default)(this, ResizeColumn); | |
| 10301 | + return _super.apply(this, arguments); | |
| 10302 | + } | |
| 10303 | + | |
| 10304 | + (0, _createClass2.default)(ResizeColumn, [{ | |
| 10305 | + key: "getCommand", | |
| 10306 | + value: function getCommand() { | |
| 10307 | + return 'document/elements/settings'; | |
| 10308 | + } | |
| 10309 | + }, { | |
| 10310 | + key: "getId", | |
| 10311 | + value: function getId() { | |
| 10312 | + return 'resize-column'; | |
| 10313 | + } | |
| 10314 | + }, { | |
| 10315 | + key: "getContainerType", | |
| 10316 | + value: function getContainerType() { | |
| 10317 | + return 'column'; | |
| 10318 | + } | |
| 10319 | + }, { | |
| 10320 | + key: "getConditions", | |
| 10321 | + value: function getConditions(args) { | |
| 10322 | + return args.settings._inline_size; | |
| 10323 | + } | |
| 10324 | + }, { | |
| 10325 | + key: "apply", | |
| 10326 | + value: function apply(args) { | |
| 10327 | + var _this = this; | |
| 10328 | + | |
| 10329 | + var _args$containers = args.containers, | |
| 10330 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 10331 | + containers.forEach(function ( | |
| 10332 | + /**Container*/ | |
| 10333 | + container) { | |
| 10334 | + _this.resizeColumn(container, args.settings._inline_size); | |
| 10335 | + }); | |
| 10336 | + return true; | |
| 10337 | + } | |
| 10338 | + }, { | |
| 10339 | + key: "resizeColumn", | |
| 10340 | + value: function resizeColumn(container, newSize) { | |
| 10341 | + var nextContainer = container.parent.view.getNeighborContainer(container); | |
| 10342 | + | |
| 10343 | + if (!nextContainer) { | |
| 10344 | + return false; | |
| 10345 | + } | |
| 10346 | + | |
| 10347 | + var parentView = container.parent.view, | |
| 10348 | + currentColumnView = container.view; | |
| 10349 | + var currentSize = null; | |
| 10350 | + | |
| 10351 | + if (undefined === container.oldValues || null === container.oldValues._inline_size) { | |
| 10352 | + // Mean, that it was not set before ( first time ). | |
| 10353 | + currentSize = container.settings.get('_column_size'); | |
| 10354 | + } else { | |
| 10355 | + var totalWidth = parentView.$el.find(' > .elementor-container')[0].getBoundingClientRect().width; | |
| 10356 | + currentSize = +(container.oldValues._inline_size || currentColumnView.el.getBoundingClientRect().width / totalWidth * 100); | |
| 10357 | + } | |
| 10358 | + | |
| 10359 | + var nextChildView = nextContainer.view, | |
| 10360 | + $nextElement = nextChildView.$el, | |
| 10361 | + nextElementCurrentSize = +nextChildView.model.getSetting('_inline_size') || container.parent.view.getColumnPercentSize($nextElement, $nextElement[0].getBoundingClientRect().width), | |
| 10362 | + nextElementNewSize = +(currentSize + nextElementCurrentSize - newSize).toFixed(3); | |
| 10363 | + /** | |
| 10364 | + * TODO: Hook prevented ( next command will not call recursive hook ), but we didnt tell the hook to be prevented | |
| 10365 | + * consider: '$e.hooks.preventRecursive()'. | |
| 10366 | + */ | |
| 10367 | + | |
| 10368 | + $e.run('document/elements/settings', { | |
| 10369 | + containers: [nextContainer], | |
| 10370 | + settings: { | |
| 10371 | + _inline_size: nextElementNewSize | |
| 10372 | + }, | |
| 10373 | + options: { | |
| 10374 | + callbacks: { | |
| 10375 | + 'resize-column-limit': false | |
| 10376 | + }, | |
| 10377 | + history: { | |
| 10378 | + title: elementor.config.elements.column.controls._inline_size.label | |
| 10379 | + }, | |
| 10380 | + external: true, | |
| 10381 | + debounce: true | |
| 10382 | + } | |
| 10383 | + }); | |
| 10384 | + return true; | |
| 10385 | + } | |
| 10386 | + }]); | |
| 10387 | + return ResizeColumn; | |
| 10388 | +}(_after.default); | |
| 10389 | + | |
| 10390 | +exports.ResizeColumn = ResizeColumn; | |
| 10391 | +var _default = ResizeColumn; | |
| 10392 | +exports["default"] = _default; | |
| 10393 | + | |
| 10394 | +/***/ }), | |
| 10395 | + | |
| 10396 | +/***/ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/set-structure.js": | |
| 10397 | +/*!***********************************************************************************************!*\ | |
| 10398 | + !*** ../assets/dev/js/editor/document/hooks/data/document/elements/settings/set-structure.js ***! | |
| 10399 | + \***********************************************************************************************/ | |
| 10400 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10401 | + | |
| 10402 | +"use strict"; | |
| 10403 | + | |
| 10404 | + | |
| 10405 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10406 | + | |
| 10407 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10408 | + value: true | |
| 10409 | +})); | |
| 10410 | +exports["default"] = exports.SetStructure = void 0; | |
| 10411 | + | |
| 10412 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10413 | + | |
| 10414 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10415 | + | |
| 10416 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10417 | + | |
| 10418 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10419 | + | |
| 10420 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10421 | + | |
| 10422 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/data/after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js")); | |
| 10423 | + | |
| 10424 | +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); }; } | |
| 10425 | + | |
| 10426 | +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; } } | |
| 10427 | + | |
| 10428 | +var SetStructure = /*#__PURE__*/function (_After) { | |
| 10429 | + (0, _inherits2.default)(SetStructure, _After); | |
| 10430 | + | |
| 10431 | + var _super = _createSuper(SetStructure); | |
| 10432 | + | |
| 10433 | + function SetStructure() { | |
| 10434 | + (0, _classCallCheck2.default)(this, SetStructure); | |
| 10435 | + return _super.apply(this, arguments); | |
| 10436 | + } | |
| 10437 | + | |
| 10438 | + (0, _createClass2.default)(SetStructure, [{ | |
| 10439 | + key: "getCommand", | |
| 10440 | + value: function getCommand() { | |
| 10441 | + return 'document/elements/settings'; | |
| 10442 | + } | |
| 10443 | + }, { | |
| 10444 | + key: "getId", | |
| 10445 | + value: function getId() { | |
| 10446 | + return 'set-structure'; | |
| 10447 | + } | |
| 10448 | + }, { | |
| 10449 | + key: "getContainerType", | |
| 10450 | + value: function getContainerType() { | |
| 10451 | + return 'section'; | |
| 10452 | + } | |
| 10453 | + }, { | |
| 10454 | + key: "getConditions", | |
| 10455 | + value: function getConditions(args) { | |
| 10456 | + return !!args.settings.structure; | |
| 10457 | + } | |
| 10458 | + }, { | |
| 10459 | + key: "apply", | |
| 10460 | + value: function apply(args) { | |
| 10461 | + var _args$containers = args.containers, | |
| 10462 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 10463 | + containers.forEach(function ( | |
| 10464 | + /**Container*/ | |
| 10465 | + container) { | |
| 10466 | + container.view.adjustColumns(); | |
| 10467 | + }); | |
| 10468 | + return true; | |
| 10469 | + } | |
| 10470 | + }]); | |
| 10471 | + return SetStructure; | |
| 10472 | +}(_after.default); | |
| 10473 | + | |
| 10474 | +exports.SetStructure = SetStructure; | |
| 10475 | +var _default = SetStructure; | |
| 10476 | +exports["default"] = _default; | |
| 10477 | + | |
| 10478 | +/***/ }), | |
| 10479 | + | |
| 10480 | +/***/ "../assets/dev/js/editor/document/hooks/data/index.js": | |
| 10481 | +/*!************************************************************!*\ | |
| 10482 | + !*** ../assets/dev/js/editor/document/hooks/data/index.js ***! | |
| 10483 | + \************************************************************/ | |
| 10484 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10485 | + | |
| 10486 | +"use strict"; | |
| 10487 | + | |
| 10488 | + | |
| 10489 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10490 | + value: true | |
| 10491 | +})); | |
| 10492 | + | |
| 10493 | +var _create = __webpack_require__(/*! ./document/elements/create/ */ "../assets/dev/js/editor/document/hooks/data/document/elements/create/index.js"); | |
| 10494 | + | |
| 10495 | +Object.keys(_create).forEach(function (key) { | |
| 10496 | + if (key === "default" || key === "__esModule") return; | |
| 10497 | + if (key in exports && exports[key] === _create[key]) return; | |
| 10498 | + Object.defineProperty(exports, key, { | |
| 10499 | + enumerable: true, | |
| 10500 | + get: function get() { | |
| 10501 | + return _create[key]; | |
| 10502 | + } | |
| 10503 | + }); | |
| 10504 | +}); | |
| 10505 | + | |
| 10506 | +var _delete = __webpack_require__(/*! ./document/elements/delete/ */ "../assets/dev/js/editor/document/hooks/data/document/elements/delete/index.js"); | |
| 10507 | + | |
| 10508 | +Object.keys(_delete).forEach(function (key) { | |
| 10509 | + if (key === "default" || key === "__esModule") return; | |
| 10510 | + if (key in exports && exports[key] === _delete[key]) return; | |
| 10511 | + Object.defineProperty(exports, key, { | |
| 10512 | + enumerable: true, | |
| 10513 | + get: function get() { | |
| 10514 | + return _delete[key]; | |
| 10515 | + } | |
| 10516 | + }); | |
| 10517 | +}); | |
| 10518 | + | |
| 10519 | +var _move = __webpack_require__(/*! ./document/elements/move/ */ "../assets/dev/js/editor/document/hooks/data/document/elements/move/index.js"); | |
| 10520 | + | |
| 10521 | +Object.keys(_move).forEach(function (key) { | |
| 10522 | + if (key === "default" || key === "__esModule") return; | |
| 10523 | + if (key in exports && exports[key] === _move[key]) return; | |
| 10524 | + Object.defineProperty(exports, key, { | |
| 10525 | + enumerable: true, | |
| 10526 | + get: function get() { | |
| 10527 | + return _move[key]; | |
| 10528 | + } | |
| 10529 | + }); | |
| 10530 | +}); | |
| 10531 | + | |
| 10532 | +var _paste = __webpack_require__(/*! ./document/elements/paste/ */ "../assets/dev/js/editor/document/hooks/data/document/elements/paste/index.js"); | |
| 10533 | + | |
| 10534 | +Object.keys(_paste).forEach(function (key) { | |
| 10535 | + if (key === "default" || key === "__esModule") return; | |
| 10536 | + if (key in exports && exports[key] === _paste[key]) return; | |
| 10537 | + Object.defineProperty(exports, key, { | |
| 10538 | + enumerable: true, | |
| 10539 | + get: function get() { | |
| 10540 | + return _paste[key]; | |
| 10541 | + } | |
| 10542 | + }); | |
| 10543 | +}); | |
| 10544 | + | |
| 10545 | +var _settings = __webpack_require__(/*! ./document/elements/settings/ */ "../assets/dev/js/editor/document/hooks/data/document/elements/settings/index.js"); | |
| 10546 | + | |
| 10547 | +Object.keys(_settings).forEach(function (key) { | |
| 10548 | + if (key === "default" || key === "__esModule") return; | |
| 10549 | + if (key in exports && exports[key] === _settings[key]) return; | |
| 10550 | + Object.defineProperty(exports, key, { | |
| 10551 | + enumerable: true, | |
| 10552 | + get: function get() { | |
| 10553 | + return _settings[key]; | |
| 10554 | + } | |
| 10555 | + }); | |
| 10556 | +}); | |
| 10557 | + | |
| 10558 | +/***/ }), | |
| 10559 | + | |
| 10560 | +/***/ "../assets/dev/js/editor/document/hooks/index.js": | |
| 10561 | +/*!*******************************************************!*\ | |
| 10562 | + !*** ../assets/dev/js/editor/document/hooks/index.js ***! | |
| 10563 | + \*******************************************************/ | |
| 10564 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10565 | + | |
| 10566 | +"use strict"; | |
| 10567 | + | |
| 10568 | + | |
| 10569 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10570 | + value: true | |
| 10571 | +})); | |
| 10572 | + | |
| 10573 | +var _data = __webpack_require__(/*! ./data/ */ "../assets/dev/js/editor/document/hooks/data/index.js"); | |
| 10574 | + | |
| 10575 | +Object.keys(_data).forEach(function (key) { | |
| 10576 | + if (key === "default" || key === "__esModule") return; | |
| 10577 | + if (key in exports && exports[key] === _data[key]) return; | |
| 10578 | + Object.defineProperty(exports, key, { | |
| 10579 | + enumerable: true, | |
| 10580 | + get: function get() { | |
| 10581 | + return _data[key]; | |
| 10582 | + } | |
| 10583 | + }); | |
| 10584 | +}); | |
| 10585 | + | |
| 10586 | +var _ui = __webpack_require__(/*! ./ui/ */ "../assets/dev/js/editor/document/hooks/ui/index.js"); | |
| 10587 | + | |
| 10588 | +Object.keys(_ui).forEach(function (key) { | |
| 10589 | + if (key === "default" || key === "__esModule") return; | |
| 10590 | + if (key in exports && exports[key] === _ui[key]) return; | |
| 10591 | + Object.defineProperty(exports, key, { | |
| 10592 | + enumerable: true, | |
| 10593 | + get: function get() { | |
| 10594 | + return _ui[key]; | |
| 10595 | + } | |
| 10596 | + }); | |
| 10597 | +}); | |
| 10598 | + | |
| 10599 | +/***/ }), | |
| 10600 | + | |
| 10601 | +/***/ "../assets/dev/js/editor/document/hooks/ui/create/column-is-populated.js": | |
| 10602 | +/*!*******************************************************************************!*\ | |
| 10603 | + !*** ../assets/dev/js/editor/document/hooks/ui/create/column-is-populated.js ***! | |
| 10604 | + \*******************************************************************************/ | |
| 10605 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10606 | + | |
| 10607 | +"use strict"; | |
| 10608 | + | |
| 10609 | + | |
| 10610 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10611 | + | |
| 10612 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10613 | + value: true | |
| 10614 | +})); | |
| 10615 | +exports["default"] = exports.ColumnIsPopulated = void 0; | |
| 10616 | + | |
| 10617 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10618 | + | |
| 10619 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10620 | + | |
| 10621 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10622 | + | |
| 10623 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10624 | + | |
| 10625 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10626 | + | |
| 10627 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 10628 | + | |
| 10629 | +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); }; } | |
| 10630 | + | |
| 10631 | +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; } } | |
| 10632 | + | |
| 10633 | +var ColumnIsPopulated = /*#__PURE__*/function (_After) { | |
| 10634 | + (0, _inherits2.default)(ColumnIsPopulated, _After); | |
| 10635 | + | |
| 10636 | + var _super = _createSuper(ColumnIsPopulated); | |
| 10637 | + | |
| 10638 | + function ColumnIsPopulated() { | |
| 10639 | + (0, _classCallCheck2.default)(this, ColumnIsPopulated); | |
| 10640 | + return _super.apply(this, arguments); | |
| 10641 | + } | |
| 10642 | + | |
| 10643 | + (0, _createClass2.default)(ColumnIsPopulated, [{ | |
| 10644 | + key: "getCommand", | |
| 10645 | + value: function getCommand() { | |
| 10646 | + return 'document/elements/create'; | |
| 10647 | + } | |
| 10648 | + }, { | |
| 10649 | + key: "getId", | |
| 10650 | + value: function getId() { | |
| 10651 | + return 'column-is-populated'; | |
| 10652 | + } | |
| 10653 | + }, { | |
| 10654 | + key: "getConditions", | |
| 10655 | + value: function getConditions(args) { | |
| 10656 | + var _args$containers = args.containers, | |
| 10657 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; // If the created element, was created at column. | |
| 10658 | + | |
| 10659 | + return containers.some(function ( | |
| 10660 | + /**Container*/ | |
| 10661 | + container) { | |
| 10662 | + return 'column' === container.model.get('elType'); | |
| 10663 | + }); | |
| 10664 | + } | |
| 10665 | + }, { | |
| 10666 | + key: "apply", | |
| 10667 | + value: function apply(args) { | |
| 10668 | + var _args$containers2 = args.containers, | |
| 10669 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 10670 | + containers.forEach(function ( | |
| 10671 | + /* Container */ | |
| 10672 | + container) { | |
| 10673 | + if ('column' === container.model.get('elType')) { | |
| 10674 | + container.view.changeChildContainerClasses(); | |
| 10675 | + } | |
| 10676 | + }); | |
| 10677 | + } | |
| 10678 | + }]); | |
| 10679 | + return ColumnIsPopulated; | |
| 10680 | +}(_after.default); | |
| 10681 | + | |
| 10682 | +exports.ColumnIsPopulated = ColumnIsPopulated; | |
| 10683 | +var _default = ColumnIsPopulated; | |
| 10684 | +exports["default"] = _default; | |
| 10685 | + | |
| 10686 | +/***/ }), | |
| 10687 | + | |
| 10688 | +/***/ "../assets/dev/js/editor/document/hooks/ui/create/index.js": | |
| 10689 | +/*!*****************************************************************!*\ | |
| 10690 | + !*** ../assets/dev/js/editor/document/hooks/ui/create/index.js ***! | |
| 10691 | + \*****************************************************************/ | |
| 10692 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10693 | + | |
| 10694 | +"use strict"; | |
| 10695 | + | |
| 10696 | + | |
| 10697 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10698 | + value: true | |
| 10699 | +})); | |
| 10700 | +Object.defineProperty(exports, "ColumnIsPopulated", ({ | |
| 10701 | + enumerable: true, | |
| 10702 | + get: function get() { | |
| 10703 | + return _columnIsPopulated.ColumnIsPopulated; | |
| 10704 | + } | |
| 10705 | +})); | |
| 10706 | +Object.defineProperty(exports, "CreateSectionIsFull", ({ | |
| 10707 | + enumerable: true, | |
| 10708 | + get: function get() { | |
| 10709 | + return _sectionIsFull.CreateSectionIsFull; | |
| 10710 | + } | |
| 10711 | +})); | |
| 10712 | + | |
| 10713 | +var _columnIsPopulated = __webpack_require__(/*! ../create/column-is-populated.js */ "../assets/dev/js/editor/document/hooks/ui/create/column-is-populated.js"); | |
| 10714 | + | |
| 10715 | +var _sectionIsFull = __webpack_require__(/*! ./section-is-full */ "../assets/dev/js/editor/document/hooks/ui/create/section-is-full.js"); | |
| 10716 | + | |
| 10717 | +/***/ }), | |
| 10718 | + | |
| 10719 | +/***/ "../assets/dev/js/editor/document/hooks/ui/create/section-is-full.js": | |
| 10720 | +/*!***************************************************************************!*\ | |
| 10721 | + !*** ../assets/dev/js/editor/document/hooks/ui/create/section-is-full.js ***! | |
| 10722 | + \***************************************************************************/ | |
| 10723 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10724 | + | |
| 10725 | +"use strict"; | |
| 10726 | + | |
| 10727 | + | |
| 10728 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10729 | + | |
| 10730 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10731 | + value: true | |
| 10732 | +})); | |
| 10733 | +exports["default"] = exports.CreateSectionIsFull = void 0; | |
| 10734 | + | |
| 10735 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10736 | + | |
| 10737 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10738 | + | |
| 10739 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10740 | + | |
| 10741 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10742 | + | |
| 10743 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10744 | + | |
| 10745 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 10746 | + | |
| 10747 | +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); }; } | |
| 10748 | + | |
| 10749 | +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; } } | |
| 10750 | + | |
| 10751 | +var CreateSectionIsFull = /*#__PURE__*/function (_After) { | |
| 10752 | + (0, _inherits2.default)(CreateSectionIsFull, _After); | |
| 10753 | + | |
| 10754 | + var _super = _createSuper(CreateSectionIsFull); | |
| 10755 | + | |
| 10756 | + function CreateSectionIsFull() { | |
| 10757 | + (0, _classCallCheck2.default)(this, CreateSectionIsFull); | |
| 10758 | + return _super.apply(this, arguments); | |
| 10759 | + } | |
| 10760 | + | |
| 10761 | + (0, _createClass2.default)(CreateSectionIsFull, [{ | |
| 10762 | + key: "getCommand", | |
| 10763 | + value: function getCommand() { | |
| 10764 | + return 'document/elements/create'; | |
| 10765 | + } | |
| 10766 | + }, { | |
| 10767 | + key: "getId", | |
| 10768 | + value: function getId() { | |
| 10769 | + return 'create-section-is-full'; | |
| 10770 | + } | |
| 10771 | + }, { | |
| 10772 | + key: "getConditions", | |
| 10773 | + value: function getConditions(args) { | |
| 10774 | + var _args$containers = args.containers, | |
| 10775 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 10776 | + return containers.some(function ( | |
| 10777 | + /* Container */ | |
| 10778 | + container) { | |
| 10779 | + return 'section' === container.model.get('elType'); | |
| 10780 | + }); | |
| 10781 | + } | |
| 10782 | + }, { | |
| 10783 | + key: "apply", | |
| 10784 | + value: function apply(args) { | |
| 10785 | + var _args$containers2 = args.containers, | |
| 10786 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 10787 | + containers.forEach(function ( | |
| 10788 | + /* Container */ | |
| 10789 | + container) { | |
| 10790 | + if ('section' === container.model.get('elType')) { | |
| 10791 | + container.view.toggleSectionIsFull(); | |
| 10792 | + } | |
| 10793 | + }); | |
| 10794 | + } | |
| 10795 | + }]); | |
| 10796 | + return CreateSectionIsFull; | |
| 10797 | +}(_after.default); | |
| 10798 | + | |
| 10799 | +exports.CreateSectionIsFull = CreateSectionIsFull; | |
| 10800 | +var _default = CreateSectionIsFull; | |
| 10801 | +exports["default"] = _default; | |
| 10802 | + | |
| 10803 | +/***/ }), | |
| 10804 | + | |
| 10805 | +/***/ "../assets/dev/js/editor/document/hooks/ui/delete/column-is-empty.js": | |
| 10806 | +/*!***************************************************************************!*\ | |
| 10807 | + !*** ../assets/dev/js/editor/document/hooks/ui/delete/column-is-empty.js ***! | |
| 10808 | + \***************************************************************************/ | |
| 10809 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10810 | + | |
| 10811 | +"use strict"; | |
| 10812 | + | |
| 10813 | + | |
| 10814 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10815 | + | |
| 10816 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10817 | + value: true | |
| 10818 | +})); | |
| 10819 | +exports["default"] = exports.ColumnIsEmpty = void 0; | |
| 10820 | + | |
| 10821 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10822 | + | |
| 10823 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10824 | + | |
| 10825 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10826 | + | |
| 10827 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10828 | + | |
| 10829 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10830 | + | |
| 10831 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 10832 | + | |
| 10833 | +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); }; } | |
| 10834 | + | |
| 10835 | +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; } } | |
| 10836 | + | |
| 10837 | +var ColumnIsEmpty = /*#__PURE__*/function (_After) { | |
| 10838 | + (0, _inherits2.default)(ColumnIsEmpty, _After); | |
| 10839 | + | |
| 10840 | + var _super = _createSuper(ColumnIsEmpty); | |
| 10841 | + | |
| 10842 | + function ColumnIsEmpty() { | |
| 10843 | + (0, _classCallCheck2.default)(this, ColumnIsEmpty); | |
| 10844 | + return _super.apply(this, arguments); | |
| 10845 | + } | |
| 10846 | + | |
| 10847 | + (0, _createClass2.default)(ColumnIsEmpty, [{ | |
| 10848 | + key: "getCommand", | |
| 10849 | + value: function getCommand() { | |
| 10850 | + return 'document/elements/delete'; | |
| 10851 | + } | |
| 10852 | + }, { | |
| 10853 | + key: "getId", | |
| 10854 | + value: function getId() { | |
| 10855 | + return 'column-is-empty'; | |
| 10856 | + } | |
| 10857 | + }, { | |
| 10858 | + key: "getConditions", | |
| 10859 | + value: function getConditions(args) { | |
| 10860 | + var _args$containers = args.containers, | |
| 10861 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; // If the deleted element, was deleted from column. | |
| 10862 | + | |
| 10863 | + return containers.some(function ( | |
| 10864 | + /**Container*/ | |
| 10865 | + container) { | |
| 10866 | + return 'column' === container.parent.model.get('elType'); | |
| 10867 | + }); | |
| 10868 | + } | |
| 10869 | + }, { | |
| 10870 | + key: "apply", | |
| 10871 | + value: function apply(args) { | |
| 10872 | + var _args$containers2 = args.containers, | |
| 10873 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 10874 | + containers.forEach(function ( | |
| 10875 | + /* Container */ | |
| 10876 | + container) { | |
| 10877 | + if ('column' === container.parent.model.get('elType')) { | |
| 10878 | + container.parent.view.changeChildContainerClasses(); | |
| 10879 | + } | |
| 10880 | + }); | |
| 10881 | + } | |
| 10882 | + }]); | |
| 10883 | + return ColumnIsEmpty; | |
| 10884 | +}(_after.default); | |
| 10885 | + | |
| 10886 | +exports.ColumnIsEmpty = ColumnIsEmpty; | |
| 10887 | +var _default = ColumnIsEmpty; | |
| 10888 | +exports["default"] = _default; | |
| 10889 | + | |
| 10890 | +/***/ }), | |
| 10891 | + | |
| 10892 | +/***/ "../assets/dev/js/editor/document/hooks/ui/delete/index.js": | |
| 10893 | +/*!*****************************************************************!*\ | |
| 10894 | + !*** ../assets/dev/js/editor/document/hooks/ui/delete/index.js ***! | |
| 10895 | + \*****************************************************************/ | |
| 10896 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10897 | + | |
| 10898 | +"use strict"; | |
| 10899 | + | |
| 10900 | + | |
| 10901 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10902 | + value: true | |
| 10903 | +})); | |
| 10904 | +Object.defineProperty(exports, "ColumnIsEmpty", ({ | |
| 10905 | + enumerable: true, | |
| 10906 | + get: function get() { | |
| 10907 | + return _columnIsEmpty.ColumnIsEmpty; | |
| 10908 | + } | |
| 10909 | +})); | |
| 10910 | +Object.defineProperty(exports, "DeleteSectionIsFull", ({ | |
| 10911 | + enumerable: true, | |
| 10912 | + get: function get() { | |
| 10913 | + return _sectionIsFull.DeleteSectionIsFull; | |
| 10914 | + } | |
| 10915 | +})); | |
| 10916 | + | |
| 10917 | +var _columnIsEmpty = __webpack_require__(/*! ./column-is-empty */ "../assets/dev/js/editor/document/hooks/ui/delete/column-is-empty.js"); | |
| 10918 | + | |
| 10919 | +var _sectionIsFull = __webpack_require__(/*! ./section-is-full */ "../assets/dev/js/editor/document/hooks/ui/delete/section-is-full.js"); | |
| 10920 | + | |
| 10921 | +/***/ }), | |
| 10922 | + | |
| 10923 | +/***/ "../assets/dev/js/editor/document/hooks/ui/delete/section-is-full.js": | |
| 10924 | +/*!***************************************************************************!*\ | |
| 10925 | + !*** ../assets/dev/js/editor/document/hooks/ui/delete/section-is-full.js ***! | |
| 10926 | + \***************************************************************************/ | |
| 10927 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10928 | + | |
| 10929 | +"use strict"; | |
| 10930 | + | |
| 10931 | + | |
| 10932 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 10933 | + | |
| 10934 | +Object.defineProperty(exports, "__esModule", ({ | |
| 10935 | + value: true | |
| 10936 | +})); | |
| 10937 | +exports["default"] = exports.DeleteSectionIsFull = void 0; | |
| 10938 | + | |
| 10939 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 10940 | + | |
| 10941 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 10942 | + | |
| 10943 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 10944 | + | |
| 10945 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 10946 | + | |
| 10947 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 10948 | + | |
| 10949 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 10950 | + | |
| 10951 | +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); }; } | |
| 10952 | + | |
| 10953 | +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; } } | |
| 10954 | + | |
| 10955 | +var DeleteSectionIsFull = /*#__PURE__*/function (_After) { | |
| 10956 | + (0, _inherits2.default)(DeleteSectionIsFull, _After); | |
| 10957 | + | |
| 10958 | + var _super = _createSuper(DeleteSectionIsFull); | |
| 10959 | + | |
| 10960 | + function DeleteSectionIsFull() { | |
| 10961 | + (0, _classCallCheck2.default)(this, DeleteSectionIsFull); | |
| 10962 | + return _super.apply(this, arguments); | |
| 10963 | + } | |
| 10964 | + | |
| 10965 | + (0, _createClass2.default)(DeleteSectionIsFull, [{ | |
| 10966 | + key: "getCommand", | |
| 10967 | + value: function getCommand() { | |
| 10968 | + return 'document/elements/delete'; | |
| 10969 | + } | |
| 10970 | + }, { | |
| 10971 | + key: "getId", | |
| 10972 | + value: function getId() { | |
| 10973 | + return 'delete-section-is-full'; | |
| 10974 | + } | |
| 10975 | + }, { | |
| 10976 | + key: "getConditions", | |
| 10977 | + value: function getConditions(args) { | |
| 10978 | + var _args$containers = args.containers, | |
| 10979 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 10980 | + return containers.some(function ( | |
| 10981 | + /* Container */ | |
| 10982 | + container) { | |
| 10983 | + return 'column' === container.model.get('elType'); | |
| 10984 | + }); | |
| 10985 | + } | |
| 10986 | + }, { | |
| 10987 | + key: "apply", | |
| 10988 | + value: function apply(args) { | |
| 10989 | + var _args$containers2 = args.containers, | |
| 10990 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 10991 | + containers.forEach(function ( | |
| 10992 | + /* Container */ | |
| 10993 | + container) { | |
| 10994 | + if ('column' === container.model.get('elType')) { | |
| 10995 | + container.parent.view.toggleSectionIsFull(); | |
| 10996 | + } | |
| 10997 | + }); | |
| 10998 | + } | |
| 10999 | + }]); | |
| 11000 | + return DeleteSectionIsFull; | |
| 11001 | +}(_after.default); | |
| 11002 | + | |
| 11003 | +exports.DeleteSectionIsFull = DeleteSectionIsFull; | |
| 11004 | +var _default = DeleteSectionIsFull; | |
| 11005 | +exports["default"] = _default; | |
| 11006 | + | |
| 11007 | +/***/ }), | |
| 11008 | + | |
| 11009 | +/***/ "../assets/dev/js/editor/document/hooks/ui/document/elements/create/index.js": | |
| 11010 | +/*!***********************************************************************************!*\ | |
| 11011 | + !*** ../assets/dev/js/editor/document/hooks/ui/document/elements/create/index.js ***! | |
| 11012 | + \***********************************************************************************/ | |
| 11013 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11014 | + | |
| 11015 | +"use strict"; | |
| 11016 | + | |
| 11017 | + | |
| 11018 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11019 | + value: true | |
| 11020 | +})); | |
| 11021 | +Object.defineProperty(exports, "MoveResizeableHandle", ({ | |
| 11022 | + enumerable: true, | |
| 11023 | + get: function get() { | |
| 11024 | + return _moveResizeableHandle.MoveResizeableHandle; | |
| 11025 | + } | |
| 11026 | +})); | |
| 11027 | + | |
| 11028 | +var _moveResizeableHandle = __webpack_require__(/*! ./move-resizeable-handle */ "../assets/dev/js/editor/document/hooks/ui/document/elements/create/move-resizeable-handle.js"); | |
| 11029 | + | |
| 11030 | +/***/ }), | |
| 11031 | + | |
| 11032 | +/***/ "../assets/dev/js/editor/document/hooks/ui/document/elements/create/move-resizeable-handle.js": | |
| 11033 | +/*!****************************************************************************************************!*\ | |
| 11034 | + !*** ../assets/dev/js/editor/document/hooks/ui/document/elements/create/move-resizeable-handle.js ***! | |
| 11035 | + \****************************************************************************************************/ | |
| 11036 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11037 | + | |
| 11038 | +"use strict"; | |
| 11039 | + | |
| 11040 | + | |
| 11041 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11042 | + | |
| 11043 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11044 | + value: true | |
| 11045 | +})); | |
| 11046 | +exports["default"] = exports.MoveResizeableHandle = void 0; | |
| 11047 | + | |
| 11048 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11049 | + | |
| 11050 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11051 | + | |
| 11052 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11053 | + | |
| 11054 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11055 | + | |
| 11056 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11057 | + | |
| 11058 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 11059 | + | |
| 11060 | +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); }; } | |
| 11061 | + | |
| 11062 | +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; } } | |
| 11063 | + | |
| 284 | 11064 | /** |
| 285 | - * Function getDefaultDebounceDelay(). | |
| 286 | - * | |
| 287 | - * Returns default debounce delay time, if exists in config override. | |
| 288 | - * | |
| 289 | - * @return {number} default debounce delay time | |
| 11065 | + * Move jQuery UI Resizeable handle to the end each time an element is created inside | |
| 11066 | + * a Container, since it causes UI issues and breaks some CSS selectors. | |
| 290 | 11067 | */ |
| 291 | -var getDefaultDebounceDelay = exports.getDefaultDebounceDelay = function getDefaultDebounceDelay() { | |
| 292 | - var result = DEFAULT_DEBOUNCE_DELAY; | |
| 293 | - if (elementor.config.document && undefined !== elementor.config.document.debounceDelay) { | |
| 294 | - result = elementor.config.document.debounceDelay; | |
| 11068 | +var MoveResizeableHandle = /*#__PURE__*/function (_After) { | |
| 11069 | + (0, _inherits2.default)(MoveResizeableHandle, _After); | |
| 11070 | + | |
| 11071 | + var _super = _createSuper(MoveResizeableHandle); | |
| 11072 | + | |
| 11073 | + function MoveResizeableHandle() { | |
| 11074 | + (0, _classCallCheck2.default)(this, MoveResizeableHandle); | |
| 11075 | + return _super.apply(this, arguments); | |
| 295 | 11076 | } |
| 296 | - return result; | |
| 297 | -}; | |
| 298 | 11077 | |
| 11078 | + (0, _createClass2.default)(MoveResizeableHandle, [{ | |
| 11079 | + key: "getCommand", | |
| 11080 | + value: function getCommand() { | |
| 11081 | + return 'document/elements/create'; | |
| 11082 | + } | |
| 11083 | + }, { | |
| 11084 | + key: "getId", | |
| 11085 | + value: function getId() { | |
| 11086 | + return 'move-resizeable-handle'; | |
| 11087 | + } | |
| 11088 | + }, { | |
| 11089 | + key: "getConditions", | |
| 11090 | + value: function getConditions(args) { | |
| 11091 | + var _args$containers = args.containers, | |
| 11092 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; // If the element was created in a Container. | |
| 11093 | + | |
| 11094 | + return containers.some(function ( | |
| 11095 | + /**Container*/ | |
| 11096 | + container) { | |
| 11097 | + return 'container' === container.model.get('elType'); | |
| 11098 | + }); | |
| 11099 | + } | |
| 11100 | + }, { | |
| 11101 | + key: "apply", | |
| 11102 | + value: function apply(args) { | |
| 11103 | + var _args$containers2 = args.containers, | |
| 11104 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2; | |
| 11105 | + containers.forEach(function ( | |
| 11106 | + /* Container */ | |
| 11107 | + container) { | |
| 11108 | + var $el = container.view.$el, | |
| 11109 | + $resizeHandle = $el.find('> .ui-resizable-handle').first(); | |
| 11110 | + | |
| 11111 | + if (!$resizeHandle) { | |
| 11112 | + return; | |
| 11113 | + } // Move the handle to the end. | |
| 11114 | + | |
| 11115 | + | |
| 11116 | + $el.append($resizeHandle); | |
| 11117 | + }); | |
| 11118 | + } | |
| 11119 | + }]); | |
| 11120 | + return MoveResizeableHandle; | |
| 11121 | +}(_after.default); | |
| 11122 | + | |
| 11123 | +exports.MoveResizeableHandle = MoveResizeableHandle; | |
| 11124 | +var _default = MoveResizeableHandle; | |
| 11125 | +exports["default"] = _default; | |
| 11126 | + | |
| 11127 | +/***/ }), | |
| 11128 | + | |
| 11129 | +/***/ "../assets/dev/js/editor/document/hooks/ui/index.js": | |
| 11130 | +/*!**********************************************************!*\ | |
| 11131 | + !*** ../assets/dev/js/editor/document/hooks/ui/index.js ***! | |
| 11132 | + \**********************************************************/ | |
| 11133 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11134 | + | |
| 11135 | +"use strict"; | |
| 11136 | + | |
| 11137 | + | |
| 11138 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11139 | + value: true | |
| 11140 | +})); | |
| 11141 | + | |
| 11142 | +var _create = __webpack_require__(/*! ./create/ */ "../assets/dev/js/editor/document/hooks/ui/create/index.js"); | |
| 11143 | + | |
| 11144 | +Object.keys(_create).forEach(function (key) { | |
| 11145 | + if (key === "default" || key === "__esModule") return; | |
| 11146 | + if (key in exports && exports[key] === _create[key]) return; | |
| 11147 | + Object.defineProperty(exports, key, { | |
| 11148 | + enumerable: true, | |
| 11149 | + get: function get() { | |
| 11150 | + return _create[key]; | |
| 11151 | + } | |
| 11152 | + }); | |
| 11153 | +}); | |
| 11154 | + | |
| 11155 | +var _delete = __webpack_require__(/*! ./delete/ */ "../assets/dev/js/editor/document/hooks/ui/delete/index.js"); | |
| 11156 | + | |
| 11157 | +Object.keys(_delete).forEach(function (key) { | |
| 11158 | + if (key === "default" || key === "__esModule") return; | |
| 11159 | + if (key in exports && exports[key] === _delete[key]) return; | |
| 11160 | + Object.defineProperty(exports, key, { | |
| 11161 | + enumerable: true, | |
| 11162 | + get: function get() { | |
| 11163 | + return _delete[key]; | |
| 11164 | + } | |
| 11165 | + }); | |
| 11166 | +}); | |
| 11167 | + | |
| 11168 | +var _create2 = __webpack_require__(/*! ./document/elements/create/ */ "../assets/dev/js/editor/document/hooks/ui/document/elements/create/index.js"); | |
| 11169 | + | |
| 11170 | +Object.keys(_create2).forEach(function (key) { | |
| 11171 | + if (key === "default" || key === "__esModule") return; | |
| 11172 | + if (key in exports && exports[key] === _create2[key]) return; | |
| 11173 | + Object.defineProperty(exports, key, { | |
| 11174 | + enumerable: true, | |
| 11175 | + get: function get() { | |
| 11176 | + return _create2[key]; | |
| 11177 | + } | |
| 11178 | + }); | |
| 11179 | +}); | |
| 11180 | + | |
| 11181 | +var _settings = __webpack_require__(/*! ./settings/ */ "../assets/dev/js/editor/document/hooks/ui/settings/index.js"); | |
| 11182 | + | |
| 11183 | +Object.keys(_settings).forEach(function (key) { | |
| 11184 | + if (key === "default" || key === "__esModule") return; | |
| 11185 | + if (key in exports && exports[key] === _settings[key]) return; | |
| 11186 | + Object.defineProperty(exports, key, { | |
| 11187 | + enumerable: true, | |
| 11188 | + get: function get() { | |
| 11189 | + return _settings[key]; | |
| 11190 | + } | |
| 11191 | + }); | |
| 11192 | +}); | |
| 11193 | + | |
| 11194 | +/***/ }), | |
| 11195 | + | |
| 11196 | +/***/ "../assets/dev/js/editor/document/hooks/ui/settings/change-post-title.js": | |
| 11197 | +/*!*******************************************************************************!*\ | |
| 11198 | + !*** ../assets/dev/js/editor/document/hooks/ui/settings/change-post-title.js ***! | |
| 11199 | + \*******************************************************************************/ | |
| 11200 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11201 | + | |
| 11202 | +"use strict"; | |
| 11203 | + | |
| 11204 | + | |
| 11205 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11206 | + | |
| 11207 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11208 | + value: true | |
| 11209 | +})); | |
| 11210 | +exports["default"] = exports.ChangePostTitle = void 0; | |
| 11211 | + | |
| 11212 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11213 | + | |
| 11214 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11215 | + | |
| 11216 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11217 | + | |
| 11218 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11219 | + | |
| 11220 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11221 | + | |
| 11222 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 11223 | + | |
| 11224 | +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); }; } | |
| 11225 | + | |
| 11226 | +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; } } | |
| 11227 | + | |
| 11228 | +var ChangePostTitle = /*#__PURE__*/function (_After) { | |
| 11229 | + (0, _inherits2.default)(ChangePostTitle, _After); | |
| 11230 | + | |
| 11231 | + var _super = _createSuper(ChangePostTitle); | |
| 11232 | + | |
| 11233 | + function ChangePostTitle() { | |
| 11234 | + (0, _classCallCheck2.default)(this, ChangePostTitle); | |
| 11235 | + return _super.apply(this, arguments); | |
| 11236 | + } | |
| 11237 | + | |
| 11238 | + (0, _createClass2.default)(ChangePostTitle, [{ | |
| 11239 | + key: "getCommand", | |
| 11240 | + value: function getCommand() { | |
| 11241 | + return 'document/elements/settings'; | |
| 11242 | + } | |
| 11243 | + }, { | |
| 11244 | + key: "getId", | |
| 11245 | + value: function getId() { | |
| 11246 | + return 'change-post-title'; | |
| 11247 | + } | |
| 11248 | + }, { | |
| 11249 | + key: "getContainerType", | |
| 11250 | + value: function getContainerType() { | |
| 11251 | + return 'document'; | |
| 11252 | + } | |
| 11253 | + }, { | |
| 11254 | + key: "getConditions", | |
| 11255 | + value: function getConditions(args) { | |
| 11256 | + return undefined !== args.settings.post_title; | |
| 11257 | + } | |
| 11258 | + }, { | |
| 11259 | + key: "apply", | |
| 11260 | + value: function apply(args) { | |
| 11261 | + var $title = elementorFrontend.elements.$document.find(elementor.config.page_title_selector); | |
| 11262 | + $title.text(args.settings.post_title); | |
| 11263 | + } | |
| 11264 | + }]); | |
| 11265 | + return ChangePostTitle; | |
| 11266 | +}(_after.default); | |
| 11267 | + | |
| 11268 | +exports.ChangePostTitle = ChangePostTitle; | |
| 11269 | +var _default = ChangePostTitle; | |
| 11270 | +exports["default"] = _default; | |
| 11271 | + | |
| 11272 | +/***/ }), | |
| 11273 | + | |
| 11274 | +/***/ "../assets/dev/js/editor/document/hooks/ui/settings/column-change-size.js": | |
| 11275 | +/*!********************************************************************************!*\ | |
| 11276 | + !*** ../assets/dev/js/editor/document/hooks/ui/settings/column-change-size.js ***! | |
| 11277 | + \********************************************************************************/ | |
| 11278 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11279 | + | |
| 11280 | +"use strict"; | |
| 11281 | + | |
| 11282 | + | |
| 11283 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11284 | + | |
| 11285 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11286 | + value: true | |
| 11287 | +})); | |
| 11288 | +exports["default"] = exports.ColumnChangeSize = void 0; | |
| 11289 | + | |
| 11290 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11291 | + | |
| 11292 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11293 | + | |
| 11294 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11295 | + | |
| 11296 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11297 | + | |
| 11298 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11299 | + | |
| 11300 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 11301 | + | |
| 11302 | +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); }; } | |
| 11303 | + | |
| 11304 | +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; } } | |
| 11305 | + | |
| 11306 | +var ColumnChangeSize = /*#__PURE__*/function (_After) { | |
| 11307 | + (0, _inherits2.default)(ColumnChangeSize, _After); | |
| 11308 | + | |
| 11309 | + var _super = _createSuper(ColumnChangeSize); | |
| 11310 | + | |
| 11311 | + function ColumnChangeSize() { | |
| 11312 | + (0, _classCallCheck2.default)(this, ColumnChangeSize); | |
| 11313 | + return _super.apply(this, arguments); | |
| 11314 | + } | |
| 11315 | + | |
| 11316 | + (0, _createClass2.default)(ColumnChangeSize, [{ | |
| 11317 | + key: "getCommand", | |
| 11318 | + value: function getCommand() { | |
| 11319 | + return 'document/elements/settings'; | |
| 11320 | + } | |
| 11321 | + }, { | |
| 11322 | + key: "getId", | |
| 11323 | + value: function getId() { | |
| 11324 | + return 'column-change-size'; | |
| 11325 | + } | |
| 11326 | + }, { | |
| 11327 | + key: "getConditions", | |
| 11328 | + value: function getConditions(args) { | |
| 11329 | + return undefined !== args.settings._inline_size || undefined !== args.settings._column_size; | |
| 11330 | + } | |
| 11331 | + }, { | |
| 11332 | + key: "apply", | |
| 11333 | + value: function apply(args) { | |
| 11334 | + var _args$containers = args.containers, | |
| 11335 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 11336 | + containers.forEach(function ( | |
| 11337 | + /* Container */ | |
| 11338 | + container) { | |
| 11339 | + container.view.changeSizeUI(); | |
| 11340 | + }); | |
| 11341 | + } | |
| 11342 | + }]); | |
| 11343 | + return ColumnChangeSize; | |
| 11344 | +}(_after.default); | |
| 11345 | + | |
| 11346 | +exports.ColumnChangeSize = ColumnChangeSize; | |
| 11347 | +var _default = ColumnChangeSize; | |
| 11348 | +exports["default"] = _default; | |
| 11349 | + | |
| 11350 | +/***/ }), | |
| 11351 | + | |
| 11352 | +/***/ "../assets/dev/js/editor/document/hooks/ui/settings/draggable.js": | |
| 11353 | +/*!***********************************************************************!*\ | |
| 11354 | + !*** ../assets/dev/js/editor/document/hooks/ui/settings/draggable.js ***! | |
| 11355 | + \***********************************************************************/ | |
| 11356 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11357 | + | |
| 11358 | +"use strict"; | |
| 11359 | + | |
| 11360 | + | |
| 11361 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11362 | + | |
| 11363 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11364 | + value: true | |
| 11365 | +})); | |
| 11366 | +exports["default"] = exports.Draggable = void 0; | |
| 11367 | + | |
| 11368 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11369 | + | |
| 11370 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11371 | + | |
| 11372 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11373 | + | |
| 11374 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11375 | + | |
| 11376 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11377 | + | |
| 11378 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 11379 | + | |
| 11380 | +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); }; } | |
| 11381 | + | |
| 11382 | +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; } } | |
| 11383 | + | |
| 11384 | +var Draggable = /*#__PURE__*/function (_After) { | |
| 11385 | + (0, _inherits2.default)(Draggable, _After); | |
| 11386 | + | |
| 11387 | + var _super = _createSuper(Draggable); | |
| 11388 | + | |
| 11389 | + function Draggable() { | |
| 11390 | + (0, _classCallCheck2.default)(this, Draggable); | |
| 11391 | + return _super.apply(this, arguments); | |
| 11392 | + } | |
| 11393 | + | |
| 11394 | + (0, _createClass2.default)(Draggable, [{ | |
| 11395 | + key: "getCommand", | |
| 11396 | + value: function getCommand() { | |
| 11397 | + return 'document/elements/settings'; | |
| 11398 | + } | |
| 11399 | + }, { | |
| 11400 | + key: "getId", | |
| 11401 | + value: function getId() { | |
| 11402 | + return 'draggable'; | |
| 11403 | + } | |
| 11404 | + }, { | |
| 11405 | + key: "getConditions", | |
| 11406 | + value: function getConditions(args) { | |
| 11407 | + return undefined !== args.settings._position; | |
| 11408 | + } | |
| 11409 | + }, { | |
| 11410 | + key: "apply", | |
| 11411 | + value: function apply(args) { | |
| 11412 | + var _args$containers = args.containers, | |
| 11413 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 11414 | + containers.forEach(function ( | |
| 11415 | + /* Container */ | |
| 11416 | + container) { | |
| 11417 | + if (container.view.options.draggable) { | |
| 11418 | + container.view.options.draggable.toggle(); | |
| 11419 | + } | |
| 11420 | + }); | |
| 11421 | + } | |
| 11422 | + }]); | |
| 11423 | + return Draggable; | |
| 11424 | +}(_after.default); | |
| 11425 | + | |
| 11426 | +exports.Draggable = Draggable; | |
| 11427 | +var _default = Draggable; | |
| 11428 | +exports["default"] = _default; | |
| 11429 | + | |
| 11430 | +/***/ }), | |
| 11431 | + | |
| 11432 | +/***/ "../assets/dev/js/editor/document/hooks/ui/settings/index.js": | |
| 11433 | +/*!*******************************************************************!*\ | |
| 11434 | + !*** ../assets/dev/js/editor/document/hooks/ui/settings/index.js ***! | |
| 11435 | + \*******************************************************************/ | |
| 11436 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11437 | + | |
| 11438 | +"use strict"; | |
| 11439 | + | |
| 11440 | + | |
| 11441 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11442 | + value: true | |
| 11443 | +})); | |
| 11444 | +Object.defineProperty(exports, "ChangePostTitle", ({ | |
| 11445 | + enumerable: true, | |
| 11446 | + get: function get() { | |
| 11447 | + return _changePostTitle.ChangePostTitle; | |
| 11448 | + } | |
| 11449 | +})); | |
| 11450 | +Object.defineProperty(exports, "ColumnChangeSize", ({ | |
| 11451 | + enumerable: true, | |
| 11452 | + get: function get() { | |
| 11453 | + return _columnChangeSize.ColumnChangeSize; | |
| 11454 | + } | |
| 11455 | +})); | |
| 11456 | +Object.defineProperty(exports, "Draggable", ({ | |
| 11457 | + enumerable: true, | |
| 11458 | + get: function get() { | |
| 11459 | + return _draggable.Draggable; | |
| 11460 | + } | |
| 11461 | +})); | |
| 11462 | +Object.defineProperty(exports, "ReloadPreview", ({ | |
| 11463 | + enumerable: true, | |
| 11464 | + get: function get() { | |
| 11465 | + return _reloadPreview.ReloadPreview; | |
| 11466 | + } | |
| 11467 | +})); | |
| 11468 | +Object.defineProperty(exports, "Resizeable", ({ | |
| 11469 | + enumerable: true, | |
| 11470 | + get: function get() { | |
| 11471 | + return _resizeable.Resizeable; | |
| 11472 | + } | |
| 11473 | +})); | |
| 11474 | +Object.defineProperty(exports, "SetDirectionMode", ({ | |
| 11475 | + enumerable: true, | |
| 11476 | + get: function get() { | |
| 11477 | + return _setDirectionMode.SetDirectionMode; | |
| 11478 | + } | |
| 11479 | +})); | |
| 11480 | + | |
| 11481 | +var _changePostTitle = __webpack_require__(/*! ./change-post-title */ "../assets/dev/js/editor/document/hooks/ui/settings/change-post-title.js"); | |
| 11482 | + | |
| 11483 | +var _columnChangeSize = __webpack_require__(/*! ./column-change-size */ "../assets/dev/js/editor/document/hooks/ui/settings/column-change-size.js"); | |
| 11484 | + | |
| 11485 | +var _draggable = __webpack_require__(/*! ./draggable */ "../assets/dev/js/editor/document/hooks/ui/settings/draggable.js"); | |
| 11486 | + | |
| 11487 | +var _resizeable = __webpack_require__(/*! ./resizeable */ "../assets/dev/js/editor/document/hooks/ui/settings/resizeable.js"); | |
| 11488 | + | |
| 11489 | +var _reloadPreview = __webpack_require__(/*! ./reload-preview */ "../assets/dev/js/editor/document/hooks/ui/settings/reload-preview.js"); | |
| 11490 | + | |
| 11491 | +var _setDirectionMode = __webpack_require__(/*! ./set-direction-mode */ "../assets/dev/js/editor/document/hooks/ui/settings/set-direction-mode.js"); | |
| 11492 | + | |
| 11493 | +/***/ }), | |
| 11494 | + | |
| 11495 | +/***/ "../assets/dev/js/editor/document/hooks/ui/settings/reload-preview.js": | |
| 11496 | +/*!****************************************************************************!*\ | |
| 11497 | + !*** ../assets/dev/js/editor/document/hooks/ui/settings/reload-preview.js ***! | |
| 11498 | + \****************************************************************************/ | |
| 11499 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11500 | + | |
| 11501 | +"use strict"; | |
| 11502 | + | |
| 11503 | + | |
| 11504 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11505 | + | |
| 11506 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11507 | + value: true | |
| 11508 | +})); | |
| 11509 | +exports.ReloadPreview = void 0; | |
| 11510 | + | |
| 11511 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11512 | + | |
| 11513 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11514 | + | |
| 11515 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11516 | + | |
| 11517 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11518 | + | |
| 11519 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11520 | + | |
| 11521 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 11522 | + | |
| 11523 | +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); }; } | |
| 11524 | + | |
| 11525 | +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; } } | |
| 11526 | + | |
| 11527 | +var ReloadPreview = /*#__PURE__*/function (_After) { | |
| 11528 | + (0, _inherits2.default)(ReloadPreview, _After); | |
| 11529 | + | |
| 11530 | + var _super = _createSuper(ReloadPreview); | |
| 11531 | + | |
| 11532 | + function ReloadPreview() { | |
| 11533 | + (0, _classCallCheck2.default)(this, ReloadPreview); | |
| 11534 | + return _super.apply(this, arguments); | |
| 11535 | + } | |
| 11536 | + | |
| 11537 | + (0, _createClass2.default)(ReloadPreview, [{ | |
| 11538 | + key: "getCommand", | |
| 11539 | + value: function getCommand() { | |
| 11540 | + return 'document/elements/settings'; | |
| 11541 | + } | |
| 11542 | + }, { | |
| 11543 | + key: "getId", | |
| 11544 | + value: function getId() { | |
| 11545 | + return 'save-layout'; | |
| 11546 | + } | |
| 11547 | + }, { | |
| 11548 | + key: "getContainerType", | |
| 11549 | + value: function getContainerType() { | |
| 11550 | + return 'document'; | |
| 11551 | + } | |
| 11552 | + }, { | |
| 11553 | + key: "getConditions", | |
| 11554 | + value: function getConditions(args) { | |
| 11555 | + return !!args.settings.template; | |
| 11556 | + } | |
| 11557 | + }, { | |
| 11558 | + key: "apply", | |
| 11559 | + value: function apply() { | |
| 11560 | + return $e.run('document/save/auto', { | |
| 11561 | + force: true | |
| 11562 | + }).then(function () { | |
| 11563 | + elementor.reloadPreview(); // TODO: Fix the route change. | |
| 11564 | + | |
| 11565 | + elementor.once('preview:loaded', function () { | |
| 11566 | + $e.route('panel/page-settings/settings'); | |
| 11567 | + }); | |
| 11568 | + }); | |
| 11569 | + } | |
| 11570 | + }]); | |
| 11571 | + return ReloadPreview; | |
| 11572 | +}(_after.default); | |
| 11573 | + | |
| 11574 | +exports.ReloadPreview = ReloadPreview; | |
| 11575 | + | |
| 11576 | +/***/ }), | |
| 11577 | + | |
| 11578 | +/***/ "../assets/dev/js/editor/document/hooks/ui/settings/resizeable.js": | |
| 11579 | +/*!************************************************************************!*\ | |
| 11580 | + !*** ../assets/dev/js/editor/document/hooks/ui/settings/resizeable.js ***! | |
| 11581 | + \************************************************************************/ | |
| 11582 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11583 | + | |
| 11584 | +"use strict"; | |
| 11585 | + | |
| 11586 | + | |
| 11587 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11588 | + | |
| 11589 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11590 | + value: true | |
| 11591 | +})); | |
| 11592 | +exports["default"] = exports.Resizeable = void 0; | |
| 11593 | + | |
| 11594 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11595 | + | |
| 11596 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11597 | + | |
| 11598 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11599 | + | |
| 11600 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11601 | + | |
| 11602 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11603 | + | |
| 11604 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 11605 | + | |
| 11606 | +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); }; } | |
| 11607 | + | |
| 11608 | +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; } } | |
| 11609 | + | |
| 11610 | +var Resizeable = /*#__PURE__*/function (_After) { | |
| 11611 | + (0, _inherits2.default)(Resizeable, _After); | |
| 11612 | + | |
| 11613 | + var _super = _createSuper(Resizeable); | |
| 11614 | + | |
| 11615 | + function Resizeable() { | |
| 11616 | + (0, _classCallCheck2.default)(this, Resizeable); | |
| 11617 | + return _super.apply(this, arguments); | |
| 11618 | + } | |
| 11619 | + | |
| 11620 | + (0, _createClass2.default)(Resizeable, [{ | |
| 11621 | + key: "getCommand", | |
| 11622 | + value: function getCommand() { | |
| 11623 | + return 'document/elements/settings'; | |
| 11624 | + } | |
| 11625 | + }, { | |
| 11626 | + key: "getId", | |
| 11627 | + value: function getId() { | |
| 11628 | + return 'resizeable'; | |
| 11629 | + } | |
| 11630 | + }, { | |
| 11631 | + key: "getConditions", | |
| 11632 | + value: function getConditions(args) { | |
| 11633 | + return undefined !== args.settings._position || undefined !== args.settings._element_width; | |
| 11634 | + } | |
| 11635 | + }, { | |
| 11636 | + key: "apply", | |
| 11637 | + value: function apply(args) { | |
| 11638 | + var _args$containers = args.containers, | |
| 11639 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 11640 | + containers.forEach(function ( | |
| 11641 | + /* Container */ | |
| 11642 | + container) { | |
| 11643 | + if (container.view.options.resizeable) { | |
| 11644 | + container.view.options.resizeable.toggle(); | |
| 11645 | + } | |
| 11646 | + }); | |
| 11647 | + } | |
| 11648 | + }]); | |
| 11649 | + return Resizeable; | |
| 11650 | +}(_after.default); | |
| 11651 | + | |
| 11652 | +exports.Resizeable = Resizeable; | |
| 11653 | +var _default = Resizeable; | |
| 11654 | +exports["default"] = _default; | |
| 11655 | + | |
| 11656 | +/***/ }), | |
| 11657 | + | |
| 11658 | +/***/ "../assets/dev/js/editor/document/hooks/ui/settings/set-direction-mode.js": | |
| 11659 | +/*!********************************************************************************!*\ | |
| 11660 | + !*** ../assets/dev/js/editor/document/hooks/ui/settings/set-direction-mode.js ***! | |
| 11661 | + \********************************************************************************/ | |
| 11662 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11663 | + | |
| 11664 | +"use strict"; | |
| 11665 | + | |
| 11666 | + | |
| 11667 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11668 | + | |
| 11669 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11670 | + value: true | |
| 11671 | +})); | |
| 11672 | +exports["default"] = exports.SetDirectionMode = void 0; | |
| 11673 | + | |
| 11674 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11675 | + | |
| 11676 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11677 | + | |
| 11678 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11679 | + | |
| 11680 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11681 | + | |
| 11682 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11683 | + | |
| 11684 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 11685 | + | |
| 11686 | +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); }; } | |
| 11687 | + | |
| 11688 | +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; } } | |
| 11689 | + | |
| 299 | 11690 | /** |
| 300 | - * @name $e.modules.editor.document.CommandHistoryDebounceBase | |
| 11691 | + * @typedef {import('../../../../container/container')} Container | |
| 301 | 11692 | */ |
| 302 | -var CommandHistoryDebounceBase = exports["default"] = /*#__PURE__*/function (_CommandHistoryBase) { | |
| 303 | - function CommandHistoryDebounceBase() { | |
| 304 | - (0, _classCallCheck2.default)(this, CommandHistoryDebounceBase); | |
| 305 | - return _callSuper(this, CommandHistoryDebounceBase, arguments); | |
| 11693 | + | |
| 11694 | +/** | |
| 11695 | + * UI hook to set direction mode when changing element's settings. | |
| 11696 | + * Currently used to determine the direction of the flex icons in the Container element. | |
| 11697 | + * It should be generic and work with any element, and since each element might use a different | |
| 11698 | + * setting to determine its direction mode, the hook should listen to any setting change. | |
| 11699 | + * Therefore, the `getConditions()` method just checks if the view exists and has UI states. | |
| 11700 | + */ | |
| 11701 | +var SetDirectionMode = /*#__PURE__*/function (_After) { | |
| 11702 | + (0, _inherits2.default)(SetDirectionMode, _After); | |
| 11703 | + | |
| 11704 | + var _super = _createSuper(SetDirectionMode); | |
| 11705 | + | |
| 11706 | + function SetDirectionMode() { | |
| 11707 | + (0, _classCallCheck2.default)(this, SetDirectionMode); | |
| 11708 | + return _super.apply(this, arguments); | |
| 306 | 11709 | } |
| 307 | - (0, _inherits2.default)(CommandHistoryDebounceBase, _CommandHistoryBase); | |
| 308 | - return (0, _createClass2.default)(CommandHistoryDebounceBase, [{ | |
| 11710 | + | |
| 11711 | + (0, _createClass2.default)(SetDirectionMode, [{ | |
| 11712 | + key: "getCommand", | |
| 11713 | + value: function getCommand() { | |
| 11714 | + return 'document/elements/settings'; | |
| 11715 | + } | |
| 11716 | + }, { | |
| 11717 | + key: "getId", | |
| 11718 | + value: function getId() { | |
| 11719 | + return 'set-direction-mode--document/elements/settings'; | |
| 11720 | + } | |
| 11721 | + }, { | |
| 11722 | + key: "getConditions", | |
| 11723 | + value: function getConditions() { | |
| 11724 | + var _args$container$rende, _args$container$rende2; | |
| 11725 | + | |
| 11726 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 11727 | + return !!((_args$container$rende = args.container.renderer) !== null && _args$container$rende !== void 0 && (_args$container$rende2 = _args$container$rende.view) !== null && _args$container$rende2 !== void 0 && _args$container$rende2.getCurrentUiStates); | |
| 11728 | + } | |
| 11729 | + }, { | |
| 11730 | + key: "apply", | |
| 11731 | + value: function apply(args) { | |
| 11732 | + SetDirectionMode.set(args.container); | |
| 11733 | + } | |
| 11734 | + /** | |
| 11735 | + * Get the direction mode from the Container's view & set the UI state accordingly. | |
| 11736 | + * | |
| 11737 | + * @param {Container} container | |
| 11738 | + * | |
| 11739 | + * @return {void} | |
| 11740 | + */ | |
| 11741 | + | |
| 11742 | + }], [{ | |
| 11743 | + key: "set", | |
| 11744 | + value: function set(container) { | |
| 11745 | + var _view$getCurrentUiSta; | |
| 11746 | + | |
| 11747 | + // Determine if the direction mode should be set by the parent. | |
| 11748 | + var useParent = 'panel/editor/advanced' === $e.routes.getCurrent('panel'); | |
| 11749 | + container = useParent ? container.parent : container; | |
| 11750 | + var view = container.renderer.view, | |
| 11751 | + direction = (_view$getCurrentUiSta = view.getCurrentUiStates) === null || _view$getCurrentUiSta === void 0 ? void 0 : _view$getCurrentUiSta.call(view).directionMode; | |
| 11752 | + | |
| 11753 | + if (direction) { | |
| 11754 | + $e.uiStates.set('document/direction-mode', direction); | |
| 11755 | + return; | |
| 11756 | + } | |
| 11757 | + | |
| 11758 | + $e.uiStates.remove('document/direction-mode'); | |
| 11759 | + } | |
| 11760 | + }]); | |
| 11761 | + return SetDirectionMode; | |
| 11762 | +}(_after.default); | |
| 11763 | + | |
| 11764 | +exports.SetDirectionMode = SetDirectionMode; | |
| 11765 | +var _default = SetDirectionMode; | |
| 11766 | +exports["default"] = _default; | |
| 11767 | + | |
| 11768 | +/***/ }), | |
| 11769 | + | |
| 11770 | +/***/ "../assets/dev/js/editor/document/index.js": | |
| 11771 | +/*!*************************************************!*\ | |
| 11772 | + !*** ../assets/dev/js/editor/document/index.js ***! | |
| 11773 | + \*************************************************/ | |
| 11774 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11775 | + | |
| 11776 | +"use strict"; | |
| 11777 | + | |
| 11778 | + | |
| 11779 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11780 | + | |
| 11781 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11782 | + value: true | |
| 11783 | +})); | |
| 11784 | +Object.defineProperty(exports, "DynamicComponent", ({ | |
| 11785 | + enumerable: true, | |
| 11786 | + get: function get() { | |
| 11787 | + return _component.default; | |
| 11788 | + } | |
| 11789 | +})); | |
| 11790 | +Object.defineProperty(exports, "ElementsComponent", ({ | |
| 11791 | + enumerable: true, | |
| 11792 | + get: function get() { | |
| 11793 | + return _component2.default; | |
| 11794 | + } | |
| 11795 | +})); | |
| 11796 | +Object.defineProperty(exports, "GlobalsComponent", ({ | |
| 11797 | + enumerable: true, | |
| 11798 | + get: function get() { | |
| 11799 | + return _component3.default; | |
| 11800 | + } | |
| 11801 | +})); | |
| 11802 | +Object.defineProperty(exports, "HistoryComponent", ({ | |
| 11803 | + enumerable: true, | |
| 11804 | + get: function get() { | |
| 11805 | + return _component4.default; | |
| 11806 | + } | |
| 11807 | +})); | |
| 11808 | +Object.defineProperty(exports, "RepeaterComponent", ({ | |
| 11809 | + enumerable: true, | |
| 11810 | + get: function get() { | |
| 11811 | + return _component5.default; | |
| 11812 | + } | |
| 11813 | +})); | |
| 11814 | +Object.defineProperty(exports, "SaveComponent", ({ | |
| 11815 | + enumerable: true, | |
| 11816 | + get: function get() { | |
| 11817 | + return _component6.default; | |
| 11818 | + } | |
| 11819 | +})); | |
| 11820 | +Object.defineProperty(exports, "UIComponent", ({ | |
| 11821 | + enumerable: true, | |
| 11822 | + get: function get() { | |
| 11823 | + return _component7.default; | |
| 11824 | + } | |
| 11825 | +})); | |
| 11826 | + | |
| 11827 | +var _component = _interopRequireDefault(__webpack_require__(/*! ../document/dynamic/component */ "../assets/dev/js/editor/document/dynamic/component.js")); | |
| 11828 | + | |
| 11829 | +var _component2 = _interopRequireDefault(__webpack_require__(/*! ../document/elements/component */ "../assets/dev/js/editor/document/elements/component.js")); | |
| 11830 | + | |
| 11831 | +var _component3 = _interopRequireDefault(__webpack_require__(/*! ../document/globals/component */ "../assets/dev/js/editor/document/globals/component.js")); | |
| 11832 | + | |
| 11833 | +var _component4 = _interopRequireDefault(__webpack_require__(/*! ../document/history/component */ "../assets/dev/js/editor/document/history/component.js")); | |
| 11834 | + | |
| 11835 | +var _component5 = _interopRequireDefault(__webpack_require__(/*! ../document/repeater/component */ "../assets/dev/js/editor/document/repeater/component.js")); | |
| 11836 | + | |
| 11837 | +var _component6 = _interopRequireDefault(__webpack_require__(/*! ../document/save/component */ "../assets/dev/js/editor/document/save/component.js")); | |
| 11838 | + | |
| 11839 | +var _component7 = _interopRequireDefault(__webpack_require__(/*! ../document/ui/component */ "../assets/dev/js/editor/document/ui/component.js")); | |
| 11840 | + | |
| 11841 | +/***/ }), | |
| 11842 | + | |
| 11843 | +/***/ "../assets/dev/js/editor/document/repeater/commands/duplicate.js": | |
| 11844 | +/*!***********************************************************************!*\ | |
| 11845 | + !*** ../assets/dev/js/editor/document/repeater/commands/duplicate.js ***! | |
| 11846 | + \***********************************************************************/ | |
| 11847 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11848 | + | |
| 11849 | +"use strict"; | |
| 11850 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 11851 | + | |
| 11852 | + | |
| 11853 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 11854 | + | |
| 11855 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11856 | + value: true | |
| 11857 | +})); | |
| 11858 | +exports["default"] = exports.Duplicate = void 0; | |
| 11859 | + | |
| 11860 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 11861 | + | |
| 11862 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 11863 | + | |
| 11864 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 11865 | + | |
| 11866 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 11867 | + | |
| 11868 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 11869 | + | |
| 11870 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 11871 | + | |
| 11872 | +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); }; } | |
| 11873 | + | |
| 11874 | +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; } } | |
| 11875 | + | |
| 11876 | +var Duplicate = /*#__PURE__*/function (_CommandHistory) { | |
| 11877 | + (0, _inherits2.default)(Duplicate, _CommandHistory); | |
| 11878 | + | |
| 11879 | + var _super = _createSuper(Duplicate); | |
| 11880 | + | |
| 11881 | + function Duplicate() { | |
| 11882 | + (0, _classCallCheck2.default)(this, Duplicate); | |
| 11883 | + return _super.apply(this, arguments); | |
| 11884 | + } | |
| 11885 | + | |
| 11886 | + (0, _createClass2.default)(Duplicate, [{ | |
| 11887 | + key: "validateArgs", | |
| 11888 | + value: function validateArgs(args) { | |
| 11889 | + this.requireContainer(args); | |
| 11890 | + this.requireArgumentType('name', 'string', args); | |
| 11891 | + this.requireArgumentType('index', 'number', args); | |
| 11892 | + } | |
| 11893 | + }, { | |
| 11894 | + key: "getHistory", | |
| 11895 | + value: function getHistory(args) { | |
| 11896 | + var _args$containers = args.containers, | |
| 11897 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 11898 | + return { | |
| 11899 | + containers: containers, | |
| 11900 | + type: 'duplicate', | |
| 11901 | + subTitle: __('Item', 'elementor') | |
| 11902 | + }; | |
| 11903 | + } | |
| 11904 | + }, { | |
| 11905 | + key: "apply", | |
| 11906 | + value: function apply(args) { | |
| 11907 | + var index = args.index, | |
| 11908 | + name = args.name, | |
| 11909 | + _args$options = args.options, | |
| 11910 | + options = _args$options === void 0 ? {} : _args$options, | |
| 11911 | + _args$containers2 = args.containers, | |
| 11912 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 11913 | + result = []; | |
| 11914 | + containers.forEach(function (container) { | |
| 11915 | + var settingsModel = container.settings, | |
| 11916 | + collection = settingsModel.get(name), | |
| 11917 | + model = collection.at(index).toJSON(); // Let the insert handle it, do not use the duplicated id. | |
| 11918 | + | |
| 11919 | + if (model._id) { | |
| 11920 | + delete model._id; | |
| 11921 | + } | |
| 11922 | + | |
| 11923 | + result.push($e.run('document/repeater/insert', { | |
| 11924 | + container: container, | |
| 11925 | + name: name, | |
| 11926 | + model: model, | |
| 11927 | + options: Object.assign({ | |
| 11928 | + at: index + 1 | |
| 11929 | + }, options) | |
| 11930 | + })); | |
| 11931 | + }); | |
| 11932 | + | |
| 11933 | + if (1 === result.length) { | |
| 11934 | + return result[0]; | |
| 11935 | + } | |
| 11936 | + | |
| 11937 | + return result; | |
| 11938 | + } | |
| 11939 | + }]); | |
| 11940 | + return Duplicate; | |
| 11941 | +}(_commandHistory.default); | |
| 11942 | + | |
| 11943 | +exports.Duplicate = Duplicate; | |
| 11944 | +var _default = Duplicate; | |
| 11945 | +exports["default"] = _default; | |
| 11946 | + | |
| 11947 | +/***/ }), | |
| 11948 | + | |
| 11949 | +/***/ "../assets/dev/js/editor/document/repeater/commands/index.js": | |
| 11950 | +/*!*******************************************************************!*\ | |
| 11951 | + !*** ../assets/dev/js/editor/document/repeater/commands/index.js ***! | |
| 11952 | + \*******************************************************************/ | |
| 11953 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 11954 | + | |
| 11955 | +"use strict"; | |
| 11956 | + | |
| 11957 | + | |
| 11958 | +Object.defineProperty(exports, "__esModule", ({ | |
| 11959 | + value: true | |
| 11960 | +})); | |
| 11961 | +Object.defineProperty(exports, "Duplicate", ({ | |
| 11962 | + enumerable: true, | |
| 11963 | + get: function get() { | |
| 11964 | + return _duplicate.Duplicate; | |
| 11965 | + } | |
| 11966 | +})); | |
| 11967 | +Object.defineProperty(exports, "Insert", ({ | |
| 11968 | + enumerable: true, | |
| 11969 | + get: function get() { | |
| 11970 | + return _insert.Insert; | |
| 11971 | + } | |
| 11972 | +})); | |
| 11973 | +Object.defineProperty(exports, "Move", ({ | |
| 11974 | + enumerable: true, | |
| 11975 | + get: function get() { | |
| 11976 | + return _move.Move; | |
| 11977 | + } | |
| 11978 | +})); | |
| 11979 | +Object.defineProperty(exports, "Remove", ({ | |
| 11980 | + enumerable: true, | |
| 11981 | + get: function get() { | |
| 11982 | + return _remove.Remove; | |
| 11983 | + } | |
| 11984 | +})); | |
| 11985 | + | |
| 11986 | +var _duplicate = __webpack_require__(/*! ./duplicate */ "../assets/dev/js/editor/document/repeater/commands/duplicate.js"); | |
| 11987 | + | |
| 11988 | +var _insert = __webpack_require__(/*! ./insert */ "../assets/dev/js/editor/document/repeater/commands/insert.js"); | |
| 11989 | + | |
| 11990 | +var _move = __webpack_require__(/*! ./move */ "../assets/dev/js/editor/document/repeater/commands/move.js"); | |
| 11991 | + | |
| 11992 | +var _remove = __webpack_require__(/*! ./remove */ "../assets/dev/js/editor/document/repeater/commands/remove.js"); | |
| 11993 | + | |
| 11994 | +/***/ }), | |
| 11995 | + | |
| 11996 | +/***/ "../assets/dev/js/editor/document/repeater/commands/insert.js": | |
| 11997 | +/*!********************************************************************!*\ | |
| 11998 | + !*** ../assets/dev/js/editor/document/repeater/commands/insert.js ***! | |
| 11999 | + \********************************************************************/ | |
| 12000 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12001 | + | |
| 12002 | +"use strict"; | |
| 12003 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 12004 | + | |
| 12005 | + | |
| 12006 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12007 | + | |
| 12008 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12009 | + value: true | |
| 12010 | +})); | |
| 12011 | +exports["default"] = exports.Insert = void 0; | |
| 12012 | + | |
| 12013 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12014 | + | |
| 12015 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12016 | + | |
| 12017 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 12018 | + | |
| 12019 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12020 | + | |
| 12021 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12022 | + | |
| 12023 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12024 | + | |
| 12025 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 12026 | + | |
| 12027 | +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); }; } | |
| 12028 | + | |
| 12029 | +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; } } | |
| 12030 | + | |
| 12031 | +var Insert = /*#__PURE__*/function (_CommandHistory) { | |
| 12032 | + (0, _inherits2.default)(Insert, _CommandHistory); | |
| 12033 | + | |
| 12034 | + var _super = _createSuper(Insert); | |
| 12035 | + | |
| 12036 | + function Insert() { | |
| 12037 | + (0, _classCallCheck2.default)(this, Insert); | |
| 12038 | + return _super.apply(this, arguments); | |
| 12039 | + } | |
| 12040 | + | |
| 12041 | + (0, _createClass2.default)(Insert, [{ | |
| 309 | 12042 | key: "initialize", |
| 310 | 12043 | value: function initialize(args) { |
| 311 | - var _args$options = args.options, | |
| 312 | - options = _args$options === void 0 ? {} : _args$options; | |
| 313 | - _superPropGet(CommandHistoryDebounceBase, "initialize", this, 3)([args]); | |
| 314 | - if (!this.constructor.debounce) { | |
| 315 | - this.constructor.debounce = _.debounce(function (fn) { | |
| 316 | - return fn(); | |
| 317 | - }, getDefaultDebounceDelay()); | |
| 12044 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Insert.prototype), "initialize", this).call(this, args); | |
| 12045 | + | |
| 12046 | + if (!args.model._id) { | |
| 12047 | + args.model._id = elementorCommon.helpers.getUniqueId(); | |
| 318 | 12048 | } |
| 12049 | + } | |
| 12050 | + }, { | |
| 12051 | + key: "validateArgs", | |
| 12052 | + value: function validateArgs(args) { | |
| 12053 | + this.requireContainer(args); | |
| 12054 | + this.requireArgumentType('model', 'object', args); | |
| 12055 | + this.requireArgumentConstructor('name', String, args); | |
| 12056 | + } | |
| 12057 | + }, { | |
| 12058 | + key: "getHistory", | |
| 12059 | + value: function getHistory(args) { | |
| 12060 | + var model = args.model, | |
| 12061 | + name = args.name, | |
| 12062 | + _args$options = args.options, | |
| 12063 | + options = _args$options === void 0 ? { | |
| 12064 | + at: null | |
| 12065 | + } : _args$options, | |
| 12066 | + _args$containers = args.containers, | |
| 12067 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 12068 | + return { | |
| 12069 | + containers: containers, | |
| 12070 | + type: 'add', | |
| 12071 | + subTitle: __('Item', 'elementor'), | |
| 12072 | + data: { | |
| 12073 | + model: model, | |
| 12074 | + name: name, | |
| 12075 | + index: options.at | |
| 12076 | + }, | |
| 12077 | + restore: this.constructor.restore | |
| 12078 | + }; | |
| 12079 | + } | |
| 12080 | + }, { | |
| 12081 | + key: "isDataChanged", | |
| 12082 | + value: function isDataChanged() { | |
| 12083 | + return true; | |
| 12084 | + } | |
| 12085 | + }, { | |
| 12086 | + key: "apply", | |
| 12087 | + value: function apply(args) { | |
| 12088 | + var model = args.model, | |
| 12089 | + name = args.name, | |
| 12090 | + _args$options2 = args.options, | |
| 12091 | + options = _args$options2 === void 0 ? { | |
| 12092 | + at: null | |
| 12093 | + } : _args$options2, | |
| 12094 | + _args$containers2 = args.containers, | |
| 12095 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 12096 | + result = []; | |
| 12097 | + containers.forEach(function (container) { | |
| 12098 | + container = container.lookup(); | |
| 12099 | + var collection = container.settings.get(name); | |
| 12100 | + options.at = null === options.at ? collection.length : options.at; // On `collection.push` the renderer needs a container, the container needs a settingsModel. | |
| 319 | 12101 | |
| 320 | - // If its head command, and not called within another command. | |
| 321 | - if (1 === $e.commands.currentTrace.length || options.debounce) { | |
| 322 | - this.isDebounceRequired = true; | |
| 12102 | + var rowSettingsModel = collection._prepareModel(model), | |
| 12103 | + repeaterContainer = container.addRepeaterItem(name, rowSettingsModel, options.at); | |
| 12104 | + | |
| 12105 | + result.push(collection.push(rowSettingsModel, options)); // Trigger render on widget but with the settings of the control. | |
| 12106 | + | |
| 12107 | + repeaterContainer.render(); | |
| 12108 | + }); | |
| 12109 | + | |
| 12110 | + if (1 === result.length) { | |
| 12111 | + return result[0]; | |
| 323 | 12112 | } |
| 12113 | + | |
| 12114 | + return result; | |
| 324 | 12115 | } |
| 12116 | + }], [{ | |
| 12117 | + key: "restore", | |
| 12118 | + value: function restore(historyItem, isRedo) { | |
| 12119 | + var containers = historyItem.get('containers'), | |
| 12120 | + data = historyItem.get('data'); | |
| 12121 | + | |
| 12122 | + if (isRedo) { | |
| 12123 | + $e.run('document/repeater/insert', { | |
| 12124 | + containers: containers, | |
| 12125 | + model: data.model, | |
| 12126 | + name: data.name, | |
| 12127 | + options: { | |
| 12128 | + at: data.index | |
| 12129 | + } | |
| 12130 | + }); | |
| 12131 | + } else { | |
| 12132 | + $e.run('document/repeater/remove', { | |
| 12133 | + containers: containers, | |
| 12134 | + name: data.name, | |
| 12135 | + index: data.index | |
| 12136 | + }); | |
| 12137 | + } | |
| 12138 | + } | |
| 12139 | + }]); | |
| 12140 | + return Insert; | |
| 12141 | +}(_commandHistory.default); | |
| 12142 | + | |
| 12143 | +exports.Insert = Insert; | |
| 12144 | +var _default = Insert; | |
| 12145 | +exports["default"] = _default; | |
| 12146 | + | |
| 12147 | +/***/ }), | |
| 12148 | + | |
| 12149 | +/***/ "../assets/dev/js/editor/document/repeater/commands/move.js": | |
| 12150 | +/*!******************************************************************!*\ | |
| 12151 | + !*** ../assets/dev/js/editor/document/repeater/commands/move.js ***! | |
| 12152 | + \******************************************************************/ | |
| 12153 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12154 | + | |
| 12155 | +"use strict"; | |
| 12156 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 12157 | + | |
| 12158 | + | |
| 12159 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12160 | + | |
| 12161 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12162 | + value: true | |
| 12163 | +})); | |
| 12164 | +exports["default"] = exports.Move = void 0; | |
| 12165 | + | |
| 12166 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12167 | + | |
| 12168 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12169 | + | |
| 12170 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12171 | + | |
| 12172 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12173 | + | |
| 12174 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12175 | + | |
| 12176 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 12177 | + | |
| 12178 | +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); }; } | |
| 12179 | + | |
| 12180 | +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; } } | |
| 12181 | + | |
| 12182 | +var Move = /*#__PURE__*/function (_CommandHistory) { | |
| 12183 | + (0, _inherits2.default)(Move, _CommandHistory); | |
| 12184 | + | |
| 12185 | + var _super = _createSuper(Move); | |
| 12186 | + | |
| 12187 | + function Move() { | |
| 12188 | + (0, _classCallCheck2.default)(this, Move); | |
| 12189 | + return _super.apply(this, arguments); | |
| 12190 | + } | |
| 12191 | + | |
| 12192 | + (0, _createClass2.default)(Move, [{ | |
| 12193 | + key: "validateArgs", | |
| 12194 | + value: function validateArgs(args) { | |
| 12195 | + this.requireContainer(args); | |
| 12196 | + this.requireArgumentType('name', 'string', args); | |
| 12197 | + this.requireArgumentType('sourceIndex', 'number', args); | |
| 12198 | + this.requireArgumentType('targetIndex', 'number', args); | |
| 12199 | + } | |
| 325 | 12200 | }, { |
| 326 | - key: "onBeforeRun", | |
| 327 | - value: function onBeforeRun(args) { | |
| 328 | - $e.modules.CommandBase.prototype.onBeforeRun.call(this, args); | |
| 329 | - if (this.history && this.isHistoryActive()) { | |
| 330 | - $e.internal('document/history/add-transaction', this.history); | |
| 12201 | + key: "getHistory", | |
| 12202 | + value: function getHistory(args) { | |
| 12203 | + var _args$containers = args.containers, | |
| 12204 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 12205 | + return { | |
| 12206 | + containers: containers, | |
| 12207 | + type: 'move', | |
| 12208 | + subTitle: __('Item', 'elementor') | |
| 12209 | + }; | |
| 12210 | + } | |
| 12211 | + }, { | |
| 12212 | + key: "apply", | |
| 12213 | + value: function apply(args) { | |
| 12214 | + var sourceIndex = args.sourceIndex, | |
| 12215 | + targetIndex = args.targetIndex, | |
| 12216 | + name = args.name, | |
| 12217 | + _args$containers2 = args.containers, | |
| 12218 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 12219 | + result = []; | |
| 12220 | + containers.forEach(function (container) { | |
| 12221 | + var collection = container.settings.get(name), | |
| 12222 | + model = elementorCommon.helpers.cloneObject(collection.at(sourceIndex)); | |
| 12223 | + $e.run('document/repeater/remove', { | |
| 12224 | + container: container, | |
| 12225 | + name: name, | |
| 12226 | + index: sourceIndex | |
| 12227 | + }); | |
| 12228 | + result.push($e.run('document/repeater/insert', { | |
| 12229 | + container: container, | |
| 12230 | + name: name, | |
| 12231 | + model: model, | |
| 12232 | + options: { | |
| 12233 | + at: targetIndex | |
| 12234 | + } | |
| 12235 | + })); | |
| 12236 | + }); | |
| 12237 | + | |
| 12238 | + if (1 === result.length) { | |
| 12239 | + return result[0]; | |
| 331 | 12240 | } |
| 12241 | + | |
| 12242 | + return result; | |
| 332 | 12243 | } |
| 12244 | + }]); | |
| 12245 | + return Move; | |
| 12246 | +}(_commandHistory.default); | |
| 12247 | + | |
| 12248 | +exports.Move = Move; | |
| 12249 | +var _default = Move; | |
| 12250 | +exports["default"] = _default; | |
| 12251 | + | |
| 12252 | +/***/ }), | |
| 12253 | + | |
| 12254 | +/***/ "../assets/dev/js/editor/document/repeater/commands/remove.js": | |
| 12255 | +/*!********************************************************************!*\ | |
| 12256 | + !*** ../assets/dev/js/editor/document/repeater/commands/remove.js ***! | |
| 12257 | + \********************************************************************/ | |
| 12258 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12259 | + | |
| 12260 | +"use strict"; | |
| 12261 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 12262 | + | |
| 12263 | + | |
| 12264 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12265 | + | |
| 12266 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12267 | + value: true | |
| 12268 | +})); | |
| 12269 | +exports["default"] = exports.Remove = void 0; | |
| 12270 | + | |
| 12271 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12272 | + | |
| 12273 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12274 | + | |
| 12275 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12276 | + | |
| 12277 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12278 | + | |
| 12279 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12280 | + | |
| 12281 | +var _commandHistory = _interopRequireDefault(__webpack_require__(/*! elementor-document/commands/base/command-history */ "../assets/dev/js/editor/document/commands/base/command-history.js")); | |
| 12282 | + | |
| 12283 | +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); }; } | |
| 12284 | + | |
| 12285 | +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; } } | |
| 12286 | + | |
| 12287 | +var Remove = /*#__PURE__*/function (_CommandHistory) { | |
| 12288 | + (0, _inherits2.default)(Remove, _CommandHistory); | |
| 12289 | + | |
| 12290 | + var _super = _createSuper(Remove); | |
| 12291 | + | |
| 12292 | + function Remove() { | |
| 12293 | + (0, _classCallCheck2.default)(this, Remove); | |
| 12294 | + return _super.apply(this, arguments); | |
| 12295 | + } | |
| 12296 | + | |
| 12297 | + (0, _createClass2.default)(Remove, [{ | |
| 12298 | + key: "validateArgs", | |
| 12299 | + value: function validateArgs(args) { | |
| 12300 | + this.requireContainer(args); | |
| 12301 | + this.requireArgumentType('name', 'string', args); | |
| 12302 | + this.requireArgument('index', args); // sometimes null. | |
| 12303 | + } | |
| 333 | 12304 | }, { |
| 334 | - key: "onAfterRun", | |
| 335 | - value: function onAfterRun(args, result) { | |
| 336 | - $e.modules.CommandBase.prototype.onAfterRun.call(this, args, result); | |
| 337 | - if (this.isHistoryActive()) { | |
| 338 | - if (this.isDebounceRequired) { | |
| 339 | - this.constructor.debounce(function () { | |
| 340 | - return $e.internal('document/history/end-transaction'); | |
| 12305 | + key: "getHistory", | |
| 12306 | + value: function getHistory(args) { | |
| 12307 | + var _args$containers = args.containers, | |
| 12308 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 12309 | + return { | |
| 12310 | + containers: containers, | |
| 12311 | + type: 'remove', | |
| 12312 | + subTitle: __('Item', 'elementor') | |
| 12313 | + }; | |
| 12314 | + } | |
| 12315 | + }, { | |
| 12316 | + key: "isDataChanged", | |
| 12317 | + value: function isDataChanged() { | |
| 12318 | + return true; | |
| 12319 | + } | |
| 12320 | + }, { | |
| 12321 | + key: "apply", | |
| 12322 | + value: function apply(args) { | |
| 12323 | + var _this = this; | |
| 12324 | + | |
| 12325 | + var name = args.name, | |
| 12326 | + _args$containers2 = args.containers, | |
| 12327 | + containers = _args$containers2 === void 0 ? [args.container] : _args$containers2, | |
| 12328 | + index = null === args.index ? -1 : args.index, | |
| 12329 | + result = []; | |
| 12330 | + containers.forEach(function (container) { | |
| 12331 | + container = container.lookup(); | |
| 12332 | + var collection = container.settings.get(name), | |
| 12333 | + model = collection.at(index), | |
| 12334 | + repeaterContainer = container.repeaters[name]; | |
| 12335 | + | |
| 12336 | + if (_this.isHistoryActive()) { | |
| 12337 | + $e.internal('document/history/log-sub-item', { | |
| 12338 | + container: container, | |
| 12339 | + data: { | |
| 12340 | + name: name, | |
| 12341 | + model: model, | |
| 12342 | + index: index | |
| 12343 | + }, | |
| 12344 | + restore: _this.constructor.restore | |
| 341 | 12345 | }); |
| 342 | - } else { | |
| 343 | - $e.internal('document/history/end-transaction'); | |
| 12346 | + } // Remove from container and add to result. | |
| 12347 | + | |
| 12348 | + | |
| 12349 | + result.push(repeaterContainer.children.splice(index, 1)); | |
| 12350 | + collection.remove(model); // Trigger render on widget but with the settings of the control. | |
| 12351 | + | |
| 12352 | + repeaterContainer.render(); | |
| 12353 | + }); | |
| 12354 | + | |
| 12355 | + if (1 === result.length) { | |
| 12356 | + return result[0]; | |
| 12357 | + } | |
| 12358 | + | |
| 12359 | + return result; | |
| 12360 | + } | |
| 12361 | + }], [{ | |
| 12362 | + key: "restore", | |
| 12363 | + value: function restore(historyItem, isRedo) { | |
| 12364 | + var data = historyItem.get('data'), | |
| 12365 | + container = historyItem.get('container'); | |
| 12366 | + | |
| 12367 | + if (isRedo) { | |
| 12368 | + $e.run('document/repeater/remove', { | |
| 12369 | + container: container, | |
| 12370 | + name: data.name, | |
| 12371 | + index: data.index | |
| 12372 | + }); | |
| 12373 | + } else { | |
| 12374 | + $e.run('document/repeater/insert', { | |
| 12375 | + container: container, | |
| 12376 | + model: data.model, | |
| 12377 | + name: data.name, | |
| 12378 | + options: { | |
| 12379 | + at: data.index | |
| 12380 | + } | |
| 12381 | + }); | |
| 12382 | + } | |
| 12383 | + } | |
| 12384 | + }]); | |
| 12385 | + return Remove; | |
| 12386 | +}(_commandHistory.default); | |
| 12387 | + | |
| 12388 | +exports.Remove = Remove; | |
| 12389 | +var _default = Remove; | |
| 12390 | +exports["default"] = _default; | |
| 12391 | + | |
| 12392 | +/***/ }), | |
| 12393 | + | |
| 12394 | +/***/ "../assets/dev/js/editor/document/repeater/component.js": | |
| 12395 | +/*!**************************************************************!*\ | |
| 12396 | + !*** ../assets/dev/js/editor/document/repeater/component.js ***! | |
| 12397 | + \**************************************************************/ | |
| 12398 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12399 | + | |
| 12400 | +"use strict"; | |
| 12401 | + | |
| 12402 | + | |
| 12403 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12404 | + | |
| 12405 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 12406 | + | |
| 12407 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12408 | + value: true | |
| 12409 | +})); | |
| 12410 | +exports["default"] = void 0; | |
| 12411 | + | |
| 12412 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12413 | + | |
| 12414 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12415 | + | |
| 12416 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12417 | + | |
| 12418 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12419 | + | |
| 12420 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12421 | + | |
| 12422 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 12423 | + | |
| 12424 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/document/repeater/commands/index.js")); | |
| 12425 | + | |
| 12426 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 12427 | + | |
| 12428 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 12429 | + | |
| 12430 | +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); }; } | |
| 12431 | + | |
| 12432 | +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; } } | |
| 12433 | + | |
| 12434 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 12435 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 12436 | + | |
| 12437 | + var _super = _createSuper(Component); | |
| 12438 | + | |
| 12439 | + function Component() { | |
| 12440 | + (0, _classCallCheck2.default)(this, Component); | |
| 12441 | + return _super.apply(this, arguments); | |
| 12442 | + } | |
| 12443 | + | |
| 12444 | + (0, _createClass2.default)(Component, [{ | |
| 12445 | + key: "getNamespace", | |
| 12446 | + value: function getNamespace() { | |
| 12447 | + return 'document/repeater'; | |
| 12448 | + } | |
| 12449 | + }, { | |
| 12450 | + key: "defaultCommands", | |
| 12451 | + value: function defaultCommands() { | |
| 12452 | + return this.importCommands(commands); | |
| 12453 | + } | |
| 12454 | + }]); | |
| 12455 | + return Component; | |
| 12456 | +}(_componentBase.default); | |
| 12457 | + | |
| 12458 | +exports["default"] = Component; | |
| 12459 | + | |
| 12460 | +/***/ }), | |
| 12461 | + | |
| 12462 | +/***/ "../assets/dev/js/editor/document/save/backwards-compatibility.js": | |
| 12463 | +/*!************************************************************************!*\ | |
| 12464 | + !*** ../assets/dev/js/editor/document/save/backwards-compatibility.js ***! | |
| 12465 | + \************************************************************************/ | |
| 12466 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12467 | + | |
| 12468 | +"use strict"; | |
| 12469 | + | |
| 12470 | + | |
| 12471 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12472 | + | |
| 12473 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12474 | + value: true | |
| 12475 | +})); | |
| 12476 | +exports["default"] = void 0; | |
| 12477 | + | |
| 12478 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12479 | + | |
| 12480 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12481 | + | |
| 12482 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 12483 | + | |
| 12484 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12485 | + | |
| 12486 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12487 | + | |
| 12488 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12489 | + | |
| 12490 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 12491 | + | |
| 12492 | +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); }; } | |
| 12493 | + | |
| 12494 | +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; } } | |
| 12495 | + | |
| 12496 | +var BackwardsCompatibility = /*#__PURE__*/function (_ComponentBase) { | |
| 12497 | + (0, _inherits2.default)(BackwardsCompatibility, _ComponentBase); | |
| 12498 | + | |
| 12499 | + var _super = _createSuper(BackwardsCompatibility); | |
| 12500 | + | |
| 12501 | + function BackwardsCompatibility() { | |
| 12502 | + (0, _classCallCheck2.default)(this, BackwardsCompatibility); | |
| 12503 | + return _super.apply(this, arguments); | |
| 12504 | + } | |
| 12505 | + | |
| 12506 | + (0, _createClass2.default)(BackwardsCompatibility, [{ | |
| 12507 | + key: "__construct", | |
| 12508 | + value: function __construct() { | |
| 12509 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 12510 | + (0, _get2.default)((0, _getPrototypeOf2.default)(BackwardsCompatibility.prototype), "__construct", this).call(this, args); | |
| 12511 | + Object.defineProperty(this, 'autoSaveTimer', { | |
| 12512 | + get: function get() { | |
| 12513 | + elementorCommon.helpers.softDeprecated('elementor.saver.autoSaveTimer', '2.9.0', "$e.components.get( 'editor/documents' ).autoSaveTimers"); | |
| 12514 | + return $e.components.get('editor/documents').autoSaveTimers; | |
| 12515 | + }, | |
| 12516 | + set: function set(value) { | |
| 12517 | + elementorCommon.helpers.softDeprecated('elementor.saver.autoSaveTimer', '2.9.0', "$e.components.get( 'editor/documents' ).autoSaveTimers[ documentId ]"); | |
| 12518 | + var documentId = elementor.documents.getCurrent(); | |
| 12519 | + $e.components.get('editor/documents').autoSaveTimers[documentId] = value; | |
| 344 | 12520 | } |
| 12521 | + }); | |
| 12522 | + var onOrig = this.on; | |
| 12523 | + | |
| 12524 | + this.on = function (eventName, callback, context) { | |
| 12525 | + elementorCommon.helpers.softDeprecated('elementor.saver.on', '2.9.0', '$e.hooks'); | |
| 12526 | + onOrig(eventName, callback, context); | |
| 12527 | + }; | |
| 12528 | + | |
| 12529 | + elementor.on('document:loaded', function () { | |
| 12530 | + if (elementor.channels.editor._events && elementor.channels.editor._events.saved) { | |
| 12531 | + elementorCommon.helpers.softDeprecated("elementor.channels.editor.on( 'saved', ... )", '2.9.0', '$e.hooks'); | |
| 12532 | + } | |
| 12533 | + }); | |
| 12534 | + } | |
| 12535 | + }, { | |
| 12536 | + key: "defaultSave", | |
| 12537 | + value: function defaultSave() { | |
| 12538 | + elementorCommon.helpers.softDeprecated('defaultSave', '2.9.0', "$e.run( 'document/save/default' )"); | |
| 12539 | + return $e.run('document/save/default'); | |
| 12540 | + } | |
| 12541 | + }, { | |
| 12542 | + key: "discard", | |
| 12543 | + value: function discard() { | |
| 12544 | + elementorCommon.helpers.softDeprecated('discard', '2.9.0', "$e.run( 'document/save/discard' )"); | |
| 12545 | + return $e.run('document/save/discard'); | |
| 12546 | + } | |
| 12547 | + }, { | |
| 12548 | + key: "doAutoSave", | |
| 12549 | + value: function doAutoSave() { | |
| 12550 | + elementorCommon.helpers.softDeprecated('doAutoSave', '2.9.0', "$e.run( 'document/save/auto' )"); | |
| 12551 | + return $e.run('document/save/auto'); | |
| 12552 | + } | |
| 12553 | + }, { | |
| 12554 | + key: "publish", | |
| 12555 | + value: function publish(options) { | |
| 12556 | + elementorCommon.helpers.softDeprecated('publish', '2.9.0', "$e.run( 'document/save/publish' )"); | |
| 12557 | + return $e.run('document/save/auto', { | |
| 12558 | + options: options | |
| 12559 | + }); | |
| 12560 | + } | |
| 12561 | + }, { | |
| 12562 | + key: "saveAutoSave", | |
| 12563 | + value: function saveAutoSave(options) { | |
| 12564 | + elementorCommon.helpers.softDeprecated('saveAutoSave', '2.9.0', "$e.run( 'document/save/auto', { force: true } )"); | |
| 12565 | + options.force = true; | |
| 12566 | + return $e.run('document/save/auto', options); | |
| 12567 | + } | |
| 12568 | + }, { | |
| 12569 | + key: "saveDraft", | |
| 12570 | + value: function saveDraft() { | |
| 12571 | + elementorCommon.helpers.softDeprecated('saveDraft', '2.9.0', "$e.run( 'document/save/draft' )"); | |
| 12572 | + return $e.run('document/save/draft'); | |
| 12573 | + } | |
| 12574 | + }, { | |
| 12575 | + key: "savePending", | |
| 12576 | + value: function savePending() { | |
| 12577 | + elementorCommon.helpers.softDeprecated('savePending', '2.9.0', "$e.run( 'document/save/pending' )"); | |
| 12578 | + return $e.run('document/save/pending'); | |
| 12579 | + } | |
| 12580 | + }, { | |
| 12581 | + key: "update", | |
| 12582 | + value: function update(options) { | |
| 12583 | + elementorCommon.helpers.softDeprecated('update', '2.9.0', "$e.run( 'document/save/update' )"); | |
| 12584 | + return $e.run('document/save/update', options); | |
| 12585 | + } | |
| 12586 | + }, { | |
| 12587 | + key: "startTimer", | |
| 12588 | + value: function startTimer() { | |
| 12589 | + elementorCommon.helpers.softDeprecated('startTimer', '2.9.0', "$e.components.get( 'document/save' ).startAutoSave"); | |
| 12590 | + throw Error('Deprecated'); | |
| 12591 | + } | |
| 12592 | + }, { | |
| 12593 | + key: "saveEditor", | |
| 12594 | + value: function saveEditor(options) { | |
| 12595 | + elementorCommon.helpers.softDeprecated('saveEditor', '2.9.0', "$e.internal( 'document/save/save' )"); | |
| 12596 | + $e.internal('document/save/save', options); | |
| 12597 | + } | |
| 12598 | + }, { | |
| 12599 | + key: "setFlagEditorChange", | |
| 12600 | + value: function setFlagEditorChange(status) { | |
| 12601 | + elementorCommon.helpers.softDeprecated('setFlagEditorChange', '2.9.0', "$e.internal( 'document/save/set-is-modified' )"); | |
| 12602 | + $e.internal('document/save/set-is-modified', { | |
| 12603 | + status: status | |
| 12604 | + }); | |
| 12605 | + } | |
| 12606 | + }]); | |
| 12607 | + return BackwardsCompatibility; | |
| 12608 | +}(_componentBase.default); | |
| 12609 | + | |
| 12610 | +exports["default"] = BackwardsCompatibility; | |
| 12611 | + | |
| 12612 | +/***/ }), | |
| 12613 | + | |
| 12614 | +/***/ "../assets/dev/js/editor/document/save/commands/auto.js": | |
| 12615 | +/*!**************************************************************!*\ | |
| 12616 | + !*** ../assets/dev/js/editor/document/save/commands/auto.js ***! | |
| 12617 | + \**************************************************************/ | |
| 12618 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12619 | + | |
| 12620 | +"use strict"; | |
| 12621 | + | |
| 12622 | + | |
| 12623 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12624 | + | |
| 12625 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12626 | + value: true | |
| 12627 | +})); | |
| 12628 | +exports["default"] = exports.Auto = void 0; | |
| 12629 | + | |
| 12630 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12631 | + | |
| 12632 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12633 | + | |
| 12634 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12635 | + | |
| 12636 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12637 | + | |
| 12638 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12639 | + | |
| 12640 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base/base */ "../assets/dev/js/editor/document/save/commands/base/base.js")); | |
| 12641 | + | |
| 12642 | +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); }; } | |
| 12643 | + | |
| 12644 | +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; } } | |
| 12645 | + | |
| 12646 | +var Auto = /*#__PURE__*/function (_Base) { | |
| 12647 | + (0, _inherits2.default)(Auto, _Base); | |
| 12648 | + | |
| 12649 | + var _super = _createSuper(Auto); | |
| 12650 | + | |
| 12651 | + function Auto() { | |
| 12652 | + (0, _classCallCheck2.default)(this, Auto); | |
| 12653 | + return _super.apply(this, arguments); | |
| 12654 | + } | |
| 12655 | + | |
| 12656 | + (0, _createClass2.default)(Auto, [{ | |
| 12657 | + key: "apply", | |
| 12658 | + value: function apply(args) { | |
| 12659 | + var _args$force = args.force, | |
| 12660 | + force = _args$force === void 0 ? false : _args$force, | |
| 12661 | + _args$document = args.document, | |
| 12662 | + document = _args$document === void 0 ? this.document : _args$document; | |
| 12663 | + | |
| 12664 | + if (!force && !document.container.isEditable()) { | |
| 12665 | + return jQuery.Deferred().reject('Document is not editable'); | |
| 345 | 12666 | } |
| 12667 | + | |
| 12668 | + if (!document.editor.isChanged) { | |
| 12669 | + return jQuery.Deferred().resolve('Document is not changed'); | |
| 12670 | + } | |
| 12671 | + | |
| 12672 | + args.status = 'autosave'; | |
| 12673 | + args.document = document; | |
| 12674 | + return $e.internal('document/save/save', args); | |
| 346 | 12675 | } |
| 12676 | + }]); | |
| 12677 | + return Auto; | |
| 12678 | +}(_base.default); | |
| 12679 | + | |
| 12680 | +exports.Auto = Auto; | |
| 12681 | +var _default = Auto; | |
| 12682 | +exports["default"] = _default; | |
| 12683 | + | |
| 12684 | +/***/ }), | |
| 12685 | + | |
| 12686 | +/***/ "../assets/dev/js/editor/document/save/commands/base/base.js": | |
| 12687 | +/*!*******************************************************************!*\ | |
| 12688 | + !*** ../assets/dev/js/editor/document/save/commands/base/base.js ***! | |
| 12689 | + \*******************************************************************/ | |
| 12690 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12691 | + | |
| 12692 | +"use strict"; | |
| 12693 | + | |
| 12694 | + | |
| 12695 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12696 | + | |
| 12697 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12698 | + value: true | |
| 12699 | +})); | |
| 12700 | +exports["default"] = void 0; | |
| 12701 | + | |
| 12702 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12703 | + | |
| 12704 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12705 | + | |
| 12706 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 12707 | + | |
| 12708 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12709 | + | |
| 12710 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12711 | + | |
| 12712 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12713 | + | |
| 12714 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 12715 | + | |
| 12716 | +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); }; } | |
| 12717 | + | |
| 12718 | +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; } } | |
| 12719 | + | |
| 12720 | +var Base = /*#__PURE__*/function (_CommandBase) { | |
| 12721 | + (0, _inherits2.default)(Base, _CommandBase); | |
| 12722 | + | |
| 12723 | + var _super = _createSuper(Base); | |
| 12724 | + | |
| 12725 | + function Base() { | |
| 12726 | + (0, _classCallCheck2.default)(this, Base); | |
| 12727 | + return _super.apply(this, arguments); | |
| 12728 | + } | |
| 12729 | + | |
| 12730 | + (0, _createClass2.default)(Base, [{ | |
| 12731 | + key: "initialize", | |
| 12732 | + value: function initialize(args) { | |
| 12733 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Base.prototype), "initialize", this).call(this, args); | |
| 12734 | + var _args$document = args.document, | |
| 12735 | + document = _args$document === void 0 ? elementor.documents.getCurrent() : _args$document; | |
| 12736 | + this.document = document; | |
| 12737 | + } | |
| 12738 | + }]); | |
| 12739 | + return Base; | |
| 12740 | +}(_commandBase.default); | |
| 12741 | + | |
| 12742 | +exports["default"] = Base; | |
| 12743 | + | |
| 12744 | +/***/ }), | |
| 12745 | + | |
| 12746 | +/***/ "../assets/dev/js/editor/document/save/commands/default.js": | |
| 12747 | +/*!*****************************************************************!*\ | |
| 12748 | + !*** ../assets/dev/js/editor/document/save/commands/default.js ***! | |
| 12749 | + \*****************************************************************/ | |
| 12750 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12751 | + | |
| 12752 | +"use strict"; | |
| 12753 | + | |
| 12754 | + | |
| 12755 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12756 | + | |
| 12757 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12758 | + value: true | |
| 12759 | +})); | |
| 12760 | +exports["default"] = exports.Default = void 0; | |
| 12761 | + | |
| 12762 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12763 | + | |
| 12764 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12765 | + | |
| 12766 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12767 | + | |
| 12768 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12769 | + | |
| 12770 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12771 | + | |
| 12772 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base/base */ "../assets/dev/js/editor/document/save/commands/base/base.js")); | |
| 12773 | + | |
| 12774 | +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); }; } | |
| 12775 | + | |
| 12776 | +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; } } | |
| 12777 | + | |
| 12778 | +var Default = /*#__PURE__*/function (_Base) { | |
| 12779 | + (0, _inherits2.default)(Default, _Base); | |
| 12780 | + | |
| 12781 | + var _super = _createSuper(Default); | |
| 12782 | + | |
| 12783 | + function Default() { | |
| 12784 | + (0, _classCallCheck2.default)(this, Default); | |
| 12785 | + return _super.apply(this, arguments); | |
| 12786 | + } | |
| 12787 | + | |
| 12788 | + (0, _createClass2.default)(Default, [{ | |
| 12789 | + key: "apply", | |
| 12790 | + value: function apply() { | |
| 12791 | + var document = this.document, | |
| 12792 | + postStatus = document.container.settings.get('post_status'); | |
| 12793 | + var deferred; | |
| 12794 | + | |
| 12795 | + switch (postStatus) { | |
| 12796 | + case 'publish': | |
| 12797 | + case 'future': | |
| 12798 | + case 'private': | |
| 12799 | + deferred = $e.run('document/save/update', { | |
| 12800 | + document: document | |
| 12801 | + }); | |
| 12802 | + break; | |
| 12803 | + | |
| 12804 | + case 'draft': | |
| 12805 | + if (document.config.user.can_publish) { | |
| 12806 | + deferred = $e.run('document/save/publish', { | |
| 12807 | + document: document | |
| 12808 | + }); | |
| 12809 | + } else { | |
| 12810 | + deferred = $e.run('document/save/pending', { | |
| 12811 | + document: document | |
| 12812 | + }); | |
| 12813 | + } | |
| 12814 | + | |
| 12815 | + break; | |
| 12816 | + | |
| 12817 | + case 'pending': // User cannot change post status | |
| 12818 | + | |
| 12819 | + case undefined: | |
| 12820 | + // TODO: as a contributor it's undefined instead of 'pending'. | |
| 12821 | + if (document.config.user.can_publish) { | |
| 12822 | + deferred = $e.run('document/save/publish', { | |
| 12823 | + document: document | |
| 12824 | + }); | |
| 12825 | + } else { | |
| 12826 | + deferred = $e.run('document/save/update', { | |
| 12827 | + document: document | |
| 12828 | + }); | |
| 12829 | + } | |
| 12830 | + | |
| 12831 | + } | |
| 12832 | + | |
| 12833 | + return deferred; | |
| 12834 | + } | |
| 12835 | + }]); | |
| 12836 | + return Default; | |
| 12837 | +}(_base.default); | |
| 12838 | + | |
| 12839 | +exports.Default = Default; | |
| 12840 | +var _default = Default; | |
| 12841 | +exports["default"] = _default; | |
| 12842 | + | |
| 12843 | +/***/ }), | |
| 12844 | + | |
| 12845 | +/***/ "../assets/dev/js/editor/document/save/commands/discard.js": | |
| 12846 | +/*!*****************************************************************!*\ | |
| 12847 | + !*** ../assets/dev/js/editor/document/save/commands/discard.js ***! | |
| 12848 | + \*****************************************************************/ | |
| 12849 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12850 | + | |
| 12851 | +"use strict"; | |
| 12852 | + | |
| 12853 | + | |
| 12854 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12855 | + | |
| 12856 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12857 | + value: true | |
| 12858 | +})); | |
| 12859 | +exports["default"] = exports.Discard = void 0; | |
| 12860 | + | |
| 12861 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12862 | + | |
| 12863 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12864 | + | |
| 12865 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12866 | + | |
| 12867 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12868 | + | |
| 12869 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12870 | + | |
| 12871 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base/base */ "../assets/dev/js/editor/document/save/commands/base/base.js")); | |
| 12872 | + | |
| 12873 | +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); }; } | |
| 12874 | + | |
| 12875 | +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; } } | |
| 12876 | + | |
| 12877 | +var Discard = /*#__PURE__*/function (_Base) { | |
| 12878 | + (0, _inherits2.default)(Discard, _Base); | |
| 12879 | + | |
| 12880 | + var _super = _createSuper(Discard); | |
| 12881 | + | |
| 12882 | + function Discard() { | |
| 12883 | + (0, _classCallCheck2.default)(this, Discard); | |
| 12884 | + return _super.apply(this, arguments); | |
| 12885 | + } | |
| 12886 | + | |
| 12887 | + (0, _createClass2.default)(Discard, [{ | |
| 12888 | + key: "apply", | |
| 12889 | + value: function apply(args) { | |
| 12890 | + var _args$document = args.document, | |
| 12891 | + document = _args$document === void 0 ? elementor.documents.getCurrent() : _args$document; // Start server request before undo, because the undo can take time. | |
| 12892 | + | |
| 12893 | + var deferred = elementorCommon.ajax.addRequest('discard_changes'); | |
| 12894 | + $e.run('document/history/undo-all', { | |
| 12895 | + document: document | |
| 12896 | + }); // Discard autosave revision if exist. | |
| 12897 | + | |
| 12898 | + return deferred; | |
| 12899 | + } | |
| 12900 | + }]); | |
| 12901 | + return Discard; | |
| 12902 | +}(_base.default); | |
| 12903 | + | |
| 12904 | +exports.Discard = Discard; | |
| 12905 | +var _default = Discard; | |
| 12906 | +exports["default"] = _default; | |
| 12907 | + | |
| 12908 | +/***/ }), | |
| 12909 | + | |
| 12910 | +/***/ "../assets/dev/js/editor/document/save/commands/draft.js": | |
| 12911 | +/*!***************************************************************!*\ | |
| 12912 | + !*** ../assets/dev/js/editor/document/save/commands/draft.js ***! | |
| 12913 | + \***************************************************************/ | |
| 12914 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12915 | + | |
| 12916 | +"use strict"; | |
| 12917 | + | |
| 12918 | + | |
| 12919 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 12920 | + | |
| 12921 | +Object.defineProperty(exports, "__esModule", ({ | |
| 12922 | + value: true | |
| 12923 | +})); | |
| 12924 | +exports["default"] = exports.Draft = void 0; | |
| 12925 | + | |
| 12926 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 12927 | + | |
| 12928 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 12929 | + | |
| 12930 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 12931 | + | |
| 12932 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 12933 | + | |
| 12934 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 12935 | + | |
| 12936 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base/base */ "../assets/dev/js/editor/document/save/commands/base/base.js")); | |
| 12937 | + | |
| 12938 | +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); }; } | |
| 12939 | + | |
| 12940 | +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; } } | |
| 12941 | + | |
| 12942 | +var Draft = /*#__PURE__*/function (_Base) { | |
| 12943 | + (0, _inherits2.default)(Draft, _Base); | |
| 12944 | + | |
| 12945 | + var _super = _createSuper(Draft); | |
| 12946 | + | |
| 12947 | + function Draft() { | |
| 12948 | + (0, _classCallCheck2.default)(this, Draft); | |
| 12949 | + return _super.apply(this, arguments); | |
| 12950 | + } | |
| 12951 | + | |
| 12952 | + (0, _createClass2.default)(Draft, [{ | |
| 12953 | + key: "apply", | |
| 12954 | + value: function apply() { | |
| 12955 | + var document = this.document, | |
| 12956 | + postStatus = document.container.settings.get('post_status'); // If no changes - don't save but allow un-publish. | |
| 12957 | + | |
| 12958 | + if (!document.editor.isChanged && 'draft' !== postStatus) { | |
| 12959 | + return jQuery.Deferred().reject('Document is not editable'); | |
| 12960 | + } | |
| 12961 | + | |
| 12962 | + var deferred; | |
| 12963 | + | |
| 12964 | + switch (postStatus) { | |
| 12965 | + case 'publish': | |
| 12966 | + case 'private': | |
| 12967 | + deferred = $e.run('document/save/auto', { | |
| 12968 | + document: document | |
| 12969 | + }); | |
| 12970 | + break; | |
| 12971 | + | |
| 12972 | + default: | |
| 12973 | + // Update and create a revision | |
| 12974 | + deferred = $e.run('document/save/update', { | |
| 12975 | + document: document | |
| 12976 | + }); | |
| 12977 | + } | |
| 12978 | + | |
| 12979 | + return deferred; | |
| 12980 | + } | |
| 12981 | + }]); | |
| 12982 | + return Draft; | |
| 12983 | +}(_base.default); | |
| 12984 | + | |
| 12985 | +exports.Draft = Draft; | |
| 12986 | +var _default = Draft; | |
| 12987 | +exports["default"] = _default; | |
| 12988 | + | |
| 12989 | +/***/ }), | |
| 12990 | + | |
| 12991 | +/***/ "../assets/dev/js/editor/document/save/commands/index.js": | |
| 12992 | +/*!***************************************************************!*\ | |
| 12993 | + !*** ../assets/dev/js/editor/document/save/commands/index.js ***! | |
| 12994 | + \***************************************************************/ | |
| 12995 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 12996 | + | |
| 12997 | +"use strict"; | |
| 12998 | + | |
| 12999 | + | |
| 13000 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13001 | + value: true | |
| 13002 | +})); | |
| 13003 | +Object.defineProperty(exports, "Auto", ({ | |
| 13004 | + enumerable: true, | |
| 13005 | + get: function get() { | |
| 13006 | + return _auto.Auto; | |
| 13007 | + } | |
| 13008 | +})); | |
| 13009 | +Object.defineProperty(exports, "Default", ({ | |
| 13010 | + enumerable: true, | |
| 13011 | + get: function get() { | |
| 13012 | + return _default.Default; | |
| 13013 | + } | |
| 13014 | +})); | |
| 13015 | +Object.defineProperty(exports, "Discard", ({ | |
| 13016 | + enumerable: true, | |
| 13017 | + get: function get() { | |
| 13018 | + return _discard.Discard; | |
| 13019 | + } | |
| 13020 | +})); | |
| 13021 | +Object.defineProperty(exports, "Draft", ({ | |
| 13022 | + enumerable: true, | |
| 13023 | + get: function get() { | |
| 13024 | + return _draft.Draft; | |
| 13025 | + } | |
| 13026 | +})); | |
| 13027 | +Object.defineProperty(exports, "Pending", ({ | |
| 13028 | + enumerable: true, | |
| 13029 | + get: function get() { | |
| 13030 | + return _pending.Pending; | |
| 13031 | + } | |
| 13032 | +})); | |
| 13033 | +Object.defineProperty(exports, "Publish", ({ | |
| 13034 | + enumerable: true, | |
| 13035 | + get: function get() { | |
| 13036 | + return _publish.Publish; | |
| 13037 | + } | |
| 13038 | +})); | |
| 13039 | +Object.defineProperty(exports, "Update", ({ | |
| 13040 | + enumerable: true, | |
| 13041 | + get: function get() { | |
| 13042 | + return _update.Update; | |
| 13043 | + } | |
| 13044 | +})); | |
| 13045 | + | |
| 13046 | +var _auto = __webpack_require__(/*! ./auto */ "../assets/dev/js/editor/document/save/commands/auto.js"); | |
| 13047 | + | |
| 13048 | +var _default = __webpack_require__(/*! ./default */ "../assets/dev/js/editor/document/save/commands/default.js"); | |
| 13049 | + | |
| 13050 | +var _discard = __webpack_require__(/*! ./discard */ "../assets/dev/js/editor/document/save/commands/discard.js"); | |
| 13051 | + | |
| 13052 | +var _draft = __webpack_require__(/*! ./draft */ "../assets/dev/js/editor/document/save/commands/draft.js"); | |
| 13053 | + | |
| 13054 | +var _pending = __webpack_require__(/*! ./pending */ "../assets/dev/js/editor/document/save/commands/pending.js"); | |
| 13055 | + | |
| 13056 | +var _publish = __webpack_require__(/*! ./publish */ "../assets/dev/js/editor/document/save/commands/publish.js"); | |
| 13057 | + | |
| 13058 | +var _update = __webpack_require__(/*! ./update */ "../assets/dev/js/editor/document/save/commands/update.js"); | |
| 13059 | + | |
| 13060 | +/***/ }), | |
| 13061 | + | |
| 13062 | +/***/ "../assets/dev/js/editor/document/save/commands/internal/index.js": | |
| 13063 | +/*!************************************************************************!*\ | |
| 13064 | + !*** ../assets/dev/js/editor/document/save/commands/internal/index.js ***! | |
| 13065 | + \************************************************************************/ | |
| 13066 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13067 | + | |
| 13068 | +"use strict"; | |
| 13069 | + | |
| 13070 | + | |
| 13071 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13072 | + value: true | |
| 13073 | +})); | |
| 13074 | +Object.defineProperty(exports, "Save", ({ | |
| 13075 | + enumerable: true, | |
| 13076 | + get: function get() { | |
| 13077 | + return _save.Save; | |
| 13078 | + } | |
| 13079 | +})); | |
| 13080 | +Object.defineProperty(exports, "SetIsModified", ({ | |
| 13081 | + enumerable: true, | |
| 13082 | + get: function get() { | |
| 13083 | + return _setIsModified.SetIsModified; | |
| 13084 | + } | |
| 13085 | +})); | |
| 13086 | + | |
| 13087 | +var _save = __webpack_require__(/*! ./save.js */ "../assets/dev/js/editor/document/save/commands/internal/save.js"); | |
| 13088 | + | |
| 13089 | +var _setIsModified = __webpack_require__(/*! ./set-is-modified */ "../assets/dev/js/editor/document/save/commands/internal/set-is-modified.js"); | |
| 13090 | + | |
| 13091 | +/***/ }), | |
| 13092 | + | |
| 13093 | +/***/ "../assets/dev/js/editor/document/save/commands/internal/save.js": | |
| 13094 | +/*!***********************************************************************!*\ | |
| 13095 | + !*** ../assets/dev/js/editor/document/save/commands/internal/save.js ***! | |
| 13096 | + \***********************************************************************/ | |
| 13097 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13098 | + | |
| 13099 | +"use strict"; | |
| 13100 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 13101 | + | |
| 13102 | + | |
| 13103 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13104 | + | |
| 13105 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13106 | + value: true | |
| 13107 | +})); | |
| 13108 | +exports["default"] = exports.Save = void 0; | |
| 13109 | + | |
| 13110 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13111 | + | |
| 13112 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13113 | + | |
| 13114 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13115 | + | |
| 13116 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13117 | + | |
| 13118 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13119 | + | |
| 13120 | +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js")); | |
| 13121 | + | |
| 13122 | +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); }; } | |
| 13123 | + | |
| 13124 | +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; } } | |
| 13125 | + | |
| 13126 | +var Save = /*#__PURE__*/function (_CommandInternalBase) { | |
| 13127 | + (0, _inherits2.default)(Save, _CommandInternalBase); | |
| 13128 | + | |
| 13129 | + var _super = _createSuper(Save); | |
| 13130 | + | |
| 13131 | + function Save() { | |
| 13132 | + (0, _classCallCheck2.default)(this, Save); | |
| 13133 | + return _super.apply(this, arguments); | |
| 13134 | + } | |
| 13135 | + | |
| 13136 | + (0, _createClass2.default)(Save, [{ | |
| 13137 | + key: "apply", | |
| 13138 | + value: function apply(args) { | |
| 13139 | + var _this = this; | |
| 13140 | + | |
| 13141 | + var _args$status = args.status, | |
| 13142 | + status = _args$status === void 0 ? 'draft' : _args$status, | |
| 13143 | + _args$force = args.force, | |
| 13144 | + force = _args$force === void 0 ? false : _args$force, | |
| 13145 | + _args$onSuccess = args.onSuccess, | |
| 13146 | + onSuccess = _args$onSuccess === void 0 ? null : _args$onSuccess, | |
| 13147 | + _args$document = args.document, | |
| 13148 | + document = _args$document === void 0 ? elementor.documents.getCurrent() : _args$document; | |
| 13149 | + | |
| 13150 | + if (!force && document.editor.isSaving) { | |
| 13151 | + return jQuery.Deferred().reject('Document already in save progress'); | |
| 13152 | + } | |
| 13153 | + | |
| 13154 | + var container = document.container, | |
| 13155 | + settings = container.settings.toJSON({ | |
| 13156 | + remove: ['default'] | |
| 13157 | + }), | |
| 13158 | + oldStatus = container.settings.get('post_status'); // TODO: Remove - Backwards compatibility. | |
| 13159 | + | |
| 13160 | + elementor.saver.trigger('before:save', args).trigger('before:save:' + status, args); | |
| 13161 | + document.editor.isSaving = true; | |
| 13162 | + document.editor.isChangedDuringSave = false; | |
| 13163 | + settings.post_status = status; | |
| 13164 | + var elements = []; | |
| 13165 | + | |
| 13166 | + if (elementor.config.document.panel.has_elements) { | |
| 13167 | + elements = container.model.get('elements').toJSON({ | |
| 13168 | + remove: ['default', 'editSettings', 'defaultEditSettings'] | |
| 13169 | + }); | |
| 13170 | + } | |
| 13171 | + | |
| 13172 | + var successArgs = { | |
| 13173 | + status: status, | |
| 13174 | + oldStatus: oldStatus, | |
| 13175 | + elements: elements, | |
| 13176 | + document: document, | |
| 13177 | + currentHistoryId: document.history.currentItem.get('id') | |
| 13178 | + }; | |
| 13179 | + var deferred = elementorCommon.ajax.addRequest('save_builder', { | |
| 13180 | + data: { | |
| 13181 | + status: status, | |
| 13182 | + elements: elements, | |
| 13183 | + settings: settings | |
| 13184 | + }, | |
| 13185 | + error: function error(data) { | |
| 13186 | + return _this.onSaveError(data, status, document); | |
| 13187 | + } | |
| 13188 | + }).then(function (data) { | |
| 13189 | + return _this.onSaveSuccess(data, successArgs, onSuccess); | |
| 13190 | + }); // TODO: Remove - Backwards compatibility | |
| 13191 | + | |
| 13192 | + elementor.saver.trigger('save', args); | |
| 13193 | + return deferred; | |
| 13194 | + } | |
| 347 | 13195 | }, { |
| 348 | - key: "onCatchApply", | |
| 349 | - value: function onCatchApply(e) { | |
| 350 | - $e.modules.CommandBase.prototype.onCatchApply.call(this, e); | |
| 13196 | + key: "onSaveSuccess", | |
| 13197 | + value: function onSaveSuccess(data, args) { | |
| 13198 | + var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | |
| 13199 | + var status = args.status, | |
| 13200 | + oldStatus = args.oldStatus, | |
| 13201 | + elements = args.elements, | |
| 13202 | + document = args.document, | |
| 13203 | + currentHistoryId = args.currentHistoryId; | |
| 13204 | + this.onAfterAjax(document); | |
| 13205 | + document.editor.lastSaveHistoryId = currentHistoryId; // Remove document cache. | |
| 351 | 13206 | |
| 352 | - // Rollback history on failure. | |
| 353 | - if (e instanceof $e.modules.HookBreak && this.history) { | |
| 354 | - if (this.isDebounceRequired) { | |
| 355 | - // `clear-transaction` is under debounce, because it should `clear-transaction` after `end-transaction`. | |
| 356 | - this.constructor.debounce(function () { | |
| 357 | - return $e.internal('document/history/clear-transaction'); | |
| 13207 | + elementor.documents.invalidateCache(document.id); | |
| 13208 | + var statusChanged = status !== oldStatus, | |
| 13209 | + result = { | |
| 13210 | + data: data, | |
| 13211 | + statusChanged: statusChanged | |
| 13212 | + }; // Document is switched during the save, do nothing. | |
| 13213 | + | |
| 13214 | + if (document !== elementor.documents.getCurrent()) { | |
| 13215 | + return result; | |
| 13216 | + } | |
| 13217 | + | |
| 13218 | + if (!document.editor.isChangedDuringSave) { | |
| 13219 | + document.editor.isSaved = true; | |
| 13220 | + } // TODO: Move to hook. | |
| 13221 | + | |
| 13222 | + | |
| 13223 | + if ('autosave' !== status) { | |
| 13224 | + if (statusChanged) { | |
| 13225 | + $e.run('document/elements/settings', { | |
| 13226 | + container: elementor.settings.page.getEditedView().getContainer(), | |
| 13227 | + settings: { | |
| 13228 | + post_status: status | |
| 13229 | + }, | |
| 13230 | + options: { | |
| 13231 | + external: true | |
| 13232 | + } | |
| 358 | 13233 | }); |
| 359 | - } else { | |
| 360 | - $e.internal('document/history/clear-transaction'); | |
| 13234 | + } // Notice: Must be after update page.model.post_status to the new status. | |
| 13235 | + | |
| 13236 | + | |
| 13237 | + if (!document.editor.isChangedDuringSave) { | |
| 13238 | + $e.internal('document/save/set-is-modified', { | |
| 13239 | + status: false | |
| 13240 | + }); | |
| 361 | 13241 | } |
| 362 | 13242 | } |
| 13243 | + | |
| 13244 | + if (data.config) { | |
| 13245 | + // TODO: Move to es6. | |
| 13246 | + jQuery.extend(true, document.config, data.config.document); | |
| 13247 | + } | |
| 13248 | + | |
| 13249 | + if (document.config.elements) { | |
| 13250 | + document.config.elements = elements; | |
| 13251 | + } // TODO: Remove - Backwards compatibility | |
| 13252 | + | |
| 13253 | + | |
| 13254 | + elementor.channels.editor.trigger('saved', data); // TODO: Remove - Backwards compatibility | |
| 13255 | + | |
| 13256 | + elementor.saver.trigger('after:save', data).trigger('after:save:' + status, data); // TODO: Remove - Backwards compatibility | |
| 13257 | + | |
| 13258 | + if (statusChanged) { | |
| 13259 | + elementor.saver.trigger('page:status:change', status, oldStatus); | |
| 13260 | + } | |
| 13261 | + | |
| 13262 | + if (_.isFunction(callback)) { | |
| 13263 | + callback.call(this, result); | |
| 13264 | + } | |
| 13265 | + | |
| 13266 | + return result; | |
| 363 | 13267 | } |
| 364 | - }], [{ | |
| 365 | - key: "getInstanceType", | |
| 366 | - value: function getInstanceType() { | |
| 367 | - return 'CommandHistoryDebounceBase'; | |
| 13268 | + }, { | |
| 13269 | + key: "onSaveError", | |
| 13270 | + value: function onSaveError(data, status, document) { | |
| 13271 | + this.onAfterAjax(document); // TODO: Remove - Backwards compatibility | |
| 13272 | + | |
| 13273 | + elementor.saver.trigger('after:saveError', data).trigger('after:saveError:' + status, data); | |
| 13274 | + var message; | |
| 13275 | + | |
| 13276 | + if (_.isString(data)) { | |
| 13277 | + message = data; | |
| 13278 | + } else if (data.statusText) { | |
| 13279 | + message = elementor.createAjaxErrorMessage(data); | |
| 13280 | + | |
| 13281 | + if (0 === data.readyState) { | |
| 13282 | + message += ' ' + __('Saving has been disabled until you’re reconnected.', 'elementor'); | |
| 13283 | + } | |
| 13284 | + } else if (data[0] && data[0].code) { | |
| 13285 | + message = __('Server Error', 'elementor') + ' ' + data[0].code; | |
| 13286 | + } | |
| 13287 | + | |
| 13288 | + elementor.notifications.showToast({ | |
| 13289 | + message: message | |
| 13290 | + }); | |
| 368 | 13291 | } |
| 13292 | + }, { | |
| 13293 | + key: "onAfterAjax", | |
| 13294 | + value: function onAfterAjax(document) { | |
| 13295 | + document.editor.isSaving = false; | |
| 13296 | + } | |
| 369 | 13297 | }]); |
| 370 | -}(_commandHistoryBase.default); | |
| 13298 | + return Save; | |
| 13299 | +}(_commandInternalBase.default); | |
| 13300 | + | |
| 13301 | +exports.Save = Save; | |
| 13302 | +var _default = Save; | |
| 13303 | +exports["default"] = _default; | |
| 13304 | + | |
| 13305 | +/***/ }), | |
| 13306 | + | |
| 13307 | +/***/ "../assets/dev/js/editor/document/save/commands/internal/set-is-modified.js": | |
| 13308 | +/*!**********************************************************************************!*\ | |
| 13309 | + !*** ../assets/dev/js/editor/document/save/commands/internal/set-is-modified.js ***! | |
| 13310 | + \**********************************************************************************/ | |
| 13311 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13312 | + | |
| 13313 | +"use strict"; | |
| 13314 | + | |
| 13315 | + | |
| 13316 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13317 | + | |
| 13318 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13319 | + value: true | |
| 13320 | +})); | |
| 13321 | +exports["default"] = exports.SetIsModified = void 0; | |
| 13322 | + | |
| 13323 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13324 | + | |
| 13325 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13326 | + | |
| 13327 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13328 | + | |
| 13329 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13330 | + | |
| 13331 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13332 | + | |
| 13333 | +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js")); | |
| 13334 | + | |
| 13335 | +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); }; } | |
| 13336 | + | |
| 13337 | +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; } } | |
| 13338 | + | |
| 13339 | +var SetIsModified = /*#__PURE__*/function (_CommandInternalBase) { | |
| 13340 | + (0, _inherits2.default)(SetIsModified, _CommandInternalBase); | |
| 13341 | + | |
| 13342 | + var _super = _createSuper(SetIsModified); | |
| 13343 | + | |
| 13344 | + function SetIsModified() { | |
| 13345 | + (0, _classCallCheck2.default)(this, SetIsModified); | |
| 13346 | + return _super.apply(this, arguments); | |
| 13347 | + } | |
| 13348 | + | |
| 13349 | + (0, _createClass2.default)(SetIsModified, [{ | |
| 13350 | + key: "validateArgs", | |
| 13351 | + value: function validateArgs(args) { | |
| 13352 | + this.requireArgumentType('status', 'boolean', args); | |
| 13353 | + } | |
| 13354 | + }, { | |
| 13355 | + key: "apply", | |
| 13356 | + value: function apply(args) { | |
| 13357 | + var status = args.status, | |
| 13358 | + _args$document = args.document, | |
| 13359 | + document = _args$document === void 0 ? elementor.documents.getCurrent() : _args$document; // Save document for hooks. | |
| 13360 | + | |
| 13361 | + args.document = document; | |
| 13362 | + document.editor.isChanged = status; | |
| 13363 | + | |
| 13364 | + if (status && document.editor.isSaving) { | |
| 13365 | + document.editor.isChangedDuringSave = true; | |
| 13366 | + } | |
| 13367 | + | |
| 13368 | + if (status) { | |
| 13369 | + document.editor.isSaved = false; | |
| 13370 | + } // TODO: BC. | |
| 13371 | + | |
| 13372 | + | |
| 13373 | + elementor.channels.editor.reply('status', status).trigger('status:change', status); | |
| 13374 | + | |
| 13375 | + if (document.editor.isChanged) { | |
| 13376 | + this.component.startAutoSave(document); | |
| 13377 | + } | |
| 13378 | + } | |
| 13379 | + }]); | |
| 13380 | + return SetIsModified; | |
| 13381 | +}(_commandInternalBase.default); | |
| 13382 | + | |
| 13383 | +exports.SetIsModified = SetIsModified; | |
| 13384 | +var _default = SetIsModified; | |
| 13385 | +exports["default"] = _default; | |
| 13386 | + | |
| 13387 | +/***/ }), | |
| 13388 | + | |
| 13389 | +/***/ "../assets/dev/js/editor/document/save/commands/pending.js": | |
| 13390 | +/*!*****************************************************************!*\ | |
| 13391 | + !*** ../assets/dev/js/editor/document/save/commands/pending.js ***! | |
| 13392 | + \*****************************************************************/ | |
| 13393 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13394 | + | |
| 13395 | +"use strict"; | |
| 13396 | + | |
| 13397 | + | |
| 13398 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13399 | + | |
| 13400 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13401 | + value: true | |
| 13402 | +})); | |
| 13403 | +exports.Pending = void 0; | |
| 13404 | + | |
| 13405 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13406 | + | |
| 13407 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13408 | + | |
| 13409 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13410 | + | |
| 13411 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13412 | + | |
| 13413 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13414 | + | |
| 13415 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base/base */ "../assets/dev/js/editor/document/save/commands/base/base.js")); | |
| 13416 | + | |
| 13417 | +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); }; } | |
| 13418 | + | |
| 13419 | +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; } } | |
| 13420 | + | |
| 13421 | +var Pending = /*#__PURE__*/function (_Base) { | |
| 13422 | + (0, _inherits2.default)(Pending, _Base); | |
| 13423 | + | |
| 13424 | + var _super = _createSuper(Pending); | |
| 13425 | + | |
| 13426 | + function Pending() { | |
| 13427 | + (0, _classCallCheck2.default)(this, Pending); | |
| 13428 | + return _super.apply(this, arguments); | |
| 13429 | + } | |
| 13430 | + | |
| 13431 | + (0, _createClass2.default)(Pending, [{ | |
| 13432 | + key: "apply", | |
| 13433 | + value: function apply(args) { | |
| 13434 | + var _args$status = args.status, | |
| 13435 | + status = _args$status === void 0 ? 'pending' : _args$status, | |
| 13436 | + _args$document = args.document, | |
| 13437 | + document = _args$document === void 0 ? this.document : _args$document; | |
| 13438 | + return $e.internal('document/save/save', { | |
| 13439 | + status: status, | |
| 13440 | + document: document | |
| 13441 | + }); | |
| 13442 | + } | |
| 13443 | + }]); | |
| 13444 | + return Pending; | |
| 13445 | +}(_base.default); | |
| 13446 | + | |
| 13447 | +exports.Pending = Pending; | |
| 13448 | + | |
| 13449 | +/***/ }), | |
| 13450 | + | |
| 13451 | +/***/ "../assets/dev/js/editor/document/save/commands/publish.js": | |
| 13452 | +/*!*****************************************************************!*\ | |
| 13453 | + !*** ../assets/dev/js/editor/document/save/commands/publish.js ***! | |
| 13454 | + \*****************************************************************/ | |
| 13455 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13456 | + | |
| 13457 | +"use strict"; | |
| 13458 | + | |
| 13459 | + | |
| 13460 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13461 | + | |
| 13462 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13463 | + value: true | |
| 13464 | +})); | |
| 13465 | +exports.Publish = void 0; | |
| 13466 | + | |
| 13467 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13468 | + | |
| 13469 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13470 | + | |
| 13471 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13472 | + | |
| 13473 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13474 | + | |
| 13475 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13476 | + | |
| 13477 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base/base */ "../assets/dev/js/editor/document/save/commands/base/base.js")); | |
| 13478 | + | |
| 13479 | +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); }; } | |
| 13480 | + | |
| 13481 | +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; } } | |
| 13482 | + | |
| 13483 | +var Publish = /*#__PURE__*/function (_Base) { | |
| 13484 | + (0, _inherits2.default)(Publish, _Base); | |
| 13485 | + | |
| 13486 | + var _super = _createSuper(Publish); | |
| 13487 | + | |
| 13488 | + function Publish() { | |
| 13489 | + (0, _classCallCheck2.default)(this, Publish); | |
| 13490 | + return _super.apply(this, arguments); | |
| 13491 | + } | |
| 13492 | + | |
| 13493 | + (0, _createClass2.default)(Publish, [{ | |
| 13494 | + key: "apply", | |
| 13495 | + value: function apply(args) { | |
| 13496 | + var _args$status = args.status, | |
| 13497 | + status = _args$status === void 0 ? 'publish' : _args$status, | |
| 13498 | + _args$document = args.document, | |
| 13499 | + document = _args$document === void 0 ? this.document : _args$document; | |
| 13500 | + return $e.internal('document/save/save', { | |
| 13501 | + status: status, | |
| 13502 | + document: document | |
| 13503 | + }); | |
| 13504 | + } | |
| 13505 | + }]); | |
| 13506 | + return Publish; | |
| 13507 | +}(_base.default); | |
| 13508 | + | |
| 13509 | +exports.Publish = Publish; | |
| 13510 | + | |
| 13511 | +/***/ }), | |
| 13512 | + | |
| 13513 | +/***/ "../assets/dev/js/editor/document/save/commands/update.js": | |
| 13514 | +/*!****************************************************************!*\ | |
| 13515 | + !*** ../assets/dev/js/editor/document/save/commands/update.js ***! | |
| 13516 | + \****************************************************************/ | |
| 13517 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13518 | + | |
| 13519 | +"use strict"; | |
| 13520 | + | |
| 13521 | + | |
| 13522 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13523 | + | |
| 13524 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13525 | + value: true | |
| 13526 | +})); | |
| 13527 | +exports.Update = void 0; | |
| 13528 | + | |
| 13529 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13530 | + | |
| 13531 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13532 | + | |
| 13533 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13534 | + | |
| 13535 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13536 | + | |
| 13537 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13538 | + | |
| 13539 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base/base */ "../assets/dev/js/editor/document/save/commands/base/base.js")); | |
| 13540 | + | |
| 13541 | +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); }; } | |
| 13542 | + | |
| 13543 | +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; } } | |
| 13544 | + | |
| 13545 | +var Update = /*#__PURE__*/function (_Base) { | |
| 13546 | + (0, _inherits2.default)(Update, _Base); | |
| 13547 | + | |
| 13548 | + var _super = _createSuper(Update); | |
| 13549 | + | |
| 13550 | + function Update() { | |
| 13551 | + (0, _classCallCheck2.default)(this, Update); | |
| 13552 | + return _super.apply(this, arguments); | |
| 13553 | + } | |
| 13554 | + | |
| 13555 | + (0, _createClass2.default)(Update, [{ | |
| 13556 | + key: "apply", | |
| 13557 | + value: function apply(args) { | |
| 13558 | + var _args$document = args.document, | |
| 13559 | + document = _args$document === void 0 ? this.document : _args$document, | |
| 13560 | + _args$status = args.status, | |
| 13561 | + status = _args$status === void 0 ? document.container.settings.get('post_status') : _args$status; | |
| 13562 | + return $e.internal('document/save/save', { | |
| 13563 | + status: status, | |
| 13564 | + document: document | |
| 13565 | + }); | |
| 13566 | + } | |
| 13567 | + }]); | |
| 13568 | + return Update; | |
| 13569 | +}(_base.default); | |
| 13570 | + | |
| 13571 | +exports.Update = Update; | |
| 13572 | + | |
| 13573 | +/***/ }), | |
| 13574 | + | |
| 13575 | +/***/ "../assets/dev/js/editor/document/save/component.js": | |
| 13576 | +/*!**********************************************************!*\ | |
| 13577 | + !*** ../assets/dev/js/editor/document/save/component.js ***! | |
| 13578 | + \**********************************************************/ | |
| 13579 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13580 | + | |
| 13581 | +"use strict"; | |
| 13582 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 13583 | + | |
| 13584 | + | |
| 13585 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13586 | + | |
| 13587 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 13588 | + | |
| 13589 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13590 | + value: true | |
| 13591 | +})); | |
| 13592 | +exports["default"] = void 0; | |
| 13593 | + | |
| 13594 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13595 | + | |
| 13596 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13597 | + | |
| 13598 | +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js")); | |
| 13599 | + | |
| 13600 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 13601 | + | |
| 13602 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13603 | + | |
| 13604 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13605 | + | |
| 13606 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13607 | + | |
| 13608 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 13609 | + | |
| 13610 | +var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility */ "../assets/dev/js/editor/document/save/backwards-compatibility.js")); | |
| 13611 | + | |
| 13612 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/document/save/commands/index.js")); | |
| 13613 | + | |
| 13614 | +var commandsInternal = _interopRequireWildcard(__webpack_require__(/*! ./commands/internal */ "../assets/dev/js/editor/document/save/commands/internal/index.js")); | |
| 13615 | + | |
| 13616 | +var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks/ */ "../assets/dev/js/editor/document/save/hooks/index.js")); | |
| 13617 | + | |
| 13618 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 13619 | + | |
| 13620 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 13621 | + | |
| 13622 | +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); }; } | |
| 13623 | + | |
| 13624 | +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; } } | |
| 13625 | + | |
| 371 | 13626 | /** |
| 372 | - * Function debounce(). | |
| 373 | - * | |
| 374 | - * Will debounce every function you pass in, at the same debounce flow. | |
| 375 | - * | |
| 376 | - * @param {Function} | |
| 13627 | + * @typedef {import('./behaviors/footer-saver')} FooterSaver | |
| 377 | 13628 | */ |
| 378 | -(0, _defineProperty2.default)(CommandHistoryDebounceBase, "debounce", undefined); | |
| 13629 | +var Component = /*#__PURE__*/function (_BackwardsCompatibili) { | |
| 13630 | + (0, _inherits2.default)(Component, _BackwardsCompatibili); | |
| 379 | 13631 | |
| 13632 | + var _super = _createSuper(Component); | |
| 13633 | + | |
| 13634 | + function Component() { | |
| 13635 | + var _this; | |
| 13636 | + | |
| 13637 | + (0, _classCallCheck2.default)(this, Component); | |
| 13638 | + | |
| 13639 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 13640 | + args[_key] = arguments[_key]; | |
| 13641 | + } | |
| 13642 | + | |
| 13643 | + _this = _super.call.apply(_super, [this].concat(args)); | |
| 13644 | + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "footerSaver", void 0); | |
| 13645 | + return _this; | |
| 13646 | + } | |
| 13647 | + | |
| 13648 | + (0, _createClass2.default)(Component, [{ | |
| 13649 | + key: "__construct", | |
| 13650 | + value: function __construct() { | |
| 13651 | + var _this2 = this; | |
| 13652 | + | |
| 13653 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 13654 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Component.prototype), "__construct", this).call(this, args); | |
| 13655 | + /** | |
| 13656 | + * Auto save timer handlers. | |
| 13657 | + * | |
| 13658 | + * @type {Object} | |
| 13659 | + */ | |
| 13660 | + | |
| 13661 | + this.autoSaveTimers = {}; | |
| 13662 | + /** | |
| 13663 | + * Auto save interval. | |
| 13664 | + * | |
| 13665 | + * @type {number} | |
| 13666 | + */ | |
| 13667 | + | |
| 13668 | + this.autoSaveInterval = elementor.config.autosave_interval * 1000; | |
| 13669 | + elementorCommon.elements.$window.on('beforeunload', function () { | |
| 13670 | + if (_this2.isEditorChanged()) { | |
| 13671 | + // Returns a message to confirm dialog. | |
| 13672 | + return __('Please note: All unsaved changes will be lost.', 'elementor'); | |
| 13673 | + } | |
| 13674 | + }); | |
| 13675 | + } | |
| 13676 | + }, { | |
| 13677 | + key: "getNamespace", | |
| 13678 | + value: function getNamespace() { | |
| 13679 | + return 'document/save'; | |
| 13680 | + } | |
| 13681 | + /** | |
| 13682 | + * TODO: test | |
| 13683 | + * | |
| 13684 | + * @param {Document} document | |
| 13685 | + */ | |
| 13686 | + | |
| 13687 | + }, { | |
| 13688 | + key: "startAutoSave", | |
| 13689 | + value: function startAutoSave(document) { | |
| 13690 | + var _this3 = this; | |
| 13691 | + | |
| 13692 | + this.stopAutoSave(document); | |
| 13693 | + this.autoSaveTimers[document.id] = setTimeout(function () { | |
| 13694 | + $e.run('document/save/auto', { | |
| 13695 | + document: document | |
| 13696 | + }); | |
| 13697 | + delete _this3.autoSaveTimers[document.id]; | |
| 13698 | + }, this.autoSaveInterval); | |
| 13699 | + } | |
| 13700 | + /** | |
| 13701 | + * TODO: test | |
| 13702 | + * | |
| 13703 | + * @param {Document} document | |
| 13704 | + */ | |
| 13705 | + | |
| 13706 | + }, { | |
| 13707 | + key: "stopAutoSave", | |
| 13708 | + value: function stopAutoSave(document) { | |
| 13709 | + if (this.autoSaveTimers[document.id]) { | |
| 13710 | + clearTimeout(this.autoSaveTimers[document.id]); | |
| 13711 | + delete this.autoSaveTimers[document.id]; | |
| 13712 | + } | |
| 13713 | + } | |
| 13714 | + }, { | |
| 13715 | + key: "defaultCommands", | |
| 13716 | + value: function defaultCommands() { | |
| 13717 | + return this.importCommands(commands); | |
| 13718 | + } | |
| 13719 | + }, { | |
| 13720 | + key: "defaultCommandsInternal", | |
| 13721 | + value: function defaultCommandsInternal() { | |
| 13722 | + return this.importCommands(commandsInternal); | |
| 13723 | + } | |
| 13724 | + }, { | |
| 13725 | + key: "defaultHooks", | |
| 13726 | + value: function defaultHooks() { | |
| 13727 | + return this.importHooks(hooks); | |
| 13728 | + } | |
| 13729 | + }, { | |
| 13730 | + key: "isEditorChanged", | |
| 13731 | + value: function isEditorChanged() { | |
| 13732 | + return true === elementor.channels.editor.request('status'); | |
| 13733 | + } | |
| 13734 | + }]); | |
| 13735 | + return Component; | |
| 13736 | +}(_backwardsCompatibility.default); | |
| 13737 | + | |
| 13738 | +exports["default"] = Component; | |
| 13739 | + | |
| 380 | 13740 | /***/ }), |
| 381 | 13741 | |
| 13742 | +/***/ "../assets/dev/js/editor/document/save/hooks/index.js": | |
| 13743 | +/*!************************************************************!*\ | |
| 13744 | + !*** ../assets/dev/js/editor/document/save/hooks/index.js ***! | |
| 13745 | + \************************************************************/ | |
| 13746 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13747 | + | |
| 13748 | +"use strict"; | |
| 13749 | + | |
| 13750 | + | |
| 13751 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13752 | + value: true | |
| 13753 | +})); | |
| 13754 | + | |
| 13755 | +var _ui = __webpack_require__(/*! ./ui/ */ "../assets/dev/js/editor/document/save/hooks/ui/index.js"); | |
| 13756 | + | |
| 13757 | +Object.keys(_ui).forEach(function (key) { | |
| 13758 | + if (key === "default" || key === "__esModule") return; | |
| 13759 | + if (key in exports && exports[key] === _ui[key]) return; | |
| 13760 | + Object.defineProperty(exports, key, { | |
| 13761 | + enumerable: true, | |
| 13762 | + get: function get() { | |
| 13763 | + return _ui[key]; | |
| 13764 | + } | |
| 13765 | + }); | |
| 13766 | +}); | |
| 13767 | + | |
| 13768 | +/***/ }), | |
| 13769 | + | |
| 13770 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/index.js": | |
| 13771 | +/*!***************************************************************!*\ | |
| 13772 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/index.js ***! | |
| 13773 | + \***************************************************************/ | |
| 13774 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13775 | + | |
| 13776 | +"use strict"; | |
| 13777 | + | |
| 13778 | + | |
| 13779 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13780 | + value: true | |
| 13781 | +})); | |
| 13782 | + | |
| 13783 | +var _save = __webpack_require__(/*! ./save/ */ "../assets/dev/js/editor/document/save/hooks/ui/save/index.js"); | |
| 13784 | + | |
| 13785 | +Object.keys(_save).forEach(function (key) { | |
| 13786 | + if (key === "default" || key === "__esModule") return; | |
| 13787 | + if (key in exports && exports[key] === _save[key]) return; | |
| 13788 | + Object.defineProperty(exports, key, { | |
| 13789 | + enumerable: true, | |
| 13790 | + get: function get() { | |
| 13791 | + return _save[key]; | |
| 13792 | + } | |
| 13793 | + }); | |
| 13794 | +}); | |
| 13795 | + | |
| 13796 | +var _setIsModified = __webpack_require__(/*! ./set-is-modified/ */ "../assets/dev/js/editor/document/save/hooks/ui/set-is-modified/index.js"); | |
| 13797 | + | |
| 13798 | +Object.keys(_setIsModified).forEach(function (key) { | |
| 13799 | + if (key === "default" || key === "__esModule") return; | |
| 13800 | + if (key in exports && exports[key] === _setIsModified[key]) return; | |
| 13801 | + Object.defineProperty(exports, key, { | |
| 13802 | + enumerable: true, | |
| 13803 | + get: function get() { | |
| 13804 | + return _setIsModified[key]; | |
| 13805 | + } | |
| 13806 | + }); | |
| 13807 | +}); | |
| 13808 | + | |
| 13809 | +var _settings = __webpack_require__(/*! ./settings */ "../assets/dev/js/editor/document/save/hooks/ui/settings/index.js"); | |
| 13810 | + | |
| 13811 | +Object.keys(_settings).forEach(function (key) { | |
| 13812 | + if (key === "default" || key === "__esModule") return; | |
| 13813 | + if (key in exports && exports[key] === _settings[key]) return; | |
| 13814 | + Object.defineProperty(exports, key, { | |
| 13815 | + enumerable: true, | |
| 13816 | + get: function get() { | |
| 13817 | + return _settings[key]; | |
| 13818 | + } | |
| 13819 | + }); | |
| 13820 | +}); | |
| 13821 | + | |
| 13822 | +/***/ }), | |
| 13823 | + | |
| 13824 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/save/after.js": | |
| 13825 | +/*!********************************************************************!*\ | |
| 13826 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/save/after.js ***! | |
| 13827 | + \********************************************************************/ | |
| 13828 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13829 | + | |
| 13830 | +"use strict"; | |
| 13831 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 13832 | + | |
| 13833 | + | |
| 13834 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13835 | + | |
| 13836 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13837 | + value: true | |
| 13838 | +})); | |
| 13839 | +exports["default"] = exports.FooterSaverAfterSave = void 0; | |
| 13840 | + | |
| 13841 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13842 | + | |
| 13843 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13844 | + | |
| 13845 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13846 | + | |
| 13847 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13848 | + | |
| 13849 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13850 | + | |
| 13851 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 13852 | + | |
| 13853 | +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); }; } | |
| 13854 | + | |
| 13855 | +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; } } | |
| 13856 | + | |
| 13857 | +var FooterSaverAfterSave = /*#__PURE__*/function (_HookUIAfter) { | |
| 13858 | + (0, _inherits2.default)(FooterSaverAfterSave, _HookUIAfter); | |
| 13859 | + | |
| 13860 | + var _super = _createSuper(FooterSaverAfterSave); | |
| 13861 | + | |
| 13862 | + function FooterSaverAfterSave() { | |
| 13863 | + (0, _classCallCheck2.default)(this, FooterSaverAfterSave); | |
| 13864 | + return _super.apply(this, arguments); | |
| 13865 | + } | |
| 13866 | + | |
| 13867 | + (0, _createClass2.default)(FooterSaverAfterSave, [{ | |
| 13868 | + key: "getCommand", | |
| 13869 | + value: function getCommand() { | |
| 13870 | + return 'document/save/save'; | |
| 13871 | + } | |
| 13872 | + }, { | |
| 13873 | + key: "getId", | |
| 13874 | + value: function getId() { | |
| 13875 | + return 'footer-saver-after-save'; | |
| 13876 | + } | |
| 13877 | + }, { | |
| 13878 | + key: "apply", | |
| 13879 | + value: function apply(args, result) { | |
| 13880 | + var status = args.status, | |
| 13881 | + data = result.data, | |
| 13882 | + _$e$components$get = $e.components.get('document/save'), | |
| 13883 | + footerSaver = _$e$components$get.footerSaver; | |
| 13884 | + | |
| 13885 | + NProgress.done(); | |
| 13886 | + footerSaver.ui.buttonPublish.removeClass('elementor-button-state'); | |
| 13887 | + footerSaver.ui.lastEditedWrapper.removeClass('elementor-state-active'); | |
| 13888 | + footerSaver.refreshWpPreview(); | |
| 13889 | + footerSaver.setLastEdited(data.config.document.last_edited); | |
| 13890 | + | |
| 13891 | + if (result.statusChanged && 'publish' === status && elementor.config.document.urls.have_a_look) { | |
| 13892 | + this.onPageStatusChange(); | |
| 13893 | + } | |
| 13894 | + } | |
| 13895 | + }, { | |
| 13896 | + key: "onPageStatusChange", | |
| 13897 | + value: function onPageStatusChange() { | |
| 13898 | + var buttons = []; | |
| 13899 | + buttons.push({ | |
| 13900 | + name: 'view_page', | |
| 13901 | + text: __('Have a look', 'elementor'), | |
| 13902 | + callback: function callback() { | |
| 13903 | + open(elementor.config.document.urls.have_a_look); | |
| 13904 | + } | |
| 13905 | + }); | |
| 13906 | + elementor.notifications.showToast({ | |
| 13907 | + message: elementor.config.document.panel.messages.publish_notification, | |
| 13908 | + buttons: buttons | |
| 13909 | + }); | |
| 13910 | + } | |
| 13911 | + }]); | |
| 13912 | + return FooterSaverAfterSave; | |
| 13913 | +}(_after.default); | |
| 13914 | + | |
| 13915 | +exports.FooterSaverAfterSave = FooterSaverAfterSave; | |
| 13916 | +var _default = FooterSaverAfterSave; | |
| 13917 | +exports["default"] = _default; | |
| 13918 | + | |
| 13919 | +/***/ }), | |
| 13920 | + | |
| 13921 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/save/before.js": | |
| 13922 | +/*!*********************************************************************!*\ | |
| 13923 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/save/before.js ***! | |
| 13924 | + \*********************************************************************/ | |
| 13925 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 13926 | + | |
| 13927 | +"use strict"; | |
| 13928 | + | |
| 13929 | + | |
| 13930 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13931 | + | |
| 13932 | +Object.defineProperty(exports, "__esModule", ({ | |
| 13933 | + value: true | |
| 13934 | +})); | |
| 13935 | +exports["default"] = exports.FooterSaverBeforeSave = void 0; | |
| 13936 | + | |
| 13937 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 13938 | + | |
| 13939 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 13940 | + | |
| 13941 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 13942 | + | |
| 13943 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 13944 | + | |
| 13945 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 13946 | + | |
| 13947 | +var _before = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js")); | |
| 13948 | + | |
| 13949 | +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); }; } | |
| 13950 | + | |
| 13951 | +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; } } | |
| 13952 | + | |
| 13953 | +var FooterSaverBeforeSave = /*#__PURE__*/function (_HookUIBefore) { | |
| 13954 | + (0, _inherits2.default)(FooterSaverBeforeSave, _HookUIBefore); | |
| 13955 | + | |
| 13956 | + var _super = _createSuper(FooterSaverBeforeSave); | |
| 13957 | + | |
| 13958 | + function FooterSaverBeforeSave() { | |
| 13959 | + (0, _classCallCheck2.default)(this, FooterSaverBeforeSave); | |
| 13960 | + return _super.apply(this, arguments); | |
| 13961 | + } | |
| 13962 | + | |
| 13963 | + (0, _createClass2.default)(FooterSaverBeforeSave, [{ | |
| 13964 | + key: "getCommand", | |
| 13965 | + value: function getCommand() { | |
| 13966 | + return 'document/save/save'; | |
| 13967 | + } | |
| 13968 | + }, { | |
| 13969 | + key: "getId", | |
| 13970 | + value: function getId() { | |
| 13971 | + return 'footer-saver-before-save'; | |
| 13972 | + } | |
| 13973 | + }, { | |
| 13974 | + key: "apply", | |
| 13975 | + value: function apply(args) { | |
| 13976 | + var status = args.status, | |
| 13977 | + _$e$components$get = $e.components.get('document/save'), | |
| 13978 | + footerSaver = _$e$components$get.footerSaver; | |
| 13979 | + | |
| 13980 | + NProgress.start(); | |
| 13981 | + | |
| 13982 | + if ('autosave' === status) { | |
| 13983 | + footerSaver.ui.lastEditedWrapper.addClass('elementor-state-active'); | |
| 13984 | + } else { | |
| 13985 | + footerSaver.ui.buttonPublish.addClass('elementor-button-state'); | |
| 13986 | + } | |
| 13987 | + } | |
| 13988 | + }]); | |
| 13989 | + return FooterSaverBeforeSave; | |
| 13990 | +}(_before.default); | |
| 13991 | + | |
| 13992 | +exports.FooterSaverBeforeSave = FooterSaverBeforeSave; | |
| 13993 | +var _default = FooterSaverBeforeSave; | |
| 13994 | +exports["default"] = _default; | |
| 13995 | + | |
| 13996 | +/***/ }), | |
| 13997 | + | |
| 13998 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/save/catch.js": | |
| 13999 | +/*!********************************************************************!*\ | |
| 14000 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/save/catch.js ***! | |
| 14001 | + \********************************************************************/ | |
| 14002 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14003 | + | |
| 14004 | +"use strict"; | |
| 14005 | + | |
| 14006 | + | |
| 14007 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14008 | + | |
| 14009 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14010 | + value: true | |
| 14011 | +})); | |
| 14012 | +exports["default"] = exports.FooterSaverCatchSave = void 0; | |
| 14013 | + | |
| 14014 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14015 | + | |
| 14016 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14017 | + | |
| 14018 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14019 | + | |
| 14020 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14021 | + | |
| 14022 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14023 | + | |
| 14024 | +var _catch = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js")); | |
| 14025 | + | |
| 14026 | +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); }; } | |
| 14027 | + | |
| 14028 | +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; } } | |
| 14029 | + | |
| 14030 | +var FooterSaverCatchSave = /*#__PURE__*/function (_HookUICatch) { | |
| 14031 | + (0, _inherits2.default)(FooterSaverCatchSave, _HookUICatch); | |
| 14032 | + | |
| 14033 | + var _super = _createSuper(FooterSaverCatchSave); | |
| 14034 | + | |
| 14035 | + function FooterSaverCatchSave() { | |
| 14036 | + (0, _classCallCheck2.default)(this, FooterSaverCatchSave); | |
| 14037 | + return _super.apply(this, arguments); | |
| 14038 | + } | |
| 14039 | + | |
| 14040 | + (0, _createClass2.default)(FooterSaverCatchSave, [{ | |
| 14041 | + key: "getCommand", | |
| 14042 | + value: function getCommand() { | |
| 14043 | + return 'document/save/save'; | |
| 14044 | + } | |
| 14045 | + }, { | |
| 14046 | + key: "getId", | |
| 14047 | + value: function getId() { | |
| 14048 | + return 'footer-saver-catch-save'; | |
| 14049 | + } | |
| 14050 | + }, { | |
| 14051 | + key: "apply", | |
| 14052 | + value: function apply() { | |
| 14053 | + NProgress.done(); | |
| 14054 | + $e.components.get('document/save').footerSaver.ui.buttonPublish.removeClass('elementor-button-state'); | |
| 14055 | + } | |
| 14056 | + }]); | |
| 14057 | + return FooterSaverCatchSave; | |
| 14058 | +}(_catch.default); | |
| 14059 | + | |
| 14060 | +exports.FooterSaverCatchSave = FooterSaverCatchSave; | |
| 14061 | +var _default = FooterSaverCatchSave; | |
| 14062 | +exports["default"] = _default; | |
| 14063 | + | |
| 14064 | +/***/ }), | |
| 14065 | + | |
| 14066 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/save/index.js": | |
| 14067 | +/*!********************************************************************!*\ | |
| 14068 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/save/index.js ***! | |
| 14069 | + \********************************************************************/ | |
| 14070 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14071 | + | |
| 14072 | +"use strict"; | |
| 14073 | + | |
| 14074 | + | |
| 14075 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14076 | + value: true | |
| 14077 | +})); | |
| 14078 | +Object.defineProperty(exports, "FooterSaverAfterSave", ({ | |
| 14079 | + enumerable: true, | |
| 14080 | + get: function get() { | |
| 14081 | + return _after.FooterSaverAfterSave; | |
| 14082 | + } | |
| 14083 | +})); | |
| 14084 | +Object.defineProperty(exports, "FooterSaverBeforeSave", ({ | |
| 14085 | + enumerable: true, | |
| 14086 | + get: function get() { | |
| 14087 | + return _before.FooterSaverBeforeSave; | |
| 14088 | + } | |
| 14089 | +})); | |
| 14090 | +Object.defineProperty(exports, "FooterSaverCatchSave", ({ | |
| 14091 | + enumerable: true, | |
| 14092 | + get: function get() { | |
| 14093 | + return _catch.FooterSaverCatchSave; | |
| 14094 | + } | |
| 14095 | +})); | |
| 14096 | + | |
| 14097 | +var _after = __webpack_require__(/*! ./after */ "../assets/dev/js/editor/document/save/hooks/ui/save/after.js"); | |
| 14098 | + | |
| 14099 | +var _before = __webpack_require__(/*! ./before */ "../assets/dev/js/editor/document/save/hooks/ui/save/before.js"); | |
| 14100 | + | |
| 14101 | +var _catch = __webpack_require__(/*! ./catch */ "../assets/dev/js/editor/document/save/hooks/ui/save/catch.js"); | |
| 14102 | + | |
| 14103 | +/***/ }), | |
| 14104 | + | |
| 14105 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/set-is-modified/after.js": | |
| 14106 | +/*!*******************************************************************************!*\ | |
| 14107 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/set-is-modified/after.js ***! | |
| 14108 | + \*******************************************************************************/ | |
| 14109 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14110 | + | |
| 14111 | +"use strict"; | |
| 14112 | + | |
| 14113 | + | |
| 14114 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14115 | + | |
| 14116 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14117 | + value: true | |
| 14118 | +})); | |
| 14119 | +exports["default"] = exports.FooterSaverActiveSaveButtons = void 0; | |
| 14120 | + | |
| 14121 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14122 | + | |
| 14123 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14124 | + | |
| 14125 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14126 | + | |
| 14127 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14128 | + | |
| 14129 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14130 | + | |
| 14131 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 14132 | + | |
| 14133 | +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); }; } | |
| 14134 | + | |
| 14135 | +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; } } | |
| 14136 | + | |
| 14137 | +var FooterSaverActiveSaveButtons = /*#__PURE__*/function (_HookUIAfter) { | |
| 14138 | + (0, _inherits2.default)(FooterSaverActiveSaveButtons, _HookUIAfter); | |
| 14139 | + | |
| 14140 | + var _super = _createSuper(FooterSaverActiveSaveButtons); | |
| 14141 | + | |
| 14142 | + function FooterSaverActiveSaveButtons() { | |
| 14143 | + (0, _classCallCheck2.default)(this, FooterSaverActiveSaveButtons); | |
| 14144 | + return _super.apply(this, arguments); | |
| 14145 | + } | |
| 14146 | + | |
| 14147 | + (0, _createClass2.default)(FooterSaverActiveSaveButtons, [{ | |
| 14148 | + key: "getCommand", | |
| 14149 | + value: function getCommand() { | |
| 14150 | + return 'document/save/set-is-modified'; | |
| 14151 | + } | |
| 14152 | + }, { | |
| 14153 | + key: "getId", | |
| 14154 | + value: function getId() { | |
| 14155 | + return 'footer-saver-activate-save-buttons'; | |
| 14156 | + } | |
| 14157 | + }, { | |
| 14158 | + key: "apply", | |
| 14159 | + value: function apply(args) { | |
| 14160 | + var status = args.status, | |
| 14161 | + document = args.document; | |
| 14162 | + $e.components.get('document/save').footerSaver.activateSaveButtons(document, status); | |
| 14163 | + } | |
| 14164 | + }]); | |
| 14165 | + return FooterSaverActiveSaveButtons; | |
| 14166 | +}(_after.default); | |
| 14167 | + | |
| 14168 | +exports.FooterSaverActiveSaveButtons = FooterSaverActiveSaveButtons; | |
| 14169 | +var _default = FooterSaverActiveSaveButtons; | |
| 14170 | +exports["default"] = _default; | |
| 14171 | + | |
| 14172 | +/***/ }), | |
| 14173 | + | |
| 14174 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/set-is-modified/index.js": | |
| 14175 | +/*!*******************************************************************************!*\ | |
| 14176 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/set-is-modified/index.js ***! | |
| 14177 | + \*******************************************************************************/ | |
| 14178 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14179 | + | |
| 14180 | +"use strict"; | |
| 14181 | + | |
| 14182 | + | |
| 14183 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14184 | + value: true | |
| 14185 | +})); | |
| 14186 | +Object.defineProperty(exports, "FooterSaverActiveSaveButtons", ({ | |
| 14187 | + enumerable: true, | |
| 14188 | + get: function get() { | |
| 14189 | + return _after.FooterSaverActiveSaveButtons; | |
| 14190 | + } | |
| 14191 | +})); | |
| 14192 | + | |
| 14193 | +var _after = __webpack_require__(/*! ./after */ "../assets/dev/js/editor/document/save/hooks/ui/set-is-modified/after.js"); | |
| 14194 | + | |
| 14195 | +/***/ }), | |
| 14196 | + | |
| 14197 | +/***/ "../assets/dev/js/editor/document/save/hooks/ui/settings/index.js": | |
| 14198 | +/*!************************************************************************!*\ | |
| 14199 | + !*** ../assets/dev/js/editor/document/save/hooks/ui/settings/index.js ***! | |
| 14200 | + \************************************************************************/ | |
| 14201 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14202 | + | |
| 14203 | +"use strict"; | |
| 14204 | + | |
| 14205 | + | |
| 14206 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14207 | + | |
| 14208 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14209 | + value: true | |
| 14210 | +})); | |
| 14211 | +exports["default"] = exports.FooterSeverRefreshMenu = void 0; | |
| 14212 | + | |
| 14213 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14214 | + | |
| 14215 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14216 | + | |
| 14217 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14218 | + | |
| 14219 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14220 | + | |
| 14221 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14222 | + | |
| 14223 | +var _after = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hooks/ui/after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js")); | |
| 14224 | + | |
| 14225 | +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); }; } | |
| 14226 | + | |
| 14227 | +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; } } | |
| 14228 | + | |
| 14229 | +var FooterSeverRefreshMenu = /*#__PURE__*/function (_HookUIAfter) { | |
| 14230 | + (0, _inherits2.default)(FooterSeverRefreshMenu, _HookUIAfter); | |
| 14231 | + | |
| 14232 | + var _super = _createSuper(FooterSeverRefreshMenu); | |
| 14233 | + | |
| 14234 | + function FooterSeverRefreshMenu() { | |
| 14235 | + (0, _classCallCheck2.default)(this, FooterSeverRefreshMenu); | |
| 14236 | + return _super.apply(this, arguments); | |
| 14237 | + } | |
| 14238 | + | |
| 14239 | + (0, _createClass2.default)(FooterSeverRefreshMenu, [{ | |
| 14240 | + key: "getCommand", | |
| 14241 | + value: function getCommand() { | |
| 14242 | + return 'document/elements/settings'; | |
| 14243 | + } | |
| 14244 | + }, { | |
| 14245 | + key: "getId", | |
| 14246 | + value: function getId() { | |
| 14247 | + return 'footer-saver-refresh-menu'; | |
| 14248 | + } | |
| 14249 | + }, { | |
| 14250 | + key: "getContainerType", | |
| 14251 | + value: function getContainerType() { | |
| 14252 | + return 'document'; | |
| 14253 | + } | |
| 14254 | + }, { | |
| 14255 | + key: "getConditions", | |
| 14256 | + value: function getConditions(args) { | |
| 14257 | + return args.settings && 'undefined' !== typeof args.settings.post_status; | |
| 14258 | + } | |
| 14259 | + }, { | |
| 14260 | + key: "apply", | |
| 14261 | + value: function apply(args) { | |
| 14262 | + var _$e$components$get = $e.components.get('document/save'), | |
| 14263 | + footerSaver = _$e$components$get.footerSaver; | |
| 14264 | + | |
| 14265 | + footerSaver.setMenuItems(args.container.document); | |
| 14266 | + footerSaver.refreshWpPreview(); | |
| 14267 | + } | |
| 14268 | + }]); | |
| 14269 | + return FooterSeverRefreshMenu; | |
| 14270 | +}(_after.default); | |
| 14271 | + | |
| 14272 | +exports.FooterSeverRefreshMenu = FooterSeverRefreshMenu; | |
| 14273 | +var _default = FooterSeverRefreshMenu; | |
| 14274 | +exports["default"] = _default; | |
| 14275 | + | |
| 14276 | +/***/ }), | |
| 14277 | + | |
| 14278 | +/***/ "../assets/dev/js/editor/document/ui-states/direction-mode.js": | |
| 14279 | +/*!********************************************************************!*\ | |
| 14280 | + !*** ../assets/dev/js/editor/document/ui-states/direction-mode.js ***! | |
| 14281 | + \********************************************************************/ | |
| 14282 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14283 | + | |
| 14284 | +"use strict"; | |
| 14285 | + | |
| 14286 | + | |
| 14287 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14288 | + | |
| 14289 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14290 | + value: true | |
| 14291 | +})); | |
| 14292 | +exports.DirectionMode = exports.DIRECTION_ROW_REVERSE = exports.DIRECTION_ROW = exports.DIRECTION_COLUMN_REVERSE = exports.DIRECTION_COLUMN = void 0; | |
| 14293 | + | |
| 14294 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 14295 | + | |
| 14296 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14297 | + | |
| 14298 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14299 | + | |
| 14300 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14301 | + | |
| 14302 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14303 | + | |
| 14304 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14305 | + | |
| 14306 | +var _uiStateBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/states/ui-state-base */ "../modules/web-cli/assets/js/core/states/ui-state-base.js")); | |
| 14307 | + | |
| 14308 | +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); }; } | |
| 14309 | + | |
| 14310 | +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; } } | |
| 14311 | + | |
| 14312 | +var DIRECTION_ROW = 'row'; | |
| 14313 | +exports.DIRECTION_ROW = DIRECTION_ROW; | |
| 14314 | +var DIRECTION_ROW_REVERSE = 'row-reverse'; | |
| 14315 | +exports.DIRECTION_ROW_REVERSE = DIRECTION_ROW_REVERSE; | |
| 14316 | +var DIRECTION_COLUMN = 'column'; | |
| 14317 | +exports.DIRECTION_COLUMN = DIRECTION_COLUMN; | |
| 14318 | +var DIRECTION_COLUMN_REVERSE = 'column-reverse'; | |
| 14319 | +exports.DIRECTION_COLUMN_REVERSE = DIRECTION_COLUMN_REVERSE; | |
| 14320 | + | |
| 14321 | +var DirectionMode = /*#__PURE__*/function (_UiStateBase) { | |
| 14322 | + (0, _inherits2.default)(DirectionMode, _UiStateBase); | |
| 14323 | + | |
| 14324 | + var _super = _createSuper(DirectionMode); | |
| 14325 | + | |
| 14326 | + function DirectionMode() { | |
| 14327 | + (0, _classCallCheck2.default)(this, DirectionMode); | |
| 14328 | + return _super.apply(this, arguments); | |
| 14329 | + } | |
| 14330 | + | |
| 14331 | + (0, _createClass2.default)(DirectionMode, [{ | |
| 14332 | + key: "getId", | |
| 14333 | + value: function getId() { | |
| 14334 | + return 'direction-mode'; | |
| 14335 | + } | |
| 14336 | + }, { | |
| 14337 | + key: "getOptions", | |
| 14338 | + value: function getOptions() { | |
| 14339 | + var _ref; | |
| 14340 | + | |
| 14341 | + return _ref = {}, (0, _defineProperty2.default)(_ref, DIRECTION_ROW, ''), (0, _defineProperty2.default)(_ref, DIRECTION_ROW_REVERSE, ''), (0, _defineProperty2.default)(_ref, DIRECTION_COLUMN, ''), (0, _defineProperty2.default)(_ref, DIRECTION_COLUMN_REVERSE, ''), _ref; | |
| 14342 | + } | |
| 14343 | + }, { | |
| 14344 | + key: "getScopes", | |
| 14345 | + value: function getScopes() { | |
| 14346 | + return [window.document.body, elementor.$previewContents[0].body]; | |
| 14347 | + } | |
| 14348 | + }]); | |
| 14349 | + return DirectionMode; | |
| 14350 | +}(_uiStateBase.default); | |
| 14351 | + | |
| 14352 | +exports.DirectionMode = DirectionMode; | |
| 14353 | + | |
| 14354 | +/***/ }), | |
| 14355 | + | |
| 14356 | +/***/ "../assets/dev/js/editor/document/ui-states/index.js": | |
| 14357 | +/*!***********************************************************!*\ | |
| 14358 | + !*** ../assets/dev/js/editor/document/ui-states/index.js ***! | |
| 14359 | + \***********************************************************/ | |
| 14360 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14361 | + | |
| 14362 | +"use strict"; | |
| 14363 | + | |
| 14364 | + | |
| 14365 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14366 | + value: true | |
| 14367 | +})); | |
| 14368 | +Object.defineProperty(exports, "DirectionMode", ({ | |
| 14369 | + enumerable: true, | |
| 14370 | + get: function get() { | |
| 14371 | + return _directionMode.DirectionMode; | |
| 14372 | + } | |
| 14373 | +})); | |
| 14374 | + | |
| 14375 | +var _directionMode = __webpack_require__(/*! ./direction-mode */ "../assets/dev/js/editor/document/ui-states/direction-mode.js"); | |
| 14376 | + | |
| 14377 | +/***/ }), | |
| 14378 | + | |
| 14379 | +/***/ "../assets/dev/js/editor/document/ui/commands/copy.js": | |
| 14380 | +/*!************************************************************!*\ | |
| 14381 | + !*** ../assets/dev/js/editor/document/ui/commands/copy.js ***! | |
| 14382 | + \************************************************************/ | |
| 14383 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14384 | + | |
| 14385 | +"use strict"; | |
| 14386 | + | |
| 14387 | + | |
| 14388 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14389 | + | |
| 14390 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14391 | + value: true | |
| 14392 | +})); | |
| 14393 | +exports["default"] = exports.Copy = void 0; | |
| 14394 | + | |
| 14395 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14396 | + | |
| 14397 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14398 | + | |
| 14399 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14400 | + | |
| 14401 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14402 | + | |
| 14403 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14404 | + | |
| 14405 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 14406 | + | |
| 14407 | +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); }; } | |
| 14408 | + | |
| 14409 | +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; } } | |
| 14410 | + | |
| 14411 | +var Copy = /*#__PURE__*/function (_CommandBase) { | |
| 14412 | + (0, _inherits2.default)(Copy, _CommandBase); | |
| 14413 | + | |
| 14414 | + var _super = _createSuper(Copy); | |
| 14415 | + | |
| 14416 | + function Copy() { | |
| 14417 | + (0, _classCallCheck2.default)(this, Copy); | |
| 14418 | + return _super.apply(this, arguments); | |
| 14419 | + } | |
| 14420 | + | |
| 14421 | + (0, _createClass2.default)(Copy, [{ | |
| 14422 | + key: "apply", | |
| 14423 | + value: function apply() { | |
| 14424 | + var selectedElements = elementor.selection.getElements(); | |
| 14425 | + | |
| 14426 | + if (selectedElements.length) { | |
| 14427 | + return $e.run('document/elements/copy', { | |
| 14428 | + containers: selectedElements | |
| 14429 | + }); | |
| 14430 | + } | |
| 14431 | + | |
| 14432 | + return false; | |
| 14433 | + } | |
| 14434 | + }]); | |
| 14435 | + return Copy; | |
| 14436 | +}(_commandBase.default); | |
| 14437 | + | |
| 14438 | +exports.Copy = Copy; | |
| 14439 | +var _default = Copy; | |
| 14440 | +exports["default"] = _default; | |
| 14441 | + | |
| 14442 | +/***/ }), | |
| 14443 | + | |
| 14444 | +/***/ "../assets/dev/js/editor/document/ui/commands/delete.js": | |
| 14445 | +/*!**************************************************************!*\ | |
| 14446 | + !*** ../assets/dev/js/editor/document/ui/commands/delete.js ***! | |
| 14447 | + \**************************************************************/ | |
| 14448 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14449 | + | |
| 14450 | +"use strict"; | |
| 14451 | + | |
| 14452 | + | |
| 14453 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14454 | + | |
| 14455 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14456 | + value: true | |
| 14457 | +})); | |
| 14458 | +exports["default"] = exports.Delete = void 0; | |
| 14459 | + | |
| 14460 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14461 | + | |
| 14462 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14463 | + | |
| 14464 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14465 | + | |
| 14466 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14467 | + | |
| 14468 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14469 | + | |
| 14470 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 14471 | + | |
| 14472 | +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); }; } | |
| 14473 | + | |
| 14474 | +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; } } | |
| 14475 | + | |
| 14476 | +var Delete = /*#__PURE__*/function (_CommandBase) { | |
| 14477 | + (0, _inherits2.default)(Delete, _CommandBase); | |
| 14478 | + | |
| 14479 | + var _super = _createSuper(Delete); | |
| 14480 | + | |
| 14481 | + function Delete() { | |
| 14482 | + (0, _classCallCheck2.default)(this, Delete); | |
| 14483 | + return _super.apply(this, arguments); | |
| 14484 | + } | |
| 14485 | + | |
| 14486 | + (0, _createClass2.default)(Delete, [{ | |
| 14487 | + key: "apply", | |
| 14488 | + value: function apply() { | |
| 14489 | + var selectedElements = elementor.selection.getElements(); | |
| 14490 | + | |
| 14491 | + if (selectedElements.length) { | |
| 14492 | + return $e.run('document/elements/delete', { | |
| 14493 | + containers: selectedElements | |
| 14494 | + }); | |
| 14495 | + } | |
| 14496 | + | |
| 14497 | + return false; | |
| 14498 | + } | |
| 14499 | + }]); | |
| 14500 | + return Delete; | |
| 14501 | +}(_commandBase.default); | |
| 14502 | + | |
| 14503 | +exports.Delete = Delete; | |
| 14504 | +var _default = Delete; | |
| 14505 | +exports["default"] = _default; | |
| 14506 | + | |
| 14507 | +/***/ }), | |
| 14508 | + | |
| 14509 | +/***/ "../assets/dev/js/editor/document/ui/commands/duplicate.js": | |
| 14510 | +/*!*****************************************************************!*\ | |
| 14511 | + !*** ../assets/dev/js/editor/document/ui/commands/duplicate.js ***! | |
| 14512 | + \*****************************************************************/ | |
| 14513 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14514 | + | |
| 14515 | +"use strict"; | |
| 14516 | + | |
| 14517 | + | |
| 14518 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14519 | + | |
| 14520 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14521 | + value: true | |
| 14522 | +})); | |
| 14523 | +exports["default"] = exports.Duplicate = void 0; | |
| 14524 | + | |
| 14525 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14526 | + | |
| 14527 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14528 | + | |
| 14529 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14530 | + | |
| 14531 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14532 | + | |
| 14533 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14534 | + | |
| 14535 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 14536 | + | |
| 14537 | +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); }; } | |
| 14538 | + | |
| 14539 | +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; } } | |
| 14540 | + | |
| 14541 | +var Duplicate = /*#__PURE__*/function (_CommandBase) { | |
| 14542 | + (0, _inherits2.default)(Duplicate, _CommandBase); | |
| 14543 | + | |
| 14544 | + var _super = _createSuper(Duplicate); | |
| 14545 | + | |
| 14546 | + function Duplicate() { | |
| 14547 | + (0, _classCallCheck2.default)(this, Duplicate); | |
| 14548 | + return _super.apply(this, arguments); | |
| 14549 | + } | |
| 14550 | + | |
| 14551 | + (0, _createClass2.default)(Duplicate, [{ | |
| 14552 | + key: "apply", | |
| 14553 | + value: function apply() { | |
| 14554 | + var selectedElements = elementor.selection.getElements(); | |
| 14555 | + | |
| 14556 | + if (selectedElements.length) { | |
| 14557 | + return $e.run('document/elements/duplicate', { | |
| 14558 | + containers: selectedElements | |
| 14559 | + }); | |
| 14560 | + } | |
| 14561 | + | |
| 14562 | + return false; | |
| 14563 | + } | |
| 14564 | + }]); | |
| 14565 | + return Duplicate; | |
| 14566 | +}(_commandBase.default); | |
| 14567 | + | |
| 14568 | +exports.Duplicate = Duplicate; | |
| 14569 | +var _default = Duplicate; | |
| 14570 | +exports["default"] = _default; | |
| 14571 | + | |
| 14572 | +/***/ }), | |
| 14573 | + | |
| 14574 | +/***/ "../assets/dev/js/editor/document/ui/commands/index.js": | |
| 14575 | +/*!*************************************************************!*\ | |
| 14576 | + !*** ../assets/dev/js/editor/document/ui/commands/index.js ***! | |
| 14577 | + \*************************************************************/ | |
| 14578 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14579 | + | |
| 14580 | +"use strict"; | |
| 14581 | + | |
| 14582 | + | |
| 14583 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14584 | + value: true | |
| 14585 | +})); | |
| 14586 | +Object.defineProperty(exports, "Copy", ({ | |
| 14587 | + enumerable: true, | |
| 14588 | + get: function get() { | |
| 14589 | + return _copy.Copy; | |
| 14590 | + } | |
| 14591 | +})); | |
| 14592 | +Object.defineProperty(exports, "Delete", ({ | |
| 14593 | + enumerable: true, | |
| 14594 | + get: function get() { | |
| 14595 | + return _delete.Delete; | |
| 14596 | + } | |
| 14597 | +})); | |
| 14598 | +Object.defineProperty(exports, "Duplicate", ({ | |
| 14599 | + enumerable: true, | |
| 14600 | + get: function get() { | |
| 14601 | + return _duplicate.Duplicate; | |
| 14602 | + } | |
| 14603 | +})); | |
| 14604 | +Object.defineProperty(exports, "Paste", ({ | |
| 14605 | + enumerable: true, | |
| 14606 | + get: function get() { | |
| 14607 | + return _paste.Paste; | |
| 14608 | + } | |
| 14609 | +})); | |
| 14610 | +Object.defineProperty(exports, "PasteStyle", ({ | |
| 14611 | + enumerable: true, | |
| 14612 | + get: function get() { | |
| 14613 | + return _pasteStyle.PasteStyle; | |
| 14614 | + } | |
| 14615 | +})); | |
| 14616 | + | |
| 14617 | +var _copy = __webpack_require__(/*! ./copy */ "../assets/dev/js/editor/document/ui/commands/copy.js"); | |
| 14618 | + | |
| 14619 | +var _delete = __webpack_require__(/*! ./delete */ "../assets/dev/js/editor/document/ui/commands/delete.js"); | |
| 14620 | + | |
| 14621 | +var _duplicate = __webpack_require__(/*! ./duplicate */ "../assets/dev/js/editor/document/ui/commands/duplicate.js"); | |
| 14622 | + | |
| 14623 | +var _paste = __webpack_require__(/*! ./paste */ "../assets/dev/js/editor/document/ui/commands/paste.js"); | |
| 14624 | + | |
| 14625 | +var _pasteStyle = __webpack_require__(/*! ./paste-style */ "../assets/dev/js/editor/document/ui/commands/paste-style.js"); | |
| 14626 | + | |
| 14627 | +/***/ }), | |
| 14628 | + | |
| 14629 | +/***/ "../assets/dev/js/editor/document/ui/commands/paste-style.js": | |
| 14630 | +/*!*******************************************************************!*\ | |
| 14631 | + !*** ../assets/dev/js/editor/document/ui/commands/paste-style.js ***! | |
| 14632 | + \*******************************************************************/ | |
| 14633 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14634 | + | |
| 14635 | +"use strict"; | |
| 14636 | + | |
| 14637 | + | |
| 14638 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14639 | + | |
| 14640 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14641 | + value: true | |
| 14642 | +})); | |
| 14643 | +exports["default"] = exports.PasteStyle = void 0; | |
| 14644 | + | |
| 14645 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14646 | + | |
| 14647 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14648 | + | |
| 14649 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14650 | + | |
| 14651 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14652 | + | |
| 14653 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14654 | + | |
| 14655 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 14656 | + | |
| 14657 | +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); }; } | |
| 14658 | + | |
| 14659 | +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; } } | |
| 14660 | + | |
| 14661 | +var PasteStyle = /*#__PURE__*/function (_CommandBase) { | |
| 14662 | + (0, _inherits2.default)(PasteStyle, _CommandBase); | |
| 14663 | + | |
| 14664 | + var _super = _createSuper(PasteStyle); | |
| 14665 | + | |
| 14666 | + function PasteStyle() { | |
| 14667 | + (0, _classCallCheck2.default)(this, PasteStyle); | |
| 14668 | + return _super.apply(this, arguments); | |
| 14669 | + } | |
| 14670 | + | |
| 14671 | + (0, _createClass2.default)(PasteStyle, [{ | |
| 14672 | + key: "apply", | |
| 14673 | + value: function apply() { | |
| 14674 | + var selectedElement = elementor.getCurrentElement(); | |
| 14675 | + | |
| 14676 | + if (selectedElement) { | |
| 14677 | + return $e.run('document/elements/paste-style', { | |
| 14678 | + container: selectedElement.getContainer() | |
| 14679 | + }); | |
| 14680 | + } | |
| 14681 | + | |
| 14682 | + return false; | |
| 14683 | + } | |
| 14684 | + }]); | |
| 14685 | + return PasteStyle; | |
| 14686 | +}(_commandBase.default); | |
| 14687 | + | |
| 14688 | +exports.PasteStyle = PasteStyle; | |
| 14689 | +var _default = PasteStyle; | |
| 14690 | +exports["default"] = _default; | |
| 14691 | + | |
| 14692 | +/***/ }), | |
| 14693 | + | |
| 14694 | +/***/ "../assets/dev/js/editor/document/ui/commands/paste.js": | |
| 14695 | +/*!*************************************************************!*\ | |
| 14696 | + !*** ../assets/dev/js/editor/document/ui/commands/paste.js ***! | |
| 14697 | + \*************************************************************/ | |
| 14698 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14699 | + | |
| 14700 | +"use strict"; | |
| 14701 | + | |
| 14702 | + | |
| 14703 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14704 | + | |
| 14705 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14706 | + value: true | |
| 14707 | +})); | |
| 14708 | +exports["default"] = exports.Paste = void 0; | |
| 14709 | + | |
| 14710 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14711 | + | |
| 14712 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14713 | + | |
| 14714 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 14715 | + | |
| 14716 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14717 | + | |
| 14718 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14719 | + | |
| 14720 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14721 | + | |
| 14722 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 14723 | + | |
| 14724 | +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); }; } | |
| 14725 | + | |
| 14726 | +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; } } | |
| 14727 | + | |
| 14728 | +var Paste = /*#__PURE__*/function (_CommandBase) { | |
| 14729 | + (0, _inherits2.default)(Paste, _CommandBase); | |
| 14730 | + | |
| 14731 | + var _super = _createSuper(Paste); | |
| 14732 | + | |
| 14733 | + function Paste() { | |
| 14734 | + (0, _classCallCheck2.default)(this, Paste); | |
| 14735 | + return _super.apply(this, arguments); | |
| 14736 | + } | |
| 14737 | + | |
| 14738 | + (0, _createClass2.default)(Paste, [{ | |
| 14739 | + key: "initialize", | |
| 14740 | + value: function initialize(args) { | |
| 14741 | + var _args$containers = args.containers, | |
| 14742 | + containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 14743 | + (0, _get2.default)((0, _getPrototypeOf2.default)(Paste.prototype), "initialize", this).call(this, args); | |
| 14744 | + this.storage = elementorCommon.storage.get('clipboard') || []; | |
| 14745 | + this.storage = this.storage.map(function (model) { | |
| 14746 | + return new Backbone.Model(model); | |
| 14747 | + }); | |
| 14748 | + | |
| 14749 | + if (!containers[0]) { | |
| 14750 | + this.target = elementor.getCurrentElement(); | |
| 14751 | + this.target = this.target ? [this.target.getContainer()] : null; | |
| 14752 | + } else { | |
| 14753 | + this.target = containers; | |
| 14754 | + } | |
| 14755 | + } | |
| 14756 | + }, { | |
| 14757 | + key: "apply", | |
| 14758 | + value: function apply(args) { | |
| 14759 | + var _this = this; | |
| 14760 | + | |
| 14761 | + if (!this.target || 0 === this.storage.length) { | |
| 14762 | + return false; | |
| 14763 | + } | |
| 14764 | + | |
| 14765 | + var result = []; | |
| 14766 | + this.target.forEach(function ( | |
| 14767 | + /* Container */ | |
| 14768 | + container) { | |
| 14769 | + var _args$options = args.options, | |
| 14770 | + options = _args$options === void 0 ? {} : _args$options, | |
| 14771 | + pasteOptions = $e.components.get('document/elements').utils.getPasteOptions(_this.storage[0], container); | |
| 14772 | + | |
| 14773 | + if (!pasteOptions.isValidChild) { | |
| 14774 | + if (pasteOptions.isSameElement) { | |
| 14775 | + options.at = container.parent.model.get('elements').findIndex(container.model) + 1; // For same element always paste on his parent. | |
| 14776 | + | |
| 14777 | + container = container.parent; | |
| 14778 | + } else if (pasteOptions.isValidGrandChild) { | |
| 14779 | + options.rebuild = true; | |
| 14780 | + } | |
| 14781 | + } | |
| 14782 | + | |
| 14783 | + if (Object.values(pasteOptions).some(function (opt) { | |
| 14784 | + return !!opt; | |
| 14785 | + })) { | |
| 14786 | + var commandArgs = { | |
| 14787 | + container: container | |
| 14788 | + }; | |
| 14789 | + | |
| 14790 | + if (undefined !== options.rebuild) { | |
| 14791 | + commandArgs.rebuild = options.rebuild; | |
| 14792 | + } | |
| 14793 | + | |
| 14794 | + if (undefined !== options.at) { | |
| 14795 | + commandArgs.at = options.at; | |
| 14796 | + } | |
| 14797 | + | |
| 14798 | + result.push($e.run('document/elements/paste', commandArgs)); | |
| 14799 | + } | |
| 14800 | + }); | |
| 14801 | + | |
| 14802 | + if (0 === result.length) { | |
| 14803 | + return false; | |
| 14804 | + } else if (1 === result.length) { | |
| 14805 | + return result[0]; | |
| 14806 | + } | |
| 14807 | + | |
| 14808 | + return result; | |
| 14809 | + } | |
| 14810 | + }]); | |
| 14811 | + return Paste; | |
| 14812 | +}(_commandBase.default); | |
| 14813 | + | |
| 14814 | +exports.Paste = Paste; | |
| 14815 | +var _default = Paste; | |
| 14816 | +exports["default"] = _default; | |
| 14817 | + | |
| 14818 | +/***/ }), | |
| 14819 | + | |
| 14820 | +/***/ "../assets/dev/js/editor/document/ui/component.js": | |
| 14821 | +/*!********************************************************!*\ | |
| 14822 | + !*** ../assets/dev/js/editor/document/ui/component.js ***! | |
| 14823 | + \********************************************************/ | |
| 14824 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 14825 | + | |
| 14826 | +"use strict"; | |
| 14827 | + | |
| 14828 | + | |
| 14829 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14830 | + | |
| 14831 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 14832 | + | |
| 14833 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14834 | + value: true | |
| 14835 | +})); | |
| 14836 | +exports["default"] = void 0; | |
| 14837 | + | |
| 14838 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 14839 | + | |
| 14840 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 14841 | + | |
| 14842 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 14843 | + | |
| 14844 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 14845 | + | |
| 14846 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 14847 | + | |
| 14848 | +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 14849 | + | |
| 14850 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../assets/dev/js/editor/document/ui/commands/index.js")); | |
| 14851 | + | |
| 14852 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 14853 | + | |
| 14854 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 14855 | + | |
| 14856 | +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); }; } | |
| 14857 | + | |
| 14858 | +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; } } | |
| 14859 | + | |
| 14860 | +var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 14861 | + (0, _inherits2.default)(Component, _ComponentBase); | |
| 14862 | + | |
| 14863 | + var _super = _createSuper(Component); | |
| 14864 | + | |
| 14865 | + function Component() { | |
| 14866 | + (0, _classCallCheck2.default)(this, Component); | |
| 14867 | + return _super.apply(this, arguments); | |
| 14868 | + } | |
| 14869 | + | |
| 14870 | + (0, _createClass2.default)(Component, [{ | |
| 14871 | + key: "getNamespace", | |
| 14872 | + value: function getNamespace() { | |
| 14873 | + return 'document/ui'; | |
| 14874 | + } | |
| 14875 | + }, { | |
| 14876 | + key: "defaultCommands", | |
| 14877 | + value: function defaultCommands() { | |
| 14878 | + return this.importCommands(commands); | |
| 14879 | + } | |
| 14880 | + }, { | |
| 14881 | + key: "defaultShortcuts", | |
| 14882 | + value: function defaultShortcuts() { | |
| 14883 | + return { | |
| 14884 | + copy: { | |
| 14885 | + keys: 'ctrl+c', | |
| 14886 | + exclude: ['input'] | |
| 14887 | + }, | |
| 14888 | + delete: { | |
| 14889 | + keys: 'del', | |
| 14890 | + exclude: ['input'] | |
| 14891 | + }, | |
| 14892 | + duplicate: { | |
| 14893 | + keys: 'ctrl+d' | |
| 14894 | + }, | |
| 14895 | + paste: { | |
| 14896 | + keys: 'ctrl+v', | |
| 14897 | + exclude: ['input'] | |
| 14898 | + }, | |
| 14899 | + 'paste-style': { | |
| 14900 | + keys: 'ctrl+shift+v', | |
| 14901 | + exclude: ['input'] | |
| 14902 | + } | |
| 14903 | + }; | |
| 14904 | + } | |
| 14905 | + }]); | |
| 14906 | + return Component; | |
| 14907 | +}(_componentBase.default); | |
| 14908 | + | |
| 14909 | +exports["default"] = Component; | |
| 14910 | + | |
| 14911 | +/***/ }), | |
| 14912 | + | |
| 14913 | +/***/ "../assets/dev/js/editor/elements/views/base.js": | |
| 14914 | +/*!******************************************************!*\ | |
| 14915 | + !*** ../assets/dev/js/editor/elements/views/base.js ***! | |
| 14916 | + \******************************************************/ | |
| 14917 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 14918 | + | |
| 14919 | +"use strict"; | |
| 14920 | +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; | |
| 14921 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 14922 | + | |
| 14923 | + | |
| 14924 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14925 | + | |
| 14926 | +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 14927 | + | |
| 14928 | +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 14929 | + | |
| 14930 | +var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-common/utils/environment */ "../core/common/assets/js/utils/environment.js")); | |
| 14931 | + | |
| 14932 | +var ControlsCSSParser = __webpack_require__(/*! elementor-editor-utils/controls-css-parser */ "../assets/dev/js/editor/utils/controls-css-parser.js"), | |
| 14933 | + Validator = __webpack_require__(/*! elementor-validator/base */ "../assets/dev/js/editor/components/validator/base.js"), | |
| 14934 | + BaseContainer = __webpack_require__(/*! elementor-views/base-container */ "../assets/dev/js/editor/views/base-container.js"), | |
| 14935 | + BaseElementView; | |
| 14936 | + | |
| 14937 | +BaseElementView = BaseContainer.extend({ | |
| 14938 | + tagName: 'div', | |
| 14939 | + controlsCSSParser: null, | |
| 14940 | + allowRender: true, | |
| 14941 | + toggleEditTools: false, | |
| 14942 | + renderAttributes: {}, | |
| 14943 | + className: function className() { | |
| 14944 | + var classes = 'elementor-element elementor-element-edit-mode ' + this.getElementUniqueID(); | |
| 14945 | + | |
| 14946 | + if (this.toggleEditTools) { | |
| 14947 | + classes += ' elementor-element--toggle-edit-tools'; | |
| 14948 | + } | |
| 14949 | + | |
| 14950 | + return classes; | |
| 14951 | + }, | |
| 14952 | + attributes: function attributes() { | |
| 14953 | + return { | |
| 14954 | + 'data-id': this.getID(), | |
| 14955 | + 'data-element_type': this.model.get('elType') | |
| 14956 | + }; | |
| 14957 | + }, | |
| 14958 | + ui: function ui() { | |
| 14959 | + return { | |
| 14960 | + tools: '> .elementor-element-overlay > .elementor-editor-element-settings', | |
| 14961 | + editButton: '> .elementor-element-overlay .elementor-editor-element-edit', | |
| 14962 | + duplicateButton: '> .elementor-element-overlay .elementor-editor-element-duplicate', | |
| 14963 | + addButton: '> .elementor-element-overlay .elementor-editor-element-add', | |
| 14964 | + removeButton: '> .elementor-element-overlay .elementor-editor-element-remove' | |
| 14965 | + }; | |
| 14966 | + }, | |
| 14967 | + behaviors: function behaviors() { | |
| 14968 | + var elementType = this.options.model.get('elType'); | |
| 14969 | + var groups = elementor.hooks.applyFilters("elements/".concat(elementType, "/contextMenuGroups"), this.getContextMenuGroups(), this); | |
| 14970 | + var behaviors = { | |
| 14971 | + contextMenu: { | |
| 14972 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/context-menu */ "../assets/dev/js/editor/elements/views/behaviors/context-menu.js"), | |
| 14973 | + groups: groups | |
| 14974 | + } | |
| 14975 | + }; | |
| 14976 | + return elementor.hooks.applyFilters('elements/base/behaviors', behaviors, this); | |
| 14977 | + }, | |
| 14978 | + getBehavior: function getBehavior(name) { | |
| 14979 | + return this._behaviors[Object.keys(this.behaviors()).indexOf(name)]; | |
| 14980 | + }, | |
| 14981 | + events: function events() { | |
| 14982 | + return { | |
| 14983 | + mousedown: 'onMouseDown', | |
| 14984 | + 'click @ui.editButton': 'onEditButtonClick', | |
| 14985 | + 'click @ui.duplicateButton': 'onDuplicateButtonClick', | |
| 14986 | + 'click @ui.addButton': 'onAddButtonClick', | |
| 14987 | + 'click @ui.removeButton': 'onRemoveButtonClick' | |
| 14988 | + }; | |
| 14989 | + }, | |
| 14990 | + getElementType: function getElementType() { | |
| 14991 | + return this.model.get('elType'); | |
| 14992 | + }, | |
| 14993 | + getIDInt: function getIDInt() { | |
| 14994 | + return parseInt(this.getID(), 16); | |
| 14995 | + }, | |
| 14996 | + getChildType: function getChildType() { | |
| 14997 | + return elementor.helpers.getElementChildType(this.getElementType()); | |
| 14998 | + }, | |
| 14999 | + getChildView: function getChildView(model) { | |
| 15000 | + var ChildView; | |
| 15001 | + var elType = model.get('elType'); | |
| 15002 | + | |
| 15003 | + switch (elType) { | |
| 15004 | + case 'section': | |
| 15005 | + ChildView = __webpack_require__(/*! elementor-elements/views/section */ "../assets/dev/js/editor/elements/views/section.js"); | |
| 15006 | + break; | |
| 15007 | + | |
| 15008 | + case 'column': | |
| 15009 | + ChildView = __webpack_require__(/*! elementor-elements/views/column */ "../assets/dev/js/editor/elements/views/column.js"); | |
| 15010 | + break; | |
| 15011 | + | |
| 15012 | + case 'container': | |
| 15013 | + ChildView = __webpack_require__(/*! elementor-elements/views/container */ "../assets/dev/js/editor/elements/views/container.js"); | |
| 15014 | + break; | |
| 15015 | + | |
| 15016 | + default: | |
| 15017 | + ChildView = elementor.modules.elements.views.Widget; | |
| 15018 | + break; | |
| 15019 | + } | |
| 15020 | + | |
| 15021 | + return elementor.hooks.applyFilters('element/view', ChildView, model, this); | |
| 15022 | + }, | |
| 15023 | + getTemplateType: function getTemplateType() { | |
| 15024 | + return 'js'; | |
| 15025 | + }, | |
| 15026 | + getEditModel: function getEditModel() { | |
| 15027 | + return this.model; | |
| 15028 | + }, | |
| 15029 | + getContainer: function getContainer() { | |
| 15030 | + if (!this.container) { | |
| 15031 | + var settingsModel = this.model.get('settings'); | |
| 15032 | + this.container = new elementorModules.editor.Container({ | |
| 15033 | + type: this.model.get('elType'), | |
| 15034 | + id: this.model.id, | |
| 15035 | + model: this.model, | |
| 15036 | + settings: settingsModel, | |
| 15037 | + view: this, | |
| 15038 | + parent: this._parent ? this._parent.getContainer() : {}, | |
| 15039 | + label: elementor.helpers.getModelLabel(this.model), | |
| 15040 | + controls: settingsModel.options.controls | |
| 15041 | + }); | |
| 15042 | + } | |
| 15043 | + | |
| 15044 | + return this.container; | |
| 15045 | + }, | |
| 15046 | + getContextMenuGroups: function getContextMenuGroups() { | |
| 15047 | + var _this = this; | |
| 15048 | + | |
| 15049 | + var controlSign = _environment.default.mac ? '⌘' : '^'; | |
| 15050 | + var groups = [{ | |
| 15051 | + name: 'general', | |
| 15052 | + actions: [{ | |
| 15053 | + name: 'edit', | |
| 15054 | + icon: 'eicon-edit', | |
| 15055 | + | |
| 15056 | + /* translators: %s: Element Name. */ | |
| 15057 | + title: function title() { | |
| 15058 | + return sprintf(__('Edit %s', 'elementor'), elementor.selection.isMultiple() ? '' : _this.options.model.getTitle()); | |
| 15059 | + }, | |
| 15060 | + isEnabled: function isEnabled() { | |
| 15061 | + return !elementor.selection.isMultiple(); | |
| 15062 | + }, | |
| 15063 | + callback: function callback() { | |
| 15064 | + return $e.run('panel/editor/open', { | |
| 15065 | + model: _this.options.model, | |
| 15066 | + // Todo: remove on merge router | |
| 15067 | + view: _this, | |
| 15068 | + // Todo: remove on merge router | |
| 15069 | + container: _this.getContainer() | |
| 15070 | + }); | |
| 15071 | + } | |
| 15072 | + }, { | |
| 15073 | + name: 'duplicate', | |
| 15074 | + icon: 'eicon-clone', | |
| 15075 | + title: __('Duplicate', 'elementor'), | |
| 15076 | + shortcut: controlSign + '+D', | |
| 15077 | + isEnabled: function isEnabled() { | |
| 15078 | + return elementor.selection.isSameType(); | |
| 15079 | + }, | |
| 15080 | + callback: function callback() { | |
| 15081 | + return $e.run('document/elements/duplicate', { | |
| 15082 | + containers: elementor.selection.getElements(_this.getContainer()) | |
| 15083 | + }); | |
| 15084 | + } | |
| 15085 | + }] | |
| 15086 | + }, { | |
| 15087 | + name: 'clipboard', | |
| 15088 | + actions: [{ | |
| 15089 | + name: 'copy', | |
| 15090 | + title: __('Copy', 'elementor'), | |
| 15091 | + shortcut: controlSign + '+C', | |
| 15092 | + isEnabled: function isEnabled() { | |
| 15093 | + return elementor.selection.isSameType(); | |
| 15094 | + }, | |
| 15095 | + callback: function callback() { | |
| 15096 | + return $e.run('document/elements/copy', { | |
| 15097 | + containers: elementor.selection.getElements(_this.getContainer()) | |
| 15098 | + }); | |
| 15099 | + } | |
| 15100 | + }, { | |
| 15101 | + name: 'paste', | |
| 15102 | + title: __('Paste', 'elementor'), | |
| 15103 | + shortcut: controlSign + '+V', | |
| 15104 | + isEnabled: function isEnabled() { | |
| 15105 | + return $e.components.get('document/elements').utils.isPasteEnabled(_this.getContainer()) && elementor.selection.isSameType(); | |
| 15106 | + }, | |
| 15107 | + callback: function callback() { | |
| 15108 | + return $e.run('document/ui/paste', { | |
| 15109 | + container: _this.getContainer() | |
| 15110 | + }); | |
| 15111 | + } | |
| 15112 | + }, { | |
| 15113 | + name: 'pasteStyle', | |
| 15114 | + title: __('Paste Style', 'elementor'), | |
| 15115 | + shortcut: controlSign + '+⇧+V', | |
| 15116 | + isEnabled: function isEnabled() { | |
| 15117 | + return !!elementorCommon.storage.get('clipboard'); | |
| 15118 | + }, | |
| 15119 | + callback: function callback() { | |
| 15120 | + return $e.run('document/elements/paste-style', { | |
| 15121 | + containers: elementor.selection.getElements(_this.getContainer()) | |
| 15122 | + }); | |
| 15123 | + } | |
| 15124 | + }, { | |
| 15125 | + name: 'resetStyle', | |
| 15126 | + title: __('Reset Style', 'elementor'), | |
| 15127 | + callback: function callback() { | |
| 15128 | + return $e.run('document/elements/reset-style', { | |
| 15129 | + containers: elementor.selection.getElements(_this.getContainer()) | |
| 15130 | + }); | |
| 15131 | + } | |
| 15132 | + }] | |
| 15133 | + }]; | |
| 15134 | + var customGroups = []; | |
| 15135 | + /** | |
| 15136 | + * Filter Additional Context Menu Groups. | |
| 15137 | + * | |
| 15138 | + * This filter allows adding new context menu groups to elements. | |
| 15139 | + * | |
| 15140 | + * @param array customGroups - An array of group objects. | |
| 15141 | + * @param string elementType - The current element type. | |
| 15142 | + */ | |
| 15143 | + | |
| 15144 | + customGroups = elementor.hooks.applyFilters('elements/context-menu/groups', customGroups, this.options.model.get('elType')); | |
| 15145 | + | |
| 15146 | + if (customGroups.length) { | |
| 15147 | + groups = [].concat((0, _toConsumableArray2.default)(groups), (0, _toConsumableArray2.default)(customGroups)); | |
| 15148 | + } | |
| 15149 | + | |
| 15150 | + groups.push({ | |
| 15151 | + name: 'delete', | |
| 15152 | + actions: [{ | |
| 15153 | + name: 'delete', | |
| 15154 | + icon: 'eicon-trash', | |
| 15155 | + title: function title() { | |
| 15156 | + return elementor.selection.isMultiple() ? sprintf(__('Delete %d items', 'elementor'), elementor.selection.getElements().length) : __('Delete', 'elementor'); | |
| 15157 | + }, | |
| 15158 | + shortcut: '⌦', | |
| 15159 | + callback: function callback() { | |
| 15160 | + return $e.run('document/elements/delete', { | |
| 15161 | + containers: elementor.selection.getElements(_this.getContainer()) | |
| 15162 | + }); | |
| 15163 | + } | |
| 15164 | + }] | |
| 15165 | + }); | |
| 15166 | + return groups; | |
| 15167 | + }, | |
| 15168 | + getEditButtons: function getEditButtons() { | |
| 15169 | + return {}; | |
| 15170 | + }, | |
| 15171 | + initialize: function initialize() { | |
| 15172 | + var _this2 = this; | |
| 15173 | + | |
| 15174 | + BaseContainer.prototype.initialize.apply(this, arguments); | |
| 15175 | + var editModel = this.getEditModel(); | |
| 15176 | + | |
| 15177 | + if (this.collection && this.onCollectionChanged) { | |
| 15178 | + elementorCommon.helpers.softDeprecated('onCollectionChanged', '2.8.0', '$e.hooks'); | |
| 15179 | + this.listenTo(this.collection, 'add remove reset', this.onCollectionChanged, this); | |
| 15180 | + } | |
| 15181 | + | |
| 15182 | + if (this.onSettingsChanged) { | |
| 15183 | + elementorCommon.helpers.softDeprecated('onSettingsChanged', '2.8.0', '$e.hooks'); | |
| 15184 | + this.listenTo(editModel.get('settings'), 'change', this.onSettingsChanged); | |
| 15185 | + } | |
| 15186 | + | |
| 15187 | + this.listenTo(editModel.get('editSettings'), 'change', this.onEditSettingsChanged).listenTo(this.model, 'request:edit', this.onEditRequest).listenTo(this.model, 'request:toggleVisibility', this.toggleVisibility); | |
| 15188 | + this.initControlsCSSParser(); | |
| 15189 | + | |
| 15190 | + _.defer(function () { | |
| 15191 | + // Init container. Defer - in order to init the container after the element is fully initialized, and properties like `_parent` are available. | |
| 15192 | + _this2.getContainer(); | |
| 15193 | + }); | |
| 15194 | + }, | |
| 15195 | + getHandlesOverlay: function getHandlesOverlay() { | |
| 15196 | + var elementType = this.getElementType(), | |
| 15197 | + $handlesOverlay = jQuery('<div>', { | |
| 15198 | + class: 'elementor-element-overlay' | |
| 15199 | + }), | |
| 15200 | + $overlayList = jQuery('<ul>', { | |
| 15201 | + class: "elementor-editor-element-settings elementor-editor-".concat(elementType, "-settings") | |
| 15202 | + }), | |
| 15203 | + editButtonsEnabled = elementor.getPreferences('edit_buttons'), | |
| 15204 | + elementData = elementor.getElementData(this.model); | |
| 15205 | + var editButtons = this.getEditButtons(); // We should only allow external modification to edit buttons if the user enabled edit buttons. | |
| 15206 | + | |
| 15207 | + if (editButtonsEnabled) { | |
| 15208 | + /** | |
| 15209 | + * Filter edit buttons. | |
| 15210 | + * | |
| 15211 | + * This filter allows adding edit buttons to all element types. | |
| 15212 | + * | |
| 15213 | + * @since 3.5.0 | |
| 15214 | + * | |
| 15215 | + * @param array editButtons An array of buttons. | |
| 15216 | + */ | |
| 15217 | + editButtons = elementor.hooks.applyFilters("elements/edit-buttons", editButtons); | |
| 15218 | + /** | |
| 15219 | + * Filter edit buttons. | |
| 15220 | + * | |
| 15221 | + * This filter allows adding edit buttons only to a specific element type. | |
| 15222 | + * | |
| 15223 | + * The dynamic portion of the hook name, `elementType`, refers to element type (widget, column, section). | |
| 15224 | + * | |
| 15225 | + * @since 3.5.0 | |
| 15226 | + * | |
| 15227 | + * @param array editButtons An array of buttons. | |
| 15228 | + */ | |
| 15229 | + | |
| 15230 | + editButtons = elementor.hooks.applyFilters("elements/edit-buttons/".concat(elementType), editButtons); | |
| 15231 | + } // Only sections always have the remove button, even if the Editing Handles preference is off. | |
| 15232 | + | |
| 15233 | + | |
| 15234 | + if ('section' === elementType || editButtonsEnabled) { | |
| 15235 | + editButtons.remove = { | |
| 15236 | + /* translators: %s: Element Name. */ | |
| 15237 | + title: sprintf(__('Delete %s', 'elementor'), elementData.title), | |
| 15238 | + icon: 'close' | |
| 15239 | + }; | |
| 15240 | + } | |
| 15241 | + | |
| 15242 | + jQuery.each(editButtons, function (toolName, tool) { | |
| 15243 | + var $item = jQuery('<li>', { | |
| 15244 | + class: "elementor-editor-element-setting elementor-editor-element-".concat(toolName), | |
| 15245 | + title: tool.title | |
| 15246 | + }), | |
| 15247 | + $icon = jQuery('<i>', { | |
| 15248 | + class: "eicon-".concat(tool.icon), | |
| 15249 | + 'aria-hidden': true | |
| 15250 | + }), | |
| 15251 | + $a11y = jQuery('<span>', { | |
| 15252 | + class: 'elementor-screen-only' | |
| 15253 | + }); | |
| 15254 | + $a11y.text(tool.title); | |
| 15255 | + $item.append($icon, $a11y); | |
| 15256 | + $overlayList.append($item); | |
| 15257 | + }); | |
| 15258 | + $handlesOverlay.append($overlayList); | |
| 15259 | + return $handlesOverlay; | |
| 15260 | + }, | |
| 15261 | + attachElContent: function attachElContent(html) { | |
| 15262 | + this.$el.empty().append(this.getHandlesOverlay(), html); | |
| 15263 | + }, | |
| 15264 | + isStyleTransferControl: function isStyleTransferControl(control) { | |
| 15265 | + if (undefined !== control.style_transfer) { | |
| 15266 | + return control.style_transfer; | |
| 15267 | + } | |
| 15268 | + | |
| 15269 | + return 'content' !== control.tab || control.selectors || control.prefix_class; | |
| 15270 | + }, | |
| 15271 | + toggleVisibility: function toggleVisibility() { | |
| 15272 | + this.model.set('hidden', !this.model.get('hidden')); | |
| 15273 | + this.toggleVisibilityClass(); | |
| 15274 | + }, | |
| 15275 | + toggleVisibilityClass: function toggleVisibilityClass() { | |
| 15276 | + this.$el.toggleClass('elementor-edit-hidden', !!this.model.get('hidden')); | |
| 15277 | + }, | |
| 15278 | + addElementFromPanel: function addElementFromPanel(options) { | |
| 15279 | + options = options || {}; | |
| 15280 | + var elementView = elementor.channels.panelElements.request('element:selected'), | |
| 15281 | + model = { | |
| 15282 | + elType: elementView.model.get('elType') | |
| 15283 | + }; | |
| 15284 | + | |
| 15285 | + if (elementor.helpers.maybeDisableWidget()) { | |
| 15286 | + return; | |
| 15287 | + } | |
| 15288 | + | |
| 15289 | + if ('widget' === model.elType) { | |
| 15290 | + model.widgetType = elementView.model.get('widgetType'); | |
| 15291 | + } else if ('section' === model.elType) { | |
| 15292 | + model.isInner = true; | |
| 15293 | + } else if ('container' !== model.elType) { | |
| 15294 | + // Don't allow adding anything other than widget, inner-section or a container. | |
| 15295 | + return; | |
| 15296 | + } | |
| 15297 | + | |
| 15298 | + var customData = elementView.model.get('custom'); | |
| 15299 | + | |
| 15300 | + if (customData) { | |
| 15301 | + jQuery.extend(model, customData); | |
| 15302 | + } // Reset the selected element cache. | |
| 15303 | + | |
| 15304 | + | |
| 15305 | + elementor.channels.panelElements.reply('element:selected', null); | |
| 15306 | + return $e.run('document/elements/create', { | |
| 15307 | + container: this.getContainer(), | |
| 15308 | + model: model, | |
| 15309 | + options: options | |
| 15310 | + }); | |
| 15311 | + }, | |
| 15312 | + // TODO: Unused function. | |
| 15313 | + addControlValidator: function addControlValidator(controlName, validationCallback) { | |
| 15314 | + validationCallback = validationCallback.bind(this); | |
| 15315 | + var validator = new Validator({ | |
| 15316 | + customValidationMethod: validationCallback | |
| 15317 | + }), | |
| 15318 | + validators = this.getEditModel().get('settings').validators; | |
| 15319 | + | |
| 15320 | + if (!validators[controlName]) { | |
| 15321 | + validators[controlName] = []; | |
| 15322 | + } | |
| 15323 | + | |
| 15324 | + validators[controlName].push(validator); | |
| 15325 | + }, | |
| 15326 | + addRenderAttribute: function addRenderAttribute(element, key, value, overwrite) { | |
| 15327 | + var self = this; | |
| 15328 | + | |
| 15329 | + if ('object' === (0, _typeof2.default)(element)) { | |
| 15330 | + jQuery.each(element, function (elementKey, elementValue) { | |
| 15331 | + self.addRenderAttribute(elementKey, elementValue, null, overwrite); | |
| 15332 | + }); | |
| 15333 | + return self; | |
| 15334 | + } | |
| 15335 | + | |
| 15336 | + if ('object' === (0, _typeof2.default)(key)) { | |
| 15337 | + jQuery.each(key, function (attributeKey, attributeValue) { | |
| 15338 | + self.addRenderAttribute(element, attributeKey, attributeValue, overwrite); | |
| 15339 | + }); | |
| 15340 | + return self; | |
| 15341 | + } | |
| 15342 | + | |
| 15343 | + if (!self.renderAttributes[element]) { | |
| 15344 | + self.renderAttributes[element] = {}; | |
| 15345 | + } | |
| 15346 | + | |
| 15347 | + if (!self.renderAttributes[element][key]) { | |
| 15348 | + self.renderAttributes[element][key] = []; | |
| 15349 | + } | |
| 15350 | + | |
| 15351 | + if (!Array.isArray(value)) { | |
| 15352 | + value = [value]; | |
| 15353 | + } | |
| 15354 | + | |
| 15355 | + if (overwrite) { | |
| 15356 | + self.renderAttributes[element][key] = value; | |
| 15357 | + } else { | |
| 15358 | + self.renderAttributes[element][key] = self.renderAttributes[element][key].concat(value); | |
| 15359 | + } | |
| 15360 | + }, | |
| 15361 | + getRenderAttributeString: function getRenderAttributeString(element) { | |
| 15362 | + if (!this.renderAttributes[element]) { | |
| 15363 | + return ''; | |
| 15364 | + } | |
| 15365 | + | |
| 15366 | + var renderAttributes = this.renderAttributes[element], | |
| 15367 | + attributes = []; | |
| 15368 | + jQuery.each(renderAttributes, function (attributeKey, attributeValue) { | |
| 15369 | + attributes.push(attributeKey + '="' + _.escape(attributeValue.join(' ')) + '"'); | |
| 15370 | + }); | |
| 15371 | + return attributes.join(' '); | |
| 15372 | + }, | |
| 15373 | + isInner: function isInner() { | |
| 15374 | + return !!this.model.get('isInner'); | |
| 15375 | + }, | |
| 15376 | + initControlsCSSParser: function initControlsCSSParser() { | |
| 15377 | + this.controlsCSSParser = new ControlsCSSParser({ | |
| 15378 | + id: this.model.get('id'), | |
| 15379 | + context: this, | |
| 15380 | + settingsModel: this.getEditModel().get('settings'), | |
| 15381 | + dynamicParsing: this.getDynamicParsingSettings() | |
| 15382 | + }); | |
| 15383 | + }, | |
| 15384 | + enqueueFonts: function enqueueFonts() { | |
| 15385 | + var editModel = this.getEditModel(), | |
| 15386 | + settings = editModel.get('settings'); // Enqueue Icon Fonts | |
| 15387 | + | |
| 15388 | + jQuery.each(settings.getIconsControls(), function (index, control) { | |
| 15389 | + var iconType = editModel.getSetting(control.name); | |
| 15390 | + | |
| 15391 | + if (!iconType || !iconType.library) { | |
| 15392 | + return; | |
| 15393 | + } | |
| 15394 | + | |
| 15395 | + elementor.helpers.enqueueIconFonts(iconType.library); | |
| 15396 | + }); | |
| 15397 | + }, | |
| 15398 | + renderStyles: function renderStyles(settings) { | |
| 15399 | + if (!settings) { | |
| 15400 | + settings = this.getEditModel().get('settings'); | |
| 15401 | + } | |
| 15402 | + | |
| 15403 | + this.controlsCSSParser.stylesheet.empty(); | |
| 15404 | + this.controlsCSSParser.addStyleRules(settings.getStyleControls(), settings.attributes, this.getEditModel().get('settings').controls, [/{{ID}}/g, /{{WRAPPER}}/g], [this.getID(), '.elementor-' + elementor.config.document.id + ' .elementor-element.' + this.getElementUniqueID()]); | |
| 15405 | + this.controlsCSSParser.addStyleToDocument(); | |
| 15406 | + }, | |
| 15407 | + renderCustomClasses: function renderCustomClasses() { | |
| 15408 | + var self = this; | |
| 15409 | + var settings = self.getEditModel().get('settings'), | |
| 15410 | + classControls = settings.getClassControls(); // Remove all previous classes | |
| 15411 | + | |
| 15412 | + _.each(classControls, function (control) { | |
| 15413 | + var previousClassValue = settings.previous(control.name); | |
| 15414 | + | |
| 15415 | + if (control.classes_dictionary) { | |
| 15416 | + if (undefined !== control.classes_dictionary[previousClassValue]) { | |
| 15417 | + previousClassValue = control.classes_dictionary[previousClassValue]; | |
| 15418 | + } | |
| 15419 | + } | |
| 15420 | + | |
| 15421 | + self.$el.removeClass(control.prefix_class + previousClassValue); | |
| 15422 | + }); // Add new classes | |
| 15423 | + | |
| 15424 | + | |
| 15425 | + _.each(classControls, function (control) { | |
| 15426 | + var value = settings.attributes[control.name]; | |
| 15427 | + var classValue = value; | |
| 15428 | + | |
| 15429 | + if (control.classes_dictionary) { | |
| 15430 | + if (undefined !== control.classes_dictionary[value]) { | |
| 15431 | + classValue = control.classes_dictionary[value]; | |
| 15432 | + } | |
| 15433 | + } | |
| 15434 | + | |
| 15435 | + var isVisible = elementor.helpers.isActiveControl(control, settings.attributes, settings.controls); | |
| 15436 | + | |
| 15437 | + if (isVisible && (classValue || 0 === classValue)) { | |
| 15438 | + self.$el.addClass(control.prefix_class + classValue); | |
| 15439 | + } | |
| 15440 | + }); | |
| 15441 | + | |
| 15442 | + self.$el.addClass(_.result(self, 'className')); | |
| 15443 | + self.toggleVisibilityClass(); | |
| 15444 | + }, | |
| 15445 | + renderCustomElementID: function renderCustomElementID() { | |
| 15446 | + var customElementID = this.getEditModel().get('settings').get('_element_id'); | |
| 15447 | + this.$el.attr('id', customElementID); | |
| 15448 | + }, | |
| 15449 | + renderUI: function renderUI() { | |
| 15450 | + this.renderStyles(); | |
| 15451 | + this.renderCustomClasses(); | |
| 15452 | + this.renderCustomElementID(); | |
| 15453 | + this.enqueueFonts(); | |
| 15454 | + }, | |
| 15455 | + runReadyTrigger: function runReadyTrigger() { | |
| 15456 | + var self = this; | |
| 15457 | + | |
| 15458 | + _.defer(function () { | |
| 15459 | + elementorFrontend.elementsHandler.runReadyTrigger(self.el); | |
| 15460 | + | |
| 15461 | + if (!elementorFrontend.isEditMode()) { | |
| 15462 | + return; | |
| 15463 | + } // In edit mode - handle an external elements that loaded by another elements like shortcode etc. | |
| 15464 | + | |
| 15465 | + | |
| 15466 | + self.$el.find('.elementor-element.elementor-' + self.model.get('elType') + ':not(.elementor-element-edit-mode)').each(function () { | |
| 15467 | + elementorFrontend.elementsHandler.runReadyTrigger(this); | |
| 15468 | + }); | |
| 15469 | + }); | |
| 15470 | + }, | |
| 15471 | + getID: function getID() { | |
| 15472 | + return this.model.get('id'); | |
| 15473 | + }, | |
| 15474 | + getElementUniqueID: function getElementUniqueID() { | |
| 15475 | + return 'elementor-element-' + this.getID(); | |
| 15476 | + }, | |
| 15477 | + renderHTML: function renderHTML() { | |
| 15478 | + var templateType = this.getTemplateType(), | |
| 15479 | + editModel = this.getEditModel(); | |
| 15480 | + | |
| 15481 | + if ('js' === templateType) { | |
| 15482 | + this.getEditModel().setHtmlCache(); | |
| 15483 | + this.render(); | |
| 15484 | + editModel.renderOnLeave = true; | |
| 15485 | + } else { | |
| 15486 | + editModel.renderRemoteServer(); | |
| 15487 | + } | |
| 15488 | + }, | |
| 15489 | + renderOnChange: function renderOnChange(settings) { | |
| 15490 | + if (!this.allowRender) { | |
| 15491 | + return; | |
| 15492 | + } // Make sure is correct model | |
| 15493 | + | |
| 15494 | + | |
| 15495 | + if (settings instanceof elementorModules.editor.elements.models.BaseSettings) { | |
| 15496 | + var hasChanged = settings.hasChanged(); | |
| 15497 | + var isContentChanged = !hasChanged, | |
| 15498 | + isRenderRequired = !hasChanged; | |
| 15499 | + | |
| 15500 | + _.each(settings.changedAttributes(), function (settingValue, settingKey) { | |
| 15501 | + if ('_column_size' === settingKey) { | |
| 15502 | + isRenderRequired = true; | |
| 15503 | + return; | |
| 15504 | + } | |
| 15505 | + | |
| 15506 | + var control = settings.getControl(settingKey); | |
| 15507 | + | |
| 15508 | + if (!control) { | |
| 15509 | + isRenderRequired = true; | |
| 15510 | + isContentChanged = true; | |
| 15511 | + return; | |
| 15512 | + } | |
| 15513 | + | |
| 15514 | + if ('none' !== control.render_type) { | |
| 15515 | + isRenderRequired = true; | |
| 15516 | + } | |
| 15517 | + | |
| 15518 | + if (-1 !== ['none', 'ui'].indexOf(control.render_type)) { | |
| 15519 | + return; | |
| 15520 | + } | |
| 15521 | + | |
| 15522 | + if ('template' === control.render_type || !settings.isStyleControl(settingKey) && !settings.isClassControl(settingKey) && '_element_id' !== settingKey) { | |
| 15523 | + isContentChanged = true; | |
| 15524 | + } | |
| 15525 | + }); | |
| 15526 | + | |
| 15527 | + if (!isRenderRequired) { | |
| 15528 | + return; | |
| 15529 | + } | |
| 15530 | + | |
| 15531 | + if (!isContentChanged) { | |
| 15532 | + this.renderUI(); | |
| 15533 | + return; | |
| 15534 | + } | |
| 15535 | + } // Re-render the template | |
| 15536 | + | |
| 15537 | + | |
| 15538 | + this.renderHTML(); | |
| 15539 | + }, | |
| 15540 | + getDynamicParsingSettings: function getDynamicParsingSettings() { | |
| 15541 | + var self = this; | |
| 15542 | + return { | |
| 15543 | + onServerRequestStart: function onServerRequestStart() { | |
| 15544 | + self.$el.addClass('elementor-loading'); | |
| 15545 | + }, | |
| 15546 | + onServerRequestEnd: function onServerRequestEnd() { | |
| 15547 | + self.render(); | |
| 15548 | + self.$el.removeClass('elementor-loading'); | |
| 15549 | + } | |
| 15550 | + }; | |
| 15551 | + }, | |
| 15552 | + serializeData: function serializeData() { | |
| 15553 | + var data = BaseContainer.prototype.serializeData.apply(this, arguments); | |
| 15554 | + data.settings = this.getEditModel().get('settings').parseDynamicSettings(data.settings, this.getDynamicParsingSettings()); | |
| 15555 | + return data; | |
| 15556 | + }, | |
| 15557 | + save: function save() { | |
| 15558 | + $e.route('library/save-template', { | |
| 15559 | + model: this.model | |
| 15560 | + }); | |
| 15561 | + }, | |
| 15562 | + onBeforeRender: function onBeforeRender() { | |
| 15563 | + this.renderAttributes = {}; | |
| 15564 | + }, | |
| 15565 | + onRender: function onRender() { | |
| 15566 | + var _this3 = this; | |
| 15567 | + | |
| 15568 | + this.renderUI(); | |
| 15569 | + this.runReadyTrigger(); | |
| 15570 | + | |
| 15571 | + if (this.toggleEditTools) { | |
| 15572 | + var editButton = this.ui.editButton; // Since this.ui.tools does not exist while testing. | |
| 15573 | + | |
| 15574 | + if (this.ui.tools) { | |
| 15575 | + this.ui.tools.hoverIntent(function () { | |
| 15576 | + editButton.addClass('elementor-active'); | |
| 15577 | + }, function () { | |
| 15578 | + editButton.removeClass('elementor-active'); | |
| 15579 | + }, { | |
| 15580 | + timeout: 500 | |
| 15581 | + }); | |
| 15582 | + } | |
| 15583 | + } // Defer to wait for all of the children to render. | |
| 15584 | + | |
| 15585 | + | |
| 15586 | + setTimeout(function () { | |
| 15587 | + return _this3.initDraggable(); | |
| 15588 | + }, 0); | |
| 15589 | + }, | |
| 15590 | + onEditSettingsChanged: function onEditSettingsChanged(changedModel) { | |
| 15591 | + elementor.channels.editor.trigger('change:editSettings', changedModel, this); | |
| 15592 | + }, | |
| 15593 | + onEditButtonClick: function onEditButtonClick(event) { | |
| 15594 | + this.model.trigger('request:edit', { | |
| 15595 | + append: event.ctrlKey || event.metaKey | |
| 15596 | + }); | |
| 15597 | + }, | |
| 15598 | + onEditRequest: function onEditRequest() { | |
| 15599 | + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 15600 | + | |
| 15601 | + if (!this.container.isEditable()) { | |
| 15602 | + return; | |
| 15603 | + } | |
| 15604 | + | |
| 15605 | + var model = this.getEditModel(), | |
| 15606 | + panel = elementor.getPanelView(); | |
| 15607 | + | |
| 15608 | + if ($e.routes.isPartOf('panel/editor') && panel.getCurrentPageView().model === model) { | |
| 15609 | + return; | |
| 15610 | + } | |
| 15611 | + | |
| 15612 | + if (options.scrollIntoView) { | |
| 15613 | + elementor.helpers.scrollToView(this.$el, 200); | |
| 15614 | + } | |
| 15615 | + | |
| 15616 | + $e.run('document/elements/toggle-selection', { | |
| 15617 | + container: this.getContainer(), | |
| 15618 | + append: options.append | |
| 15619 | + }); | |
| 15620 | + }, | |
| 15621 | + | |
| 15622 | + /** | |
| 15623 | + * Select current element. | |
| 15624 | + */ | |
| 15625 | + select: function select() { | |
| 15626 | + this.$el.addClass('elementor-element-editable'); | |
| 15627 | + }, | |
| 15628 | + | |
| 15629 | + /** | |
| 15630 | + * Deselect current element. | |
| 15631 | + */ | |
| 15632 | + deselect: function deselect() { | |
| 15633 | + this.$el.removeClass('elementor-element-editable'); | |
| 15634 | + }, | |
| 15635 | + onDuplicateButtonClick: function onDuplicateButtonClick(event) { | |
| 15636 | + event.stopPropagation(); | |
| 15637 | + $e.run('document/elements/duplicate', { | |
| 15638 | + container: this.getContainer() | |
| 15639 | + }); | |
| 15640 | + }, | |
| 15641 | + onRemoveButtonClick: function onRemoveButtonClick(event) { | |
| 15642 | + event.stopPropagation(); | |
| 15643 | + $e.run('document/elements/delete', { | |
| 15644 | + container: this.getContainer() | |
| 15645 | + }); | |
| 15646 | + }, | |
| 15647 | + | |
| 15648 | + /* jQuery ui sortable preventing any `mousedown` event above any element, and as a result is preventing the `blur` | |
| 15649 | + * event on the currently active element. Therefor, we need to blur the active element manually. | |
| 15650 | + */ | |
| 15651 | + onMouseDown: function onMouseDown(event) { | |
| 15652 | + if (jQuery(event.target).closest('.elementor-inline-editing').length) { | |
| 15653 | + return; | |
| 15654 | + } | |
| 15655 | + | |
| 15656 | + elementorFrontend.elements.window.document.activeElement.blur(); | |
| 15657 | + }, | |
| 15658 | + onDestroy: function onDestroy() { | |
| 15659 | + this.controlsCSSParser.removeStyleFromDocument(); | |
| 15660 | + this.getEditModel().get('settings').validators = {}; | |
| 15661 | + elementor.channels.data.trigger('element:destroy', this.model); | |
| 15662 | + }, | |
| 15663 | + // eslint-disable-next-line jsdoc/require-returns-check | |
| 15664 | + | |
| 15665 | + /** | |
| 15666 | + * On `$el` drag start event. | |
| 15667 | + * Used inside `Draggable` and can be overridden by the extending views. | |
| 15668 | + */ | |
| 15669 | + onDragStart: function onDragStart() {// TODO: Override if needed. | |
| 15670 | + }, | |
| 15671 | + | |
| 15672 | + /** | |
| 15673 | + * On `$el` drag end event. | |
| 15674 | + * Used inside `Draggable` and can be overridden by the extending views. | |
| 15675 | + */ | |
| 15676 | + onDragEnd: function onDragEnd() {// TODO: Override if needed. | |
| 15677 | + }, | |
| 15678 | + | |
| 15679 | + /** | |
| 15680 | + * Create a drag helper element. | |
| 15681 | + * Copied from `behaviors/sortable.js` with some refactor. | |
| 15682 | + * | |
| 15683 | + * @return {HTMLDivElement} helper | |
| 15684 | + */ | |
| 15685 | + getDraggableHelper: function getDraggableHelper() { | |
| 15686 | + var model = this.getEditModel(); | |
| 15687 | + var helper = document.createElement('div'); | |
| 15688 | + helper.classList.add('elementor-sortable-helper', "elementor-sortable-helper-".concat(model.get('elType'))); | |
| 15689 | + helper.innerHTML = "\n\t\t\t<div class=\"icon\">\n\t\t\t\t<i class=\"".concat(model.getIcon(), "\"></i>\n\t\t\t</div>\n\t\t\t<div class=\"elementor-element-title-wrapper\">\n\t\t\t\t<div class=\"title\">").concat(model.getTitle(), "</div>\n\t\t\t</div>\n\t\t"); | |
| 15690 | + return helper; | |
| 15691 | + }, | |
| 15692 | + | |
| 15693 | + /** | |
| 15694 | + * Initialize the Droppable instance. | |
| 15695 | + */ | |
| 15696 | + initDraggable: function initDraggable() { | |
| 15697 | + var _this4 = this; | |
| 15698 | + | |
| 15699 | + // Init the draggable only for Containers and their children. | |
| 15700 | + if (!this.$el.hasClass('.e-container') && !this.$el.parents('.e-container').length) { | |
| 15701 | + return; | |
| 15702 | + } | |
| 15703 | + | |
| 15704 | + this.$el.html5Draggable({ | |
| 15705 | + onDragStart: function onDragStart(e) { | |
| 15706 | + var _this4$options$dragga; | |
| 15707 | + | |
| 15708 | + e.stopPropagation(); // Need to stop this event when the element is absolute since it clashes with this one. | |
| 15709 | + // See `behaviors/widget-draggable.js`. | |
| 15710 | + | |
| 15711 | + if ((_this4$options$dragga = _this4.options.draggable) !== null && _this4$options$dragga !== void 0 && _this4$options$dragga.isActive) { | |
| 15712 | + return; | |
| 15713 | + } | |
| 15714 | + | |
| 15715 | + var helper = _this4.getDraggableHelper(); | |
| 15716 | + | |
| 15717 | + _this4.$el[0].appendChild(helper); // Set the x & y coordinates of the helper the same as the legacy jQuery sortable. | |
| 15718 | + | |
| 15719 | + | |
| 15720 | + e.originalEvent.dataTransfer.setDragImage(helper, 25, 20); // Remove the helper element as soon as it's set as a drag image, since the element must be | |
| 15721 | + // rendered for at least a fraction of a second in order to set it as a drag image. | |
| 15722 | + | |
| 15723 | + setTimeout(function () { | |
| 15724 | + helper.remove(); | |
| 15725 | + }); | |
| 15726 | + | |
| 15727 | + _this4.onDragStart(e); | |
| 15728 | + | |
| 15729 | + elementor.channels.editor.reply('element:dragged', _this4); | |
| 15730 | + }, | |
| 15731 | + onDragEnd: function onDragEnd(e) { | |
| 15732 | + e.stopPropagation(); | |
| 15733 | + | |
| 15734 | + _this4.onDragEnd(e); | |
| 15735 | + }, | |
| 15736 | + groups: ['elementor-element'] | |
| 15737 | + }); | |
| 15738 | + } | |
| 15739 | +}); | |
| 15740 | +module.exports = BaseElementView; | |
| 15741 | + | |
| 15742 | +/***/ }), | |
| 15743 | + | |
| 15744 | +/***/ "../assets/dev/js/editor/elements/views/behaviors/column-resizable.js": | |
| 15745 | +/*!****************************************************************************!*\ | |
| 15746 | + !*** ../assets/dev/js/editor/elements/views/behaviors/column-resizable.js ***! | |
| 15747 | + \****************************************************************************/ | |
| 15748 | +/***/ ((module) => { | |
| 15749 | + | |
| 15750 | +"use strict"; | |
| 15751 | + | |
| 15752 | + | |
| 15753 | +var ResizableBehavior; | |
| 15754 | +ResizableBehavior = Marionette.Behavior.extend({ | |
| 15755 | + defaults: { | |
| 15756 | + handles: elementorCommon.config.isRTL ? 'w' : 'e' | |
| 15757 | + }, | |
| 15758 | + events: { | |
| 15759 | + resizestart: 'onResizeStart', | |
| 15760 | + resizestop: 'onResizeStop', | |
| 15761 | + resize: 'onResize' | |
| 15762 | + }, | |
| 15763 | + initialize: function initialize() { | |
| 15764 | + Marionette.Behavior.prototype.initialize.apply(this, arguments); | |
| 15765 | + this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched); | |
| 15766 | + }, | |
| 15767 | + active: function active() { | |
| 15768 | + if (!elementor.userCan('design')) { | |
| 15769 | + return; | |
| 15770 | + } | |
| 15771 | + | |
| 15772 | + this.deactivate(); | |
| 15773 | + | |
| 15774 | + var options = _.clone(this.options); | |
| 15775 | + | |
| 15776 | + delete options.behaviorClass; | |
| 15777 | + | |
| 15778 | + var $childViewContainer = this.getChildViewContainer(), | |
| 15779 | + defaultResizableOptions = {}, | |
| 15780 | + resizableOptions = _.extend(defaultResizableOptions, options); | |
| 15781 | + | |
| 15782 | + $childViewContainer.resizable(resizableOptions); | |
| 15783 | + }, | |
| 15784 | + deactivate: function deactivate() { | |
| 15785 | + if (this.getChildViewContainer().resizable('instance')) { | |
| 15786 | + this.getChildViewContainer().resizable('destroy'); | |
| 15787 | + } | |
| 15788 | + }, | |
| 15789 | + onEditModeSwitched: function onEditModeSwitched(activeMode) { | |
| 15790 | + if ('edit' === activeMode) { | |
| 15791 | + this.active(); | |
| 15792 | + } else { | |
| 15793 | + this.deactivate(); | |
| 15794 | + } | |
| 15795 | + }, | |
| 15796 | + onRender: function onRender() { | |
| 15797 | + var self = this; | |
| 15798 | + | |
| 15799 | + _.defer(function () { | |
| 15800 | + self.onEditModeSwitched(elementor.channels.dataEditMode.request('activeMode')); | |
| 15801 | + }); | |
| 15802 | + }, | |
| 15803 | + onDestroy: function onDestroy() { | |
| 15804 | + this.deactivate(); | |
| 15805 | + }, | |
| 15806 | + onResizeStart: function onResizeStart(event) { | |
| 15807 | + event.stopPropagation(); | |
| 15808 | + this.view.$el.data('originalWidth', this.view.el.getBoundingClientRect().width); | |
| 15809 | + this.view.triggerMethod('request:resize:start', event); | |
| 15810 | + }, | |
| 15811 | + onResizeStop: function onResizeStop(event) { | |
| 15812 | + event.stopPropagation(); | |
| 15813 | + this.view.triggerMethod('request:resize:stop'); | |
| 15814 | + }, | |
| 15815 | + onResize: function onResize(event, ui) { | |
| 15816 | + event.stopPropagation(); | |
| 15817 | + this.view.triggerMethod('request:resize', ui, event); | |
| 15818 | + }, | |
| 15819 | + getChildViewContainer: function getChildViewContainer() { | |
| 15820 | + return this.$el; | |
| 15821 | + } | |
| 15822 | +}); | |
| 15823 | +module.exports = ResizableBehavior; | |
| 15824 | + | |
| 15825 | +/***/ }), | |
| 15826 | + | |
| 15827 | +/***/ "../assets/dev/js/editor/elements/views/behaviors/context-menu.js": | |
| 15828 | +/*!************************************************************************!*\ | |
| 15829 | + !*** ../assets/dev/js/editor/elements/views/behaviors/context-menu.js ***! | |
| 15830 | + \************************************************************************/ | |
| 15831 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 15832 | + | |
| 15833 | +"use strict"; | |
| 15834 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 15835 | + | |
| 15836 | + | |
| 15837 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 15838 | + | |
| 15839 | +var _base = _interopRequireDefault(__webpack_require__(/*! elementor-views/add-section/base */ "../assets/dev/js/editor/views/add-section/base.js")); | |
| 15840 | + | |
| 15841 | +var ContextMenu = __webpack_require__(/*! elementor-editor-utils/context-menu */ "../assets/dev/js/editor/utils/context-menu.js"); | |
| 15842 | + | |
| 15843 | +module.exports = Marionette.Behavior.extend({ | |
| 15844 | + defaults: { | |
| 15845 | + context: 'preview', | |
| 15846 | + groups: [], | |
| 15847 | + eventTargets: ['el'] | |
| 15848 | + }, | |
| 15849 | + events: function events() { | |
| 15850 | + var events = {}; | |
| 15851 | + this.getOption('eventTargets').forEach(function (eventTarget) { | |
| 15852 | + var eventName = 'contextmenu'; | |
| 15853 | + | |
| 15854 | + if ('el' !== eventTarget) { | |
| 15855 | + eventName += ' ' + eventTarget; | |
| 15856 | + } | |
| 15857 | + | |
| 15858 | + events[eventName] = 'onContextMenu'; | |
| 15859 | + }); | |
| 15860 | + return events; | |
| 15861 | + }, | |
| 15862 | + initialize: function initialize() { | |
| 15863 | + this.listenTo(this.view.options.model, 'request:contextmenu', this.onRequestContextMenu); | |
| 15864 | + }, | |
| 15865 | + initContextMenu: function initContextMenu() { | |
| 15866 | + var _this = this; | |
| 15867 | + | |
| 15868 | + var contextMenuGroups = this.getOption('groups'), | |
| 15869 | + deleteGroup = _.findWhere(contextMenuGroups, { | |
| 15870 | + name: 'delete' | |
| 15871 | + }), | |
| 15872 | + afterGroupIndex = contextMenuGroups.indexOf(deleteGroup); | |
| 15873 | + | |
| 15874 | + if (-1 === afterGroupIndex) { | |
| 15875 | + afterGroupIndex = contextMenuGroups.length; | |
| 15876 | + } | |
| 15877 | + | |
| 15878 | + if ('preview' === this.getOption('context')) { | |
| 15879 | + contextMenuGroups.splice(afterGroupIndex, 0, { | |
| 15880 | + name: 'tools', | |
| 15881 | + actions: [{ | |
| 15882 | + name: 'navigator', | |
| 15883 | + title: __('Navigator', 'elementor'), | |
| 15884 | + callback: function callback() { | |
| 15885 | + return $e.route('navigator', { | |
| 15886 | + reOpen: true, | |
| 15887 | + model: _this.view.model | |
| 15888 | + }); | |
| 15889 | + } | |
| 15890 | + }] | |
| 15891 | + }); | |
| 15892 | + } | |
| 15893 | + | |
| 15894 | + this.contextMenu = new ContextMenu({ | |
| 15895 | + groups: contextMenuGroups, | |
| 15896 | + context: this.getOption('context') | |
| 15897 | + }); | |
| 15898 | + this.contextMenu.getModal().on('hide', function () { | |
| 15899 | + return _this.onContextMenuHide(); | |
| 15900 | + }); | |
| 15901 | + }, | |
| 15902 | + getContextMenu: function getContextMenu() { | |
| 15903 | + var _this$view$getContain, _this$view; | |
| 15904 | + | |
| 15905 | + if (!this.contextMenu) { | |
| 15906 | + this.initContextMenu(); | |
| 15907 | + } | |
| 15908 | + | |
| 15909 | + if ('preview' === this.getOption('context') && !elementor.selection.has((_this$view$getContain = (_this$view = this.view).getContainer) === null || _this$view$getContain === void 0 ? void 0 : _this$view$getContain.call(_this$view))) { | |
| 15910 | + $e.run('document/elements/deselect-all'); | |
| 15911 | + } | |
| 15912 | + | |
| 15913 | + return this.contextMenu; | |
| 15914 | + }, | |
| 15915 | + onContextMenu: function onContextMenu(event) { | |
| 15916 | + if ($e.shortcuts.isControlEvent(event)) { | |
| 15917 | + return; | |
| 15918 | + } | |
| 15919 | + | |
| 15920 | + if ('preview' === this.getOption('context')) { | |
| 15921 | + var isAddSectionView = this.view instanceof _base.default; | |
| 15922 | + | |
| 15923 | + if (!isAddSectionView && (!this.view.container || !this.view.container.isDesignable())) { | |
| 15924 | + return; | |
| 15925 | + } | |
| 15926 | + } | |
| 15927 | + | |
| 15928 | + event.preventDefault(); | |
| 15929 | + event.stopPropagation(); // Disable sortable when context menu opened | |
| 15930 | + // TODO: Should be in UI hook when the context menu will move to command | |
| 15931 | + | |
| 15932 | + if (this.view._parent) { | |
| 15933 | + this.view._parent.triggerMethod('toggleSortMode', false); | |
| 15934 | + } | |
| 15935 | + | |
| 15936 | + this.getContextMenu().show(event); | |
| 15937 | + elementor.channels.editor.reply('contextMenu:targetView', this.view); | |
| 15938 | + }, | |
| 15939 | + onRequestContextMenu: function onRequestContextMenu(event) { | |
| 15940 | + var modal = this.getContextMenu().getModal(), | |
| 15941 | + iframe = modal.getSettings('iframe'), | |
| 15942 | + toolsGroup = _.findWhere(this.contextMenu.getSettings('groups'), { | |
| 15943 | + name: 'tools' | |
| 15944 | + }); | |
| 15945 | + | |
| 15946 | + toolsGroup.isVisible = false; | |
| 15947 | + modal.setSettings('iframe', null); | |
| 15948 | + this.onContextMenu(event); | |
| 15949 | + toolsGroup.isVisible = true; | |
| 15950 | + modal.setSettings('iframe', iframe); | |
| 15951 | + }, | |
| 15952 | + onContextMenuHide: function onContextMenuHide() { | |
| 15953 | + // enable sortable when context menu closed | |
| 15954 | + // TODO: Should be in UI hook when the context menu will move to command | |
| 15955 | + if (this.view._parent) { | |
| 15956 | + this.view._parent.triggerMethod('toggleSortMode', true); | |
| 15957 | + } | |
| 15958 | + | |
| 15959 | + elementor.channels.editor.reply('contextMenu:targetView', null); | |
| 15960 | + }, | |
| 15961 | + onDestroy: function onDestroy() { | |
| 15962 | + if (this.contextMenu) { | |
| 15963 | + this.contextMenu.destroy(); | |
| 15964 | + } | |
| 15965 | + } | |
| 15966 | +}); | |
| 15967 | + | |
| 15968 | +/***/ }), | |
| 15969 | + | |
| 15970 | +/***/ "../assets/dev/js/editor/elements/views/behaviors/sortable.js": | |
| 15971 | +/*!********************************************************************!*\ | |
| 15972 | + !*** ../assets/dev/js/editor/elements/views/behaviors/sortable.js ***! | |
| 15973 | + \********************************************************************/ | |
| 15974 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 15975 | + | |
| 15976 | +"use strict"; | |
| 15977 | + | |
| 15978 | + | |
| 15979 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 15980 | + | |
| 15981 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 15982 | + | |
| 15983 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 15984 | + | |
| 15985 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 15986 | + | |
| 15987 | +var SortableBehavior; | |
| 15988 | +/** | |
| 15989 | + * @typedef {import('../../../container/container')} Container | |
| 15990 | + */ | |
| 15991 | + | |
| 15992 | +SortableBehavior = Marionette.Behavior.extend({ | |
| 15993 | + defaults: { | |
| 15994 | + elChildType: 'widget' | |
| 15995 | + }, | |
| 15996 | + events: { | |
| 15997 | + sortstart: 'onSortStart', | |
| 15998 | + sortreceive: 'onSortReceive', | |
| 15999 | + sortupdate: 'onSortUpdate', | |
| 16000 | + sortover: 'onSortOver', | |
| 16001 | + sortout: 'onSortOut' | |
| 16002 | + }, | |
| 16003 | + initialize: function initialize() { | |
| 16004 | + this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched).listenTo(this.view.options.model, 'request:sort:start', this.startSort).listenTo(this.view.options.model, 'request:sort:update', this.updateSort).listenTo(this.view.options.model, 'request:sort:receive', this.receiveSort); | |
| 16005 | + }, | |
| 16006 | + onEditModeSwitched: function onEditModeSwitched(activeMode) { | |
| 16007 | + this.onToggleSortMode('edit' === activeMode); | |
| 16008 | + }, | |
| 16009 | + onRender: function onRender() { | |
| 16010 | + var self = this; | |
| 16011 | + | |
| 16012 | + _.defer(function () { | |
| 16013 | + self.onEditModeSwitched(elementor.channels.dataEditMode.request('activeMode')); | |
| 16014 | + }); | |
| 16015 | + }, | |
| 16016 | + onDestroy: function onDestroy() { | |
| 16017 | + this.deactivate(); | |
| 16018 | + }, | |
| 16019 | + | |
| 16020 | + /** | |
| 16021 | + * Create an item placeholder in order to avoid UI jumps due to flex. | |
| 16022 | + * | |
| 16023 | + * @param {Object} $element - jQuery element instance to create placeholder for. | |
| 16024 | + * @param {string} className - Placeholder class. | |
| 16025 | + * @param {boolean} hide - Whether to hide the original element. | |
| 16026 | + * | |
| 16027 | + * @return {void} | |
| 16028 | + */ | |
| 16029 | + createPlaceholder: function createPlaceholder($element) { | |
| 16030 | + var className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | |
| 16031 | + var hide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | |
| 16032 | + // Get the actual item size. | |
| 16033 | + $element.css('display', ''); | |
| 16034 | + var _$element$ = $element[0], | |
| 16035 | + width = _$element$.clientWidth, | |
| 16036 | + height = _$element$.clientHeight; | |
| 16037 | + | |
| 16038 | + if (hide) { | |
| 16039 | + $element.css('display', 'none'); | |
| 16040 | + } | |
| 16041 | + | |
| 16042 | + jQuery('<div />').css(_objectSpread(_objectSpread({}, $element.css(['flex-basis', 'flex-grow', 'flex-shrink', 'position'])), {}, { | |
| 16043 | + width: width, | |
| 16044 | + height: height | |
| 16045 | + })).addClass(className).insertAfter($element); | |
| 16046 | + }, | |
| 16047 | + | |
| 16048 | + /** | |
| 16049 | + * Return a settings object for jQuery UI sortable to make it swappable. | |
| 16050 | + * | |
| 16051 | + * @return {{stop: Function, start: Function}} options | |
| 16052 | + */ | |
| 16053 | + getSwappableOptions: function getSwappableOptions() { | |
| 16054 | + var _this = this; | |
| 16055 | + | |
| 16056 | + var $childViewContainer = this.getChildViewContainer(), | |
| 16057 | + placeholderClass = 'e-swappable--item-placeholder'; | |
| 16058 | + return { | |
| 16059 | + start: function start(event, ui) { | |
| 16060 | + $childViewContainer.sortable('refreshPositions'); // TODO: Find a better solution than this hack. | |
| 16061 | + // Used in order to prevent dragging a container into itself. | |
| 16062 | + | |
| 16063 | + _this.createPlaceholder(ui.item, placeholderClass); | |
| 16064 | + }, | |
| 16065 | + stop: function stop() { | |
| 16066 | + // Cleanup. | |
| 16067 | + $childViewContainer.find(".".concat(placeholderClass)).remove(); | |
| 16068 | + } | |
| 16069 | + }; | |
| 16070 | + }, | |
| 16071 | + onToggleSortMode: function onToggleSortMode(isActive) { | |
| 16072 | + if (isActive) { | |
| 16073 | + this.activate(); | |
| 16074 | + } else { | |
| 16075 | + this.deactivate(); | |
| 16076 | + } | |
| 16077 | + }, | |
| 16078 | + applySortable: function applySortable() { | |
| 16079 | + if (!elementor.userCan('design')) { | |
| 16080 | + return; | |
| 16081 | + } | |
| 16082 | + | |
| 16083 | + var $childViewContainer = this.getChildViewContainer(), | |
| 16084 | + defaultSortableOptions = { | |
| 16085 | + placeholder: 'elementor-sortable-placeholder elementor-' + this.getOption('elChildType') + '-placeholder', | |
| 16086 | + cursorAt: { | |
| 16087 | + top: 20, | |
| 16088 | + left: 25 | |
| 16089 | + }, | |
| 16090 | + helper: this._getSortableHelper.bind(this), | |
| 16091 | + cancel: 'input, textarea, button, select, option, .elementor-inline-editing, .elementor-tab-title', | |
| 16092 | + // Fix: Sortable - Unable to drag and drop sections with huge height. | |
| 16093 | + start: function start() { | |
| 16094 | + $childViewContainer.sortable('refreshPositions'); | |
| 16095 | + } | |
| 16096 | + }; | |
| 16097 | + | |
| 16098 | + var sortableOptions = _.extend(defaultSortableOptions, this.view.getSortableOptions()); // Add a swappable behavior (used for flex containers). | |
| 16099 | + | |
| 16100 | + | |
| 16101 | + if (this.isSwappable()) { | |
| 16102 | + $childViewContainer.addClass('e-swappable'); | |
| 16103 | + sortableOptions = _.extend(sortableOptions, this.getSwappableOptions()); | |
| 16104 | + } // TODO: Temporary hack for Container. | |
| 16105 | + // Will be removed in the future when the Navigator will use React. | |
| 16106 | + | |
| 16107 | + | |
| 16108 | + if (sortableOptions.preventInit) { | |
| 16109 | + return; | |
| 16110 | + } | |
| 16111 | + | |
| 16112 | + $childViewContainer.sortable(sortableOptions); | |
| 16113 | + }, | |
| 16114 | + | |
| 16115 | + /** | |
| 16116 | + * Enable sorting for this element, and generate sortable instance for it unless already generated. | |
| 16117 | + */ | |
| 16118 | + activate: function activate() { | |
| 16119 | + if (!this.getChildViewContainer().sortable('instance')) { | |
| 16120 | + // Generate sortable instance for this element. Since fresh instances of sortable already allowing sorting, | |
| 16121 | + // we can return. | |
| 16122 | + this.applySortable(); | |
| 16123 | + return; | |
| 16124 | + } | |
| 16125 | + | |
| 16126 | + this.getChildViewContainer().sortable('enable'); | |
| 16127 | + }, | |
| 16128 | + _getSortableHelper: function _getSortableHelper(event, $item) { | |
| 16129 | + var model = this.view.collection.get({ | |
| 16130 | + cid: $item.data('model-cid') | |
| 16131 | + }); | |
| 16132 | + return '<div style="height: 84px; width: 125px;" class="elementor-sortable-helper elementor-sortable-helper-' + model.get('elType') + '"><div class="icon"><i class="' + model.getIcon() + '"></i></div><div class="elementor-element-title-wrapper"><div class="title">' + model.getTitle() + '</div></div></div>'; | |
| 16133 | + }, | |
| 16134 | + getChildViewContainer: function getChildViewContainer() { | |
| 16135 | + return this.view.getChildViewContainer(this.view); | |
| 16136 | + }, | |
| 16137 | + // The natural widget index in the column is wrong, since there are other elements | |
| 16138 | + // at the beginning of the column (background-overlay, element-overlay, resizeable-handle) | |
| 16139 | + getSortedElementNewIndex: function getSortedElementNewIndex($element) { | |
| 16140 | + var widgets = Object.values($element.parent().find('> .elementor-element')); | |
| 16141 | + return widgets.indexOf($element[0]); | |
| 16142 | + }, | |
| 16143 | + | |
| 16144 | + /** | |
| 16145 | + * Disable sorting of the element unless no sortable instance exists, in which case there is already no option to | |
| 16146 | + * sort. | |
| 16147 | + */ | |
| 16148 | + deactivate: function deactivate() { | |
| 16149 | + var childViewContainer = this.getChildViewContainer(); | |
| 16150 | + | |
| 16151 | + if (childViewContainer.sortable('instance')) { | |
| 16152 | + childViewContainer.sortable('disable'); | |
| 16153 | + } | |
| 16154 | + }, | |
| 16155 | + | |
| 16156 | + /** | |
| 16157 | + * Determine if the current instance of Sortable is swappable. | |
| 16158 | + * | |
| 16159 | + * @return {boolean} is swappable | |
| 16160 | + */ | |
| 16161 | + isSwappable: function isSwappable() { | |
| 16162 | + return !!this.view.getSortableOptions().swappable; | |
| 16163 | + }, | |
| 16164 | + startSort: function startSort(event, ui) { | |
| 16165 | + event.stopPropagation(); | |
| 16166 | + var container = elementor.getContainer(ui.item.attr('data-id')); | |
| 16167 | + elementor.channels.data.reply('dragging:model', container.model).reply('dragging:view', container.view).reply('dragging:parent:view', this.view).trigger('drag:start', container.model).trigger(container.model.get('elType') + ':drag:start'); | |
| 16168 | + }, | |
| 16169 | + // On sorting element | |
| 16170 | + updateSort: function updateSort(ui, newIndex) { | |
| 16171 | + if (undefined === newIndex) { | |
| 16172 | + newIndex = ui.item.index(); | |
| 16173 | + } | |
| 16174 | + | |
| 16175 | + var child = elementor.channels.data.request('dragging:view').getContainer(); | |
| 16176 | + this.moveChild(child, newIndex); | |
| 16177 | + }, | |
| 16178 | + // On receiving element from another container | |
| 16179 | + receiveSort: function receiveSort(event, ui, newIndex) { | |
| 16180 | + event.stopPropagation(); | |
| 16181 | + | |
| 16182 | + if (this.view.isCollectionFilled()) { | |
| 16183 | + jQuery(ui.sender).sortable('cancel'); | |
| 16184 | + return; | |
| 16185 | + } | |
| 16186 | + | |
| 16187 | + var model = elementor.channels.data.request('dragging:model'), | |
| 16188 | + draggedElType = model.get('elType'), | |
| 16189 | + draggedIsInnerSection = 'section' === draggedElType && model.get('isInner'), | |
| 16190 | + targetIsInnerColumn = 'column' === this.view.getElementType() && this.view.isInner(); | |
| 16191 | + | |
| 16192 | + if (draggedIsInnerSection && targetIsInnerColumn) { | |
| 16193 | + jQuery(ui.sender).sortable('cancel'); | |
| 16194 | + return; | |
| 16195 | + } | |
| 16196 | + | |
| 16197 | + if (undefined === newIndex) { | |
| 16198 | + newIndex = ui.item.index(); | |
| 16199 | + } | |
| 16200 | + | |
| 16201 | + var child = elementor.channels.data.request('dragging:view').getContainer(); | |
| 16202 | + this.moveChild(child, newIndex); | |
| 16203 | + }, | |
| 16204 | + onSortStart: function onSortStart(event, ui) { | |
| 16205 | + if ('column' === this.options.elChildType) { | |
| 16206 | + var uiData = ui.item.data('sortableItem'), | |
| 16207 | + uiItems = uiData.items, | |
| 16208 | + itemHeight = 0; | |
| 16209 | + uiItems.forEach(function (item) { | |
| 16210 | + if (item.item[0] === ui.item[0]) { | |
| 16211 | + itemHeight = item.height; | |
| 16212 | + return false; | |
| 16213 | + } | |
| 16214 | + }); | |
| 16215 | + ui.placeholder.height(itemHeight); | |
| 16216 | + } | |
| 16217 | + | |
| 16218 | + this.startSort(event, ui); | |
| 16219 | + }, | |
| 16220 | + onSortOver: function onSortOver(event) { | |
| 16221 | + event.stopPropagation(); | |
| 16222 | + var model = elementor.channels.data.request('dragging:model'); | |
| 16223 | + jQuery(event.target).addClass('elementor-draggable-over').attr({ | |
| 16224 | + 'data-dragged-element': model.get('elType'), | |
| 16225 | + 'data-dragged-is-inner': model.get('isInner') | |
| 16226 | + }); | |
| 16227 | + this.$el.addClass('elementor-dragging-on-child'); | |
| 16228 | + }, | |
| 16229 | + onSortOut: function onSortOut(event) { | |
| 16230 | + event.stopPropagation(); | |
| 16231 | + jQuery(event.target).removeClass('elementor-draggable-over').removeAttr('data-dragged-element data-dragged-is-inner'); | |
| 16232 | + this.$el.removeClass('elementor-dragging-on-child'); | |
| 16233 | + }, | |
| 16234 | + onSortReceive: function onSortReceive(event, ui) { | |
| 16235 | + this.receiveSort(event, ui, this.getSortedElementNewIndex(ui.item)); | |
| 16236 | + }, | |
| 16237 | + onSortUpdate: function onSortUpdate(event, ui) { | |
| 16238 | + event.stopPropagation(); | |
| 16239 | + | |
| 16240 | + if (this.getChildViewContainer()[0] !== ui.item.parent()[0]) { | |
| 16241 | + return; | |
| 16242 | + } | |
| 16243 | + | |
| 16244 | + this.updateSort(ui, this.getSortedElementNewIndex(ui.item)); | |
| 16245 | + }, | |
| 16246 | + onAddChild: function onAddChild(view) { | |
| 16247 | + view.$el.attr('data-model-cid', view.model.cid); | |
| 16248 | + }, | |
| 16249 | + | |
| 16250 | + /** | |
| 16251 | + * Move a child container to another position. | |
| 16252 | + * | |
| 16253 | + * @param {Container} child - The child container to move. | |
| 16254 | + * @param {number|string} index - New index. | |
| 16255 | + * | |
| 16256 | + * @return {void} | |
| 16257 | + */ | |
| 16258 | + moveChild: function moveChild(child, index) { | |
| 16259 | + $e.run('document/elements/move', { | |
| 16260 | + container: child, | |
| 16261 | + target: this.view.getContainer(), | |
| 16262 | + options: { | |
| 16263 | + at: index | |
| 16264 | + } | |
| 16265 | + }); | |
| 16266 | + } | |
| 16267 | +}); | |
| 16268 | +module.exports = SortableBehavior; | |
| 16269 | + | |
| 16270 | +/***/ }), | |
| 16271 | + | |
| 16272 | +/***/ "../assets/dev/js/editor/elements/views/behaviors/widget-resizeable.js": | |
| 16273 | +/*!*****************************************************************************!*\ | |
| 16274 | + !*** ../assets/dev/js/editor/elements/views/behaviors/widget-resizeable.js ***! | |
| 16275 | + \*****************************************************************************/ | |
| 16276 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 16277 | + | |
| 16278 | +"use strict"; | |
| 16279 | + | |
| 16280 | + | |
| 16281 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 16282 | + | |
| 16283 | +Object.defineProperty(exports, "__esModule", ({ | |
| 16284 | + value: true | |
| 16285 | +})); | |
| 16286 | +exports["default"] = void 0; | |
| 16287 | + | |
| 16288 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 16289 | + | |
| 16290 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 16291 | + | |
| 16292 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 16293 | + | |
| 16294 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 16295 | + | |
| 16296 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 16297 | + | |
| 16298 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 16299 | + | |
| 16300 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 16301 | + | |
| 16302 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 16303 | + | |
| 16304 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 16305 | + | |
| 16306 | +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); }; } | |
| 16307 | + | |
| 16308 | +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; } } | |
| 16309 | + | |
| 16310 | +var _default = /*#__PURE__*/function (_Marionette$Behavior) { | |
| 16311 | + (0, _inherits2.default)(_default, _Marionette$Behavior); | |
| 16312 | + | |
| 16313 | + var _super = _createSuper(_default); | |
| 16314 | + | |
| 16315 | + function _default() { | |
| 16316 | + (0, _classCallCheck2.default)(this, _default); | |
| 16317 | + return _super.apply(this, arguments); | |
| 16318 | + } | |
| 16319 | + | |
| 16320 | + (0, _createClass2.default)(_default, [{ | |
| 16321 | + key: "events", | |
| 16322 | + value: function events() { | |
| 16323 | + return { | |
| 16324 | + resizestart: 'onResizeStart', | |
| 16325 | + resizestop: 'onResizeStop', | |
| 16326 | + resize: 'onResize' | |
| 16327 | + }; | |
| 16328 | + } | |
| 16329 | + }, { | |
| 16330 | + key: "initialize", | |
| 16331 | + value: function initialize() { | |
| 16332 | + (0, _get2.default)((0, _getPrototypeOf2.default)(_default.prototype), "initialize", this).call(this); | |
| 16333 | + this.listenTo(elementor.channels.dataEditMode, 'switch', this.toggle); // Save this instance for external use eg: ( hooks ). | |
| 16334 | + | |
| 16335 | + this.view.options.resizeable = this; | |
| 16336 | + } | |
| 16337 | + /** | |
| 16338 | + * Get the resizable options object. | |
| 16339 | + * | |
| 16340 | + * @return {Object} options object | |
| 16341 | + */ | |
| 16342 | + | |
| 16343 | + }, { | |
| 16344 | + key: "getOptions", | |
| 16345 | + value: function getOptions() { | |
| 16346 | + // jQuery UI handles are using Cardinal Directions (n, e, s, w, etc.). | |
| 16347 | + var handles = 'e, w'; // If it's a container item, add resize handles only at the end of the element in order to prevent UI | |
| 16348 | + // glitches when resizing from start. | |
| 16349 | + | |
| 16350 | + if (this.isContainerItem()) { | |
| 16351 | + handles = elementorCommon.config.isRTL ? 'w' : 'e'; | |
| 16352 | + } | |
| 16353 | + | |
| 16354 | + return { | |
| 16355 | + handles: handles | |
| 16356 | + }; | |
| 16357 | + } | |
| 16358 | + }, { | |
| 16359 | + key: "activate", | |
| 16360 | + value: function activate() { | |
| 16361 | + this.$el.resizable(this.getOptions()); | |
| 16362 | + } | |
| 16363 | + }, { | |
| 16364 | + key: "deactivate", | |
| 16365 | + value: function deactivate() { | |
| 16366 | + if (!this.$el.resizable('instance')) { | |
| 16367 | + return; | |
| 16368 | + } | |
| 16369 | + | |
| 16370 | + this.$el.resizable('destroy'); | |
| 16371 | + } | |
| 16372 | + }, { | |
| 16373 | + key: "toggle", | |
| 16374 | + value: function toggle() { | |
| 16375 | + var editModel = this.view.getEditModel(), | |
| 16376 | + isAbsolute = editModel.getSetting('_position'), | |
| 16377 | + isInline = 'initial' === editModel.getSetting('_element_width'); | |
| 16378 | + this.deactivate(); | |
| 16379 | + | |
| 16380 | + if ((isAbsolute || isInline) && this.view.container.isDesignable() || this.isContainerItem()) { | |
| 16381 | + this.activate(); | |
| 16382 | + } | |
| 16383 | + } | |
| 16384 | + /** | |
| 16385 | + * Determine if the current element is a Container element. | |
| 16386 | + * | |
| 16387 | + * @return {boolean} is a container | |
| 16388 | + */ | |
| 16389 | + | |
| 16390 | + }, { | |
| 16391 | + key: "isContainer", | |
| 16392 | + value: function isContainer() { | |
| 16393 | + return 'container' === this.view.model.get('elType'); | |
| 16394 | + } | |
| 16395 | + /** | |
| 16396 | + * Determine if the current element is a flex container item. | |
| 16397 | + * | |
| 16398 | + * @return {boolean} is a container item | |
| 16399 | + */ | |
| 16400 | + | |
| 16401 | + }, { | |
| 16402 | + key: "isContainerItem", | |
| 16403 | + value: function isContainerItem() { | |
| 16404 | + var _this$view$getContain, _this$view$getContain2; | |
| 16405 | + | |
| 16406 | + return 'container' === ((_this$view$getContain = this.view.getContainer().parent) === null || _this$view$getContain === void 0 ? void 0 : (_this$view$getContain2 = _this$view$getContain.model) === null || _this$view$getContain2 === void 0 ? void 0 : _this$view$getContain2.get('elType')); | |
| 16407 | + } | |
| 16408 | + /** | |
| 16409 | + * Determine if the Container element is active. | |
| 16410 | + * | |
| 16411 | + * @return {boolean} is container active | |
| 16412 | + */ | |
| 16413 | + | |
| 16414 | + }, { | |
| 16415 | + key: "isContainerActive", | |
| 16416 | + value: function isContainerActive() { | |
| 16417 | + return !!elementorCommon.config.experimentalFeatures.container; | |
| 16418 | + } | |
| 16419 | + /** | |
| 16420 | + * Get the width control ID to change when resizing. | |
| 16421 | + * | |
| 16422 | + * @return {string} width key | |
| 16423 | + */ | |
| 16424 | + | |
| 16425 | + }, { | |
| 16426 | + key: "getWidthKey", | |
| 16427 | + value: function getWidthKey() { | |
| 16428 | + return this.isContainer() ? 'width' : '_element_custom_width'; | |
| 16429 | + } | |
| 16430 | + /** | |
| 16431 | + * Get a device-suffixed setting. | |
| 16432 | + * | |
| 16433 | + * @param {string} setting - Setting name. | |
| 16434 | + * | |
| 16435 | + * @return {string} device setting | |
| 16436 | + */ | |
| 16437 | + | |
| 16438 | + }, { | |
| 16439 | + key: "getDeviceSetting", | |
| 16440 | + value: function getDeviceSetting(setting) { | |
| 16441 | + var currentDeviceMode = elementorFrontend.getCurrentDeviceMode(), | |
| 16442 | + deviceSuffix = 'desktop' === currentDeviceMode ? '' : '_' + currentDeviceMode; | |
| 16443 | + return setting + deviceSuffix; | |
| 16444 | + } | |
| 16445 | + /** | |
| 16446 | + * Get a setting value from the current edited model. | |
| 16447 | + * | |
| 16448 | + * @param {string} setting - Setting name. | |
| 16449 | + * | |
| 16450 | + * @return {*} setting | |
| 16451 | + */ | |
| 16452 | + | |
| 16453 | + }, { | |
| 16454 | + key: "getSetting", | |
| 16455 | + value: function getSetting(setting) { | |
| 16456 | + var editModel = this.view.getEditModel(); | |
| 16457 | + return editModel.getSetting(setting); | |
| 16458 | + } | |
| 16459 | + }, { | |
| 16460 | + key: "onRender", | |
| 16461 | + value: function onRender() { | |
| 16462 | + var _this = this; | |
| 16463 | + | |
| 16464 | + _.defer(function () { | |
| 16465 | + return _this.toggle(); | |
| 16466 | + }); | |
| 16467 | + } | |
| 16468 | + }, { | |
| 16469 | + key: "onDestroy", | |
| 16470 | + value: function onDestroy() { | |
| 16471 | + this.deactivate(); | |
| 16472 | + } | |
| 16473 | + }, { | |
| 16474 | + key: "onResizeStart", | |
| 16475 | + value: function onResizeStart(event) { | |
| 16476 | + event.stopPropagation(); | |
| 16477 | + | |
| 16478 | + if (this.view.onResizeStart) { | |
| 16479 | + this.view.onResizeStart(event); | |
| 16480 | + } // Don't open edit mode when the item is a Container item ( for UX ). | |
| 16481 | + | |
| 16482 | + | |
| 16483 | + if (!this.isContainerItem()) { | |
| 16484 | + this.view.model.trigger('request:edit'); | |
| 16485 | + } | |
| 16486 | + } | |
| 16487 | + }, { | |
| 16488 | + key: "onResizeStop", | |
| 16489 | + value: function onResizeStop(event, ui) { | |
| 16490 | + var _objectSpread2, | |
| 16491 | + _this2 = this; | |
| 16492 | + | |
| 16493 | + event.stopPropagation(); | |
| 16494 | + | |
| 16495 | + if (this.view.onResizeStop) { | |
| 16496 | + this.view.onResizeStop(event, ui); | |
| 16497 | + } | |
| 16498 | + | |
| 16499 | + var elementWidthSettingKey = this.getDeviceSetting('_element_width'), | |
| 16500 | + widthSettingKey = this.getDeviceSetting(this.getWidthKey()); | |
| 16501 | + | |
| 16502 | + var _this$getSetting = this.getSetting(widthSettingKey), | |
| 16503 | + unit = _this$getSetting.unit, | |
| 16504 | + width = elementor.helpers.elementSizeToUnit(this.$el, ui.size.width, unit); | |
| 16505 | + | |
| 16506 | + var settingToChange = _objectSpread(_objectSpread(_objectSpread({}, this.isContainerActive() ? { | |
| 16507 | + _flex_size: 'none' | |
| 16508 | + } : {}), this.isContainer() ? { | |
| 16509 | + content_width: 'full' | |
| 16510 | + } : {}), {}, (_objectSpread2 = {}, (0, _defineProperty2.default)(_objectSpread2, elementWidthSettingKey, 'initial'), (0, _defineProperty2.default)(_objectSpread2, widthSettingKey, { | |
| 16511 | + unit: unit, | |
| 16512 | + size: width | |
| 16513 | + }), _objectSpread2)); | |
| 16514 | + | |
| 16515 | + $e.run('document/elements/settings', { | |
| 16516 | + container: this.view.container, | |
| 16517 | + settings: settingToChange, | |
| 16518 | + options: { | |
| 16519 | + external: true | |
| 16520 | + } | |
| 16521 | + }); // Defer to wait for the widget to re-render and prevent UI glitches. | |
| 16522 | + | |
| 16523 | + setTimeout(function () { | |
| 16524 | + _this2.$el.css({ | |
| 16525 | + width: '', | |
| 16526 | + height: '', | |
| 16527 | + left: '', | |
| 16528 | + 'flex-shrink': '', | |
| 16529 | + 'flex-grow': '', | |
| 16530 | + 'flex-basis': '' | |
| 16531 | + }); | |
| 16532 | + }); | |
| 16533 | + } | |
| 16534 | + }, { | |
| 16535 | + key: "onResize", | |
| 16536 | + value: function onResize(event, ui) { | |
| 16537 | + event.stopPropagation(); | |
| 16538 | + | |
| 16539 | + if (this.view.onResize) { | |
| 16540 | + this.view.onResize(event, ui); | |
| 16541 | + } | |
| 16542 | + | |
| 16543 | + if (!this.isContainerItem()) { | |
| 16544 | + return; | |
| 16545 | + } // Set grow & shrink to 0 in order to set a specific size and prevent UI glitches. | |
| 16546 | + | |
| 16547 | + | |
| 16548 | + this.$el.css({ | |
| 16549 | + left: '', | |
| 16550 | + right: '', | |
| 16551 | + 'flex-shrink': 0, | |
| 16552 | + 'flex-grow': 0 | |
| 16553 | + }); | |
| 16554 | + } | |
| 16555 | + }]); | |
| 16556 | + return _default; | |
| 16557 | +}(Marionette.Behavior); | |
| 16558 | + | |
| 16559 | +exports["default"] = _default; | |
| 16560 | + | |
| 16561 | +/***/ }), | |
| 16562 | + | |
| 16563 | +/***/ "../assets/dev/js/editor/elements/views/column-empty.js": | |
| 16564 | +/*!**************************************************************!*\ | |
| 16565 | + !*** ../assets/dev/js/editor/elements/views/column-empty.js ***! | |
| 16566 | + \**************************************************************/ | |
| 16567 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 16568 | + | |
| 16569 | +"use strict"; | |
| 16570 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 16571 | + | |
| 16572 | + | |
| 16573 | +module.exports = Marionette.ItemView.extend({ | |
| 16574 | + template: '#tmpl-elementor-empty-preview', | |
| 16575 | + className: 'elementor-empty-view', | |
| 16576 | + events: { | |
| 16577 | + click: 'onClickAdd' | |
| 16578 | + }, | |
| 16579 | + behaviors: function behaviors() { | |
| 16580 | + return { | |
| 16581 | + contextMenu: { | |
| 16582 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/context-menu */ "../assets/dev/js/editor/elements/views/behaviors/context-menu.js"), | |
| 16583 | + groups: this.getContextMenuGroups() | |
| 16584 | + } | |
| 16585 | + }; | |
| 16586 | + }, | |
| 16587 | + getContextMenuGroups: function getContextMenuGroups() { | |
| 16588 | + var _this = this; | |
| 16589 | + | |
| 16590 | + return [{ | |
| 16591 | + name: 'general', | |
| 16592 | + actions: [{ | |
| 16593 | + name: 'paste', | |
| 16594 | + title: __('Paste', 'elementor'), | |
| 16595 | + isEnabled: function isEnabled() { | |
| 16596 | + return $e.components.get('document/elements').utils.isPasteEnabled(_this._parent.getContainer()); | |
| 16597 | + }, | |
| 16598 | + callback: function callback() { | |
| 16599 | + return $e.run('document/ui/paste', { | |
| 16600 | + container: _this._parent.getContainer() | |
| 16601 | + }); | |
| 16602 | + } | |
| 16603 | + }] | |
| 16604 | + }]; | |
| 16605 | + }, | |
| 16606 | + onClickAdd: function onClickAdd() { | |
| 16607 | + $e.route('panel/elements/categories'); | |
| 16608 | + } | |
| 16609 | +}); | |
| 16610 | + | |
| 16611 | +/***/ }), | |
| 16612 | + | |
| 16613 | +/***/ "../assets/dev/js/editor/elements/views/column.js": | |
| 16614 | +/*!********************************************************!*\ | |
| 16615 | + !*** ../assets/dev/js/editor/elements/views/column.js ***! | |
| 16616 | + \********************************************************/ | |
| 16617 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 16618 | + | |
| 16619 | +"use strict"; | |
| 16620 | +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; | |
| 16621 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 16622 | + | |
| 16623 | + | |
| 16624 | +var _section = __webpack_require__(/*! elementor-elements/views/section */ "../assets/dev/js/editor/elements/views/section.js"); | |
| 16625 | + | |
| 16626 | +var BaseElementView = __webpack_require__(/*! elementor-elements/views/base */ "../assets/dev/js/editor/elements/views/base.js"), | |
| 16627 | + ColumnEmptyView = __webpack_require__(/*! elementor-elements/views/column-empty */ "../assets/dev/js/editor/elements/views/column-empty.js"), | |
| 16628 | + ColumnView; | |
| 16629 | + | |
| 16630 | +ColumnView = BaseElementView.extend({ | |
| 16631 | + template: Marionette.TemplateCache.get('#tmpl-elementor-column-content'), | |
| 16632 | + emptyView: ColumnEmptyView, | |
| 16633 | + childViewContainer: elementorCommon.config.experimentalFeatures.e_dom_optimization ? '> .elementor-widget-wrap' : '> .elementor-column-wrap > .elementor-widget-wrap', | |
| 16634 | + toggleEditTools: true, | |
| 16635 | + behaviors: function behaviors() { | |
| 16636 | + var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); | |
| 16637 | + | |
| 16638 | + _.extend(behaviors, { | |
| 16639 | + Sortable: { | |
| 16640 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"), | |
| 16641 | + elChildType: 'widget' | |
| 16642 | + }, | |
| 16643 | + Resizable: { | |
| 16644 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/column-resizable */ "../assets/dev/js/editor/elements/views/behaviors/column-resizable.js") | |
| 16645 | + } | |
| 16646 | + }); | |
| 16647 | + | |
| 16648 | + return elementor.hooks.applyFilters('elements/column/behaviors', behaviors, this); | |
| 16649 | + }, | |
| 16650 | + className: function className() { | |
| 16651 | + var classes = BaseElementView.prototype.className.apply(this, arguments), | |
| 16652 | + type = this.isInner() ? 'inner' : 'top'; | |
| 16653 | + return classes + ' elementor-column elementor-' + type + '-column'; | |
| 16654 | + }, | |
| 16655 | + tagName: function tagName() { | |
| 16656 | + return this.model.getSetting('html_tag') || 'div'; | |
| 16657 | + }, | |
| 16658 | + ui: function ui() { | |
| 16659 | + var ui = BaseElementView.prototype.ui.apply(this, arguments); | |
| 16660 | + ui.columnInner = elementorCommon.config.experimentalFeatures.e_dom_optimization ? '> .elementor-widget-wrap' : '> .elementor-column-wrap'; | |
| 16661 | + ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip'; | |
| 16662 | + return ui; | |
| 16663 | + }, | |
| 16664 | + getEditButtons: function getEditButtons() { | |
| 16665 | + var elementData = elementor.getElementData(this.model), | |
| 16666 | + editTools = {}; | |
| 16667 | + editTools.edit = { | |
| 16668 | + /* translators: %s: Element name. */ | |
| 16669 | + title: sprintf(__('Edit %s', 'elementor'), elementData.title), | |
| 16670 | + icon: 'column' | |
| 16671 | + }; | |
| 16672 | + | |
| 16673 | + if (elementor.getPreferences('edit_buttons')) { | |
| 16674 | + editTools.duplicate = { | |
| 16675 | + /* translators: %s: Element name. */ | |
| 16676 | + title: sprintf(__('Duplicate %s', 'elementor'), elementData.title), | |
| 16677 | + icon: 'clone' | |
| 16678 | + }; | |
| 16679 | + editTools.add = { | |
| 16680 | + /* translators: %s: Element name. */ | |
| 16681 | + title: sprintf(__('Add %s', 'elementor'), elementData.title), | |
| 16682 | + icon: 'plus' | |
| 16683 | + }; | |
| 16684 | + } | |
| 16685 | + | |
| 16686 | + return editTools; | |
| 16687 | + }, | |
| 16688 | + initialize: function initialize() { | |
| 16689 | + BaseElementView.prototype.initialize.apply(this, arguments); | |
| 16690 | + this.model.get('editSettings').set('defaultEditRoute', 'layout'); | |
| 16691 | + }, | |
| 16692 | + attachElContent: function attachElContent() { | |
| 16693 | + BaseElementView.prototype.attachElContent.apply(this, arguments); | |
| 16694 | + var $tooltip = jQuery('<div>', { | |
| 16695 | + class: 'elementor-column-percents-tooltip' | |
| 16696 | + }); | |
| 16697 | + this.$el.children('.elementor-element-overlay').append($tooltip); | |
| 16698 | + }, | |
| 16699 | + getContextMenuGroups: function getContextMenuGroups() { | |
| 16700 | + var self = this, | |
| 16701 | + groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), | |
| 16702 | + generalGroupIndex = groups.indexOf(_.findWhere(groups, { | |
| 16703 | + name: 'general' | |
| 16704 | + })); | |
| 16705 | + groups.splice(generalGroupIndex + 1, 0, { | |
| 16706 | + name: 'addNew', | |
| 16707 | + actions: [{ | |
| 16708 | + name: 'addNew', | |
| 16709 | + icon: 'eicon-plus', | |
| 16710 | + title: __('Add New Column', 'elementor'), | |
| 16711 | + callback: this.addNewColumn.bind(this), | |
| 16712 | + isEnabled: function isEnabled() { | |
| 16713 | + return self.model.collection.length < _section.DEFAULT_MAX_COLUMNS && !elementor.selection.isMultiple(); | |
| 16714 | + } | |
| 16715 | + }] | |
| 16716 | + }); | |
| 16717 | + return groups; | |
| 16718 | + }, | |
| 16719 | + isDroppingAllowed: function isDroppingAllowed() { | |
| 16720 | + // Don't allow dragging items to document which is not editable. | |
| 16721 | + if (!this.getContainer().isEditable()) { | |
| 16722 | + return false; | |
| 16723 | + } | |
| 16724 | + | |
| 16725 | + var elementView = elementor.channels.panelElements.request('element:selected'); | |
| 16726 | + | |
| 16727 | + if (!elementView) { | |
| 16728 | + return false; | |
| 16729 | + } | |
| 16730 | + | |
| 16731 | + var elType = elementView.model.get('elType'); | |
| 16732 | + | |
| 16733 | + if ('container' === elType) { | |
| 16734 | + return true; | |
| 16735 | + } | |
| 16736 | + | |
| 16737 | + if ('section' === elType) { | |
| 16738 | + return !this.isInner(); | |
| 16739 | + } | |
| 16740 | + | |
| 16741 | + return 'widget' === elType; | |
| 16742 | + }, | |
| 16743 | + getPercentsForDisplay: function getPercentsForDisplay() { | |
| 16744 | + var inlineSize = +this.model.getSetting('_inline_size') || this.getPercentSize(); | |
| 16745 | + return inlineSize.toFixed(1) + '%'; | |
| 16746 | + }, | |
| 16747 | + changeSizeUI: function changeSizeUI() { | |
| 16748 | + var self = this, | |
| 16749 | + columnSize = self.model.getSetting('_column_size'); | |
| 16750 | + self.$el.attr('data-col', columnSize); | |
| 16751 | + | |
| 16752 | + _.defer(function () { | |
| 16753 | + // Wait for the column size to be applied | |
| 16754 | + if (self.ui.percentsTooltip) { | |
| 16755 | + self.ui.percentsTooltip.text(self.getPercentsForDisplay()); | |
| 16756 | + } | |
| 16757 | + }); | |
| 16758 | + }, | |
| 16759 | + getPercentSize: function getPercentSize(size) { | |
| 16760 | + if (!size) { | |
| 16761 | + size = this.el.getBoundingClientRect().width; | |
| 16762 | + } | |
| 16763 | + | |
| 16764 | + return +(size / this.$el.parent().width() * 100).toFixed(3); | |
| 16765 | + }, | |
| 16766 | + getSortableOptions: function getSortableOptions() { | |
| 16767 | + return { | |
| 16768 | + connectWith: '.elementor-widget-wrap', | |
| 16769 | + items: '> .elementor-element' | |
| 16770 | + }; | |
| 16771 | + }, | |
| 16772 | + changeChildContainerClasses: function changeChildContainerClasses() { | |
| 16773 | + var emptyClass = 'elementor-element-empty', | |
| 16774 | + populatedClass = 'elementor-element-populated'; | |
| 16775 | + | |
| 16776 | + if (this.ui.columnInner) { | |
| 16777 | + if (this.collection.isEmpty()) { | |
| 16778 | + this.ui.columnInner.removeClass(populatedClass).addClass(emptyClass); | |
| 16779 | + } else { | |
| 16780 | + this.ui.columnInner.removeClass(emptyClass).addClass(populatedClass); | |
| 16781 | + } | |
| 16782 | + } | |
| 16783 | + }, | |
| 16784 | + addNewColumn: function addNewColumn() { | |
| 16785 | + $e.run('document/elements/create', { | |
| 16786 | + model: { | |
| 16787 | + elType: 'column' | |
| 16788 | + }, | |
| 16789 | + container: this.getContainer().parent, | |
| 16790 | + options: { | |
| 16791 | + at: this.$el.index() + 1 | |
| 16792 | + } | |
| 16793 | + }); | |
| 16794 | + }, | |
| 16795 | + onRender: function onRender() { | |
| 16796 | + var _this = this; | |
| 16797 | + | |
| 16798 | + var isDomOptimizationActive = elementorCommon.config.experimentalFeatures.e_dom_optimization, | |
| 16799 | + getDropIndex = function getDropIndex(side, event) { | |
| 16800 | + var newIndex = jQuery(event.currentTarget).index(); // Since 3.0.0, the `.elementor-background-overlay` element sit at the same level as widgets | |
| 16801 | + | |
| 16802 | + if ('bottom' === side && !isDomOptimizationActive) { | |
| 16803 | + newIndex++; | |
| 16804 | + } else if ('top' === side && isDomOptimizationActive) { | |
| 16805 | + newIndex--; | |
| 16806 | + } | |
| 16807 | + | |
| 16808 | + return newIndex; | |
| 16809 | + }; | |
| 16810 | + | |
| 16811 | + var itemsClasses = ''; | |
| 16812 | + | |
| 16813 | + if (isDomOptimizationActive) { | |
| 16814 | + itemsClasses = ' > .elementor-widget-wrap > .elementor-element, >.elementor-widget-wrap > .elementor-empty-view > .elementor-first-add'; | |
| 16815 | + } else { | |
| 16816 | + itemsClasses = ' > .elementor-column-wrap > .elementor-widget-wrap > .elementor-element, >.elementor-column-wrap > .elementor-widget-wrap > .elementor-empty-view > .elementor-first-add'; | |
| 16817 | + } | |
| 16818 | + | |
| 16819 | + BaseElementView.prototype.onRender.apply(this, arguments); | |
| 16820 | + this.changeChildContainerClasses(); | |
| 16821 | + this.changeSizeUI(); | |
| 16822 | + this.$el.html5Droppable({ | |
| 16823 | + items: itemsClasses, | |
| 16824 | + axis: ['vertical'], | |
| 16825 | + groups: ['elementor-element'], | |
| 16826 | + isDroppingAllowed: this.isDroppingAllowed.bind(this), | |
| 16827 | + currentElementClass: 'elementor-html5dnd-current-element', | |
| 16828 | + placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder', | |
| 16829 | + hasDraggingOnChildClass: 'elementor-dragging-on-child', | |
| 16830 | + onDropping: function onDropping(side, event) { | |
| 16831 | + // Triggering drag end manually, since it won't fired above iframe | |
| 16832 | + elementor.getPreviewView().onPanelElementDragEnd(); | |
| 16833 | + | |
| 16834 | + _this.onDrop(event, { | |
| 16835 | + side: side, | |
| 16836 | + at: getDropIndex(side, event) | |
| 16837 | + }); | |
| 16838 | + } | |
| 16839 | + }); | |
| 16840 | + }, | |
| 16841 | + onAddButtonClick: function onAddButtonClick(event) { | |
| 16842 | + event.stopPropagation(); | |
| 16843 | + this.addNewColumn(); | |
| 16844 | + } | |
| 16845 | +}); | |
| 16846 | +module.exports = ColumnView; | |
| 16847 | + | |
| 16848 | +/***/ }), | |
| 16849 | + | |
| 16850 | +/***/ "../assets/dev/js/editor/elements/views/container.js": | |
| 16851 | +/*!***********************************************************!*\ | |
| 16852 | + !*** ../assets/dev/js/editor/elements/views/container.js ***! | |
| 16853 | + \***********************************************************/ | |
| 16854 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 16855 | + | |
| 16856 | +"use strict"; | |
| 16857 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 16858 | +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; | |
| 16859 | + | |
| 16860 | + | |
| 16861 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 16862 | + | |
| 16863 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 16864 | + | |
| 16865 | +var _inline = _interopRequireDefault(__webpack_require__(/*! elementor-views/add-section/inline */ "../assets/dev/js/editor/views/add-section/inline.js")); | |
| 16866 | + | |
| 16867 | +var _widgetResizeable = _interopRequireDefault(__webpack_require__(/*! ./behaviors/widget-resizeable */ "../assets/dev/js/editor/elements/views/behaviors/widget-resizeable.js")); | |
| 16868 | + | |
| 16869 | +var _containerHelper = _interopRequireDefault(__webpack_require__(/*! elementor-editor-utils/container-helper */ "../assets/dev/js/editor/utils/container-helper.js")); | |
| 16870 | + | |
| 16871 | +// Most of the code has been copied from `section.js`. | |
| 16872 | +var BaseElementView = __webpack_require__(/*! elementor-elements/views/base */ "../assets/dev/js/editor/elements/views/base.js"), | |
| 16873 | + ColumnEmptyView = __webpack_require__(/*! elementor-elements/views/column-empty */ "../assets/dev/js/editor/elements/views/column-empty.js"); | |
| 16874 | + | |
| 16875 | +var ContainerView = BaseElementView.extend({ | |
| 16876 | + template: Marionette.TemplateCache.get('#tmpl-elementor-container-content'), | |
| 16877 | + emptyView: ColumnEmptyView, | |
| 16878 | + // Child view is empty in order to use the parent element. | |
| 16879 | + childViewContainer: '', | |
| 16880 | + className: function className() { | |
| 16881 | + return "".concat(BaseElementView.prototype.className.apply(this), " e-container"); | |
| 16882 | + }, | |
| 16883 | + tagName: function tagName() { | |
| 16884 | + return this.model.getSetting('html_tag') || 'div'; | |
| 16885 | + }, | |
| 16886 | + // TODO: Copied from `views/column.js`. | |
| 16887 | + ui: function ui() { | |
| 16888 | + var ui = BaseElementView.prototype.ui.apply(this, arguments); | |
| 16889 | + ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip'; | |
| 16890 | + return ui; | |
| 16891 | + }, | |
| 16892 | + getCurrentUiStates: function getCurrentUiStates() { | |
| 16893 | + var currentDirection = this.container.settings.get('flex_direction'); | |
| 16894 | + return { | |
| 16895 | + directionMode: currentDirection || _containerHelper.default.DIRECTION_DEFAULT | |
| 16896 | + }; | |
| 16897 | + }, | |
| 16898 | + behaviors: function behaviors() { | |
| 16899 | + var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); | |
| 16900 | + | |
| 16901 | + _.extend(behaviors, { | |
| 16902 | + // TODO: Remove. It's a temporary solution for the Navigator sortable. | |
| 16903 | + Sortable: { | |
| 16904 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"), | |
| 16905 | + elChildType: 'widget' | |
| 16906 | + }, | |
| 16907 | + Resizable: { | |
| 16908 | + behaviorClass: _widgetResizeable.default | |
| 16909 | + } | |
| 16910 | + }); | |
| 16911 | + | |
| 16912 | + return elementor.hooks.applyFilters('elements/container/behaviors', behaviors, this); | |
| 16913 | + }, | |
| 16914 | + initialize: function initialize() { | |
| 16915 | + BaseElementView.prototype.initialize.apply(this, arguments); | |
| 16916 | + this.model.get('editSettings').set('defaultEditRoute', 'layout'); | |
| 16917 | + }, | |
| 16918 | + | |
| 16919 | + /** | |
| 16920 | + * TODO: Remove. It's a temporary solution for the Navigator sortable. | |
| 16921 | + * | |
| 16922 | + * @return {{}} options | |
| 16923 | + */ | |
| 16924 | + getSortableOptions: function getSortableOptions() { | |
| 16925 | + // TODO: Temporary hack. | |
| 16926 | + return { | |
| 16927 | + preventInit: true | |
| 16928 | + }; | |
| 16929 | + }, | |
| 16930 | + | |
| 16931 | + /** | |
| 16932 | + * Get the Container nesting level recursively. | |
| 16933 | + * The farthest parent Container is level 0. | |
| 16934 | + * | |
| 16935 | + * @return {number} nesting level | |
| 16936 | + */ | |
| 16937 | + getNestingLevel: function getNestingLevel() { | |
| 16938 | + // Use the memoized value if present, to prevent too many calculations. | |
| 16939 | + if (this.nestingLevel) { | |
| 16940 | + return this.nestingLevel; | |
| 16941 | + } | |
| 16942 | + | |
| 16943 | + var parent = this.container.parent; // Start counting nesting level only from the closest Container parent. | |
| 16944 | + | |
| 16945 | + if ('container' !== parent.type) { | |
| 16946 | + return 0; | |
| 16947 | + } | |
| 16948 | + | |
| 16949 | + return parent.view.getNestingLevel() + 1; | |
| 16950 | + }, | |
| 16951 | + getDroppableAxis: function getDroppableAxis() { | |
| 16952 | + var _axisMap; | |
| 16953 | + | |
| 16954 | + var isColumnDefault = _containerHelper.default.DIRECTION_DEFAULT === _containerHelper.default.DIRECTION_COLUMN, | |
| 16955 | + currentDirection = this.getContainer().settings.get('flex_direction'); | |
| 16956 | + var axisMap = (_axisMap = {}, (0, _defineProperty2.default)(_axisMap, _containerHelper.default.DIRECTION_COLUMN, 'vertical'), (0, _defineProperty2.default)(_axisMap, _containerHelper.default.DIRECTION_COLUMN_REVERSED, 'vertical'), (0, _defineProperty2.default)(_axisMap, _containerHelper.default.DIRECTION_ROW, 'horizontal'), (0, _defineProperty2.default)(_axisMap, _containerHelper.default.DIRECTION_ROW_REVERSED, 'horizontal'), (0, _defineProperty2.default)(_axisMap, '', isColumnDefault ? 'vertical' : 'horizontal'), _axisMap); | |
| 16957 | + return axisMap[currentDirection]; | |
| 16958 | + }, | |
| 16959 | + getDroppableOptions: function getDroppableOptions() { | |
| 16960 | + var _this = this; | |
| 16961 | + | |
| 16962 | + return { | |
| 16963 | + axis: this.getDroppableAxis(), | |
| 16964 | + items: '> .elementor-element, > .elementor-empty-view .elementor-first-add', | |
| 16965 | + groups: ['elementor-element'], | |
| 16966 | + horizontalThreshold: 5, | |
| 16967 | + // TODO: Stop the magic. | |
| 16968 | + isDroppingAllowed: this.isDroppingAllowed.bind(this), | |
| 16969 | + currentElementClass: 'elementor-html5dnd-current-element', | |
| 16970 | + placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder', | |
| 16971 | + hasDraggingOnChildClass: 'e-dragging-over', | |
| 16972 | + getDropContainer: function getDropContainer() { | |
| 16973 | + return _this.getContainer(); | |
| 16974 | + }, | |
| 16975 | + onDropping: function onDropping(side, event) { | |
| 16976 | + event.stopPropagation(); // Triggering drag end manually, since it won't fired above iframe | |
| 16977 | + | |
| 16978 | + elementor.getPreviewView().onPanelElementDragEnd(); | |
| 16979 | + var draggedView = elementor.channels.editor.request('element:dragged'), | |
| 16980 | + draggingInSameParent = (draggedView === null || draggedView === void 0 ? void 0 : draggedView.parent) === _this; | |
| 16981 | + var $elements = jQuery(event.currentTarget.parentElement).find('> .elementor-element'); // Exclude the dragged element from the indexing calculations. | |
| 16982 | + | |
| 16983 | + if (draggingInSameParent) { | |
| 16984 | + $elements = $elements.not(draggedView.$el); | |
| 16985 | + } | |
| 16986 | + | |
| 16987 | + var widgetsArray = Object.values($elements); | |
| 16988 | + var newIndex = widgetsArray.indexOf(event.currentTarget); // Plus one in order to insert it after the current target element. | |
| 16989 | + | |
| 16990 | + if (['bottom', 'right'].includes(side)) { | |
| 16991 | + newIndex++; | |
| 16992 | + } // User is sorting inside a Container. | |
| 16993 | + | |
| 16994 | + | |
| 16995 | + if (draggedView) { | |
| 16996 | + // Reset the dragged element cache. | |
| 16997 | + elementor.channels.editor.reply('element:dragged', null); | |
| 16998 | + $e.run('document/elements/move', { | |
| 16999 | + container: draggedView.getContainer(), | |
| 17000 | + target: _this.getContainer(), | |
| 17001 | + options: { | |
| 17002 | + at: newIndex | |
| 17003 | + } | |
| 17004 | + }); | |
| 17005 | + return; | |
| 17006 | + } // User is dragging an element from the panel. | |
| 17007 | + | |
| 17008 | + | |
| 17009 | + _this.onDrop(event, { | |
| 17010 | + at: newIndex | |
| 17011 | + }); | |
| 17012 | + } | |
| 17013 | + }; | |
| 17014 | + }, | |
| 17015 | + | |
| 17016 | + /** | |
| 17017 | + * Save container as a template. | |
| 17018 | + * | |
| 17019 | + * @return {void} | |
| 17020 | + */ | |
| 17021 | + saveAsTemplate: function saveAsTemplate() { | |
| 17022 | + $e.route('library/save-template', { | |
| 17023 | + model: this.model | |
| 17024 | + }); | |
| 17025 | + }, | |
| 17026 | + | |
| 17027 | + /** | |
| 17028 | + * Add a `Save as Template` button to the context menu. | |
| 17029 | + * | |
| 17030 | + * @return {Object} groups | |
| 17031 | + * | |
| 17032 | + */ | |
| 17033 | + getContextMenuGroups: function getContextMenuGroups() { | |
| 17034 | + var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), | |
| 17035 | + transferGroupIndex = groups.indexOf(_.findWhere(groups, { | |
| 17036 | + name: 'clipboard' | |
| 17037 | + })); | |
| 17038 | + groups.splice(transferGroupIndex + 1, 0, { | |
| 17039 | + name: 'save', | |
| 17040 | + actions: [{ | |
| 17041 | + name: 'save', | |
| 17042 | + title: __('Save as Template', 'elementor'), | |
| 17043 | + callback: this.saveAsTemplate.bind(this) | |
| 17044 | + }] | |
| 17045 | + }); | |
| 17046 | + return groups; | |
| 17047 | + }, | |
| 17048 | + isDroppingAllowed: function isDroppingAllowed() { | |
| 17049 | + // Don't allow dragging items to document which is not editable. | |
| 17050 | + if (!this.getContainer().isEditable()) { | |
| 17051 | + return false; | |
| 17052 | + } | |
| 17053 | + | |
| 17054 | + var elementView = elementor.channels.panelElements.request('element:selected') || elementor.channels.editor.request('element:dragged'); | |
| 17055 | + | |
| 17056 | + if (!elementView) { | |
| 17057 | + return false; | |
| 17058 | + } | |
| 17059 | + | |
| 17060 | + return ['widget', 'container'].includes(elementView.model.get('elType')); | |
| 17061 | + }, | |
| 17062 | + | |
| 17063 | + /** | |
| 17064 | + * Determine if the current container is a nested container. | |
| 17065 | + * | |
| 17066 | + * @return {boolean} is a nested container | |
| 17067 | + */ | |
| 17068 | + isNested: function isNested() { | |
| 17069 | + return 'document' !== this.getContainer().parent.model.get('elType'); | |
| 17070 | + }, | |
| 17071 | + getEditButtons: function getEditButtons() { | |
| 17072 | + var elementData = elementor.getElementData(this.model), | |
| 17073 | + editTools = {}; | |
| 17074 | + editTools.add = { | |
| 17075 | + /* translators: %s: Element Name. */ | |
| 17076 | + title: sprintf(__('Add %s', 'elementor'), elementData.title), | |
| 17077 | + icon: 'plus' | |
| 17078 | + }; | |
| 17079 | + editTools.edit = { | |
| 17080 | + /* translators: %s: Element Name. */ | |
| 17081 | + title: sprintf(__('Edit %s', 'elementor'), elementData.title), | |
| 17082 | + icon: 'handle' | |
| 17083 | + }; | |
| 17084 | + | |
| 17085 | + if (elementor.getPreferences('edit_buttons')) { | |
| 17086 | + editTools.duplicate = { | |
| 17087 | + /* translators: %s: Element Name. */ | |
| 17088 | + title: sprintf(__('Duplicate %s', 'elementor'), elementData.title), | |
| 17089 | + icon: 'clone' | |
| 17090 | + }; | |
| 17091 | + } | |
| 17092 | + | |
| 17093 | + editTools.remove = { | |
| 17094 | + /* translators: %s: Element Name. */ | |
| 17095 | + title: sprintf(__('Delete %s', 'elementor'), elementData.title), | |
| 17096 | + icon: 'close' | |
| 17097 | + }; | |
| 17098 | + return editTools; | |
| 17099 | + }, | |
| 17100 | + | |
| 17101 | + /** | |
| 17102 | + * Toggle the `New Section` view when clicking the `add` button in the edit tools. | |
| 17103 | + * | |
| 17104 | + * @return {void} | |
| 17105 | + * | |
| 17106 | + */ | |
| 17107 | + onAddButtonClick: function onAddButtonClick() { | |
| 17108 | + if (this.addSectionView && !this.addSectionView.isDestroyed) { | |
| 17109 | + this.addSectionView.fadeToDeath(); | |
| 17110 | + return; | |
| 17111 | + } | |
| 17112 | + | |
| 17113 | + var addSectionView = new _inline.default({ | |
| 17114 | + at: this.model.collection.indexOf(this.model) | |
| 17115 | + }); | |
| 17116 | + addSectionView.render(); | |
| 17117 | + this.$el.before(addSectionView.$el); | |
| 17118 | + addSectionView.$el.hide(); // Delaying the slide down for slow-render browsers (such as FF) | |
| 17119 | + | |
| 17120 | + setTimeout(function () { | |
| 17121 | + addSectionView.$el.slideDown(null, function () { | |
| 17122 | + // Remove inline style, for preview mode. | |
| 17123 | + jQuery(this).css('display', ''); | |
| 17124 | + }); | |
| 17125 | + }); | |
| 17126 | + this.addSectionView = addSectionView; | |
| 17127 | + }, | |
| 17128 | + onRender: function onRender() { | |
| 17129 | + var _this2 = this; | |
| 17130 | + | |
| 17131 | + BaseElementView.prototype.onRender.apply(this, arguments); // Defer to wait for everything to render. | |
| 17132 | + | |
| 17133 | + setTimeout(function () { | |
| 17134 | + _this2.nestingLevel = _this2.getNestingLevel(); | |
| 17135 | + _this2.$el[0].dataset.nestingLevel = _this2.nestingLevel; | |
| 17136 | + | |
| 17137 | + _this2.$el.html5Droppable(_this2.getDroppableOptions()); | |
| 17138 | + }); | |
| 17139 | + }, | |
| 17140 | + renderOnChange: function renderOnChange(settings) { | |
| 17141 | + BaseElementView.prototype.renderOnChange.apply(this, arguments); // Re-initialize the droppable in order to make sure the axis works properly. | |
| 17142 | + | |
| 17143 | + if (!!settings.changed.flex_direction) { | |
| 17144 | + this.$el.html5Droppable('destroy'); | |
| 17145 | + this.$el.html5Droppable(this.getDroppableOptions()); | |
| 17146 | + } | |
| 17147 | + }, | |
| 17148 | + onDragStart: function onDragStart() { | |
| 17149 | + this.$el.html5Droppable('destroy'); | |
| 17150 | + }, | |
| 17151 | + onDragEnd: function onDragEnd() { | |
| 17152 | + this.$el.html5Droppable(this.getDroppableOptions()); | |
| 17153 | + }, | |
| 17154 | + // TODO: Copied from `views/column.js`. | |
| 17155 | + attachElContent: function attachElContent() { | |
| 17156 | + BaseElementView.prototype.attachElContent.apply(this, arguments); | |
| 17157 | + var $tooltip = jQuery('<div>', { | |
| 17158 | + class: 'elementor-column-percents-tooltip', | |
| 17159 | + 'data-side': elementorCommon.config.isRTL ? 'right' : 'left' | |
| 17160 | + }); | |
| 17161 | + this.$el.children('.elementor-element-overlay').append($tooltip); | |
| 17162 | + }, | |
| 17163 | + // TODO: Copied from `views/column.js`. | |
| 17164 | + getPercentSize: function getPercentSize(size) { | |
| 17165 | + if (!size) { | |
| 17166 | + size = this.el.getBoundingClientRect().width; | |
| 17167 | + } | |
| 17168 | + | |
| 17169 | + return +(size / this.$el.parent().width() * 100).toFixed(3); | |
| 17170 | + }, | |
| 17171 | + // TODO: Copied from `views/column.js`. | |
| 17172 | + getPercentsForDisplay: function getPercentsForDisplay() { | |
| 17173 | + var width = +this.model.getSetting('width') || this.getPercentSize(); | |
| 17174 | + return width.toFixed(1) + '%'; | |
| 17175 | + }, | |
| 17176 | + onResizeStart: function onResizeStart() { | |
| 17177 | + if (this.ui.percentsTooltip) { | |
| 17178 | + this.ui.percentsTooltip.show(); | |
| 17179 | + } | |
| 17180 | + }, | |
| 17181 | + onResize: function onResize() { | |
| 17182 | + // TODO: Copied from `views/column.js`. | |
| 17183 | + if (this.ui.percentsTooltip) { | |
| 17184 | + this.ui.percentsTooltip.text(this.getPercentsForDisplay()); | |
| 17185 | + } | |
| 17186 | + }, | |
| 17187 | + onResizeStop: function onResizeStop() { | |
| 17188 | + if (this.ui.percentsTooltip) { | |
| 17189 | + this.ui.percentsTooltip.hide(); | |
| 17190 | + } | |
| 17191 | + } | |
| 17192 | +}); | |
| 17193 | +module.exports = ContainerView; | |
| 17194 | + | |
| 17195 | +/***/ }), | |
| 17196 | + | |
| 17197 | +/***/ "../assets/dev/js/editor/elements/views/section.js": | |
| 17198 | +/*!*********************************************************!*\ | |
| 17199 | + !*** ../assets/dev/js/editor/elements/views/section.js ***! | |
| 17200 | + \*********************************************************/ | |
| 17201 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 17202 | + | |
| 17203 | +"use strict"; | |
| 17204 | +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; | |
| 17205 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 17206 | + | |
| 17207 | + | |
| 17208 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 17209 | + | |
| 17210 | +var _inline = _interopRequireDefault(__webpack_require__(/*! ../../views/add-section/inline */ "../assets/dev/js/editor/views/add-section/inline.js")); | |
| 17211 | + | |
| 17212 | +var BaseElementView = __webpack_require__(/*! elementor-elements/views/base */ "../assets/dev/js/editor/elements/views/base.js"); | |
| 17213 | + | |
| 17214 | +var DEFAULT_INNER_SECTION_COLUMNS = 2, | |
| 17215 | + DEFAULT_MIN_COLUMN_SIZE = 2, | |
| 17216 | + DEFAULT_MAX_COLUMNS = 10; | |
| 17217 | +var SectionView = BaseElementView.extend({ | |
| 17218 | + childViewContainer: function childViewContainer() { | |
| 17219 | + var containerSelector = '> .elementor-container'; | |
| 17220 | + | |
| 17221 | + if (!elementorCommon.config.experimentalFeatures.e_dom_optimization) { | |
| 17222 | + containerSelector += ' > .elementor-row'; | |
| 17223 | + } | |
| 17224 | + | |
| 17225 | + return containerSelector; | |
| 17226 | + }, | |
| 17227 | + template: Marionette.TemplateCache.get('#tmpl-elementor-section-content'), | |
| 17228 | + addSectionView: null, | |
| 17229 | + _checkIsFull: function _checkIsFull() { | |
| 17230 | + this.toggleSectionIsFull(); | |
| 17231 | + elementorCommon.helpers.softDeprecated('_checkIsFull', '2.9.0', 'toggleSectionIsFull()'); | |
| 17232 | + }, | |
| 17233 | + toggleSectionIsFull: function toggleSectionIsFull() { | |
| 17234 | + this.$el.toggleClass('elementor-section-filled', this.isCollectionFilled()); | |
| 17235 | + }, | |
| 17236 | + addChildModel: function addChildModel(model) { | |
| 17237 | + /// TODO: maybe should be part of $e.hooks. | |
| 17238 | + var isModelInstance = model instanceof Backbone.Model, | |
| 17239 | + isInner = this.isInner(); | |
| 17240 | + | |
| 17241 | + if (isModelInstance) { | |
| 17242 | + // TODO: change to command. | |
| 17243 | + model.set('isInner', isInner); | |
| 17244 | + } else { | |
| 17245 | + model.isInner = isInner; | |
| 17246 | + } | |
| 17247 | + | |
| 17248 | + return BaseElementView.prototype.addChildModel.apply(this, arguments); | |
| 17249 | + }, | |
| 17250 | + className: function className() { | |
| 17251 | + var classes = BaseElementView.prototype.className.apply(this, arguments), | |
| 17252 | + type = this.isInner() ? 'inner' : 'top'; | |
| 17253 | + return classes + ' elementor-section elementor-' + type + '-section'; | |
| 17254 | + }, | |
| 17255 | + tagName: function tagName() { | |
| 17256 | + return this.model.getSetting('html_tag') || 'section'; | |
| 17257 | + }, | |
| 17258 | + behaviors: function behaviors() { | |
| 17259 | + var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); | |
| 17260 | + | |
| 17261 | + _.extend(behaviors, { | |
| 17262 | + Sortable: { | |
| 17263 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"), | |
| 17264 | + elChildType: 'column' | |
| 17265 | + } | |
| 17266 | + }); | |
| 17267 | + | |
| 17268 | + return elementor.hooks.applyFilters('elements/section/behaviors', behaviors, this); | |
| 17269 | + }, | |
| 17270 | + initialize: function initialize() { | |
| 17271 | + BaseElementView.prototype.initialize.apply(this, arguments); | |
| 17272 | + this.model.get('editSettings').set('defaultEditRoute', 'layout'); | |
| 17273 | + }, | |
| 17274 | + getEditButtons: function getEditButtons() { | |
| 17275 | + var elementData = elementor.getElementData(this.model), | |
| 17276 | + editTools = {}; | |
| 17277 | + | |
| 17278 | + if (!this.isInner()) { | |
| 17279 | + editTools.add = { | |
| 17280 | + /* translators: %s: Element name. */ | |
| 17281 | + title: sprintf(__('Add %s', 'elementor'), elementData.title), | |
| 17282 | + icon: 'plus' | |
| 17283 | + }; | |
| 17284 | + } | |
| 17285 | + | |
| 17286 | + editTools.edit = { | |
| 17287 | + /* translators: %s: Element name. */ | |
| 17288 | + title: sprintf(__('Edit %s', 'elementor'), elementData.title), | |
| 17289 | + icon: 'handle' | |
| 17290 | + }; | |
| 17291 | + | |
| 17292 | + if (elementor.getPreferences('edit_buttons')) { | |
| 17293 | + editTools.duplicate = { | |
| 17294 | + /* translators: %s: Element name. */ | |
| 17295 | + title: sprintf(__('Duplicate %s', 'elementor'), elementData.title), | |
| 17296 | + icon: 'clone' | |
| 17297 | + }; | |
| 17298 | + } | |
| 17299 | + | |
| 17300 | + return editTools; | |
| 17301 | + }, | |
| 17302 | + getContextMenuGroups: function getContextMenuGroups() { | |
| 17303 | + var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), | |
| 17304 | + transferGroupIndex = groups.indexOf(_.findWhere(groups, { | |
| 17305 | + name: 'clipboard' | |
| 17306 | + })); | |
| 17307 | + groups.splice(transferGroupIndex + 1, 0, { | |
| 17308 | + name: 'save', | |
| 17309 | + actions: [{ | |
| 17310 | + name: 'save', | |
| 17311 | + title: __('Save as Template', 'elementor'), | |
| 17312 | + isEnabled: function isEnabled() { | |
| 17313 | + return !elementor.selection.isMultiple(); | |
| 17314 | + }, | |
| 17315 | + callback: this.save.bind(this) | |
| 17316 | + }] | |
| 17317 | + }); | |
| 17318 | + return groups; | |
| 17319 | + }, | |
| 17320 | + getSortableOptions: function getSortableOptions() { | |
| 17321 | + var sectionConnectClass = this.isInner() ? '.elementor-inner-section' : '.elementor-top-section'; | |
| 17322 | + return { | |
| 17323 | + connectWith: sectionConnectClass + this.childViewContainer(), | |
| 17324 | + handle: '> .elementor-element-overlay .elementor-editor-element-edit', | |
| 17325 | + items: '> .elementor-column', | |
| 17326 | + forcePlaceholderSize: true, | |
| 17327 | + tolerance: 'pointer' | |
| 17328 | + }; | |
| 17329 | + }, | |
| 17330 | + getColumnPercentSize: function getColumnPercentSize(element, size) { | |
| 17331 | + return +(size / element.parent().width() * 100).toFixed(3); | |
| 17332 | + }, | |
| 17333 | + getDefaultStructure: function getDefaultStructure() { | |
| 17334 | + return this.collection.length + '0'; | |
| 17335 | + }, | |
| 17336 | + getStructure: function getStructure() { | |
| 17337 | + return this.model.getSetting('structure'); | |
| 17338 | + }, | |
| 17339 | + getColumnAt: function getColumnAt(index) { | |
| 17340 | + var model = this.collection.at(index); | |
| 17341 | + return model ? this.children.findByModelCid(model.cid) : null; | |
| 17342 | + }, | |
| 17343 | + getNextColumn: function getNextColumn(columnView) { | |
| 17344 | + return this.getColumnAt(this.collection.indexOf(columnView.model) + 1); | |
| 17345 | + }, | |
| 17346 | + getPreviousColumn: function getPreviousColumn(columnView) { | |
| 17347 | + return this.getColumnAt(this.collection.indexOf(columnView.model) - 1); | |
| 17348 | + }, | |
| 17349 | + getNeighborContainer: function getNeighborContainer(container) { | |
| 17350 | + var parentView = container.parent.view, | |
| 17351 | + nextView = parentView.getNextColumn(container.view) || parentView.getPreviousColumn(container.view); | |
| 17352 | + | |
| 17353 | + if (!nextView) { | |
| 17354 | + return false; | |
| 17355 | + } | |
| 17356 | + | |
| 17357 | + return nextView.getContainer(); | |
| 17358 | + }, | |
| 17359 | + setStructure: function setStructure(structure) { | |
| 17360 | + var shouldAdjustColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | |
| 17361 | + var parsedStructure = elementor.presetsFactory.getParsedStructure(structure); | |
| 17362 | + | |
| 17363 | + if (+parsedStructure.columnsCount !== this.collection.length) { | |
| 17364 | + throw new TypeError('The provided structure doesn\'t match the columns count.'); | |
| 17365 | + } | |
| 17366 | + | |
| 17367 | + $e.run('document/elements/settings', { | |
| 17368 | + container: this.getContainer(), | |
| 17369 | + settings: { | |
| 17370 | + structure: structure | |
| 17371 | + }, | |
| 17372 | + options: { | |
| 17373 | + external: true | |
| 17374 | + } | |
| 17375 | + }); | |
| 17376 | + | |
| 17377 | + if (shouldAdjustColumns) { | |
| 17378 | + this.adjustColumns(); | |
| 17379 | + } | |
| 17380 | + }, | |
| 17381 | + adjustColumns: function adjustColumns() { | |
| 17382 | + var preset = elementor.presetsFactory.getPresetByStructure(this.getStructure()); | |
| 17383 | + this.children.each(function (columnView, index) { | |
| 17384 | + var container = columnView.getContainer(); | |
| 17385 | + $e.run('document/elements/settings', { | |
| 17386 | + container: container, | |
| 17387 | + settings: { | |
| 17388 | + _column_size: preset.preset[index], | |
| 17389 | + _inline_size: null | |
| 17390 | + } | |
| 17391 | + }); | |
| 17392 | + }); | |
| 17393 | + }, | |
| 17394 | + resetLayout: function resetLayout() { | |
| 17395 | + var shouldAdjustColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; | |
| 17396 | + this.setStructure(this.getDefaultStructure(), shouldAdjustColumns); | |
| 17397 | + }, | |
| 17398 | + resetColumnsCustomSize: function resetColumnsCustomSize() { | |
| 17399 | + this.children.each(function (columnView) { | |
| 17400 | + $e.run('document/elements/settings', { | |
| 17401 | + container: columnView.getContainer(), | |
| 17402 | + settings: { | |
| 17403 | + _inline_size: null | |
| 17404 | + }, | |
| 17405 | + options: { | |
| 17406 | + external: true | |
| 17407 | + } | |
| 17408 | + }); | |
| 17409 | + }); | |
| 17410 | + }, | |
| 17411 | + isCollectionFilled: function isCollectionFilled() { | |
| 17412 | + return DEFAULT_MAX_COLUMNS <= this.collection.length; | |
| 17413 | + }, | |
| 17414 | + showChildrenPercentsTooltip: function showChildrenPercentsTooltip(columnView, nextColumnView) { | |
| 17415 | + columnView.ui.percentsTooltip.show(); | |
| 17416 | + columnView.ui.percentsTooltip.attr('data-side', elementorCommon.config.isRTL ? 'right' : 'left'); | |
| 17417 | + nextColumnView.ui.percentsTooltip.show(); | |
| 17418 | + nextColumnView.ui.percentsTooltip.attr('data-side', elementorCommon.config.isRTL ? 'left' : 'right'); | |
| 17419 | + }, | |
| 17420 | + hideChildrenPercentsTooltip: function hideChildrenPercentsTooltip(columnView, nextColumnView) { | |
| 17421 | + columnView.ui.percentsTooltip.hide(); | |
| 17422 | + nextColumnView.ui.percentsTooltip.hide(); | |
| 17423 | + }, | |
| 17424 | + destroyAddSectionView: function destroyAddSectionView() { | |
| 17425 | + if (this.addSectionView && !this.addSectionView.isDestroyed) { | |
| 17426 | + this.addSectionView.destroy(); | |
| 17427 | + } | |
| 17428 | + }, | |
| 17429 | + onRender: function onRender() { | |
| 17430 | + BaseElementView.prototype.onRender.apply(this, arguments); | |
| 17431 | + this.toggleSectionIsFull(); | |
| 17432 | + }, | |
| 17433 | + onAddButtonClick: function onAddButtonClick() { | |
| 17434 | + if (this.addSectionView && !this.addSectionView.isDestroyed) { | |
| 17435 | + this.addSectionView.fadeToDeath(); | |
| 17436 | + return; | |
| 17437 | + } | |
| 17438 | + | |
| 17439 | + var addSectionView = new _inline.default({ | |
| 17440 | + at: this.model.collection.indexOf(this.model) | |
| 17441 | + }); | |
| 17442 | + addSectionView.render(); | |
| 17443 | + this.$el.before(addSectionView.$el); | |
| 17444 | + addSectionView.$el.hide(); // Delaying the slide down for slow-render browsers (such as FF) | |
| 17445 | + | |
| 17446 | + setTimeout(function () { | |
| 17447 | + addSectionView.$el.slideDown(null, function () { | |
| 17448 | + // Remove inline style, for preview mode. | |
| 17449 | + jQuery(this).css('display', ''); | |
| 17450 | + }); | |
| 17451 | + }); | |
| 17452 | + this.addSectionView = addSectionView; | |
| 17453 | + }, | |
| 17454 | + onChildviewRequestResizeStart: function onChildviewRequestResizeStart(columnView) { | |
| 17455 | + var nextColumnView = this.getNextColumn(columnView); | |
| 17456 | + | |
| 17457 | + if (!nextColumnView) { | |
| 17458 | + return; | |
| 17459 | + } | |
| 17460 | + | |
| 17461 | + this.showChildrenPercentsTooltip(columnView, nextColumnView); | |
| 17462 | + var $iframes = columnView.$el.find('iframe').add(nextColumnView.$el.find('iframe')); | |
| 17463 | + elementor.helpers.disableElementEvents($iframes); | |
| 17464 | + }, | |
| 17465 | + onChildviewRequestResizeStop: function onChildviewRequestResizeStop(columnView) { | |
| 17466 | + var nextColumnView = this.getNextColumn(columnView); | |
| 17467 | + | |
| 17468 | + if (!nextColumnView) { | |
| 17469 | + return; | |
| 17470 | + } | |
| 17471 | + | |
| 17472 | + this.hideChildrenPercentsTooltip(columnView, nextColumnView); | |
| 17473 | + var $iframes = columnView.$el.find('iframe').add(nextColumnView.$el.find('iframe')); | |
| 17474 | + elementor.helpers.enableElementEvents($iframes); | |
| 17475 | + }, | |
| 17476 | + onChildviewRequestResize: function onChildviewRequestResize(columnView, ui) { | |
| 17477 | + ui.element.css({ | |
| 17478 | + width: '', | |
| 17479 | + left: 'initial' // Fix for RTL resizing | |
| 17480 | + | |
| 17481 | + }); | |
| 17482 | + $e.run('document/elements/settings', { | |
| 17483 | + container: columnView.getContainer(), | |
| 17484 | + settings: { | |
| 17485 | + _inline_size: this.getColumnPercentSize(ui.element, ui.size.width) | |
| 17486 | + } | |
| 17487 | + }); | |
| 17488 | + }, | |
| 17489 | + onDestroy: function onDestroy() { | |
| 17490 | + BaseElementView.prototype.onDestroy.apply(this, arguments); | |
| 17491 | + this.destroyAddSectionView(); | |
| 17492 | + } | |
| 17493 | +}); | |
| 17494 | +module.exports = SectionView; | |
| 17495 | +module.exports.DEFAULT_INNER_SECTION_COLUMNS = DEFAULT_INNER_SECTION_COLUMNS; | |
| 17496 | +module.exports.DEFAULT_MIN_COLUMN_SIZE = DEFAULT_MIN_COLUMN_SIZE; | |
| 17497 | +module.exports.DEFAULT_MAX_COLUMNS = DEFAULT_MAX_COLUMNS; | |
| 17498 | + | |
| 17499 | +/***/ }), | |
| 17500 | + | |
| 17501 | +/***/ "../assets/dev/js/editor/utils/container-helper.js": | |
| 17502 | +/*!*********************************************************!*\ | |
| 17503 | + !*** ../assets/dev/js/editor/utils/container-helper.js ***! | |
| 17504 | + \*********************************************************/ | |
| 17505 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 17506 | + | |
| 17507 | +"use strict"; | |
| 17508 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 17509 | + | |
| 17510 | + | |
| 17511 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 17512 | + | |
| 17513 | +Object.defineProperty(exports, "__esModule", ({ | |
| 17514 | + value: true | |
| 17515 | +})); | |
| 17516 | +exports["default"] = exports.ContainerHelper = void 0; | |
| 17517 | + | |
| 17518 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 17519 | + | |
| 17520 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 17521 | + | |
| 17522 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 17523 | + | |
| 17524 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 17525 | + | |
| 17526 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 17527 | + | |
| 17528 | +/** | |
| 17529 | + * @typedef {import('../container/container')} Container | |
| 17530 | + */ | |
| 17531 | + | |
| 17532 | +/** | |
| 17533 | + * Container element helper functions. | |
| 17534 | + */ | |
| 17535 | +var ContainerHelper = /*#__PURE__*/function () { | |
| 17536 | + function ContainerHelper() { | |
| 17537 | + (0, _classCallCheck2.default)(this, ContainerHelper); | |
| 17538 | + } | |
| 17539 | + | |
| 17540 | + (0, _createClass2.default)(ContainerHelper, null, [{ | |
| 17541 | + key: "createContainers", | |
| 17542 | + value: // Flex directions. | |
| 17543 | + | |
| 17544 | + /** | |
| 17545 | + * Create multiple container elements. | |
| 17546 | + * | |
| 17547 | + * @param {number} count - Count of Containers to create. | |
| 17548 | + * @param {Object} settings - Settings to set to each Container. | |
| 17549 | + * @param {Container} target - The Container object to create the new Container elements inside. | |
| 17550 | + * @param {Object} options - Additional command options. | |
| 17551 | + * | |
| 17552 | + * @return {Container[]} - Array of the newly created Containers. | |
| 17553 | + */ | |
| 17554 | + function createContainers(count, settings) { | |
| 17555 | + var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 17556 | + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | |
| 17557 | + var containers = []; | |
| 17558 | + | |
| 17559 | + for (var i = 0; i < count; i++) { | |
| 17560 | + containers.push(this.createContainer(settings, target, options)); | |
| 17561 | + } | |
| 17562 | + | |
| 17563 | + return containers; | |
| 17564 | + } | |
| 17565 | + /** | |
| 17566 | + * Create a Container element. | |
| 17567 | + * | |
| 17568 | + * @param {Object} settings - Settings to set to each Container. | |
| 17569 | + * @param {Container} target - The Container object to create the new Container elements inside. | |
| 17570 | + * @param {Object} options - Additional command options. | |
| 17571 | + * | |
| 17572 | + * @return {Container} - The newly created Container. | |
| 17573 | + */ | |
| 17574 | + | |
| 17575 | + }, { | |
| 17576 | + key: "createContainer", | |
| 17577 | + value: function createContainer() { | |
| 17578 | + var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 17579 | + var target = arguments.length > 1 ? arguments[1] : undefined; | |
| 17580 | + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 17581 | + return $e.run('document/elements/create', { | |
| 17582 | + container: target, | |
| 17583 | + model: { | |
| 17584 | + elType: 'container', | |
| 17585 | + settings: settings | |
| 17586 | + }, | |
| 17587 | + options: options | |
| 17588 | + }); | |
| 17589 | + } | |
| 17590 | + /** | |
| 17591 | + * Change Container settings. | |
| 17592 | + * | |
| 17593 | + * @param {Object} settings - New settings. | |
| 17594 | + * @param {Container} container - Container to set the settings to. | |
| 17595 | + * | |
| 17596 | + * @return {void} | |
| 17597 | + */ | |
| 17598 | + | |
| 17599 | + }, { | |
| 17600 | + key: "setContainerSettings", | |
| 17601 | + value: function setContainerSettings(settings, container) { | |
| 17602 | + $e.run('document/elements/settings', { | |
| 17603 | + container: container, | |
| 17604 | + settings: settings, | |
| 17605 | + options: { | |
| 17606 | + external: true | |
| 17607 | + } | |
| 17608 | + }); | |
| 17609 | + } | |
| 17610 | + /** | |
| 17611 | + * Create a Container element based on a sizes. | |
| 17612 | + * | |
| 17613 | + * @param {Array} sizes - Preset sizes. | |
| 17614 | + * @param {Container} target - The target of new created element. | |
| 17615 | + * @param {Object} options - Additional command options. | |
| 17616 | + * @param {boolean} [options.createWrapper=true] - Create a wrapper container for the preset. | |
| 17617 | + * | |
| 17618 | + * @return {Container} - Container created on. | |
| 17619 | + */ | |
| 17620 | + | |
| 17621 | + }, { | |
| 17622 | + key: "createContainerFromSizes", | |
| 17623 | + value: function createContainerFromSizes(sizes, target) { | |
| 17624 | + var _this = this; | |
| 17625 | + | |
| 17626 | + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 17627 | + | |
| 17628 | + var _options$createWrappe = options.createWrapper, | |
| 17629 | + createWrapper = _options$createWrappe === void 0 ? true : _options$createWrappe, | |
| 17630 | + sizesMap = { | |
| 17631 | + 33: '33.3333', | |
| 17632 | + 66: '66.6666' | |
| 17633 | + }, | |
| 17634 | + sizesSum = sizes.reduce(function (sum, size) { | |
| 17635 | + return sum + parseInt(size); | |
| 17636 | + }, 0), | |
| 17637 | + shouldWrap = sizesSum > 100, | |
| 17638 | + settings = _objectSpread(_objectSpread({ | |
| 17639 | + flex_direction: this.DIRECTION_ROW | |
| 17640 | + }, shouldWrap ? { | |
| 17641 | + flex_wrap: 'wrap' | |
| 17642 | + } : {}), {}, { | |
| 17643 | + flex_gap: { | |
| 17644 | + unit: 'px', | |
| 17645 | + size: 0 // Set the gap to 0 to override the default inherited from `Site Settings`. | |
| 17646 | + | |
| 17647 | + } | |
| 17648 | + }); // Create a parent container to contain all of the sub containers. | |
| 17649 | + | |
| 17650 | + | |
| 17651 | + var parentContainer; // The `createWrapper` false option is used in nested-modules for creating containers from preset for custom target(s). | |
| 17652 | + | |
| 17653 | + if (!createWrapper) { | |
| 17654 | + $e.run('document/elements/settings', { | |
| 17655 | + container: target, | |
| 17656 | + settings: settings | |
| 17657 | + }); | |
| 17658 | + parentContainer = target; | |
| 17659 | + } else { | |
| 17660 | + parentContainer = this.createContainer(settings, target, options); | |
| 17661 | + } // Create all sub containers using the sizes array. | |
| 17662 | + // Use flex basis to make the sizes explicit. | |
| 17663 | + | |
| 17664 | + | |
| 17665 | + sizes.forEach(function (size) { | |
| 17666 | + size = sizesMap[size] || size; | |
| 17667 | + | |
| 17668 | + _this.createContainer({ | |
| 17669 | + flex_direction: _this.DIRECTION_COLUMN, | |
| 17670 | + content_width: 'full', | |
| 17671 | + width: { | |
| 17672 | + unit: '%', | |
| 17673 | + size: size | |
| 17674 | + } | |
| 17675 | + }, parentContainer, { | |
| 17676 | + edit: false | |
| 17677 | + }); | |
| 17678 | + }); | |
| 17679 | + return parentContainer; | |
| 17680 | + } | |
| 17681 | + /** | |
| 17682 | + * Create a Container element based on a preset. | |
| 17683 | + * | |
| 17684 | + * @param {string} preset - Preset structure of the sub containers (e.g. `33-66-66-33`). | |
| 17685 | + * @param {Container} target - The target container of the newly created Container. | |
| 17686 | + * @param {Object} options - Additional command options. | |
| 17687 | + * @param {boolean} [options.createWrapper=true] - Create a wrapper container for the preset. | |
| 17688 | + * | |
| 17689 | + * @return {Container} - Container created on. | |
| 17690 | + */ | |
| 17691 | + | |
| 17692 | + }, { | |
| 17693 | + key: "createContainerFromPreset", | |
| 17694 | + value: function createContainerFromPreset(preset) { | |
| 17695 | + var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : elementor.getPreviewContainer(); | |
| 17696 | + var options = arguments.length > 2 ? arguments[2] : undefined; | |
| 17697 | + var historyId = $e.internal('document/history/start-log', { | |
| 17698 | + type: 'add', | |
| 17699 | + title: __('Container', 'elementor') | |
| 17700 | + }), | |
| 17701 | + _options$createWrappe2 = options.createWrapper, | |
| 17702 | + createWrapper = _options$createWrappe2 === void 0 ? true : _options$createWrappe2; | |
| 17703 | + var newContainer, settings; | |
| 17704 | + | |
| 17705 | + try { | |
| 17706 | + switch (preset) { | |
| 17707 | + // Single column Container without sub Containers. | |
| 17708 | + case 'c100': | |
| 17709 | + newContainer = ContainerHelper.createContainer({}, target, options); | |
| 17710 | + break; | |
| 17711 | + // Single row Container without sub Containers. | |
| 17712 | + | |
| 17713 | + case 'r100': | |
| 17714 | + newContainer = ContainerHelper.createContainer({ | |
| 17715 | + flex_direction: ContainerHelper.DIRECTION_ROW | |
| 17716 | + }, target, options); | |
| 17717 | + break; | |
| 17718 | + // Exceptional preset. | |
| 17719 | + | |
| 17720 | + case 'c100-c50-50': | |
| 17721 | + settings = { | |
| 17722 | + flex_direction: ContainerHelper.DIRECTION_ROW, | |
| 17723 | + flex_wrap: 'wrap', | |
| 17724 | + flex_gap: { | |
| 17725 | + unit: 'px', | |
| 17726 | + size: 0 // Set the gap to 0 to override the default inherited from `Site Settings`. | |
| 17727 | + | |
| 17728 | + } | |
| 17729 | + }; | |
| 17730 | + | |
| 17731 | + if (!createWrapper) { | |
| 17732 | + $e.run('document/elements/settings', { | |
| 17733 | + container: target, | |
| 17734 | + settings: settings | |
| 17735 | + }); | |
| 17736 | + newContainer = target; | |
| 17737 | + } else { | |
| 17738 | + newContainer = ContainerHelper.createContainer(settings, target, options); | |
| 17739 | + } | |
| 17740 | + | |
| 17741 | + settings = { | |
| 17742 | + content_width: 'full', | |
| 17743 | + width: { | |
| 17744 | + unit: '%', | |
| 17745 | + size: '50' | |
| 17746 | + } | |
| 17747 | + }; | |
| 17748 | + ContainerHelper.createContainer(settings, newContainer, { | |
| 17749 | + edit: false | |
| 17750 | + }); | |
| 17751 | + var rightContainer = ContainerHelper.createContainer(_objectSpread(_objectSpread({}, settings), {}, { | |
| 17752 | + padding: { | |
| 17753 | + size: '' | |
| 17754 | + }, | |
| 17755 | + // Create the right Container with 0 padding (default is 10px) to fix UI (ED-4900). | |
| 17756 | + flex_gap: { | |
| 17757 | + unit: 'px', | |
| 17758 | + size: 0 // Set the gap to 0 to override the default inherited from `Site Settings`. | |
| 17759 | + | |
| 17760 | + } | |
| 17761 | + }), newContainer, { | |
| 17762 | + edit: false | |
| 17763 | + }); | |
| 17764 | + ContainerHelper.createContainers(2, {}, rightContainer, { | |
| 17765 | + edit: false | |
| 17766 | + }); | |
| 17767 | + break; | |
| 17768 | + // Containers by preset. | |
| 17769 | + | |
| 17770 | + default: | |
| 17771 | + var sizes = preset.split('-'); | |
| 17772 | + newContainer = ContainerHelper.createContainerFromSizes(sizes, target, options); | |
| 17773 | + } | |
| 17774 | + | |
| 17775 | + $e.internal('document/history/end-log', { | |
| 17776 | + id: historyId | |
| 17777 | + }); | |
| 17778 | + } catch (e) { | |
| 17779 | + $e.internal('document/history/delete-log', { | |
| 17780 | + id: historyId | |
| 17781 | + }); | |
| 17782 | + } | |
| 17783 | + | |
| 17784 | + return newContainer; | |
| 17785 | + } | |
| 17786 | + /** | |
| 17787 | + * Open edit mode of a Container. | |
| 17788 | + * | |
| 17789 | + * @param {Container} container - Container to open edit mode for. | |
| 17790 | + */ | |
| 17791 | + | |
| 17792 | + }, { | |
| 17793 | + key: "openEditMode", | |
| 17794 | + value: function openEditMode(container) { | |
| 17795 | + $e.run('panel/editor/open', { | |
| 17796 | + model: container.model, | |
| 17797 | + view: container.view, | |
| 17798 | + container: container | |
| 17799 | + }); | |
| 17800 | + } | |
| 17801 | + }]); | |
| 17802 | + return ContainerHelper; | |
| 17803 | +}(); | |
| 17804 | + | |
| 17805 | +exports.ContainerHelper = ContainerHelper; | |
| 17806 | +(0, _defineProperty2.default)(ContainerHelper, "DIRECTION_ROW", 'row'); | |
| 17807 | +(0, _defineProperty2.default)(ContainerHelper, "DIRECTION_COLUMN", 'column'); | |
| 17808 | +(0, _defineProperty2.default)(ContainerHelper, "DIRECTION_ROW_REVERSED", 'row-reverse'); | |
| 17809 | +(0, _defineProperty2.default)(ContainerHelper, "DIRECTION_COLUMN_REVERSED", 'column-reverse'); | |
| 17810 | +(0, _defineProperty2.default)(ContainerHelper, "DIRECTION_DEFAULT", ContainerHelper.DIRECTION_COLUMN); | |
| 17811 | +var _default = ContainerHelper; | |
| 17812 | +exports["default"] = _default; | |
| 17813 | + | |
| 17814 | +/***/ }), | |
| 17815 | + | |
| 17816 | +/***/ "../assets/dev/js/editor/utils/context-menu.js": | |
| 17817 | +/*!*****************************************************!*\ | |
| 17818 | + !*** ../assets/dev/js/editor/utils/context-menu.js ***! | |
| 17819 | + \*****************************************************/ | |
| 17820 | +/***/ ((module) => { | |
| 17821 | + | |
| 17822 | +"use strict"; | |
| 17823 | + | |
| 17824 | + | |
| 17825 | +module.exports = elementorModules.Module.extend({ | |
| 17826 | + getDefaultSettings: function getDefaultSettings() { | |
| 17827 | + return { | |
| 17828 | + context: 'preview', | |
| 17829 | + actions: {}, | |
| 17830 | + classes: { | |
| 17831 | + list: 'elementor-context-menu-list', | |
| 17832 | + group: 'elementor-context-menu-list__group', | |
| 17833 | + groupPrefix: 'elementor-context-menu-list__group-', | |
| 17834 | + item: 'elementor-context-menu-list__item', | |
| 17835 | + itemTypePrefix: 'elementor-context-menu-list__item-', | |
| 17836 | + itemTitle: 'elementor-context-menu-list__item__title', | |
| 17837 | + itemShortcut: 'elementor-context-menu-list__item__shortcut', | |
| 17838 | + iconShortcut: 'elementor-context-menu-list__item__icon', | |
| 17839 | + itemDisabled: 'elementor-context-menu-list__item--disabled', | |
| 17840 | + divider: 'elementor-context-menu-list__divider', | |
| 17841 | + hidden: 'elementor-hidden' | |
| 17842 | + } | |
| 17843 | + }; | |
| 17844 | + }, | |
| 17845 | + buildActionItem: function buildActionItem(action) { | |
| 17846 | + var self = this, | |
| 17847 | + classes = self.getSettings('classes'), | |
| 17848 | + $item = jQuery('<div>', { | |
| 17849 | + class: classes.item + ' ' + classes.itemTypePrefix + action.name | |
| 17850 | + }), | |
| 17851 | + $itemTitle = jQuery('<div>', { | |
| 17852 | + class: classes.itemTitle | |
| 17853 | + }).text(action.title), | |
| 17854 | + $itemIcon = jQuery('<div>', { | |
| 17855 | + class: classes.iconShortcut | |
| 17856 | + }); | |
| 17857 | + | |
| 17858 | + if (action.icon) { | |
| 17859 | + $itemIcon.html(jQuery('<i>', { | |
| 17860 | + class: action.icon | |
| 17861 | + })); | |
| 17862 | + } | |
| 17863 | + | |
| 17864 | + $item.append($itemIcon, $itemTitle); | |
| 17865 | + | |
| 17866 | + if (action.shortcut) { | |
| 17867 | + var $itemShortcut = jQuery('<div>', { | |
| 17868 | + class: classes.itemShortcut | |
| 17869 | + }).html(action.shortcut); | |
| 17870 | + $item.append($itemShortcut); | |
| 17871 | + } | |
| 17872 | + | |
| 17873 | + if (action.callback) { | |
| 17874 | + $item.on('click', function () { | |
| 17875 | + self.runAction(action); | |
| 17876 | + }); | |
| 17877 | + } | |
| 17878 | + | |
| 17879 | + action.$item = $item; | |
| 17880 | + return $item; | |
| 17881 | + }, | |
| 17882 | + buildActionsList: function buildActionsList() { | |
| 17883 | + var self = this, | |
| 17884 | + classes = self.getSettings('classes'), | |
| 17885 | + groups = self.getSettings('groups'), | |
| 17886 | + $list = jQuery('<div>', { | |
| 17887 | + class: classes.list | |
| 17888 | + }); | |
| 17889 | + groups.forEach(function (group) { | |
| 17890 | + var $group = jQuery('<div>', { | |
| 17891 | + class: classes.group + ' ' + classes.groupPrefix + group.name | |
| 17892 | + }); | |
| 17893 | + group.actions.forEach(function (action) { | |
| 17894 | + $group.append(self.buildActionItem(action)); | |
| 17895 | + }); | |
| 17896 | + $list.append($group); | |
| 17897 | + group.$item = $group; | |
| 17898 | + }); | |
| 17899 | + return $list; | |
| 17900 | + }, | |
| 17901 | + toggleGroupVisibility: function toggleGroupVisibility(group, state) { | |
| 17902 | + group.$item.toggleClass(this.getSettings('classes.hidden'), !state); | |
| 17903 | + }, | |
| 17904 | + toggleActionVisibility: function toggleActionVisibility(action, state) { | |
| 17905 | + action.$item.toggleClass(this.getSettings('classes.hidden'), !state); | |
| 17906 | + }, | |
| 17907 | + toggleActionUsability: function toggleActionUsability(action, state) { | |
| 17908 | + action.$item.toggleClass(this.getSettings('classes.itemDisabled'), !state); | |
| 17909 | + }, | |
| 17910 | + | |
| 17911 | + /** | |
| 17912 | + * Update the action title. | |
| 17913 | + * | |
| 17914 | + * Sometimes the action title should dynamically change. This can be done by passing a function as the `title` | |
| 17915 | + * property when initializing the context-menu, and here it actually invoked and assigned as the title. | |
| 17916 | + * | |
| 17917 | + * @param {*} action | |
| 17918 | + */ | |
| 17919 | + updateActionTitle: function updateActionTitle(action) { | |
| 17920 | + if ('function' === typeof action.title) { | |
| 17921 | + action.$item.find('.' + this.getSettings('classes').itemTitle).text(action.title()); | |
| 17922 | + } | |
| 17923 | + }, | |
| 17924 | + isActionEnabled: function isActionEnabled(action) { | |
| 17925 | + if (!action.callback && !action.groups) { | |
| 17926 | + return false; | |
| 17927 | + } | |
| 17928 | + | |
| 17929 | + return action.isEnabled ? action.isEnabled() : true; | |
| 17930 | + }, | |
| 17931 | + runAction: function runAction(action) { | |
| 17932 | + if (!this.isActionEnabled(action)) { | |
| 17933 | + return; | |
| 17934 | + } | |
| 17935 | + | |
| 17936 | + action.callback(); | |
| 17937 | + this.getModal().hide(); | |
| 17938 | + }, | |
| 17939 | + initModal: function initModal() { | |
| 17940 | + var modal; | |
| 17941 | + | |
| 17942 | + this.getModal = function () { | |
| 17943 | + if (!modal) { | |
| 17944 | + modal = elementorCommon.dialogsManager.createWidget('simple', { | |
| 17945 | + className: 'elementor-context-menu', | |
| 17946 | + message: this.buildActionsList(), | |
| 17947 | + iframe: 'preview' === this.getSettings('context') ? elementor.$preview : null, | |
| 17948 | + effects: { | |
| 17949 | + hide: 'hide', | |
| 17950 | + show: 'show' | |
| 17951 | + }, | |
| 17952 | + hide: { | |
| 17953 | + onOutsideContextMenu: true | |
| 17954 | + }, | |
| 17955 | + position: { | |
| 17956 | + my: (elementorCommon.config.isRTL ? 'right' : 'left') + ' top', | |
| 17957 | + collision: 'fit' | |
| 17958 | + } | |
| 17959 | + }); | |
| 17960 | + } | |
| 17961 | + | |
| 17962 | + return modal; | |
| 17963 | + }; | |
| 17964 | + }, | |
| 17965 | + show: function show(event) { | |
| 17966 | + var self = this, | |
| 17967 | + modal = self.getModal(); | |
| 17968 | + modal.setSettings('position', { | |
| 17969 | + of: event | |
| 17970 | + }); | |
| 17971 | + self.getSettings('groups').forEach(function (group) { | |
| 17972 | + var isGroupVisible = false !== group.isVisible; | |
| 17973 | + self.toggleGroupVisibility(group, isGroupVisible); | |
| 17974 | + | |
| 17975 | + if (isGroupVisible) { | |
| 17976 | + group.actions.forEach(function (action) { | |
| 17977 | + var isActionVisible = false !== action.isVisible; | |
| 17978 | + self.toggleActionVisibility(action, isActionVisible); | |
| 17979 | + self.updateActionTitle(action); | |
| 17980 | + | |
| 17981 | + if (isActionVisible) { | |
| 17982 | + self.toggleActionUsability(action, self.isActionEnabled(action)); | |
| 17983 | + } | |
| 17984 | + }); | |
| 17985 | + } | |
| 17986 | + }); | |
| 17987 | + modal.show(); | |
| 17988 | + }, | |
| 17989 | + destroy: function destroy() { | |
| 17990 | + this.getModal().destroy(); | |
| 17991 | + }, | |
| 17992 | + onInit: function onInit() { | |
| 17993 | + this.initModal(); | |
| 17994 | + } | |
| 17995 | +}); | |
| 17996 | + | |
| 17997 | +/***/ }), | |
| 17998 | + | |
| 17999 | +/***/ "../assets/dev/js/editor/utils/controls-css-parser.js": | |
| 18000 | +/*!************************************************************!*\ | |
| 18001 | + !*** ../assets/dev/js/editor/utils/controls-css-parser.js ***! | |
| 18002 | + \************************************************************/ | |
| 18003 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 18004 | + | |
| 18005 | +"use strict"; | |
| 18006 | + | |
| 18007 | + | |
| 18008 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 18009 | + | |
| 18010 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 18011 | + | |
| 18012 | +var Stylesheet = __webpack_require__(/*! elementor-editor-utils/stylesheet */ "../assets/dev/js/editor/utils/stylesheet.js"), | |
| 18013 | + ControlsCSSParser; | |
| 18014 | + | |
| 18015 | +ControlsCSSParser = elementorModules.ViewModule.extend({ | |
| 18016 | + stylesheet: null, | |
| 18017 | + getDefaultSettings: function getDefaultSettings() { | |
| 18018 | + return { | |
| 18019 | + id: 0, | |
| 18020 | + context: null, | |
| 18021 | + settingsModel: null, | |
| 18022 | + dynamicParsing: {} | |
| 18023 | + }; | |
| 18024 | + }, | |
| 18025 | + getDefaultElements: function getDefaultElements() { | |
| 18026 | + var id = "elementor-style-".concat(this.getSettings('id')); | |
| 18027 | + var $stylesheet = elementor.$previewContents.find("#".concat(id)); | |
| 18028 | + | |
| 18029 | + if (!$stylesheet.length) { | |
| 18030 | + $stylesheet = jQuery('<style>', { | |
| 18031 | + id: id | |
| 18032 | + }); | |
| 18033 | + } | |
| 18034 | + | |
| 18035 | + return { | |
| 18036 | + $stylesheetElement: $stylesheet | |
| 18037 | + }; | |
| 18038 | + }, | |
| 18039 | + initStylesheet: function initStylesheet() { | |
| 18040 | + var _this = this; | |
| 18041 | + | |
| 18042 | + var breakpoints = elementorFrontend.config.responsive.activeBreakpoints; | |
| 18043 | + this.stylesheet = new Stylesheet(); | |
| 18044 | + Object.entries(breakpoints).forEach(function (_ref) { | |
| 18045 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 18046 | + breakpointName = _ref2[0], | |
| 18047 | + breakpointConfig = _ref2[1]; | |
| 18048 | + | |
| 18049 | + _this.stylesheet.addDevice(breakpointName, breakpointConfig.value); | |
| 18050 | + }); | |
| 18051 | + }, | |
| 18052 | + addStyleRules: function addStyleRules(styleControls, values, controls, placeholders, replacements) { | |
| 18053 | + var _this2 = this; | |
| 18054 | + | |
| 18055 | + // If the current element contains dynamic values, parse these values | |
| 18056 | + var dynamicParsedValues = this.getSettings('settingsModel').parseDynamicSettings(values, this.getSettings('dynamicParsing'), styleControls); | |
| 18057 | + | |
| 18058 | + _.each(styleControls, function (control) { | |
| 18059 | + var _control$dynamic, _values$__dynamic__; | |
| 18060 | + | |
| 18061 | + if (control.styleFields && control.styleFields.length) { | |
| 18062 | + _this2.addRepeaterControlsStyleRules(values[control.name], control.styleFields, control.fields, placeholders, replacements); | |
| 18063 | + } // If a dynamic tag includes controls with CSS implementations, Take their CSS and apply it. | |
| 18064 | + | |
| 18065 | + | |
| 18066 | + if ((_control$dynamic = control.dynamic) !== null && _control$dynamic !== void 0 && _control$dynamic.active && (_values$__dynamic__ = values.__dynamic__) !== null && _values$__dynamic__ !== void 0 && _values$__dynamic__[control.name]) { | |
| 18067 | + _this2.addDynamicControlStyleRules(values.__dynamic__[control.name], control); | |
| 18068 | + } | |
| 18069 | + | |
| 18070 | + if (!control.selectors) { | |
| 18071 | + return; | |
| 18072 | + } | |
| 18073 | + | |
| 18074 | + var context = _this2.getSettings('context'); | |
| 18075 | + | |
| 18076 | + var globalKeys; | |
| 18077 | + | |
| 18078 | + if (context) { | |
| 18079 | + globalKeys = context.model.get('settings').get('__globals__'); | |
| 18080 | + } | |
| 18081 | + | |
| 18082 | + _this2.addControlStyleRules(control, dynamicParsedValues, controls, placeholders, replacements, globalKeys); | |
| 18083 | + }); | |
| 18084 | + }, | |
| 18085 | + addControlStyleRules: function addControlStyleRules(control, values, controls, placeholders, replacements, globalKeys) { | |
| 18086 | + var _this3 = this; | |
| 18087 | + | |
| 18088 | + var globalKey; | |
| 18089 | + | |
| 18090 | + if (globalKeys) { | |
| 18091 | + var controlGlobalKey = control.name; | |
| 18092 | + | |
| 18093 | + if (control.groupType) { | |
| 18094 | + controlGlobalKey = control.groupPrefix + control.groupType; | |
| 18095 | + } | |
| 18096 | + | |
| 18097 | + globalKey = globalKeys[controlGlobalKey]; | |
| 18098 | + } | |
| 18099 | + | |
| 18100 | + var value; | |
| 18101 | + | |
| 18102 | + if (!globalKey) { | |
| 18103 | + value = this.getStyleControlValue(control, values); | |
| 18104 | + | |
| 18105 | + if (undefined === value) { | |
| 18106 | + return; | |
| 18107 | + } | |
| 18108 | + } | |
| 18109 | + | |
| 18110 | + _.each(control.selectors, function (cssProperty, selector) { | |
| 18111 | + var outputCssProperty; | |
| 18112 | + | |
| 18113 | + if (globalKey) { | |
| 18114 | + var selectorGlobalValue = _this3.getSelectorGlobalValue(control, globalKey); | |
| 18115 | + | |
| 18116 | + if (selectorGlobalValue) { | |
| 18117 | + if ('font' === control.type) { | |
| 18118 | + $e.data.get(globalKey).then(function (response) { | |
| 18119 | + elementor.helpers.enqueueFont(response.data.value.typography_font_family); | |
| 18120 | + }); | |
| 18121 | + } // This regex handles a case where a control's selector property value includes more than one CSS selector. | |
| 18122 | + // Example: 'selector' => 'background: {{VALUE}}; background-color: {{VALUE}};'. | |
| 18123 | + | |
| 18124 | + | |
| 18125 | + outputCssProperty = cssProperty.replace(/(:)[^;]+(;?)/g, '$1' + selectorGlobalValue + '$2'); | |
| 18126 | + } | |
| 18127 | + } else { | |
| 18128 | + try { | |
| 18129 | + outputCssProperty = cssProperty.replace(/{{(?:([^.}]+)\.)?([^}| ]*)(?: *\|\| *(?:([^.}]+)\.)?([^}| ]*) *)*}}/g, function (originalPhrase, controlName, placeholder, fallbackControlName, fallbackValue) { | |
| 18130 | + var externalControlMissing = controlName && !controls[controlName]; | |
| 18131 | + var parsedValue = ''; | |
| 18132 | + | |
| 18133 | + if (!externalControlMissing) { | |
| 18134 | + parsedValue = _this3.parsePropertyPlaceholder(control, value, controls, values, placeholder, controlName); | |
| 18135 | + } | |
| 18136 | + | |
| 18137 | + if (!parsedValue && 0 !== parsedValue) { | |
| 18138 | + if (fallbackValue) { | |
| 18139 | + parsedValue = fallbackValue; | |
| 18140 | + var stringValueMatches = parsedValue.match(/^(['"])(.*)\1$/); | |
| 18141 | + | |
| 18142 | + if (stringValueMatches) { | |
| 18143 | + parsedValue = stringValueMatches[2]; | |
| 18144 | + } else if (!isFinite(parsedValue)) { | |
| 18145 | + if (fallbackControlName && !controls[fallbackControlName]) { | |
| 18146 | + return ''; | |
| 18147 | + } | |
| 18148 | + | |
| 18149 | + parsedValue = _this3.parsePropertyPlaceholder(control, value, controls, values, fallbackValue, fallbackControlName); | |
| 18150 | + } | |
| 18151 | + } | |
| 18152 | + | |
| 18153 | + if (!parsedValue && 0 !== parsedValue) { | |
| 18154 | + if (externalControlMissing) { | |
| 18155 | + return ''; | |
| 18156 | + } | |
| 18157 | + | |
| 18158 | + throw ''; | |
| 18159 | + } | |
| 18160 | + } | |
| 18161 | + | |
| 18162 | + if ('font' === control.type) { | |
| 18163 | + elementor.helpers.enqueueFont(parsedValue); | |
| 18164 | + } | |
| 18165 | + | |
| 18166 | + return parsedValue; | |
| 18167 | + }); | |
| 18168 | + } catch (e) { | |
| 18169 | + return; | |
| 18170 | + } | |
| 18171 | + } | |
| 18172 | + | |
| 18173 | + if (_.isEmpty(outputCssProperty)) { | |
| 18174 | + return; | |
| 18175 | + } | |
| 18176 | + | |
| 18177 | + var devicePattern = /^(?:\([^)]+\)){1,2}/, | |
| 18178 | + deviceRules = selector.match(devicePattern), | |
| 18179 | + query = {}; | |
| 18180 | + | |
| 18181 | + if (deviceRules) { | |
| 18182 | + deviceRules = deviceRules[0]; | |
| 18183 | + selector = selector.replace(devicePattern, ''); | |
| 18184 | + var pureDevicePattern = /\(([^)]+)\)/g, | |
| 18185 | + pureDeviceRules = [], | |
| 18186 | + matches; | |
| 18187 | + matches = pureDevicePattern.exec(deviceRules); | |
| 18188 | + | |
| 18189 | + while (matches) { | |
| 18190 | + pureDeviceRules.push(matches[1]); | |
| 18191 | + matches = pureDevicePattern.exec(deviceRules); | |
| 18192 | + } | |
| 18193 | + | |
| 18194 | + _.each(pureDeviceRules, function (deviceRule) { | |
| 18195 | + if ('desktop' === deviceRule) { | |
| 18196 | + return; | |
| 18197 | + } | |
| 18198 | + | |
| 18199 | + var device = deviceRule.replace(/\+$/, ''), | |
| 18200 | + endPoint = device === deviceRule ? 'max' : 'min'; | |
| 18201 | + query[endPoint] = device; | |
| 18202 | + }); | |
| 18203 | + } | |
| 18204 | + | |
| 18205 | + _.each(placeholders, function (placeholder, index) { | |
| 18206 | + // Check if it's a RegExp | |
| 18207 | + var regexp = placeholder.source ? placeholder.source : placeholder, | |
| 18208 | + placeholderPattern = new RegExp(regexp, 'g'); | |
| 18209 | + selector = selector.replace(placeholderPattern, replacements[index]); | |
| 18210 | + }); | |
| 18211 | + | |
| 18212 | + if (!Object.keys(query).length && control.responsive) { | |
| 18213 | + query = _.pick(elementorCommon.helpers.cloneObject(control.responsive), ['min', 'max']); | |
| 18214 | + | |
| 18215 | + if ('desktop' === query.max) { | |
| 18216 | + delete query.max; | |
| 18217 | + } | |
| 18218 | + } | |
| 18219 | + | |
| 18220 | + _this3.stylesheet.addRules(selector, outputCssProperty, query); | |
| 18221 | + }); | |
| 18222 | + }, | |
| 18223 | + parsePropertyPlaceholder: function parsePropertyPlaceholder(control, value, controls, values, placeholder, parserControlName) { | |
| 18224 | + if (parserControlName) { | |
| 18225 | + control = _.findWhere(controls, { | |
| 18226 | + name: parserControlName | |
| 18227 | + }); | |
| 18228 | + value = this.getStyleControlValue(control, values); | |
| 18229 | + } | |
| 18230 | + | |
| 18231 | + return elementor.getControlView(control.type).getStyleValue(placeholder, value, control); | |
| 18232 | + }, | |
| 18233 | + getStyleControlValue: function getStyleControlValue(control, values) { | |
| 18234 | + var _this$getSettings, _this$getSettings$con, _values$__globals__, _control$global; | |
| 18235 | + | |
| 18236 | + var container = (_this$getSettings = this.getSettings()) === null || _this$getSettings === void 0 ? void 0 : (_this$getSettings$con = _this$getSettings.context) === null || _this$getSettings$con === void 0 ? void 0 : _this$getSettings$con.container, | |
| 18237 | + isGlobalApplied = container === null || container === void 0 ? void 0 : container.isGlobalApplied(control.name), | |
| 18238 | + globalKey = ((_values$__globals__ = values.__globals__) === null || _values$__globals__ === void 0 ? void 0 : _values$__globals__[control.name]) || ((_control$global = control.global) === null || _control$global === void 0 ? void 0 : _control$global.default); // Set a global value only if it's is applied. | |
| 18239 | + | |
| 18240 | + if (isGlobalApplied && globalKey) { | |
| 18241 | + // When the control itself has no global value, but it refers to another control global value | |
| 18242 | + return this.getSelectorGlobalValue(control, globalKey); | |
| 18243 | + } | |
| 18244 | + | |
| 18245 | + var value = values[control.name]; | |
| 18246 | + | |
| 18247 | + if (control.selectors_dictionary) { | |
| 18248 | + value = control.selectors_dictionary[value] || value; | |
| 18249 | + } | |
| 18250 | + | |
| 18251 | + if (!_.isNumber(value) && _.isEmpty(value)) { | |
| 18252 | + return; | |
| 18253 | + } | |
| 18254 | + | |
| 18255 | + return value; | |
| 18256 | + }, | |
| 18257 | + getSelectorGlobalValue: function getSelectorGlobalValue(control, globalKey) { | |
| 18258 | + var globalArgs = $e.data.commandExtractArgs(globalKey), | |
| 18259 | + data = $e.data.getCache($e.components.get('globals'), globalArgs.command, globalArgs.args.query); | |
| 18260 | + | |
| 18261 | + if (!(data !== null && data !== void 0 && data.value)) { | |
| 18262 | + return; | |
| 18263 | + } | |
| 18264 | + | |
| 18265 | + var id = data.id; | |
| 18266 | + var value; // it's a global settings with additional controls in group. | |
| 18267 | + | |
| 18268 | + if (control.groupType) { | |
| 18269 | + // A regex containing all of the active breakpoints' prefixes ('_mobile', '_tablet' etc.). | |
| 18270 | + var responsivePrefixRegex = elementor.breakpoints.getActiveMatchRegex(); | |
| 18271 | + var propertyName = control.name.replace(control.groupPrefix, '').replace(responsivePrefixRegex, ''); | |
| 18272 | + | |
| 18273 | + if (!data.value[elementor.config.kit_config.typography_prefix + propertyName]) { | |
| 18274 | + return; | |
| 18275 | + } | |
| 18276 | + | |
| 18277 | + propertyName = propertyName.replace('_', '-'); | |
| 18278 | + value = "var( --e-global-".concat(control.groupType, "-").concat(id, "-").concat(propertyName, " )"); | |
| 18279 | + | |
| 18280 | + if (elementor.config.ui.defaultGenericFonts && control.groupPrefix + 'font_family' === control.name) { | |
| 18281 | + value += ", ".concat(elementor.config.ui.defaultGenericFonts); | |
| 18282 | + } | |
| 18283 | + } else { | |
| 18284 | + value = "var( --e-global-".concat(control.type, "-").concat(id, " )"); | |
| 18285 | + } | |
| 18286 | + | |
| 18287 | + return value; | |
| 18288 | + }, | |
| 18289 | + addRepeaterControlsStyleRules: function addRepeaterControlsStyleRules(repeaterValues, repeaterControlsItems, controls, placeholders, replacements) { | |
| 18290 | + var _this4 = this; | |
| 18291 | + | |
| 18292 | + repeaterControlsItems.forEach(function (item, index) { | |
| 18293 | + var itemModel = repeaterValues.models[index]; | |
| 18294 | + | |
| 18295 | + _this4.addStyleRules(item, itemModel.attributes, controls, placeholders.concat(['{{CURRENT_ITEM}}']), replacements.concat(['.elementor-repeater-item-' + itemModel.get('_id')])); | |
| 18296 | + }); | |
| 18297 | + }, | |
| 18298 | + addDynamicControlStyleRules: function addDynamicControlStyleRules(value, control) { | |
| 18299 | + var self = this; | |
| 18300 | + elementor.dynamicTags.parseTagsText(value, control.dynamic, function (id, name, settings) { | |
| 18301 | + var tag = elementor.dynamicTags.createTag(id, name, settings); | |
| 18302 | + | |
| 18303 | + if (!tag) { | |
| 18304 | + return; | |
| 18305 | + } | |
| 18306 | + | |
| 18307 | + var tagSettingsModel = tag.model, | |
| 18308 | + styleControls = tagSettingsModel.getStyleControls(); | |
| 18309 | + | |
| 18310 | + if (!styleControls.length) { | |
| 18311 | + return; | |
| 18312 | + } | |
| 18313 | + | |
| 18314 | + self.addStyleRules(tagSettingsModel.getStyleControls(), tagSettingsModel.attributes, tagSettingsModel.controls, ['{{WRAPPER}}'], ['#elementor-tag-' + id]); | |
| 18315 | + }); | |
| 18316 | + }, | |
| 18317 | + addStyleToDocument: function addStyleToDocument(position) { | |
| 18318 | + var $head = elementor.$previewContents.find('head'); | |
| 18319 | + var insertMethod = 'append', | |
| 18320 | + $insertBy = $head; | |
| 18321 | + | |
| 18322 | + if (position) { | |
| 18323 | + var $targetElement = $head.children(position.of); | |
| 18324 | + | |
| 18325 | + if ($targetElement.length) { | |
| 18326 | + insertMethod = position.at; | |
| 18327 | + $insertBy = $targetElement; | |
| 18328 | + } | |
| 18329 | + } | |
| 18330 | + | |
| 18331 | + $insertBy[insertMethod](this.elements.$stylesheetElement); | |
| 18332 | + var extraCSS = elementor.hooks.applyFilters('editor/style/styleText', '', this.getSettings('context')); | |
| 18333 | + this.elements.$stylesheetElement.text(this.stylesheet + extraCSS); | |
| 18334 | + }, | |
| 18335 | + removeStyleFromDocument: function removeStyleFromDocument() { | |
| 18336 | + this.elements.$stylesheetElement.remove(); | |
| 18337 | + }, | |
| 18338 | + onInit: function onInit() { | |
| 18339 | + elementorModules.ViewModule.prototype.onInit.apply(this, arguments); | |
| 18340 | + this.initStylesheet(); | |
| 18341 | + } | |
| 18342 | +}); | |
| 18343 | +module.exports = ControlsCSSParser; | |
| 18344 | + | |
| 18345 | +/***/ }), | |
| 18346 | + | |
| 382 | 18347 | /***/ "../assets/dev/js/editor/utils/is-instanceof.js": |
| 383 | 18348 | /*!******************************************************!*\ |
| 384 | 18349 | !*** ../assets/dev/js/editor/utils/is-instanceof.js ***! |
| 385 | 18350 | \******************************************************/ |
| @@ -391,11 +18356,15 @@ | ||
| 391 | 18356 | Object.defineProperty(exports, "__esModule", ({ |
| 392 | 18357 | value: true |
| 393 | 18358 | })); |
| 394 | 18359 | exports["default"] = void 0; |
| 395 | -function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | |
| 396 | -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); 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; } } | |
| 397 | -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
| 18360 | + | |
| 18361 | +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; } } }; } | |
| 18362 | + | |
| 18363 | +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); } | |
| 18364 | + | |
| 18365 | +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; } | |
| 18366 | + | |
| 398 | 18367 | /** |
| 399 | 18368 | * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved |
| 400 | 18369 | * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can |
| 401 | 18370 | * check whether it's instanceof by using the objects constructor and prototype names. |
| @@ -403,16 +18372,19 @@ | ||
| 403 | 18372 | * @param object |
| 404 | 18373 | * @param constructors |
| 405 | 18374 | * @return {boolean} |
| 406 | 18375 | */ |
| 407 | -var _default = exports["default"] = function _default(object, constructors) { | |
| 18376 | +var _default = function _default(object, constructors) { | |
| 408 | 18377 | constructors = Array.isArray(constructors) ? constructors : [constructors]; |
| 18378 | + | |
| 409 | 18379 | var _iterator = _createForOfIteratorHelper(constructors), |
| 410 | - _step; | |
| 18380 | + _step; | |
| 18381 | + | |
| 411 | 18382 | try { |
| 412 | 18383 | for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 413 | - var constructor = _step.value; | |
| 414 | - if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) { | |
| 18384 | + var _constructor = _step.value; | |
| 18385 | + | |
| 18386 | + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) { | |
| 415 | 18387 | return true; |
| 416 | 18388 | } |
| 417 | 18389 | } |
| 418 | 18390 | } catch (err) { |
| @@ -419,13 +18391,875 @@ | ||
| 419 | 18391 | _iterator.e(err); |
| 420 | 18392 | } finally { |
| 421 | 18393 | _iterator.f(); |
| 422 | 18394 | } |
| 18395 | + | |
| 423 | 18396 | return false; |
| 424 | 18397 | }; |
| 425 | 18398 | |
| 18399 | +exports["default"] = _default; | |
| 18400 | + | |
| 426 | 18401 | /***/ }), |
| 427 | 18402 | |
| 18403 | +/***/ "../assets/dev/js/editor/utils/stylesheet.js": | |
| 18404 | +/*!***************************************************!*\ | |
| 18405 | + !*** ../assets/dev/js/editor/utils/stylesheet.js ***! | |
| 18406 | + \***************************************************/ | |
| 18407 | +/***/ ((module) => { | |
| 18408 | + | |
| 18409 | +"use strict"; | |
| 18410 | + | |
| 18411 | + | |
| 18412 | +(function ($) { | |
| 18413 | + var Stylesheet = function Stylesheet() { | |
| 18414 | + var self = this, | |
| 18415 | + rules = {}, | |
| 18416 | + rawCSS = {}, | |
| 18417 | + devices = {}; | |
| 18418 | + | |
| 18419 | + var queryToHash = function queryToHash(query) { | |
| 18420 | + var hash = []; | |
| 18421 | + $.each(query, function (endPoint) { | |
| 18422 | + hash.push(endPoint + '_' + this); | |
| 18423 | + }); | |
| 18424 | + return hash.join('-'); | |
| 18425 | + }; | |
| 18426 | + | |
| 18427 | + var hashToQuery = function hashToQuery(hash) { | |
| 18428 | + var query = {}; | |
| 18429 | + hash = hash.split('-').filter(String); | |
| 18430 | + hash.forEach(function (singleQuery) { | |
| 18431 | + // split {max}/{min}_{device name} to separate strings | |
| 18432 | + var queryParts = singleQuery.split(/_(.+)/), | |
| 18433 | + endPoint = queryParts[0], | |
| 18434 | + deviceName = queryParts[1]; | |
| 18435 | + query[endPoint] = 'max' === endPoint ? devices[deviceName] : elementorFrontend.breakpoints.getDeviceMinBreakpoint(deviceName); | |
| 18436 | + }); | |
| 18437 | + return query; | |
| 18438 | + }; | |
| 18439 | + | |
| 18440 | + var addQueryHash = function addQueryHash(queryHash) { | |
| 18441 | + rules[queryHash] = {}; | |
| 18442 | + var hashes = Object.keys(rules); | |
| 18443 | + | |
| 18444 | + if (hashes.length < 2) { | |
| 18445 | + return; | |
| 18446 | + } // Sort the devices from narrowest to widest | |
| 18447 | + | |
| 18448 | + | |
| 18449 | + hashes.sort(function (a, b) { | |
| 18450 | + var _aQuery$max, _bQuery$max; | |
| 18451 | + | |
| 18452 | + if ('all' === a) { | |
| 18453 | + return -1; | |
| 18454 | + } | |
| 18455 | + | |
| 18456 | + if ('all' === b) { | |
| 18457 | + return 1; | |
| 18458 | + } | |
| 18459 | + | |
| 18460 | + var aQuery = hashToQuery(a), | |
| 18461 | + bQuery = hashToQuery(b); // Calculation should be either `max - max` or `min - min`. | |
| 18462 | + // Caused when the `min_affected_device` is equal to the current responsive control. | |
| 18463 | + // (e.g. `min_affected_device = tablet`, and the user is changing a tablet control). | |
| 18464 | + | |
| 18465 | + if (aQuery.max && bQuery.max) { | |
| 18466 | + return bQuery.max - aQuery.max; | |
| 18467 | + } | |
| 18468 | + | |
| 18469 | + if (aQuery.min && bQuery.min) { | |
| 18470 | + return bQuery.min - aQuery.min; | |
| 18471 | + } // If one of the queries has only `min` and the other has only `max`. | |
| 18472 | + | |
| 18473 | + | |
| 18474 | + var aQueryValue = (_aQuery$max = aQuery.max) !== null && _aQuery$max !== void 0 ? _aQuery$max : aQuery.min; | |
| 18475 | + var bQueryValue = (_bQuery$max = bQuery.max) !== null && _bQuery$max !== void 0 ? _bQuery$max : bQuery.min; | |
| 18476 | + return bQueryValue - aQueryValue; | |
| 18477 | + }); | |
| 18478 | + var sortedRules = {}; | |
| 18479 | + hashes.forEach(function (deviceName) { | |
| 18480 | + sortedRules[deviceName] = rules[deviceName]; | |
| 18481 | + }); | |
| 18482 | + rules = sortedRules; | |
| 18483 | + }; | |
| 18484 | + | |
| 18485 | + var getQueryHashStyleFormat = function getQueryHashStyleFormat(queryHash) { | |
| 18486 | + var query = hashToQuery(queryHash), | |
| 18487 | + styleFormat = []; | |
| 18488 | + $.each(query, function (endPoint) { | |
| 18489 | + styleFormat.push('(' + endPoint + '-width:' + this + 'px)'); | |
| 18490 | + }); | |
| 18491 | + return '@media' + styleFormat.join(' and '); | |
| 18492 | + }; | |
| 18493 | + | |
| 18494 | + this.addDevice = function (newDeviceName, deviceValue) { | |
| 18495 | + devices[newDeviceName] = deviceValue; | |
| 18496 | + var deviceNames = Object.keys(devices); | |
| 18497 | + | |
| 18498 | + if (deviceNames.length < 2) { | |
| 18499 | + return self; | |
| 18500 | + } // Sort the devices from narrowest to widest | |
| 18501 | + | |
| 18502 | + | |
| 18503 | + deviceNames.sort(function (a, b) { | |
| 18504 | + return devices[a] - devices[b]; | |
| 18505 | + }); | |
| 18506 | + var sortedDevices = {}; | |
| 18507 | + deviceNames.forEach(function (deviceName) { | |
| 18508 | + sortedDevices[deviceName] = devices[deviceName]; | |
| 18509 | + }); | |
| 18510 | + devices = sortedDevices; | |
| 18511 | + return self; | |
| 18512 | + }; | |
| 18513 | + | |
| 18514 | + this.addRawCSS = function (key, css) { | |
| 18515 | + rawCSS[key] = css; | |
| 18516 | + }; | |
| 18517 | + | |
| 18518 | + this.addRules = function (selector, styleRules, query) { | |
| 18519 | + var queryHash = 'all'; | |
| 18520 | + | |
| 18521 | + if (!_.isEmpty(query)) { | |
| 18522 | + queryHash = queryToHash(query); | |
| 18523 | + } | |
| 18524 | + | |
| 18525 | + if (!rules[queryHash]) { | |
| 18526 | + addQueryHash(queryHash); | |
| 18527 | + } | |
| 18528 | + | |
| 18529 | + if (!styleRules) { | |
| 18530 | + var parsedRules = selector.match(/[^{]+\{[^}]+}/g); | |
| 18531 | + $.each(parsedRules, function () { | |
| 18532 | + var parsedRule = this.match(/([^{]+)\{([^}]+)}/); | |
| 18533 | + | |
| 18534 | + if (parsedRule) { | |
| 18535 | + self.addRules(parsedRule[1].trim(), parsedRule[2].trim(), query); | |
| 18536 | + } | |
| 18537 | + }); | |
| 18538 | + return; | |
| 18539 | + } | |
| 18540 | + | |
| 18541 | + if (!rules[queryHash][selector]) { | |
| 18542 | + rules[queryHash][selector] = {}; | |
| 18543 | + } | |
| 18544 | + | |
| 18545 | + if ('string' === typeof styleRules) { | |
| 18546 | + styleRules = styleRules.split(';').filter(String); | |
| 18547 | + var orderedRules = {}; | |
| 18548 | + | |
| 18549 | + try { | |
| 18550 | + $.each(styleRules, function () { | |
| 18551 | + var property = this.split(/:(.*)?/); | |
| 18552 | + orderedRules[property[0].trim()] = property[1].trim().replace(';', ''); | |
| 18553 | + }); | |
| 18554 | + } catch (error) { | |
| 18555 | + // At least one of the properties is incorrect | |
| 18556 | + return; | |
| 18557 | + } | |
| 18558 | + | |
| 18559 | + styleRules = orderedRules; | |
| 18560 | + } | |
| 18561 | + | |
| 18562 | + $.extend(rules[queryHash][selector], styleRules); | |
| 18563 | + return self; | |
| 18564 | + }; | |
| 18565 | + | |
| 18566 | + this.getRules = function () { | |
| 18567 | + return rules; | |
| 18568 | + }; | |
| 18569 | + | |
| 18570 | + this.empty = function () { | |
| 18571 | + rules = {}; | |
| 18572 | + rawCSS = {}; | |
| 18573 | + }; | |
| 18574 | + | |
| 18575 | + this.toString = function () { | |
| 18576 | + var styleText = ''; | |
| 18577 | + $.each(rules, function (queryHash) { | |
| 18578 | + var deviceText = Stylesheet.parseRules(this); | |
| 18579 | + | |
| 18580 | + if ('all' !== queryHash) { | |
| 18581 | + deviceText = getQueryHashStyleFormat(queryHash) + '{' + deviceText + '}'; | |
| 18582 | + } | |
| 18583 | + | |
| 18584 | + styleText += deviceText; | |
| 18585 | + }); | |
| 18586 | + $.each(rawCSS, function () { | |
| 18587 | + styleText += this; | |
| 18588 | + }); | |
| 18589 | + return styleText; | |
| 18590 | + }; | |
| 18591 | + }; | |
| 18592 | + | |
| 18593 | + Stylesheet.parseRules = function (rules) { | |
| 18594 | + var parsedRules = ''; | |
| 18595 | + $.each(rules, function (selector) { | |
| 18596 | + var selectorContent = Stylesheet.parseProperties(this); | |
| 18597 | + | |
| 18598 | + if (selectorContent) { | |
| 18599 | + parsedRules += selector + '{' + selectorContent + '}'; | |
| 18600 | + } | |
| 18601 | + }); | |
| 18602 | + return parsedRules; | |
| 18603 | + }; | |
| 18604 | + | |
| 18605 | + Stylesheet.parseProperties = function (properties) { | |
| 18606 | + var parsedProperties = ''; | |
| 18607 | + $.each(properties, function (propertyKey) { | |
| 18608 | + if (this) { | |
| 18609 | + parsedProperties += propertyKey + ':' + this + ';'; | |
| 18610 | + } | |
| 18611 | + }); | |
| 18612 | + return parsedProperties; | |
| 18613 | + }; | |
| 18614 | + | |
| 18615 | + module.exports = Stylesheet; | |
| 18616 | +})(jQuery); | |
| 18617 | + | |
| 18618 | +/***/ }), | |
| 18619 | + | |
| 18620 | +/***/ "../assets/dev/js/editor/views/add-section/base.js": | |
| 18621 | +/*!*********************************************************!*\ | |
| 18622 | + !*** ../assets/dev/js/editor/views/add-section/base.js ***! | |
| 18623 | + \*********************************************************/ | |
| 18624 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 18625 | + | |
| 18626 | +"use strict"; | |
| 18627 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 18628 | + | |
| 18629 | + | |
| 18630 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 18631 | + | |
| 18632 | +Object.defineProperty(exports, "__esModule", ({ | |
| 18633 | + value: true | |
| 18634 | +})); | |
| 18635 | +exports["default"] = void 0; | |
| 18636 | + | |
| 18637 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 18638 | + | |
| 18639 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 18640 | + | |
| 18641 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 18642 | + | |
| 18643 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 18644 | + | |
| 18645 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 18646 | + | |
| 18647 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 18648 | + | |
| 18649 | +var _containerHelper = _interopRequireDefault(__webpack_require__(/*! elementor-editor-utils/container-helper */ "../assets/dev/js/editor/utils/container-helper.js")); | |
| 18650 | + | |
| 18651 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 18652 | + | |
| 18653 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 18654 | + | |
| 18655 | +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); }; } | |
| 18656 | + | |
| 18657 | +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; } } | |
| 18658 | + | |
| 18659 | +/** | |
| 18660 | + * @typedef {import('../../container/container')} Container | |
| 18661 | + */ | |
| 18662 | +var AddSectionBase = /*#__PURE__*/function (_Marionette$ItemView) { | |
| 18663 | + (0, _inherits2.default)(AddSectionBase, _Marionette$ItemView); | |
| 18664 | + | |
| 18665 | + var _super = _createSuper(AddSectionBase); | |
| 18666 | + | |
| 18667 | + function AddSectionBase() { | |
| 18668 | + (0, _classCallCheck2.default)(this, AddSectionBase); | |
| 18669 | + return _super.apply(this, arguments); | |
| 18670 | + } | |
| 18671 | + | |
| 18672 | + (0, _createClass2.default)(AddSectionBase, [{ | |
| 18673 | + key: "template", | |
| 18674 | + value: // Views. | |
| 18675 | + function template() { | |
| 18676 | + return Marionette.TemplateCache.get('#tmpl-elementor-add-section'); | |
| 18677 | + } | |
| 18678 | + }, { | |
| 18679 | + key: "attributes", | |
| 18680 | + value: function attributes() { | |
| 18681 | + return { | |
| 18682 | + 'data-view': AddSectionBase.VIEW_CHOOSE_ACTION | |
| 18683 | + }; | |
| 18684 | + } | |
| 18685 | + }, { | |
| 18686 | + key: "ui", | |
| 18687 | + value: function ui() { | |
| 18688 | + return { | |
| 18689 | + addNewSection: '.elementor-add-new-section', | |
| 18690 | + closeButton: '.elementor-add-section-close', | |
| 18691 | + addSectionButton: '.elementor-add-section-button', | |
| 18692 | + addTemplateButton: '.elementor-add-template-button', | |
| 18693 | + selectPreset: '.elementor-select-preset', | |
| 18694 | + presets: '.elementor-preset', | |
| 18695 | + containerPresets: '.e-container-preset' | |
| 18696 | + }; | |
| 18697 | + } | |
| 18698 | + }, { | |
| 18699 | + key: "events", | |
| 18700 | + value: function events() { | |
| 18701 | + return { | |
| 18702 | + 'click @ui.addSectionButton': 'onAddSectionButtonClick', | |
| 18703 | + 'click @ui.addTemplateButton': 'onAddTemplateButtonClick', | |
| 18704 | + 'click @ui.closeButton': 'onCloseButtonClick', | |
| 18705 | + 'click @ui.presets': 'onPresetSelected', | |
| 18706 | + 'click @ui.containerPresets': 'onContainerPresetSelected' | |
| 18707 | + }; | |
| 18708 | + } | |
| 18709 | + }, { | |
| 18710 | + key: "behaviors", | |
| 18711 | + value: function behaviors() { | |
| 18712 | + return { | |
| 18713 | + contextMenu: { | |
| 18714 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/context-menu */ "../assets/dev/js/editor/elements/views/behaviors/context-menu.js"), | |
| 18715 | + groups: this.getContextMenuGroups() | |
| 18716 | + } | |
| 18717 | + }; | |
| 18718 | + } | |
| 18719 | + }, { | |
| 18720 | + key: "className", | |
| 18721 | + value: function className() { | |
| 18722 | + return 'elementor-add-section elementor-visible-desktop'; | |
| 18723 | + } | |
| 18724 | + }, { | |
| 18725 | + key: "setView", | |
| 18726 | + value: function setView(view) { | |
| 18727 | + this.$el.attr('data-view', view); | |
| 18728 | + } | |
| 18729 | + }, { | |
| 18730 | + key: "showSelectPresets", | |
| 18731 | + value: function showSelectPresets() { | |
| 18732 | + this.setView(AddSectionBase.VIEW_SELECT_PRESET); | |
| 18733 | + } | |
| 18734 | + }, { | |
| 18735 | + key: "closeSelectPresets", | |
| 18736 | + value: function closeSelectPresets() { | |
| 18737 | + this.setView(AddSectionBase.VIEW_CHOOSE_ACTION); | |
| 18738 | + } | |
| 18739 | + }, { | |
| 18740 | + key: "getTemplatesModalOptions", | |
| 18741 | + value: function getTemplatesModalOptions() { | |
| 18742 | + return { | |
| 18743 | + importOptions: { | |
| 18744 | + at: this.getOption('at') | |
| 18745 | + } | |
| 18746 | + }; | |
| 18747 | + } | |
| 18748 | + }, { | |
| 18749 | + key: "getContextMenuGroups", | |
| 18750 | + value: function getContextMenuGroups() { | |
| 18751 | + var _this = this; | |
| 18752 | + | |
| 18753 | + var hasContent = function hasContent() { | |
| 18754 | + return elementor.elements.length > 0; | |
| 18755 | + }; | |
| 18756 | + | |
| 18757 | + return [{ | |
| 18758 | + name: 'paste', | |
| 18759 | + actions: [{ | |
| 18760 | + name: 'paste', | |
| 18761 | + title: __('Paste', 'elementor'), | |
| 18762 | + isEnabled: function isEnabled() { | |
| 18763 | + return $e.components.get('document/elements').utils.isPasteEnabled(elementor.getPreviewContainer()); | |
| 18764 | + }, | |
| 18765 | + callback: function callback() { | |
| 18766 | + return $e.run('document/ui/paste', { | |
| 18767 | + container: elementor.getPreviewContainer(), | |
| 18768 | + options: { | |
| 18769 | + at: _this.getOption('at'), | |
| 18770 | + rebuild: true | |
| 18771 | + }, | |
| 18772 | + onAfter: function onAfter() { | |
| 18773 | + return _this.onAfterPaste(); | |
| 18774 | + } | |
| 18775 | + }); | |
| 18776 | + } | |
| 18777 | + }] | |
| 18778 | + }, { | |
| 18779 | + name: 'content', | |
| 18780 | + actions: [{ | |
| 18781 | + name: 'copy_all_content', | |
| 18782 | + title: __('Copy All Content', 'elementor'), | |
| 18783 | + isEnabled: hasContent, | |
| 18784 | + callback: function callback() { | |
| 18785 | + return $e.run('document/elements/copy-all'); | |
| 18786 | + } | |
| 18787 | + }, { | |
| 18788 | + name: 'delete_all_content', | |
| 18789 | + title: __('Delete All Content', 'elementor'), | |
| 18790 | + isEnabled: hasContent, | |
| 18791 | + callback: function callback() { | |
| 18792 | + return $e.run('document/elements/empty'); | |
| 18793 | + } | |
| 18794 | + }] | |
| 18795 | + }]; | |
| 18796 | + } | |
| 18797 | + }, { | |
| 18798 | + key: "onAddSectionButtonClick", | |
| 18799 | + value: function onAddSectionButtonClick() { | |
| 18800 | + this.showSelectPresets(); | |
| 18801 | + } | |
| 18802 | + }, { | |
| 18803 | + key: "onAddTemplateButtonClick", | |
| 18804 | + value: function onAddTemplateButtonClick() { | |
| 18805 | + $e.run('library/open', this.getTemplatesModalOptions()); | |
| 18806 | + } | |
| 18807 | + }, { | |
| 18808 | + key: "onRender", | |
| 18809 | + value: function onRender() { | |
| 18810 | + this.$el.html5Droppable(_objectSpread({ | |
| 18811 | + axis: ['vertical'], | |
| 18812 | + groups: ['elementor-element'], | |
| 18813 | + placeholder: false, | |
| 18814 | + currentElementClass: 'elementor-html5dnd-current-element', | |
| 18815 | + hasDraggingOnChildClass: 'elementor-dragging-on-child' | |
| 18816 | + }, this.getDroppableOptions())); | |
| 18817 | + } | |
| 18818 | + }, { | |
| 18819 | + key: "getDroppableOptions", | |
| 18820 | + value: function getDroppableOptions() { | |
| 18821 | + var _this2 = this; | |
| 18822 | + | |
| 18823 | + return { | |
| 18824 | + onDropping: function onDropping(side, event) { | |
| 18825 | + elementor.getPreviewView().onDrop(event, { | |
| 18826 | + side: side, | |
| 18827 | + at: _this2.getOption('at') | |
| 18828 | + }); | |
| 18829 | + } | |
| 18830 | + }; | |
| 18831 | + } | |
| 18832 | + }, { | |
| 18833 | + key: "onPresetSelected", | |
| 18834 | + value: function onPresetSelected(event) { | |
| 18835 | + this.closeSelectPresets(); | |
| 18836 | + var selectedStructure = event.currentTarget.dataset.structure, | |
| 18837 | + parsedStructure = elementor.presetsFactory.getParsedStructure(selectedStructure); | |
| 18838 | + $e.run('document/elements/create', { | |
| 18839 | + model: { | |
| 18840 | + elType: 'section' | |
| 18841 | + }, | |
| 18842 | + container: elementor.getPreviewContainer(), | |
| 18843 | + columns: parsedStructure.columnsCount, | |
| 18844 | + structure: selectedStructure, | |
| 18845 | + options: Object.assign({}, this.options) | |
| 18846 | + }); | |
| 18847 | + } | |
| 18848 | + /** | |
| 18849 | + * Create a Container preset when the user chooses a preset. | |
| 18850 | + * | |
| 18851 | + * @param {MouseEvent} e - Click event. | |
| 18852 | + * | |
| 18853 | + * @return {Container} container | |
| 18854 | + */ | |
| 18855 | + | |
| 18856 | + }, { | |
| 18857 | + key: "onContainerPresetSelected", | |
| 18858 | + value: function onContainerPresetSelected(e) { | |
| 18859 | + this.closeSelectPresets(); | |
| 18860 | + return _containerHelper.default.createContainerFromPreset(e.currentTarget.dataset.preset, elementor.getPreviewContainer(), this.options); | |
| 18861 | + } | |
| 18862 | + }, { | |
| 18863 | + key: "onDropping", | |
| 18864 | + value: function onDropping() { | |
| 18865 | + if (elementor.helpers.maybeDisableWidget()) { | |
| 18866 | + return; | |
| 18867 | + } | |
| 18868 | + | |
| 18869 | + var selectedElement = elementor.channels.panelElements.request('element:selected'), | |
| 18870 | + historyId = $e.internal('document/history/start-log', { | |
| 18871 | + type: 'add', | |
| 18872 | + title: elementor.helpers.getModelLabel(selectedElement.model) | |
| 18873 | + }), | |
| 18874 | + containingElement = $e.run('document/elements/create', { | |
| 18875 | + model: { | |
| 18876 | + elType: AddSectionBase.IS_CONTAINER_ACTIVE ? 'container' : 'section' | |
| 18877 | + }, | |
| 18878 | + container: elementor.getPreviewContainer(), | |
| 18879 | + columns: 1, | |
| 18880 | + options: { | |
| 18881 | + at: this.getOption('at') | |
| 18882 | + } | |
| 18883 | + }); | |
| 18884 | + | |
| 18885 | + if (!AddSectionBase.IS_CONTAINER_ACTIVE) { | |
| 18886 | + // Create the element in column. | |
| 18887 | + containingElement.view.children.findByIndex(0).addElementFromPanel(); | |
| 18888 | + } else if ('container' !== selectedElement.model.get('elType')) { | |
| 18889 | + // Create the element in a Container, only if the dragged element is not a Container already. | |
| 18890 | + containingElement.view.addElementFromPanel(); | |
| 18891 | + } | |
| 18892 | + | |
| 18893 | + $e.internal('document/history/end-log', { | |
| 18894 | + id: historyId | |
| 18895 | + }); | |
| 18896 | + } | |
| 18897 | + }, { | |
| 18898 | + key: "onAfterPaste", | |
| 18899 | + value: function onAfterPaste() {} | |
| 18900 | + }]); | |
| 18901 | + return AddSectionBase; | |
| 18902 | +}(Marionette.ItemView); | |
| 18903 | + | |
| 18904 | +(0, _defineProperty2.default)(AddSectionBase, "IS_CONTAINER_ACTIVE", !!elementorCommon.config.experimentalFeatures.container); | |
| 18905 | +(0, _defineProperty2.default)(AddSectionBase, "VIEW_CHOOSE_ACTION", 'choose-action'); | |
| 18906 | +(0, _defineProperty2.default)(AddSectionBase, "VIEW_SELECT_PRESET", AddSectionBase.IS_CONTAINER_ACTIVE ? 'select-container-preset' : 'select-preset'); | |
| 18907 | +var _default = AddSectionBase; | |
| 18908 | +exports["default"] = _default; | |
| 18909 | + | |
| 18910 | +/***/ }), | |
| 18911 | + | |
| 18912 | +/***/ "../assets/dev/js/editor/views/add-section/inline.js": | |
| 18913 | +/*!***********************************************************!*\ | |
| 18914 | + !*** ../assets/dev/js/editor/views/add-section/inline.js ***! | |
| 18915 | + \***********************************************************/ | |
| 18916 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 18917 | + | |
| 18918 | +"use strict"; | |
| 18919 | + | |
| 18920 | + | |
| 18921 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 18922 | + | |
| 18923 | +Object.defineProperty(exports, "__esModule", ({ | |
| 18924 | + value: true | |
| 18925 | +})); | |
| 18926 | +exports["default"] = void 0; | |
| 18927 | + | |
| 18928 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 18929 | + | |
| 18930 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 18931 | + | |
| 18932 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 18933 | + | |
| 18934 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 18935 | + | |
| 18936 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 18937 | + | |
| 18938 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 18939 | + | |
| 18940 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../assets/dev/js/editor/views/add-section/base.js")); | |
| 18941 | + | |
| 18942 | +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); }; } | |
| 18943 | + | |
| 18944 | +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; } } | |
| 18945 | + | |
| 18946 | +var AddSectionView = /*#__PURE__*/function (_BaseAddSectionView) { | |
| 18947 | + (0, _inherits2.default)(AddSectionView, _BaseAddSectionView); | |
| 18948 | + | |
| 18949 | + var _super = _createSuper(AddSectionView); | |
| 18950 | + | |
| 18951 | + function AddSectionView() { | |
| 18952 | + (0, _classCallCheck2.default)(this, AddSectionView); | |
| 18953 | + return _super.apply(this, arguments); | |
| 18954 | + } | |
| 18955 | + | |
| 18956 | + (0, _createClass2.default)(AddSectionView, [{ | |
| 18957 | + key: "className", | |
| 18958 | + value: function className() { | |
| 18959 | + return (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "className", this).call(this) + ' elementor-add-section-inline'; | |
| 18960 | + } | |
| 18961 | + }, { | |
| 18962 | + key: "fadeToDeath", | |
| 18963 | + value: function fadeToDeath() { | |
| 18964 | + var self = this; | |
| 18965 | + self.$el.slideUp(function () { | |
| 18966 | + self.destroy(); | |
| 18967 | + }); | |
| 18968 | + } | |
| 18969 | + }, { | |
| 18970 | + key: "onAfterPaste", | |
| 18971 | + value: function onAfterPaste() { | |
| 18972 | + (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onAfterPaste", this).call(this); | |
| 18973 | + this.destroy(); | |
| 18974 | + } | |
| 18975 | + }, { | |
| 18976 | + key: "onCloseButtonClick", | |
| 18977 | + value: function onCloseButtonClick() { | |
| 18978 | + this.fadeToDeath(); | |
| 18979 | + } | |
| 18980 | + }, { | |
| 18981 | + key: "onPresetSelected", | |
| 18982 | + value: function onPresetSelected(event) { | |
| 18983 | + (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onPresetSelected", this).call(this, event); | |
| 18984 | + this.destroy(); | |
| 18985 | + } | |
| 18986 | + }, { | |
| 18987 | + key: "onContainerPresetSelected", | |
| 18988 | + value: function onContainerPresetSelected(e) { | |
| 18989 | + (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onContainerPresetSelected", this).call(this, e); | |
| 18990 | + this.destroy(); | |
| 18991 | + } | |
| 18992 | + }, { | |
| 18993 | + key: "onAddTemplateButtonClick", | |
| 18994 | + value: function onAddTemplateButtonClick() { | |
| 18995 | + (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onAddTemplateButtonClick", this).call(this); | |
| 18996 | + this.destroy(); | |
| 18997 | + } | |
| 18998 | + }, { | |
| 18999 | + key: "getDroppableOptions", | |
| 19000 | + value: function getDroppableOptions() { | |
| 19001 | + var _this = this; | |
| 19002 | + | |
| 19003 | + return { | |
| 19004 | + onDropping: function onDropping(side, event) { | |
| 19005 | + (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "getDroppableOptions", _this).call(_this).onDropping(side, event); | |
| 19006 | + | |
| 19007 | + _this.destroy(); | |
| 19008 | + } | |
| 19009 | + }; | |
| 19010 | + } | |
| 19011 | + }, { | |
| 19012 | + key: "onDropping", | |
| 19013 | + value: function onDropping() { | |
| 19014 | + var droppableOptions = this.getDroppableOptions(); | |
| 19015 | + (0, _get2.default)((0, _getPrototypeOf2.default)(AddSectionView.prototype), "onDropping", this).call(this); | |
| 19016 | + | |
| 19017 | + if (droppableOptions.onDropping) { | |
| 19018 | + droppableOptions.onDropping(); | |
| 19019 | + } | |
| 19020 | + } | |
| 19021 | + }]); | |
| 19022 | + return AddSectionView; | |
| 19023 | +}(_base.default); | |
| 19024 | + | |
| 19025 | +var _default = AddSectionView; | |
| 19026 | +exports["default"] = _default; | |
| 19027 | + | |
| 19028 | +/***/ }), | |
| 19029 | + | |
| 19030 | +/***/ "../assets/dev/js/editor/views/base-container.js": | |
| 19031 | +/*!*******************************************************!*\ | |
| 19032 | + !*** ../assets/dev/js/editor/views/base-container.js ***! | |
| 19033 | + \*******************************************************/ | |
| 19034 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 19035 | + | |
| 19036 | +"use strict"; | |
| 19037 | + | |
| 19038 | + | |
| 19039 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 19040 | + | |
| 19041 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 19042 | + | |
| 19043 | +module.exports = Marionette.CompositeView.extend({ | |
| 19044 | + templateHelpers: function templateHelpers() { | |
| 19045 | + return { | |
| 19046 | + view: this | |
| 19047 | + }; | |
| 19048 | + }, | |
| 19049 | + getBehavior: function getBehavior(name) { | |
| 19050 | + return this._behaviors[Object.keys(this.behaviors()).indexOf(name)]; | |
| 19051 | + }, | |
| 19052 | + initialize: function initialize() { | |
| 19053 | + this.collection = this.model.get('elements'); | |
| 19054 | + }, | |
| 19055 | + addChildModel: function addChildModel(model, options) { | |
| 19056 | + return this.collection.add(model, options, true); | |
| 19057 | + }, | |
| 19058 | + addElement: function addElement(data, options) { | |
| 19059 | + if (this.isCollectionFilled()) { | |
| 19060 | + return; | |
| 19061 | + } | |
| 19062 | + | |
| 19063 | + options = jQuery.extend({ | |
| 19064 | + trigger: false, | |
| 19065 | + edit: true, | |
| 19066 | + onBeforeAdd: null, | |
| 19067 | + onAfterAdd: null | |
| 19068 | + }, options); | |
| 19069 | + var childTypes = this.getChildType(); | |
| 19070 | + var newItem, elType; | |
| 19071 | + | |
| 19072 | + if (data instanceof Backbone.Model) { | |
| 19073 | + newItem = data; | |
| 19074 | + elType = newItem.get('elType'); | |
| 19075 | + } else { | |
| 19076 | + newItem = { | |
| 19077 | + id: elementorCommon.helpers.getUniqueId(), | |
| 19078 | + elType: childTypes[0], | |
| 19079 | + settings: {}, | |
| 19080 | + elements: [] | |
| 19081 | + }; | |
| 19082 | + | |
| 19083 | + if (data) { | |
| 19084 | + jQuery.extend(newItem, data); | |
| 19085 | + } | |
| 19086 | + | |
| 19087 | + elType = newItem.elType; | |
| 19088 | + } | |
| 19089 | + | |
| 19090 | + if (-1 === childTypes.indexOf(elType)) { | |
| 19091 | + return this.children.last().addElement(newItem, options); | |
| 19092 | + } | |
| 19093 | + | |
| 19094 | + if (options.clone) { | |
| 19095 | + newItem = this.cloneItem(newItem); | |
| 19096 | + } | |
| 19097 | + | |
| 19098 | + if (options.trigger) { | |
| 19099 | + elementor.channels.data.trigger(options.trigger.beforeAdd, newItem); | |
| 19100 | + } | |
| 19101 | + | |
| 19102 | + if (options.onBeforeAdd) { | |
| 19103 | + options.onBeforeAdd(); | |
| 19104 | + } | |
| 19105 | + | |
| 19106 | + var newModel = this.addChildModel(newItem, { | |
| 19107 | + at: options.at | |
| 19108 | + }), | |
| 19109 | + newView = this.children.findByModel(newModel); | |
| 19110 | + | |
| 19111 | + if (options.onAfterAdd) { | |
| 19112 | + options.onAfterAdd(newModel, newView); | |
| 19113 | + } | |
| 19114 | + | |
| 19115 | + if (options.trigger) { | |
| 19116 | + elementor.channels.data.trigger(options.trigger.afterAdd, newItem); | |
| 19117 | + } | |
| 19118 | + | |
| 19119 | + if (options.edit && elementor.documents.getCurrent().history.getActive()) { | |
| 19120 | + // Ensure container is created. TODO: Open editor via UI hook after `document/elements/create`. | |
| 19121 | + newView.getContainer(); | |
| 19122 | + newModel.trigger('request:edit', { | |
| 19123 | + scrollIntoView: options.scrollIntoView | |
| 19124 | + }); | |
| 19125 | + } | |
| 19126 | + | |
| 19127 | + return newView; | |
| 19128 | + }, | |
| 19129 | + createElementFromContainer: function createElementFromContainer(container) { | |
| 19130 | + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 19131 | + return this.createElementFromModel(container.model, options); | |
| 19132 | + }, | |
| 19133 | + createElementFromModel: function createElementFromModel(model) { | |
| 19134 | + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 19135 | + | |
| 19136 | + if (model instanceof Backbone.Model) { | |
| 19137 | + model = model.toJSON(); | |
| 19138 | + } | |
| 19139 | + | |
| 19140 | + if (elementor.helpers.maybeDisableWidget(model.widgetType)) { | |
| 19141 | + return; | |
| 19142 | + } | |
| 19143 | + | |
| 19144 | + model = Object.assign(model, model.custom); // Check whether the container cannot contain a section, in which case we should use an inner-section. | |
| 19145 | + | |
| 19146 | + if ('section' === model.elType) { | |
| 19147 | + model.isInner = true; | |
| 19148 | + } | |
| 19149 | + | |
| 19150 | + var historyId = $e.internal('document/history/start-log', { | |
| 19151 | + type: this.getHistoryType(options.event), | |
| 19152 | + title: elementor.helpers.getModelLabel(model) | |
| 19153 | + }); | |
| 19154 | + var container = this.getContainer(); | |
| 19155 | + | |
| 19156 | + if (options.shouldWrap) { | |
| 19157 | + var containerExperiment = elementorCommon.config.experimentalFeatures.container; | |
| 19158 | + container = $e.run('document/elements/create', { | |
| 19159 | + model: { | |
| 19160 | + elType: containerExperiment ? 'container' : 'section' | |
| 19161 | + }, | |
| 19162 | + container: container, | |
| 19163 | + columns: Number(!containerExperiment), | |
| 19164 | + options: { | |
| 19165 | + at: options.at | |
| 19166 | + } | |
| 19167 | + }); // Since wrapping an element with container doesn't produce a column, we shouldn't try to access it. | |
| 19168 | + | |
| 19169 | + if (!containerExperiment) { | |
| 19170 | + container = container.view.children.findByIndex(0).getContainer(); | |
| 19171 | + } | |
| 19172 | + } // Create the element in column. | |
| 19173 | + | |
| 19174 | + | |
| 19175 | + var widget = $e.run('document/elements/create', { | |
| 19176 | + container: container, | |
| 19177 | + model: model, | |
| 19178 | + options: options | |
| 19179 | + }); | |
| 19180 | + $e.internal('document/history/end-log', { | |
| 19181 | + id: historyId | |
| 19182 | + }); | |
| 19183 | + return widget; | |
| 19184 | + }, | |
| 19185 | + onDrop: function onDrop(event, options) { | |
| 19186 | + var _elementor$channels$p; | |
| 19187 | + | |
| 19188 | + var input = event.originalEvent.dataTransfer.files; | |
| 19189 | + | |
| 19190 | + if (input.length) { | |
| 19191 | + $e.run('editor/browser-import/import', { | |
| 19192 | + input: input, | |
| 19193 | + target: this.getContainer(), | |
| 19194 | + options: { | |
| 19195 | + event: event, | |
| 19196 | + target: { | |
| 19197 | + at: options.at | |
| 19198 | + } | |
| 19199 | + } | |
| 19200 | + }); | |
| 19201 | + return; | |
| 19202 | + } | |
| 19203 | + | |
| 19204 | + this.createElementFromModel(Object.fromEntries(Object.entries((_elementor$channels$p = elementor.channels.panelElements.request('element:selected')) === null || _elementor$channels$p === void 0 ? void 0 : _elementor$channels$p.model.attributes) // The `custom` property is responsible for storing global-widgets related data. | |
| 19205 | + .filter(function (_ref) { | |
| 19206 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 1), | |
| 19207 | + key = _ref2[0]; | |
| 19208 | + | |
| 19209 | + return ['elType', 'widgetType', 'custom'].includes(key); | |
| 19210 | + })), options); | |
| 19211 | + }, | |
| 19212 | + getHistoryType: function getHistoryType(event) { | |
| 19213 | + if (event) { | |
| 19214 | + if (event.originalEvent) { | |
| 19215 | + event = event.originalEvent; | |
| 19216 | + } | |
| 19217 | + | |
| 19218 | + switch (event.constructor.name) { | |
| 19219 | + case 'DragEvent': | |
| 19220 | + return 'import'; | |
| 19221 | + | |
| 19222 | + case 'ClipboardEvent': | |
| 19223 | + return 'paste'; | |
| 19224 | + } | |
| 19225 | + } | |
| 19226 | + | |
| 19227 | + return 'add'; | |
| 19228 | + }, | |
| 19229 | + cloneItem: function cloneItem(item) { | |
| 19230 | + var self = this; | |
| 19231 | + | |
| 19232 | + if (item instanceof Backbone.Model) { | |
| 19233 | + return item.clone(); | |
| 19234 | + } | |
| 19235 | + | |
| 19236 | + item.id = elementorCommon.helpers.getUniqueId(); | |
| 19237 | + item.settings._element_id = ''; | |
| 19238 | + item.elements.forEach(function (childItem, index) { | |
| 19239 | + item.elements[index] = self.cloneItem(childItem); | |
| 19240 | + }); | |
| 19241 | + return item; | |
| 19242 | + }, | |
| 19243 | + lookup: function lookup() { | |
| 19244 | + var element = this; | |
| 19245 | + | |
| 19246 | + if (element.isDisconnected()) { | |
| 19247 | + element = $e.components.get('document').utils.findViewById(element.model.id); | |
| 19248 | + } | |
| 19249 | + | |
| 19250 | + return element; | |
| 19251 | + }, | |
| 19252 | + isDisconnected: function isDisconnected() { | |
| 19253 | + return this.isDestroyed || !this.el.isConnected; | |
| 19254 | + }, | |
| 19255 | + isCollectionFilled: function isCollectionFilled() { | |
| 19256 | + return false; | |
| 19257 | + } | |
| 19258 | +}); | |
| 19259 | + | |
| 19260 | +/***/ }), | |
| 19261 | + | |
| 428 | 19262 | /***/ "../assets/dev/js/modules/imports/args-object.js": |
| 429 | 19263 | /*!*******************************************************!*\ |
| 430 | 19264 | !*** ../assets/dev/js/modules/imports/args-object.js ***! |
| 431 | 19265 | \*******************************************************/ |
| @@ -434,23 +19268,39 @@ | ||
| 434 | 19268 | "use strict"; |
| 435 | 19269 | |
| 436 | 19270 | |
| 437 | 19271 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 19272 | + | |
| 438 | 19273 | Object.defineProperty(exports, "__esModule", ({ |
| 439 | 19274 | value: true |
| 440 | 19275 | })); |
| 441 | 19276 | exports["default"] = void 0; |
| 19277 | + | |
| 442 | 19278 | var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); |
| 19279 | + | |
| 443 | 19280 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 19281 | + | |
| 444 | 19282 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 19283 | + | |
| 19284 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 19285 | + | |
| 445 | 19286 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 19287 | + | |
| 446 | 19288 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 447 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 19289 | + | |
| 448 | 19290 | var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js")); |
| 19291 | + | |
| 449 | 19292 | var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js")); |
| 450 | -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 451 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 452 | -var ArgsObject = exports["default"] = /*#__PURE__*/function (_InstanceType) { | |
| 19293 | + | |
| 19294 | +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); }; } | |
| 19295 | + | |
| 19296 | +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; } } | |
| 19297 | + | |
| 19298 | +var ArgsObject = /*#__PURE__*/function (_InstanceType) { | |
| 19299 | + (0, _inherits2.default)(ArgsObject, _InstanceType); | |
| 19300 | + | |
| 19301 | + var _super = _createSuper(ArgsObject); | |
| 19302 | + | |
| 453 | 19303 | /** |
| 454 | 19304 | * Function constructor(). |
| 455 | 19305 | * |
| 456 | 19306 | * Create ArgsObject. |
| @@ -458,14 +19308,14 @@ | ||
| 458 | 19308 | * @param {{}} args |
| 459 | 19309 | */ |
| 460 | 19310 | function ArgsObject(args) { |
| 461 | 19311 | var _this; |
| 19312 | + | |
| 462 | 19313 | (0, _classCallCheck2.default)(this, ArgsObject); |
| 463 | - _this = _callSuper(this, ArgsObject); | |
| 19314 | + _this = _super.call(this); | |
| 464 | 19315 | _this.args = args; |
| 465 | 19316 | return _this; |
| 466 | 19317 | } |
| 467 | - | |
| 468 | 19318 | /** |
| 469 | 19319 | * Function requireArgument(). |
| 470 | 19320 | * |
| 471 | 19321 | * Validate property in args. |
| @@ -473,19 +19323,21 @@ | ||
| 473 | 19323 | * @param {string} property |
| 474 | 19324 | * @param {{}} args |
| 475 | 19325 | * |
| 476 | 19326 | * @throws {Error} |
| 19327 | + * | |
| 477 | 19328 | */ |
| 478 | - (0, _inherits2.default)(ArgsObject, _InstanceType); | |
| 479 | - return (0, _createClass2.default)(ArgsObject, [{ | |
| 19329 | + | |
| 19330 | + | |
| 19331 | + (0, _createClass2.default)(ArgsObject, [{ | |
| 480 | 19332 | key: "requireArgument", |
| 481 | 19333 | value: function requireArgument(property) { |
| 482 | 19334 | var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args; |
| 483 | - if (!Object.prototype.hasOwnProperty.call(args, property)) { | |
| 19335 | + | |
| 19336 | + if (!args.hasOwnProperty(property)) { | |
| 484 | 19337 | throw Error("".concat(property, " is required.")); |
| 485 | 19338 | } |
| 486 | 19339 | } |
| 487 | - | |
| 488 | 19340 | /** |
| 489 | 19341 | * Function requireArgumentType(). |
| 490 | 19342 | * |
| 491 | 19343 | * Validate property in args using `type === typeof(args.whatever)`. |
| @@ -494,19 +19346,21 @@ | ||
| 494 | 19346 | * @param {string} type |
| 495 | 19347 | * @param {{}} args |
| 496 | 19348 | * |
| 497 | 19349 | * @throws {Error} |
| 19350 | + * | |
| 498 | 19351 | */ |
| 19352 | + | |
| 499 | 19353 | }, { |
| 500 | 19354 | key: "requireArgumentType", |
| 501 | 19355 | value: function requireArgumentType(property, type) { |
| 502 | 19356 | var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; |
| 503 | 19357 | this.requireArgument(property, args); |
| 19358 | + | |
| 504 | 19359 | if ((0, _typeof2.default)(args[property]) !== type) { |
| 505 | 19360 | throw Error("".concat(property, " invalid type: ").concat(type, ".")); |
| 506 | 19361 | } |
| 507 | 19362 | } |
| 508 | - | |
| 509 | 19363 | /** |
| 510 | 19364 | * Function requireArgumentInstance(). |
| 511 | 19365 | * |
| 512 | 19366 | * Validate property in args using `args.whatever instanceof instance`. |
| @@ -515,19 +19369,21 @@ | ||
| 515 | 19369 | * @param {*} instance |
| 516 | 19370 | * @param {{}} args |
| 517 | 19371 | * |
| 518 | 19372 | * @throws {Error} |
| 19373 | + * | |
| 519 | 19374 | */ |
| 19375 | + | |
| 520 | 19376 | }, { |
| 521 | 19377 | key: "requireArgumentInstance", |
| 522 | 19378 | value: function requireArgumentInstance(property, instance) { |
| 523 | 19379 | var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; |
| 524 | 19380 | this.requireArgument(property, args); |
| 19381 | + | |
| 525 | 19382 | if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) { |
| 526 | 19383 | throw Error("".concat(property, " invalid instance.")); |
| 527 | 19384 | } |
| 528 | 19385 | } |
| 529 | - | |
| 530 | 19386 | /** |
| 531 | 19387 | * Function requireArgumentConstructor(). |
| 532 | 19388 | * |
| 533 | 19389 | * Validate property in args using `type === args.whatever.constructor`. |
| @@ -536,17 +19392,18 @@ | ||
| 536 | 19392 | * @param {*} type |
| 537 | 19393 | * @param {{}} args |
| 538 | 19394 | * |
| 539 | 19395 | * @throws {Error} |
| 19396 | + * | |
| 540 | 19397 | */ |
| 19398 | + | |
| 541 | 19399 | }, { |
| 542 | 19400 | key: "requireArgumentConstructor", |
| 543 | 19401 | value: function requireArgumentConstructor(property, type) { |
| 544 | 19402 | var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; |
| 545 | - this.requireArgument(property, args); | |
| 19403 | + this.requireArgument(property, args); // Note: Converting the constructor to string in order to avoid equation issues | |
| 19404 | + // due to different memory addresses between iframes (window.Object !== window.top.Object). | |
| 546 | 19405 | |
| 547 | - // Note: Converting the constructor to string in order to avoid equation issues | |
| 548 | - // due to different memory addresses between iframes (window.Object !== window.top.Object). | |
| 549 | 19406 | if (args[property].constructor.toString() !== type.prototype.constructor.toString()) { |
| 550 | 19407 | throw Error("".concat(property, " invalid constructor type.")); |
| 551 | 19408 | } |
| 552 | 19409 | } |
| @@ -555,10 +19412,13 @@ | ||
| 555 | 19412 | value: function getInstanceType() { |
| 556 | 19413 | return 'ArgsObject'; |
| 557 | 19414 | } |
| 558 | 19415 | }]); |
| 19416 | + return ArgsObject; | |
| 559 | 19417 | }(_instanceType.default); |
| 560 | 19418 | |
| 19419 | +exports["default"] = ArgsObject; | |
| 19420 | + | |
| 561 | 19421 | /***/ }), |
| 562 | 19422 | |
| 563 | 19423 | /***/ "../assets/dev/js/modules/imports/instance-type.js": |
| 564 | 19424 | /*!*********************************************************!*\ |
| @@ -569,34 +19429,43 @@ | ||
| 569 | 19429 | "use strict"; |
| 570 | 19430 | |
| 571 | 19431 | |
| 572 | 19432 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 19433 | + | |
| 573 | 19434 | Object.defineProperty(exports, "__esModule", ({ |
| 574 | 19435 | value: true |
| 575 | 19436 | })); |
| 576 | 19437 | exports["default"] = void 0; |
| 19438 | + | |
| 577 | 19439 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 19440 | + | |
| 578 | 19441 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 19442 | + | |
| 19443 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 19444 | + | |
| 579 | 19445 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 580 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 581 | -function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } | |
| 582 | -var InstanceType = exports["default"] = /*#__PURE__*/function () { | |
| 19446 | + | |
| 19447 | +var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) { | |
| 583 | 19448 | function InstanceType() { |
| 584 | 19449 | var _this = this; |
| 19450 | + | |
| 585 | 19451 | (0, _classCallCheck2.default)(this, InstanceType); |
| 586 | 19452 | // Since anonymous classes sometimes do not get validated by babel, do it manually. |
| 587 | 19453 | var target = this instanceof InstanceType ? this.constructor : void 0; |
| 588 | 19454 | var prototypes = []; |
| 19455 | + | |
| 589 | 19456 | while (target.__proto__ && target.__proto__.name) { |
| 590 | 19457 | prototypes.push(target.__proto__); |
| 591 | 19458 | target = target.__proto__; |
| 592 | 19459 | } |
| 19460 | + | |
| 593 | 19461 | prototypes.reverse().forEach(function (proto) { |
| 594 | 19462 | return _this instanceof proto; |
| 595 | 19463 | }); |
| 596 | 19464 | } |
| 597 | - return (0, _createClass2.default)(InstanceType, null, [{ | |
| 598 | - key: Symbol.hasInstance, | |
| 19465 | + | |
| 19466 | + (0, _createClass2.default)(InstanceType, null, [{ | |
| 19467 | + key: _Symbol$hasInstance, | |
| 599 | 19468 | value: function value(target) { |
| 600 | 19469 | /** |
| 601 | 19470 | * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class |
| 602 | 19471 | * its give's opportunity to mange capabilities of instanceOf operator. |
| @@ -601,34 +19470,39 @@ | ||
| 601 | 19470 | * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class |
| 602 | 19471 | * its give's opportunity to mange capabilities of instanceOf operator. |
| 603 | 19472 | * saving current class each time will give option later to handle instanceOf manually. |
| 604 | 19473 | */ |
| 605 | - var result = _superPropGet(InstanceType, Symbol.hasInstance, this, 2)([target]); | |
| 19474 | + var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target); // Act normal when validate a class, which does not have instance type. | |
| 606 | 19475 | |
| 607 | - // Act normal when validate a class, which does not have instance type. | |
| 608 | 19476 | if (target && !target.constructor.getInstanceType) { |
| 609 | 19477 | return result; |
| 610 | 19478 | } |
| 19479 | + | |
| 611 | 19480 | if (target) { |
| 612 | 19481 | if (!target.instanceTypes) { |
| 613 | 19482 | target.instanceTypes = []; |
| 614 | 19483 | } |
| 19484 | + | |
| 615 | 19485 | if (!result) { |
| 616 | 19486 | if (this.getInstanceType() === target.constructor.getInstanceType()) { |
| 617 | 19487 | result = true; |
| 618 | 19488 | } |
| 619 | 19489 | } |
| 19490 | + | |
| 620 | 19491 | if (result) { |
| 621 | 19492 | var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType(); |
| 19493 | + | |
| 622 | 19494 | if (-1 === target.instanceTypes.indexOf(name)) { |
| 623 | 19495 | target.instanceTypes.push(name); |
| 624 | 19496 | } |
| 625 | 19497 | } |
| 626 | 19498 | } |
| 19499 | + | |
| 627 | 19500 | if (!result && target) { |
| 628 | 19501 | // Check if the given 'target', is instance of known types. |
| 629 | 19502 | result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType()); |
| 630 | 19503 | } |
| 19504 | + | |
| 631 | 19505 | return result; |
| 632 | 19506 | } |
| 633 | 19507 | }, { |
| 634 | 19508 | key: "getInstanceType", |
| @@ -635,16 +19509,289 @@ | ||
| 635 | 19509 | value: function getInstanceType() { |
| 636 | 19510 | elementorModules.ForceMethodImplementation(); |
| 637 | 19511 | } |
| 638 | 19512 | }]); |
| 639 | -}(); | |
| 19513 | + return InstanceType; | |
| 19514 | +}(Symbol.hasInstance); | |
| 640 | 19515 | |
| 19516 | +exports["default"] = InstanceType; | |
| 19517 | + | |
| 641 | 19518 | /***/ }), |
| 642 | 19519 | |
| 643 | -/***/ "../modules/web-cli/assets/js/modules/command-base.js": | |
| 644 | -/*!************************************************************!*\ | |
| 645 | - !*** ../modules/web-cli/assets/js/modules/command-base.js ***! | |
| 646 | - \************************************************************/ | |
| 19520 | +/***/ "../assets/dev/js/modules/imports/module.js": | |
| 19521 | +/*!**************************************************!*\ | |
| 19522 | + !*** ../assets/dev/js/modules/imports/module.js ***! | |
| 19523 | + \**************************************************/ | |
| 19524 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 19525 | + | |
| 19526 | +"use strict"; | |
| 19527 | + | |
| 19528 | + | |
| 19529 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 19530 | + | |
| 19531 | +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 19532 | + | |
| 19533 | +var Module = function Module() { | |
| 19534 | + var $ = jQuery, | |
| 19535 | + instanceParams = arguments, | |
| 19536 | + self = this, | |
| 19537 | + events = {}; | |
| 19538 | + var settings; | |
| 19539 | + | |
| 19540 | + var ensureClosureMethods = function ensureClosureMethods() { | |
| 19541 | + $.each(self, function (methodName) { | |
| 19542 | + var oldMethod = self[methodName]; | |
| 19543 | + | |
| 19544 | + if ('function' !== typeof oldMethod) { | |
| 19545 | + return; | |
| 19546 | + } | |
| 19547 | + | |
| 19548 | + self[methodName] = function () { | |
| 19549 | + return oldMethod.apply(self, arguments); | |
| 19550 | + }; | |
| 19551 | + }); | |
| 19552 | + }; | |
| 19553 | + | |
| 19554 | + var initSettings = function initSettings() { | |
| 19555 | + settings = self.getDefaultSettings(); | |
| 19556 | + var instanceSettings = instanceParams[0]; | |
| 19557 | + | |
| 19558 | + if (instanceSettings) { | |
| 19559 | + $.extend(true, settings, instanceSettings); | |
| 19560 | + } | |
| 19561 | + }; | |
| 19562 | + | |
| 19563 | + var init = function init() { | |
| 19564 | + self.__construct.apply(self, instanceParams); | |
| 19565 | + | |
| 19566 | + ensureClosureMethods(); | |
| 19567 | + initSettings(); | |
| 19568 | + self.trigger('init'); | |
| 19569 | + }; | |
| 19570 | + | |
| 19571 | + this.getItems = function (items, itemKey) { | |
| 19572 | + if (itemKey) { | |
| 19573 | + var keyStack = itemKey.split('.'), | |
| 19574 | + currentKey = keyStack.splice(0, 1); | |
| 19575 | + | |
| 19576 | + if (!keyStack.length) { | |
| 19577 | + return items[currentKey]; | |
| 19578 | + } | |
| 19579 | + | |
| 19580 | + if (!items[currentKey]) { | |
| 19581 | + return; | |
| 19582 | + } | |
| 19583 | + | |
| 19584 | + return this.getItems(items[currentKey], keyStack.join('.')); | |
| 19585 | + } | |
| 19586 | + | |
| 19587 | + return items; | |
| 19588 | + }; | |
| 19589 | + | |
| 19590 | + this.getSettings = function (setting) { | |
| 19591 | + return this.getItems(settings, setting); | |
| 19592 | + }; | |
| 19593 | + | |
| 19594 | + this.setSettings = function (settingKey, value, settingsContainer) { | |
| 19595 | + if (!settingsContainer) { | |
| 19596 | + settingsContainer = settings; | |
| 19597 | + } | |
| 19598 | + | |
| 19599 | + if ('object' === (0, _typeof2.default)(settingKey)) { | |
| 19600 | + $.extend(settingsContainer, settingKey); | |
| 19601 | + return self; | |
| 19602 | + } | |
| 19603 | + | |
| 19604 | + var keyStack = settingKey.split('.'), | |
| 19605 | + currentKey = keyStack.splice(0, 1); | |
| 19606 | + | |
| 19607 | + if (!keyStack.length) { | |
| 19608 | + settingsContainer[currentKey] = value; | |
| 19609 | + return self; | |
| 19610 | + } | |
| 19611 | + | |
| 19612 | + if (!settingsContainer[currentKey]) { | |
| 19613 | + settingsContainer[currentKey] = {}; | |
| 19614 | + } | |
| 19615 | + | |
| 19616 | + return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]); | |
| 19617 | + }; | |
| 19618 | + | |
| 19619 | + this.getErrorMessage = function (type, functionName) { | |
| 19620 | + var message; | |
| 19621 | + | |
| 19622 | + switch (type) { | |
| 19623 | + case 'forceMethodImplementation': | |
| 19624 | + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child."); | |
| 19625 | + break; | |
| 19626 | + | |
| 19627 | + default: | |
| 19628 | + message = 'An error occurs'; | |
| 19629 | + } | |
| 19630 | + | |
| 19631 | + return message; | |
| 19632 | + }; // TODO: This function should be deleted ?. | |
| 19633 | + | |
| 19634 | + | |
| 19635 | + this.forceMethodImplementation = function (functionName) { | |
| 19636 | + throw new Error(this.getErrorMessage('forceMethodImplementation', functionName)); | |
| 19637 | + }; | |
| 19638 | + | |
| 19639 | + this.on = function (eventName, callback) { | |
| 19640 | + if ('object' === (0, _typeof2.default)(eventName)) { | |
| 19641 | + $.each(eventName, function (singleEventName) { | |
| 19642 | + self.on(singleEventName, this); | |
| 19643 | + }); | |
| 19644 | + return self; | |
| 19645 | + } | |
| 19646 | + | |
| 19647 | + var eventNames = eventName.split(' '); | |
| 19648 | + eventNames.forEach(function (singleEventName) { | |
| 19649 | + if (!events[singleEventName]) { | |
| 19650 | + events[singleEventName] = []; | |
| 19651 | + } | |
| 19652 | + | |
| 19653 | + events[singleEventName].push(callback); | |
| 19654 | + }); | |
| 19655 | + return self; | |
| 19656 | + }; | |
| 19657 | + | |
| 19658 | + this.off = function (eventName, callback) { | |
| 19659 | + if (!events[eventName]) { | |
| 19660 | + return self; | |
| 19661 | + } | |
| 19662 | + | |
| 19663 | + if (!callback) { | |
| 19664 | + delete events[eventName]; | |
| 19665 | + return self; | |
| 19666 | + } | |
| 19667 | + | |
| 19668 | + var callbackIndex = events[eventName].indexOf(callback); | |
| 19669 | + | |
| 19670 | + if (-1 !== callbackIndex) { | |
| 19671 | + delete events[eventName][callbackIndex]; // Reset array index (for next off on same event). | |
| 19672 | + | |
| 19673 | + events[eventName] = events[eventName].filter(function (val) { | |
| 19674 | + return val; | |
| 19675 | + }); | |
| 19676 | + } | |
| 19677 | + | |
| 19678 | + return self; | |
| 19679 | + }; | |
| 19680 | + | |
| 19681 | + this.trigger = function (eventName) { | |
| 19682 | + var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1), | |
| 19683 | + params = Array.prototype.slice.call(arguments, 1); | |
| 19684 | + | |
| 19685 | + if (self[methodName]) { | |
| 19686 | + self[methodName].apply(self, params); | |
| 19687 | + } | |
| 19688 | + | |
| 19689 | + var callbacks = events[eventName]; | |
| 19690 | + | |
| 19691 | + if (!callbacks) { | |
| 19692 | + return self; | |
| 19693 | + } | |
| 19694 | + | |
| 19695 | + $.each(callbacks, function (index, callback) { | |
| 19696 | + callback.apply(self, params); | |
| 19697 | + }); | |
| 19698 | + return self; | |
| 19699 | + }; | |
| 19700 | + | |
| 19701 | + init(); | |
| 19702 | +}; | |
| 19703 | + | |
| 19704 | +Module.prototype.__construct = function () {}; | |
| 19705 | + | |
| 19706 | +Module.prototype.getDefaultSettings = function () { | |
| 19707 | + return {}; | |
| 19708 | +}; | |
| 19709 | + | |
| 19710 | +Module.prototype.getConstructorID = function () { | |
| 19711 | + return this.constructor.name; | |
| 19712 | +}; | |
| 19713 | + | |
| 19714 | +Module.extend = function (properties) { | |
| 19715 | + var $ = jQuery, | |
| 19716 | + parent = this; | |
| 19717 | + | |
| 19718 | + var child = function child() { | |
| 19719 | + return parent.apply(this, arguments); | |
| 19720 | + }; | |
| 19721 | + | |
| 19722 | + $.extend(child, parent); | |
| 19723 | + child.prototype = Object.create($.extend({}, parent.prototype, properties)); | |
| 19724 | + child.prototype.constructor = child; | |
| 19725 | + child.__super__ = parent.prototype; | |
| 19726 | + return child; | |
| 19727 | +}; | |
| 19728 | + | |
| 19729 | +module.exports = Module; | |
| 19730 | + | |
| 19731 | +/***/ }), | |
| 19732 | + | |
| 19733 | +/***/ "../core/common/assets/js/utils/environment.js": | |
| 19734 | +/*!*****************************************************!*\ | |
| 19735 | + !*** ../core/common/assets/js/utils/environment.js ***! | |
| 19736 | + \*****************************************************/ | |
| 19737 | +/***/ ((__unused_webpack_module, exports) => { | |
| 19738 | + | |
| 19739 | +"use strict"; | |
| 19740 | + | |
| 19741 | + | |
| 19742 | +Object.defineProperty(exports, "__esModule", ({ | |
| 19743 | + value: true | |
| 19744 | +})); | |
| 19745 | +exports["default"] = void 0; | |
| 19746 | + | |
| 19747 | +var matchUserAgent = function matchUserAgent(UserAgentStr) { | |
| 19748 | + return userAgent.indexOf(UserAgentStr) >= 0; | |
| 19749 | +}, | |
| 19750 | + userAgent = navigator.userAgent, | |
| 19751 | + // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser | |
| 19752 | +// Opera 8.0+ | |
| 19753 | +isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'), | |
| 19754 | + // Firefox 1.0+ | |
| 19755 | +isFirefox = matchUserAgent('Firefox'), | |
| 19756 | + // Safari 3.0+ "[object HTMLElementConstructor]" | |
| 19757 | +isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) { | |
| 19758 | + return '[object SafariRemoteNotification]' === p.toString(); | |
| 19759 | +}(!window.safari || typeof safari !== 'undefined' && safari.pushNotification), | |
| 19760 | + // Internet Explorer 6-11 | |
| 19761 | +isIE = /Trident|MSIE/.test(userAgent) && ( | |
| 19762 | +/*@cc_on!@*/ | |
| 19763 | + false || !!document.documentMode), | |
| 19764 | + // Edge 20+ | |
| 19765 | +isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'), | |
| 19766 | + // Google Chrome (Not accurate) | |
| 19767 | +isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera), | |
| 19768 | + // Blink engine | |
| 19769 | +isBlink = matchUserAgent('Chrome') && !!window.CSS, | |
| 19770 | + // Apple Webkit engine | |
| 19771 | +isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink, | |
| 19772 | + environment = { | |
| 19773 | + appleWebkit: isAppleWebkit, | |
| 19774 | + blink: isBlink, | |
| 19775 | + chrome: isChrome, | |
| 19776 | + edge: isEdge, | |
| 19777 | + firefox: isFirefox, | |
| 19778 | + ie: isIE, | |
| 19779 | + mac: matchUserAgent('Macintosh'), | |
| 19780 | + opera: isOpera, | |
| 19781 | + safari: isSafari, | |
| 19782 | + webkit: matchUserAgent('AppleWebKit') | |
| 19783 | +}; | |
| 19784 | + | |
| 19785 | +var _default = environment; | |
| 19786 | +exports["default"] = _default; | |
| 19787 | + | |
| 19788 | +/***/ }), | |
| 19789 | + | |
| 19790 | +/***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js": | |
| 19791 | +/*!*******************************************************************!*\ | |
| 19792 | + !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***! | |
| 19793 | + \*******************************************************************/ | |
| 647 | 19794 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 648 | 19795 | |
| 649 | 19796 | "use strict"; |
| 650 | 19797 | |
| @@ -649,119 +19796,449 @@ | ||
| 649 | 19796 | "use strict"; |
| 650 | 19797 | |
| 651 | 19798 | |
| 652 | 19799 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 19800 | + | |
| 653 | 19801 | Object.defineProperty(exports, "__esModule", ({ |
| 654 | 19802 | value: true |
| 655 | 19803 | })); |
| 656 | 19804 | exports["default"] = void 0; |
| 19805 | + | |
| 657 | 19806 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 19807 | + | |
| 658 | 19808 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 19809 | + | |
| 19810 | +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js")); | |
| 19811 | + | |
| 19812 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 19813 | + | |
| 659 | 19814 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 19815 | + | |
| 660 | 19816 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 19817 | + | |
| 19818 | +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js")); | |
| 19819 | + | |
| 19820 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 19821 | + | |
| 19822 | +var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js")); | |
| 19823 | + | |
| 19824 | +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 19825 | + | |
| 19826 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 19827 | + | |
| 19828 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 19829 | + | |
| 19830 | +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); }; } | |
| 19831 | + | |
| 19832 | +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; } } | |
| 19833 | + | |
| 19834 | +var BaseError = /*#__PURE__*/function (_Error) { | |
| 19835 | + (0, _inherits2.default)(BaseError, _Error); | |
| 19836 | + | |
| 19837 | + var _super = _createSuper(BaseError); | |
| 19838 | + | |
| 19839 | + /** | |
| 19840 | + * Error constructor. | |
| 19841 | + * | |
| 19842 | + * @param {string} message | |
| 19843 | + * @param {string} code | |
| 19844 | + * @param {*} data | |
| 19845 | + */ | |
| 19846 | + function BaseError() { | |
| 19847 | + var _this; | |
| 19848 | + | |
| 19849 | + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | |
| 19850 | + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | |
| 19851 | + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | |
| 19852 | + (0, _classCallCheck2.default)(this, BaseError); | |
| 19853 | + _this = _super.call(this, message); | |
| 19854 | + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "code", ''); | |
| 19855 | + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", []); | |
| 19856 | + _this.code = code; | |
| 19857 | + _this.data = data; | |
| 19858 | + return _this; | |
| 19859 | + } | |
| 19860 | + /** | |
| 19861 | + * Notify a message when the error occurs. | |
| 19862 | + */ | |
| 19863 | + | |
| 19864 | + | |
| 19865 | + (0, _createClass2.default)(BaseError, [{ | |
| 19866 | + key: "notify", | |
| 19867 | + value: function notify() { | |
| 19868 | + _helpers.default.consoleError(_objectSpread({ | |
| 19869 | + message: this.message | |
| 19870 | + }, this)); | |
| 19871 | + } | |
| 19872 | + }], [{ | |
| 19873 | + key: "create", | |
| 19874 | + value: | |
| 19875 | + /** | |
| 19876 | + * The server error code. | |
| 19877 | + * | |
| 19878 | + * @type {string} | |
| 19879 | + */ | |
| 19880 | + | |
| 19881 | + /** | |
| 19882 | + * Additional data about the current error. | |
| 19883 | + * | |
| 19884 | + * @type {*[]} | |
| 19885 | + */ | |
| 19886 | + | |
| 19887 | + /** | |
| 19888 | + * Static helper function to create the error. | |
| 19889 | + * | |
| 19890 | + * @param {string} message | |
| 19891 | + * @param {string} code | |
| 19892 | + * @param {*} data | |
| 19893 | + * @return {BaseError} error | |
| 19894 | + */ | |
| 19895 | + function create(message) { | |
| 19896 | + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | |
| 19897 | + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | |
| 19898 | + return new this(message, code, data); | |
| 19899 | + } | |
| 19900 | + /** | |
| 19901 | + * Returns the status code of the error. | |
| 19902 | + */ | |
| 19903 | + | |
| 19904 | + }, { | |
| 19905 | + key: "getHTTPErrorCode", | |
| 19906 | + value: function getHTTPErrorCode() { | |
| 19907 | + (0, _forceMethodImplementation.default)(); | |
| 19908 | + } | |
| 19909 | + }]); | |
| 19910 | + return BaseError; | |
| 19911 | +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); | |
| 19912 | + | |
| 19913 | +exports["default"] = BaseError; | |
| 19914 | + | |
| 19915 | +/***/ }), | |
| 19916 | + | |
| 19917 | +/***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js": | |
| 19918 | +/*!**********************************************************************!*\ | |
| 19919 | + !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***! | |
| 19920 | + \**********************************************************************/ | |
| 19921 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 19922 | + | |
| 19923 | +"use strict"; | |
| 19924 | + | |
| 19925 | + | |
| 19926 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 19927 | + | |
| 19928 | +Object.defineProperty(exports, "__esModule", ({ | |
| 19929 | + value: true | |
| 19930 | +})); | |
| 19931 | +exports["default"] = exports.DefaultError = void 0; | |
| 19932 | + | |
| 19933 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 19934 | + | |
| 19935 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 19936 | + | |
| 661 | 19937 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 662 | -var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js")); | |
| 663 | -var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 664 | -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 665 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 19938 | + | |
| 19939 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 19940 | + | |
| 19941 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 19942 | + | |
| 19943 | +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js")); | |
| 19944 | + | |
| 19945 | +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); }; } | |
| 19946 | + | |
| 19947 | +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; } } | |
| 19948 | + | |
| 19949 | +var DefaultError = /*#__PURE__*/function (_BaseError) { | |
| 19950 | + (0, _inherits2.default)(DefaultError, _BaseError); | |
| 19951 | + | |
| 19952 | + var _super = _createSuper(DefaultError); | |
| 19953 | + | |
| 19954 | + function DefaultError() { | |
| 19955 | + (0, _classCallCheck2.default)(this, DefaultError); | |
| 19956 | + return _super.apply(this, arguments); | |
| 19957 | + } | |
| 19958 | + | |
| 19959 | + (0, _createClass2.default)(DefaultError, null, [{ | |
| 19960 | + key: "getHTTPErrorCode", | |
| 19961 | + value: function getHTTPErrorCode() { | |
| 19962 | + return 501; | |
| 19963 | + } | |
| 19964 | + }]); | |
| 19965 | + return DefaultError; | |
| 19966 | +}(_baseError.default); | |
| 19967 | + | |
| 19968 | +exports.DefaultError = DefaultError; | |
| 19969 | +var _default = DefaultError; | |
| 19970 | +exports["default"] = _default; | |
| 19971 | + | |
| 19972 | +/***/ }), | |
| 19973 | + | |
| 19974 | +/***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js": | |
| 19975 | +/*!******************************************************************!*\ | |
| 19976 | + !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***! | |
| 19977 | + \******************************************************************/ | |
| 19978 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 19979 | + | |
| 19980 | +"use strict"; | |
| 19981 | + | |
| 19982 | + | |
| 19983 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 19984 | + | |
| 19985 | +Object.defineProperty(exports, "__esModule", ({ | |
| 19986 | + value: true | |
| 19987 | +})); | |
| 19988 | +exports["default"] = exports.Error404 = void 0; | |
| 19989 | + | |
| 19990 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 19991 | + | |
| 19992 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 19993 | + | |
| 19994 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 19995 | + | |
| 19996 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 19997 | + | |
| 19998 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 19999 | + | |
| 20000 | +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js")); | |
| 20001 | + | |
| 20002 | +var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js")); | |
| 20003 | + | |
| 20004 | +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); }; } | |
| 20005 | + | |
| 20006 | +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; } } | |
| 20007 | + | |
| 20008 | +var Error404 = /*#__PURE__*/function (_BaseError) { | |
| 20009 | + (0, _inherits2.default)(Error404, _BaseError); | |
| 20010 | + | |
| 20011 | + var _super = _createSuper(Error404); | |
| 20012 | + | |
| 20013 | + function Error404() { | |
| 20014 | + (0, _classCallCheck2.default)(this, Error404); | |
| 20015 | + return _super.apply(this, arguments); | |
| 20016 | + } | |
| 20017 | + | |
| 20018 | + (0, _createClass2.default)(Error404, [{ | |
| 20019 | + key: "notify", | |
| 20020 | + value: function notify() { | |
| 20021 | + _helpers.default.consoleWarn(this.message); | |
| 20022 | + } | |
| 20023 | + }], [{ | |
| 20024 | + key: "getHTTPErrorCode", | |
| 20025 | + value: function getHTTPErrorCode() { | |
| 20026 | + return 404; | |
| 20027 | + } | |
| 20028 | + }]); | |
| 20029 | + return Error404; | |
| 20030 | +}(_baseError.default); | |
| 20031 | + | |
| 20032 | +exports.Error404 = Error404; | |
| 20033 | +var _default = Error404; | |
| 20034 | +exports["default"] = _default; | |
| 20035 | + | |
| 20036 | +/***/ }), | |
| 20037 | + | |
| 20038 | +/***/ "../modules/web-cli/assets/js/core/data/errors/index.js": | |
| 20039 | +/*!**************************************************************!*\ | |
| 20040 | + !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***! | |
| 20041 | + \**************************************************************/ | |
| 20042 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 20043 | + | |
| 20044 | +"use strict"; | |
| 20045 | + | |
| 20046 | + | |
| 20047 | +Object.defineProperty(exports, "__esModule", ({ | |
| 20048 | + value: true | |
| 20049 | +})); | |
| 20050 | +Object.defineProperty(exports, "DefaultError", ({ | |
| 20051 | + enumerable: true, | |
| 20052 | + get: function get() { | |
| 20053 | + return _defaultError.DefaultError; | |
| 20054 | + } | |
| 20055 | +})); | |
| 20056 | +Object.defineProperty(exports, "Error404", ({ | |
| 20057 | + enumerable: true, | |
| 20058 | + get: function get() { | |
| 20059 | + return _error.Error404; | |
| 20060 | + } | |
| 20061 | +})); | |
| 20062 | + | |
| 20063 | +var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js"); | |
| 20064 | + | |
| 20065 | +var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js"); | |
| 20066 | + | |
| 20067 | +/***/ }), | |
| 20068 | + | |
| 20069 | +/***/ "../modules/web-cli/assets/js/core/states/ui-state-base.js": | |
| 20070 | +/*!*****************************************************************!*\ | |
| 20071 | + !*** ../modules/web-cli/assets/js/core/states/ui-state-base.js ***! | |
| 20072 | + \*****************************************************************/ | |
| 20073 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 20074 | + | |
| 20075 | +"use strict"; | |
| 20076 | + | |
| 20077 | + | |
| 20078 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 20079 | + | |
| 20080 | +Object.defineProperty(exports, "__esModule", ({ | |
| 20081 | + value: true | |
| 20082 | +})); | |
| 20083 | +exports["default"] = void 0; | |
| 20084 | + | |
| 20085 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 20086 | + | |
| 20087 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 20088 | + | |
| 20089 | +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 20090 | + | |
| 666 | 20091 | /** |
| 667 | - * @name $e.modules.CommandBase | |
| 20092 | + * @typedef {import('../../modules/component-base')} ComponentBase | |
| 668 | 20093 | */ |
| 669 | -var CommandBase = exports["default"] = /*#__PURE__*/function (_CommandInfra) { | |
| 670 | - function CommandBase() { | |
| 671 | - (0, _classCallCheck2.default)(this, CommandBase); | |
| 672 | - return _callSuper(this, CommandBase, arguments); | |
| 20094 | +var UiStateBase = /*#__PURE__*/function () { | |
| 20095 | + /** | |
| 20096 | + * Initialize the state object. | |
| 20097 | + * | |
| 20098 | + * @param {ComponentBase} component - Optional. The component that the state belongs to. | |
| 20099 | + * | |
| 20100 | + * @return {void} | |
| 20101 | + */ | |
| 20102 | + function UiStateBase(component) { | |
| 20103 | + (0, _classCallCheck2.default)(this, UiStateBase); | |
| 20104 | + this.component = component; | |
| 20105 | + this.id = this.getId(); | |
| 20106 | + this.options = this.getOptions(); | |
| 20107 | + this.currentState = null; | |
| 673 | 20108 | } |
| 674 | - (0, _inherits2.default)(CommandBase, _CommandInfra); | |
| 675 | - return (0, _createClass2.default)(CommandBase, [{ | |
| 676 | - key: "onBeforeRun", | |
| 677 | - value: function onBeforeRun() { | |
| 678 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 679 | - $e.hooks.runUIBefore(this.command, args); | |
| 20109 | + /** | |
| 20110 | + * Set the current state. | |
| 20111 | + * | |
| 20112 | + * @param {string} newValue - The new value to set as state. Has to be one of `this.options`. | |
| 20113 | + * | |
| 20114 | + * @return {void} | |
| 20115 | + */ | |
| 20116 | + | |
| 20117 | + | |
| 20118 | + (0, _createClass2.default)(UiStateBase, [{ | |
| 20119 | + key: "set", | |
| 20120 | + value: function set(newValue) { | |
| 20121 | + if (newValue && !this.options.hasOwnProperty(newValue)) { | |
| 20122 | + throw "Option '".concat(newValue, "' for state '").concat(this.id, "' is invalid."); | |
| 20123 | + } | |
| 20124 | + | |
| 20125 | + var callback = this.options[newValue], | |
| 20126 | + oldValue = this.currentState; // Change the current state. | |
| 20127 | + | |
| 20128 | + this.currentState = newValue; // Trigger the `onChange` method before the option's callback. | |
| 20129 | + | |
| 20130 | + this.onChange(oldValue, newValue); // Run the callback if it's callable. | |
| 20131 | + | |
| 20132 | + if ('function' === typeof callback) { | |
| 20133 | + callback(oldValue, newValue); | |
| 20134 | + } | |
| 680 | 20135 | } |
| 20136 | + /** | |
| 20137 | + * Get current state value. | |
| 20138 | + * | |
| 20139 | + * @return {string} current state | |
| 20140 | + */ | |
| 20141 | + | |
| 681 | 20142 | }, { |
| 682 | - key: "onAfterRun", | |
| 683 | - value: function onAfterRun() { | |
| 684 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 685 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 686 | - $e.hooks.runUIAfter(this.command, args, result); | |
| 687 | - } | |
| 20143 | + key: "getCurrent", | |
| 20144 | + value: function getCurrent() { | |
| 20145 | + return this.currentState; | |
| 20146 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 20147 | + | |
| 20148 | + /** | |
| 20149 | + * Get state ID. | |
| 20150 | + * | |
| 20151 | + * @return {string} state ID | |
| 20152 | + */ | |
| 20153 | + | |
| 688 | 20154 | }, { |
| 689 | - key: "onBeforeApply", | |
| 690 | - value: function onBeforeApply() { | |
| 691 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 692 | - $e.hooks.runDataDependency(this.command, args); | |
| 20155 | + key: "getId", | |
| 20156 | + value: function getId() { | |
| 20157 | + (0, _forceMethodImplementation.default)(); | |
| 693 | 20158 | } |
| 20159 | + /** | |
| 20160 | + * Return the state ID prefix. | |
| 20161 | + * | |
| 20162 | + * @return {string} state ID prefix | |
| 20163 | + */ | |
| 20164 | + | |
| 694 | 20165 | }, { |
| 695 | - key: "onAfterApply", | |
| 696 | - value: function onAfterApply() { | |
| 697 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 698 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 699 | - return $e.hooks.runDataAfter(this.command, args, result); | |
| 20166 | + key: "getPrefix", | |
| 20167 | + value: function getPrefix() { | |
| 20168 | + var _this$component; | |
| 20169 | + | |
| 20170 | + return ((_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.getNamespace()) || ''; | |
| 700 | 20171 | } |
| 20172 | + /** | |
| 20173 | + * Get the prefixed state ID. | |
| 20174 | + * | |
| 20175 | + * @return {string} prefixed state ID | |
| 20176 | + */ | |
| 20177 | + | |
| 701 | 20178 | }, { |
| 702 | - key: "onCatchApply", | |
| 703 | - value: function onCatchApply(e) { | |
| 704 | - this.runCatchHooks(e); | |
| 20179 | + key: "getPrefixedId", | |
| 20180 | + value: function getPrefixedId() { | |
| 20181 | + var prefix = this.getPrefix(); | |
| 20182 | + | |
| 20183 | + if (!prefix) { | |
| 20184 | + return this.getId(); | |
| 20185 | + } | |
| 20186 | + | |
| 20187 | + return "".concat(prefix, "/").concat(this.getId()); | |
| 705 | 20188 | } |
| 706 | - | |
| 707 | 20189 | /** |
| 708 | - * Run all the catch hooks. | |
| 20190 | + * Get state options. | |
| 20191 | + * Each option should have unique ID as key and a callback if needed (should be an inner class method). | |
| 709 | 20192 | * |
| 710 | - * @param {Error} e | |
| 20193 | + * @return {Object} state options | |
| 711 | 20194 | */ |
| 20195 | + | |
| 712 | 20196 | }, { |
| 713 | - key: "runCatchHooks", | |
| 714 | - value: function runCatchHooks(e) { | |
| 715 | - $e.hooks.runDataCatch(this.command, this.args, e); | |
| 716 | - $e.hooks.runUICatch(this.command, this.args, e); | |
| 20197 | + key: "getOptions", | |
| 20198 | + value: function getOptions() { | |
| 20199 | + return { | |
| 20200 | + on: '', | |
| 20201 | + off: '' | |
| 20202 | + }; | |
| 717 | 20203 | } |
| 718 | - | |
| 719 | 20204 | /** |
| 720 | - * TODO - Remove - Backwards compatibility. | |
| 20205 | + * Triggered on every UI state change. | |
| 721 | 20206 | * |
| 722 | - * Function requireContainer(). | |
| 20207 | + * @param {string} oldValue - Previous UI state value. | |
| 20208 | + * @param {string} newValue - New UI state value. | |
| 723 | 20209 | * |
| 724 | - * Validate `arg.container` & `arg.containers`. | |
| 20210 | + * @return {void} | |
| 20211 | + */ | |
| 20212 | + | |
| 20213 | + }, { | |
| 20214 | + key: "onChange", | |
| 20215 | + value: function onChange(oldValue, newValue) {// eslint-disable-line no-unused-vars | |
| 20216 | + // Override this method if needed. | |
| 20217 | + } | |
| 20218 | + /** | |
| 20219 | + * Retrieve an array of scopes that the state will be applied to. | |
| 725 | 20220 | * |
| 726 | - * @param {{}} args | |
| 727 | - * @deprecated since 3.7.0, extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase` instead. | |
| 728 | - * | |
| 729 | - * @throws {Error} | |
| 20221 | + * @return {HTMLElement[]} scopes | |
| 730 | 20222 | */ |
| 20223 | + | |
| 731 | 20224 | }, { |
| 732 | - key: "requireContainer", | |
| 733 | - value: function requireContainer() { | |
| 734 | - var _this = this; | |
| 735 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args; | |
| 736 | - _deprecation.default.deprecated('requireContainer()', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`'); | |
| 737 | - if (!args.container && !args.containers) { | |
| 738 | - throw Error('container or containers are required.'); | |
| 739 | - } | |
| 740 | - if (args.container && args.containers) { | |
| 741 | - throw Error('container and containers cannot go together please select one of them.'); | |
| 742 | - } | |
| 743 | - var containers = args.containers || [args.container]; | |
| 744 | - containers.forEach(function (container) { | |
| 745 | - _this.requireArgumentInstance('container', elementorModules.editor.Container, { | |
| 746 | - container: container | |
| 747 | - }); | |
| 748 | - }); | |
| 20225 | + key: "getScopes", | |
| 20226 | + value: function getScopes() { | |
| 20227 | + return [window.document.body]; | |
| 749 | 20228 | } |
| 750 | - }], [{ | |
| 751 | - key: "getInstanceType", | |
| 752 | - value: function getInstanceType() { | |
| 753 | - return 'CommandBase'; | |
| 754 | - } | |
| 755 | 20229 | }]); |
| 756 | -}(_commandInfra.default); | |
| 20230 | + return UiStateBase; | |
| 20231 | +}(); | |
| 757 | 20232 | |
| 20233 | +exports["default"] = UiStateBase; | |
| 20234 | + | |
| 758 | 20235 | /***/ }), |
| 759 | 20236 | |
| 760 | -/***/ "../modules/web-cli/assets/js/modules/command-infra.js": | |
| 761 | -/*!*************************************************************!*\ | |
| 762 | - !*** ../modules/web-cli/assets/js/modules/command-infra.js ***! | |
| 763 | - \*************************************************************/ | |
| 20237 | +/***/ "../modules/web-cli/assets/js/modules/command-base.js": | |
| 20238 | +/*!************************************************************!*\ | |
| 20239 | + !*** ../modules/web-cli/assets/js/modules/command-base.js ***! | |
| 20240 | + \************************************************************/ | |
| 764 | 20241 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 765 | 20242 | |
| 766 | 20243 | "use strict"; |
| 767 | 20244 | |
| @@ -766,77 +20243,126 @@ | ||
| 766 | 20243 | "use strict"; |
| 767 | 20244 | |
| 768 | 20245 | |
| 769 | 20246 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 20247 | + | |
| 770 | 20248 | Object.defineProperty(exports, "__esModule", ({ |
| 771 | 20249 | value: true |
| 772 | 20250 | })); |
| 773 | 20251 | exports["default"] = void 0; |
| 20252 | + | |
| 20253 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 20254 | + | |
| 20255 | +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 20256 | + | |
| 20257 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 20258 | + | |
| 774 | 20259 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 20260 | + | |
| 775 | 20261 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 20262 | + | |
| 20263 | +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js")); | |
| 20264 | + | |
| 20265 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 20266 | + | |
| 776 | 20267 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 20268 | + | |
| 777 | 20269 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 778 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 20270 | + | |
| 779 | 20271 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 20272 | + | |
| 780 | 20273 | var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js")); |
| 781 | -var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 782 | -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 783 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 20274 | + | |
| 20275 | +var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js")); | |
| 20276 | + | |
| 20277 | +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 20278 | + | |
| 20279 | +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); }; } | |
| 20280 | + | |
| 20281 | +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; } } | |
| 20282 | + | |
| 784 | 20283 | /** |
| 785 | 20284 | * @typedef {import('../modules/component-base')} ComponentBase |
| 786 | 20285 | */ |
| 787 | -var CommandInfra = exports["default"] = /*#__PURE__*/function (_ArgsObject) { | |
| 20286 | + | |
| 20287 | +/** | |
| 20288 | + * @typedef {{}} Component | |
| 20289 | + */ | |
| 20290 | +var CommandBase = /*#__PURE__*/function (_ArgsObject) { | |
| 20291 | + (0, _inherits2.default)(CommandBase, _ArgsObject); | |
| 20292 | + | |
| 20293 | + var _super = _createSuper(CommandBase); | |
| 20294 | + | |
| 788 | 20295 | /** |
| 789 | 20296 | * Function constructor(). |
| 790 | 20297 | * |
| 791 | 20298 | * Create Commands Base. |
| 792 | 20299 | * |
| 793 | - * @param {{}} args | |
| 20300 | + * @param {*} [args={}] | |
| 20301 | + * @param {*} [commandsAPI={}] | |
| 794 | 20302 | */ |
| 795 | - function CommandInfra() { | |
| 20303 | + function CommandBase(args) { | |
| 796 | 20304 | var _this; |
| 797 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 798 | - (0, _classCallCheck2.default)(this, CommandInfra); | |
| 799 | - _this = _callSuper(this, CommandInfra, [args]); | |
| 800 | - if (!_this.constructor.registerConfig) { | |
| 801 | - throw RangeError('Doing it wrong: Each command type should have `registerConfig`.'); | |
| 802 | - } | |
| 803 | 20305 | |
| 804 | - // Acknowledge self about which command it run. | |
| 805 | - _this.command = _this.constructor.getCommand(); | |
| 20306 | + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commands; | |
| 20307 | + (0, _classCallCheck2.default)(this, CommandBase); | |
| 20308 | + _this = _super.call(this, args); // Acknowledge self about which command it run. | |
| 806 | 20309 | |
| 807 | - // Assign instance of current component. | |
| 808 | - _this.component = _this.constructor.getComponent(); | |
| 20310 | + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "component", void 0); | |
| 20311 | + _this.currentCommand = commandsAPI.getCurrentLast(); // Assign instance of current component. | |
| 809 | 20312 | |
| 810 | - // Who ever need do something before without `super` the constructor can use `initialize` method. | |
| 811 | - _this.initialize(args); | |
| 20313 | + _this.component = commandsAPI.getComponent(_this.currentCommand); // Who ever need do something before without `super` the constructor can use `initialize` method. | |
| 812 | 20314 | |
| 813 | - // Refresh args, maybe the changed via `initialize`. | |
| 814 | - args = _this.args; | |
| 20315 | + _this.initialize(args); // Refresh args, maybe the changed via `initialize`. | |
| 815 | 20316 | |
| 816 | - // Validate args before run. | |
| 20317 | + | |
| 20318 | + args = _this.args; // Validate args before run. | |
| 20319 | + | |
| 817 | 20320 | _this.validateArgs(args); |
| 20321 | + | |
| 818 | 20322 | return _this; |
| 819 | 20323 | } |
| 820 | - | |
| 821 | 20324 | /** |
| 822 | - * Function initialize(). | |
| 20325 | + * Function requireContainer(). | |
| 823 | 20326 | * |
| 824 | - * Initialize command, called after construction. | |
| 20327 | + * Validate `arg.container` & `arg.containers`. | |
| 825 | 20328 | * |
| 826 | 20329 | * @param {{}} args |
| 20330 | + * | |
| 20331 | + * @throws {Error} | |
| 827 | 20332 | */ |
| 828 | - (0, _inherits2.default)(CommandInfra, _ArgsObject); | |
| 829 | - return (0, _createClass2.default)(CommandInfra, [{ | |
| 830 | - key: "currentCommand", | |
| 831 | - get: | |
| 20333 | + | |
| 20334 | + | |
| 20335 | + (0, _createClass2.default)(CommandBase, [{ | |
| 20336 | + key: "requireContainer", | |
| 20337 | + value: function requireContainer() { | |
| 20338 | + var _this2 = this; | |
| 20339 | + | |
| 20340 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args; | |
| 20341 | + | |
| 20342 | + if (!args.container && !args.containers) { | |
| 20343 | + throw Error('container or containers are required.'); | |
| 20344 | + } | |
| 20345 | + | |
| 20346 | + if (args.container && args.containers) { | |
| 20347 | + throw Error('container and containers cannot go together please select one of them.'); | |
| 20348 | + } | |
| 20349 | + | |
| 20350 | + var containers = args.containers || [args.container]; | |
| 20351 | + containers.forEach(function (container) { | |
| 20352 | + _this2.requireArgumentInstance('container', elementorModules.editor.Container, { | |
| 20353 | + container: container | |
| 20354 | + }); | |
| 20355 | + }); | |
| 20356 | + } | |
| 832 | 20357 | /** |
| 833 | - * @deprecated since 3.7.0, use `this.command` instead. | |
| 20358 | + * Function initialize(). | |
| 20359 | + * | |
| 20360 | + * Initialize command, called after construction. | |
| 20361 | + * | |
| 20362 | + * @param {*} [args={}] | |
| 834 | 20363 | */ |
| 835 | - function get() { | |
| 836 | - _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command'); | |
| 837 | - return this.command; | |
| 838 | - } | |
| 20364 | + | |
| 839 | 20365 | }, { |
| 840 | 20366 | key: "initialize", |
| 841 | 20367 | value: function initialize() { |
| 842 | 20368 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| @@ -846,10 +20372,11 @@ | ||
| 846 | 20372 | * Function validateArgs(). |
| 847 | 20373 | * |
| 848 | 20374 | * Validate command arguments. |
| 849 | 20375 | * |
| 850 | - * @param {{}} args | |
| 20376 | + * @param {*} [args={}] | |
| 851 | 20377 | */ |
| 20378 | + | |
| 852 | 20379 | }, { |
| 853 | 20380 | key: "validateArgs", |
| 854 | 20381 | value: function validateArgs() { |
| 855 | 20382 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| @@ -854,95 +20381,240 @@ | ||
| 854 | 20381 | value: function validateArgs() { |
| 855 | 20382 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 856 | 20383 | } // eslint-disable-line no-unused-vars |
| 857 | 20384 | |
| 858 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 859 | 20385 | /** |
| 20386 | + * Function isDataChanged(). | |
| 20387 | + * | |
| 20388 | + * Whether the editor needs to set change flag on/off. | |
| 20389 | + * | |
| 20390 | + * @return {boolean} Whether the editor needs to set change flag on/off. | |
| 20391 | + */ | |
| 20392 | + | |
| 20393 | + }, { | |
| 20394 | + key: "isDataChanged", | |
| 20395 | + value: function isDataChanged() { | |
| 20396 | + return false; | |
| 20397 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 20398 | + | |
| 20399 | + /** | |
| 860 | 20400 | * Function apply(). |
| 861 | 20401 | * |
| 862 | 20402 | * Do the actual command. |
| 863 | 20403 | * |
| 864 | - * @param {{}} args | |
| 20404 | + * @param {*} [args={}] | |
| 865 | 20405 | * |
| 866 | - * @return {*} Command results. | |
| 20406 | + * @return {*} callback | |
| 867 | 20407 | */ |
| 20408 | + | |
| 868 | 20409 | }, { |
| 869 | 20410 | key: "apply", |
| 870 | 20411 | value: function apply() { |
| 871 | 20412 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 872 | 20413 | // eslint-disable-line no-unused-vars |
| 873 | - elementorModules.ForceMethodImplementation(); | |
| 20414 | + (0, _forceMethodImplementation.default)(); | |
| 874 | 20415 | } |
| 875 | - | |
| 876 | 20416 | /** |
| 877 | 20417 | * Function run(). |
| 878 | 20418 | * |
| 879 | 20419 | * Run command with history & hooks. |
| 880 | 20420 | * |
| 881 | - * @return {*} Command results. | |
| 20421 | + * @return {*} run results | |
| 882 | 20422 | */ |
| 20423 | + | |
| 883 | 20424 | }, { |
| 884 | 20425 | key: "run", |
| 885 | 20426 | value: function run() { |
| 886 | - return this.apply(this.args); | |
| 20427 | + var result; // For UI Hooks. | |
| 20428 | + | |
| 20429 | + this.onBeforeRun(this.args); | |
| 20430 | + | |
| 20431 | + try { | |
| 20432 | + // For Data hooks. | |
| 20433 | + this.onBeforeApply(this.args); | |
| 20434 | + result = this.apply(this.args); | |
| 20435 | + } catch (e) { | |
| 20436 | + this.onCatchApply(e); // Catch 'Hook-Break' that comes from hooks base. | |
| 20437 | + | |
| 20438 | + if (e instanceof $e.modules.HookBreak) { | |
| 20439 | + // Bypass. | |
| 20440 | + return false; | |
| 20441 | + } | |
| 20442 | + } | |
| 20443 | + | |
| 20444 | + return this.runAfter(result); | |
| 887 | 20445 | } |
| 20446 | + }, { | |
| 20447 | + key: "runAfter", | |
| 20448 | + value: function runAfter(result) { | |
| 20449 | + var _this3 = this; | |
| 888 | 20450 | |
| 20451 | + var onAfter = function onAfter(_result) { | |
| 20452 | + // Run Data hooks. | |
| 20453 | + _this3.onAfterApply(_this3.args, _result); // TODO: Create Command-Base for Command-Document and apply it on after. | |
| 20454 | + | |
| 20455 | + | |
| 20456 | + if (_this3.isDataChanged()) { | |
| 20457 | + $e.internal('document/save/set-is-modified', { | |
| 20458 | + status: true | |
| 20459 | + }); | |
| 20460 | + } // For UI hooks. | |
| 20461 | + | |
| 20462 | + | |
| 20463 | + _this3.onAfterRun(_this3.args, _result); | |
| 20464 | + }, | |
| 20465 | + asyncOnAfter = /*#__PURE__*/function () { | |
| 20466 | + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_result) { | |
| 20467 | + var results, promises; | |
| 20468 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 20469 | + while (1) { | |
| 20470 | + switch (_context.prev = _context.next) { | |
| 20471 | + case 0: | |
| 20472 | + // Run Data hooks. | |
| 20473 | + results = _this3.onAfterApply(_this3.args, _result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) { | |
| 20474 | + return filtered instanceof Promise; | |
| 20475 | + }) : []; | |
| 20476 | + | |
| 20477 | + if (!promises.length) { | |
| 20478 | + _context.next = 4; | |
| 20479 | + break; | |
| 20480 | + } | |
| 20481 | + | |
| 20482 | + _context.next = 4; | |
| 20483 | + return Promise.all(promises); | |
| 20484 | + | |
| 20485 | + case 4: | |
| 20486 | + if (_this3.isDataChanged()) { | |
| 20487 | + // TODO: Create Command-Base for Command-Document and apply it on after. | |
| 20488 | + $e.internal('document/save/set-is-modified', { | |
| 20489 | + status: true | |
| 20490 | + }); | |
| 20491 | + } // For UI hooks. | |
| 20492 | + | |
| 20493 | + | |
| 20494 | + _this3.onAfterRun(_this3.args, _result); | |
| 20495 | + | |
| 20496 | + case 6: | |
| 20497 | + case "end": | |
| 20498 | + return _context.stop(); | |
| 20499 | + } | |
| 20500 | + } | |
| 20501 | + }, _callee); | |
| 20502 | + })); | |
| 20503 | + | |
| 20504 | + return function asyncOnAfter(_x) { | |
| 20505 | + return _ref.apply(this, arguments); | |
| 20506 | + }; | |
| 20507 | + }(); // TODO: Temp code determine if it's a jQuery deferred object. | |
| 20508 | + | |
| 20509 | + | |
| 20510 | + if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) { | |
| 20511 | + result.fail(this.onCatchApply.bind(this)); | |
| 20512 | + result.done(onAfter); | |
| 20513 | + } else if (result instanceof Promise) { | |
| 20514 | + // Override initial result ( promise ) to await onAfter promises, first!. | |
| 20515 | + return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { | |
| 20516 | + return _regenerator.default.wrap(function _callee2$(_context2) { | |
| 20517 | + while (1) { | |
| 20518 | + switch (_context2.prev = _context2.next) { | |
| 20519 | + case 0: | |
| 20520 | + _context2.next = 2; | |
| 20521 | + return result.catch(_this3.onCatchApply.bind(_this3)); | |
| 20522 | + | |
| 20523 | + case 2: | |
| 20524 | + _context2.next = 4; | |
| 20525 | + return result.then(function (_result) { | |
| 20526 | + return asyncOnAfter(_result); | |
| 20527 | + }); | |
| 20528 | + | |
| 20529 | + case 4: | |
| 20530 | + return _context2.abrupt("return", result); | |
| 20531 | + | |
| 20532 | + case 5: | |
| 20533 | + case "end": | |
| 20534 | + return _context2.stop(); | |
| 20535 | + } | |
| 20536 | + } | |
| 20537 | + }, _callee2); | |
| 20538 | + }))(); | |
| 20539 | + } else { | |
| 20540 | + onAfter(result); | |
| 20541 | + } | |
| 20542 | + | |
| 20543 | + return result; | |
| 20544 | + } | |
| 889 | 20545 | /** |
| 20546 | + * Run all the catch hooks. | |
| 20547 | + * | |
| 20548 | + * @param {Error} e | |
| 20549 | + */ | |
| 20550 | + | |
| 20551 | + }, { | |
| 20552 | + key: "runCatchHooks", | |
| 20553 | + value: function runCatchHooks(e) { | |
| 20554 | + $e.hooks.runDataCatch(this.currentCommand, this.args, e); | |
| 20555 | + $e.hooks.runUICatch(this.currentCommand, this.args, e); | |
| 20556 | + } | |
| 20557 | + /** | |
| 890 | 20558 | * Function onBeforeRun. |
| 891 | 20559 | * |
| 892 | 20560 | * Called before run(). |
| 893 | 20561 | * |
| 894 | - * @param {{}} args | |
| 20562 | + * @param {*} [args={}] | |
| 895 | 20563 | */ |
| 20564 | + | |
| 896 | 20565 | }, { |
| 897 | 20566 | key: "onBeforeRun", |
| 898 | 20567 | value: function onBeforeRun() { |
| 899 | 20568 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 900 | - } // eslint-disable-line no-unused-vars | |
| 901 | - | |
| 20569 | + $e.hooks.runUIBefore(this.currentCommand, args); | |
| 20570 | + } | |
| 902 | 20571 | /** |
| 903 | 20572 | * Function onAfterRun. |
| 904 | 20573 | * |
| 905 | 20574 | * Called after run(). |
| 906 | 20575 | * |
| 907 | - * @param {{}} args | |
| 908 | - * @param {*} result | |
| 20576 | + * @param {*} [args={}] | |
| 20577 | + * @param {*} [result={*}] | |
| 909 | 20578 | */ |
| 20579 | + | |
| 910 | 20580 | }, { |
| 911 | 20581 | key: "onAfterRun", |
| 912 | 20582 | value: function onAfterRun() { |
| 913 | 20583 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 914 | 20584 | var result = arguments.length > 1 ? arguments[1] : undefined; |
| 915 | - } // eslint-disable-line no-unused-vars | |
| 916 | - | |
| 20585 | + $e.hooks.runUIAfter(this.currentCommand, args, result); | |
| 20586 | + } | |
| 917 | 20587 | /** |
| 918 | 20588 | * Function onBeforeApply. |
| 919 | 20589 | * |
| 920 | 20590 | * Called before apply(). |
| 921 | 20591 | * |
| 922 | - * @param {{}} args | |
| 20592 | + * @param {*} [args={}] | |
| 923 | 20593 | */ |
| 20594 | + | |
| 924 | 20595 | }, { |
| 925 | 20596 | key: "onBeforeApply", |
| 926 | 20597 | value: function onBeforeApply() { |
| 927 | 20598 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 928 | - } // eslint-disable-line no-unused-vars | |
| 929 | - | |
| 20599 | + $e.hooks.runDataDependency(this.currentCommand, args); | |
| 20600 | + } | |
| 930 | 20601 | /** |
| 931 | 20602 | * Function onAfterApply. |
| 932 | 20603 | * |
| 933 | 20604 | * Called after apply(). |
| 934 | 20605 | * |
| 935 | - * @param {{}} args | |
| 936 | - * @param {*} result | |
| 20606 | + * @param {*} [args={}] | |
| 20607 | + * @param {*} [result={*}] | |
| 937 | 20608 | */ |
| 20609 | + | |
| 938 | 20610 | }, { |
| 939 | 20611 | key: "onAfterApply", |
| 940 | 20612 | value: function onAfterApply() { |
| 941 | 20613 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 942 | 20614 | var result = arguments.length > 1 ? arguments[1] : undefined; |
| 943 | - } // eslint-disable-line no-unused-vars | |
| 944 | - | |
| 20615 | + return $e.hooks.runDataAfter(this.currentCommand, args, result); | |
| 20616 | + } | |
| 945 | 20617 | /** |
| 946 | 20618 | * Function onCatchApply. |
| 947 | 20619 | * |
| 948 | 20620 | * Called after apply() failed. |
| @@ -948,63 +20620,404 @@ | ||
| 948 | 20620 | * Called after apply() failed. |
| 949 | 20621 | * |
| 950 | 20622 | * @param {Error} e |
| 951 | 20623 | */ |
| 20624 | + | |
| 952 | 20625 | }, { |
| 953 | 20626 | key: "onCatchApply", |
| 954 | - value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars | |
| 20627 | + value: function onCatchApply(e) { | |
| 20628 | + this.runCatchHooks(e); | |
| 20629 | + | |
| 20630 | + _helpers.default.consoleError(e); | |
| 20631 | + } | |
| 955 | 20632 | }], [{ |
| 956 | 20633 | key: "getInstanceType", |
| 957 | 20634 | value: function getInstanceType() { |
| 958 | - return 'CommandInfra'; | |
| 20635 | + return 'CommandBase'; | |
| 959 | 20636 | } |
| 960 | - | |
| 961 | 20637 | /** |
| 962 | 20638 | * Get info of command. |
| 963 | 20639 | * |
| 964 | - * @return {Object} Extra information about the command. | |
| 20640 | + * Use to provide 'extra' information about the command. | |
| 20641 | + * | |
| 20642 | + * @return {Object} info of command | |
| 965 | 20643 | */ |
| 20644 | + | |
| 966 | 20645 | }, { |
| 967 | 20646 | key: "getInfo", |
| 968 | 20647 | value: function getInfo() { |
| 969 | 20648 | return {}; |
| 970 | 20649 | } |
| 20650 | + /** | |
| 20651 | + * Current component. | |
| 20652 | + * | |
| 20653 | + * @type {Component} | |
| 20654 | + */ | |
| 971 | 20655 | |
| 20656 | + }]); | |
| 20657 | + return CommandBase; | |
| 20658 | +}(_argsObject.default); | |
| 20659 | + | |
| 20660 | +exports["default"] = CommandBase; | |
| 20661 | + | |
| 20662 | +/***/ }), | |
| 20663 | + | |
| 20664 | +/***/ "../modules/web-cli/assets/js/modules/command-data.js": | |
| 20665 | +/*!************************************************************!*\ | |
| 20666 | + !*** ../modules/web-cli/assets/js/modules/command-data.js ***! | |
| 20667 | + \************************************************************/ | |
| 20668 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 20669 | + | |
| 20670 | +"use strict"; | |
| 20671 | + | |
| 20672 | + | |
| 20673 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 20674 | + | |
| 20675 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 20676 | + | |
| 20677 | +Object.defineProperty(exports, "__esModule", ({ | |
| 20678 | + value: true | |
| 20679 | +})); | |
| 20680 | +exports["default"] = void 0; | |
| 20681 | + | |
| 20682 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 20683 | + | |
| 20684 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 20685 | + | |
| 20686 | +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js")); | |
| 20687 | + | |
| 20688 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 20689 | + | |
| 20690 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 20691 | + | |
| 20692 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 20693 | + | |
| 20694 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 20695 | + | |
| 20696 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 20697 | + | |
| 20698 | +var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js")); | |
| 20699 | + | |
| 20700 | +var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js")); | |
| 20701 | + | |
| 20702 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 20703 | + | |
| 20704 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 20705 | + | |
| 20706 | +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); }; } | |
| 20707 | + | |
| 20708 | +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; } } | |
| 20709 | + | |
| 20710 | +/** | |
| 20711 | + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes | |
| 20712 | + */ | |
| 20713 | + | |
| 20714 | +/** | |
| 20715 | + * @typedef {{}} RequestData | |
| 20716 | + */ | |
| 20717 | + | |
| 20718 | +/** | |
| 20719 | + * @typedef {import('../core/data/errors/base-error')} BaseError | |
| 20720 | + */ | |
| 20721 | +var CommandData = /*#__PURE__*/function (_CommandBase) { | |
| 20722 | + (0, _inherits2.default)(CommandData, _CommandBase); | |
| 20723 | + | |
| 20724 | + var _super = _createSuper(CommandData); | |
| 20725 | + | |
| 20726 | + function CommandData(args) { | |
| 20727 | + var _this$args$options; | |
| 20728 | + | |
| 20729 | + var _this; | |
| 20730 | + | |
| 20731 | + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data; | |
| 20732 | + (0, _classCallCheck2.default)(this, CommandData); | |
| 20733 | + _this = _super.call(this, args, commandsAPI); | |
| 20734 | + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", void 0); | |
| 20735 | + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", void 0); | |
| 20736 | + | |
| 20737 | + if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) { | |
| 20738 | + _this.type = _this.args.options.type; | |
| 20739 | + } | |
| 20740 | + | |
| 20741 | + return _this; | |
| 20742 | + } | |
| 20743 | + /** | |
| 20744 | + * Function getEndpointFormat(). | |
| 20745 | + * | |
| 20746 | + * @return {null|string} endpoint format | |
| 20747 | + */ | |
| 20748 | + | |
| 20749 | + | |
| 20750 | + (0, _createClass2.default)(CommandData, [{ | |
| 20751 | + key: "getApplyMethods", | |
| 20752 | + value: | |
| 972 | 20753 | /** |
| 973 | - * @return {string} Self command name. | |
| 20754 | + * @param {DataTypes} type | |
| 20755 | + * | |
| 20756 | + * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods | |
| 974 | 20757 | */ |
| 20758 | + function getApplyMethods() { | |
| 20759 | + var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type; | |
| 20760 | + var before, after; | |
| 20761 | + | |
| 20762 | + switch (type) { | |
| 20763 | + case 'create': | |
| 20764 | + before = this.applyBeforeCreate; | |
| 20765 | + after = this.applyAfterCreate; | |
| 20766 | + break; | |
| 20767 | + | |
| 20768 | + case 'delete': | |
| 20769 | + before = this.applyBeforeDelete; | |
| 20770 | + after = this.applyAfterDelete; | |
| 20771 | + break; | |
| 20772 | + | |
| 20773 | + case 'get': | |
| 20774 | + before = this.applyBeforeGet; | |
| 20775 | + after = this.applyAfterGet; | |
| 20776 | + break; | |
| 20777 | + | |
| 20778 | + case 'update': | |
| 20779 | + before = this.applyBeforeUpdate; | |
| 20780 | + after = this.applyAfterUpdate; | |
| 20781 | + break; | |
| 20782 | + | |
| 20783 | + case 'options': | |
| 20784 | + before = this.applyBeforeOptions; | |
| 20785 | + after = this.applyAfterOptions; | |
| 20786 | + break; | |
| 20787 | + | |
| 20788 | + default: | |
| 20789 | + return false; | |
| 20790 | + } | |
| 20791 | + | |
| 20792 | + return { | |
| 20793 | + before: before.bind(this), | |
| 20794 | + after: after.bind(this) | |
| 20795 | + }; | |
| 20796 | + } | |
| 20797 | + /** | |
| 20798 | + * Function getRequestData(). | |
| 20799 | + * | |
| 20800 | + * @return {RequestData} request data | |
| 20801 | + */ | |
| 20802 | + | |
| 975 | 20803 | }, { |
| 976 | - key: "getCommand", | |
| 977 | - value: function getCommand() { | |
| 978 | - return this.registerConfig.command; | |
| 20804 | + key: "getRequestData", | |
| 20805 | + value: function getRequestData() { | |
| 20806 | + return { | |
| 20807 | + component: this.component, | |
| 20808 | + command: this.currentCommand, | |
| 20809 | + type: this.type, | |
| 20810 | + args: this.args, | |
| 20811 | + timestamp: new Date().getTime(), | |
| 20812 | + endpoint: $e.data.commandToEndpoint(this.currentCommand, _helpers.default.cloneObject(this.args), this.constructor.getEndpointFormat()) | |
| 20813 | + }; | |
| 979 | 20814 | } |
| 20815 | + }, { | |
| 20816 | + key: "apply", | |
| 20817 | + value: function apply() { | |
| 20818 | + var _this2 = this; | |
| 980 | 20819 | |
| 20820 | + var applyMethods = this.getApplyMethods(); // Run 'before' method. | |
| 20821 | + | |
| 20822 | + this.args = applyMethods.before(this.args); | |
| 20823 | + var requestData = this.getRequestData(); | |
| 20824 | + return $e.data.fetch(requestData).then(function (data) { | |
| 20825 | + _this2.data = data; // Run 'after' method. | |
| 20826 | + | |
| 20827 | + _this2.data = applyMethods.after(data, _this2.args); | |
| 20828 | + _this2.data = { | |
| 20829 | + data: _this2.data | |
| 20830 | + }; // Append requestData. | |
| 20831 | + | |
| 20832 | + _this2.data = Object.assign({ | |
| 20833 | + __requestData__: requestData | |
| 20834 | + }, _this2.data); | |
| 20835 | + return _this2.data; | |
| 20836 | + }); | |
| 20837 | + } | |
| 981 | 20838 | /** |
| 982 | - * @return {ComponentBase} Self component | |
| 20839 | + * @param {*} [args={}] | |
| 20840 | + * @return {{}} filtered args | |
| 983 | 20841 | */ |
| 20842 | + | |
| 984 | 20843 | }, { |
| 985 | - key: "getComponent", | |
| 986 | - value: function getComponent() { | |
| 987 | - return this.registerConfig.component; | |
| 20844 | + key: "applyBeforeCreate", | |
| 20845 | + value: function applyBeforeCreate() { | |
| 20846 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 20847 | + return args; | |
| 988 | 20848 | } |
| 20849 | + /** | |
| 20850 | + * @param {{}} data | |
| 20851 | + * @param {*} [args={}] | |
| 20852 | + * @return {{}} filtered result | |
| 20853 | + */ | |
| 20854 | + | |
| 989 | 20855 | }, { |
| 990 | - key: "setRegisterConfig", | |
| 991 | - value: function setRegisterConfig(config) { | |
| 992 | - this.registerConfig = Object.freeze(config); | |
| 20856 | + key: "applyAfterCreate", | |
| 20857 | + value: function applyAfterCreate(data) { | |
| 20858 | + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 20859 | + // eslint-disable-line no-unused-vars | |
| 20860 | + return data; | |
| 993 | 20861 | } |
| 20862 | + /** | |
| 20863 | + * @param {*} [args={}] | |
| 20864 | + * @return {{}} filtered args | |
| 20865 | + */ | |
| 20866 | + | |
| 20867 | + }, { | |
| 20868 | + key: "applyBeforeDelete", | |
| 20869 | + value: function applyBeforeDelete() { | |
| 20870 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 20871 | + return args; | |
| 20872 | + } | |
| 20873 | + /** | |
| 20874 | + * @param {{}} data | |
| 20875 | + * @param {*} [args={}] | |
| 20876 | + * @return {{}} filtered result | |
| 20877 | + */ | |
| 20878 | + | |
| 20879 | + }, { | |
| 20880 | + key: "applyAfterDelete", | |
| 20881 | + value: function applyAfterDelete(data) { | |
| 20882 | + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 20883 | + // eslint-disable-line no-unused-vars | |
| 20884 | + return data; | |
| 20885 | + } | |
| 20886 | + /** | |
| 20887 | + * @param {*} [args={}] | |
| 20888 | + * @return {{}} filtered args | |
| 20889 | + */ | |
| 20890 | + | |
| 20891 | + }, { | |
| 20892 | + key: "applyBeforeGet", | |
| 20893 | + value: function applyBeforeGet() { | |
| 20894 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 20895 | + return args; | |
| 20896 | + } | |
| 20897 | + /** | |
| 20898 | + * @param {{}} data | |
| 20899 | + * @param {*} [args={}] | |
| 20900 | + * @return {{}} filtered result | |
| 20901 | + */ | |
| 20902 | + | |
| 20903 | + }, { | |
| 20904 | + key: "applyAfterGet", | |
| 20905 | + value: function applyAfterGet(data) { | |
| 20906 | + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 20907 | + // eslint-disable-line no-unused-vars | |
| 20908 | + return data; | |
| 20909 | + } | |
| 20910 | + /** | |
| 20911 | + * @param {*} [args={}] | |
| 20912 | + * @return {{}} filtered args | |
| 20913 | + */ | |
| 20914 | + | |
| 20915 | + }, { | |
| 20916 | + key: "applyBeforeUpdate", | |
| 20917 | + value: function applyBeforeUpdate() { | |
| 20918 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 20919 | + return args; | |
| 20920 | + } | |
| 20921 | + /** | |
| 20922 | + * @param {{}} data | |
| 20923 | + * @param {*} [args={}] | |
| 20924 | + * @return {{}} filtered result | |
| 20925 | + */ | |
| 20926 | + | |
| 20927 | + }, { | |
| 20928 | + key: "applyAfterUpdate", | |
| 20929 | + value: function applyAfterUpdate(data) { | |
| 20930 | + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 20931 | + // eslint-disable-line no-unused-vars | |
| 20932 | + return data; | |
| 20933 | + } | |
| 20934 | + /** | |
| 20935 | + * @param {*} [args={}] | |
| 20936 | + * @return {{}} filtered args | |
| 20937 | + */ | |
| 20938 | + | |
| 20939 | + }, { | |
| 20940 | + key: "applyBeforeOptions", | |
| 20941 | + value: function applyBeforeOptions() { | |
| 20942 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 20943 | + return args; | |
| 20944 | + } | |
| 20945 | + /** | |
| 20946 | + * @param {{}} data | |
| 20947 | + * @param {*} [args={}] | |
| 20948 | + * @return {{}} filtered result | |
| 20949 | + */ | |
| 20950 | + | |
| 20951 | + }, { | |
| 20952 | + key: "applyAfterOptions", | |
| 20953 | + value: function applyAfterOptions(data) { | |
| 20954 | + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 20955 | + // eslint-disable-line no-unused-vars | |
| 20956 | + return data; | |
| 20957 | + } | |
| 20958 | + /** | |
| 20959 | + * @param {BaseError} e | |
| 20960 | + */ | |
| 20961 | + | |
| 20962 | + }, { | |
| 20963 | + key: "applyAfterCatch", | |
| 20964 | + value: function applyAfterCatch(e) { | |
| 20965 | + e.notify(); | |
| 20966 | + } | |
| 20967 | + }, { | |
| 20968 | + key: "onCatchApply", | |
| 20969 | + value: function onCatchApply(e) { | |
| 20970 | + var _e, _e$data; | |
| 20971 | + | |
| 20972 | + // TODO: If the errors that returns from the server is consistent remove the '?' from 'e' | |
| 20973 | + var httpErrorCode = ((_e = e) === null || _e === void 0 ? void 0 : (_e$data = _e.data) === null || _e$data === void 0 ? void 0 : _e$data.status) || 501; | |
| 20974 | + var dataError = Object.values(errors).find(function (error) { | |
| 20975 | + return error.getHTTPErrorCode() === httpErrorCode; | |
| 20976 | + }); | |
| 20977 | + | |
| 20978 | + if (!dataError) { | |
| 20979 | + dataError = errors.DefaultError; | |
| 20980 | + } | |
| 20981 | + | |
| 20982 | + e = dataError.create(e.message, e.code, e.data || []); | |
| 20983 | + this.runCatchHooks(e); | |
| 20984 | + this.applyAfterCatch(e); | |
| 20985 | + } | |
| 20986 | + }], [{ | |
| 20987 | + key: "getInstanceType", | |
| 20988 | + value: | |
| 20989 | + /** | |
| 20990 | + * Data returned from remote. | |
| 20991 | + * | |
| 20992 | + * @type {*} | |
| 20993 | + */ | |
| 20994 | + | |
| 20995 | + /** | |
| 20996 | + * Fetch type. | |
| 20997 | + * | |
| 20998 | + * @type {DataTypes} | |
| 20999 | + */ | |
| 21000 | + function getInstanceType() { | |
| 21001 | + return 'CommandData'; | |
| 21002 | + } | |
| 21003 | + }, { | |
| 21004 | + key: "getEndpointFormat", | |
| 21005 | + value: function getEndpointFormat() { | |
| 21006 | + return null; | |
| 21007 | + } | |
| 994 | 21008 | }]); |
| 995 | -}(_argsObject.default); | |
| 996 | -/** | |
| 997 | - * @type {Object} | |
| 998 | - */ | |
| 999 | -(0, _defineProperty2.default)(CommandInfra, "registerConfig", null); | |
| 21009 | + return CommandData; | |
| 21010 | +}(_commandBase.default); | |
| 1000 | 21011 | |
| 21012 | +exports["default"] = CommandData; | |
| 21013 | + | |
| 1001 | 21014 | /***/ }), |
| 1002 | 21015 | |
| 1003 | -/***/ "../modules/web-cli/assets/js/utils/console.js": | |
| 1004 | -/*!*****************************************************!*\ | |
| 1005 | - !*** ../modules/web-cli/assets/js/utils/console.js ***! | |
| 1006 | - \*****************************************************/ | |
| 21016 | +/***/ "../modules/web-cli/assets/js/modules/command-internal-base.js": | |
| 21017 | +/*!*********************************************************************!*\ | |
| 21018 | + !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***! | |
| 21019 | + \*********************************************************************/ | |
| 1007 | 21020 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1008 | 21021 | |
| 1009 | 21022 | "use strict"; |
| 1010 | 21023 | |
| @@ -1009,52 +21022,58 @@ | ||
| 1009 | 21022 | "use strict"; |
| 1010 | 21023 | |
| 1011 | 21024 | |
| 1012 | 21025 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 21026 | + | |
| 1013 | 21027 | Object.defineProperty(exports, "__esModule", ({ |
| 1014 | 21028 | value: true |
| 1015 | 21029 | })); |
| 1016 | 21030 | exports["default"] = void 0; |
| 21031 | + | |
| 1017 | 21032 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 21033 | + | |
| 1018 | 21034 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1019 | -var Console = exports["default"] = /*#__PURE__*/function () { | |
| 1020 | - function Console() { | |
| 1021 | - (0, _classCallCheck2.default)(this, Console); | |
| 21035 | + | |
| 21036 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 21037 | + | |
| 21038 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 21039 | + | |
| 21040 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 21041 | + | |
| 21042 | +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 21043 | + | |
| 21044 | +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); }; } | |
| 21045 | + | |
| 21046 | +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; } } | |
| 21047 | + | |
| 21048 | +var CommandInternalBase = /*#__PURE__*/function (_CommandBase) { | |
| 21049 | + (0, _inherits2.default)(CommandInternalBase, _CommandBase); | |
| 21050 | + | |
| 21051 | + var _super = _createSuper(CommandInternalBase); | |
| 21052 | + | |
| 21053 | + function CommandInternalBase(args) { | |
| 21054 | + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal; | |
| 21055 | + (0, _classCallCheck2.default)(this, CommandInternalBase); | |
| 21056 | + return _super.call(this, args, commandsAPI); | |
| 1022 | 21057 | } |
| 1023 | - return (0, _createClass2.default)(Console, null, [{ | |
| 1024 | - key: "error", | |
| 1025 | - value: function error(message) { | |
| 1026 | - // Show an error if devTools is available. | |
| 1027 | - if ($e.devTools) { | |
| 1028 | - $e.devTools.log.error(message); | |
| 1029 | - } | |
| 1030 | 21058 | |
| 1031 | - // If not a 'Hook-Break' then show error. | |
| 1032 | - if (!(message instanceof $e.modules.HookBreak)) { | |
| 1033 | - // eslint-disable-next-line no-console | |
| 1034 | - console.error(message); | |
| 1035 | - } | |
| 21059 | + (0, _createClass2.default)(CommandInternalBase, null, [{ | |
| 21060 | + key: "getInstanceType", | |
| 21061 | + value: function getInstanceType() { | |
| 21062 | + return 'CommandInternalBase'; | |
| 1036 | 21063 | } |
| 1037 | - }, { | |
| 1038 | - key: "warn", | |
| 1039 | - value: function warn() { | |
| 1040 | - var _console; | |
| 1041 | - var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;"); | |
| 1042 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 1043 | - args[_key] = arguments[_key]; | |
| 1044 | - } | |
| 1045 | - args.unshift('%c %c', style, ''); | |
| 1046 | - (_console = console).warn.apply(_console, args); // eslint-disable-line no-console | |
| 1047 | - } | |
| 1048 | 21064 | }]); |
| 1049 | -}(); | |
| 21065 | + return CommandInternalBase; | |
| 21066 | +}(_commandBase.default); | |
| 1050 | 21067 | |
| 21068 | +exports["default"] = CommandInternalBase; | |
| 21069 | + | |
| 1051 | 21070 | /***/ }), |
| 1052 | 21071 | |
| 1053 | -/***/ "../modules/web-cli/assets/js/utils/deprecation.js": | |
| 1054 | -/*!*********************************************************!*\ | |
| 1055 | - !*** ../modules/web-cli/assets/js/utils/deprecation.js ***! | |
| 1056 | - \*********************************************************/ | |
| 21072 | +/***/ "../modules/web-cli/assets/js/modules/component-base.js": | |
| 21073 | +/*!**************************************************************!*\ | |
| 21074 | + !*** ../modules/web-cli/assets/js/modules/component-base.js ***! | |
| 21075 | + \**************************************************************/ | |
| 1057 | 21076 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1058 | 21077 | |
| 1059 | 21078 | "use strict"; |
| 1060 | 21079 | |
| @@ -1059,500 +21078,2599 @@ | ||
| 1059 | 21078 | "use strict"; |
| 1060 | 21079 | |
| 1061 | 21080 | |
| 1062 | 21081 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 21082 | + | |
| 1063 | 21083 | Object.defineProperty(exports, "__esModule", ({ |
| 1064 | 21084 | value: true |
| 1065 | 21085 | })); |
| 1066 | 21086 | exports["default"] = void 0; |
| 21087 | + | |
| 21088 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 21089 | + | |
| 1067 | 21090 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); |
| 21091 | + | |
| 1068 | 21092 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 21093 | + | |
| 1069 | 21094 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1070 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 1071 | -// Copied from `modules/dev-tools/assets/js/deprecation.js` | |
| 21095 | + | |
| 21096 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 21097 | + | |
| 21098 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 21099 | + | |
| 21100 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 21101 | + | |
| 21102 | +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js"); | |
| 21103 | + | |
| 21104 | +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); | |
| 21105 | + | |
| 21106 | +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 21107 | + | |
| 21108 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 21109 | + | |
| 21110 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 21111 | + | |
| 21112 | +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); }; } | |
| 21113 | + | |
| 21114 | +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; } } | |
| 21115 | + | |
| 1072 | 21116 | /** |
| 1073 | - * @typedef {Object} Version | |
| 1074 | - * @property {number} major1 The first number | |
| 1075 | - * @property {number} major2 The second number | |
| 1076 | - * @property {number} minor The third number | |
| 1077 | - * @property {string} build The fourth number | |
| 21117 | + * @typedef {import('./hook-base')} HookBase | |
| 1078 | 21118 | */ |
| 1079 | 21119 | |
| 1080 | -var softDeprecated = function softDeprecated(name, version, replacement) { | |
| 1081 | - if (elementorWebCliConfig.isDebug) { | |
| 1082 | - deprecatedMessage('soft', name, version, replacement); | |
| 21120 | +/** | |
| 21121 | + * @typedef {import('../core/states/ui-state-base')} UiStateBase | |
| 21122 | + */ | |
| 21123 | +var ComponentBase = /*#__PURE__*/function (_Module) { | |
| 21124 | + (0, _inherits2.default)(ComponentBase, _Module); | |
| 21125 | + | |
| 21126 | + var _super = _createSuper(ComponentBase); | |
| 21127 | + | |
| 21128 | + function ComponentBase() { | |
| 21129 | + (0, _classCallCheck2.default)(this, ComponentBase); | |
| 21130 | + return _super.apply(this, arguments); | |
| 1083 | 21131 | } |
| 1084 | -}; | |
| 1085 | -var hardDeprecated = function hardDeprecated(name, version, replacement) { | |
| 1086 | - deprecatedMessage('hard', name, version, replacement); | |
| 1087 | -}; | |
| 1088 | -var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) { | |
| 1089 | - var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version); | |
| 1090 | - if (replacement) { | |
| 1091 | - message += " - Use `".concat(replacement, "` instead"); | |
| 1092 | - } | |
| 1093 | - _console.default.warn(message); | |
| 1094 | -}; | |
| 1095 | -var Deprecation = exports["default"] = /*#__PURE__*/function () { | |
| 1096 | - function Deprecation() { | |
| 1097 | - (0, _classCallCheck2.default)(this, Deprecation); | |
| 1098 | - } | |
| 1099 | - return (0, _createClass2.default)(Deprecation, null, [{ | |
| 1100 | - key: "deprecated", | |
| 1101 | - value: function deprecated(name, version, replacement) { | |
| 1102 | - if (this.isHardDeprecated(version)) { | |
| 1103 | - hardDeprecated(name, version, replacement); | |
| 1104 | - } else { | |
| 1105 | - softDeprecated(name, version, replacement); | |
| 21132 | + | |
| 21133 | + (0, _createClass2.default)(ComponentBase, [{ | |
| 21134 | + key: "__construct", | |
| 21135 | + value: function __construct() { | |
| 21136 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 21137 | + | |
| 21138 | + if (args.manager) { | |
| 21139 | + this.manager = args.manager; | |
| 1106 | 21140 | } |
| 21141 | + | |
| 21142 | + this.commands = this.defaultCommands(); | |
| 21143 | + this.commandsInternal = this.defaultCommandsInternal(); | |
| 21144 | + this.hooks = this.defaultHooks(); | |
| 21145 | + this.routes = this.defaultRoutes(); | |
| 21146 | + this.tabs = this.defaultTabs(); | |
| 21147 | + this.shortcuts = this.defaultShortcuts(); | |
| 21148 | + this.utils = this.defaultUtils(); | |
| 21149 | + this.data = this.defaultData(); | |
| 21150 | + this.uiStates = this.defaultUiStates(); | |
| 21151 | + this.states = this.defaultStates(); | |
| 21152 | + this.defaultRoute = ''; | |
| 21153 | + this.currentTab = ''; | |
| 1107 | 21154 | } |
| 21155 | + }, { | |
| 21156 | + key: "registerAPI", | |
| 21157 | + value: function registerAPI() { | |
| 21158 | + var _this = this; | |
| 1108 | 21159 | |
| 21160 | + Object.entries(this.getTabs()).forEach(function (tab) { | |
| 21161 | + return _this.registerTabRoute(tab[0]); | |
| 21162 | + }); | |
| 21163 | + Object.entries(this.getRoutes()).forEach(function (_ref) { | |
| 21164 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 21165 | + route = _ref2[0], | |
| 21166 | + callback = _ref2[1]; | |
| 21167 | + | |
| 21168 | + return _this.registerRoute(route, callback); | |
| 21169 | + }); | |
| 21170 | + Object.entries(this.getCommands()).forEach(function (_ref3) { | |
| 21171 | + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), | |
| 21172 | + command = _ref4[0], | |
| 21173 | + callback = _ref4[1]; | |
| 21174 | + | |
| 21175 | + return _this.registerCommand(command, callback); | |
| 21176 | + }); | |
| 21177 | + Object.entries(this.getCommandsInternal()).forEach(function (_ref5) { | |
| 21178 | + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2), | |
| 21179 | + command = _ref6[0], | |
| 21180 | + callback = _ref6[1]; | |
| 21181 | + | |
| 21182 | + return _this.registerCommandInternal(command, callback); | |
| 21183 | + }); | |
| 21184 | + Object.values(this.getHooks()).forEach(function (instance) { | |
| 21185 | + return _this.registerHook(instance); | |
| 21186 | + }); | |
| 21187 | + Object.entries(this.getData()).forEach(function (_ref7) { | |
| 21188 | + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2), | |
| 21189 | + command = _ref8[0], | |
| 21190 | + callback = _ref8[1]; | |
| 21191 | + | |
| 21192 | + return _this.registerData(command, callback); | |
| 21193 | + }); | |
| 21194 | + Object.values(this.getUiStates()).forEach(function (instance) { | |
| 21195 | + return _this.registerUiState(instance); | |
| 21196 | + }); | |
| 21197 | + Object.entries(this.getStates()).forEach(function (_ref9) { | |
| 21198 | + var _ref10 = (0, _slicedToArray2.default)(_ref9, 2), | |
| 21199 | + id = _ref10[0], | |
| 21200 | + state = _ref10[1]; | |
| 21201 | + | |
| 21202 | + return _this.registerState(id, state); | |
| 21203 | + }); | |
| 21204 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 21205 | + | |
| 1109 | 21206 | /** |
| 1110 | - * @param {string} version | |
| 21207 | + * @return {string} namespace | |
| 21208 | + */ | |
| 21209 | + | |
| 21210 | + }, { | |
| 21211 | + key: "getNamespace", | |
| 21212 | + value: function getNamespace() { | |
| 21213 | + (0, _forceMethodImplementation.default)(); | |
| 21214 | + } | |
| 21215 | + }, { | |
| 21216 | + key: "getRootContainer", | |
| 21217 | + value: function getRootContainer() { | |
| 21218 | + var parts = this.getNamespace().split('/'); | |
| 21219 | + return parts[0]; | |
| 21220 | + } | |
| 21221 | + }, { | |
| 21222 | + key: "defaultTabs", | |
| 21223 | + value: function defaultTabs() { | |
| 21224 | + return {}; | |
| 21225 | + } | |
| 21226 | + }, { | |
| 21227 | + key: "defaultRoutes", | |
| 21228 | + value: function defaultRoutes() { | |
| 21229 | + return {}; | |
| 21230 | + } | |
| 21231 | + }, { | |
| 21232 | + key: "defaultCommands", | |
| 21233 | + value: function defaultCommands() { | |
| 21234 | + return {}; | |
| 21235 | + } | |
| 21236 | + }, { | |
| 21237 | + key: "defaultCommandsInternal", | |
| 21238 | + value: function defaultCommandsInternal() { | |
| 21239 | + return {}; | |
| 21240 | + } | |
| 21241 | + }, { | |
| 21242 | + key: "defaultHooks", | |
| 21243 | + value: function defaultHooks() { | |
| 21244 | + return {}; | |
| 21245 | + } | |
| 21246 | + /** | |
| 21247 | + * Get the component's default UI states. | |
| 1111 | 21248 | * |
| 1112 | - * @return {Version} | |
| 21249 | + * @return {Object} default UI states | |
| 1113 | 21250 | */ |
| 21251 | + | |
| 1114 | 21252 | }, { |
| 1115 | - key: "parseVersion", | |
| 1116 | - value: function parseVersion(version) { | |
| 1117 | - var versionParts = version.split('.'); | |
| 1118 | - if (versionParts.length < 3 || versionParts.length > 4) { | |
| 1119 | - throw new RangeError('Invalid Semantic Version string provided'); | |
| 1120 | - } | |
| 1121 | - var _versionParts = (0, _slicedToArray2.default)(versionParts, 4), | |
| 1122 | - major1 = _versionParts[0], | |
| 1123 | - major2 = _versionParts[1], | |
| 1124 | - minor = _versionParts[2], | |
| 1125 | - _versionParts$ = _versionParts[3], | |
| 1126 | - build = _versionParts$ === void 0 ? '' : _versionParts$; | |
| 1127 | - return { | |
| 1128 | - major1: parseInt(major1), | |
| 1129 | - major2: parseInt(major2), | |
| 1130 | - minor: parseInt(minor), | |
| 1131 | - build: build | |
| 1132 | - }; | |
| 21253 | + key: "defaultUiStates", | |
| 21254 | + value: function defaultUiStates() { | |
| 21255 | + return {}; | |
| 1133 | 21256 | } |
| 21257 | + /** | |
| 21258 | + * Get the component's Redux slice settings. | |
| 21259 | + * | |
| 21260 | + * @return {Object} Redux slice settings | |
| 21261 | + */ | |
| 1134 | 21262 | |
| 21263 | + }, { | |
| 21264 | + key: "defaultStates", | |
| 21265 | + value: function defaultStates() { | |
| 21266 | + return {}; | |
| 21267 | + } | |
| 21268 | + }, { | |
| 21269 | + key: "defaultShortcuts", | |
| 21270 | + value: function defaultShortcuts() { | |
| 21271 | + return {}; | |
| 21272 | + } | |
| 21273 | + }, { | |
| 21274 | + key: "defaultUtils", | |
| 21275 | + value: function defaultUtils() { | |
| 21276 | + return {}; | |
| 21277 | + } | |
| 21278 | + }, { | |
| 21279 | + key: "defaultData", | |
| 21280 | + value: function defaultData() { | |
| 21281 | + return {}; | |
| 21282 | + } | |
| 21283 | + }, { | |
| 21284 | + key: "getCommands", | |
| 21285 | + value: function getCommands() { | |
| 21286 | + return this.commands; | |
| 21287 | + } | |
| 21288 | + }, { | |
| 21289 | + key: "getCommandsInternal", | |
| 21290 | + value: function getCommandsInternal() { | |
| 21291 | + return this.commandsInternal; | |
| 21292 | + } | |
| 21293 | + }, { | |
| 21294 | + key: "getHooks", | |
| 21295 | + value: function getHooks() { | |
| 21296 | + return this.hooks; | |
| 21297 | + } | |
| 1135 | 21298 | /** |
| 1136 | - * Get total of major. | |
| 21299 | + * Retrieve the component's UI states. | |
| 1137 | 21300 | * |
| 1138 | - * 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, | |
| 1139 | - * versions with major2 more then 9 will be added to total. | |
| 21301 | + * @return {Object} UI states | |
| 21302 | + */ | |
| 21303 | + | |
| 21304 | + }, { | |
| 21305 | + key: "getUiStates", | |
| 21306 | + value: function getUiStates() { | |
| 21307 | + return this.uiStates; | |
| 21308 | + } | |
| 21309 | + /** | |
| 21310 | + * Retrieve the component's Redux Slice. | |
| 1140 | 21311 | * |
| 1141 | - * @param {Version} versionObj | |
| 21312 | + * @return {Object} Redux Slice | |
| 21313 | + */ | |
| 21314 | + | |
| 21315 | + }, { | |
| 21316 | + key: "getStates", | |
| 21317 | + value: function getStates() { | |
| 21318 | + return this.states; | |
| 21319 | + } | |
| 21320 | + }, { | |
| 21321 | + key: "getRoutes", | |
| 21322 | + value: function getRoutes() { | |
| 21323 | + return this.routes; | |
| 21324 | + } | |
| 21325 | + }, { | |
| 21326 | + key: "getTabs", | |
| 21327 | + value: function getTabs() { | |
| 21328 | + return this.tabs; | |
| 21329 | + } | |
| 21330 | + }, { | |
| 21331 | + key: "getShortcuts", | |
| 21332 | + value: function getShortcuts() { | |
| 21333 | + return this.shortcuts; | |
| 21334 | + } | |
| 21335 | + }, { | |
| 21336 | + key: "getData", | |
| 21337 | + value: function getData() { | |
| 21338 | + return this.data; | |
| 21339 | + } | |
| 21340 | + }, { | |
| 21341 | + key: "registerCommand", | |
| 21342 | + value: function registerCommand(command, callback) { | |
| 21343 | + $e.commands.register(this, command, callback); | |
| 21344 | + } | |
| 21345 | + /** | |
| 21346 | + * @param {HookBase} instance | |
| 21347 | + */ | |
| 21348 | + | |
| 21349 | + }, { | |
| 21350 | + key: "registerHook", | |
| 21351 | + value: function registerHook(instance) { | |
| 21352 | + return instance.register(); | |
| 21353 | + } | |
| 21354 | + /** | |
| 21355 | + * Register a UI state. | |
| 1142 | 21356 | * |
| 1143 | - * @return {number} | |
| 21357 | + * @param {UiStateBase} instance - UI state instance. | |
| 21358 | + * | |
| 21359 | + * @return {void} | |
| 1144 | 21360 | */ |
| 21361 | + | |
| 1145 | 21362 | }, { |
| 1146 | - key: "getTotalMajor", | |
| 1147 | - value: function getTotalMajor(versionObj) { | |
| 1148 | - var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0")); | |
| 1149 | - total = Number((total / 10).toFixed(0)); | |
| 1150 | - if (versionObj.major2 > 9) { | |
| 1151 | - total = versionObj.major2 - 9; | |
| 21363 | + key: "registerUiState", | |
| 21364 | + value: function registerUiState(instance) { | |
| 21365 | + $e.uiStates.register(instance); | |
| 21366 | + } | |
| 21367 | + /** | |
| 21368 | + * Register a Redux Slice. | |
| 21369 | + * | |
| 21370 | + * @param {string} id - State id. | |
| 21371 | + * @param {Object} stateConfig - The state config. | |
| 21372 | + * | |
| 21373 | + * @return {void} | |
| 21374 | + */ | |
| 21375 | + | |
| 21376 | + }, { | |
| 21377 | + key: "registerState", | |
| 21378 | + value: function registerState(id, stateConfig) { | |
| 21379 | + id = this.getNamespace() + (id ? "/".concat(id) : ''); | |
| 21380 | + var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, { | |
| 21381 | + name: id | |
| 21382 | + })); | |
| 21383 | + $e.store.register(id, slice); | |
| 21384 | + } | |
| 21385 | + }, { | |
| 21386 | + key: "registerCommandInternal", | |
| 21387 | + value: function registerCommandInternal(command, callback) { | |
| 21388 | + $e.commandsInternal.register(this, command, callback); | |
| 21389 | + } | |
| 21390 | + }, { | |
| 21391 | + key: "registerRoute", | |
| 21392 | + value: function registerRoute(route, callback) { | |
| 21393 | + $e.routes.register(this, route, callback); | |
| 21394 | + } | |
| 21395 | + }, { | |
| 21396 | + key: "registerData", | |
| 21397 | + value: function registerData(command, callback) { | |
| 21398 | + $e.data.register(this, command, callback); | |
| 21399 | + } | |
| 21400 | + }, { | |
| 21401 | + key: "unregisterRoute", | |
| 21402 | + value: function unregisterRoute(route) { | |
| 21403 | + $e.routes.unregister(this, route); | |
| 21404 | + } | |
| 21405 | + }, { | |
| 21406 | + key: "registerTabRoute", | |
| 21407 | + value: function registerTabRoute(tab) { | |
| 21408 | + var _this2 = this; | |
| 21409 | + | |
| 21410 | + this.registerRoute(tab, function (args) { | |
| 21411 | + return _this2.activateTab(tab, args); | |
| 21412 | + }); | |
| 21413 | + } | |
| 21414 | + }, { | |
| 21415 | + key: "dependency", | |
| 21416 | + value: function dependency() { | |
| 21417 | + return true; | |
| 21418 | + } | |
| 21419 | + }, { | |
| 21420 | + key: "open", | |
| 21421 | + value: function open() { | |
| 21422 | + return true; | |
| 21423 | + } | |
| 21424 | + }, { | |
| 21425 | + key: "close", | |
| 21426 | + value: function close() { | |
| 21427 | + if (!this.isOpen) { | |
| 21428 | + return false; | |
| 1152 | 21429 | } |
| 1153 | - return total; | |
| 21430 | + | |
| 21431 | + this.isOpen = false; | |
| 21432 | + this.inactivate(); | |
| 21433 | + $e.routes.clearCurrent(this.getNamespace()); | |
| 21434 | + $e.routes.clearHistory(this.getRootContainer()); | |
| 21435 | + return true; | |
| 1154 | 21436 | } |
| 21437 | + }, { | |
| 21438 | + key: "activate", | |
| 21439 | + value: function activate() { | |
| 21440 | + $e.components.activate(this.getNamespace()); | |
| 21441 | + } | |
| 21442 | + }, { | |
| 21443 | + key: "inactivate", | |
| 21444 | + value: function inactivate() { | |
| 21445 | + $e.components.inactivate(this.getNamespace()); | |
| 21446 | + } | |
| 21447 | + }, { | |
| 21448 | + key: "isActive", | |
| 21449 | + value: function isActive() { | |
| 21450 | + return $e.components.isActive(this.getNamespace()); | |
| 21451 | + } | |
| 21452 | + }, { | |
| 21453 | + key: "onRoute", | |
| 21454 | + value: function onRoute(route) { | |
| 21455 | + this.toggleRouteClass(route, true); | |
| 21456 | + this.toggleHistoryClass(); | |
| 21457 | + this.activate(); | |
| 21458 | + this.trigger('route/open', route); | |
| 21459 | + } | |
| 21460 | + }, { | |
| 21461 | + key: "onCloseRoute", | |
| 21462 | + value: function onCloseRoute(route) { | |
| 21463 | + this.toggleRouteClass(route, false); | |
| 21464 | + this.inactivate(); | |
| 21465 | + this.trigger('route/close', route); | |
| 21466 | + } | |
| 21467 | + }, { | |
| 21468 | + key: "setDefaultRoute", | |
| 21469 | + value: function setDefaultRoute(route) { | |
| 21470 | + this.defaultRoute = this.getNamespace() + '/' + route; | |
| 21471 | + } | |
| 21472 | + }, { | |
| 21473 | + key: "getDefaultRoute", | |
| 21474 | + value: function getDefaultRoute() { | |
| 21475 | + return this.defaultRoute; | |
| 21476 | + } | |
| 21477 | + }, { | |
| 21478 | + key: "removeTab", | |
| 21479 | + value: function removeTab(tab) { | |
| 21480 | + delete this.tabs[tab]; | |
| 21481 | + this.unregisterRoute(tab); | |
| 21482 | + } | |
| 21483 | + }, { | |
| 21484 | + key: "hasTab", | |
| 21485 | + value: function hasTab(tab) { | |
| 21486 | + return !!this.tabs[tab]; | |
| 21487 | + } | |
| 21488 | + }, { | |
| 21489 | + key: "addTab", | |
| 21490 | + value: function addTab(tab, args, position) { | |
| 21491 | + var _this3 = this; | |
| 1155 | 21492 | |
| 21493 | + this.tabs[tab] = args; // It can be 0. | |
| 21494 | + | |
| 21495 | + if ('undefined' !== typeof position) { | |
| 21496 | + var newTabs = {}; | |
| 21497 | + var ids = Object.keys(this.tabs); // Remove new tab | |
| 21498 | + | |
| 21499 | + ids.pop(); // Add it to position. | |
| 21500 | + | |
| 21501 | + ids.splice(position, 0, tab); | |
| 21502 | + ids.forEach(function (id) { | |
| 21503 | + newTabs[id] = _this3.tabs[id]; | |
| 21504 | + }); | |
| 21505 | + this.tabs = newTabs; | |
| 21506 | + } | |
| 21507 | + | |
| 21508 | + this.registerTabRoute(tab); | |
| 21509 | + } | |
| 21510 | + }, { | |
| 21511 | + key: "getTabsWrapperSelector", | |
| 21512 | + value: function getTabsWrapperSelector() { | |
| 21513 | + return ''; | |
| 21514 | + } | |
| 21515 | + }, { | |
| 21516 | + key: "getTabRoute", | |
| 21517 | + value: function getTabRoute(tab) { | |
| 21518 | + return this.getNamespace() + '/' + tab; | |
| 21519 | + } | |
| 21520 | + }, { | |
| 21521 | + key: "renderTab", | |
| 21522 | + value: function renderTab(tab) {} // eslint-disable-line | |
| 21523 | + | |
| 21524 | + }, { | |
| 21525 | + key: "activateTab", | |
| 21526 | + value: function activateTab(tab, args) { | |
| 21527 | + var _this4 = this; | |
| 21528 | + | |
| 21529 | + this.currentTab = tab; | |
| 21530 | + this.renderTab(tab, args); | |
| 21531 | + jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) { | |
| 21532 | + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args); | |
| 21533 | + }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active'); | |
| 21534 | + } | |
| 21535 | + }, { | |
| 21536 | + key: "getActiveTabConfig", | |
| 21537 | + value: function getActiveTabConfig() { | |
| 21538 | + return this.tabs[this.currentTab] || {}; | |
| 21539 | + } | |
| 21540 | + }, { | |
| 21541 | + key: "getBodyClass", | |
| 21542 | + value: function getBodyClass(route) { | |
| 21543 | + return 'e-route-' + route.replace(/\//g, '-'); | |
| 21544 | + } | |
| 1156 | 21545 | /** |
| 1157 | - * @param {string} version1 | |
| 1158 | - * @param {string} version2 | |
| 21546 | + * If command includes uppercase character convert it to lowercase and add `-`. | |
| 21547 | + * e.g: `CopyAll` is converted to `copy-all`. | |
| 1159 | 21548 | * |
| 1160 | - * @return {number} | |
| 21549 | + * @param {string} commandName | |
| 1161 | 21550 | */ |
| 21551 | + | |
| 1162 | 21552 | }, { |
| 1163 | - key: "compareVersion", | |
| 1164 | - value: function compareVersion(version1, version2) { | |
| 1165 | - var _this = this; | |
| 1166 | - return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) { | |
| 1167 | - return _this.getTotalMajor(versionObj); | |
| 1168 | - }).reduce(function (acc, major) { | |
| 1169 | - return acc - major; | |
| 21553 | + key: "normalizeCommandName", | |
| 21554 | + value: function normalizeCommandName(commandName) { | |
| 21555 | + return commandName.replace(/[A-Z]/g, function (match, offset) { | |
| 21556 | + return (offset > 0 ? '-' : '') + match.toLowerCase(); | |
| 1170 | 21557 | }); |
| 1171 | 21558 | } |
| 21559 | + }, { | |
| 21560 | + key: "importCommands", | |
| 21561 | + value: function importCommands(commandsFromImport) { | |
| 21562 | + var _this5 = this; | |
| 1172 | 21563 | |
| 21564 | + var commands = {}; // Convert `Commands` to `ComponentBase` workable format. | |
| 21565 | + | |
| 21566 | + Object.entries(commandsFromImport).forEach(function (_ref11) { | |
| 21567 | + var _ref12 = (0, _slicedToArray2.default)(_ref11, 2), | |
| 21568 | + className = _ref12[0], | |
| 21569 | + Class = _ref12[1]; | |
| 21570 | + | |
| 21571 | + var command = _this5.normalizeCommandName(className); | |
| 21572 | + | |
| 21573 | + commands[command] = function (args) { | |
| 21574 | + return new Class(args).run(); | |
| 21575 | + }; // TODO: Temporary code, remove after merge with 'require-commands-base' branch. | |
| 21576 | + // should not return callback, but Class or Instance without run ( gain performance ). | |
| 21577 | + | |
| 21578 | + | |
| 21579 | + $e.commands.classes[_this5.getNamespace() + '/' + command] = Class; | |
| 21580 | + }); | |
| 21581 | + return commands; | |
| 21582 | + } | |
| 21583 | + }, { | |
| 21584 | + key: "importHooks", | |
| 21585 | + value: function importHooks(hooksFromImport) { | |
| 21586 | + var hooks = {}; | |
| 21587 | + | |
| 21588 | + for (var key in hooksFromImport) { | |
| 21589 | + var hook = new hooksFromImport[key](); | |
| 21590 | + hooks[hook.getId()] = hook; | |
| 21591 | + } | |
| 21592 | + | |
| 21593 | + return hooks; | |
| 21594 | + } | |
| 1173 | 21595 | /** |
| 1174 | - * @param {string} version | |
| 21596 | + * Import & initialize the component's UI states. | |
| 21597 | + * Should be used inside `defaultUiState()`. | |
| 1175 | 21598 | * |
| 1176 | - * @return {boolean} | |
| 21599 | + * @param {Object} statesFromImport - UI states from import. | |
| 21600 | + * | |
| 21601 | + * @return {Object} UI States | |
| 1177 | 21602 | */ |
| 21603 | + | |
| 1178 | 21604 | }, { |
| 1179 | - key: "isSoftDeprecated", | |
| 1180 | - value: function isSoftDeprecated(version) { | |
| 1181 | - var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 1182 | - return total <= 4; | |
| 21605 | + key: "importUiStates", | |
| 21606 | + value: function importUiStates(statesFromImport) { | |
| 21607 | + var _this6 = this; | |
| 21608 | + | |
| 21609 | + var uiStates = {}; | |
| 21610 | + Object.values(statesFromImport).forEach(function (className) { | |
| 21611 | + var uiState = new className(_this6); | |
| 21612 | + uiStates[uiState.getId()] = uiState; | |
| 21613 | + }); | |
| 21614 | + return uiStates; | |
| 1183 | 21615 | } |
| 21616 | + /** | |
| 21617 | + * Set a UI state value. | |
| 21618 | + * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID? | |
| 21619 | + * | |
| 21620 | + * @param {string} state - Non-prefixed state ID. | |
| 21621 | + * @param {*} value - New state value. | |
| 21622 | + * | |
| 21623 | + * @return {void} | |
| 21624 | + */ | |
| 1184 | 21625 | |
| 21626 | + }, { | |
| 21627 | + key: "setUiState", | |
| 21628 | + value: function setUiState(state, value) { | |
| 21629 | + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value); | |
| 21630 | + } | |
| 21631 | + }, { | |
| 21632 | + key: "toggleRouteClass", | |
| 21633 | + value: function toggleRouteClass(route, state) { | |
| 21634 | + document.body.classList.toggle(this.getBodyClass(route), state); | |
| 21635 | + } | |
| 21636 | + }, { | |
| 21637 | + key: "toggleHistoryClass", | |
| 21638 | + value: function toggleHistoryClass() { | |
| 21639 | + document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getRootContainer()).length); | |
| 21640 | + } | |
| 21641 | + }]); | |
| 21642 | + return ComponentBase; | |
| 21643 | +}(_module.default); | |
| 21644 | + | |
| 21645 | +exports["default"] = ComponentBase; | |
| 21646 | + | |
| 21647 | +/***/ }), | |
| 21648 | + | |
| 21649 | +/***/ "../modules/web-cli/assets/js/modules/hook-base.js": | |
| 21650 | +/*!*********************************************************!*\ | |
| 21651 | + !*** ../modules/web-cli/assets/js/modules/hook-base.js ***! | |
| 21652 | + \*********************************************************/ | |
| 21653 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 21654 | + | |
| 21655 | +"use strict"; | |
| 21656 | + | |
| 21657 | + | |
| 21658 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 21659 | + | |
| 21660 | +Object.defineProperty(exports, "__esModule", ({ | |
| 21661 | + value: true | |
| 21662 | +})); | |
| 21663 | +exports["default"] = void 0; | |
| 21664 | + | |
| 21665 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 21666 | + | |
| 21667 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 21668 | + | |
| 21669 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 21670 | + | |
| 21671 | +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 21672 | + | |
| 21673 | +var HookBase = /*#__PURE__*/function () { | |
| 21674 | + /** | |
| 21675 | + * Callback type, eg ( hook, event ). | |
| 21676 | + * | |
| 21677 | + * @type {string} | |
| 21678 | + */ | |
| 21679 | + | |
| 21680 | + /** | |
| 21681 | + * Full command address, that will hook the callback. | |
| 21682 | + * | |
| 21683 | + * @type {string} | |
| 21684 | + */ | |
| 21685 | + | |
| 21686 | + /** | |
| 21687 | + * Unique id of the callback. | |
| 21688 | + * | |
| 21689 | + * @type {string} | |
| 21690 | + */ | |
| 21691 | + | |
| 21692 | + /** | |
| 21693 | + * Function constructor(). | |
| 21694 | + * | |
| 21695 | + * Create callback base. | |
| 21696 | + */ | |
| 21697 | + function HookBase() { | |
| 21698 | + (0, _classCallCheck2.default)(this, HookBase); | |
| 21699 | + (0, _defineProperty2.default)(this, "type", void 0); | |
| 21700 | + (0, _defineProperty2.default)(this, "command", void 0); | |
| 21701 | + (0, _defineProperty2.default)(this, "id", void 0); | |
| 21702 | + this.initialize(); | |
| 21703 | + this.type = this.getType(); | |
| 21704 | + this.command = this.getCommand(); | |
| 21705 | + this.id = this.getId(); | |
| 21706 | + } | |
| 21707 | + /** | |
| 21708 | + * Function initialize(). | |
| 21709 | + * | |
| 21710 | + * Called after creation of the base, used for initialize extras. | |
| 21711 | + * Without expending constructor. | |
| 21712 | + */ | |
| 21713 | + | |
| 21714 | + | |
| 21715 | + (0, _createClass2.default)(HookBase, [{ | |
| 21716 | + key: "initialize", | |
| 21717 | + value: function initialize() {} | |
| 1185 | 21718 | /** |
| 1186 | - * @param {string} version | |
| 1187 | - * @return {boolean} | |
| 21719 | + * Function register(). | |
| 21720 | + * | |
| 21721 | + * Used to register the callback. | |
| 21722 | + * | |
| 21723 | + * @throws {Error} | |
| 1188 | 21724 | */ |
| 21725 | + | |
| 1189 | 21726 | }, { |
| 1190 | - key: "isHardDeprecated", | |
| 1191 | - value: function isHardDeprecated(version) { | |
| 1192 | - var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 1193 | - return total < 0 || total >= 8; | |
| 21727 | + key: "register", | |
| 21728 | + value: function register() { | |
| 21729 | + (0, _forceMethodImplementation.default)(); | |
| 21730 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 21731 | + | |
| 21732 | + /** | |
| 21733 | + * Function getType(). | |
| 21734 | + * | |
| 21735 | + * Get type eg: ( hook, event, etc ... ). | |
| 21736 | + * | |
| 21737 | + * @return {string} type | |
| 21738 | + * | |
| 21739 | + * @throws {Error} | |
| 21740 | + */ | |
| 21741 | + | |
| 21742 | + }, { | |
| 21743 | + key: "getType", | |
| 21744 | + value: function getType() { | |
| 21745 | + (0, _forceMethodImplementation.default)(); | |
| 21746 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 21747 | + | |
| 21748 | + /** | |
| 21749 | + * Function getCommand(). | |
| 21750 | + * | |
| 21751 | + * Returns the full command path for callback binding. | |
| 21752 | + * | |
| 21753 | + * Supports array of strings ( commands ). | |
| 21754 | + * | |
| 21755 | + * @return {string} command | |
| 21756 | + * | |
| 21757 | + * @throws {Error} | |
| 21758 | + */ | |
| 21759 | + | |
| 21760 | + }, { | |
| 21761 | + key: "getCommand", | |
| 21762 | + value: function getCommand() { | |
| 21763 | + (0, _forceMethodImplementation.default)(); | |
| 21764 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 21765 | + | |
| 21766 | + /** | |
| 21767 | + * Function getId(). | |
| 21768 | + * | |
| 21769 | + * Returns command id for the hook (should be unique). | |
| 21770 | + * | |
| 21771 | + * @return {string} id | |
| 21772 | + * | |
| 21773 | + * @throws {Error} | |
| 21774 | + */ | |
| 21775 | + | |
| 21776 | + }, { | |
| 21777 | + key: "getId", | |
| 21778 | + value: function getId() { | |
| 21779 | + (0, _forceMethodImplementation.default)(); | |
| 21780 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 21781 | + | |
| 21782 | + /** | |
| 21783 | + * Function getContainerType(). | |
| 21784 | + * | |
| 21785 | + * Bind eContainer type to callback. | |
| 21786 | + * | |
| 21787 | + * Used to gain performance. | |
| 21788 | + * | |
| 21789 | + * @return {string} type | |
| 21790 | + */ | |
| 21791 | + | |
| 21792 | + }, { | |
| 21793 | + key: "getContainerType", | |
| 21794 | + value: function getContainerType() {} | |
| 21795 | + /** | |
| 21796 | + * Function getConditions(). | |
| 21797 | + * | |
| 21798 | + * Condition for running the callback, if true, call to apply(). | |
| 21799 | + * | |
| 21800 | + * @param {*} [args={}] | |
| 21801 | + * @param {*} [result=*] | |
| 21802 | + * | |
| 21803 | + * @return {boolean} conditions | |
| 21804 | + */ | |
| 21805 | + | |
| 21806 | + }, { | |
| 21807 | + key: "getConditions", | |
| 21808 | + value: function getConditions() { | |
| 21809 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 21810 | + var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 21811 | + // eslint-disable-line no-unused-vars | |
| 21812 | + return true; | |
| 21813 | + } // eslint-disable-next-line jsdoc/require-returns-check | |
| 21814 | + | |
| 21815 | + /** | |
| 21816 | + * Function apply(). | |
| 21817 | + * | |
| 21818 | + * Apply the callback, ( The actual affect of the callback ). | |
| 21819 | + * | |
| 21820 | + * @param {*} [args={}] | |
| 21821 | + * | |
| 21822 | + * @return {*} results | |
| 21823 | + */ | |
| 21824 | + | |
| 21825 | + }, { | |
| 21826 | + key: "apply", | |
| 21827 | + value: function apply(args) { | |
| 21828 | + // eslint-disable-line no-unused-vars | |
| 21829 | + (0, _forceMethodImplementation.default)(); | |
| 1194 | 21830 | } |
| 21831 | + /** | |
| 21832 | + * Function run(). | |
| 21833 | + * | |
| 21834 | + * Run the callback. | |
| 21835 | + * | |
| 21836 | + * @param {*} args | |
| 21837 | + * | |
| 21838 | + * @return {*} results | |
| 21839 | + */ | |
| 21840 | + | |
| 21841 | + }, { | |
| 21842 | + key: "run", | |
| 21843 | + value: function run() { | |
| 21844 | + var _ref = arguments.length <= 0 ? undefined : arguments[0], | |
| 21845 | + _ref$options = _ref.options, | |
| 21846 | + options = _ref$options === void 0 ? {} : _ref$options; // Disable callback if requested by args.options. | |
| 21847 | + | |
| 21848 | + | |
| 21849 | + if (options.callbacks && false === options.callbacks[this.id]) { | |
| 21850 | + return true; | |
| 21851 | + } | |
| 21852 | + | |
| 21853 | + if (this.getConditions.apply(this, arguments)) { | |
| 21854 | + if ($e.devTools) { | |
| 21855 | + $e.devTools.log.callbacks().active(this.type, this.command, this.id); | |
| 21856 | + } | |
| 21857 | + | |
| 21858 | + return this.apply.apply(this, arguments); | |
| 21859 | + } | |
| 21860 | + | |
| 21861 | + return true; | |
| 21862 | + } | |
| 1195 | 21863 | }]); |
| 21864 | + return HookBase; | |
| 1196 | 21865 | }(); |
| 1197 | 21866 | |
| 21867 | +exports["default"] = HookBase; | |
| 21868 | + | |
| 1198 | 21869 | /***/ }), |
| 1199 | 21870 | |
| 1200 | -/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 1201 | -/*!******************************************************************!*\ | |
| 1202 | - !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 1203 | - \******************************************************************/ | |
| 1204 | -/***/ ((module) => { | |
| 21871 | +/***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js": | |
| 21872 | +/*!****************************************************************!*\ | |
| 21873 | + !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***! | |
| 21874 | + \****************************************************************/ | |
| 21875 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1205 | 21876 | |
| 1206 | -function _arrayLikeToArray(r, a) { | |
| 1207 | - (null == a || a > r.length) && (a = r.length); | |
| 1208 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 1209 | - return n; | |
| 1210 | -} | |
| 1211 | -module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 21877 | +"use strict"; | |
| 1212 | 21878 | |
| 21879 | + | |
| 21880 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 21881 | + | |
| 21882 | +Object.defineProperty(exports, "__esModule", ({ | |
| 21883 | + value: true | |
| 21884 | +})); | |
| 21885 | +exports["default"] = exports.After = void 0; | |
| 21886 | + | |
| 21887 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 21888 | + | |
| 21889 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 21890 | + | |
| 21891 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 21892 | + | |
| 21893 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 21894 | + | |
| 21895 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 21896 | + | |
| 21897 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js")); | |
| 21898 | + | |
| 21899 | +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); }; } | |
| 21900 | + | |
| 21901 | +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; } } | |
| 21902 | + | |
| 21903 | +var After = /*#__PURE__*/function (_Base) { | |
| 21904 | + (0, _inherits2.default)(After, _Base); | |
| 21905 | + | |
| 21906 | + var _super = _createSuper(After); | |
| 21907 | + | |
| 21908 | + function After() { | |
| 21909 | + (0, _classCallCheck2.default)(this, After); | |
| 21910 | + return _super.apply(this, arguments); | |
| 21911 | + } | |
| 21912 | + | |
| 21913 | + (0, _createClass2.default)(After, [{ | |
| 21914 | + key: "register", | |
| 21915 | + value: function register() { | |
| 21916 | + $e.hooks.registerDataAfter(this); | |
| 21917 | + } | |
| 21918 | + }]); | |
| 21919 | + return After; | |
| 21920 | +}(_base.default); | |
| 21921 | + | |
| 21922 | +exports.After = After; | |
| 21923 | +var _default = After; | |
| 21924 | +exports["default"] = _default; | |
| 21925 | + | |
| 1213 | 21926 | /***/ }), |
| 1214 | 21927 | |
| 1215 | -/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 1216 | -/*!****************************************************************!*\ | |
| 1217 | - !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 1218 | - \****************************************************************/ | |
| 1219 | -/***/ ((module) => { | |
| 21928 | +/***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js": | |
| 21929 | +/*!***************************************************************!*\ | |
| 21930 | + !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***! | |
| 21931 | + \***************************************************************/ | |
| 21932 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1220 | 21933 | |
| 1221 | -function _arrayWithHoles(r) { | |
| 1222 | - if (Array.isArray(r)) return r; | |
| 1223 | -} | |
| 1224 | -module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 21934 | +"use strict"; | |
| 1225 | 21935 | |
| 21936 | + | |
| 21937 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 21938 | + | |
| 21939 | +Object.defineProperty(exports, "__esModule", ({ | |
| 21940 | + value: true | |
| 21941 | +})); | |
| 21942 | +exports["default"] = exports.Base = void 0; | |
| 21943 | + | |
| 21944 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 21945 | + | |
| 21946 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 21947 | + | |
| 21948 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 21949 | + | |
| 21950 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 21951 | + | |
| 21952 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 21953 | + | |
| 21954 | +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js")); | |
| 21955 | + | |
| 21956 | +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); }; } | |
| 21957 | + | |
| 21958 | +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; } } | |
| 21959 | + | |
| 21960 | +var Base = /*#__PURE__*/function (_HookBase) { | |
| 21961 | + (0, _inherits2.default)(Base, _HookBase); | |
| 21962 | + | |
| 21963 | + var _super = _createSuper(Base); | |
| 21964 | + | |
| 21965 | + function Base() { | |
| 21966 | + (0, _classCallCheck2.default)(this, Base); | |
| 21967 | + return _super.apply(this, arguments); | |
| 21968 | + } | |
| 21969 | + | |
| 21970 | + (0, _createClass2.default)(Base, [{ | |
| 21971 | + key: "getType", | |
| 21972 | + value: function getType() { | |
| 21973 | + return 'data'; | |
| 21974 | + } | |
| 21975 | + }]); | |
| 21976 | + return Base; | |
| 21977 | +}(_hookBase.default); | |
| 21978 | + | |
| 21979 | +exports.Base = Base; | |
| 21980 | +var _default = Base; | |
| 21981 | +exports["default"] = _default; | |
| 21982 | + | |
| 1226 | 21983 | /***/ }), |
| 1227 | 21984 | |
| 1228 | -/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 1229 | -/*!***********************************************************************!*\ | |
| 1230 | - !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 1231 | - \***********************************************************************/ | |
| 1232 | -/***/ ((module) => { | |
| 21985 | +/***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js": | |
| 21986 | +/*!*********************************************************************!*\ | |
| 21987 | + !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***! | |
| 21988 | + \*********************************************************************/ | |
| 21989 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1233 | 21990 | |
| 1234 | -function _assertThisInitialized(e) { | |
| 1235 | - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 1236 | - return e; | |
| 1237 | -} | |
| 1238 | -module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 21991 | +"use strict"; | |
| 1239 | 21992 | |
| 21993 | + | |
| 21994 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 21995 | + | |
| 21996 | +Object.defineProperty(exports, "__esModule", ({ | |
| 21997 | + value: true | |
| 21998 | +})); | |
| 21999 | +exports["default"] = exports.Dependency = void 0; | |
| 22000 | + | |
| 22001 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 22002 | + | |
| 22003 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22004 | + | |
| 22005 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 22006 | + | |
| 22007 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 22008 | + | |
| 22009 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 22010 | + | |
| 22011 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js")); | |
| 22012 | + | |
| 22013 | +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); }; } | |
| 22014 | + | |
| 22015 | +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; } } | |
| 22016 | + | |
| 22017 | +var Dependency = /*#__PURE__*/function (_Base) { | |
| 22018 | + (0, _inherits2.default)(Dependency, _Base); | |
| 22019 | + | |
| 22020 | + var _super = _createSuper(Dependency); | |
| 22021 | + | |
| 22022 | + function Dependency() { | |
| 22023 | + (0, _classCallCheck2.default)(this, Dependency); | |
| 22024 | + return _super.apply(this, arguments); | |
| 22025 | + } | |
| 22026 | + | |
| 22027 | + (0, _createClass2.default)(Dependency, [{ | |
| 22028 | + key: "register", | |
| 22029 | + value: function register() { | |
| 22030 | + $e.hooks.registerDataDependency(this); | |
| 22031 | + } | |
| 22032 | + }]); | |
| 22033 | + return Dependency; | |
| 22034 | +}(_base.default); | |
| 22035 | + | |
| 22036 | +exports.Dependency = Dependency; | |
| 22037 | +var _default = Dependency; | |
| 22038 | +exports["default"] = _default; | |
| 22039 | + | |
| 1240 | 22040 | /***/ }), |
| 1241 | 22041 | |
| 1242 | -/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 1243 | -/*!****************************************************************!*\ | |
| 1244 | - !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 1245 | - \****************************************************************/ | |
| 1246 | -/***/ ((module) => { | |
| 22042 | +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js": | |
| 22043 | +/*!**************************************************************!*\ | |
| 22044 | + !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***! | |
| 22045 | + \**************************************************************/ | |
| 22046 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1247 | 22047 | |
| 1248 | -function _classCallCheck(a, n) { | |
| 1249 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 1250 | -} | |
| 1251 | -module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 22048 | +"use strict"; | |
| 1252 | 22049 | |
| 22050 | + | |
| 22051 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 22052 | + | |
| 22053 | +Object.defineProperty(exports, "__esModule", ({ | |
| 22054 | + value: true | |
| 22055 | +})); | |
| 22056 | +exports["default"] = exports.After = void 0; | |
| 22057 | + | |
| 22058 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 22059 | + | |
| 22060 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22061 | + | |
| 22062 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 22063 | + | |
| 22064 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 22065 | + | |
| 22066 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 22067 | + | |
| 22068 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js")); | |
| 22069 | + | |
| 22070 | +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); }; } | |
| 22071 | + | |
| 22072 | +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; } } | |
| 22073 | + | |
| 22074 | +var After = /*#__PURE__*/function (_Base) { | |
| 22075 | + (0, _inherits2.default)(After, _Base); | |
| 22076 | + | |
| 22077 | + var _super = _createSuper(After); | |
| 22078 | + | |
| 22079 | + function After() { | |
| 22080 | + (0, _classCallCheck2.default)(this, After); | |
| 22081 | + return _super.apply(this, arguments); | |
| 22082 | + } | |
| 22083 | + | |
| 22084 | + (0, _createClass2.default)(After, [{ | |
| 22085 | + key: "register", | |
| 22086 | + value: function register() { | |
| 22087 | + $e.hooks.registerUIAfter(this); | |
| 22088 | + } | |
| 22089 | + }]); | |
| 22090 | + return After; | |
| 22091 | +}(_base.default); | |
| 22092 | + | |
| 22093 | +exports.After = After; | |
| 22094 | +var _default = After; | |
| 22095 | +exports["default"] = _default; | |
| 22096 | + | |
| 1253 | 22097 | /***/ }), |
| 1254 | 22098 | |
| 1255 | -/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 22099 | +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js": | |
| 1256 | 22100 | /*!*************************************************************!*\ |
| 1257 | - !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 22101 | + !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***! | |
| 1258 | 22102 | \*************************************************************/ |
| 1259 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 22103 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1260 | 22104 | |
| 1261 | -var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 1262 | -function _defineProperties(e, r) { | |
| 1263 | - for (var t = 0; t < r.length; t++) { | |
| 1264 | - var o = r[t]; | |
| 1265 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 22105 | +"use strict"; | |
| 22106 | + | |
| 22107 | + | |
| 22108 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 22109 | + | |
| 22110 | +Object.defineProperty(exports, "__esModule", ({ | |
| 22111 | + value: true | |
| 22112 | +})); | |
| 22113 | +exports["default"] = exports.Base = void 0; | |
| 22114 | + | |
| 22115 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 22116 | + | |
| 22117 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22118 | + | |
| 22119 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 22120 | + | |
| 22121 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 22122 | + | |
| 22123 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 22124 | + | |
| 22125 | +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js")); | |
| 22126 | + | |
| 22127 | +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); }; } | |
| 22128 | + | |
| 22129 | +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; } } | |
| 22130 | + | |
| 22131 | +var Base = /*#__PURE__*/function (_HookBase) { | |
| 22132 | + (0, _inherits2.default)(Base, _HookBase); | |
| 22133 | + | |
| 22134 | + var _super = _createSuper(Base); | |
| 22135 | + | |
| 22136 | + function Base() { | |
| 22137 | + (0, _classCallCheck2.default)(this, Base); | |
| 22138 | + return _super.apply(this, arguments); | |
| 1266 | 22139 | } |
| 1267 | -} | |
| 1268 | -function _createClass(e, r, t) { | |
| 1269 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { | |
| 1270 | - writable: !1 | |
| 1271 | - }), e; | |
| 1272 | -} | |
| 1273 | -module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1274 | 22140 | |
| 22141 | + (0, _createClass2.default)(Base, [{ | |
| 22142 | + key: "getType", | |
| 22143 | + value: function getType() { | |
| 22144 | + return 'ui'; | |
| 22145 | + } | |
| 22146 | + }]); | |
| 22147 | + return Base; | |
| 22148 | +}(_hookBase.default); | |
| 22149 | + | |
| 22150 | +exports.Base = Base; | |
| 22151 | +var _default = Base; | |
| 22152 | +exports["default"] = _default; | |
| 22153 | + | |
| 1275 | 22154 | /***/ }), |
| 1276 | 22155 | |
| 1277 | -/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 1278 | -/*!****************************************************************!*\ | |
| 1279 | - !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 1280 | - \****************************************************************/ | |
| 1281 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 22156 | +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js": | |
| 22157 | +/*!***************************************************************!*\ | |
| 22158 | + !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***! | |
| 22159 | + \***************************************************************/ | |
| 22160 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1282 | 22161 | |
| 1283 | -var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 1284 | -function _defineProperty(e, r, t) { | |
| 1285 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 1286 | - value: t, | |
| 1287 | - enumerable: !0, | |
| 1288 | - configurable: !0, | |
| 1289 | - writable: !0 | |
| 1290 | - }) : e[r] = t, e; | |
| 1291 | -} | |
| 1292 | -module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 22162 | +"use strict"; | |
| 1293 | 22163 | |
| 22164 | + | |
| 22165 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 22166 | + | |
| 22167 | +Object.defineProperty(exports, "__esModule", ({ | |
| 22168 | + value: true | |
| 22169 | +})); | |
| 22170 | +exports["default"] = exports.Before = void 0; | |
| 22171 | + | |
| 22172 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 22173 | + | |
| 22174 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22175 | + | |
| 22176 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 22177 | + | |
| 22178 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 22179 | + | |
| 22180 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 22181 | + | |
| 22182 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js")); | |
| 22183 | + | |
| 22184 | +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); }; } | |
| 22185 | + | |
| 22186 | +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; } } | |
| 22187 | + | |
| 22188 | +var Before = /*#__PURE__*/function (_Base) { | |
| 22189 | + (0, _inherits2.default)(Before, _Base); | |
| 22190 | + | |
| 22191 | + var _super = _createSuper(Before); | |
| 22192 | + | |
| 22193 | + function Before() { | |
| 22194 | + (0, _classCallCheck2.default)(this, Before); | |
| 22195 | + return _super.apply(this, arguments); | |
| 22196 | + } | |
| 22197 | + | |
| 22198 | + (0, _createClass2.default)(Before, [{ | |
| 22199 | + key: "register", | |
| 22200 | + value: function register() { | |
| 22201 | + $e.hooks.registerUIBefore(this); | |
| 22202 | + } | |
| 22203 | + }]); | |
| 22204 | + return Before; | |
| 22205 | +}(_base.default); | |
| 22206 | + | |
| 22207 | +exports.Before = Before; | |
| 22208 | +var _default = Before; | |
| 22209 | +exports["default"] = _default; | |
| 22210 | + | |
| 1294 | 22211 | /***/ }), |
| 1295 | 22212 | |
| 1296 | -/***/ "../node_modules/@babel/runtime/helpers/get.js": | |
| 22213 | +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js": | |
| 22214 | +/*!**************************************************************!*\ | |
| 22215 | + !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***! | |
| 22216 | + \**************************************************************/ | |
| 22217 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 22218 | + | |
| 22219 | +"use strict"; | |
| 22220 | + | |
| 22221 | + | |
| 22222 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 22223 | + | |
| 22224 | +Object.defineProperty(exports, "__esModule", ({ | |
| 22225 | + value: true | |
| 22226 | +})); | |
| 22227 | +exports["default"] = exports.Catch = void 0; | |
| 22228 | + | |
| 22229 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 22230 | + | |
| 22231 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22232 | + | |
| 22233 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 22234 | + | |
| 22235 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 22236 | + | |
| 22237 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 22238 | + | |
| 22239 | +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js")); | |
| 22240 | + | |
| 22241 | +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); }; } | |
| 22242 | + | |
| 22243 | +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; } } | |
| 22244 | + | |
| 22245 | +var Catch = /*#__PURE__*/function (_Base) { | |
| 22246 | + (0, _inherits2.default)(Catch, _Base); | |
| 22247 | + | |
| 22248 | + var _super = _createSuper(Catch); | |
| 22249 | + | |
| 22250 | + function Catch() { | |
| 22251 | + (0, _classCallCheck2.default)(this, Catch); | |
| 22252 | + return _super.apply(this, arguments); | |
| 22253 | + } | |
| 22254 | + | |
| 22255 | + (0, _createClass2.default)(Catch, [{ | |
| 22256 | + key: "register", | |
| 22257 | + value: function register() { | |
| 22258 | + $e.hooks.registerUICatch(this); | |
| 22259 | + } | |
| 22260 | + }]); | |
| 22261 | + return Catch; | |
| 22262 | +}(_base.default); | |
| 22263 | + | |
| 22264 | +exports.Catch = Catch; | |
| 22265 | +var _default = Catch; | |
| 22266 | +exports["default"] = _default; | |
| 22267 | + | |
| 22268 | +/***/ }), | |
| 22269 | + | |
| 22270 | +/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js": | |
| 22271 | +/*!*************************************************************************!*\ | |
| 22272 | + !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***! | |
| 22273 | + \*************************************************************************/ | |
| 22274 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 22275 | + | |
| 22276 | +"use strict"; | |
| 22277 | + | |
| 22278 | + | |
| 22279 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 22280 | + | |
| 22281 | +Object.defineProperty(exports, "__esModule", ({ | |
| 22282 | + value: true | |
| 22283 | +})); | |
| 22284 | +exports["default"] = exports.ForceMethodImplementation = void 0; | |
| 22285 | + | |
| 22286 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22287 | + | |
| 22288 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 22289 | + | |
| 22290 | +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js")); | |
| 22291 | + | |
| 22292 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 22293 | + | |
| 22294 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 22295 | + | |
| 22296 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 22297 | + | |
| 22298 | +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js")); | |
| 22299 | + | |
| 22300 | +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); }; } | |
| 22301 | + | |
| 22302 | +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; } } | |
| 22303 | + | |
| 22304 | +// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`; | |
| 22305 | +var ForceMethodImplementation = /*#__PURE__*/function (_Error) { | |
| 22306 | + (0, _inherits2.default)(ForceMethodImplementation, _Error); | |
| 22307 | + | |
| 22308 | + var _super = _createSuper(ForceMethodImplementation); | |
| 22309 | + | |
| 22310 | + function ForceMethodImplementation() { | |
| 22311 | + var _this; | |
| 22312 | + | |
| 22313 | + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 22314 | + (0, _classCallCheck2.default)(this, ForceMethodImplementation); | |
| 22315 | + _this = _super.call(this, "".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")); | |
| 22316 | + Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), ForceMethodImplementation); | |
| 22317 | + return _this; | |
| 22318 | + } | |
| 22319 | + | |
| 22320 | + return (0, _createClass2.default)(ForceMethodImplementation); | |
| 22321 | +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); | |
| 22322 | + | |
| 22323 | +exports.ForceMethodImplementation = ForceMethodImplementation; | |
| 22324 | + | |
| 22325 | +var _default = function _default() { | |
| 22326 | + var stack = Error().stack, | |
| 22327 | + caller = stack.split('\n')[2].trim(), | |
| 22328 | + callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1], | |
| 22329 | + info = {}; | |
| 22330 | + info.functionName = callerName; | |
| 22331 | + info.fullName = callerName; | |
| 22332 | + | |
| 22333 | + if (info.functionName.includes('.')) { | |
| 22334 | + var parts = info.functionName.split('.'); | |
| 22335 | + info.className = parts[0]; | |
| 22336 | + info.functionName = parts[1]; | |
| 22337 | + } else { | |
| 22338 | + info.isStatic = true; | |
| 22339 | + } | |
| 22340 | + | |
| 22341 | + throw new ForceMethodImplementation(info); | |
| 22342 | +}; | |
| 22343 | + | |
| 22344 | +exports["default"] = _default; | |
| 22345 | + | |
| 22346 | +/***/ }), | |
| 22347 | + | |
| 22348 | +/***/ "../modules/web-cli/assets/js/utils/helpers.js": | |
| 1297 | 22349 | /*!*****************************************************!*\ |
| 1298 | - !*** ../node_modules/@babel/runtime/helpers/get.js ***! | |
| 22350 | + !*** ../modules/web-cli/assets/js/utils/helpers.js ***! | |
| 1299 | 22351 | \*****************************************************/ |
| 1300 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 22352 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1301 | 22353 | |
| 1302 | -var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); | |
| 1303 | -function _get() { | |
| 1304 | - return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { | |
| 1305 | - var p = superPropBase(e, t); | |
| 1306 | - if (p) { | |
| 1307 | - var n = Object.getOwnPropertyDescriptor(p, t); | |
| 1308 | - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 22354 | +"use strict"; | |
| 22355 | + | |
| 22356 | + | |
| 22357 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 22358 | + | |
| 22359 | +Object.defineProperty(exports, "__esModule", ({ | |
| 22360 | + value: true | |
| 22361 | +})); | |
| 22362 | +exports["default"] = void 0; | |
| 22363 | + | |
| 22364 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 22365 | + | |
| 22366 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22367 | + | |
| 22368 | +// TODO: Copied from `core/common/assets/js/utils/helpers.js` and modified into static functions. | |
| 22369 | +var Helpers = /*#__PURE__*/function () { | |
| 22370 | + function Helpers() { | |
| 22371 | + (0, _classCallCheck2.default)(this, Helpers); | |
| 22372 | + } | |
| 22373 | + | |
| 22374 | + (0, _createClass2.default)(Helpers, null, [{ | |
| 22375 | + key: "softDeprecated", | |
| 22376 | + value: function softDeprecated(name, version, replacement) { | |
| 22377 | + if (elementorWebCliConfig.isDebug) { | |
| 22378 | + this.deprecatedMessage('soft', name, version, replacement); | |
| 22379 | + } | |
| 1309 | 22380 | } |
| 1310 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); | |
| 22381 | + }, { | |
| 22382 | + key: "hardDeprecated", | |
| 22383 | + value: function hardDeprecated(name, version, replacement) { | |
| 22384 | + this.deprecatedMessage('hard', name, version, replacement); | |
| 22385 | + } | |
| 22386 | + }, { | |
| 22387 | + key: "deprecatedMessage", | |
| 22388 | + value: function deprecatedMessage(type, name, version, replacement) { | |
| 22389 | + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version); | |
| 22390 | + | |
| 22391 | + if (replacement) { | |
| 22392 | + message += " - Use `".concat(replacement, "` instead"); | |
| 22393 | + } | |
| 22394 | + | |
| 22395 | + this.consoleWarn(message); | |
| 22396 | + } | |
| 22397 | + }, { | |
| 22398 | + key: "consoleWarn", | |
| 22399 | + value: function consoleWarn() { | |
| 22400 | + var _console; | |
| 22401 | + | |
| 22402 | + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;"); | |
| 22403 | + | |
| 22404 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 22405 | + args[_key] = arguments[_key]; | |
| 22406 | + } | |
| 22407 | + | |
| 22408 | + args.unshift('%c %c', style, ''); | |
| 22409 | + | |
| 22410 | + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console | |
| 22411 | + | |
| 22412 | + } | |
| 22413 | + }, { | |
| 22414 | + key: "consoleError", | |
| 22415 | + value: function consoleError(message) { | |
| 22416 | + // TODO: function is part of $e. | |
| 22417 | + // Show an error if devTools is available. | |
| 22418 | + if ($e.devTools) { | |
| 22419 | + $e.devTools.log.error(message); | |
| 22420 | + } // If not a 'Hook-Break' then show error. | |
| 22421 | + | |
| 22422 | + | |
| 22423 | + if (!(message instanceof $e.modules.HookBreak)) { | |
| 22424 | + // eslint-disable-next-line no-console | |
| 22425 | + console.error(message); | |
| 22426 | + } | |
| 22427 | + } | |
| 22428 | + }, { | |
| 22429 | + key: "deprecatedMethod", | |
| 22430 | + value: function deprecatedMethod(methodName, version, replacement) { | |
| 22431 | + this.deprecatedMessage('hard', methodName, version, replacement); // This itself is deprecated. | |
| 22432 | + | |
| 22433 | + this.softDeprecated('Helpers.deprecatedMethod', '2.8.0', 'Helpers.softDeprecated || Helpers.hardDeprecated'); | |
| 22434 | + } | |
| 22435 | + }, { | |
| 22436 | + key: "cloneObject", | |
| 22437 | + value: function cloneObject(object) { | |
| 22438 | + return JSON.parse(JSON.stringify(object)); | |
| 22439 | + } | |
| 22440 | + }, { | |
| 22441 | + key: "upperCaseWords", | |
| 22442 | + value: function upperCaseWords(string) { | |
| 22443 | + return (string + '').replace(/^(.)|\s+(.)/g, function ($1) { | |
| 22444 | + return $1.toUpperCase(); | |
| 22445 | + }); | |
| 22446 | + } | |
| 22447 | + }, { | |
| 22448 | + key: "getUniqueId", | |
| 22449 | + value: function getUniqueId() { | |
| 22450 | + return Math.random().toString(16).substr(2, 7); | |
| 22451 | + } | |
| 22452 | + }]); | |
| 22453 | + return Helpers; | |
| 22454 | +}(); | |
| 22455 | + | |
| 22456 | +exports["default"] = Helpers; | |
| 22457 | + | |
| 22458 | +/***/ }), | |
| 22459 | + | |
| 22460 | +/***/ "../node_modules/redux-thunk/es/index.js": | |
| 22461 | +/*!***********************************************!*\ | |
| 22462 | + !*** ../node_modules/redux-thunk/es/index.js ***! | |
| 22463 | + \***********************************************/ | |
| 22464 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 22465 | + | |
| 22466 | +"use strict"; | |
| 22467 | +__webpack_require__.r(__webpack_exports__); | |
| 22468 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 22469 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) | |
| 22470 | +/* harmony export */ }); | |
| 22471 | +/** A function that accepts a potential "extra argument" value to be injected later, | |
| 22472 | + * and returns an instance of the thunk middleware that uses that value | |
| 22473 | + */ | |
| 22474 | +function createThunkMiddleware(extraArgument) { | |
| 22475 | + // Standard Redux middleware definition pattern: | |
| 22476 | + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware | |
| 22477 | + var middleware = function middleware(_ref) { | |
| 22478 | + var dispatch = _ref.dispatch, | |
| 22479 | + getState = _ref.getState; | |
| 22480 | + return function (next) { | |
| 22481 | + return function (action) { | |
| 22482 | + // The thunk middleware looks for any functions that were passed to `store.dispatch`. | |
| 22483 | + // If this "action" is really a function, call it and return the result. | |
| 22484 | + if (typeof action === 'function') { | |
| 22485 | + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" | |
| 22486 | + return action(dispatch, getState, extraArgument); | |
| 22487 | + } // Otherwise, pass the action down the middleware chain as usual | |
| 22488 | + | |
| 22489 | + | |
| 22490 | + return next(action); | |
| 22491 | + }; | |
| 22492 | + }; | |
| 22493 | + }; | |
| 22494 | + | |
| 22495 | + return middleware; | |
| 1311 | 22496 | } |
| 1312 | -module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1313 | 22497 | |
| 22498 | +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version | |
| 22499 | +// with whatever "extra arg" they want to inject into their thunks | |
| 22500 | + | |
| 22501 | +thunk.withExtraArgument = createThunkMiddleware; | |
| 22502 | +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk); | |
| 22503 | + | |
| 1314 | 22504 | /***/ }), |
| 1315 | 22505 | |
| 1316 | -/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 1317 | -/*!****************************************************************!*\ | |
| 1318 | - !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 1319 | - \****************************************************************/ | |
| 1320 | -/***/ ((module) => { | |
| 22506 | +/***/ "../node_modules/redux/es/redux.js": | |
| 22507 | +/*!*****************************************!*\ | |
| 22508 | + !*** ../node_modules/redux/es/redux.js ***! | |
| 22509 | + \*****************************************/ | |
| 22510 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 1321 | 22511 | |
| 1322 | -function _getPrototypeOf(t) { | |
| 1323 | - return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { | |
| 1324 | - return t.__proto__ || Object.getPrototypeOf(t); | |
| 1325 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); | |
| 22512 | +"use strict"; | |
| 22513 | +__webpack_require__.r(__webpack_exports__); | |
| 22514 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 22515 | +/* harmony export */ "__DO_NOT_USE__ActionTypes": () => (/* binding */ ActionTypes), | |
| 22516 | +/* harmony export */ "applyMiddleware": () => (/* binding */ applyMiddleware), | |
| 22517 | +/* harmony export */ "bindActionCreators": () => (/* binding */ bindActionCreators), | |
| 22518 | +/* harmony export */ "combineReducers": () => (/* binding */ combineReducers), | |
| 22519 | +/* harmony export */ "compose": () => (/* binding */ compose), | |
| 22520 | +/* harmony export */ "createStore": () => (/* binding */ createStore), | |
| 22521 | +/* harmony export */ "legacy_createStore": () => (/* binding */ legacy_createStore) | |
| 22522 | +/* harmony export */ }); | |
| 22523 | +/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js"); | |
| 22524 | + | |
| 22525 | + | |
| 22526 | +/** | |
| 22527 | + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js | |
| 22528 | + * | |
| 22529 | + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes | |
| 22530 | + * during build. | |
| 22531 | + * @param {number} code | |
| 22532 | + */ | |
| 22533 | +function formatProdErrorMessage(code) { | |
| 22534 | + return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. '; | |
| 1326 | 22535 | } |
| 1327 | -module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1328 | 22536 | |
| 1329 | -/***/ }), | |
| 22537 | +// Inlined version of the `symbol-observable` polyfill | |
| 22538 | +var $$observable = (function () { | |
| 22539 | + return typeof Symbol === 'function' && Symbol.observable || '@@observable'; | |
| 22540 | +})(); | |
| 1330 | 22541 | |
| 1331 | -/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 1332 | -/*!**********************************************************!*\ | |
| 1333 | - !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 1334 | - \**********************************************************/ | |
| 1335 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 22542 | +/** | |
| 22543 | + * These are private action types reserved by Redux. | |
| 22544 | + * For any unknown actions, you must return the current state. | |
| 22545 | + * If the current state is undefined, you must return the initial state. | |
| 22546 | + * Do not reference these action types directly in your code. | |
| 22547 | + */ | |
| 22548 | +var randomString = function randomString() { | |
| 22549 | + return Math.random().toString(36).substring(7).split('').join('.'); | |
| 22550 | +}; | |
| 1336 | 22551 | |
| 1337 | -var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 1338 | -function _inherits(t, e) { | |
| 1339 | - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 1340 | - t.prototype = Object.create(e && e.prototype, { | |
| 1341 | - constructor: { | |
| 1342 | - value: t, | |
| 1343 | - writable: !0, | |
| 1344 | - configurable: !0 | |
| 1345 | - } | |
| 1346 | - }), Object.defineProperty(t, "prototype", { | |
| 1347 | - writable: !1 | |
| 1348 | - }), e && setPrototypeOf(t, e); | |
| 22552 | +var ActionTypes = { | |
| 22553 | + INIT: "@@redux/INIT" + randomString(), | |
| 22554 | + REPLACE: "@@redux/REPLACE" + randomString(), | |
| 22555 | + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { | |
| 22556 | + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); | |
| 22557 | + } | |
| 22558 | +}; | |
| 22559 | + | |
| 22560 | +/** | |
| 22561 | + * @param {any} obj The object to inspect. | |
| 22562 | + * @returns {boolean} True if the argument appears to be a plain object. | |
| 22563 | + */ | |
| 22564 | +function isPlainObject(obj) { | |
| 22565 | + if (typeof obj !== 'object' || obj === null) return false; | |
| 22566 | + var proto = obj; | |
| 22567 | + | |
| 22568 | + while (Object.getPrototypeOf(proto) !== null) { | |
| 22569 | + proto = Object.getPrototypeOf(proto); | |
| 22570 | + } | |
| 22571 | + | |
| 22572 | + return Object.getPrototypeOf(obj) === proto; | |
| 1349 | 22573 | } |
| 1350 | -module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1351 | 22574 | |
| 1352 | -/***/ }), | |
| 22575 | +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of | |
| 22576 | +function miniKindOf(val) { | |
| 22577 | + if (val === void 0) return 'undefined'; | |
| 22578 | + if (val === null) return 'null'; | |
| 22579 | + var type = typeof val; | |
| 1353 | 22580 | |
| 1354 | -/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 1355 | -/*!***********************************************************************!*\ | |
| 1356 | - !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 1357 | - \***********************************************************************/ | |
| 1358 | -/***/ ((module) => { | |
| 22581 | + switch (type) { | |
| 22582 | + case 'boolean': | |
| 22583 | + case 'string': | |
| 22584 | + case 'number': | |
| 22585 | + case 'symbol': | |
| 22586 | + case 'function': | |
| 22587 | + { | |
| 22588 | + return type; | |
| 22589 | + } | |
| 22590 | + } | |
| 1359 | 22591 | |
| 1360 | -function _interopRequireDefault(e) { | |
| 1361 | - return e && e.__esModule ? e : { | |
| 1362 | - "default": e | |
| 1363 | - }; | |
| 22592 | + if (Array.isArray(val)) return 'array'; | |
| 22593 | + if (isDate(val)) return 'date'; | |
| 22594 | + if (isError(val)) return 'error'; | |
| 22595 | + var constructorName = ctorName(val); | |
| 22596 | + | |
| 22597 | + switch (constructorName) { | |
| 22598 | + case 'Symbol': | |
| 22599 | + case 'Promise': | |
| 22600 | + case 'WeakMap': | |
| 22601 | + case 'WeakSet': | |
| 22602 | + case 'Map': | |
| 22603 | + case 'Set': | |
| 22604 | + return constructorName; | |
| 22605 | + } // other | |
| 22606 | + | |
| 22607 | + | |
| 22608 | + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); | |
| 1364 | 22609 | } |
| 1365 | -module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1366 | 22610 | |
| 1367 | -/***/ }), | |
| 22611 | +function ctorName(val) { | |
| 22612 | + return typeof val.constructor === 'function' ? val.constructor.name : null; | |
| 22613 | +} | |
| 1368 | 22614 | |
| 1369 | -/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 1370 | -/*!**********************************************************************!*\ | |
| 1371 | - !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 1372 | - \**********************************************************************/ | |
| 1373 | -/***/ ((module) => { | |
| 22615 | +function isError(val) { | |
| 22616 | + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'; | |
| 22617 | +} | |
| 1374 | 22618 | |
| 1375 | -function _iterableToArrayLimit(r, l) { | |
| 1376 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 1377 | - if (null != t) { | |
| 1378 | - var e, | |
| 1379 | - n, | |
| 1380 | - i, | |
| 1381 | - u, | |
| 1382 | - a = [], | |
| 1383 | - f = !0, | |
| 1384 | - o = !1; | |
| 22619 | +function isDate(val) { | |
| 22620 | + if (val instanceof Date) return true; | |
| 22621 | + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; | |
| 22622 | +} | |
| 22623 | + | |
| 22624 | +function kindOf(val) { | |
| 22625 | + var typeOfVal = typeof val; | |
| 22626 | + | |
| 22627 | + if (true) { | |
| 22628 | + typeOfVal = miniKindOf(val); | |
| 22629 | + } | |
| 22630 | + | |
| 22631 | + return typeOfVal; | |
| 22632 | +} | |
| 22633 | + | |
| 22634 | +/** | |
| 22635 | + * @deprecated | |
| 22636 | + * | |
| 22637 | + * **We recommend using the `configureStore` method | |
| 22638 | + * of the `@reduxjs/toolkit` package**, which replaces `createStore`. | |
| 22639 | + * | |
| 22640 | + * Redux Toolkit is our recommended approach for writing Redux logic today, | |
| 22641 | + * including store setup, reducers, data fetching, and more. | |
| 22642 | + * | |
| 22643 | + * **For more details, please read this Redux docs page:** | |
| 22644 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 22645 | + * | |
| 22646 | + * `configureStore` from Redux Toolkit is an improved version of `createStore` that | |
| 22647 | + * simplifies setup and helps avoid common bugs. | |
| 22648 | + * | |
| 22649 | + * You should not be using the `redux` core package by itself today, except for learning purposes. | |
| 22650 | + * The `createStore` method from the core `redux` package will not be removed, but we encourage | |
| 22651 | + * all users to migrate to using Redux Toolkit for all Redux code. | |
| 22652 | + * | |
| 22653 | + * If you want to use `createStore` without this visual deprecation warning, use | |
| 22654 | + * the `legacy_createStore` import instead: | |
| 22655 | + * | |
| 22656 | + * `import { legacy_createStore as createStore} from 'redux'` | |
| 22657 | + * | |
| 22658 | + */ | |
| 22659 | + | |
| 22660 | +function createStore(reducer, preloadedState, enhancer) { | |
| 22661 | + var _ref2; | |
| 22662 | + | |
| 22663 | + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { | |
| 22664 | + throw new Error( false ? 0 : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.'); | |
| 22665 | + } | |
| 22666 | + | |
| 22667 | + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { | |
| 22668 | + enhancer = preloadedState; | |
| 22669 | + preloadedState = undefined; | |
| 22670 | + } | |
| 22671 | + | |
| 22672 | + if (typeof enhancer !== 'undefined') { | |
| 22673 | + if (typeof enhancer !== 'function') { | |
| 22674 | + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'"); | |
| 22675 | + } | |
| 22676 | + | |
| 22677 | + return enhancer(createStore)(reducer, preloadedState); | |
| 22678 | + } | |
| 22679 | + | |
| 22680 | + if (typeof reducer !== 'function') { | |
| 22681 | + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'"); | |
| 22682 | + } | |
| 22683 | + | |
| 22684 | + var currentReducer = reducer; | |
| 22685 | + var currentState = preloadedState; | |
| 22686 | + var currentListeners = []; | |
| 22687 | + var nextListeners = currentListeners; | |
| 22688 | + var isDispatching = false; | |
| 22689 | + /** | |
| 22690 | + * This makes a shallow copy of currentListeners so we can use | |
| 22691 | + * nextListeners as a temporary list while dispatching. | |
| 22692 | + * | |
| 22693 | + * This prevents any bugs around consumers calling | |
| 22694 | + * subscribe/unsubscribe in the middle of a dispatch. | |
| 22695 | + */ | |
| 22696 | + | |
| 22697 | + function ensureCanMutateNextListeners() { | |
| 22698 | + if (nextListeners === currentListeners) { | |
| 22699 | + nextListeners = currentListeners.slice(); | |
| 22700 | + } | |
| 22701 | + } | |
| 22702 | + /** | |
| 22703 | + * Reads the state tree managed by the store. | |
| 22704 | + * | |
| 22705 | + * @returns {any} The current state tree of your application. | |
| 22706 | + */ | |
| 22707 | + | |
| 22708 | + | |
| 22709 | + function getState() { | |
| 22710 | + if (isDispatching) { | |
| 22711 | + throw new Error( false ? 0 : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.'); | |
| 22712 | + } | |
| 22713 | + | |
| 22714 | + return currentState; | |
| 22715 | + } | |
| 22716 | + /** | |
| 22717 | + * Adds a change listener. It will be called any time an action is dispatched, | |
| 22718 | + * and some part of the state tree may potentially have changed. You may then | |
| 22719 | + * call `getState()` to read the current state tree inside the callback. | |
| 22720 | + * | |
| 22721 | + * You may call `dispatch()` from a change listener, with the following | |
| 22722 | + * caveats: | |
| 22723 | + * | |
| 22724 | + * 1. The subscriptions are snapshotted just before every `dispatch()` call. | |
| 22725 | + * If you subscribe or unsubscribe while the listeners are being invoked, this | |
| 22726 | + * will not have any effect on the `dispatch()` that is currently in progress. | |
| 22727 | + * However, the next `dispatch()` call, whether nested or not, will use a more | |
| 22728 | + * recent snapshot of the subscription list. | |
| 22729 | + * | |
| 22730 | + * 2. The listener should not expect to see all state changes, as the state | |
| 22731 | + * might have been updated multiple times during a nested `dispatch()` before | |
| 22732 | + * the listener is called. It is, however, guaranteed that all subscribers | |
| 22733 | + * registered before the `dispatch()` started will be called with the latest | |
| 22734 | + * state by the time it exits. | |
| 22735 | + * | |
| 22736 | + * @param {Function} listener A callback to be invoked on every dispatch. | |
| 22737 | + * @returns {Function} A function to remove this change listener. | |
| 22738 | + */ | |
| 22739 | + | |
| 22740 | + | |
| 22741 | + function subscribe(listener) { | |
| 22742 | + if (typeof listener !== 'function') { | |
| 22743 | + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'"); | |
| 22744 | + } | |
| 22745 | + | |
| 22746 | + if (isDispatching) { | |
| 22747 | + throw new Error( false ? 0 : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.'); | |
| 22748 | + } | |
| 22749 | + | |
| 22750 | + var isSubscribed = true; | |
| 22751 | + ensureCanMutateNextListeners(); | |
| 22752 | + nextListeners.push(listener); | |
| 22753 | + return function unsubscribe() { | |
| 22754 | + if (!isSubscribed) { | |
| 22755 | + return; | |
| 22756 | + } | |
| 22757 | + | |
| 22758 | + if (isDispatching) { | |
| 22759 | + throw new Error( false ? 0 : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.'); | |
| 22760 | + } | |
| 22761 | + | |
| 22762 | + isSubscribed = false; | |
| 22763 | + ensureCanMutateNextListeners(); | |
| 22764 | + var index = nextListeners.indexOf(listener); | |
| 22765 | + nextListeners.splice(index, 1); | |
| 22766 | + currentListeners = null; | |
| 22767 | + }; | |
| 22768 | + } | |
| 22769 | + /** | |
| 22770 | + * Dispatches an action. It is the only way to trigger a state change. | |
| 22771 | + * | |
| 22772 | + * The `reducer` function, used to create the store, will be called with the | |
| 22773 | + * current state tree and the given `action`. Its return value will | |
| 22774 | + * be considered the **next** state of the tree, and the change listeners | |
| 22775 | + * will be notified. | |
| 22776 | + * | |
| 22777 | + * The base implementation only supports plain object actions. If you want to | |
| 22778 | + * dispatch a Promise, an Observable, a thunk, or something else, you need to | |
| 22779 | + * wrap your store creating function into the corresponding middleware. For | |
| 22780 | + * example, see the documentation for the `redux-thunk` package. Even the | |
| 22781 | + * middleware will eventually dispatch plain object actions using this method. | |
| 22782 | + * | |
| 22783 | + * @param {Object} action A plain object representing “what changed”. It is | |
| 22784 | + * a good idea to keep actions serializable so you can record and replay user | |
| 22785 | + * sessions, or use the time travelling `redux-devtools`. An action must have | |
| 22786 | + * a `type` property which may not be `undefined`. It is a good idea to use | |
| 22787 | + * string constants for action types. | |
| 22788 | + * | |
| 22789 | + * @returns {Object} For convenience, the same action object you dispatched. | |
| 22790 | + * | |
| 22791 | + * Note that, if you use a custom middleware, it may wrap `dispatch()` to | |
| 22792 | + * return something else (for example, a Promise you can await). | |
| 22793 | + */ | |
| 22794 | + | |
| 22795 | + | |
| 22796 | + function dispatch(action) { | |
| 22797 | + if (!isPlainObject(action)) { | |
| 22798 | + throw new Error( false ? 0 : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples."); | |
| 22799 | + } | |
| 22800 | + | |
| 22801 | + if (typeof action.type === 'undefined') { | |
| 22802 | + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); | |
| 22803 | + } | |
| 22804 | + | |
| 22805 | + if (isDispatching) { | |
| 22806 | + throw new Error( false ? 0 : 'Reducers may not dispatch actions.'); | |
| 22807 | + } | |
| 22808 | + | |
| 1385 | 22809 | try { |
| 1386 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 1387 | - if (Object(t) !== t) return; | |
| 1388 | - f = !1; | |
| 1389 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 1390 | - } catch (r) { | |
| 1391 | - o = !0, n = r; | |
| 22810 | + isDispatching = true; | |
| 22811 | + currentState = currentReducer(currentState, action); | |
| 1392 | 22812 | } finally { |
| 1393 | - try { | |
| 1394 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 1395 | - } finally { | |
| 1396 | - if (o) throw n; | |
| 22813 | + isDispatching = false; | |
| 22814 | + } | |
| 22815 | + | |
| 22816 | + var listeners = currentListeners = nextListeners; | |
| 22817 | + | |
| 22818 | + for (var i = 0; i < listeners.length; i++) { | |
| 22819 | + var listener = listeners[i]; | |
| 22820 | + listener(); | |
| 22821 | + } | |
| 22822 | + | |
| 22823 | + return action; | |
| 22824 | + } | |
| 22825 | + /** | |
| 22826 | + * Replaces the reducer currently used by the store to calculate the state. | |
| 22827 | + * | |
| 22828 | + * You might need this if your app implements code splitting and you want to | |
| 22829 | + * load some of the reducers dynamically. You might also need this if you | |
| 22830 | + * implement a hot reloading mechanism for Redux. | |
| 22831 | + * | |
| 22832 | + * @param {Function} nextReducer The reducer for the store to use instead. | |
| 22833 | + * @returns {void} | |
| 22834 | + */ | |
| 22835 | + | |
| 22836 | + | |
| 22837 | + function replaceReducer(nextReducer) { | |
| 22838 | + if (typeof nextReducer !== 'function') { | |
| 22839 | + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer)); | |
| 22840 | + } | |
| 22841 | + | |
| 22842 | + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. | |
| 22843 | + // Any reducers that existed in both the new and old rootReducer | |
| 22844 | + // will receive the previous state. This effectively populates | |
| 22845 | + // the new state tree with any relevant data from the old one. | |
| 22846 | + | |
| 22847 | + dispatch({ | |
| 22848 | + type: ActionTypes.REPLACE | |
| 22849 | + }); | |
| 22850 | + } | |
| 22851 | + /** | |
| 22852 | + * Interoperability point for observable/reactive libraries. | |
| 22853 | + * @returns {observable} A minimal observable of state changes. | |
| 22854 | + * For more information, see the observable proposal: | |
| 22855 | + * https://github.com/tc39/proposal-observable | |
| 22856 | + */ | |
| 22857 | + | |
| 22858 | + | |
| 22859 | + function observable() { | |
| 22860 | + var _ref; | |
| 22861 | + | |
| 22862 | + var outerSubscribe = subscribe; | |
| 22863 | + return _ref = { | |
| 22864 | + /** | |
| 22865 | + * The minimal observable subscription method. | |
| 22866 | + * @param {Object} observer Any object that can be used as an observer. | |
| 22867 | + * The observer object should have a `next` method. | |
| 22868 | + * @returns {subscription} An object with an `unsubscribe` method that can | |
| 22869 | + * be used to unsubscribe the observable from the store, and prevent further | |
| 22870 | + * emission of values from the observable. | |
| 22871 | + */ | |
| 22872 | + subscribe: function subscribe(observer) { | |
| 22873 | + if (typeof observer !== 'object' || observer === null) { | |
| 22874 | + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'"); | |
| 22875 | + } | |
| 22876 | + | |
| 22877 | + function observeState() { | |
| 22878 | + if (observer.next) { | |
| 22879 | + observer.next(getState()); | |
| 22880 | + } | |
| 22881 | + } | |
| 22882 | + | |
| 22883 | + observeState(); | |
| 22884 | + var unsubscribe = outerSubscribe(observeState); | |
| 22885 | + return { | |
| 22886 | + unsubscribe: unsubscribe | |
| 22887 | + }; | |
| 1397 | 22888 | } |
| 22889 | + }, _ref[$$observable] = function () { | |
| 22890 | + return this; | |
| 22891 | + }, _ref; | |
| 22892 | + } // When a store is created, an "INIT" action is dispatched so that every | |
| 22893 | + // reducer returns their initial state. This effectively populates | |
| 22894 | + // the initial state tree. | |
| 22895 | + | |
| 22896 | + | |
| 22897 | + dispatch({ | |
| 22898 | + type: ActionTypes.INIT | |
| 22899 | + }); | |
| 22900 | + return _ref2 = { | |
| 22901 | + dispatch: dispatch, | |
| 22902 | + subscribe: subscribe, | |
| 22903 | + getState: getState, | |
| 22904 | + replaceReducer: replaceReducer | |
| 22905 | + }, _ref2[$$observable] = observable, _ref2; | |
| 22906 | +} | |
| 22907 | +/** | |
| 22908 | + * Creates a Redux store that holds the state tree. | |
| 22909 | + * | |
| 22910 | + * **We recommend using `configureStore` from the | |
| 22911 | + * `@reduxjs/toolkit` package**, which replaces `createStore`: | |
| 22912 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 22913 | + * | |
| 22914 | + * The only way to change the data in the store is to call `dispatch()` on it. | |
| 22915 | + * | |
| 22916 | + * There should only be a single store in your app. To specify how different | |
| 22917 | + * parts of the state tree respond to actions, you may combine several reducers | |
| 22918 | + * into a single reducer function by using `combineReducers`. | |
| 22919 | + * | |
| 22920 | + * @param {Function} reducer A function that returns the next state tree, given | |
| 22921 | + * the current state tree and the action to handle. | |
| 22922 | + * | |
| 22923 | + * @param {any} [preloadedState] The initial state. You may optionally specify it | |
| 22924 | + * to hydrate the state from the server in universal apps, or to restore a | |
| 22925 | + * previously serialized user session. | |
| 22926 | + * If you use `combineReducers` to produce the root reducer function, this must be | |
| 22927 | + * an object with the same shape as `combineReducers` keys. | |
| 22928 | + * | |
| 22929 | + * @param {Function} [enhancer] The store enhancer. You may optionally specify it | |
| 22930 | + * to enhance the store with third-party capabilities such as middleware, | |
| 22931 | + * time travel, persistence, etc. The only store enhancer that ships with Redux | |
| 22932 | + * is `applyMiddleware()`. | |
| 22933 | + * | |
| 22934 | + * @returns {Store} A Redux store that lets you read the state, dispatch actions | |
| 22935 | + * and subscribe to changes. | |
| 22936 | + */ | |
| 22937 | + | |
| 22938 | +var legacy_createStore = createStore; | |
| 22939 | + | |
| 22940 | +/** | |
| 22941 | + * Prints a warning in the console if it exists. | |
| 22942 | + * | |
| 22943 | + * @param {String} message The warning message. | |
| 22944 | + * @returns {void} | |
| 22945 | + */ | |
| 22946 | +function warning(message) { | |
| 22947 | + /* eslint-disable no-console */ | |
| 22948 | + if (typeof console !== 'undefined' && typeof console.error === 'function') { | |
| 22949 | + console.error(message); | |
| 22950 | + } | |
| 22951 | + /* eslint-enable no-console */ | |
| 22952 | + | |
| 22953 | + | |
| 22954 | + try { | |
| 22955 | + // This error was thrown as a convenience so that if you enable | |
| 22956 | + // "break on all exceptions" in your console, | |
| 22957 | + // it would pause the execution at this line. | |
| 22958 | + throw new Error(message); | |
| 22959 | + } catch (e) {} // eslint-disable-line no-empty | |
| 22960 | + | |
| 22961 | +} | |
| 22962 | + | |
| 22963 | +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { | |
| 22964 | + var reducerKeys = Object.keys(reducers); | |
| 22965 | + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; | |
| 22966 | + | |
| 22967 | + if (reducerKeys.length === 0) { | |
| 22968 | + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; | |
| 22969 | + } | |
| 22970 | + | |
| 22971 | + if (!isPlainObject(inputState)) { | |
| 22972 | + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); | |
| 22973 | + } | |
| 22974 | + | |
| 22975 | + var unexpectedKeys = Object.keys(inputState).filter(function (key) { | |
| 22976 | + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; | |
| 22977 | + }); | |
| 22978 | + unexpectedKeys.forEach(function (key) { | |
| 22979 | + unexpectedKeyCache[key] = true; | |
| 22980 | + }); | |
| 22981 | + if (action && action.type === ActionTypes.REPLACE) return; | |
| 22982 | + | |
| 22983 | + if (unexpectedKeys.length > 0) { | |
| 22984 | + return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); | |
| 22985 | + } | |
| 22986 | +} | |
| 22987 | + | |
| 22988 | +function assertReducerShape(reducers) { | |
| 22989 | + Object.keys(reducers).forEach(function (key) { | |
| 22990 | + var reducer = reducers[key]; | |
| 22991 | + var initialState = reducer(undefined, { | |
| 22992 | + type: ActionTypes.INIT | |
| 22993 | + }); | |
| 22994 | + | |
| 22995 | + if (typeof initialState === 'undefined') { | |
| 22996 | + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined."); | |
| 1398 | 22997 | } |
| 1399 | - return a; | |
| 22998 | + | |
| 22999 | + if (typeof reducer(undefined, { | |
| 23000 | + type: ActionTypes.PROBE_UNKNOWN_ACTION() | |
| 23001 | + }) === 'undefined') { | |
| 23002 | + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null."); | |
| 23003 | + } | |
| 23004 | + }); | |
| 23005 | +} | |
| 23006 | +/** | |
| 23007 | + * Turns an object whose values are different reducer functions, into a single | |
| 23008 | + * reducer function. It will call every child reducer, and gather their results | |
| 23009 | + * into a single state object, whose keys correspond to the keys of the passed | |
| 23010 | + * reducer functions. | |
| 23011 | + * | |
| 23012 | + * @param {Object} reducers An object whose values correspond to different | |
| 23013 | + * reducer functions that need to be combined into one. One handy way to obtain | |
| 23014 | + * it is to use ES6 `import * as reducers` syntax. The reducers may never return | |
| 23015 | + * undefined for any action. Instead, they should return their initial state | |
| 23016 | + * if the state passed to them was undefined, and the current state for any | |
| 23017 | + * unrecognized action. | |
| 23018 | + * | |
| 23019 | + * @returns {Function} A reducer function that invokes every reducer inside the | |
| 23020 | + * passed object, and builds a state object with the same shape. | |
| 23021 | + */ | |
| 23022 | + | |
| 23023 | + | |
| 23024 | +function combineReducers(reducers) { | |
| 23025 | + var reducerKeys = Object.keys(reducers); | |
| 23026 | + var finalReducers = {}; | |
| 23027 | + | |
| 23028 | + for (var i = 0; i < reducerKeys.length; i++) { | |
| 23029 | + var key = reducerKeys[i]; | |
| 23030 | + | |
| 23031 | + if (true) { | |
| 23032 | + if (typeof reducers[key] === 'undefined') { | |
| 23033 | + warning("No reducer provided for key \"" + key + "\""); | |
| 23034 | + } | |
| 23035 | + } | |
| 23036 | + | |
| 23037 | + if (typeof reducers[key] === 'function') { | |
| 23038 | + finalReducers[key] = reducers[key]; | |
| 23039 | + } | |
| 1400 | 23040 | } |
| 23041 | + | |
| 23042 | + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same | |
| 23043 | + // keys multiple times. | |
| 23044 | + | |
| 23045 | + var unexpectedKeyCache; | |
| 23046 | + | |
| 23047 | + if (true) { | |
| 23048 | + unexpectedKeyCache = {}; | |
| 23049 | + } | |
| 23050 | + | |
| 23051 | + var shapeAssertionError; | |
| 23052 | + | |
| 23053 | + try { | |
| 23054 | + assertReducerShape(finalReducers); | |
| 23055 | + } catch (e) { | |
| 23056 | + shapeAssertionError = e; | |
| 23057 | + } | |
| 23058 | + | |
| 23059 | + return function combination(state, action) { | |
| 23060 | + if (state === void 0) { | |
| 23061 | + state = {}; | |
| 23062 | + } | |
| 23063 | + | |
| 23064 | + if (shapeAssertionError) { | |
| 23065 | + throw shapeAssertionError; | |
| 23066 | + } | |
| 23067 | + | |
| 23068 | + if (true) { | |
| 23069 | + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); | |
| 23070 | + | |
| 23071 | + if (warningMessage) { | |
| 23072 | + warning(warningMessage); | |
| 23073 | + } | |
| 23074 | + } | |
| 23075 | + | |
| 23076 | + var hasChanged = false; | |
| 23077 | + var nextState = {}; | |
| 23078 | + | |
| 23079 | + for (var _i = 0; _i < finalReducerKeys.length; _i++) { | |
| 23080 | + var _key = finalReducerKeys[_i]; | |
| 23081 | + var reducer = finalReducers[_key]; | |
| 23082 | + var previousStateForKey = state[_key]; | |
| 23083 | + var nextStateForKey = reducer(previousStateForKey, action); | |
| 23084 | + | |
| 23085 | + if (typeof nextStateForKey === 'undefined') { | |
| 23086 | + var actionType = action && action.type; | |
| 23087 | + throw new Error( false ? 0 : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined."); | |
| 23088 | + } | |
| 23089 | + | |
| 23090 | + nextState[_key] = nextStateForKey; | |
| 23091 | + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; | |
| 23092 | + } | |
| 23093 | + | |
| 23094 | + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; | |
| 23095 | + return hasChanged ? nextState : state; | |
| 23096 | + }; | |
| 1401 | 23097 | } |
| 1402 | -module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1403 | 23098 | |
| 1404 | -/***/ }), | |
| 23099 | +function bindActionCreator(actionCreator, dispatch) { | |
| 23100 | + return function () { | |
| 23101 | + return dispatch(actionCreator.apply(this, arguments)); | |
| 23102 | + }; | |
| 23103 | +} | |
| 23104 | +/** | |
| 23105 | + * Turns an object whose values are action creators, into an object with the | |
| 23106 | + * same keys, but with every function wrapped into a `dispatch` call so they | |
| 23107 | + * may be invoked directly. This is just a convenience method, as you can call | |
| 23108 | + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. | |
| 23109 | + * | |
| 23110 | + * For convenience, you can also pass an action creator as the first argument, | |
| 23111 | + * and get a dispatch wrapped function in return. | |
| 23112 | + * | |
| 23113 | + * @param {Function|Object} actionCreators An object whose values are action | |
| 23114 | + * creator functions. One handy way to obtain it is to use ES6 `import * as` | |
| 23115 | + * syntax. You may also pass a single function. | |
| 23116 | + * | |
| 23117 | + * @param {Function} dispatch The `dispatch` function available on your Redux | |
| 23118 | + * store. | |
| 23119 | + * | |
| 23120 | + * @returns {Function|Object} The object mimicking the original object, but with | |
| 23121 | + * every action creator wrapped into the `dispatch` call. If you passed a | |
| 23122 | + * function as `actionCreators`, the return value will also be a single | |
| 23123 | + * function. | |
| 23124 | + */ | |
| 1405 | 23125 | |
| 1406 | -/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 1407 | -/*!*****************************************************************!*\ | |
| 1408 | - !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 1409 | - \*****************************************************************/ | |
| 1410 | -/***/ ((module) => { | |
| 1411 | 23126 | |
| 1412 | -function _nonIterableRest() { | |
| 1413 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 23127 | +function bindActionCreators(actionCreators, dispatch) { | |
| 23128 | + if (typeof actionCreators === 'function') { | |
| 23129 | + return bindActionCreator(actionCreators, dispatch); | |
| 23130 | + } | |
| 23131 | + | |
| 23132 | + if (typeof actionCreators !== 'object' || actionCreators === null) { | |
| 23133 | + throw new Error( false ? 0 : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?"); | |
| 23134 | + } | |
| 23135 | + | |
| 23136 | + var boundActionCreators = {}; | |
| 23137 | + | |
| 23138 | + for (var key in actionCreators) { | |
| 23139 | + var actionCreator = actionCreators[key]; | |
| 23140 | + | |
| 23141 | + if (typeof actionCreator === 'function') { | |
| 23142 | + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); | |
| 23143 | + } | |
| 23144 | + } | |
| 23145 | + | |
| 23146 | + return boundActionCreators; | |
| 1414 | 23147 | } |
| 1415 | -module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1416 | 23148 | |
| 23149 | +/** | |
| 23150 | + * Composes single-argument functions from right to left. The rightmost | |
| 23151 | + * function can take multiple arguments as it provides the signature for | |
| 23152 | + * the resulting composite function. | |
| 23153 | + * | |
| 23154 | + * @param {...Function} funcs The functions to compose. | |
| 23155 | + * @returns {Function} A function obtained by composing the argument functions | |
| 23156 | + * from right to left. For example, compose(f, g, h) is identical to doing | |
| 23157 | + * (...args) => f(g(h(...args))). | |
| 23158 | + */ | |
| 23159 | +function compose() { | |
| 23160 | + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 23161 | + funcs[_key] = arguments[_key]; | |
| 23162 | + } | |
| 23163 | + | |
| 23164 | + if (funcs.length === 0) { | |
| 23165 | + return function (arg) { | |
| 23166 | + return arg; | |
| 23167 | + }; | |
| 23168 | + } | |
| 23169 | + | |
| 23170 | + if (funcs.length === 1) { | |
| 23171 | + return funcs[0]; | |
| 23172 | + } | |
| 23173 | + | |
| 23174 | + return funcs.reduce(function (a, b) { | |
| 23175 | + return function () { | |
| 23176 | + return a(b.apply(void 0, arguments)); | |
| 23177 | + }; | |
| 23178 | + }); | |
| 23179 | +} | |
| 23180 | + | |
| 23181 | +/** | |
| 23182 | + * Creates a store enhancer that applies middleware to the dispatch method | |
| 23183 | + * of the Redux store. This is handy for a variety of tasks, such as expressing | |
| 23184 | + * asynchronous actions in a concise manner, or logging every action payload. | |
| 23185 | + * | |
| 23186 | + * See `redux-thunk` package as an example of the Redux middleware. | |
| 23187 | + * | |
| 23188 | + * Because middleware is potentially asynchronous, this should be the first | |
| 23189 | + * store enhancer in the composition chain. | |
| 23190 | + * | |
| 23191 | + * Note that each middleware will be given the `dispatch` and `getState` functions | |
| 23192 | + * as named arguments. | |
| 23193 | + * | |
| 23194 | + * @param {...Function} middlewares The middleware chain to be applied. | |
| 23195 | + * @returns {Function} A store enhancer applying the middleware. | |
| 23196 | + */ | |
| 23197 | + | |
| 23198 | +function applyMiddleware() { | |
| 23199 | + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 23200 | + middlewares[_key] = arguments[_key]; | |
| 23201 | + } | |
| 23202 | + | |
| 23203 | + return function (createStore) { | |
| 23204 | + return function () { | |
| 23205 | + var store = createStore.apply(void 0, arguments); | |
| 23206 | + | |
| 23207 | + var _dispatch = function dispatch() { | |
| 23208 | + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.'); | |
| 23209 | + }; | |
| 23210 | + | |
| 23211 | + var middlewareAPI = { | |
| 23212 | + getState: store.getState, | |
| 23213 | + dispatch: function dispatch() { | |
| 23214 | + return _dispatch.apply(void 0, arguments); | |
| 23215 | + } | |
| 23216 | + }; | |
| 23217 | + var chain = middlewares.map(function (middleware) { | |
| 23218 | + return middleware(middlewareAPI); | |
| 23219 | + }); | |
| 23220 | + _dispatch = compose.apply(void 0, chain)(store.dispatch); | |
| 23221 | + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, { | |
| 23222 | + dispatch: _dispatch | |
| 23223 | + }); | |
| 23224 | + }; | |
| 23225 | + }; | |
| 23226 | +} | |
| 23227 | + | |
| 23228 | +/* | |
| 23229 | + * This is a dummy function to check if the function name has been altered by minification. | |
| 23230 | + * If the function has been minified and NODE_ENV !== 'production', warn the user. | |
| 23231 | + */ | |
| 23232 | + | |
| 23233 | +function isCrushed() {} | |
| 23234 | + | |
| 23235 | +if ( true && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { | |
| 23236 | + warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.'); | |
| 23237 | +} | |
| 23238 | + | |
| 23239 | + | |
| 23240 | + | |
| 23241 | + | |
| 1417 | 23242 | /***/ }), |
| 1418 | 23243 | |
| 1419 | -/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": | |
| 1420 | -/*!***************************************************************************!*\ | |
| 1421 | - !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! | |
| 1422 | - \***************************************************************************/ | |
| 1423 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 23244 | +/***/ "../node_modules/reselect/es/defaultMemoize.js": | |
| 23245 | +/*!*****************************************************!*\ | |
| 23246 | + !*** ../node_modules/reselect/es/defaultMemoize.js ***! | |
| 23247 | + \*****************************************************/ | |
| 23248 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 1424 | 23249 | |
| 1425 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1426 | -var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); | |
| 1427 | -function _possibleConstructorReturn(t, e) { | |
| 1428 | - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; | |
| 1429 | - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 1430 | - return assertThisInitialized(t); | |
| 23250 | +"use strict"; | |
| 23251 | +__webpack_require__.r(__webpack_exports__); | |
| 23252 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 23253 | +/* harmony export */ "createCacheKeyComparator": () => (/* binding */ createCacheKeyComparator), | |
| 23254 | +/* harmony export */ "defaultEqualityCheck": () => (/* binding */ defaultEqualityCheck), | |
| 23255 | +/* harmony export */ "defaultMemoize": () => (/* binding */ defaultMemoize) | |
| 23256 | +/* harmony export */ }); | |
| 23257 | +// Cache implementation based on Erik Rasmussen's `lru-memoize`: | |
| 23258 | +// https://github.com/erikras/lru-memoize | |
| 23259 | +var NOT_FOUND = 'NOT_FOUND'; | |
| 23260 | + | |
| 23261 | +function createSingletonCache(equals) { | |
| 23262 | + var entry; | |
| 23263 | + return { | |
| 23264 | + get: function get(key) { | |
| 23265 | + if (entry && equals(entry.key, key)) { | |
| 23266 | + return entry.value; | |
| 23267 | + } | |
| 23268 | + | |
| 23269 | + return NOT_FOUND; | |
| 23270 | + }, | |
| 23271 | + put: function put(key, value) { | |
| 23272 | + entry = { | |
| 23273 | + key: key, | |
| 23274 | + value: value | |
| 23275 | + }; | |
| 23276 | + }, | |
| 23277 | + getEntries: function getEntries() { | |
| 23278 | + return entry ? [entry] : []; | |
| 23279 | + }, | |
| 23280 | + clear: function clear() { | |
| 23281 | + entry = undefined; | |
| 23282 | + } | |
| 23283 | + }; | |
| 1431 | 23284 | } |
| 1432 | -module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1433 | 23285 | |
| 1434 | -/***/ }), | |
| 23286 | +function createLruCache(maxSize, equals) { | |
| 23287 | + var entries = []; | |
| 1435 | 23288 | |
| 1436 | -/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 1437 | -/*!****************************************************************!*\ | |
| 1438 | - !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 1439 | - \****************************************************************/ | |
| 1440 | -/***/ ((module) => { | |
| 23289 | + function get(key) { | |
| 23290 | + var cacheIndex = entries.findIndex(function (entry) { | |
| 23291 | + return equals(key, entry.key); | |
| 23292 | + }); // We found a cached entry | |
| 1441 | 23293 | |
| 1442 | -function _setPrototypeOf(t, e) { | |
| 1443 | - return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { | |
| 1444 | - return t.__proto__ = e, t; | |
| 1445 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); | |
| 23294 | + if (cacheIndex > -1) { | |
| 23295 | + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top | |
| 23296 | + | |
| 23297 | + if (cacheIndex > 0) { | |
| 23298 | + entries.splice(cacheIndex, 1); | |
| 23299 | + entries.unshift(entry); | |
| 23300 | + } | |
| 23301 | + | |
| 23302 | + return entry.value; | |
| 23303 | + } // No entry found in cache, return sentinel | |
| 23304 | + | |
| 23305 | + | |
| 23306 | + return NOT_FOUND; | |
| 23307 | + } | |
| 23308 | + | |
| 23309 | + function put(key, value) { | |
| 23310 | + if (get(key) === NOT_FOUND) { | |
| 23311 | + // TODO Is unshift slow? | |
| 23312 | + entries.unshift({ | |
| 23313 | + key: key, | |
| 23314 | + value: value | |
| 23315 | + }); | |
| 23316 | + | |
| 23317 | + if (entries.length > maxSize) { | |
| 23318 | + entries.pop(); | |
| 23319 | + } | |
| 23320 | + } | |
| 23321 | + } | |
| 23322 | + | |
| 23323 | + function getEntries() { | |
| 23324 | + return entries; | |
| 23325 | + } | |
| 23326 | + | |
| 23327 | + function clear() { | |
| 23328 | + entries = []; | |
| 23329 | + } | |
| 23330 | + | |
| 23331 | + return { | |
| 23332 | + get: get, | |
| 23333 | + put: put, | |
| 23334 | + getEntries: getEntries, | |
| 23335 | + clear: clear | |
| 23336 | + }; | |
| 1446 | 23337 | } |
| 1447 | -module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1448 | 23338 | |
| 1449 | -/***/ }), | |
| 23339 | +var defaultEqualityCheck = function defaultEqualityCheck(a, b) { | |
| 23340 | + return a === b; | |
| 23341 | +}; | |
| 23342 | +function createCacheKeyComparator(equalityCheck) { | |
| 23343 | + return function areArgumentsShallowlyEqual(prev, next) { | |
| 23344 | + if (prev === null || next === null || prev.length !== next.length) { | |
| 23345 | + return false; | |
| 23346 | + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible. | |
| 1450 | 23347 | |
| 1451 | -/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 1452 | -/*!***************************************************************!*\ | |
| 1453 | - !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 1454 | - \***************************************************************/ | |
| 1455 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1456 | 23348 | |
| 1457 | -var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 1458 | -var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 1459 | -var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 1460 | -var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 1461 | -function _slicedToArray(r, e) { | |
| 1462 | - return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); | |
| 23349 | + var length = prev.length; | |
| 23350 | + | |
| 23351 | + for (var i = 0; i < length; i++) { | |
| 23352 | + if (!equalityCheck(prev[i], next[i])) { | |
| 23353 | + return false; | |
| 23354 | + } | |
| 23355 | + } | |
| 23356 | + | |
| 23357 | + return true; | |
| 23358 | + }; | |
| 1463 | 23359 | } |
| 1464 | -module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 23360 | +// defaultMemoize now supports a configurable cache size with LRU behavior, | |
| 23361 | +// and optional comparison of the result value with existing values | |
| 23362 | +function defaultMemoize(func, equalityCheckOrOptions) { | |
| 23363 | + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : { | |
| 23364 | + equalityCheck: equalityCheckOrOptions | |
| 23365 | + }; | |
| 23366 | + var _providedOptions$equa = providedOptions.equalityCheck, | |
| 23367 | + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa, | |
| 23368 | + _providedOptions$maxS = providedOptions.maxSize, | |
| 23369 | + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS, | |
| 23370 | + resultEqualityCheck = providedOptions.resultEqualityCheck; | |
| 23371 | + var comparator = createCacheKeyComparator(equalityCheck); | |
| 23372 | + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons | |
| 1465 | 23373 | |
| 1466 | -/***/ }), | |
| 23374 | + function memoized() { | |
| 23375 | + var value = cache.get(arguments); | |
| 1467 | 23376 | |
| 1468 | -/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": | |
| 1469 | -/*!***************************************************************!*\ | |
| 1470 | - !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! | |
| 1471 | - \***************************************************************/ | |
| 1472 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 23377 | + if (value === NOT_FOUND) { | |
| 23378 | + // @ts-ignore | |
| 23379 | + value = func.apply(null, arguments); | |
| 1473 | 23380 | |
| 1474 | -var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 1475 | -function _superPropBase(t, o) { | |
| 1476 | - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); | |
| 1477 | - return t; | |
| 23381 | + if (resultEqualityCheck) { | |
| 23382 | + var entries = cache.getEntries(); | |
| 23383 | + var matchingEntry = entries.find(function (entry) { | |
| 23384 | + return resultEqualityCheck(entry.value, value); | |
| 23385 | + }); | |
| 23386 | + | |
| 23387 | + if (matchingEntry) { | |
| 23388 | + value = matchingEntry.value; | |
| 23389 | + } | |
| 23390 | + } | |
| 23391 | + | |
| 23392 | + cache.put(arguments, value); | |
| 23393 | + } | |
| 23394 | + | |
| 23395 | + return value; | |
| 23396 | + } | |
| 23397 | + | |
| 23398 | + memoized.clearCache = function () { | |
| 23399 | + return cache.clear(); | |
| 23400 | + }; | |
| 23401 | + | |
| 23402 | + return memoized; | |
| 1478 | 23403 | } |
| 1479 | -module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1480 | 23404 | |
| 1481 | 23405 | /***/ }), |
| 1482 | 23406 | |
| 1483 | -/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 1484 | -/*!*************************************************************!*\ | |
| 1485 | - !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 1486 | - \*************************************************************/ | |
| 1487 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 23407 | +/***/ "../node_modules/reselect/es/index.js": | |
| 23408 | +/*!********************************************!*\ | |
| 23409 | + !*** ../node_modules/reselect/es/index.js ***! | |
| 23410 | + \********************************************/ | |
| 23411 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 1488 | 23412 | |
| 1489 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1490 | -function toPrimitive(t, r) { | |
| 1491 | - if ("object" != _typeof(t) || !t) return t; | |
| 1492 | - var e = t[Symbol.toPrimitive]; | |
| 1493 | - if (void 0 !== e) { | |
| 1494 | - var i = e.call(t, r || "default"); | |
| 1495 | - if ("object" != _typeof(i)) return i; | |
| 1496 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 23413 | +"use strict"; | |
| 23414 | +__webpack_require__.r(__webpack_exports__); | |
| 23415 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 23416 | +/* harmony export */ "createSelector": () => (/* binding */ createSelector), | |
| 23417 | +/* harmony export */ "createSelectorCreator": () => (/* binding */ createSelectorCreator), | |
| 23418 | +/* harmony export */ "createStructuredSelector": () => (/* binding */ createStructuredSelector), | |
| 23419 | +/* harmony export */ "defaultEqualityCheck": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck), | |
| 23420 | +/* harmony export */ "defaultMemoize": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize) | |
| 23421 | +/* harmony export */ }); | |
| 23422 | +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js"); | |
| 23423 | + | |
| 23424 | + | |
| 23425 | + | |
| 23426 | +function getDependencies(funcs) { | |
| 23427 | + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; | |
| 23428 | + | |
| 23429 | + if (!dependencies.every(function (dep) { | |
| 23430 | + return typeof dep === 'function'; | |
| 23431 | + })) { | |
| 23432 | + var dependencyTypes = dependencies.map(function (dep) { | |
| 23433 | + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep; | |
| 23434 | + }).join(', '); | |
| 23435 | + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]"); | |
| 1497 | 23436 | } |
| 1498 | - return ("string" === r ? String : Number)(t); | |
| 23437 | + | |
| 23438 | + return dependencies; | |
| 1499 | 23439 | } |
| 1500 | -module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1501 | 23440 | |
| 1502 | -/***/ }), | |
| 23441 | +function createSelectorCreator(memoize) { | |
| 23442 | + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | |
| 23443 | + memoizeOptionsFromArgs[_key - 1] = arguments[_key]; | |
| 23444 | + } | |
| 1503 | 23445 | |
| 1504 | -/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 1505 | -/*!***************************************************************!*\ | |
| 1506 | - !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 1507 | - \***************************************************************/ | |
| 1508 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 23446 | + var createSelector = function createSelector() { | |
| 23447 | + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | |
| 23448 | + funcs[_key2] = arguments[_key2]; | |
| 23449 | + } | |
| 1509 | 23450 | |
| 1510 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1511 | -var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 1512 | -function toPropertyKey(t) { | |
| 1513 | - var i = toPrimitive(t, "string"); | |
| 1514 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 23451 | + var _recomputations = 0; | |
| 23452 | + | |
| 23453 | + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`. | |
| 23454 | + // So, start by declaring the default value here. | |
| 23455 | + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.) | |
| 23456 | + | |
| 23457 | + | |
| 23458 | + var directlyPassedOptions = { | |
| 23459 | + memoizeOptions: undefined | |
| 23460 | + }; // Normally, the result func or "output selector" is the last arg | |
| 23461 | + | |
| 23462 | + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object | |
| 23463 | + | |
| 23464 | + if (typeof resultFunc === 'object') { | |
| 23465 | + directlyPassedOptions = resultFunc; // and pop the real result func off | |
| 23466 | + | |
| 23467 | + resultFunc = funcs.pop(); | |
| 23468 | + } | |
| 23469 | + | |
| 23470 | + if (typeof resultFunc !== 'function') { | |
| 23471 | + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]"); | |
| 23472 | + } // Determine which set of options we're using. Prefer options passed directly, | |
| 23473 | + // but fall back to options given to createSelectorCreator. | |
| 23474 | + | |
| 23475 | + | |
| 23476 | + var _directlyPassedOption = directlyPassedOptions, | |
| 23477 | + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, | |
| 23478 | + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer | |
| 23479 | + // is an array. In most libs I've looked at, it's an equality function or options object. | |
| 23480 | + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full | |
| 23481 | + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so | |
| 23482 | + // we wrap it in an array so we can apply it. | |
| 23483 | + | |
| 23484 | + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions]; | |
| 23485 | + var dependencies = getDependencies(funcs); | |
| 23486 | + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() { | |
| 23487 | + _recomputations++; // apply arguments instead of spreading for performance. | |
| 23488 | + | |
| 23489 | + return resultFunc.apply(null, arguments); | |
| 23490 | + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again. | |
| 23491 | + | |
| 23492 | + var selector = memoize(function dependenciesChecker() { | |
| 23493 | + var params = []; | |
| 23494 | + var length = dependencies.length; | |
| 23495 | + | |
| 23496 | + for (var i = 0; i < length; i++) { | |
| 23497 | + // apply arguments instead of spreading and mutate a local list of params for performance. | |
| 23498 | + // @ts-ignore | |
| 23499 | + params.push(dependencies[i].apply(null, arguments)); | |
| 23500 | + } // apply arguments instead of spreading for performance. | |
| 23501 | + | |
| 23502 | + | |
| 23503 | + _lastResult = memoizedResultFunc.apply(null, params); | |
| 23504 | + return _lastResult; | |
| 23505 | + }); | |
| 23506 | + Object.assign(selector, { | |
| 23507 | + resultFunc: resultFunc, | |
| 23508 | + memoizedResultFunc: memoizedResultFunc, | |
| 23509 | + dependencies: dependencies, | |
| 23510 | + lastResult: function lastResult() { | |
| 23511 | + return _lastResult; | |
| 23512 | + }, | |
| 23513 | + recomputations: function recomputations() { | |
| 23514 | + return _recomputations; | |
| 23515 | + }, | |
| 23516 | + resetRecomputations: function resetRecomputations() { | |
| 23517 | + return _recomputations = 0; | |
| 23518 | + } | |
| 23519 | + }); | |
| 23520 | + return selector; | |
| 23521 | + }; // @ts-ignore | |
| 23522 | + | |
| 23523 | + | |
| 23524 | + return createSelector; | |
| 1515 | 23525 | } |
| 1516 | -module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 23526 | +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize); | |
| 23527 | +// Manual definition of state and output arguments | |
| 23528 | +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) { | |
| 23529 | + if (selectorCreator === void 0) { | |
| 23530 | + selectorCreator = createSelector; | |
| 23531 | + } | |
| 1517 | 23532 | |
| 23533 | + if (typeof selectors !== 'object') { | |
| 23534 | + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors)); | |
| 23535 | + } | |
| 23536 | + | |
| 23537 | + var objectKeys = Object.keys(selectors); | |
| 23538 | + var resultSelector = selectorCreator( // @ts-ignore | |
| 23539 | + objectKeys.map(function (key) { | |
| 23540 | + return selectors[key]; | |
| 23541 | + }), function () { | |
| 23542 | + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | |
| 23543 | + values[_key3] = arguments[_key3]; | |
| 23544 | + } | |
| 23545 | + | |
| 23546 | + return values.reduce(function (composition, value, index) { | |
| 23547 | + composition[objectKeys[index]] = value; | |
| 23548 | + return composition; | |
| 23549 | + }, {}); | |
| 23550 | + }); | |
| 23551 | + return resultSelector; | |
| 23552 | +}; | |
| 23553 | + | |
| 1518 | 23554 | /***/ }), |
| 1519 | 23555 | |
| 1520 | -/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 1521 | -/*!********************************************************!*\ | |
| 1522 | - !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 1523 | - \********************************************************/ | |
| 23556 | +/***/ "@wordpress/i18n": | |
| 23557 | +/*!**************************!*\ | |
| 23558 | + !*** external "wp.i18n" ***! | |
| 23559 | + \**************************/ | |
| 1524 | 23560 | /***/ ((module) => { |
| 1525 | 23561 | |
| 1526 | -function _typeof(o) { | |
| 1527 | - "@babel/helpers - typeof"; | |
| 23562 | +"use strict"; | |
| 23563 | +module.exports = wp.i18n; | |
| 1528 | 23564 | |
| 1529 | - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 1530 | - return typeof o; | |
| 1531 | - } : function (o) { | |
| 1532 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 1533 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 23565 | +/***/ }), | |
| 23566 | + | |
| 23567 | +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js": | |
| 23568 | +/*!********************************************************************!*\ | |
| 23569 | + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! | |
| 23570 | + \********************************************************************/ | |
| 23571 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 23572 | + | |
| 23573 | +"use strict"; | |
| 23574 | +__webpack_require__.r(__webpack_exports__); | |
| 23575 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 23576 | +/* harmony export */ "default": () => (/* binding */ _defineProperty) | |
| 23577 | +/* harmony export */ }); | |
| 23578 | +function _defineProperty(obj, key, value) { | |
| 23579 | + if (key in obj) { | |
| 23580 | + Object.defineProperty(obj, key, { | |
| 23581 | + value: value, | |
| 23582 | + enumerable: true, | |
| 23583 | + configurable: true, | |
| 23584 | + writable: true | |
| 23585 | + }); | |
| 23586 | + } else { | |
| 23587 | + obj[key] = value; | |
| 23588 | + } | |
| 23589 | + | |
| 23590 | + return obj; | |
| 1534 | 23591 | } |
| 1535 | -module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1536 | 23592 | |
| 1537 | 23593 | /***/ }), |
| 1538 | 23594 | |
| 1539 | -/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 1540 | -/*!****************************************************************************!*\ | |
| 1541 | - !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 1542 | - \****************************************************************************/ | |
| 1543 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 23595 | +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js": | |
| 23596 | +/*!*******************************************************************!*\ | |
| 23597 | + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***! | |
| 23598 | + \*******************************************************************/ | |
| 23599 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 1544 | 23600 | |
| 1545 | -var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 1546 | -function _unsupportedIterableToArray(r, a) { | |
| 1547 | - if (r) { | |
| 1548 | - if ("string" == typeof r) return arrayLikeToArray(r, a); | |
| 1549 | - var t = {}.toString.call(r).slice(8, -1); | |
| 1550 | - 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; | |
| 23601 | +"use strict"; | |
| 23602 | +__webpack_require__.r(__webpack_exports__); | |
| 23603 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 23604 | +/* harmony export */ "default": () => (/* binding */ _objectSpread2) | |
| 23605 | +/* harmony export */ }); | |
| 23606 | +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js"); | |
| 23607 | + | |
| 23608 | + | |
| 23609 | +function ownKeys(object, enumerableOnly) { | |
| 23610 | + var keys = Object.keys(object); | |
| 23611 | + | |
| 23612 | + if (Object.getOwnPropertySymbols) { | |
| 23613 | + var symbols = Object.getOwnPropertySymbols(object); | |
| 23614 | + enumerableOnly && (symbols = symbols.filter(function (sym) { | |
| 23615 | + return Object.getOwnPropertyDescriptor(object, sym).enumerable; | |
| 23616 | + })), keys.push.apply(keys, symbols); | |
| 1551 | 23617 | } |
| 23618 | + | |
| 23619 | + return keys; | |
| 1552 | 23620 | } |
| 1553 | -module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1554 | 23621 | |
| 23622 | +function _objectSpread2(target) { | |
| 23623 | + for (var i = 1; i < arguments.length; i++) { | |
| 23624 | + var source = null != arguments[i] ? arguments[i] : {}; | |
| 23625 | + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { | |
| 23626 | + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); | |
| 23627 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { | |
| 23628 | + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | |
| 23629 | + }); | |
| 23630 | + } | |
| 23631 | + | |
| 23632 | + return target; | |
| 23633 | +} | |
| 23634 | + | |
| 23635 | +/***/ }), | |
| 23636 | + | |
| 23637 | +/***/ "../node_modules/immer/dist/immer.esm.mjs": | |
| 23638 | +/*!************************************************!*\ | |
| 23639 | + !*** ../node_modules/immer/dist/immer.esm.mjs ***! | |
| 23640 | + \************************************************/ | |
| 23641 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 23642 | + | |
| 23643 | +"use strict"; | |
| 23644 | +__webpack_require__.r(__webpack_exports__); | |
| 23645 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 23646 | +/* harmony export */ "Immer": () => (/* binding */ un), | |
| 23647 | +/* harmony export */ "applyPatches": () => (/* binding */ pn), | |
| 23648 | +/* harmony export */ "castDraft": () => (/* binding */ K), | |
| 23649 | +/* harmony export */ "castImmutable": () => (/* binding */ $), | |
| 23650 | +/* harmony export */ "createDraft": () => (/* binding */ ln), | |
| 23651 | +/* harmony export */ "current": () => (/* binding */ D), | |
| 23652 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), | |
| 23653 | +/* harmony export */ "enableAllPlugins": () => (/* binding */ J), | |
| 23654 | +/* harmony export */ "enableES5": () => (/* binding */ N), | |
| 23655 | +/* harmony export */ "enableMapSet": () => (/* binding */ C), | |
| 23656 | +/* harmony export */ "enablePatches": () => (/* binding */ T), | |
| 23657 | +/* harmony export */ "finishDraft": () => (/* binding */ dn), | |
| 23658 | +/* harmony export */ "freeze": () => (/* binding */ d), | |
| 23659 | +/* harmony export */ "immerable": () => (/* binding */ L), | |
| 23660 | +/* harmony export */ "isDraft": () => (/* binding */ r), | |
| 23661 | +/* harmony export */ "isDraftable": () => (/* binding */ t), | |
| 23662 | +/* harmony export */ "nothing": () => (/* binding */ H), | |
| 23663 | +/* harmony export */ "original": () => (/* binding */ e), | |
| 23664 | +/* harmony export */ "produce": () => (/* binding */ fn), | |
| 23665 | +/* harmony export */ "produceWithPatches": () => (/* binding */ cn), | |
| 23666 | +/* harmony export */ "setAutoFreeze": () => (/* binding */ sn), | |
| 23667 | +/* harmony export */ "setUseProxies": () => (/* binding */ vn) | |
| 23668 | +/* harmony export */ }); | |
| 23669 | +function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if(true){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return!!n&&!!n[Q]}function t(n){return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return false||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function O(n){g(n),n.p.forEach(S),n.p=null}function g(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s){if( true&&c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function N(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return true&&f(r),en.get(r,n)},set:function(r){var t=this[Q]; true&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.O&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.D,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=""+i[s];0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},R:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.D,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.D,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.D=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=R(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.O&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,D:void 0,t:n,k:this,C:!1,O:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.D.set(n,!0),t.o.set(n,r),t.D.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.D.set(n,!1):r.D.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.D=new Map,i(n.t,(function(r){n.D.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=R(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,O:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{N:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){N(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return true&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return true&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?O(c):g(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q]; true&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fn); | |
| 23670 | +//# sourceMappingURL=immer.esm.js.map | |
| 23671 | + | |
| 23672 | + | |
| 1555 | 23673 | /***/ }) |
| 1556 | 23674 | |
| 1557 | 23675 | /******/ }); |
| 1558 | 23676 | /************************************************************************/ |
| @@ -1580,10 +23698,39 @@ | ||
| 1580 | 23698 | /******/ return module.exports; |
| 1581 | 23699 | /******/ } |
| 1582 | 23700 | /******/ |
| 1583 | 23701 | /************************************************************************/ |
| 23702 | +/******/ /* webpack/runtime/define property getters */ | |
| 23703 | +/******/ (() => { | |
| 23704 | +/******/ // define getter functions for harmony exports | |
| 23705 | +/******/ __webpack_require__.d = (exports, definition) => { | |
| 23706 | +/******/ for(var key in definition) { | |
| 23707 | +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 23708 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 23709 | +/******/ } | |
| 23710 | +/******/ } | |
| 23711 | +/******/ }; | |
| 23712 | +/******/ })(); | |
| 23713 | +/******/ | |
| 23714 | +/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 23715 | +/******/ (() => { | |
| 23716 | +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | |
| 23717 | +/******/ })(); | |
| 23718 | +/******/ | |
| 23719 | +/******/ /* webpack/runtime/make namespace object */ | |
| 23720 | +/******/ (() => { | |
| 23721 | +/******/ // define __esModule on exports | |
| 23722 | +/******/ __webpack_require__.r = (exports) => { | |
| 23723 | +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 23724 | +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 23725 | +/******/ } | |
| 23726 | +/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 23727 | +/******/ }; | |
| 23728 | +/******/ })(); | |
| 23729 | +/******/ | |
| 23730 | +/************************************************************************/ | |
| 1584 | 23731 | var __webpack_exports__ = {}; |
| 1585 | -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. | |
| 23732 | +// This entry need to be wrapped in an IIFE because it need to be in strict mode. | |
| 1586 | 23733 | (() => { |
| 1587 | 23734 | "use strict"; |
| 1588 | 23735 | /*!**************************************************!*\ |
| 1589 | 23736 | !*** ../assets/dev/js/editor/editor-document.js ***! |
| @@ -1590,39 +23737,22 @@ | ||
| 1590 | 23737 | \**************************************************/ |
| 1591 | 23738 | |
| 1592 | 23739 | |
| 1593 | 23740 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1594 | -var _commandContainerBase = _interopRequireDefault(__webpack_require__(/*! ./command-bases/command-container-base */ "../assets/dev/js/editor/command-bases/command-container-base.js")); | |
| 1595 | -var _commandContainerInternalBase = _interopRequireDefault(__webpack_require__(/*! ./command-bases/command-container-internal-base */ "../assets/dev/js/editor/command-bases/command-container-internal-base.js")); | |
| 1596 | -var _commandHistoryBase = _interopRequireDefault(__webpack_require__(/*! elementor-document/command-bases/command-history-base */ "../assets/dev/js/editor/document/command-bases/command-history-base.js")); | |
| 1597 | -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")); | |
| 1598 | -$e.modules.editor = { | |
| 1599 | - CommandContainerBase: _commandContainerBase.default, | |
| 1600 | - CommandContainerInternalBase: _commandContainerInternalBase.default, | |
| 1601 | - document: { | |
| 1602 | - CommandHistoryBase: _commandHistoryBase.default, | |
| 1603 | - CommandHistoryDebounceBase: _commandHistoryDebounceBase.default | |
| 1604 | - } | |
| 1605 | -}; | |
| 1606 | 23741 | |
| 1607 | -// TODO: Remove, BC. | |
| 1608 | -$e.modules.document = { | |
| 1609 | - /** | |
| 1610 | - * @deprecated since 3.7.0, use `$e.modules.editor.document.CommandHistoryBase` instead. | |
| 1611 | - */ | |
| 1612 | - get CommandHistory() { | |
| 1613 | - elementorDevTools.deprecation.deprecated('$e.modules.document.CommandHistory', '3.7.0', '$e.modules.editor.document.CommandHistoryBase'); | |
| 1614 | - return $e.modules.editor.document.CommandHistoryBase; | |
| 1615 | - }, | |
| 1616 | - /** | |
| 1617 | - * @deprecated since 3.7.0, use `$e.modules.editor.document.CommandHistoryDebounceBase` instead. | |
| 1618 | - */ | |
| 1619 | - get CommandHistoryDebounce() { | |
| 1620 | - elementorDevTools.deprecation.deprecated('$e.modules.CommandHistoryDebounce', '3.7.0', '$e.modules.editor.document.CommandHistoryDebounceBase'); | |
| 1621 | - return $e.modules.editor.document.CommandHistoryDebounceBase; | |
| 1622 | - } | |
| 1623 | -}; | |
| 23742 | +var _component = _interopRequireDefault(__webpack_require__(/*! ./document/component */ "../assets/dev/js/editor/document/component.js")); | |
| 23743 | + | |
| 23744 | +var _component2 = _interopRequireDefault(__webpack_require__(/*! ./data/globals/component */ "../assets/dev/js/editor/data/globals/component.js")); | |
| 23745 | + | |
| 23746 | +elementorCommon.elements.$window.on('elementor:init-components', function () { | |
| 23747 | + // TODO: Move to elementor:init-data-components | |
| 23748 | + $e.components.register(new _component2.default()); | |
| 23749 | + $e.components.register(new _component.default()); // TODO: Remove, BC Since 2.9.0. | |
| 23750 | + | |
| 23751 | + elementor.saver = $e.components.get('document/save'); | |
| 23752 | +}); | |
| 23753 | +$e.modules.document = _component.default.getModules(); | |
| 1624 | 23754 | })(); |
| 1625 | 23755 | |
| 1626 | 23756 | /******/ })() |
| 1627 | 23757 | ; |
| 1628 | 23758 | //# sourceMappingURL=editor-document.js.map |