| @@ -1,4 +1,5 @@ | ||
| 1 | +/*! elementor - v3.8.1 - 13-11-2022 */ | |
| 1 | 2 | /******/ (() => { // webpackBootstrap |
| 2 | 3 | /******/ var __webpack_modules__ = ({ |
| 3 | 4 | |
| 4 | 5 | /***/ "../assets/dev/js/admin/new-template/behaviors/lock-pro.js": |
| @@ -10,29 +11,33 @@ | ||
| 10 | 11 | "use strict"; |
| 11 | 12 | |
| 12 | 13 | |
| 13 | 14 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 15 | + | |
| 14 | 16 | Object.defineProperty(exports, "__esModule", ({ |
| 15 | 17 | value: true |
| 16 | 18 | })); |
| 17 | 19 | exports["default"] = void 0; |
| 20 | + | |
| 18 | 21 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 22 | + | |
| 19 | 23 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 20 | -var LockPro = exports["default"] = /*#__PURE__*/function () { | |
| 24 | + | |
| 25 | +var LockPro = /*#__PURE__*/function () { | |
| 21 | 26 | function LockPro(elements) { |
| 22 | 27 | (0, _classCallCheck2.default)(this, LockPro); |
| 23 | 28 | this.elements = elements; |
| 24 | 29 | } |
| 25 | - return (0, _createClass2.default)(LockPro, [{ | |
| 30 | + | |
| 31 | + (0, _createClass2.default)(LockPro, [{ | |
| 26 | 32 | key: "bindEvents", |
| 27 | 33 | value: function bindEvents() { |
| 28 | 34 | var _this$elements = this.elements, |
| 29 | - form = _this$elements.form, | |
| 30 | - templateType = _this$elements.templateType; | |
| 35 | + form = _this$elements.form, | |
| 36 | + templateType = _this$elements.templateType; | |
| 31 | 37 | form.addEventListener('submit', this.onFormSubmit.bind(this)); |
| 32 | - templateType.addEventListener('change', this.onTemplateTypeChange.bind(this)); | |
| 38 | + templateType.addEventListener('change', this.onTemplateTypeChange.bind(this)); // Force checking on render, to make sure that default values are also checked. | |
| 33 | 39 | |
| 34 | - // Force checking on render, to make sure that default values are also checked. | |
| 35 | 40 | this.onTemplateTypeChange(); |
| 36 | 41 | } |
| 37 | 42 | }, { |
| 38 | 43 | key: "onFormSubmit", |
| @@ -37,8 +42,9 @@ | ||
| 37 | 42 | }, { |
| 38 | 43 | key: "onFormSubmit", |
| 39 | 44 | value: function onFormSubmit(e) { |
| 40 | 45 | var lockOptions = this.getCurrentLockOptions(); |
| 46 | + | |
| 41 | 47 | if (lockOptions.is_locked) { |
| 42 | 48 | e.preventDefault(); |
| 43 | 49 | } |
| 44 | 50 | } |
| @@ -45,8 +51,9 @@ | ||
| 45 | 51 | }, { |
| 46 | 52 | key: "onTemplateTypeChange", |
| 47 | 53 | value: function onTemplateTypeChange() { |
| 48 | 54 | var lockOptions = this.getCurrentLockOptions(); |
| 55 | + | |
| 49 | 56 | if (lockOptions.is_locked) { |
| 50 | 57 | this.lock(lockOptions); |
| 51 | 58 | } else { |
| 52 | 59 | this.unlock(); |
| @@ -55,9 +62,9 @@ | ||
| 55 | 62 | }, { |
| 56 | 63 | key: "getCurrentLockOptions", |
| 57 | 64 | value: function getCurrentLockOptions() { |
| 58 | 65 | var templateType = this.elements.templateType, |
| 59 | - currentOption = templateType.options[templateType.selectedIndex]; | |
| 66 | + currentOption = templateType.options[templateType.selectedIndex]; | |
| 60 | 67 | return JSON.parse(currentOption.dataset.lock || '{}'); |
| 61 | 68 | } |
| 62 | 69 | }, { |
| 63 | 70 | key: "lock", |
| @@ -76,11 +83,11 @@ | ||
| 76 | 83 | }, { |
| 77 | 84 | key: "showLockBadge", |
| 78 | 85 | value: function showLockBadge(badgeConfig) { |
| 79 | 86 | var _this$elements2 = this.elements, |
| 80 | - lockBadge = _this$elements2.lockBadge, | |
| 81 | - lockBadgeText = _this$elements2.lockBadgeText, | |
| 82 | - lockBadgeIcon = _this$elements2.lockBadgeIcon; | |
| 87 | + lockBadge = _this$elements2.lockBadge, | |
| 88 | + lockBadgeText = _this$elements2.lockBadgeText, | |
| 89 | + lockBadgeIcon = _this$elements2.lockBadgeIcon; | |
| 83 | 90 | lockBadgeText.innerText = badgeConfig.text; |
| 84 | 91 | lockBadgeIcon.className = badgeConfig.icon; |
| 85 | 92 | lockBadge.classList.remove('e-hidden'); |
| 86 | 93 | } |
| @@ -117,10 +124,13 @@ | ||
| 117 | 124 | value: function replaceLockLinkPlaceholders(link) { |
| 118 | 125 | return link.replace(/%%utm_source%%/g, 'wp-add-new').replace(/%%utm_medium%%/g, 'wp-dash'); |
| 119 | 126 | } |
| 120 | 127 | }]); |
| 128 | + return LockPro; | |
| 121 | 129 | }(); |
| 122 | 130 | |
| 131 | +exports["default"] = LockPro; | |
| 132 | + | |
| 123 | 133 | /***/ }), |
| 124 | 134 | |
| 125 | 135 | /***/ "../assets/dev/js/admin/new-template/layout.js": |
| 126 | 136 | /*!*****************************************************!*\ |
| @@ -132,10 +142,13 @@ | ||
| 132 | 142 | /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; |
| 133 | 143 | |
| 134 | 144 | |
| 135 | 145 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 146 | + | |
| 136 | 147 | var _lockPro = _interopRequireDefault(__webpack_require__(/*! ./behaviors/lock-pro */ "../assets/dev/js/admin/new-template/behaviors/lock-pro.js")); |
| 148 | + | |
| 137 | 149 | var NewTemplateView = __webpack_require__(/*! elementor-admin/new-template/view */ "../assets/dev/js/admin/new-template/view.js"); |
| 150 | + | |
| 138 | 151 | module.exports = elementorModules.common.views.modal.Layout.extend({ |
| 139 | 152 | getModalOptions: function getModalOptions() { |
| 140 | 153 | return { |
| 141 | 154 | id: 'elementor-new-template-modal' |
| @@ -147,31 +160,25 @@ | ||
| 147 | 160 | }; |
| 148 | 161 | }, |
| 149 | 162 | initialize: function initialize() { |
| 150 | 163 | elementorModules.common.views.modal.Layout.prototype.initialize.apply(this, arguments); |
| 164 | + var lookupControlIdPrefix = 'elementor-new-template__form__'; | |
| 165 | + var templateTypeSelectId = "".concat(lookupControlIdPrefix, "template-type"); | |
| 151 | 166 | this.showLogo(); |
| 152 | 167 | this.showContentView(); |
| 153 | 168 | this.initElements(); |
| 154 | 169 | this.lockProBehavior = new _lockPro.default(this.elements); |
| 155 | 170 | this.lockProBehavior.bindEvents(); |
| 156 | - this.setupDynamicControlsVisibility(); | |
| 157 | - }, | |
| 158 | - setupDynamicControlsVisibility: function setupDynamicControlsVisibility() { | |
| 159 | - // eslint-disable-next-line camelcase | |
| 160 | - var isFormControlsDefined = 'undefined' !== typeof elementor_new_template_form_controls; | |
| 161 | - if (!isFormControlsDefined) { | |
| 162 | - return; | |
| 163 | - } | |
| 164 | - var CONTROL_ID_PREFIX = 'elementor-new-template__form__'; | |
| 165 | - var templateTypeSelectId = "".concat(CONTROL_ID_PREFIX, "template-type"); | |
| 171 | + | |
| 166 | 172 | var dynamicControlsVisibilityListener = function dynamicControlsVisibilityListener() { |
| 167 | - // eslint-disable-next-line camelcase | |
| 168 | - elementorAdmin.templateControls.setDynamicControlsVisibility(CONTROL_ID_PREFIX, elementor_new_template_form_controls); | |
| 173 | + elementorAdmin.templateControls.setDynamicControlsVisibility(lookupControlIdPrefix, elementor_new_template_form_controls); | |
| 169 | 174 | }; |
| 175 | + | |
| 170 | 176 | this.getModal().onShow = function () { |
| 171 | 177 | dynamicControlsVisibilityListener(); |
| 172 | 178 | document.getElementById(templateTypeSelectId).addEventListener('change', dynamicControlsVisibilityListener); |
| 173 | 179 | }; |
| 180 | + | |
| 174 | 181 | this.getModal().onHide = function () { |
| 175 | 182 | document.getElementById(templateTypeSelectId).removeEventListener('change', dynamicControlsVisibilityListener); |
| 176 | 183 | }; |
| 177 | 184 | }, |
| @@ -176,9 +183,9 @@ | ||
| 176 | 183 | }; |
| 177 | 184 | }, |
| 178 | 185 | initElements: function initElements() { |
| 179 | 186 | var container = this.$el[0], |
| 180 | - root = '#elementor-new-template__form'; | |
| 187 | + root = '#elementor-new-template__form'; | |
| 181 | 188 | this.elements = { |
| 182 | 189 | form: container.querySelector(root), |
| 183 | 190 | submitButton: container.querySelector("".concat(root, "__submit")), |
| 184 | 191 | lockButton: container.querySelector("".concat(root, "__lock_button")), |
| @@ -213,8 +220,19 @@ | ||
| 213 | 220 | }); |
| 214 | 221 | |
| 215 | 222 | /***/ }), |
| 216 | 223 | |
| 224 | +/***/ "@wordpress/i18n": | |
| 225 | +/*!**************************!*\ | |
| 226 | + !*** external "wp.i18n" ***! | |
| 227 | + \**************************/ | |
| 228 | +/***/ ((module) => { | |
| 229 | + | |
| 230 | +"use strict"; | |
| 231 | +module.exports = wp.i18n; | |
| 232 | + | |
| 233 | +/***/ }), | |
| 234 | + | |
| 217 | 235 | /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": |
| 218 | 236 | /*!****************************************************************!*\ |
| 219 | 237 | !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! |
| 220 | 238 | \****************************************************************/ |
| @@ -219,11 +237,14 @@ | ||
| 219 | 237 | !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! |
| 220 | 238 | \****************************************************************/ |
| 221 | 239 | /***/ ((module) => { |
| 222 | 240 | |
| 223 | -function _classCallCheck(a, n) { | |
| 224 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 241 | +function _classCallCheck(instance, Constructor) { | |
| 242 | + if (!(instance instanceof Constructor)) { | |
| 243 | + throw new TypeError("Cannot call a class as a function"); | |
| 244 | + } | |
| 225 | 245 | } |
| 246 | + | |
| 226 | 247 | module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 227 | 248 | |
| 228 | 249 | /***/ }), |
| 229 | 250 | |
| @@ -230,22 +251,29 @@ | ||
| 230 | 251 | /***/ "../node_modules/@babel/runtime/helpers/createClass.js": |
| 231 | 252 | /*!*************************************************************!*\ |
| 232 | 253 | !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! |
| 233 | 254 | \*************************************************************/ |
| 234 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 255 | +/***/ ((module) => { | |
| 235 | 256 | |
| 236 | -var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 237 | -function _defineProperties(e, r) { | |
| 238 | - for (var t = 0; t < r.length; t++) { | |
| 239 | - var o = r[t]; | |
| 240 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 257 | +function _defineProperties(target, props) { | |
| 258 | + for (var i = 0; i < props.length; i++) { | |
| 259 | + var descriptor = props[i]; | |
| 260 | + descriptor.enumerable = descriptor.enumerable || false; | |
| 261 | + descriptor.configurable = true; | |
| 262 | + if ("value" in descriptor) descriptor.writable = true; | |
| 263 | + Object.defineProperty(target, descriptor.key, descriptor); | |
| 241 | 264 | } |
| 242 | 265 | } |
| 243 | -function _createClass(e, r, t) { | |
| 244 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { | |
| 245 | - writable: !1 | |
| 246 | - }), e; | |
| 266 | + | |
| 267 | +function _createClass(Constructor, protoProps, staticProps) { | |
| 268 | + if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
| 269 | + if (staticProps) _defineProperties(Constructor, staticProps); | |
| 270 | + Object.defineProperty(Constructor, "prototype", { | |
| 271 | + writable: false | |
| 272 | + }); | |
| 273 | + return Constructor; | |
| 247 | 274 | } |
| 275 | + | |
| 248 | 276 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 249 | 277 | |
| 250 | 278 | /***/ }), |
| 251 | 279 | |
| @@ -254,82 +282,16 @@ | ||
| 254 | 282 | !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! |
| 255 | 283 | \***********************************************************************/ |
| 256 | 284 | /***/ ((module) => { |
| 257 | 285 | |
| 258 | -function _interopRequireDefault(e) { | |
| 259 | - return e && e.__esModule ? e : { | |
| 260 | - "default": e | |
| 286 | +function _interopRequireDefault(obj) { | |
| 287 | + return obj && obj.__esModule ? obj : { | |
| 288 | + "default": obj | |
| 261 | 289 | }; |
| 262 | 290 | } |
| 291 | + | |
| 263 | 292 | module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 264 | 293 | |
| 265 | -/***/ }), | |
| 266 | - | |
| 267 | -/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 268 | -/*!*************************************************************!*\ | |
| 269 | - !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 270 | - \*************************************************************/ | |
| 271 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 272 | - | |
| 273 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 274 | -function toPrimitive(t, r) { | |
| 275 | - if ("object" != _typeof(t) || !t) return t; | |
| 276 | - var e = t[Symbol.toPrimitive]; | |
| 277 | - if (void 0 !== e) { | |
| 278 | - var i = e.call(t, r || "default"); | |
| 279 | - if ("object" != _typeof(i)) return i; | |
| 280 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 281 | - } | |
| 282 | - return ("string" === r ? String : Number)(t); | |
| 283 | -} | |
| 284 | -module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 285 | - | |
| 286 | -/***/ }), | |
| 287 | - | |
| 288 | -/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 289 | -/*!***************************************************************!*\ | |
| 290 | - !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 291 | - \***************************************************************/ | |
| 292 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 293 | - | |
| 294 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 295 | -var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 296 | -function toPropertyKey(t) { | |
| 297 | - var i = toPrimitive(t, "string"); | |
| 298 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 299 | -} | |
| 300 | -module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 301 | - | |
| 302 | -/***/ }), | |
| 303 | - | |
| 304 | -/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 305 | -/*!********************************************************!*\ | |
| 306 | - !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 307 | - \********************************************************/ | |
| 308 | -/***/ ((module) => { | |
| 309 | - | |
| 310 | -function _typeof(o) { | |
| 311 | - "@babel/helpers - typeof"; | |
| 312 | - | |
| 313 | - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 314 | - return typeof o; | |
| 315 | - } : function (o) { | |
| 316 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 317 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 318 | -} | |
| 319 | -module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 320 | - | |
| 321 | -/***/ }), | |
| 322 | - | |
| 323 | -/***/ "@wordpress/i18n": | |
| 324 | -/*!**************************!*\ | |
| 325 | - !*** external "wp.i18n" ***! | |
| 326 | - \**************************/ | |
| 327 | -/***/ ((module) => { | |
| 328 | - | |
| 329 | -"use strict"; | |
| 330 | -module.exports = wp.i18n; | |
| 331 | - | |
| 332 | 294 | /***/ }) |
| 333 | 295 | |
| 334 | 296 | /******/ }); |
| 335 | 297 | /************************************************************************/ |
| @@ -358,9 +320,9 @@ | ||
| 358 | 320 | /******/ } |
| 359 | 321 | /******/ |
| 360 | 322 | /************************************************************************/ |
| 361 | 323 | var __webpack_exports__ = {}; |
| 362 | -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. | |
| 324 | +// This entry need to be wrapped in an IIFE because it need to be in strict mode. | |
| 363 | 325 | (() => { |
| 364 | 326 | "use strict"; |
| 365 | 327 | /*!***********************************************************!*\ |
| 366 | 328 | !*** ../assets/dev/js/admin/new-template/new-template.js ***! |
| @@ -367,13 +329,14 @@ | ||
| 367 | 329 | \***********************************************************/ |
| 368 | 330 | |
| 369 | 331 | |
| 370 | 332 | var NewTemplateLayout = __webpack_require__(/*! elementor-admin/new-template/layout */ "../assets/dev/js/admin/new-template/layout.js"); |
| 333 | + | |
| 371 | 334 | var NewTemplateModule = elementorModules.ViewModule.extend({ |
| 372 | 335 | getDefaultSettings: function getDefaultSettings() { |
| 373 | 336 | return { |
| 374 | 337 | selectors: { |
| 375 | - addButton: 'a.page-title-action[href*="post-new.php?post_type=elementor_library"], #elementor-template-library-add-new' | |
| 338 | + addButton: '.page-title-action:first, #elementor-template-library-add-new' | |
| 376 | 339 | } |
| 377 | 340 | }; |
| 378 | 341 | }, |
| 379 | 342 | getDefaultElements: function getDefaultElements() { |
| @@ -387,10 +350,9 @@ | ||
| 387 | 350 | elementorCommon.elements.$window.on('hashchange', this.showModalByHash.bind(this)); |
| 388 | 351 | }, |
| 389 | 352 | showModalByHash: function showModalByHash() { |
| 390 | 353 | if ('#add_new' === location.hash) { |
| 391 | - var _this$layout; | |
| 392 | - (_this$layout = this.layout) === null || _this$layout === void 0 || _this$layout.showModal(); | |
| 354 | + this.layout.showModal(); | |
| 393 | 355 | location.hash = ''; |
| 394 | 356 | } |
| 395 | 357 | }, |
| 396 | 358 | onInit: function onInit() { |
| @@ -398,11 +360,10 @@ | ||
| 398 | 360 | this.layout = new NewTemplateLayout(); |
| 399 | 361 | this.showModalByHash(); |
| 400 | 362 | }, |
| 401 | 363 | onAddButtonClick: function onAddButtonClick(event) { |
| 402 | - var _this$layout2; | |
| 403 | 364 | event.preventDefault(); |
| 404 | - (_this$layout2 = this.layout) === null || _this$layout2 === void 0 || _this$layout2.showModal(); | |
| 365 | + this.layout.showModal(); | |
| 405 | 366 | } |
| 406 | 367 | }); |
| 407 | 368 | jQuery(function () { |
| 408 | 369 | window.elementorNewTemplate = new NewTemplateModule(); |