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