| @@ -1,1765 +1,2308 @@ | ||
| 1 | -(function(_wordpress_i18n) { | |
| 1 | +/*! elementor - v3.24.0 - 28-10-2024 */ | |
| 2 | +/******/ (() => { // webpackBootstrap | |
| 3 | +/******/ var __webpack_modules__ = ({ | |
| 2 | 4 | |
| 3 | -//#region \0rolldown/runtime.js | |
| 4 | - var __create = Object.create; | |
| 5 | - var __defProp = Object.defineProperty; | |
| 6 | - var __name = (target, value) => __defProp(target, "name", { | |
| 7 | - value, | |
| 8 | - configurable: true | |
| 9 | - }); | |
| 10 | - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 11 | - var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 12 | - var __getProtoOf = Object.getPrototypeOf; | |
| 13 | - var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 14 | - var __esmMin = (fn, res, err) => () => { | |
| 15 | - if (err) throw err[0]; | |
| 16 | - try { | |
| 17 | - return fn && (res = fn(fn = 0)), res; | |
| 18 | - } catch (e) { | |
| 19 | - throw err = [e], e; | |
| 20 | - } | |
| 21 | - }; | |
| 22 | - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); | |
| 23 | - var __exportAll = (all, no_symbols) => { | |
| 24 | - let target = {}; | |
| 25 | - for (var name in all) { | |
| 26 | - __defProp(target, name, { | |
| 27 | - get: all[name], | |
| 28 | - enumerable: true | |
| 29 | - }); | |
| 30 | - } | |
| 31 | - if (!no_symbols) { | |
| 32 | - __defProp(target, Symbol.toStringTag, { value: "Module" }); | |
| 33 | - } | |
| 34 | - return target; | |
| 35 | - }; | |
| 36 | - var __copyProps = (to, from, except, desc) => { | |
| 37 | - if (from && typeof from === "object" || typeof from === "function") { | |
| 38 | - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { | |
| 39 | - key = keys[i]; | |
| 40 | - if (!__hasOwnProp.call(to, key) && key !== except) { | |
| 41 | - __defProp(to, key, { | |
| 42 | - get: ((k) => from[k]).bind(null, key), | |
| 43 | - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable | |
| 44 | - }); | |
| 45 | - } | |
| 46 | - } | |
| 47 | - } | |
| 48 | - return to; | |
| 49 | - }; | |
| 50 | - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { | |
| 51 | - value: mod, | |
| 52 | - enumerable: true | |
| 53 | - }) : target, mod)); | |
| 5 | +/***/ "../assets/dev/js/editor/components/dynamic-tags/control-behavior.js": | |
| 6 | +/*!***************************************************************************!*\ | |
| 7 | + !*** ../assets/dev/js/editor/components/dynamic-tags/control-behavior.js ***! | |
| 8 | + \***************************************************************************/ | |
| 9 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 54 | 10 | |
| 55 | -//#endregion | |
| 11 | +"use strict"; | |
| 12 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 56 | 13 | |
| 57 | -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js | |
| 58 | - function _classCallCheck(a, n) { | |
| 59 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 60 | - } | |
| 61 | - var init_classCallCheck = __esmMin((() => {})); | |
| 62 | 14 | |
| 63 | -//#endregion | |
| 64 | -//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 65 | - function _typeof(o) { | |
| 66 | - "@babel/helpers - typeof"; | |
| 67 | - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 68 | - return typeof o; | |
| 69 | - } : function(o) { | |
| 70 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 71 | - }, _typeof(o); | |
| 72 | - } | |
| 73 | - var init_typeof = __esmMin((() => {})); | |
| 15 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 16 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 17 | +var TagPanelView = __webpack_require__(/*! elementor-dynamic-tags/tag-panel-view */ "../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js"); | |
| 18 | +module.exports = Marionette.Behavior.extend({ | |
| 19 | + tagView: null, | |
| 20 | + listenerAttached: false, | |
| 21 | + initialize: function initialize() { | |
| 22 | + if (!this.listenerAttached) { | |
| 23 | + this.listenTo(this.view.options.container.settings, 'change:external:__dynamic__', this.onAfterExternalChange); | |
| 24 | + this.listenerAttached = true; | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + shouldRenderTools: function shouldRenderTools() { | |
| 28 | + var hasDefault = this.getOption('dynamicSettings').default; | |
| 29 | + if (hasDefault) { | |
| 30 | + return false; | |
| 31 | + } | |
| 32 | + var isFeatureAvailableToUser = elementor.helpers.hasPro() && !elementor.helpers.hasProAndNotConnected(), | |
| 33 | + hasTags = this.getOption('tags').length > 0; | |
| 34 | + return !isFeatureAvailableToUser || hasTags; | |
| 35 | + }, | |
| 36 | + renderTools: function renderTools() { | |
| 37 | + var _this = this; | |
| 38 | + if (!this.shouldRenderTools()) { | |
| 39 | + return; | |
| 40 | + } | |
| 41 | + var $dynamicSwitcher = jQuery(Marionette.Renderer.render('#tmpl-elementor-control-dynamic-switcher')); | |
| 42 | + $dynamicSwitcher.on('click', function (event) { | |
| 43 | + return _this.onDynamicSwitcherClick(event); | |
| 44 | + }); | |
| 45 | + this.$el.find('.elementor-control-dynamic-switcher-wrapper').append($dynamicSwitcher); | |
| 46 | + this.ui.dynamicSwitcher = $dynamicSwitcher; | |
| 47 | + if ('color' === this.view.model.get('type')) { | |
| 48 | + if (this.view.colorPicker) { | |
| 49 | + this.moveDynamicSwitcherToColorPicker(); | |
| 50 | + } else { | |
| 51 | + setTimeout(function () { | |
| 52 | + return _this.moveDynamicSwitcherToColorPicker(); | |
| 53 | + }); | |
| 54 | + } | |
| 55 | + } | |
| 74 | 56 | |
| 75 | -//#endregion | |
| 76 | -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 77 | - function toPrimitive(t, r) { | |
| 78 | - if ("object" != _typeof(t) || !t) return t; | |
| 79 | - var e = t[Symbol.toPrimitive]; | |
| 80 | - if (void 0 !== e) { | |
| 81 | - var i = e.call(t, r || "default"); | |
| 82 | - if ("object" != _typeof(i)) return i; | |
| 83 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 84 | - } | |
| 85 | - return ("string" === r ? String : Number)(t); | |
| 86 | - } | |
| 87 | - var init_toPrimitive = __esmMin((() => { | |
| 88 | - init_typeof(); | |
| 89 | - })); | |
| 57 | + // Add a Tipsy Tooltip to the Dynamic Switcher | |
| 58 | + this.ui.dynamicSwitcher.tipsy({ | |
| 59 | + title: function title() { | |
| 60 | + return this.getAttribute('data-tooltip'); | |
| 61 | + }, | |
| 62 | + gravity: 's' | |
| 63 | + }); | |
| 64 | + }, | |
| 65 | + moveDynamicSwitcherToColorPicker: function moveDynamicSwitcherToColorPicker() { | |
| 66 | + var $colorPickerToolsContainer = this.view.colorPicker.$pickerToolsContainer; | |
| 67 | + this.ui.dynamicSwitcher.removeClass('elementor-control-unit-1').addClass('e-control-tool'); | |
| 68 | + var $eyedropper = $colorPickerToolsContainer.find('.elementor-control-element-color-picker'); | |
| 69 | + if ($eyedropper.length) { | |
| 70 | + this.ui.dynamicSwitcher.insertBefore($eyedropper); | |
| 71 | + } else { | |
| 72 | + $colorPickerToolsContainer.append(this.ui.dynamicSwitcher); | |
| 73 | + } | |
| 74 | + }, | |
| 75 | + toggleDynamicClass: function toggleDynamicClass() { | |
| 76 | + this.$el.toggleClass('elementor-control-dynamic-value', this.isDynamicMode()); | |
| 77 | + }, | |
| 78 | + isDynamicMode: function isDynamicMode() { | |
| 79 | + var dynamicSettings = this.view.container.settings.get('__dynamic__'); | |
| 80 | + return !!(dynamicSettings && dynamicSettings[this.view.model.get('name')]); | |
| 81 | + }, | |
| 82 | + createTagsList: function createTagsList() { | |
| 83 | + var tags = _.groupBy(this.getOption('tags'), 'group'), | |
| 84 | + groups = elementor.dynamicTags.getConfig('groups'), | |
| 85 | + $tagsList = this.ui.tagsList = jQuery('<div>', { | |
| 86 | + class: 'elementor-tags-list' | |
| 87 | + }), | |
| 88 | + $tagsListInner = jQuery('<div>', { | |
| 89 | + class: 'elementor-tags-list__inner' | |
| 90 | + }); | |
| 91 | + $tagsList.append($tagsListInner); | |
| 92 | + jQuery.each(groups, function (groupName) { | |
| 93 | + var groupTags = tags[groupName]; | |
| 94 | + if (!groupTags) { | |
| 95 | + return; | |
| 96 | + } | |
| 97 | + var group = this, | |
| 98 | + $groupTitle = jQuery('<div>', { | |
| 99 | + class: 'elementor-tags-list__group-title' | |
| 100 | + }).text(group.title); | |
| 101 | + $tagsListInner.append($groupTitle); | |
| 102 | + groupTags.forEach(function (tag) { | |
| 103 | + var $tag = jQuery('<div>', { | |
| 104 | + class: 'elementor-tags-list__item' | |
| 105 | + }); | |
| 106 | + $tag.text(tag.title).attr('data-tag-name', tag.name); | |
| 107 | + $tagsListInner.append($tag); | |
| 108 | + }); | |
| 109 | + }); | |
| 90 | 110 | |
| 91 | -//#endregion | |
| 92 | -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 93 | - function toPropertyKey(t) { | |
| 94 | - var i = toPrimitive(t, "string"); | |
| 95 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 96 | - } | |
| 97 | - var init_toPropertyKey = __esmMin((() => { | |
| 98 | - init_typeof(); | |
| 99 | - init_toPrimitive(); | |
| 100 | - })); | |
| 111 | + // Create and inject pro dynamic teaser template if Pro is not installed | |
| 112 | + if (!elementor.helpers.hasPro() && Object.keys(tags).length) { | |
| 113 | + var proTeaser = Marionette.Renderer.render('#tmpl-elementor-dynamic-tags-promo', { | |
| 114 | + promotionUrl: elementor.config.dynamicPromotionURL.replace('%s', this.view.model.get('name')) | |
| 115 | + }); | |
| 116 | + $tagsListInner.append(proTeaser); | |
| 117 | + } | |
| 118 | + $tagsListInner.on('click', '.elementor-tags-list__item', this.onTagsListItemClick.bind(this)); | |
| 119 | + elementorCommon.elements.$body.append($tagsList); | |
| 120 | + }, | |
| 121 | + getTagsList: function getTagsList() { | |
| 122 | + if (!this.ui.tagsList) { | |
| 123 | + this.createTagsList(); | |
| 124 | + } | |
| 125 | + return this.ui.tagsList; | |
| 126 | + }, | |
| 127 | + toggleTagsList: function toggleTagsList() { | |
| 128 | + var $tagsList = this.getTagsList(); | |
| 129 | + if ($tagsList.is(':visible')) { | |
| 130 | + $tagsList.hide(); | |
| 131 | + return; | |
| 132 | + } | |
| 133 | + var direction = elementorCommon.config.isRTL ? 'left' : 'right'; | |
| 134 | + $tagsList.show().position({ | |
| 135 | + my: "".concat(direction, " top"), | |
| 136 | + at: "".concat(direction, " bottom+5"), | |
| 137 | + of: this.ui.dynamicSwitcher | |
| 138 | + }); | |
| 139 | + }, | |
| 140 | + setTagView: function setTagView(id, name, settings) { | |
| 141 | + if (this.tagView) { | |
| 142 | + this.tagView.destroy(); | |
| 143 | + } | |
| 144 | + var tagView = this.tagView = new TagPanelView({ | |
| 145 | + id: id, | |
| 146 | + name: name, | |
| 147 | + settings: settings, | |
| 148 | + controlName: this.view.model.get('name'), | |
| 149 | + dynamicSettings: this.getOption('dynamicSettings') | |
| 150 | + }), | |
| 151 | + elementContainer = this.view.options.container, | |
| 152 | + tagViewLabel = elementContainer.controls[tagView.options.controlName].label; | |
| 153 | + tagView.options.container = new elementorModules.editor.Container({ | |
| 154 | + type: 'dynamic', | |
| 155 | + id: id, | |
| 156 | + model: tagView.model, | |
| 157 | + settings: tagView.model, | |
| 158 | + view: tagView, | |
| 159 | + parent: elementContainer, | |
| 160 | + label: elementContainer.label + ' ' + tagViewLabel, | |
| 161 | + controls: tagView.model.options.controls, | |
| 162 | + renderer: elementContainer | |
| 163 | + }); | |
| 164 | + tagView.render(); | |
| 165 | + this.$el.find('.elementor-control-tag-area').after(tagView.el); | |
| 166 | + this.listenTo(tagView, 'remove', this.onTagViewRemove.bind(this)); | |
| 167 | + }, | |
| 168 | + setDefaultTagView: function setDefaultTagView() { | |
| 169 | + var tagData = elementor.dynamicTags.tagTextToTagData(this.getDynamicValue()); | |
| 170 | + this.setTagView(tagData.id, tagData.name, tagData.settings); | |
| 171 | + }, | |
| 172 | + tagViewToTagText: function tagViewToTagText() { | |
| 173 | + var tagView = this.tagView; | |
| 174 | + return elementor.dynamicTags.tagDataToTagText(tagView.getOption('id'), tagView.getOption('name'), tagView.model); | |
| 175 | + }, | |
| 176 | + getDynamicValue: function getDynamicValue() { | |
| 177 | + return this.view.container.dynamic.get(this.view.model.get('name')); | |
| 178 | + }, | |
| 179 | + destroyTagView: function destroyTagView() { | |
| 180 | + if (this.tagView) { | |
| 181 | + this.tagView.destroy(); | |
| 182 | + this.tagView = null; | |
| 183 | + } | |
| 184 | + }, | |
| 185 | + showPromotion: function showPromotion() { | |
| 186 | + var hasProAndNotConnected = elementor.helpers.hasProAndNotConnected(), | |
| 187 | + dialogOptions = { | |
| 188 | + title: __('Dynamic Content', 'elementor'), | |
| 189 | + content: __('Create more personalized and dynamic sites by populating data from various sources with dozens of dynamic tags to choose from.', 'elementor'), | |
| 190 | + targetElement: this.ui.dynamicSwitcher, | |
| 191 | + position: { | |
| 192 | + blockStart: '-10' | |
| 193 | + }, | |
| 194 | + actionButton: { | |
| 195 | + url: hasProAndNotConnected ? elementorProEditorConfig.urls.connect : elementor.config.dynamicPromotionURL.replace('%s', this.view.model.get('name')), | |
| 196 | + text: hasProAndNotConnected ? __('Connect & Activate', 'elementor') : __('Upgrade', 'elementor') | |
| 197 | + } | |
| 198 | + }; | |
| 199 | + elementor.promotion.showDialog(dialogOptions); | |
| 200 | + }, | |
| 201 | + onRender: function onRender() { | |
| 202 | + this.$el.addClass('elementor-control-dynamic'); | |
| 203 | + this.renderTools(); | |
| 204 | + this.toggleDynamicClass(); | |
| 205 | + if (this.isDynamicMode()) { | |
| 206 | + this.setDefaultTagView(); | |
| 207 | + } | |
| 208 | + }, | |
| 209 | + onDynamicSwitcherClick: function onDynamicSwitcherClick(event) { | |
| 210 | + event.stopPropagation(); | |
| 211 | + if (this.getOption('tags').length) { | |
| 212 | + this.toggleTagsList(); | |
| 213 | + } else { | |
| 214 | + this.showPromotion(); | |
| 215 | + } | |
| 216 | + }, | |
| 217 | + onTagsListItemClick: function onTagsListItemClick(event) { | |
| 218 | + var $tag = jQuery(event.currentTarget); | |
| 219 | + this.setTagView(elementorCommon.helpers.getUniqueId(), $tag.data('tagName'), {}); | |
| 101 | 220 | |
| 102 | -//#endregion | |
| 103 | -//#region node_modules/@babel/runtime/helpers/esm/createClass.js | |
| 104 | - function _defineProperties(e, r) { | |
| 105 | - for (var t = 0; t < r.length; t++) { | |
| 106 | - var o = r[t]; | |
| 107 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 108 | - } | |
| 109 | - } | |
| 110 | - function _createClass(e, r, t) { | |
| 111 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; | |
| 112 | - } | |
| 113 | - var init_createClass = __esmMin((() => { | |
| 114 | - init_toPropertyKey(); | |
| 115 | - })); | |
| 221 | + // If an element has an active global value, disable it before applying the dynamic value. | |
| 222 | + if (this.view.getGlobalKey()) { | |
| 223 | + this.view.triggerMethod('unset:global:value'); | |
| 224 | + } | |
| 225 | + if (this.isDynamicMode()) { | |
| 226 | + $e.run('document/dynamic/settings', { | |
| 227 | + container: this.view.options.container, | |
| 228 | + settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) | |
| 229 | + }); | |
| 230 | + } else { | |
| 231 | + $e.run('document/dynamic/enable', { | |
| 232 | + container: this.view.options.container, | |
| 233 | + settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) | |
| 234 | + }); | |
| 235 | + } | |
| 236 | + this.toggleDynamicClass(); | |
| 237 | + this.toggleTagsList(); | |
| 238 | + if (this.tagView.getTagConfig().settings_required) { | |
| 239 | + this.tagView.showSettingsPopup(); | |
| 240 | + } | |
| 241 | + }, | |
| 242 | + onTagViewRemove: function onTagViewRemove() { | |
| 243 | + $e.run('document/dynamic/disable', { | |
| 244 | + container: this.view.options.container, | |
| 245 | + settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) | |
| 246 | + }); | |
| 247 | + this.toggleDynamicClass(); | |
| 248 | + }, | |
| 249 | + onAfterExternalChange: function onAfterExternalChange() { | |
| 250 | + this.destroyTagView(); | |
| 251 | + if (this.isDynamicMode()) { | |
| 252 | + this.setDefaultTagView(); | |
| 253 | + } | |
| 254 | + this.toggleDynamicClass(); | |
| 255 | + }, | |
| 256 | + onDestroy: function onDestroy() { | |
| 257 | + this.destroyTagView(); | |
| 258 | + if (this.ui.tagsList) { | |
| 259 | + this.ui.tagsList.remove(); | |
| 260 | + } | |
| 261 | + } | |
| 262 | +}); | |
| 116 | 263 | |
| 117 | -//#endregion | |
| 118 | -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js | |
| 119 | - function _assertThisInitialized(e) { | |
| 120 | - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 121 | - return e; | |
| 122 | - } | |
| 123 | - var init_assertThisInitialized = __esmMin((() => {})); | |
| 264 | +/***/ }), | |
| 124 | 265 | |
| 125 | -//#endregion | |
| 126 | -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js | |
| 127 | - function _possibleConstructorReturn(t, e) { | |
| 128 | - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; | |
| 129 | - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 130 | - return _assertThisInitialized(t); | |
| 131 | - } | |
| 132 | - var init_possibleConstructorReturn = __esmMin((() => { | |
| 133 | - init_typeof(); | |
| 134 | - init_assertThisInitialized(); | |
| 135 | - })); | |
| 266 | +/***/ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js": | |
| 267 | +/*!***********************************************************************************!*\ | |
| 268 | + !*** ../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js ***! | |
| 269 | + \***********************************************************************************/ | |
| 270 | +/***/ ((module) => { | |
| 136 | 271 | |
| 137 | -//#endregion | |
| 138 | -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js | |
| 139 | - function _getPrototypeOf(t) { | |
| 140 | - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { | |
| 141 | - return t.__proto__ || Object.getPrototypeOf(t); | |
| 142 | - }, _getPrototypeOf(t); | |
| 143 | - } | |
| 144 | - var init_getPrototypeOf = __esmMin((() => {})); | |
| 272 | +"use strict"; | |
| 145 | 273 | |
| 146 | -//#endregion | |
| 147 | -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js | |
| 148 | - function _setPrototypeOf(t, e) { | |
| 149 | - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { | |
| 150 | - return t.__proto__ = e, t; | |
| 151 | - }, _setPrototypeOf(t, e); | |
| 152 | - } | |
| 153 | - var init_setPrototypeOf = __esmMin((() => {})); | |
| 154 | 274 | |
| 155 | -//#endregion | |
| 156 | -//#region node_modules/@babel/runtime/helpers/esm/inherits.js | |
| 157 | - function _inherits(t, e) { | |
| 158 | - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 159 | - t.prototype = Object.create(e && e.prototype, { constructor: { | |
| 160 | - value: t, | |
| 161 | - writable: !0, | |
| 162 | - configurable: !0 | |
| 163 | - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); | |
| 164 | - } | |
| 165 | - var init_inherits = __esmMin((() => { | |
| 166 | - init_setPrototypeOf(); | |
| 167 | - })); | |
| 275 | +module.exports = Marionette.ItemView.extend({ | |
| 276 | + className: 'elementor-tag-controls-stack-empty', | |
| 277 | + template: '#tmpl-elementor-tag-controls-stack-empty' | |
| 278 | +}); | |
| 168 | 279 | |
| 169 | -//#endregion | |
| 170 | -//#region modules/styleguide/assets/js/commands/enable.js | |
| 171 | - init_classCallCheck(); | |
| 172 | - init_createClass(); | |
| 173 | - init_possibleConstructorReturn(); | |
| 174 | - init_getPrototypeOf(); | |
| 175 | - init_inherits(); | |
| 176 | - function _callSuper$8(t, o, e) { | |
| 177 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 178 | - } | |
| 179 | - __name(_callSuper$8, "_callSuper"); | |
| 180 | - function _isNativeReflectConstruct$8() { | |
| 181 | - try { | |
| 182 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 183 | - } catch (t) {} | |
| 184 | - return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() { | |
| 185 | - return !!t; | |
| 186 | - })(); | |
| 187 | - } | |
| 188 | - __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct"); | |
| 189 | - var Enable = /*#__PURE__*/ function(_$e$modules$CommandBa) { | |
| 190 | - function Enable() { | |
| 191 | - _classCallCheck(this, Enable); | |
| 192 | - return _callSuper$8(this, Enable, arguments); | |
| 193 | - } | |
| 194 | - _inherits(Enable, _$e$modules$CommandBa); | |
| 195 | - return _createClass(Enable, [{ | |
| 196 | - key: "apply", | |
| 197 | - value: function apply(args) { | |
| 198 | - $e.components.get("preview/styleguide").enableStyleguidePreview(args); | |
| 199 | - } | |
| 200 | - }]); | |
| 201 | - }($e.modules.CommandBase); | |
| 280 | +/***/ }), | |
| 202 | 281 | |
| 203 | -//#endregion | |
| 204 | -//#region modules/styleguide/assets/js/commands/global-colors.js | |
| 205 | - init_classCallCheck(); | |
| 206 | - init_createClass(); | |
| 207 | - init_possibleConstructorReturn(); | |
| 208 | - init_getPrototypeOf(); | |
| 209 | - init_inherits(); | |
| 210 | - function _callSuper$7(t, o, e) { | |
| 211 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 212 | - } | |
| 213 | - __name(_callSuper$7, "_callSuper"); | |
| 214 | - function _isNativeReflectConstruct$7() { | |
| 215 | - try { | |
| 216 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 217 | - } catch (t) {} | |
| 218 | - return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() { | |
| 219 | - return !!t; | |
| 220 | - })(); | |
| 221 | - } | |
| 222 | - __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct"); | |
| 223 | - var GlobalColors = /*#__PURE__*/ function(_$e$modules$CommandBa) { | |
| 224 | - function GlobalColors() { | |
| 225 | - _classCallCheck(this, GlobalColors); | |
| 226 | - return _callSuper$7(this, GlobalColors, arguments); | |
| 227 | - } | |
| 228 | - _inherits(GlobalColors, _$e$modules$CommandBa); | |
| 229 | - return _createClass(GlobalColors, [{ | |
| 230 | - key: "apply", | |
| 231 | - value: function apply() { | |
| 232 | - $e.components.get("preview/styleguide").showStyleguidePreview(); | |
| 233 | - } | |
| 234 | - }]); | |
| 235 | - }($e.modules.CommandBase); | |
| 282 | +/***/ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js": | |
| 283 | +/*!*****************************************************************************!*\ | |
| 284 | + !*** ../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js ***! | |
| 285 | + \*****************************************************************************/ | |
| 286 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 236 | 287 | |
| 237 | -//#endregion | |
| 238 | -//#region modules/styleguide/assets/js/commands/global-typography.js | |
| 239 | - init_classCallCheck(); | |
| 240 | - init_createClass(); | |
| 241 | - init_possibleConstructorReturn(); | |
| 242 | - init_getPrototypeOf(); | |
| 243 | - init_inherits(); | |
| 244 | - function _callSuper$6(t, o, e) { | |
| 245 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 246 | - } | |
| 247 | - __name(_callSuper$6, "_callSuper"); | |
| 248 | - function _isNativeReflectConstruct$6() { | |
| 249 | - try { | |
| 250 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 251 | - } catch (t) {} | |
| 252 | - return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { | |
| 253 | - return !!t; | |
| 254 | - })(); | |
| 255 | - } | |
| 256 | - __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct"); | |
| 257 | - var GlobalTypography = /*#__PURE__*/ function(_$e$modules$CommandBa) { | |
| 258 | - function GlobalTypography() { | |
| 259 | - _classCallCheck(this, GlobalTypography); | |
| 260 | - return _callSuper$6(this, GlobalTypography, arguments); | |
| 261 | - } | |
| 262 | - _inherits(GlobalTypography, _$e$modules$CommandBa); | |
| 263 | - return _createClass(GlobalTypography, [{ | |
| 264 | - key: "apply", | |
| 265 | - value: function apply() { | |
| 266 | - $e.components.get("preview/styleguide").showStyleguidePreview(); | |
| 267 | - } | |
| 268 | - }]); | |
| 269 | - }($e.modules.CommandBase); | |
| 288 | +"use strict"; | |
| 270 | 289 | |
| 271 | -//#endregion | |
| 272 | -//#region modules/styleguide/assets/js/commands/hide.js | |
| 273 | - init_classCallCheck(); | |
| 274 | - init_createClass(); | |
| 275 | - init_possibleConstructorReturn(); | |
| 276 | - init_getPrototypeOf(); | |
| 277 | - init_inherits(); | |
| 278 | - function _callSuper$5(t, o, e) { | |
| 279 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 280 | - } | |
| 281 | - __name(_callSuper$5, "_callSuper"); | |
| 282 | - function _isNativeReflectConstruct$5() { | |
| 283 | - try { | |
| 284 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 285 | - } catch (t) {} | |
| 286 | - return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() { | |
| 287 | - return !!t; | |
| 288 | - })(); | |
| 289 | - } | |
| 290 | - __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct"); | |
| 291 | - var Hide = /*#__PURE__*/ function(_$e$modules$CommandBa) { | |
| 292 | - function Hide() { | |
| 293 | - _classCallCheck(this, Hide); | |
| 294 | - return _callSuper$5(this, Hide, arguments); | |
| 295 | - } | |
| 296 | - _inherits(Hide, _$e$modules$CommandBa); | |
| 297 | - return _createClass(Hide, [{ | |
| 298 | - key: "apply", | |
| 299 | - value: function apply() { | |
| 300 | - $e.components.get("preview/styleguide").hideStyleguidePreview(); | |
| 301 | - } | |
| 302 | - }]); | |
| 303 | - }($e.modules.CommandBase); | |
| 304 | 290 | |
| 305 | -//#endregion | |
| 306 | -//#region modules/styleguide/assets/js/commands/switcher-change.js | |
| 307 | - init_classCallCheck(); | |
| 308 | - init_createClass(); | |
| 309 | - init_possibleConstructorReturn(); | |
| 310 | - init_getPrototypeOf(); | |
| 311 | - init_inherits(); | |
| 312 | - function _callSuper$4(t, o, e) { | |
| 313 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 314 | - } | |
| 315 | - __name(_callSuper$4, "_callSuper"); | |
| 316 | - function _isNativeReflectConstruct$4() { | |
| 317 | - try { | |
| 318 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 319 | - } catch (t) {} | |
| 320 | - return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { | |
| 321 | - return !!t; | |
| 322 | - })(); | |
| 323 | - } | |
| 324 | - __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct"); | |
| 325 | - var SwitcherChange = /*#__PURE__*/ function(_$e$modules$CommandBa) { | |
| 326 | - function SwitcherChange() { | |
| 327 | - _classCallCheck(this, SwitcherChange); | |
| 328 | - return _callSuper$4(this, SwitcherChange, arguments); | |
| 329 | - } | |
| 330 | - _inherits(SwitcherChange, _$e$modules$CommandBa); | |
| 331 | - return _createClass(SwitcherChange, [{ | |
| 332 | - key: "validateArgs", | |
| 333 | - value: function validateArgs() { | |
| 334 | - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 335 | - this.requireArgumentType("name", "string", args); | |
| 336 | - this.requireArgumentType("value", "string", args); | |
| 337 | - } | |
| 338 | - }, { | |
| 339 | - key: "apply", | |
| 340 | - value: function apply(args) { | |
| 341 | - if (args.name.includes("enable_styleguide_preview")) $e.components.get("preview/styleguide").enableStyleguidePreview({ value: args.value }); | |
| 342 | - } | |
| 343 | - }]); | |
| 344 | - }($e.modules.CommandBase); | |
| 291 | +var EmptyView = __webpack_require__(/*! elementor-dynamic-tags/tag-controls-stack-empty */ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js"); | |
| 292 | +module.exports = elementorModules.editor.views.ControlsStack.extend({ | |
| 293 | + activeTab: 'content', | |
| 294 | + template: _.noop, | |
| 295 | + emptyView: EmptyView, | |
| 296 | + isEmpty: function isEmpty() { | |
| 297 | + // Ignore the section control | |
| 298 | + return this.collection.length < 2; | |
| 299 | + }, | |
| 300 | + childViewOptions: function childViewOptions() { | |
| 301 | + return { | |
| 302 | + container: this.options.container | |
| 303 | + }; | |
| 304 | + }, | |
| 305 | + getNamespaceArray: function getNamespaceArray() { | |
| 306 | + var currentPageView = elementor.getPanelView().getCurrentPageView(), | |
| 307 | + eventNamespace = currentPageView.getNamespaceArray(); | |
| 308 | + eventNamespace.push(currentPageView.activeSection); | |
| 309 | + eventNamespace.push(this.getOption('controlName')); | |
| 310 | + eventNamespace.push(this.getOption('name')); | |
| 311 | + return eventNamespace; | |
| 312 | + }, | |
| 313 | + onRenderTemplate: function onRenderTemplate() { | |
| 314 | + this.activateFirstSection(); | |
| 315 | + } | |
| 316 | +}); | |
| 345 | 317 | |
| 346 | -//#endregion | |
| 347 | -//#region modules/styleguide/assets/js/commands/index.js | |
| 348 | - var commands_exports = /* @__PURE__ */ __exportAll({ | |
| 349 | - Enable: () => Enable, | |
| 350 | - GlobalColors: () => GlobalColors, | |
| 351 | - GlobalTypography: () => GlobalTypography, | |
| 352 | - Hide: () => Hide, | |
| 353 | - SwitcherChange: () => SwitcherChange | |
| 354 | - }); | |
| 318 | +/***/ }), | |
| 355 | 319 | |
| 356 | -//#endregion | |
| 357 | -//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js | |
| 358 | - init_getPrototypeOf(); | |
| 359 | - function _superPropBase(t, o) { | |
| 360 | - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); | |
| 361 | - return t; | |
| 362 | - } | |
| 320 | +/***/ "../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js": | |
| 321 | +/*!*************************************************************************!*\ | |
| 322 | + !*** ../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js ***! | |
| 323 | + \*************************************************************************/ | |
| 324 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 363 | 325 | |
| 364 | -//#endregion | |
| 365 | -//#region node_modules/@babel/runtime/helpers/esm/get.js | |
| 366 | - function _get() { | |
| 367 | - return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { | |
| 368 | - var p = _superPropBase(e, t); | |
| 369 | - if (p) { | |
| 370 | - var n = Object.getOwnPropertyDescriptor(p, t); | |
| 371 | - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 372 | - } | |
| 373 | - }, _get.apply(null, arguments); | |
| 374 | - } | |
| 326 | +"use strict"; | |
| 375 | 327 | |
| 376 | -//#endregion | |
| 377 | -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | |
| 378 | - function _arrayWithHoles(r) { | |
| 379 | - if (Array.isArray(r)) return r; | |
| 380 | - } | |
| 381 | - var init_arrayWithHoles = __esmMin((() => {})); | |
| 382 | 328 | |
| 383 | -//#endregion | |
| 384 | -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js | |
| 385 | - function _iterableToArrayLimit(r, l) { | |
| 386 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 387 | - if (null != t) { | |
| 388 | - var e; | |
| 389 | - var n; | |
| 390 | - var i; | |
| 391 | - var u; | |
| 392 | - var a = []; | |
| 393 | - var f = !0; | |
| 394 | - var o = !1; | |
| 395 | - try { | |
| 396 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 397 | - if (Object(t) !== t) return; | |
| 398 | - f = !1; | |
| 399 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 400 | - } catch (r) { | |
| 401 | - o = !0, n = r; | |
| 402 | - } finally { | |
| 403 | - try { | |
| 404 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 405 | - } finally { | |
| 406 | - if (o) throw n; | |
| 407 | - } | |
| 408 | - } | |
| 409 | - return a; | |
| 410 | - } | |
| 411 | - } | |
| 412 | - var init_iterableToArrayLimit = __esmMin((() => {})); | |
| 329 | +var TagControlsStack = __webpack_require__(/*! elementor-dynamic-tags/tag-controls-stack */ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js"); | |
| 330 | +module.exports = Marionette.ItemView.extend({ | |
| 331 | + className: 'elementor-dynamic-cover e-input-style', | |
| 332 | + tagControlsStack: null, | |
| 333 | + templateHelpers: function templateHelpers() { | |
| 334 | + var helpers = {}; | |
| 335 | + if (this.model) { | |
| 336 | + helpers.controls = this.model.options.controls; | |
| 337 | + } | |
| 338 | + return helpers; | |
| 339 | + }, | |
| 340 | + ui: { | |
| 341 | + remove: '.elementor-dynamic-cover__remove' | |
| 342 | + }, | |
| 343 | + events: function events() { | |
| 344 | + var events = { | |
| 345 | + 'click @ui.remove': 'onRemoveClick' | |
| 346 | + }; | |
| 347 | + if (this.hasSettings()) { | |
| 348 | + events.click = 'onClick'; | |
| 349 | + } | |
| 350 | + return events; | |
| 351 | + }, | |
| 352 | + getTemplate: function getTemplate() { | |
| 353 | + var config = this.getTagConfig(), | |
| 354 | + templateFunction = Marionette.TemplateCache.get('#tmpl-elementor-control-dynamic-cover'), | |
| 355 | + renderedTemplate = Marionette.Renderer.render(templateFunction, { | |
| 356 | + hasSettings: this.hasSettings(), | |
| 357 | + isRemovable: !this.getOption('dynamicSettings').default, | |
| 358 | + title: config.title, | |
| 359 | + content: config.panel_template | |
| 360 | + }); | |
| 361 | + return Marionette.TemplateCache.prototype.compileTemplate(renderedTemplate.trim()); | |
| 362 | + }, | |
| 363 | + getTagConfig: function getTagConfig() { | |
| 364 | + return elementor.dynamicTags.getConfig('tags.' + this.getOption('name')); | |
| 365 | + }, | |
| 366 | + initSettingsPopup: function initSettingsPopup() { | |
| 367 | + var settingsPopupOptions = { | |
| 368 | + className: 'elementor-tag-settings-popup', | |
| 369 | + position: { | |
| 370 | + my: 'left top+5', | |
| 371 | + at: 'left bottom', | |
| 372 | + of: this.$el, | |
| 373 | + autoRefresh: true | |
| 374 | + }, | |
| 375 | + hide: { | |
| 376 | + ignore: '.select2-container' | |
| 377 | + } | |
| 378 | + }; | |
| 379 | + var settingsPopup = elementorCommon.dialogsManager.createWidget('buttons', settingsPopupOptions); | |
| 380 | + this.getSettingsPopup = function () { | |
| 381 | + return settingsPopup; | |
| 382 | + }; | |
| 383 | + }, | |
| 384 | + hasSettings: function hasSettings() { | |
| 385 | + return !!Object.values(this.getTagConfig().controls).length; | |
| 386 | + }, | |
| 387 | + showSettingsPopup: function showSettingsPopup() { | |
| 388 | + if (!this.tagControlsStack) { | |
| 389 | + this.initTagControlsStack(); | |
| 390 | + } | |
| 391 | + var settingsPopup = this.getSettingsPopup(); | |
| 392 | + if (settingsPopup.isVisible()) { | |
| 393 | + return; | |
| 394 | + } | |
| 395 | + settingsPopup.show(); | |
| 396 | + }, | |
| 397 | + initTagControlsStack: function initTagControlsStack() { | |
| 398 | + this.tagControlsStack = new TagControlsStack({ | |
| 399 | + model: this.model, | |
| 400 | + controls: this.model.controls, | |
| 401 | + name: this.options.name, | |
| 402 | + controlName: this.options.controlName, | |
| 403 | + container: this.options.container, | |
| 404 | + el: this.getSettingsPopup().getElements('message')[0] | |
| 405 | + }); | |
| 406 | + this.tagControlsStack.render(); | |
| 407 | + }, | |
| 408 | + initModel: function initModel() { | |
| 409 | + this.model = new elementorModules.editor.elements.models.BaseSettings(this.getOption('settings'), { | |
| 410 | + controls: this.getTagConfig().controls | |
| 411 | + }); | |
| 412 | + }, | |
| 413 | + initialize: function initialize() { | |
| 414 | + // The `model` should always be available. | |
| 415 | + this.initModel(); | |
| 416 | + if (!this.hasSettings()) { | |
| 417 | + return; | |
| 418 | + } | |
| 419 | + this.initSettingsPopup(); | |
| 420 | + this.listenTo(this.model, 'change', this.render); | |
| 421 | + }, | |
| 422 | + onClick: function onClick() { | |
| 423 | + this.showSettingsPopup(); | |
| 424 | + }, | |
| 425 | + onRemoveClick: function onRemoveClick(event) { | |
| 426 | + event.stopPropagation(); | |
| 427 | + this.destroy(); | |
| 428 | + this.trigger('remove'); | |
| 429 | + }, | |
| 430 | + onDestroy: function onDestroy() { | |
| 431 | + if (this.hasSettings()) { | |
| 432 | + this.getSettingsPopup().destroy(); | |
| 433 | + } | |
| 434 | + if (this.tagControlsStack) { | |
| 435 | + this.tagControlsStack.destroy(); | |
| 436 | + } | |
| 437 | + } | |
| 438 | +}); | |
| 413 | 439 | |
| 414 | -//#endregion | |
| 415 | -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js | |
| 416 | - function _arrayLikeToArray(r, a) { | |
| 417 | - (null == a || a > r.length) && (a = r.length); | |
| 418 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 419 | - return n; | |
| 420 | - } | |
| 421 | - var init_arrayLikeToArray = __esmMin((() => {})); | |
| 440 | +/***/ }), | |
| 422 | 441 | |
| 423 | -//#endregion | |
| 424 | -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js | |
| 425 | - function _unsupportedIterableToArray(r, a) { | |
| 426 | - if (r) { | |
| 427 | - if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 428 | - var t = {}.toString.call(r).slice(8, -1); | |
| 429 | - 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; | |
| 430 | - } | |
| 431 | - } | |
| 432 | - var init_unsupportedIterableToArray = __esmMin((() => { | |
| 433 | - init_arrayLikeToArray(); | |
| 434 | - })); | |
| 442 | +/***/ "../assets/dev/js/editor/components/validator/base.js": | |
| 443 | +/*!************************************************************!*\ | |
| 444 | + !*** ../assets/dev/js/editor/components/validator/base.js ***! | |
| 445 | + \************************************************************/ | |
| 446 | +/***/ ((module) => { | |
| 435 | 447 | |
| 436 | -//#endregion | |
| 437 | -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js | |
| 438 | - function _nonIterableRest() { | |
| 439 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 440 | - } | |
| 441 | - var init_nonIterableRest = __esmMin((() => {})); | |
| 448 | +"use strict"; | |
| 442 | 449 | |
| 443 | -//#endregion | |
| 444 | -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js | |
| 445 | - function _slicedToArray(r, e) { | |
| 446 | - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | |
| 447 | - } | |
| 448 | - var init_slicedToArray = __esmMin((() => { | |
| 449 | - init_arrayWithHoles(); | |
| 450 | - init_iterableToArrayLimit(); | |
| 451 | - init_unsupportedIterableToArray(); | |
| 452 | - init_nonIterableRest(); | |
| 453 | - })); | |
| 454 | 450 | |
| 455 | -//#endregion | |
| 456 | -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 457 | - function _defineProperty(e, r, t) { | |
| 458 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 459 | - value: t, | |
| 460 | - enumerable: !0, | |
| 461 | - configurable: !0, | |
| 462 | - writable: !0 | |
| 463 | - }) : e[r] = t, e; | |
| 464 | - } | |
| 465 | - var init_defineProperty = __esmMin((() => { | |
| 466 | - init_toPropertyKey(); | |
| 467 | - })); | |
| 451 | +module.exports = elementorModules.Module.extend({ | |
| 452 | + errors: [], | |
| 453 | + __construct: function __construct(settings) { | |
| 454 | + var customValidationMethod = settings.customValidationMethod; | |
| 455 | + if (customValidationMethod) { | |
| 456 | + this.validationMethod = customValidationMethod; | |
| 457 | + } | |
| 458 | + }, | |
| 459 | + getDefaultSettings: function getDefaultSettings() { | |
| 460 | + return { | |
| 461 | + validationTerms: {} | |
| 462 | + }; | |
| 463 | + }, | |
| 464 | + isValid: function isValid() { | |
| 465 | + var validationErrors = this.validationMethod.apply(this, arguments); | |
| 466 | + if (validationErrors.length) { | |
| 467 | + this.errors = validationErrors; | |
| 468 | + return false; | |
| 469 | + } | |
| 470 | + return true; | |
| 471 | + }, | |
| 472 | + validationMethod: function validationMethod(newValue) { | |
| 473 | + var validationTerms = this.getSettings('validationTerms'), | |
| 474 | + errors = []; | |
| 475 | + if (validationTerms.required) { | |
| 476 | + if (!('' + newValue).length) { | |
| 477 | + errors.push('Required value is empty'); | |
| 478 | + } | |
| 479 | + } | |
| 480 | + return errors; | |
| 481 | + } | |
| 482 | +}); | |
| 468 | 483 | |
| 469 | -//#endregion | |
| 470 | -//#region assets/dev/js/editor/components/validator/base.js | |
| 471 | - var require_base$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 472 | - module.exports = elementorModules.Module.extend({ | |
| 473 | - errors: [], | |
| 474 | - __construct: function __construct(settings) { | |
| 475 | - var customValidationMethod = settings.customValidationMethod; | |
| 476 | - if (customValidationMethod) this.validationMethod = customValidationMethod; | |
| 477 | - }, | |
| 478 | - getDefaultSettings: function getDefaultSettings() { | |
| 479 | - return { validationTerms: {} }; | |
| 480 | - }, | |
| 481 | - isValid: function isValid() { | |
| 482 | - var validationErrors = this.validationMethod.apply(this, arguments); | |
| 483 | - if (validationErrors.length) { | |
| 484 | - this.errors = validationErrors; | |
| 485 | - return false; | |
| 486 | - } | |
| 487 | - return true; | |
| 488 | - }, | |
| 489 | - validationMethod: function validationMethod(newValue) { | |
| 490 | - var validationTerms = this.getSettings("validationTerms"); | |
| 491 | - var errors = []; | |
| 492 | - if (validationTerms.required) { | |
| 493 | - if (!("" + newValue).length) errors.push("Required value is empty"); | |
| 494 | - } | |
| 495 | - return errors; | |
| 496 | - } | |
| 497 | - }); | |
| 498 | - })); | |
| 484 | +/***/ }), | |
| 499 | 485 | |
| 500 | -//#endregion | |
| 501 | -//#region assets/dev/js/editor/components/validator/number.js | |
| 502 | - var require_number = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 503 | - var Validator = require_base$1(); | |
| 504 | - module.exports = Validator.extend({ validationMethod: function validationMethod(newValue) { | |
| 505 | - var validationTerms = this.getSettings("validationTerms"); | |
| 506 | - var errors = []; | |
| 507 | - if (_.isFinite(newValue)) { | |
| 508 | - if (void 0 !== validationTerms.min && newValue < validationTerms.min) errors.push("Value is less than minimum"); | |
| 509 | - if (void 0 !== validationTerms.max && newValue > validationTerms.max) errors.push("Value is greater than maximum"); | |
| 510 | - } | |
| 511 | - return errors; | |
| 512 | - } }); | |
| 513 | - })); | |
| 486 | +/***/ "../assets/dev/js/editor/components/validator/breakpoint.js": | |
| 487 | +/*!******************************************************************!*\ | |
| 488 | + !*** ../assets/dev/js/editor/components/validator/breakpoint.js ***! | |
| 489 | + \******************************************************************/ | |
| 490 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 514 | 491 | |
| 515 | -//#endregion | |
| 516 | -//#region assets/dev/js/editor/components/validator/breakpoint.js | |
| 517 | - function _callSuper$3(t, o, e) { | |
| 518 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 519 | - } | |
| 520 | - function _isNativeReflectConstruct$3() { | |
| 521 | - try { | |
| 522 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 523 | - } catch (t) {} | |
| 524 | - return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { | |
| 525 | - return !!t; | |
| 526 | - })(); | |
| 527 | - } | |
| 528 | - var NumberValidator, BreakpointValidator; | |
| 529 | - var init_breakpoint = __esmMin((() => { | |
| 530 | - init_classCallCheck(); | |
| 531 | - init_createClass(); | |
| 532 | - init_possibleConstructorReturn(); | |
| 533 | - init_getPrototypeOf(); | |
| 534 | - init_inherits(); | |
| 535 | - __name(_callSuper$3, "_callSuper"); | |
| 536 | - __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct"); | |
| 537 | - NumberValidator = require_number(); | |
| 538 | - BreakpointValidator = /*#__PURE__*/ function(_NumberValidator) { | |
| 539 | - function BreakpointValidator() { | |
| 540 | - _classCallCheck(this, BreakpointValidator); | |
| 541 | - return _callSuper$3(this, BreakpointValidator, arguments); | |
| 542 | - } | |
| 543 | - _inherits(BreakpointValidator, _NumberValidator); | |
| 544 | - return _createClass(BreakpointValidator, [ | |
| 545 | - { | |
| 546 | - key: "getDefaultSettings", | |
| 547 | - value: function getDefaultSettings() { | |
| 548 | - return { validationTerms: { max: 5120 } }; | |
| 549 | - } | |
| 550 | - }, | |
| 551 | - { | |
| 552 | - key: "getPanelActiveBreakpoints", | |
| 553 | - value: function getPanelActiveBreakpoints() { | |
| 554 | - var panelBreakpoints = elementor.documents.currentDocument.config.settings.settings.active_breakpoints.map(function(breakpointName) { | |
| 555 | - return breakpointName.replace("viewport_", ""); | |
| 556 | - }); | |
| 557 | - var panelActiveBreakpoints = {}; | |
| 558 | - panelBreakpoints.forEach(function(breakpointName) { | |
| 559 | - panelActiveBreakpoints[breakpointName] = elementorFrontend.config.responsive.breakpoints[breakpointName]; | |
| 560 | - }); | |
| 561 | - return panelActiveBreakpoints; | |
| 562 | - } | |
| 563 | - }, | |
| 564 | - { | |
| 565 | - key: "initBreakpointProperties", | |
| 566 | - value: function initBreakpointProperties() { | |
| 567 | - var _activeBreakpoints$br; | |
| 568 | - var _activeBreakpoints$br2; | |
| 569 | - var validationTerms = this.getSettings("validationTerms"); | |
| 570 | - var activeBreakpoints = this.getPanelActiveBreakpoints(); | |
| 571 | - var breakpointKeys = Object.keys(activeBreakpoints); | |
| 572 | - this.breakpointIndex = breakpointKeys.indexOf(validationTerms.breakpointName); | |
| 573 | - this.topBreakpoint = (_activeBreakpoints$br = activeBreakpoints[breakpointKeys[this.breakpointIndex + 1]]) === null || _activeBreakpoints$br === void 0 ? void 0 : _activeBreakpoints$br.value; | |
| 574 | - this.bottomBreakpoint = (_activeBreakpoints$br2 = activeBreakpoints[breakpointKeys[this.breakpointIndex - 1]]) === null || _activeBreakpoints$br2 === void 0 ? void 0 : _activeBreakpoints$br2.value; | |
| 575 | - } | |
| 576 | - }, | |
| 577 | - { | |
| 578 | - key: "validationMethod", | |
| 579 | - value: function validationMethod(newValue) { | |
| 580 | - var validationTerms = this.getSettings("validationTerms"); | |
| 581 | - var errors = NumberValidator.prototype.validationMethod.call(this, newValue); | |
| 582 | - if (_.isFinite(newValue) || "" === newValue) { | |
| 583 | - if (!this.validateMinMaxForBreakpoint(newValue, validationTerms)) errors.push("Value is not between the breakpoints above or under the edited breakpoint"); | |
| 584 | - } | |
| 585 | - return errors; | |
| 586 | - } | |
| 587 | - }, | |
| 588 | - { | |
| 589 | - key: "validateMinMaxForBreakpoint", | |
| 590 | - value: function validateMinMaxForBreakpoint(newValue, validationTerms) { | |
| 591 | - var breakpointDefaultValue = elementorFrontend.config.responsive.breakpoints[validationTerms.breakpointName].default_value; | |
| 592 | - var isValid = true; | |
| 593 | - this.initBreakpointProperties(); | |
| 594 | - if ("mobile" === validationTerms.breakpointName && 320 === this.bottomBreakpoint) this.bottomBreakpoint -= 1; | |
| 595 | - if (this.bottomBreakpoint) { | |
| 596 | - if ("" !== newValue && newValue <= this.bottomBreakpoint) isValid = false; | |
| 597 | - if ("" === newValue && breakpointDefaultValue <= this.bottomBreakpoint) isValid = false; | |
| 598 | - } | |
| 599 | - if (this.topBreakpoint) { | |
| 600 | - if ("" !== newValue && newValue >= this.topBreakpoint) isValid = false; | |
| 601 | - if ("" === newValue && breakpointDefaultValue >= this.topBreakpoint) isValid = false; | |
| 602 | - } | |
| 603 | - return isValid; | |
| 604 | - } | |
| 605 | - } | |
| 606 | - ]); | |
| 607 | - }(NumberValidator); | |
| 608 | - })); | |
| 492 | +"use strict"; | |
| 609 | 493 | |
| 610 | -//#endregion | |
| 611 | -//#region assets/dev/js/editor/controls/base.js | |
| 612 | - var require_base = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 613 | - init_defineProperty(); | |
| 614 | - function ownKeys(e, r) { | |
| 615 | - var t = Object.keys(e); | |
| 616 | - if (Object.getOwnPropertySymbols) { | |
| 617 | - var o = Object.getOwnPropertySymbols(e); | |
| 618 | - r && (o = o.filter(function(r) { | |
| 619 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 620 | - })), t.push.apply(t, o); | |
| 621 | - } | |
| 622 | - return t; | |
| 623 | - } | |
| 624 | - function _objectSpread(e) { | |
| 625 | - for (var r = 1; r < arguments.length; r++) { | |
| 626 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 627 | - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { | |
| 628 | - _defineProperty(e, r, t[r]); | |
| 629 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { | |
| 630 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 631 | - }); | |
| 632 | - } | |
| 633 | - return e; | |
| 634 | - } | |
| 635 | - var ControlBaseView = Marionette.CompositeView.extend({ | |
| 636 | - ui: function ui() { | |
| 637 | - return { controlTitle: ".elementor-control-title" }; | |
| 638 | - }, | |
| 639 | - behaviors: function behaviors() { | |
| 640 | - return elementor.hooks.applyFilters("controls/base/behaviors", {}, this); | |
| 641 | - }, | |
| 642 | - getBehavior: function getBehavior(name) { | |
| 643 | - return this._behaviors[Object.keys(this.behaviors()).indexOf(name)]; | |
| 644 | - }, | |
| 645 | - className: function className() { | |
| 646 | - var classes = "elementor-control elementor-control-" + this.model.get("name") + " elementor-control-type-" + this.model.get("type"); | |
| 647 | - var modelClasses = this.model.get("classes"); | |
| 648 | - var responsive = this.model.get("responsive"); | |
| 649 | - if (!_.isEmpty(modelClasses)) classes += " " + modelClasses; | |
| 650 | - if (!_.isEmpty(responsive)) { | |
| 651 | - var responsiveControlName = responsive.max || responsive.min; | |
| 652 | - classes += " elementor-control-responsive-" + responsiveControlName; | |
| 653 | - } | |
| 654 | - return classes; | |
| 655 | - }, | |
| 656 | - templateHelpers: function templateHelpers() { | |
| 657 | - var controlData = { _cid: this.model.cid }; | |
| 658 | - return { | |
| 659 | - view: this, | |
| 660 | - data: _.extend({}, this.model.toJSON(), controlData) | |
| 661 | - }; | |
| 662 | - }, | |
| 663 | - getTemplate: function getTemplate() { | |
| 664 | - return Marionette.TemplateCache.get("#tmpl-elementor-control-" + this.model.get("type") + "-content"); | |
| 665 | - }, | |
| 666 | - initialize: function initialize(options) { | |
| 667 | - var label = this.model.get("label"); | |
| 668 | - Object.defineProperty(this, "container", { get: function get() { | |
| 669 | - if (!options.container) { | |
| 670 | - var settingsModel = options.elementSettingsModel; | |
| 671 | - var view = $e.components.get("document").utils.findViewById(settingsModel.id); | |
| 672 | - if (view && view.getContainer) options.container = view.getContainer(); | |
| 673 | - else { | |
| 674 | - if (!settingsModel.id) settingsModel.id = "bc-" + elementorCommon.helpers.getUniqueId(); | |
| 675 | - options.container = new elementorModules.editor.Container({ | |
| 676 | - type: "bc-container", | |
| 677 | - id: settingsModel.id, | |
| 678 | - model: settingsModel, | |
| 679 | - settings: settingsModel, | |
| 680 | - label, | |
| 681 | - view: false, | |
| 682 | - parent: false, | |
| 683 | - renderer: false, | |
| 684 | - controls: settingsModel.options.controls | |
| 685 | - }); | |
| 686 | - } | |
| 687 | - } | |
| 688 | - return options.container; | |
| 689 | - } }); | |
| 690 | - Object.defineProperty(this, "elementSettingsModel", { get: function get() { | |
| 691 | - elementorDevTools.deprecation.deprecated("elementSettingsModel", "2.8.0", "container.settings"); | |
| 692 | - return options.container ? options.container.settings : options.elementSettingsModel; | |
| 693 | - } }); | |
| 694 | - var controlType = this.model.get("type"); | |
| 695 | - var controlSettings = jQuery.extend(true, {}, elementor.config.controls[controlType], this.model.attributes); | |
| 696 | - this.model.set(controlSettings); | |
| 697 | - var settings = this.container ? this.container.settings : this.elementSettingsModel; | |
| 698 | - this.listenTo(settings, "change", this.onAfterChange); | |
| 699 | - if (this.model.attributes.responsive) { | |
| 700 | - this.onDeviceModeChange = this.onDeviceModeChange.bind(this); | |
| 701 | - elementor.listenTo(elementor.channels.deviceMode, "change", this.onDeviceModeChange); | |
| 702 | - } | |
| 703 | - }, | |
| 704 | - onDestroy: function onDestroy() { | |
| 705 | - elementor.stopListening(elementor.channels.deviceMode, "change", this.onDeviceModeChange); | |
| 706 | - }, | |
| 707 | - onDeviceModeChange: function onDeviceModeChange() { | |
| 708 | - this.toggleControlVisibility(); | |
| 709 | - }, | |
| 710 | - onAfterChange: function onAfterChange() { | |
| 711 | - this.toggleControlVisibility(); | |
| 712 | - }, | |
| 713 | - toggleControlVisibility: function toggleControlVisibility() { | |
| 714 | - var settings = this.container ? this.container.settings : this.elementSettingsModel; | |
| 715 | - var isVisible = elementor.helpers.isActiveControl(this.model, settings.attributes, settings.controls); | |
| 716 | - this.$el.toggleClass("elementor-hidden-control", !isVisible); | |
| 717 | - elementor.getPanelView().updateScrollbar(); | |
| 718 | - }, | |
| 719 | - onRender: function onRender() { | |
| 720 | - var layoutType = this.model.get("label_block") ? "block" : "inline"; | |
| 721 | - var showLabel = this.model.get("show_label"); | |
| 722 | - var elClasses = "elementor-label-" + layoutType; | |
| 723 | - elClasses += " elementor-control-separator-" + this.model.get("separator"); | |
| 724 | - if (!showLabel) elClasses += " elementor-control-hidden-label"; | |
| 725 | - this.$el.addClass(elClasses); | |
| 726 | - this.toggleControlVisibility(); | |
| 727 | - }, | |
| 728 | - reRoute: function reRoute(controlActive) { | |
| 729 | - $e.route($e.routes.getCurrent("panel"), this.getControlInRouteArgs(controlActive ? this.getControlPath() : ""), { history: false }); | |
| 730 | - }, | |
| 731 | - getControlInRouteArgs: function getControlInRouteArgs(path) { | |
| 732 | - return _objectSpread(_objectSpread({}, $e.routes.getCurrentArgs("panel")), {}, { activeControl: path }); | |
| 733 | - }, | |
| 734 | - getControlPath: function getControlPath() { | |
| 735 | - var controlPath = this.model.get("name"); | |
| 736 | - var parent = this._parent; | |
| 737 | - while (!parent.$el.hasClass("elementor-controls-stack")) { | |
| 738 | - controlPath = (parent.model.get("name") || parent.model.get("_id")) + "/" + controlPath; | |
| 739 | - parent = parent._parent; | |
| 740 | - } | |
| 741 | - return controlPath; | |
| 742 | - } | |
| 743 | - }); | |
| 744 | - module.exports = ControlBaseView; | |
| 745 | - })); | |
| 746 | 494 | |
| 747 | -//#endregion | |
| 748 | -//#region assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js | |
| 749 | - var require_tag_controls_stack_empty = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 750 | - module.exports = Marionette.ItemView.extend({ | |
| 751 | - className: "elementor-tag-controls-stack-empty", | |
| 752 | - template: "#tmpl-elementor-tag-controls-stack-empty" | |
| 753 | - }); | |
| 754 | - })); | |
| 495 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 496 | +Object.defineProperty(exports, "__esModule", ({ | |
| 497 | + value: true | |
| 498 | +})); | |
| 499 | +exports["default"] = void 0; | |
| 500 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 501 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 502 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 503 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 504 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 505 | +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); }; } | |
| 506 | +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; } } | |
| 507 | +var NumberValidator = __webpack_require__(/*! elementor-validator/number */ "../assets/dev/js/editor/components/validator/number.js"); | |
| 508 | +var BreakpointValidator = /*#__PURE__*/function (_NumberValidator) { | |
| 509 | + (0, _inherits2.default)(BreakpointValidator, _NumberValidator); | |
| 510 | + var _super = _createSuper(BreakpointValidator); | |
| 511 | + function BreakpointValidator() { | |
| 512 | + (0, _classCallCheck2.default)(this, BreakpointValidator); | |
| 513 | + return _super.apply(this, arguments); | |
| 514 | + } | |
| 515 | + (0, _createClass2.default)(BreakpointValidator, [{ | |
| 516 | + key: "getDefaultSettings", | |
| 517 | + value: function getDefaultSettings() { | |
| 518 | + return { | |
| 519 | + validationTerms: { | |
| 520 | + // Max width we allow in general | |
| 521 | + max: 5120 | |
| 522 | + } | |
| 523 | + }; | |
| 524 | + } | |
| 755 | 525 | |
| 756 | -//#endregion | |
| 757 | -//#region assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js | |
| 758 | - var require_tag_controls_stack = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 759 | - var EmptyView = require_tag_controls_stack_empty(); | |
| 760 | - module.exports = elementorModules.editor.views.ControlsStack.extend({ | |
| 761 | - activeTab: "content", | |
| 762 | - template: _.noop, | |
| 763 | - emptyView: EmptyView, | |
| 764 | - isEmpty: function isEmpty() { | |
| 765 | - return this.collection.length < 2; | |
| 766 | - }, | |
| 767 | - childViewOptions: function childViewOptions() { | |
| 768 | - return { container: this.options.container }; | |
| 769 | - }, | |
| 770 | - getNamespaceArray: function getNamespaceArray() { | |
| 771 | - var currentPageView = elementor.getPanelView().getCurrentPageView(); | |
| 772 | - var eventNamespace = currentPageView.getNamespaceArray(); | |
| 773 | - eventNamespace.push(currentPageView.activeSection); | |
| 774 | - eventNamespace.push(this.getOption("controlName")); | |
| 775 | - eventNamespace.push(this.getOption("name")); | |
| 776 | - return eventNamespace; | |
| 777 | - }, | |
| 778 | - onRenderTemplate: function onRenderTemplate() { | |
| 779 | - this.activateFirstSection(); | |
| 780 | - } | |
| 781 | - }); | |
| 782 | - })); | |
| 526 | + /** | |
| 527 | + * Get Panel Active Breakpoints | |
| 528 | + * | |
| 529 | + * Since the active kit used in the Site Settings panel could be a draft, we need to use the panel's active | |
| 530 | + * breakpoints settings and not the elementorFrontend.config values (which come from the DB). | |
| 531 | + * | |
| 532 | + * @return {*} Object | |
| 533 | + */ | |
| 534 | + }, { | |
| 535 | + key: "getPanelActiveBreakpoints", | |
| 536 | + value: function getPanelActiveBreakpoints() { | |
| 537 | + var panelBreakpoints = elementor.documents.currentDocument.config.settings.settings.active_breakpoints.map(function (breakpointName) { | |
| 538 | + return breakpointName.replace('viewport_', ''); | |
| 539 | + }), | |
| 540 | + panelActiveBreakpoints = {}; | |
| 541 | + panelBreakpoints.forEach(function (breakpointName) { | |
| 542 | + panelActiveBreakpoints[breakpointName] = elementorFrontend.config.responsive.breakpoints[breakpointName]; | |
| 543 | + }); | |
| 544 | + return panelActiveBreakpoints; | |
| 545 | + } | |
| 546 | + }, { | |
| 547 | + key: "initBreakpointProperties", | |
| 548 | + value: function initBreakpointProperties() { | |
| 549 | + var _activeBreakpoints$br, _activeBreakpoints$br2; | |
| 550 | + var validationTerms = this.getSettings('validationTerms'), | |
| 551 | + activeBreakpoints = this.getPanelActiveBreakpoints(), | |
| 552 | + breakpointKeys = Object.keys(activeBreakpoints); | |
| 553 | + this.breakpointIndex = breakpointKeys.indexOf(validationTerms.breakpointName); | |
| 554 | + this.topBreakpoint = (_activeBreakpoints$br = activeBreakpoints[breakpointKeys[this.breakpointIndex + 1]]) === null || _activeBreakpoints$br === void 0 ? void 0 : _activeBreakpoints$br.value; | |
| 555 | + this.bottomBreakpoint = (_activeBreakpoints$br2 = activeBreakpoints[breakpointKeys[this.breakpointIndex - 1]]) === null || _activeBreakpoints$br2 === void 0 ? void 0 : _activeBreakpoints$br2.value; | |
| 556 | + } | |
| 557 | + }, { | |
| 558 | + key: "validationMethod", | |
| 559 | + value: function validationMethod(newValue) { | |
| 560 | + var validationTerms = this.getSettings('validationTerms'), | |
| 561 | + errors = NumberValidator.prototype.validationMethod.call(this, newValue); | |
| 783 | 562 | |
| 784 | -//#endregion | |
| 785 | -//#region assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js | |
| 786 | - var require_tag_panel_view = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 787 | - var TagControlsStack = require_tag_controls_stack(); | |
| 788 | - module.exports = Marionette.ItemView.extend({ | |
| 789 | - className: "elementor-dynamic-cover e-input-style", | |
| 790 | - tagControlsStack: null, | |
| 791 | - templateHelpers: function templateHelpers() { | |
| 792 | - var helpers = {}; | |
| 793 | - if (this.model) helpers.controls = this.model.options.controls; | |
| 794 | - return helpers; | |
| 795 | - }, | |
| 796 | - ui: { remove: ".elementor-dynamic-cover__remove" }, | |
| 797 | - events: function events() { | |
| 798 | - var events = { "click @ui.remove": "onRemoveClick" }; | |
| 799 | - if (this.hasSettings()) events.click = "onClick"; | |
| 800 | - return events; | |
| 801 | - }, | |
| 802 | - getTemplate: function getTemplate() { | |
| 803 | - var config = this.getTagConfig(); | |
| 804 | - var templateFunction = Marionette.TemplateCache.get("#tmpl-elementor-control-dynamic-cover"); | |
| 805 | - var renderedTemplate = Marionette.Renderer.render(templateFunction, { | |
| 806 | - hasSettings: this.hasSettings(), | |
| 807 | - isRemovable: !this.getOption("dynamicSettings").default, | |
| 808 | - title: config.title, | |
| 809 | - content: config.panel_template | |
| 810 | - }); | |
| 811 | - return Marionette.TemplateCache.prototype.compileTemplate(renderedTemplate.trim()); | |
| 812 | - }, | |
| 813 | - getTagConfig: function getTagConfig() { | |
| 814 | - return elementor.dynamicTags.getConfig("tags." + this.getOption("name")); | |
| 815 | - }, | |
| 816 | - initSettingsPopup: function initSettingsPopup() { | |
| 817 | - var settingsPopupOptions = { | |
| 818 | - className: "elementor-tag-settings-popup", | |
| 819 | - position: { | |
| 820 | - my: "left top+5", | |
| 821 | - at: "left bottom", | |
| 822 | - of: this.$el, | |
| 823 | - autoRefresh: true | |
| 824 | - }, | |
| 825 | - hide: { ignore: ".select2-container" } | |
| 826 | - }; | |
| 827 | - var settingsPopup = elementorCommon.dialogsManager.createWidget("buttons", settingsPopupOptions); | |
| 828 | - this.getSettingsPopup = function() { | |
| 829 | - return settingsPopup; | |
| 830 | - }; | |
| 831 | - }, | |
| 832 | - hasSettings: function hasSettings() { | |
| 833 | - return !!Object.values(this.getTagConfig().controls).length; | |
| 834 | - }, | |
| 835 | - showSettingsPopup: function showSettingsPopup() { | |
| 836 | - if (!this.tagControlsStack) this.initTagControlsStack(); | |
| 837 | - var settingsPopup = this.getSettingsPopup(); | |
| 838 | - if (settingsPopup.isVisible()) return; | |
| 839 | - settingsPopup.show(); | |
| 840 | - }, | |
| 841 | - initTagControlsStack: function initTagControlsStack() { | |
| 842 | - this.tagControlsStack = new TagControlsStack({ | |
| 843 | - model: this.model, | |
| 844 | - controls: this.model.controls, | |
| 845 | - name: this.options.name, | |
| 846 | - controlName: this.options.controlName, | |
| 847 | - container: this.options.container, | |
| 848 | - el: this.getSettingsPopup().getElements("message")[0] | |
| 849 | - }); | |
| 850 | - this.tagControlsStack.render(); | |
| 851 | - }, | |
| 852 | - initModel: function initModel() { | |
| 853 | - this.model = new elementorModules.editor.elements.models.BaseSettings(this.getOption("settings"), { controls: this.getTagConfig().controls }); | |
| 854 | - }, | |
| 855 | - initialize: function initialize() { | |
| 856 | - this.initModel(); | |
| 857 | - if (!this.hasSettings()) return; | |
| 858 | - this.initSettingsPopup(); | |
| 859 | - this.listenTo(this.model, "change", this.render); | |
| 860 | - }, | |
| 861 | - onClick: function onClick() { | |
| 862 | - this.showSettingsPopup(); | |
| 863 | - }, | |
| 864 | - onRemoveClick: function onRemoveClick(event) { | |
| 865 | - event.stopPropagation(); | |
| 866 | - this.destroy(); | |
| 867 | - this.trigger("remove"); | |
| 868 | - }, | |
| 869 | - onDestroy: function onDestroy() { | |
| 870 | - if (this.hasSettings()) this.getSettingsPopup().destroy(); | |
| 871 | - if (this.tagControlsStack) this.tagControlsStack.destroy(); | |
| 872 | - } | |
| 873 | - }); | |
| 874 | - })); | |
| 563 | + // Validate both numeric and empty values, since breakpoints utilize default values when empty. | |
| 564 | + if (_.isFinite(newValue) || '' === newValue) { | |
| 565 | + if (!this.validateMinMaxForBreakpoint(newValue, validationTerms)) { | |
| 566 | + errors.push('Value is not between the breakpoints above or under the edited breakpoint'); | |
| 567 | + } | |
| 568 | + } | |
| 569 | + return errors; | |
| 570 | + } | |
| 571 | + }, { | |
| 572 | + key: "validateMinMaxForBreakpoint", | |
| 573 | + value: function validateMinMaxForBreakpoint(newValue, validationTerms) { | |
| 574 | + var breakpointDefaultValue = elementorFrontend.config.responsive.breakpoints[validationTerms.breakpointName].default_value; | |
| 575 | + var isValid = true; | |
| 576 | + this.initBreakpointProperties(); | |
| 875 | 577 | |
| 876 | -//#endregion | |
| 877 | -//#region assets/dev/js/editor/components/dynamic-tags/control-behavior.js | |
| 878 | - var require_control_behavior = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 879 | - init_defineProperty(); | |
| 880 | - var TagPanelView = require_tag_panel_view(); | |
| 881 | - module.exports = Marionette.Behavior.extend({ | |
| 882 | - tagView: null, | |
| 883 | - listenerAttached: false, | |
| 884 | - initialize: function initialize() { | |
| 885 | - if (!this.listenerAttached) { | |
| 886 | - this.listenTo(this.view.options.container.settings, "change:external:__dynamic__", this.onAfterExternalChange); | |
| 887 | - this.listenerAttached = true; | |
| 888 | - } | |
| 889 | - }, | |
| 890 | - shouldRenderTools: function shouldRenderTools() { | |
| 891 | - if (this.getOption("dynamicSettings").default) return false; | |
| 892 | - var isFeatureAvailableToUser = elementor.helpers.hasPro() && !elementor.helpers.hasProAndNotConnected(); | |
| 893 | - var hasTags = this.getOption("tags").length > 0; | |
| 894 | - return !isFeatureAvailableToUser || hasTags; | |
| 895 | - }, | |
| 896 | - renderTools: function renderTools() { | |
| 897 | - var _this = this; | |
| 898 | - if (!this.shouldRenderTools()) return; | |
| 899 | - var $dynamicSwitcher = jQuery(Marionette.Renderer.render("#tmpl-elementor-control-dynamic-switcher")); | |
| 900 | - $dynamicSwitcher.on("click", function(event) { | |
| 901 | - return _this.onDynamicSwitcherClick(event); | |
| 902 | - }); | |
| 903 | - this.$el.find(".elementor-control-dynamic-switcher-wrapper").append($dynamicSwitcher); | |
| 904 | - this.ui.dynamicSwitcher = $dynamicSwitcher; | |
| 905 | - if ("color" === this.view.model.get("type")) if (this.view.colorPicker) this.moveDynamicSwitcherToColorPicker(); | |
| 906 | - else setTimeout(function() { | |
| 907 | - return _this.moveDynamicSwitcherToColorPicker(); | |
| 908 | - }); | |
| 909 | - this.ui.dynamicSwitcher.tipsy({ | |
| 910 | - title: function title() { | |
| 911 | - return this.getAttribute("data-tooltip"); | |
| 912 | - }, | |
| 913 | - gravity: "s" | |
| 914 | - }); | |
| 915 | - }, | |
| 916 | - moveDynamicSwitcherToColorPicker: function moveDynamicSwitcherToColorPicker() { | |
| 917 | - var $colorPickerToolsContainer = this.view.colorPicker.$pickerToolsContainer; | |
| 918 | - this.ui.dynamicSwitcher.removeClass("elementor-control-unit-1").addClass("e-control-tool"); | |
| 919 | - var $eyedropper = $colorPickerToolsContainer.find(".elementor-control-element-color-picker"); | |
| 920 | - if ($eyedropper.length) this.ui.dynamicSwitcher.insertBefore($eyedropper); | |
| 921 | - else $colorPickerToolsContainer.append(this.ui.dynamicSwitcher); | |
| 922 | - }, | |
| 923 | - toggleDynamicClass: function toggleDynamicClass() { | |
| 924 | - this.$el.toggleClass("elementor-control-dynamic-value", this.isDynamicMode()); | |
| 925 | - }, | |
| 926 | - isDynamicMode: function isDynamicMode() { | |
| 927 | - var dynamicSettings = this.view.container.settings.get("__dynamic__"); | |
| 928 | - return !!(dynamicSettings && dynamicSettings[this.view.model.get("name")]); | |
| 929 | - }, | |
| 930 | - createTagsList: function createTagsList() { | |
| 931 | - var tags = _.groupBy(this.getOption("tags"), "group"); | |
| 932 | - var groups = elementor.dynamicTags.getConfig("groups"); | |
| 933 | - var $tagsList = this.ui.tagsList = jQuery("<div>", { class: "elementor-tags-list" }); | |
| 934 | - var $tagsListInner = jQuery("<div>", { class: "elementor-tags-list__inner" }); | |
| 935 | - $tagsList.append($tagsListInner); | |
| 936 | - jQuery.each(groups, function(groupName) { | |
| 937 | - var groupTags = tags[groupName]; | |
| 938 | - if (!groupTags) return; | |
| 939 | - var group = this; | |
| 940 | - var $groupTitle = jQuery("<div>", { class: "elementor-tags-list__group-title" }).text(group.title); | |
| 941 | - $tagsListInner.append($groupTitle); | |
| 942 | - groupTags.forEach(function(tag) { | |
| 943 | - var $tag = jQuery("<div>", { class: "elementor-tags-list__item" }); | |
| 944 | - $tag.text(tag.title).attr("data-tag-name", tag.name); | |
| 945 | - $tagsListInner.append($tag); | |
| 946 | - }); | |
| 947 | - }); | |
| 948 | - if (!elementor.helpers.hasPro() && Object.keys(tags).length) { | |
| 949 | - var proTeaser = Marionette.Renderer.render("#tmpl-elementor-dynamic-tags-promo", { promotionUrl: elementor.config.dynamicPromotionURL.replace("%s", this.view.model.get("name")) }); | |
| 950 | - $tagsListInner.append(proTeaser); | |
| 951 | - } | |
| 952 | - $tagsListInner.on("click", ".elementor-tags-list__item", this.onTagsListItemClick.bind(this)); | |
| 953 | - elementorCommon.elements.$body.append($tagsList); | |
| 954 | - }, | |
| 955 | - getTagsList: function getTagsList() { | |
| 956 | - if (!this.ui.tagsList) this.createTagsList(); | |
| 957 | - return this.ui.tagsList; | |
| 958 | - }, | |
| 959 | - toggleTagsList: function toggleTagsList() { | |
| 960 | - var $tagsList = this.getTagsList(); | |
| 961 | - if ($tagsList.is(":visible")) { | |
| 962 | - $tagsList.hide(); | |
| 963 | - return; | |
| 964 | - } | |
| 965 | - var direction = elementorCommon.config.isRTL ? "left" : "right"; | |
| 966 | - $tagsList.show().position({ | |
| 967 | - my: "".concat(direction, " top"), | |
| 968 | - at: "".concat(direction, " bottom+5"), | |
| 969 | - of: this.ui.dynamicSwitcher | |
| 970 | - }); | |
| 971 | - }, | |
| 972 | - setTagView: function setTagView(id, name, settings) { | |
| 973 | - if (this.tagView) this.tagView.destroy(); | |
| 974 | - var tagView = this.tagView = new TagPanelView({ | |
| 975 | - id, | |
| 976 | - name, | |
| 977 | - settings, | |
| 978 | - controlName: this.view.model.get("name"), | |
| 979 | - dynamicSettings: this.getOption("dynamicSettings") | |
| 980 | - }); | |
| 981 | - var elementContainer = this.view.options.container; | |
| 982 | - var tagViewLabel = elementContainer.controls[tagView.options.controlName].label; | |
| 983 | - tagView.options.container = new elementorModules.editor.Container({ | |
| 984 | - type: "dynamic", | |
| 985 | - id, | |
| 986 | - model: tagView.model, | |
| 987 | - settings: tagView.model, | |
| 988 | - view: tagView, | |
| 989 | - parent: elementContainer, | |
| 990 | - label: elementContainer.label + " " + tagViewLabel, | |
| 991 | - controls: tagView.model.options.controls, | |
| 992 | - renderer: elementContainer | |
| 993 | - }); | |
| 994 | - tagView.render(); | |
| 995 | - this.$el.find(".elementor-control-tag-area").after(tagView.el); | |
| 996 | - this.listenTo(tagView, "remove", this.onTagViewRemove.bind(this)); | |
| 997 | - }, | |
| 998 | - setDefaultTagView: function setDefaultTagView() { | |
| 999 | - var tagData = elementor.dynamicTags.tagTextToTagData(this.getDynamicValue()); | |
| 1000 | - this.setTagView(tagData.id, tagData.name, tagData.settings); | |
| 1001 | - }, | |
| 1002 | - tagViewToTagText: function tagViewToTagText() { | |
| 1003 | - var tagView = this.tagView; | |
| 1004 | - return elementor.dynamicTags.tagDataToTagText(tagView.getOption("id"), tagView.getOption("name"), tagView.model); | |
| 1005 | - }, | |
| 1006 | - getDynamicValue: function getDynamicValue() { | |
| 1007 | - return this.view.container.dynamic.get(this.view.model.get("name")); | |
| 1008 | - }, | |
| 1009 | - destroyTagView: function destroyTagView() { | |
| 1010 | - if (this.tagView) { | |
| 1011 | - this.tagView.destroy(); | |
| 1012 | - this.tagView = null; | |
| 1013 | - } | |
| 1014 | - }, | |
| 1015 | - showPromotion: function showPromotion() { | |
| 1016 | - var hasProAndNotConnected = elementor.helpers.hasProAndNotConnected(); | |
| 1017 | - var dialogOptions = { | |
| 1018 | - title: (0, _wordpress_i18n.__)("Dynamic Content", "elementor"), | |
| 1019 | - content: (0, _wordpress_i18n.__)("Create more personalized and dynamic sites by populating data from various sources with dozens of dynamic tags to choose from.", "elementor"), | |
| 1020 | - targetElement: this.ui.dynamicSwitcher, | |
| 1021 | - position: { blockStart: "-10" }, | |
| 1022 | - actionButton: { | |
| 1023 | - url: hasProAndNotConnected ? elementorProEditorConfig.urls.connect : elementor.config.dynamicPromotionURL.replace("%s", this.view.model.get("name")), | |
| 1024 | - text: hasProAndNotConnected ? (0, _wordpress_i18n.__)("Connect & Activate", "elementor") : (0, _wordpress_i18n.__)("Upgrade", "elementor") | |
| 1025 | - } | |
| 1026 | - }; | |
| 1027 | - elementor.promotion.showDialog(dialogOptions); | |
| 1028 | - }, | |
| 1029 | - onRender: function onRender() { | |
| 1030 | - this.$el.addClass("elementor-control-dynamic"); | |
| 1031 | - this.renderTools(); | |
| 1032 | - this.toggleDynamicClass(); | |
| 1033 | - if (this.isDynamicMode()) this.setDefaultTagView(); | |
| 1034 | - }, | |
| 1035 | - onDynamicSwitcherClick: function onDynamicSwitcherClick(event) { | |
| 1036 | - event.stopPropagation(); | |
| 1037 | - if (this.getOption("tags").length) this.toggleTagsList(); | |
| 1038 | - else this.showPromotion(); | |
| 1039 | - }, | |
| 1040 | - onTagsListItemClick: function onTagsListItemClick(event) { | |
| 1041 | - var $tag = jQuery(event.currentTarget); | |
| 1042 | - this.setTagView(elementorCommon.helpers.getUniqueId(), $tag.data("tagName"), {}); | |
| 1043 | - if (this.view.getGlobalKey()) this.view.triggerMethod("unset:global:value"); | |
| 1044 | - if (this.isDynamicMode()) $e.run("document/dynamic/settings", { | |
| 1045 | - container: this.view.options.container, | |
| 1046 | - settings: _defineProperty({}, this.view.model.get("name"), this.tagViewToTagText()) | |
| 1047 | - }); | |
| 1048 | - else $e.run("document/dynamic/enable", { | |
| 1049 | - container: this.view.options.container, | |
| 1050 | - settings: _defineProperty({}, this.view.model.get("name"), this.tagViewToTagText()) | |
| 1051 | - }); | |
| 1052 | - this.toggleDynamicClass(); | |
| 1053 | - this.toggleTagsList(); | |
| 1054 | - if (this.tagView.getTagConfig().settings_required) this.tagView.showSettingsPopup(); | |
| 1055 | - }, | |
| 1056 | - onTagViewRemove: function onTagViewRemove() { | |
| 1057 | - $e.run("document/dynamic/disable", { | |
| 1058 | - container: this.view.options.container, | |
| 1059 | - settings: _defineProperty({}, this.view.model.get("name"), this.tagViewToTagText()) | |
| 1060 | - }); | |
| 1061 | - this.toggleDynamicClass(); | |
| 1062 | - }, | |
| 1063 | - onAfterExternalChange: function onAfterExternalChange() { | |
| 1064 | - this.destroyTagView(); | |
| 1065 | - if (this.isDynamicMode()) this.setDefaultTagView(); | |
| 1066 | - this.toggleDynamicClass(); | |
| 1067 | - }, | |
| 1068 | - onDestroy: function onDestroy() { | |
| 1069 | - this.destroyTagView(); | |
| 1070 | - if (this.ui.tagsList) this.ui.tagsList.remove(); | |
| 1071 | - } | |
| 1072 | - }); | |
| 1073 | - })); | |
| 578 | + // Since the following comparison is <=, allow usage of the 320px value for the mobile breakpoint. | |
| 579 | + if ('mobile' === validationTerms.breakpointName && 320 === this.bottomBreakpoint) { | |
| 580 | + this.bottomBreakpoint -= 1; | |
| 581 | + } | |
| 1074 | 582 | |
| 1075 | -//#endregion | |
| 1076 | -//#region assets/dev/js/editor/controls/base-data.js | |
| 1077 | - var require_base_data = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1078 | - init_slicedToArray(); | |
| 1079 | - init_defineProperty(); | |
| 1080 | - init_breakpoint(); | |
| 1081 | - function _createForOfIteratorHelper(r, e) { | |
| 1082 | - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 1083 | - if (!t) { | |
| 1084 | - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { | |
| 1085 | - t && (r = t); | |
| 1086 | - var _n = 0; | |
| 1087 | - var F = function F() {}; | |
| 1088 | - return { | |
| 1089 | - s: F, | |
| 1090 | - n: function n() { | |
| 1091 | - return _n >= r.length ? { done: !0 } : { | |
| 1092 | - done: !1, | |
| 1093 | - value: r[_n++] | |
| 1094 | - }; | |
| 1095 | - }, | |
| 1096 | - e: function e(r) { | |
| 1097 | - throw r; | |
| 1098 | - }, | |
| 1099 | - f: F | |
| 1100 | - }; | |
| 1101 | - } | |
| 1102 | - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 1103 | - } | |
| 1104 | - var o; | |
| 1105 | - var a = !0; | |
| 1106 | - var u = !1; | |
| 1107 | - return { | |
| 1108 | - s: function s() { | |
| 1109 | - t = t.call(r); | |
| 1110 | - }, | |
| 1111 | - n: function n() { | |
| 1112 | - var r = t.next(); | |
| 1113 | - return a = r.done, r; | |
| 1114 | - }, | |
| 1115 | - e: function e(r) { | |
| 1116 | - u = !0, o = r; | |
| 1117 | - }, | |
| 1118 | - f: function f() { | |
| 1119 | - try { | |
| 1120 | - a || null == t.return || t.return(); | |
| 1121 | - } finally { | |
| 1122 | - if (u) throw o; | |
| 1123 | - } | |
| 1124 | - } | |
| 1125 | - }; | |
| 1126 | - } | |
| 1127 | - function _unsupportedIterableToArray(r, a) { | |
| 1128 | - if (r) { | |
| 1129 | - if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 1130 | - var t = {}.toString.call(r).slice(8, -1); | |
| 1131 | - 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; | |
| 1132 | - } | |
| 1133 | - } | |
| 1134 | - function _arrayLikeToArray(r, a) { | |
| 1135 | - (null == a || a > r.length) && (a = r.length); | |
| 1136 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 1137 | - return n; | |
| 1138 | - } | |
| 1139 | - var ControlBaseView = require_base(); | |
| 1140 | - var TagsBehavior = require_control_behavior(); | |
| 1141 | - var Validator = require_base$1(); | |
| 1142 | - var NumberValidator = require_number(); | |
| 1143 | - var ControlBaseDataView = ControlBaseView.extend({ | |
| 1144 | - validatorTypes: { | |
| 1145 | - Base: Validator, | |
| 1146 | - Number: NumberValidator, | |
| 1147 | - Breakpoint: BreakpointValidator | |
| 1148 | - }, | |
| 1149 | - ui: function ui() { | |
| 1150 | - var ui = ControlBaseView.prototype.ui.apply(this, arguments); | |
| 1151 | - _.extend(ui, { | |
| 1152 | - input: "input[data-setting][type!=\"checkbox\"][type!=\"radio\"]", | |
| 1153 | - checkbox: "input[data-setting][type=\"checkbox\"]", | |
| 1154 | - radio: "input[data-setting][type=\"radio\"]", | |
| 1155 | - select: "select[data-setting]", | |
| 1156 | - textarea: "textarea[data-setting]", | |
| 1157 | - responsiveSwitchersSibling: "".concat(ui.controlTitle, "[data-e-responsive-switcher-sibling!=\"false\"]"), | |
| 1158 | - responsiveSwitchers: ".elementor-responsive-switcher", | |
| 1159 | - contentEditable: "[contenteditable=\"true\"]" | |
| 1160 | - }); | |
| 1161 | - return ui; | |
| 1162 | - }, | |
| 1163 | - templateHelpers: function templateHelpers() { | |
| 1164 | - var controlData = ControlBaseView.prototype.templateHelpers.apply(this, arguments); | |
| 1165 | - controlData.data.controlValue = this.getControlValue(); | |
| 1166 | - return controlData; | |
| 1167 | - }, | |
| 1168 | - events: function events() { | |
| 1169 | - return { | |
| 1170 | - "input @ui.input": "onBaseInputTextChange", | |
| 1171 | - "change @ui.checkbox": "onBaseInputChange", | |
| 1172 | - "change @ui.radio": "onBaseInputChange", | |
| 1173 | - "input @ui.textarea": "onBaseInputTextChange", | |
| 1174 | - "change @ui.select": "onBaseInputChange", | |
| 1175 | - "input @ui.contentEditable": "onBaseInputTextChange", | |
| 1176 | - "click @ui.responsiveSwitchers": "onResponsiveSwitchersClick" | |
| 1177 | - }; | |
| 1178 | - }, | |
| 1179 | - behaviors: function behaviors() { | |
| 1180 | - var behaviors = ControlBaseView.prototype.behaviors.apply(this, arguments); | |
| 1181 | - var dynamicSettings = this.options.model.get("dynamic"); | |
| 1182 | - if (dynamicSettings && dynamicSettings.active) { | |
| 1183 | - var tags = _.filter(elementor.dynamicTags.getConfig("tags"), function(tag) { | |
| 1184 | - return tag.editable && _.intersection(tag.categories, dynamicSettings.categories).length; | |
| 1185 | - }); | |
| 1186 | - if (tags.length || elementor.config.user.is_administrator) behaviors.tags = { | |
| 1187 | - behaviorClass: TagsBehavior, | |
| 1188 | - tags, | |
| 1189 | - dynamicSettings | |
| 1190 | - }; | |
| 1191 | - } | |
| 1192 | - return behaviors; | |
| 1193 | - }, | |
| 1194 | - initialize: function initialize() { | |
| 1195 | - ControlBaseView.prototype.initialize.apply(this, arguments); | |
| 1196 | - this.registerValidators(); | |
| 1197 | - if (this.model.get("responsive")) this.setPlaceholderFromParent(); | |
| 1198 | - if (void 0 === this.model.get("inherit_placeholders")) this.model.set("inherit_placeholders", true); | |
| 1199 | - var settings = this.container ? this.container.settings : this.elementSettingsModel; | |
| 1200 | - this.listenTo(settings, "change:external:" + this.model.get("name"), this.onAfterExternalChange); | |
| 1201 | - }, | |
| 1202 | - getControlValue: function getControlValue() { | |
| 1203 | - return this.container.settings.get(this.model.get("name")); | |
| 1204 | - }, | |
| 1205 | - getGlobalKey: function getGlobalKey() { | |
| 1206 | - return this.container.globals.get(this.model.get("name")); | |
| 1207 | - }, | |
| 1208 | - getGlobalValue: function getGlobalValue() { | |
| 1209 | - return this.globalValue; | |
| 1210 | - }, | |
| 1211 | - getGlobalDefault: function getGlobalDefault() { | |
| 1212 | - var controlGlobalArgs = this.model.get("global"); | |
| 1213 | - if (controlGlobalArgs !== null && controlGlobalArgs !== void 0 && controlGlobalArgs.default) { | |
| 1214 | - if (!elementor.config.globals.defaults_enabled[this.getGlobalMeta().controlType]) return ""; | |
| 1215 | - var _$e$data$commandExtra = $e.data.commandExtractArgs(controlGlobalArgs.default); | |
| 1216 | - var command = _$e$data$commandExtra.command; | |
| 1217 | - var args = _$e$data$commandExtra.args; | |
| 1218 | - var result = $e.data.getCache($e.components.get("globals"), command, args.query); | |
| 1219 | - return result === null || result === void 0 ? void 0 : result.value; | |
| 1220 | - } | |
| 1221 | - return ""; | |
| 1222 | - }, | |
| 1223 | - getCurrentValue: function getCurrentValue() { | |
| 1224 | - if (this.getGlobalKey() && !this.globalValue) return ""; | |
| 1225 | - if (this.globalValue) return this.globalValue; | |
| 1226 | - var controlValue = this.getControlValue(); | |
| 1227 | - if (controlValue) return controlValue; | |
| 1228 | - return this.getGlobalDefault(); | |
| 1229 | - }, | |
| 1230 | - isGlobalActive: function isGlobalActive() { | |
| 1231 | - var _this$options$model$g; | |
| 1232 | - return (_this$options$model$g = this.options.model.get("global")) === null || _this$options$model$g === void 0 ? void 0 : _this$options$model$g.active; | |
| 1233 | - }, | |
| 1234 | - setValue: function setValue(value) { | |
| 1235 | - this.setSettingsModel(value); | |
| 1236 | - }, | |
| 1237 | - setSettingsModel: function setSettingsModel(value) { | |
| 1238 | - var key = this.model.get("name"); | |
| 1239 | - $e.run("document/elements/settings", { | |
| 1240 | - container: this.options.container, | |
| 1241 | - settings: _defineProperty({}, key, value) | |
| 1242 | - }); | |
| 1243 | - this.triggerMethod("settings:change"); | |
| 1244 | - }, | |
| 1245 | - applySavedValue: function applySavedValue() { | |
| 1246 | - this.setInputValue("[data-setting=\"" + this.model.get("name") + "\"]", this.getControlValue()); | |
| 1247 | - }, | |
| 1248 | - getEditSettings: function getEditSettings(setting) { | |
| 1249 | - var settings = this.getOption("elementEditSettings").toJSON(); | |
| 1250 | - if (setting) return settings[setting]; | |
| 1251 | - return settings; | |
| 1252 | - }, | |
| 1253 | - setEditSetting: function setEditSetting(settingKey, settingValue) { | |
| 1254 | - (this.getOption("elementEditSettings") || this.getOption("container").settings).set(settingKey, settingValue); | |
| 1255 | - }, | |
| 1256 | - /** | |
| 1257 | - * Get the placeholder for the current control. | |
| 1258 | - * | |
| 1259 | - * @return {*} placeholder | |
| 1260 | - */ | |
| 1261 | - getControlPlaceholder: function getControlPlaceholder() { | |
| 1262 | - var placeholder = this.model.get("placeholder"); | |
| 1263 | - if (this.model.get("responsive") && this.model.get("inherit_placeholders")) placeholder = placeholder || this.container.placeholders[this.model.get("name")]; | |
| 1264 | - return placeholder; | |
| 1265 | - }, | |
| 1266 | - /** | |
| 1267 | - * Get the responsive parent view if exists. | |
| 1268 | - * | |
| 1269 | - * @return {ControlBaseDataView|undefined} responsive parent view if exists | |
| 1270 | - */ | |
| 1271 | - getResponsiveParentView: function getResponsiveParentView() { | |
| 1272 | - var parent = this.model.get("parent"); | |
| 1273 | - try { | |
| 1274 | - return parent && this.container.panel.getControlView(parent); | |
| 1275 | - } catch (e) {} | |
| 1276 | - }, | |
| 1277 | - /** | |
| 1278 | - * Get the responsive children views if exists. | |
| 1279 | - * | |
| 1280 | - * @return {ControlBaseDataView|null} responsive children views if exists | |
| 1281 | - */ | |
| 1282 | - getResponsiveChildrenViews: function getResponsiveChildrenViews() { | |
| 1283 | - var children = this.model.get("inheritors"); | |
| 1284 | - var views = []; | |
| 1285 | - try { | |
| 1286 | - var _iterator = _createForOfIteratorHelper(children); | |
| 1287 | - var _step; | |
| 1288 | - try { | |
| 1289 | - for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 1290 | - var child = _step.value; | |
| 1291 | - views.push(this.container.panel.getControlView(child)); | |
| 1292 | - } | |
| 1293 | - } catch (err) { | |
| 1294 | - _iterator.e(err); | |
| 1295 | - } finally { | |
| 1296 | - _iterator.f(); | |
| 1297 | - } | |
| 1298 | - } catch (e) {} | |
| 1299 | - return views; | |
| 1300 | - }, | |
| 1301 | - /** | |
| 1302 | - * Get prepared placeholder from the responsive parent, and put it into current | |
| 1303 | - * control model as placeholder. | |
| 1304 | - */ | |
| 1305 | - setPlaceholderFromParent: function setPlaceholderFromParent() { | |
| 1306 | - var parent = this.getResponsiveParentView(); | |
| 1307 | - if (parent) this.container.placeholders[this.model.get("name")] = parent.preparePlaceholderForChildren(); | |
| 1308 | - }, | |
| 1309 | - /** | |
| 1310 | - * Returns the value of the current control if exists, or the parent value if not, | |
| 1311 | - * so responsive children can set it as their placeholder. When there are multiple | |
| 1312 | - * inputs, the inputs which are empty on this control will inherit their values | |
| 1313 | - * from the responsive parent. | |
| 1314 | - * For example, if on desktop the padding of all edges is 10, and on tablet only | |
| 1315 | - * padding right and left is set to 15, the mobile control placeholder will | |
| 1316 | - * eventually be: { top: 10, right: 15, left: 15, bottom: 10 }, because of the | |
| 1317 | - * inheritance of multiple values. | |
| 1318 | - * | |
| 1319 | - * @return {*} value of the current control if exists, or the parent value if not | |
| 1320 | - */ | |
| 1321 | - preparePlaceholderForChildren: function preparePlaceholderForChildren() { | |
| 1322 | - var _this$getResponsivePa; | |
| 1323 | - var cleanValue = this.getCleanControlValue(); | |
| 1324 | - var parentValue = (_this$getResponsivePa = this.getResponsiveParentView()) === null || _this$getResponsivePa === void 0 ? void 0 : _this$getResponsivePa.preparePlaceholderForChildren(); | |
| 1325 | - if (cleanValue instanceof Object) return Object.assign({}, parentValue, cleanValue); | |
| 1326 | - return cleanValue || parentValue; | |
| 1327 | - }, | |
| 1328 | - /** | |
| 1329 | - * Start the re-rendering recursive chain from the responsive child of this | |
| 1330 | - * control. It's useful when the current control value is changed and we want | |
| 1331 | - * to update all responsive children. In this case, the re-rendering is supposed | |
| 1332 | - * to be applied only from the responsive child of this control and on. | |
| 1333 | - */ | |
| 1334 | - propagatePlaceholder: function propagatePlaceholder() { | |
| 1335 | - var _iterator2 = _createForOfIteratorHelper(this.getResponsiveChildrenViews()); | |
| 1336 | - var _step2; | |
| 1337 | - try { | |
| 1338 | - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) _step2.value.renderWithChildren(); | |
| 1339 | - } catch (err) { | |
| 1340 | - _iterator2.e(err); | |
| 1341 | - } finally { | |
| 1342 | - _iterator2.f(); | |
| 1343 | - } | |
| 1344 | - }, | |
| 1345 | - /** | |
| 1346 | - * Re-render current control and trigger this method on the responsive child. | |
| 1347 | - * The purpose of those actions is to recursively re-render all responsive | |
| 1348 | - * children. | |
| 1349 | - */ | |
| 1350 | - renderWithChildren: function renderWithChildren() { | |
| 1351 | - this.render(); | |
| 1352 | - this.propagatePlaceholder(); | |
| 1353 | - }, | |
| 1354 | - /** | |
| 1355 | - * Get control value without empty properties, and without default values. | |
| 1356 | - * | |
| 1357 | - * @return {{}} control value without empty properties, and without default values | |
| 1358 | - */ | |
| 1359 | - getCleanControlValue: function getCleanControlValue() { | |
| 1360 | - var value = this.getControlValue(); | |
| 1361 | - return value && value !== this.model.get("default") ? value : void 0; | |
| 1362 | - }, | |
| 1363 | - onAfterChange: function onAfterChange(control) { | |
| 1364 | - if (Object.keys(control.changed).includes(this.model.get("name"))) this.propagatePlaceholder(); | |
| 1365 | - ControlBaseView.prototype.onAfterChange.apply(this, arguments); | |
| 1366 | - }, | |
| 1367 | - getInputValue: function getInputValue(input) { | |
| 1368 | - var $input = this.$(input); | |
| 1369 | - if ($input.is("[contenteditable=\"true\"]")) return $input.html(); | |
| 1370 | - var inputValue = $input.val(); | |
| 1371 | - var inputType = $input.attr("type"); | |
| 1372 | - if (-1 !== ["radio", "checkbox"].indexOf(inputType)) return $input.prop("checked") ? inputValue : ""; | |
| 1373 | - if ("number" === inputType && _.isFinite(inputValue)) return +inputValue; | |
| 1374 | - if ("SELECT" === input.tagName && $input.prop("multiple") && null === inputValue) inputValue = []; | |
| 1375 | - return inputValue; | |
| 1376 | - }, | |
| 1377 | - setInputValue: function setInputValue(input, value) { | |
| 1378 | - var $input = this.$(input); | |
| 1379 | - var inputType = $input.attr("type"); | |
| 1380 | - if ("checkbox" === inputType) $input.prop("checked", !!value); | |
| 1381 | - else if ("radio" === inputType) $input.filter("[value=\"" + value + "\"]").prop("checked", true); | |
| 1382 | - else $input.val(value); | |
| 1383 | - }, | |
| 1384 | - addValidator: function addValidator(validator) { | |
| 1385 | - this.validators.push(validator); | |
| 1386 | - }, | |
| 1387 | - registerValidators: function registerValidators() { | |
| 1388 | - var _this = this; | |
| 1389 | - this.validators = []; | |
| 1390 | - var validationTerms = {}; | |
| 1391 | - if (this.model.get("required")) validationTerms.required = true; | |
| 1392 | - if (!jQuery.isEmptyObject(validationTerms)) this.addValidator(new this.validatorTypes.Base({ validationTerms })); | |
| 1393 | - var validators = this.model.get("validators"); | |
| 1394 | - if (validators) Object.entries(validators).forEach(function(_ref) { | |
| 1395 | - var _ref2 = _slicedToArray(_ref, 2); | |
| 1396 | - var key = _ref2[0]; | |
| 1397 | - var args = _ref2[1]; | |
| 1398 | - _this.addValidator(new _this.validatorTypes[key]({ validationTerms: args })); | |
| 1399 | - }); | |
| 1400 | - }, | |
| 1401 | - onBeforeRender: function onBeforeRender() { | |
| 1402 | - this.setPlaceholderFromParent(); | |
| 1403 | - }, | |
| 1404 | - onRender: function onRender() { | |
| 1405 | - ControlBaseView.prototype.onRender.apply(this, arguments); | |
| 1406 | - if (this.model.get("responsive")) this.renderResponsiveSwitchers(); | |
| 1407 | - this.applySavedValue(); | |
| 1408 | - this.triggerMethod("ready"); | |
| 1409 | - this.toggleControlVisibility(); | |
| 1410 | - this.addTooltip(); | |
| 1411 | - }, | |
| 1412 | - onBaseInputTextChange: function onBaseInputTextChange(event) { | |
| 1413 | - this.onBaseInputChange(event); | |
| 1414 | - }, | |
| 1415 | - onBaseInputChange: function onBaseInputChange(event) { | |
| 1416 | - clearTimeout(this.correctionTimeout); | |
| 1417 | - var input = event.currentTarget; | |
| 1418 | - var value = this.getInputValue(input); | |
| 1419 | - var validators = this.validators.slice(0); | |
| 1420 | - var settingsValidators = this.container.settings.validators[this.model.get("name")]; | |
| 1421 | - if (settingsValidators) validators = validators.concat(settingsValidators); | |
| 1422 | - if (validators) { | |
| 1423 | - var oldValue = this.getControlValue(input.dataset.setting); | |
| 1424 | - if (!validators.every(function(validator) { | |
| 1425 | - return validator.isValid(value, oldValue); | |
| 1426 | - })) { | |
| 1427 | - this.correctionTimeout = setTimeout(this.setInputValue.bind(this, input, oldValue), 1200); | |
| 1428 | - return; | |
| 1429 | - } | |
| 1430 | - } | |
| 1431 | - this.updateElementModel(value, input); | |
| 1432 | - this.triggerMethod("input:change", event); | |
| 1433 | - }, | |
| 1434 | - onResponsiveSwitchersClick: function onResponsiveSwitchersClick(event) { | |
| 1435 | - var $switcher = jQuery(event.currentTarget); | |
| 1436 | - var device = $switcher.data("device"); | |
| 1437 | - var $switchersWrapper = this.ui.responsiveSwitchersWrapper; | |
| 1438 | - var selectedOption = $switcher.index(); | |
| 1439 | - $switchersWrapper.toggleClass("elementor-responsive-switchers-open"); | |
| 1440 | - $switchersWrapper[0].style.setProperty("--selected-option", selectedOption); | |
| 1441 | - this.triggerMethod("responsive:switcher:click", device); | |
| 1442 | - elementor.changeDeviceMode(device); | |
| 1443 | - }, | |
| 1444 | - renderResponsiveSwitchers: function renderResponsiveSwitchers() { | |
| 1445 | - var templateHtml = Marionette.Renderer.render("#tmpl-elementor-control-responsive-switchers", this.model.attributes); | |
| 1446 | - this.ui.responsiveSwitchersSibling.after(templateHtml); | |
| 1447 | - this.ui.responsiveSwitchersWrapper = this.$el.find(".elementor-control-responsive-switchers"); | |
| 1448 | - }, | |
| 1449 | - onAfterExternalChange: function onAfterExternalChange() { | |
| 1450 | - this.hideTooltip(); | |
| 1451 | - this.applySavedValue(); | |
| 1452 | - }, | |
| 1453 | - addTooltip: function addTooltip() { | |
| 1454 | - this.ui.tooltipTargets = this.$el.find(".tooltip-target"); | |
| 1455 | - if (!this.ui.tooltipTargets.length) return; | |
| 1456 | - this.ui.tooltipTargets.tipsy({ | |
| 1457 | - gravity: function gravity() { | |
| 1458 | - var gravity = jQuery(this).data("tooltip-pos"); | |
| 1459 | - if (void 0 !== gravity) return gravity; | |
| 1460 | - return "s"; | |
| 1461 | - }, | |
| 1462 | - title: function title() { | |
| 1463 | - return this.getAttribute("data-tooltip"); | |
| 1464 | - } | |
| 1465 | - }); | |
| 1466 | - }, | |
| 1467 | - hideTooltip: function hideTooltip() { | |
| 1468 | - if (this.ui.tooltipTargets.length) this.ui.tooltipTargets.tipsy("hide"); | |
| 1469 | - }, | |
| 1470 | - updateElementModel: function updateElementModel(value) { | |
| 1471 | - this.setValue(value); | |
| 1472 | - } | |
| 1473 | - }, { | |
| 1474 | - getStyleValue: function getStyleValue(placeholder, controlValue, controlData) { | |
| 1475 | - if ("DEFAULT" === placeholder) return controlData.default; | |
| 1476 | - return controlValue; | |
| 1477 | - }, | |
| 1478 | - onPasteStyle: function onPasteStyle() { | |
| 1479 | - return true; | |
| 1480 | - } | |
| 1481 | - }); | |
| 1482 | - module.exports = ControlBaseDataView; | |
| 1483 | - })); | |
| 583 | + // If there is a breakpoint below the currently edited breakpoint | |
| 584 | + if (this.bottomBreakpoint) { | |
| 585 | + // Check that the new value is not under the bottom breakpoint's value. | |
| 586 | + if ('' !== newValue && newValue <= this.bottomBreakpoint) { | |
| 587 | + isValid = false; | |
| 588 | + } | |
| 1484 | 589 | |
| 1485 | -//#endregion | |
| 1486 | -//#region assets/dev/js/editor/controls/switcher.js | |
| 1487 | - var require_switcher = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1488 | - var ControlBaseDataView = require_base_data(); | |
| 1489 | - module.exports = ControlBaseDataView.extend({ setInputValue: function setInputValue(input, value) { | |
| 1490 | - this.$(input).prop("checked", this.model.get("return_value") === value); | |
| 1491 | - } }, { onPasteStyle: function onPasteStyle(control, clipboardValue) { | |
| 1492 | - return !clipboardValue || clipboardValue === control.return_value; | |
| 1493 | - } }); | |
| 1494 | - })); | |
| 590 | + // If the new value is empty, check that the default breakpoint value is not below the bottom breakpoint. | |
| 591 | + if ('' === newValue && breakpointDefaultValue <= this.bottomBreakpoint) { | |
| 592 | + isValid = false; | |
| 593 | + } | |
| 594 | + } | |
| 1495 | 595 | |
| 1496 | -//#endregion | |
| 1497 | -//#region modules/styleguide/assets/js/controls/switcher.js | |
| 1498 | - init_classCallCheck(); | |
| 1499 | - init_createClass(); | |
| 1500 | - init_possibleConstructorReturn(); | |
| 1501 | - init_getPrototypeOf(); | |
| 1502 | - init_inherits(); | |
| 1503 | - var import_switcher = /* @__PURE__ */ __toESM(require_switcher()); | |
| 1504 | - var import_base_data = /* @__PURE__ */ __toESM(require_base_data()); | |
| 1505 | - function _callSuper$2(t, o, e) { | |
| 1506 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1507 | - } | |
| 1508 | - __name(_callSuper$2, "_callSuper"); | |
| 1509 | - function _isNativeReflectConstruct$2() { | |
| 1510 | - try { | |
| 1511 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1512 | - } catch (t) {} | |
| 1513 | - return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { | |
| 1514 | - return !!t; | |
| 1515 | - })(); | |
| 1516 | - } | |
| 1517 | - __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct"); | |
| 1518 | - function _superPropGet(t, o, e, r) { | |
| 1519 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 1520 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 1521 | - return p.apply(e, t); | |
| 1522 | - } : p; | |
| 1523 | - } | |
| 1524 | - var _default$1 = /*#__PURE__*/ function(_Switcher) { | |
| 1525 | - function _default() { | |
| 1526 | - _classCallCheck(this, _default); | |
| 1527 | - return _callSuper$2(this, _default, arguments); | |
| 1528 | - } | |
| 1529 | - _inherits(_default, _Switcher); | |
| 1530 | - return _createClass(_default, [ | |
| 1531 | - { | |
| 1532 | - key: "initialize", | |
| 1533 | - value: function initialize() { | |
| 1534 | - import_base_data.default.prototype.initialize.apply(this, arguments); | |
| 1535 | - this.$el.addClass("elementor-control-type-switcher"); | |
| 1536 | - } | |
| 1537 | - }, | |
| 1538 | - { | |
| 1539 | - key: "onBeforeRender", | |
| 1540 | - value: function onBeforeRender() { | |
| 1541 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 1542 | - _superPropGet(_default, "onBeforeRender", this, 3)(args); | |
| 1543 | - var actualValue = elementor.getPreferences("enable_styleguide_preview"); | |
| 1544 | - if (actualValue !== this.getCurrentValue()) this.setValue(actualValue); | |
| 1545 | - } | |
| 1546 | - }, | |
| 1547 | - { | |
| 1548 | - key: "onBaseInputChange", | |
| 1549 | - value: function onBaseInputChange(event) { | |
| 1550 | - import_base_data.default.prototype.onBaseInputChange.apply(this, arguments); | |
| 1551 | - var input = event.currentTarget; | |
| 1552 | - var value = this.getInputValue(input); | |
| 1553 | - if (this.model.get("on_change_command")) this.runCommand(value); | |
| 1554 | - this.model.set("return_value", null); | |
| 1555 | - } | |
| 1556 | - }, | |
| 1557 | - { | |
| 1558 | - key: "runCommand", | |
| 1559 | - value: function runCommand(value) { | |
| 1560 | - $e.run("preview/styleguide/switcher-change", { | |
| 1561 | - name: this.model.get("name"), | |
| 1562 | - value | |
| 1563 | - }); | |
| 1564 | - } | |
| 1565 | - } | |
| 1566 | - ]); | |
| 1567 | - }(import_switcher.default); | |
| 596 | + // If there is a breakpoint above the currently edited breakpoint. | |
| 597 | + if (this.topBreakpoint) { | |
| 598 | + // Check that the value is not above the top breakpoint's value. | |
| 599 | + if ('' !== newValue && newValue >= this.topBreakpoint) { | |
| 600 | + isValid = false; | |
| 601 | + } | |
| 1568 | 602 | |
| 1569 | -//#endregion | |
| 1570 | -//#region modules/styleguide/assets/js/e-component.js | |
| 1571 | - init_classCallCheck(); | |
| 1572 | - init_createClass(); | |
| 1573 | - init_possibleConstructorReturn(); | |
| 1574 | - init_getPrototypeOf(); | |
| 1575 | - init_inherits(); | |
| 1576 | - function _callSuper$1(t, o, e) { | |
| 1577 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1578 | - } | |
| 1579 | - __name(_callSuper$1, "_callSuper"); | |
| 1580 | - function _isNativeReflectConstruct$1() { | |
| 1581 | - try { | |
| 1582 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1583 | - } catch (t) {} | |
| 1584 | - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { | |
| 1585 | - return !!t; | |
| 1586 | - })(); | |
| 1587 | - } | |
| 1588 | - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); | |
| 1589 | - var _default = /*#__PURE__*/ function(_$e$modules$Component) { | |
| 1590 | - function _default(args) { | |
| 1591 | - var _this; | |
| 1592 | - _classCallCheck(this, _default); | |
| 1593 | - _this = _callSuper$1(this, _default, [args]); | |
| 1594 | - elementor.addControlView("global-style-switcher", _default$1); | |
| 1595 | - _this.registerStyleguideDialogType(); | |
| 1596 | - elementor.once("preview:loaded", function() { | |
| 1597 | - _this.initModal(); | |
| 1598 | - }); | |
| 1599 | - return _this; | |
| 1600 | - } | |
| 1601 | - _inherits(_default, _$e$modules$Component); | |
| 1602 | - return _createClass(_default, [ | |
| 1603 | - { | |
| 1604 | - key: "getNamespace", | |
| 1605 | - value: function getNamespace() { | |
| 1606 | - return "preview/styleguide"; | |
| 1607 | - } | |
| 1608 | - }, | |
| 1609 | - { | |
| 1610 | - key: "defaultCommands", | |
| 1611 | - value: function defaultCommands() { | |
| 1612 | - return this.importCommands(commands_exports); | |
| 1613 | - } | |
| 1614 | - }, | |
| 1615 | - { | |
| 1616 | - key: "registerStyleguideDialogType", | |
| 1617 | - value: function registerStyleguideDialogType() { | |
| 1618 | - DialogsManager.addWidgetType("styleguide", DialogsManager.getWidgetType("lightbox").extend("alert", { buildWidget: function buildWidget() { | |
| 1619 | - DialogsManager.getWidgetType("lightbox").prototype.buildWidget.apply(this, arguments); | |
| 1620 | - var $widgetContent = this.addElement("widgetContent"); | |
| 1621 | - var elements = this.getElements(); | |
| 1622 | - $widgetContent.append(elements.message); | |
| 1623 | - elements.widget.html($widgetContent); | |
| 1624 | - } })); | |
| 1625 | - } | |
| 1626 | - }, | |
| 1627 | - { | |
| 1628 | - key: "initModal", | |
| 1629 | - value: function initModal() { | |
| 1630 | - var modal; | |
| 1631 | - this.getModal = function() { | |
| 1632 | - if (modal) return modal; | |
| 1633 | - modal = elementorCommon.dialogsManager.createWidget("styleguide", { | |
| 1634 | - id: "e-styleguide-preview-dialog", | |
| 1635 | - message: "<div class=\"e-styleguide-preview-root\"></div>", | |
| 1636 | - position: { | |
| 1637 | - my: "center center", | |
| 1638 | - at: "center center" | |
| 1639 | - }, | |
| 1640 | - hide: { | |
| 1641 | - onOutsideClick: false, | |
| 1642 | - onEscKeyPress: false, | |
| 1643 | - onClick: false, | |
| 1644 | - onBackgroundClick: false | |
| 1645 | - }, | |
| 1646 | - container: elementor.$previewContents.find("body") | |
| 1647 | - }); | |
| 1648 | - return modal; | |
| 1649 | - }; | |
| 1650 | - } | |
| 1651 | - }, | |
| 1652 | - { | |
| 1653 | - key: "showStyleguidePreview", | |
| 1654 | - value: function showStyleguidePreview() { | |
| 1655 | - var skipPreferencesCheck = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; | |
| 1656 | - if (this.getModal().isVisible() || !skipPreferencesCheck && !elementor.getPreferences("enable_styleguide_preview")) return; | |
| 1657 | - this.getPreviewFrame().postMessage({ name: "elementor/styleguide/preview/show" }, "*"); | |
| 1658 | - this.getModal().show(); | |
| 1659 | - } | |
| 1660 | - }, | |
| 1661 | - { | |
| 1662 | - key: "hideStyleguidePreview", | |
| 1663 | - value: function hideStyleguidePreview() { | |
| 1664 | - this.getPreviewFrame().postMessage({ name: "elementor/styleguide/preview/hide" }, "*"); | |
| 1665 | - this.getModal().hide(); | |
| 1666 | - } | |
| 1667 | - }, | |
| 1668 | - { | |
| 1669 | - key: "enableStyleguidePreview", | |
| 1670 | - value: function enableStyleguidePreview(options) { | |
| 1671 | - if (options.value) this.showStyleguidePreview(true); | |
| 1672 | - else this.hideStyleguidePreview(); | |
| 1673 | - $e.run("document/elements/settings", { | |
| 1674 | - container: elementor.settings.editorPreferences.getEditedView().getContainer(), | |
| 1675 | - settings: { enable_styleguide_preview: options.value }, | |
| 1676 | - options: { external: true } | |
| 1677 | - }); | |
| 1678 | - } | |
| 1679 | - }, | |
| 1680 | - { | |
| 1681 | - key: "isInEditor", | |
| 1682 | - value: function isInEditor() { | |
| 1683 | - return !!window.elementor; | |
| 1684 | - } | |
| 1685 | - }, | |
| 1686 | - { | |
| 1687 | - key: "getPreviewFrame", | |
| 1688 | - value: function getPreviewFrame() { | |
| 1689 | - return this.isInEditor() ? elementor.$preview[0].contentWindow : window; | |
| 1690 | - } | |
| 1691 | - } | |
| 1692 | - ]); | |
| 1693 | - }($e.modules.ComponentBase); | |
| 603 | + // If the new value is empty, check that the default breakpoint value is not above the top breakpoint. | |
| 604 | + if ('' === newValue && breakpointDefaultValue >= this.topBreakpoint) { | |
| 605 | + isValid = false; | |
| 606 | + } | |
| 607 | + } | |
| 608 | + return isValid; | |
| 609 | + } | |
| 610 | + }]); | |
| 611 | + return BreakpointValidator; | |
| 612 | +}(NumberValidator); | |
| 613 | +exports["default"] = BreakpointValidator; | |
| 1694 | 614 | |
| 1695 | -//#endregion | |
| 1696 | -//#region modules/styleguide/assets/js/styleguide.js | |
| 1697 | - init_classCallCheck(); | |
| 1698 | - init_createClass(); | |
| 1699 | - init_possibleConstructorReturn(); | |
| 1700 | - init_getPrototypeOf(); | |
| 1701 | - init_inherits(); | |
| 1702 | - function _callSuper(t, o, e) { | |
| 1703 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1704 | - } | |
| 1705 | - function _isNativeReflectConstruct() { | |
| 1706 | - try { | |
| 1707 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1708 | - } catch (t) {} | |
| 1709 | - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { | |
| 1710 | - return !!t; | |
| 1711 | - })(); | |
| 1712 | - } | |
| 1713 | - new (/* @__PURE__ */ function(_elementorModules$edi) { | |
| 1714 | - function Styleguide() { | |
| 1715 | - _classCallCheck(this, Styleguide); | |
| 1716 | - return _callSuper(this, Styleguide, arguments); | |
| 1717 | - } | |
| 1718 | - _inherits(Styleguide, _elementorModules$edi); | |
| 1719 | - return _createClass(Styleguide, [ | |
| 1720 | - { | |
| 1721 | - key: "onInit", | |
| 1722 | - value: function onInit() { | |
| 1723 | - $e.components.register(new _default()); | |
| 1724 | - this.addHooks(); | |
| 1725 | - } | |
| 1726 | - }, | |
| 1727 | - { | |
| 1728 | - key: "getGlobalRoutes", | |
| 1729 | - value: function getGlobalRoutes() { | |
| 1730 | - return { | |
| 1731 | - "global-colors": "panel/global/global-colors", | |
| 1732 | - "global-typography": "panel/global/global-typography" | |
| 1733 | - }; | |
| 1734 | - } | |
| 1735 | - }, | |
| 1736 | - { | |
| 1737 | - key: "addHooks", | |
| 1738 | - value: function addHooks() { | |
| 1739 | - elementor.hooks.addAction("panel/global/tab/before-show", this.show.bind(this)); | |
| 1740 | - elementor.hooks.addAction("panel/global/tab/before-destroy", this.hide.bind(this)); | |
| 1741 | - } | |
| 1742 | - }, | |
| 1743 | - { | |
| 1744 | - key: "show", | |
| 1745 | - value: function show(args) { | |
| 1746 | - if (!args.id || !(args.id in this.getGlobalRoutes())) return; | |
| 1747 | - $e.run("preview/styleguide/".concat(args.id)); | |
| 1748 | - } | |
| 1749 | - }, | |
| 1750 | - { | |
| 1751 | - key: "hide", | |
| 1752 | - value: function hide(args) { | |
| 1753 | - if (!args.id || !(args.id in this.getGlobalRoutes())) return; | |
| 1754 | - if (Object.values(this.getGlobalRoutes()).some(function(route) { | |
| 1755 | - return $e.routes.current.panel === route; | |
| 1756 | - })) return; | |
| 1757 | - $e.run("preview/styleguide/hide"); | |
| 1758 | - } | |
| 1759 | - } | |
| 1760 | - ]); | |
| 1761 | - }(elementorModules.editor.utils.Module))(); | |
| 615 | +/***/ }), | |
| 1762 | 616 | |
| 1763 | -//#endregion | |
| 1764 | -})(wp.i18n); | |
| 617 | +/***/ "../assets/dev/js/editor/components/validator/number.js": | |
| 618 | +/*!**************************************************************!*\ | |
| 619 | + !*** ../assets/dev/js/editor/components/validator/number.js ***! | |
| 620 | + \**************************************************************/ | |
| 621 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 622 | + | |
| 623 | +"use strict"; | |
| 624 | + | |
| 625 | + | |
| 626 | +var Validator = __webpack_require__(/*! elementor-validator/base */ "../assets/dev/js/editor/components/validator/base.js"); | |
| 627 | +module.exports = Validator.extend({ | |
| 628 | + validationMethod: function validationMethod(newValue) { | |
| 629 | + var validationTerms = this.getSettings('validationTerms'), | |
| 630 | + errors = []; | |
| 631 | + if (_.isFinite(newValue)) { | |
| 632 | + if (undefined !== validationTerms.min && newValue < validationTerms.min) { | |
| 633 | + errors.push('Value is less than minimum'); | |
| 634 | + } | |
| 635 | + if (undefined !== validationTerms.max && newValue > validationTerms.max) { | |
| 636 | + errors.push('Value is greater than maximum'); | |
| 637 | + } | |
| 638 | + } | |
| 639 | + return errors; | |
| 640 | + } | |
| 641 | +}); | |
| 642 | + | |
| 643 | +/***/ }), | |
| 644 | + | |
| 645 | +/***/ "../assets/dev/js/editor/controls/base-data.js": | |
| 646 | +/*!*****************************************************!*\ | |
| 647 | + !*** ../assets/dev/js/editor/controls/base-data.js ***! | |
| 648 | + \*****************************************************/ | |
| 649 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 650 | + | |
| 651 | +"use strict"; | |
| 652 | + | |
| 653 | + | |
| 654 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 655 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 656 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 657 | +var _breakpoint = _interopRequireDefault(__webpack_require__(/*! elementor-validator/breakpoint */ "../assets/dev/js/editor/components/validator/breakpoint.js")); | |
| 658 | +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; } } }; } | |
| 659 | +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); } | |
| 660 | +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; } | |
| 661 | +var ControlBaseView = __webpack_require__(/*! elementor-controls/base */ "../assets/dev/js/editor/controls/base.js"), | |
| 662 | + TagsBehavior = __webpack_require__(/*! elementor-dynamic-tags/control-behavior */ "../assets/dev/js/editor/components/dynamic-tags/control-behavior.js"), | |
| 663 | + Validator = __webpack_require__(/*! elementor-validator/base */ "../assets/dev/js/editor/components/validator/base.js"), | |
| 664 | + NumberValidator = __webpack_require__(/*! elementor-validator/number */ "../assets/dev/js/editor/components/validator/number.js"), | |
| 665 | + ControlBaseDataView; | |
| 666 | +ControlBaseDataView = ControlBaseView.extend({ | |
| 667 | + validatorTypes: { | |
| 668 | + Base: Validator, | |
| 669 | + Number: NumberValidator, | |
| 670 | + Breakpoint: _breakpoint.default | |
| 671 | + }, | |
| 672 | + ui: function ui() { | |
| 673 | + var ui = ControlBaseView.prototype.ui.apply(this, arguments); | |
| 674 | + _.extend(ui, { | |
| 675 | + input: 'input[data-setting][type!="checkbox"][type!="radio"]', | |
| 676 | + checkbox: 'input[data-setting][type="checkbox"]', | |
| 677 | + radio: 'input[data-setting][type="radio"]', | |
| 678 | + select: 'select[data-setting]', | |
| 679 | + textarea: 'textarea[data-setting]', | |
| 680 | + responsiveSwitchersSibling: "".concat(ui.controlTitle, "[data-e-responsive-switcher-sibling!=\"false\"]"), | |
| 681 | + responsiveSwitchers: '.elementor-responsive-switcher', | |
| 682 | + contentEditable: '[contenteditable="true"]' | |
| 683 | + }); | |
| 684 | + return ui; | |
| 685 | + }, | |
| 686 | + templateHelpers: function templateHelpers() { | |
| 687 | + var controlData = ControlBaseView.prototype.templateHelpers.apply(this, arguments); | |
| 688 | + controlData.data.controlValue = this.getControlValue(); | |
| 689 | + return controlData; | |
| 690 | + }, | |
| 691 | + events: function events() { | |
| 692 | + return { | |
| 693 | + 'input @ui.input': 'onBaseInputTextChange', | |
| 694 | + 'change @ui.checkbox': 'onBaseInputChange', | |
| 695 | + 'change @ui.radio': 'onBaseInputChange', | |
| 696 | + 'input @ui.textarea': 'onBaseInputTextChange', | |
| 697 | + 'change @ui.select': 'onBaseInputChange', | |
| 698 | + 'input @ui.contentEditable': 'onBaseInputTextChange', | |
| 699 | + 'click @ui.responsiveSwitchers': 'onResponsiveSwitchersClick' | |
| 700 | + }; | |
| 701 | + }, | |
| 702 | + behaviors: function behaviors() { | |
| 703 | + var behaviors = ControlBaseView.prototype.behaviors.apply(this, arguments), | |
| 704 | + dynamicSettings = this.options.model.get('dynamic'); | |
| 705 | + if (dynamicSettings && dynamicSettings.active) { | |
| 706 | + var tags = _.filter(elementor.dynamicTags.getConfig('tags'), function (tag) { | |
| 707 | + return tag.editable && _.intersection(tag.categories, dynamicSettings.categories).length; | |
| 708 | + }); | |
| 709 | + if (tags.length || elementor.config.user.is_administrator) { | |
| 710 | + behaviors.tags = { | |
| 711 | + behaviorClass: TagsBehavior, | |
| 712 | + tags: tags, | |
| 713 | + dynamicSettings: dynamicSettings | |
| 714 | + }; | |
| 715 | + } | |
| 716 | + } | |
| 717 | + return behaviors; | |
| 718 | + }, | |
| 719 | + initialize: function initialize() { | |
| 720 | + ControlBaseView.prototype.initialize.apply(this, arguments); | |
| 721 | + this.registerValidators(); | |
| 722 | + if (this.model.get('responsive')) { | |
| 723 | + this.setPlaceholderFromParent(); | |
| 724 | + } | |
| 725 | + if (undefined === this.model.get('inherit_placeholders')) { | |
| 726 | + this.model.set('inherit_placeholders', true); | |
| 727 | + } | |
| 728 | + | |
| 729 | + // TODO: this.elementSettingsModel is deprecated since 2.8.0. | |
| 730 | + var settings = this.container ? this.container.settings : this.elementSettingsModel; | |
| 731 | + this.listenTo(settings, 'change:external:' + this.model.get('name'), this.onAfterExternalChange); | |
| 732 | + }, | |
| 733 | + getControlValue: function getControlValue() { | |
| 734 | + return this.container.settings.get(this.model.get('name')); | |
| 735 | + }, | |
| 736 | + getGlobalKey: function getGlobalKey() { | |
| 737 | + return this.container.globals.get(this.model.get('name')); | |
| 738 | + }, | |
| 739 | + getGlobalValue: function getGlobalValue() { | |
| 740 | + return this.globalValue; | |
| 741 | + }, | |
| 742 | + getGlobalDefault: function getGlobalDefault() { | |
| 743 | + var controlGlobalArgs = this.model.get('global'); | |
| 744 | + if (controlGlobalArgs !== null && controlGlobalArgs !== void 0 && controlGlobalArgs.default) { | |
| 745 | + // If the control is a color/typography control and default colors/typography are disabled, don't return the global value. | |
| 746 | + if (!elementor.config.globals.defaults_enabled[this.getGlobalMeta().controlType]) { | |
| 747 | + return ''; | |
| 748 | + } | |
| 749 | + var _$e$data$commandExtra = $e.data.commandExtractArgs(controlGlobalArgs.default), | |
| 750 | + command = _$e$data$commandExtra.command, | |
| 751 | + args = _$e$data$commandExtra.args, | |
| 752 | + result = $e.data.getCache($e.components.get('globals'), command, args.query); | |
| 753 | + return result === null || result === void 0 ? void 0 : result.value; | |
| 754 | + } | |
| 755 | + | |
| 756 | + // No global default. | |
| 757 | + return ''; | |
| 758 | + }, | |
| 759 | + getCurrentValue: function getCurrentValue() { | |
| 760 | + if (this.getGlobalKey() && !this.globalValue) { | |
| 761 | + return ''; | |
| 762 | + } | |
| 763 | + if (this.globalValue) { | |
| 764 | + return this.globalValue; | |
| 765 | + } | |
| 766 | + var controlValue = this.getControlValue(); | |
| 767 | + if (controlValue) { | |
| 768 | + return controlValue; | |
| 769 | + } | |
| 770 | + return this.getGlobalDefault(); | |
| 771 | + }, | |
| 772 | + isGlobalActive: function isGlobalActive() { | |
| 773 | + var _this$options$model$g; | |
| 774 | + return (_this$options$model$g = this.options.model.get('global')) === null || _this$options$model$g === void 0 ? void 0 : _this$options$model$g.active; | |
| 775 | + }, | |
| 776 | + setValue: function setValue(value) { | |
| 777 | + this.setSettingsModel(value); | |
| 778 | + }, | |
| 779 | + setSettingsModel: function setSettingsModel(value) { | |
| 780 | + var key = this.model.get('name'); | |
| 781 | + $e.run('document/elements/settings', { | |
| 782 | + container: this.options.container, | |
| 783 | + settings: (0, _defineProperty2.default)({}, key, value) | |
| 784 | + }); | |
| 785 | + this.triggerMethod('settings:change'); | |
| 786 | + }, | |
| 787 | + applySavedValue: function applySavedValue() { | |
| 788 | + this.setInputValue('[data-setting="' + this.model.get('name') + '"]', this.getControlValue()); | |
| 789 | + }, | |
| 790 | + getEditSettings: function getEditSettings(setting) { | |
| 791 | + var settings = this.getOption('elementEditSettings').toJSON(); | |
| 792 | + if (setting) { | |
| 793 | + return settings[setting]; | |
| 794 | + } | |
| 795 | + return settings; | |
| 796 | + }, | |
| 797 | + setEditSetting: function setEditSetting(settingKey, settingValue) { | |
| 798 | + var settings = this.getOption('elementEditSettings') || this.getOption('container').settings; | |
| 799 | + settings.set(settingKey, settingValue); | |
| 800 | + }, | |
| 801 | + /** | |
| 802 | + * Get the placeholder for the current control. | |
| 803 | + * | |
| 804 | + * @return {*} placeholder | |
| 805 | + */ | |
| 806 | + getControlPlaceholder: function getControlPlaceholder() { | |
| 807 | + var placeholder = this.model.get('placeholder'); | |
| 808 | + if (this.model.get('responsive') && this.model.get('inherit_placeholders')) { | |
| 809 | + placeholder = placeholder || this.container.placeholders[this.model.get('name')]; | |
| 810 | + } | |
| 811 | + return placeholder; | |
| 812 | + }, | |
| 813 | + /** | |
| 814 | + * Get the responsive parent view if exists. | |
| 815 | + * | |
| 816 | + * @return {ControlBaseDataView|undefined} responsive parent view if exists | |
| 817 | + */ | |
| 818 | + getResponsiveParentView: function getResponsiveParentView() { | |
| 819 | + var parent = this.model.get('parent'); | |
| 820 | + try { | |
| 821 | + return parent && this.container.panel.getControlView(parent); | |
| 822 | + // eslint-disable-next-line no-empty | |
| 823 | + } catch (e) {} | |
| 824 | + }, | |
| 825 | + /** | |
| 826 | + * Get the responsive children views if exists. | |
| 827 | + * | |
| 828 | + * @return {ControlBaseDataView|null} responsive children views if exists | |
| 829 | + */ | |
| 830 | + getResponsiveChildrenViews: function getResponsiveChildrenViews() { | |
| 831 | + var children = this.model.get('inheritors'), | |
| 832 | + views = []; | |
| 833 | + try { | |
| 834 | + var _iterator = _createForOfIteratorHelper(children), | |
| 835 | + _step; | |
| 836 | + try { | |
| 837 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 838 | + var child = _step.value; | |
| 839 | + views.push(this.container.panel.getControlView(child)); | |
| 840 | + } | |
| 841 | + // eslint-disable-next-line no-empty | |
| 842 | + } catch (err) { | |
| 843 | + _iterator.e(err); | |
| 844 | + } finally { | |
| 845 | + _iterator.f(); | |
| 846 | + } | |
| 847 | + } catch (e) {} | |
| 848 | + return views; | |
| 849 | + }, | |
| 850 | + /** | |
| 851 | + * Get prepared placeholder from the responsive parent, and put it into current | |
| 852 | + * control model as placeholder. | |
| 853 | + */ | |
| 854 | + setPlaceholderFromParent: function setPlaceholderFromParent() { | |
| 855 | + var parent = this.getResponsiveParentView(); | |
| 856 | + if (parent) { | |
| 857 | + this.container.placeholders[this.model.get('name')] = parent.preparePlaceholderForChildren(); | |
| 858 | + } | |
| 859 | + }, | |
| 860 | + /** | |
| 861 | + * Returns the value of the current control if exists, or the parent value if not, | |
| 862 | + * so responsive children can set it as their placeholder. When there are multiple | |
| 863 | + * inputs, the inputs which are empty on this control will inherit their values | |
| 864 | + * from the responsive parent. | |
| 865 | + * For example, if on desktop the padding of all edges is 10, and on tablet only | |
| 866 | + * padding right and left is set to 15, the mobile control placeholder will | |
| 867 | + * eventually be: { top: 10, right: 15, left: 15, bottom: 10 }, because of the | |
| 868 | + * inheritance of multiple values. | |
| 869 | + * | |
| 870 | + * @return {*} value of the current control if exists, or the parent value if not | |
| 871 | + */ | |
| 872 | + preparePlaceholderForChildren: function preparePlaceholderForChildren() { | |
| 873 | + var _this$getResponsivePa; | |
| 874 | + var cleanValue = this.getCleanControlValue(), | |
| 875 | + parentValue = (_this$getResponsivePa = this.getResponsiveParentView()) === null || _this$getResponsivePa === void 0 ? void 0 : _this$getResponsivePa.preparePlaceholderForChildren(); | |
| 876 | + if (cleanValue instanceof Object) { | |
| 877 | + return Object.assign({}, parentValue, cleanValue); | |
| 878 | + } | |
| 879 | + return cleanValue || parentValue; | |
| 880 | + }, | |
| 881 | + /** | |
| 882 | + * Start the re-rendering recursive chain from the responsive child of this | |
| 883 | + * control. It's useful when the current control value is changed and we want | |
| 884 | + * to update all responsive children. In this case, the re-rendering is supposed | |
| 885 | + * to be applied only from the responsive child of this control and on. | |
| 886 | + */ | |
| 887 | + propagatePlaceholder: function propagatePlaceholder() { | |
| 888 | + var children = this.getResponsiveChildrenViews(); | |
| 889 | + var _iterator2 = _createForOfIteratorHelper(children), | |
| 890 | + _step2; | |
| 891 | + try { | |
| 892 | + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | |
| 893 | + var child = _step2.value; | |
| 894 | + child.renderWithChildren(); | |
| 895 | + } | |
| 896 | + } catch (err) { | |
| 897 | + _iterator2.e(err); | |
| 898 | + } finally { | |
| 899 | + _iterator2.f(); | |
| 900 | + } | |
| 901 | + }, | |
| 902 | + /** | |
| 903 | + * Re-render current control and trigger this method on the responsive child. | |
| 904 | + * The purpose of those actions is to recursively re-render all responsive | |
| 905 | + * children. | |
| 906 | + */ | |
| 907 | + renderWithChildren: function renderWithChildren() { | |
| 908 | + this.render(); | |
| 909 | + this.propagatePlaceholder(); | |
| 910 | + }, | |
| 911 | + /** | |
| 912 | + * Get control value without empty properties, and without default values. | |
| 913 | + * | |
| 914 | + * @return {{}} control value without empty properties, and without default values | |
| 915 | + */ | |
| 916 | + getCleanControlValue: function getCleanControlValue() { | |
| 917 | + var value = this.getControlValue(); | |
| 918 | + return value && value !== this.model.get('default') ? value : undefined; | |
| 919 | + }, | |
| 920 | + onAfterChange: function onAfterChange(control) { | |
| 921 | + if (Object.keys(control.changed).includes(this.model.get('name'))) { | |
| 922 | + this.propagatePlaceholder(); | |
| 923 | + } | |
| 924 | + ControlBaseView.prototype.onAfterChange.apply(this, arguments); | |
| 925 | + }, | |
| 926 | + getInputValue: function getInputValue(input) { | |
| 927 | + var $input = this.$(input); | |
| 928 | + if ($input.is('[contenteditable="true"]')) { | |
| 929 | + return $input.html(); | |
| 930 | + } | |
| 931 | + var inputValue = $input.val(), | |
| 932 | + inputType = $input.attr('type'); | |
| 933 | + if (-1 !== ['radio', 'checkbox'].indexOf(inputType)) { | |
| 934 | + return $input.prop('checked') ? inputValue : ''; | |
| 935 | + } | |
| 936 | + if ('number' === inputType && _.isFinite(inputValue)) { | |
| 937 | + return +inputValue; | |
| 938 | + } | |
| 939 | + | |
| 940 | + // Temp fix for jQuery (< 3.0) that return null instead of empty array | |
| 941 | + if ('SELECT' === input.tagName && $input.prop('multiple') && null === inputValue) { | |
| 942 | + inputValue = []; | |
| 943 | + } | |
| 944 | + return inputValue; | |
| 945 | + }, | |
| 946 | + setInputValue: function setInputValue(input, value) { | |
| 947 | + var $input = this.$(input), | |
| 948 | + inputType = $input.attr('type'); | |
| 949 | + if ('checkbox' === inputType) { | |
| 950 | + $input.prop('checked', !!value); | |
| 951 | + } else if ('radio' === inputType) { | |
| 952 | + $input.filter('[value="' + value + '"]').prop('checked', true); | |
| 953 | + } else { | |
| 954 | + $input.val(value); | |
| 955 | + } | |
| 956 | + }, | |
| 957 | + addValidator: function addValidator(validator) { | |
| 958 | + this.validators.push(validator); | |
| 959 | + }, | |
| 960 | + registerValidators: function registerValidators() { | |
| 961 | + var _this = this; | |
| 962 | + this.validators = []; | |
| 963 | + var validationTerms = {}; | |
| 964 | + if (this.model.get('required')) { | |
| 965 | + validationTerms.required = true; | |
| 966 | + } | |
| 967 | + if (!jQuery.isEmptyObject(validationTerms)) { | |
| 968 | + this.addValidator(new this.validatorTypes.Base({ | |
| 969 | + validationTerms: validationTerms | |
| 970 | + })); | |
| 971 | + } | |
| 972 | + var validators = this.model.get('validators'); | |
| 973 | + if (validators) { | |
| 974 | + Object.entries(validators).forEach(function (_ref) { | |
| 975 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 976 | + key = _ref2[0], | |
| 977 | + args = _ref2[1]; | |
| 978 | + _this.addValidator(new _this.validatorTypes[key]({ | |
| 979 | + validationTerms: args | |
| 980 | + })); | |
| 981 | + }); | |
| 982 | + } | |
| 983 | + }, | |
| 984 | + onBeforeRender: function onBeforeRender() { | |
| 985 | + this.setPlaceholderFromParent(); | |
| 986 | + }, | |
| 987 | + onRender: function onRender() { | |
| 988 | + ControlBaseView.prototype.onRender.apply(this, arguments); | |
| 989 | + if (this.model.get('responsive')) { | |
| 990 | + this.renderResponsiveSwitchers(); | |
| 991 | + } | |
| 992 | + this.applySavedValue(); | |
| 993 | + this.triggerMethod('ready'); | |
| 994 | + this.toggleControlVisibility(); | |
| 995 | + this.addTooltip(); | |
| 996 | + }, | |
| 997 | + onBaseInputTextChange: function onBaseInputTextChange(event) { | |
| 998 | + this.onBaseInputChange(event); | |
| 999 | + }, | |
| 1000 | + onBaseInputChange: function onBaseInputChange(event) { | |
| 1001 | + clearTimeout(this.correctionTimeout); | |
| 1002 | + var input = event.currentTarget, | |
| 1003 | + value = this.getInputValue(input), | |
| 1004 | + validators = this.validators.slice(0), | |
| 1005 | + settingsValidators = this.container.settings.validators[this.model.get('name')]; | |
| 1006 | + if (settingsValidators) { | |
| 1007 | + validators = validators.concat(settingsValidators); | |
| 1008 | + } | |
| 1009 | + if (validators) { | |
| 1010 | + var oldValue = this.getControlValue(input.dataset.setting); | |
| 1011 | + var isValidValue = validators.every(function (validator) { | |
| 1012 | + return validator.isValid(value, oldValue); | |
| 1013 | + }); | |
| 1014 | + if (!isValidValue) { | |
| 1015 | + this.correctionTimeout = setTimeout(this.setInputValue.bind(this, input, oldValue), 1200); | |
| 1016 | + return; | |
| 1017 | + } | |
| 1018 | + } | |
| 1019 | + this.updateElementModel(value, input); | |
| 1020 | + this.triggerMethod('input:change', event); | |
| 1021 | + }, | |
| 1022 | + onResponsiveSwitchersClick: function onResponsiveSwitchersClick(event) { | |
| 1023 | + var $switcher = jQuery(event.currentTarget), | |
| 1024 | + device = $switcher.data('device'), | |
| 1025 | + $switchersWrapper = this.ui.responsiveSwitchersWrapper, | |
| 1026 | + selectedOption = $switcher.index(); | |
| 1027 | + $switchersWrapper.toggleClass('elementor-responsive-switchers-open'); | |
| 1028 | + $switchersWrapper[0].style.setProperty('--selected-option', selectedOption); | |
| 1029 | + this.triggerMethod('responsive:switcher:click', device); | |
| 1030 | + elementor.changeDeviceMode(device); | |
| 1031 | + }, | |
| 1032 | + renderResponsiveSwitchers: function renderResponsiveSwitchers() { | |
| 1033 | + var templateHtml = Marionette.Renderer.render('#tmpl-elementor-control-responsive-switchers', this.model.attributes); | |
| 1034 | + this.ui.responsiveSwitchersSibling.after(templateHtml); | |
| 1035 | + this.ui.responsiveSwitchersWrapper = this.$el.find('.elementor-control-responsive-switchers'); | |
| 1036 | + }, | |
| 1037 | + onAfterExternalChange: function onAfterExternalChange() { | |
| 1038 | + this.hideTooltip(); | |
| 1039 | + this.applySavedValue(); | |
| 1040 | + }, | |
| 1041 | + addTooltip: function addTooltip() { | |
| 1042 | + this.ui.tooltipTargets = this.$el.find('.tooltip-target'); | |
| 1043 | + if (!this.ui.tooltipTargets.length) { | |
| 1044 | + return; | |
| 1045 | + } | |
| 1046 | + | |
| 1047 | + // Create tooltip on controls | |
| 1048 | + this.ui.tooltipTargets.tipsy({ | |
| 1049 | + gravity: function gravity() { | |
| 1050 | + // `n` for down, `s` for up | |
| 1051 | + var gravity = jQuery(this).data('tooltip-pos'); | |
| 1052 | + if (undefined !== gravity) { | |
| 1053 | + return gravity; | |
| 1054 | + } | |
| 1055 | + return 's'; | |
| 1056 | + }, | |
| 1057 | + title: function title() { | |
| 1058 | + return this.getAttribute('data-tooltip'); | |
| 1059 | + } | |
| 1060 | + }); | |
| 1061 | + }, | |
| 1062 | + hideTooltip: function hideTooltip() { | |
| 1063 | + if (this.ui.tooltipTargets.length) { | |
| 1064 | + this.ui.tooltipTargets.tipsy('hide'); | |
| 1065 | + } | |
| 1066 | + }, | |
| 1067 | + updateElementModel: function updateElementModel(value) { | |
| 1068 | + this.setValue(value); | |
| 1069 | + } | |
| 1070 | +}, { | |
| 1071 | + // Static methods | |
| 1072 | + getStyleValue: function getStyleValue(placeholder, controlValue, controlData) { | |
| 1073 | + if ('DEFAULT' === placeholder) { | |
| 1074 | + return controlData.default; | |
| 1075 | + } | |
| 1076 | + return controlValue; | |
| 1077 | + }, | |
| 1078 | + onPasteStyle: function onPasteStyle() { | |
| 1079 | + return true; | |
| 1080 | + } | |
| 1081 | +}); | |
| 1082 | +module.exports = ControlBaseDataView; | |
| 1083 | + | |
| 1084 | +/***/ }), | |
| 1085 | + | |
| 1086 | +/***/ "../assets/dev/js/editor/controls/base.js": | |
| 1087 | +/*!************************************************!*\ | |
| 1088 | + !*** ../assets/dev/js/editor/controls/base.js ***! | |
| 1089 | + \************************************************/ | |
| 1090 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1091 | + | |
| 1092 | +"use strict"; | |
| 1093 | + | |
| 1094 | + | |
| 1095 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1096 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1097 | +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; } | |
| 1098 | +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; } | |
| 1099 | +var ControlBaseView; | |
| 1100 | +ControlBaseView = Marionette.CompositeView.extend({ | |
| 1101 | + ui: function ui() { | |
| 1102 | + return { | |
| 1103 | + controlTitle: '.elementor-control-title' | |
| 1104 | + }; | |
| 1105 | + }, | |
| 1106 | + behaviors: function behaviors() { | |
| 1107 | + var behaviors = {}; | |
| 1108 | + return elementor.hooks.applyFilters('controls/base/behaviors', behaviors, this); | |
| 1109 | + }, | |
| 1110 | + getBehavior: function getBehavior(name) { | |
| 1111 | + return this._behaviors[Object.keys(this.behaviors()).indexOf(name)]; | |
| 1112 | + }, | |
| 1113 | + className: function className() { | |
| 1114 | + // TODO: Any better classes for that? | |
| 1115 | + var classes = 'elementor-control elementor-control-' + this.model.get('name') + ' elementor-control-type-' + this.model.get('type'), | |
| 1116 | + modelClasses = this.model.get('classes'), | |
| 1117 | + responsive = this.model.get('responsive'); | |
| 1118 | + if (!_.isEmpty(modelClasses)) { | |
| 1119 | + classes += ' ' + modelClasses; | |
| 1120 | + } | |
| 1121 | + if (!_.isEmpty(responsive)) { | |
| 1122 | + var responsiveControlName = responsive.max || responsive.min; | |
| 1123 | + classes += ' elementor-control-responsive-' + responsiveControlName; | |
| 1124 | + } | |
| 1125 | + return classes; | |
| 1126 | + }, | |
| 1127 | + templateHelpers: function templateHelpers() { | |
| 1128 | + var controlData = { | |
| 1129 | + _cid: this.model.cid | |
| 1130 | + }; | |
| 1131 | + return { | |
| 1132 | + view: this, | |
| 1133 | + data: _.extend({}, this.model.toJSON(), controlData) | |
| 1134 | + }; | |
| 1135 | + }, | |
| 1136 | + getTemplate: function getTemplate() { | |
| 1137 | + return Marionette.TemplateCache.get('#tmpl-elementor-control-' + this.model.get('type') + '-content'); | |
| 1138 | + }, | |
| 1139 | + initialize: function initialize(options) { | |
| 1140 | + var label = this.model.get('label'); | |
| 1141 | + | |
| 1142 | + // TODO: Temp backwards compatibility. since 2.8.0. | |
| 1143 | + Object.defineProperty(this, 'container', { | |
| 1144 | + get: function get() { | |
| 1145 | + if (!options.container) { | |
| 1146 | + var settingsModel = options.elementSettingsModel, | |
| 1147 | + view = $e.components.get('document').utils.findViewById(settingsModel.id); | |
| 1148 | + | |
| 1149 | + // Element control. | |
| 1150 | + if (view && view.getContainer) { | |
| 1151 | + options.container = view.getContainer(); | |
| 1152 | + } else { | |
| 1153 | + if (!settingsModel.id) { | |
| 1154 | + settingsModel.id = 'bc-' + elementorCommon.helpers.getUniqueId(); | |
| 1155 | + } | |
| 1156 | + | |
| 1157 | + // Document/General/Other control. | |
| 1158 | + options.container = new elementorModules.editor.Container({ | |
| 1159 | + type: 'bc-container', | |
| 1160 | + id: settingsModel.id, | |
| 1161 | + model: settingsModel, | |
| 1162 | + settings: settingsModel, | |
| 1163 | + label: label, | |
| 1164 | + view: false, | |
| 1165 | + parent: false, | |
| 1166 | + renderer: false, | |
| 1167 | + controls: settingsModel.options.controls | |
| 1168 | + }); | |
| 1169 | + } | |
| 1170 | + } | |
| 1171 | + return options.container; | |
| 1172 | + } | |
| 1173 | + }); | |
| 1174 | + | |
| 1175 | + // Use `defineProperty` because `get elementSettingsModel()` fails during the `Marionette.CompositeView.extend`. | |
| 1176 | + Object.defineProperty(this, 'elementSettingsModel', { | |
| 1177 | + get: function get() { | |
| 1178 | + elementorDevTools.deprecation.deprecated('elementSettingsModel', '2.8.0', 'container.settings'); | |
| 1179 | + return options.container ? options.container.settings : options.elementSettingsModel; | |
| 1180 | + } | |
| 1181 | + }); | |
| 1182 | + var controlType = this.model.get('type'), | |
| 1183 | + controlSettings = jQuery.extend(true, {}, elementor.config.controls[controlType], this.model.attributes); | |
| 1184 | + this.model.set(controlSettings); | |
| 1185 | + | |
| 1186 | + // TODO: this.elementSettingsModel is deprecated since 2.8.0. | |
| 1187 | + var settings = this.container ? this.container.settings : this.elementSettingsModel; | |
| 1188 | + this.listenTo(settings, 'change', this.onAfterChange); | |
| 1189 | + if (this.model.attributes.responsive) { | |
| 1190 | + this.onDeviceModeChange = this.onDeviceModeChange.bind(this); | |
| 1191 | + elementor.listenTo(elementor.channels.deviceMode, 'change', this.onDeviceModeChange); | |
| 1192 | + } | |
| 1193 | + }, | |
| 1194 | + onDestroy: function onDestroy() { | |
| 1195 | + elementor.stopListening(elementor.channels.deviceMode, 'change', this.onDeviceModeChange); | |
| 1196 | + }, | |
| 1197 | + onDeviceModeChange: function onDeviceModeChange() { | |
| 1198 | + this.toggleControlVisibility(); | |
| 1199 | + }, | |
| 1200 | + onAfterChange: function onAfterChange() { | |
| 1201 | + this.toggleControlVisibility(); | |
| 1202 | + }, | |
| 1203 | + toggleControlVisibility: function toggleControlVisibility() { | |
| 1204 | + // TODO: this.elementSettingsModel is deprecated since 2.8.0. | |
| 1205 | + var settings = this.container ? this.container.settings : this.elementSettingsModel; | |
| 1206 | + var isVisible = elementor.helpers.isActiveControl(this.model, settings.attributes, settings.controls); | |
| 1207 | + this.$el.toggleClass('elementor-hidden-control', !isVisible); | |
| 1208 | + elementor.getPanelView().updateScrollbar(); | |
| 1209 | + }, | |
| 1210 | + onRender: function onRender() { | |
| 1211 | + var layoutType = this.model.get('label_block') ? 'block' : 'inline', | |
| 1212 | + showLabel = this.model.get('show_label'), | |
| 1213 | + elClasses = 'elementor-label-' + layoutType; | |
| 1214 | + elClasses += ' elementor-control-separator-' + this.model.get('separator'); | |
| 1215 | + if (!showLabel) { | |
| 1216 | + elClasses += ' elementor-control-hidden-label'; | |
| 1217 | + } | |
| 1218 | + this.$el.addClass(elClasses); | |
| 1219 | + this.toggleControlVisibility(); | |
| 1220 | + }, | |
| 1221 | + reRoute: function reRoute(controlActive) { | |
| 1222 | + $e.route($e.routes.getCurrent('panel'), this.getControlInRouteArgs(controlActive ? this.getControlPath() : ''), { | |
| 1223 | + history: false | |
| 1224 | + }); | |
| 1225 | + }, | |
| 1226 | + getControlInRouteArgs: function getControlInRouteArgs(path) { | |
| 1227 | + return _objectSpread(_objectSpread({}, $e.routes.getCurrentArgs('panel')), {}, { | |
| 1228 | + activeControl: path | |
| 1229 | + }); | |
| 1230 | + }, | |
| 1231 | + getControlPath: function getControlPath() { | |
| 1232 | + var controlPath = this.model.get('name'), | |
| 1233 | + parent = this._parent; | |
| 1234 | + while (!parent.$el.hasClass('elementor-controls-stack')) { | |
| 1235 | + var parentName = parent.model.get('name') || parent.model.get('_id'); | |
| 1236 | + controlPath = parentName + '/' + controlPath; | |
| 1237 | + parent = parent._parent; | |
| 1238 | + } | |
| 1239 | + return controlPath; | |
| 1240 | + } | |
| 1241 | +}); | |
| 1242 | +module.exports = ControlBaseView; | |
| 1243 | + | |
| 1244 | +/***/ }), | |
| 1245 | + | |
| 1246 | +/***/ "../assets/dev/js/editor/controls/switcher.js": | |
| 1247 | +/*!****************************************************!*\ | |
| 1248 | + !*** ../assets/dev/js/editor/controls/switcher.js ***! | |
| 1249 | + \****************************************************/ | |
| 1250 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1251 | + | |
| 1252 | +"use strict"; | |
| 1253 | + | |
| 1254 | + | |
| 1255 | +var ControlBaseDataView = __webpack_require__(/*! elementor-controls/base-data */ "../assets/dev/js/editor/controls/base-data.js"); | |
| 1256 | +module.exports = ControlBaseDataView.extend({ | |
| 1257 | + setInputValue: function setInputValue(input, value) { | |
| 1258 | + this.$(input).prop('checked', this.model.get('return_value') === value); | |
| 1259 | + } | |
| 1260 | +}, { | |
| 1261 | + onPasteStyle: function onPasteStyle(control, clipboardValue) { | |
| 1262 | + return !clipboardValue || clipboardValue === control.return_value; | |
| 1263 | + } | |
| 1264 | +}); | |
| 1265 | + | |
| 1266 | +/***/ }), | |
| 1267 | + | |
| 1268 | +/***/ "../modules/styleguide/assets/js/commands/enable.js": | |
| 1269 | +/*!**********************************************************!*\ | |
| 1270 | + !*** ../modules/styleguide/assets/js/commands/enable.js ***! | |
| 1271 | + \**********************************************************/ | |
| 1272 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1273 | + | |
| 1274 | +"use strict"; | |
| 1275 | + | |
| 1276 | + | |
| 1277 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1278 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1279 | + value: true | |
| 1280 | +})); | |
| 1281 | +exports["default"] = exports.Enable = void 0; | |
| 1282 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1283 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1284 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1285 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1286 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1287 | +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); }; } | |
| 1288 | +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; } } | |
| 1289 | +var Enable = /*#__PURE__*/function (_$e$modules$CommandBa) { | |
| 1290 | + (0, _inherits2.default)(Enable, _$e$modules$CommandBa); | |
| 1291 | + var _super = _createSuper(Enable); | |
| 1292 | + function Enable() { | |
| 1293 | + (0, _classCallCheck2.default)(this, Enable); | |
| 1294 | + return _super.apply(this, arguments); | |
| 1295 | + } | |
| 1296 | + (0, _createClass2.default)(Enable, [{ | |
| 1297 | + key: "apply", | |
| 1298 | + value: function apply(args) { | |
| 1299 | + $e.components.get('preview/styleguide').enableStyleguidePreview(args); | |
| 1300 | + } | |
| 1301 | + }]); | |
| 1302 | + return Enable; | |
| 1303 | +}($e.modules.CommandBase); | |
| 1304 | +exports.Enable = Enable; | |
| 1305 | +var _default = Enable; | |
| 1306 | +exports["default"] = _default; | |
| 1307 | + | |
| 1308 | +/***/ }), | |
| 1309 | + | |
| 1310 | +/***/ "../modules/styleguide/assets/js/commands/global-colors.js": | |
| 1311 | +/*!*****************************************************************!*\ | |
| 1312 | + !*** ../modules/styleguide/assets/js/commands/global-colors.js ***! | |
| 1313 | + \*****************************************************************/ | |
| 1314 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1315 | + | |
| 1316 | +"use strict"; | |
| 1317 | + | |
| 1318 | + | |
| 1319 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1320 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1321 | + value: true | |
| 1322 | +})); | |
| 1323 | +exports["default"] = exports.GlobalColors = void 0; | |
| 1324 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1325 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1326 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1327 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1328 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1329 | +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); }; } | |
| 1330 | +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; } } | |
| 1331 | +var GlobalColors = /*#__PURE__*/function (_$e$modules$CommandBa) { | |
| 1332 | + (0, _inherits2.default)(GlobalColors, _$e$modules$CommandBa); | |
| 1333 | + var _super = _createSuper(GlobalColors); | |
| 1334 | + function GlobalColors() { | |
| 1335 | + (0, _classCallCheck2.default)(this, GlobalColors); | |
| 1336 | + return _super.apply(this, arguments); | |
| 1337 | + } | |
| 1338 | + (0, _createClass2.default)(GlobalColors, [{ | |
| 1339 | + key: "apply", | |
| 1340 | + value: function apply() { | |
| 1341 | + $e.components.get('preview/styleguide').showStyleguidePreview(); | |
| 1342 | + } | |
| 1343 | + }]); | |
| 1344 | + return GlobalColors; | |
| 1345 | +}($e.modules.CommandBase); | |
| 1346 | +exports.GlobalColors = GlobalColors; | |
| 1347 | +var _default = GlobalColors; | |
| 1348 | +exports["default"] = _default; | |
| 1349 | + | |
| 1350 | +/***/ }), | |
| 1351 | + | |
| 1352 | +/***/ "../modules/styleguide/assets/js/commands/global-typography.js": | |
| 1353 | +/*!*********************************************************************!*\ | |
| 1354 | + !*** ../modules/styleguide/assets/js/commands/global-typography.js ***! | |
| 1355 | + \*********************************************************************/ | |
| 1356 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1357 | + | |
| 1358 | +"use strict"; | |
| 1359 | + | |
| 1360 | + | |
| 1361 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1362 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1363 | + value: true | |
| 1364 | +})); | |
| 1365 | +exports["default"] = exports.GlobalTypography = void 0; | |
| 1366 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1367 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1368 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1369 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1370 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1371 | +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); }; } | |
| 1372 | +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; } } | |
| 1373 | +var GlobalTypography = /*#__PURE__*/function (_$e$modules$CommandBa) { | |
| 1374 | + (0, _inherits2.default)(GlobalTypography, _$e$modules$CommandBa); | |
| 1375 | + var _super = _createSuper(GlobalTypography); | |
| 1376 | + function GlobalTypography() { | |
| 1377 | + (0, _classCallCheck2.default)(this, GlobalTypography); | |
| 1378 | + return _super.apply(this, arguments); | |
| 1379 | + } | |
| 1380 | + (0, _createClass2.default)(GlobalTypography, [{ | |
| 1381 | + key: "apply", | |
| 1382 | + value: function apply() { | |
| 1383 | + $e.components.get('preview/styleguide').showStyleguidePreview(); | |
| 1384 | + } | |
| 1385 | + }]); | |
| 1386 | + return GlobalTypography; | |
| 1387 | +}($e.modules.CommandBase); | |
| 1388 | +exports.GlobalTypography = GlobalTypography; | |
| 1389 | +var _default = GlobalTypography; | |
| 1390 | +exports["default"] = _default; | |
| 1391 | + | |
| 1392 | +/***/ }), | |
| 1393 | + | |
| 1394 | +/***/ "../modules/styleguide/assets/js/commands/hide.js": | |
| 1395 | +/*!********************************************************!*\ | |
| 1396 | + !*** ../modules/styleguide/assets/js/commands/hide.js ***! | |
| 1397 | + \********************************************************/ | |
| 1398 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1399 | + | |
| 1400 | +"use strict"; | |
| 1401 | + | |
| 1402 | + | |
| 1403 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1404 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1405 | + value: true | |
| 1406 | +})); | |
| 1407 | +exports["default"] = exports.Hide = void 0; | |
| 1408 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1409 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1410 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1411 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1412 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1413 | +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); }; } | |
| 1414 | +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; } } | |
| 1415 | +var Hide = /*#__PURE__*/function (_$e$modules$CommandBa) { | |
| 1416 | + (0, _inherits2.default)(Hide, _$e$modules$CommandBa); | |
| 1417 | + var _super = _createSuper(Hide); | |
| 1418 | + function Hide() { | |
| 1419 | + (0, _classCallCheck2.default)(this, Hide); | |
| 1420 | + return _super.apply(this, arguments); | |
| 1421 | + } | |
| 1422 | + (0, _createClass2.default)(Hide, [{ | |
| 1423 | + key: "apply", | |
| 1424 | + value: function apply() { | |
| 1425 | + $e.components.get('preview/styleguide').hideStyleguidePreview(); | |
| 1426 | + } | |
| 1427 | + }]); | |
| 1428 | + return Hide; | |
| 1429 | +}($e.modules.CommandBase); | |
| 1430 | +exports.Hide = Hide; | |
| 1431 | +var _default = Hide; | |
| 1432 | +exports["default"] = _default; | |
| 1433 | + | |
| 1434 | +/***/ }), | |
| 1435 | + | |
| 1436 | +/***/ "../modules/styleguide/assets/js/commands/index.js": | |
| 1437 | +/*!*********************************************************!*\ | |
| 1438 | + !*** ../modules/styleguide/assets/js/commands/index.js ***! | |
| 1439 | + \*********************************************************/ | |
| 1440 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1441 | + | |
| 1442 | +"use strict"; | |
| 1443 | + | |
| 1444 | + | |
| 1445 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1446 | + value: true | |
| 1447 | +})); | |
| 1448 | +Object.defineProperty(exports, "Enable", ({ | |
| 1449 | + enumerable: true, | |
| 1450 | + get: function get() { | |
| 1451 | + return _enable.Enable; | |
| 1452 | + } | |
| 1453 | +})); | |
| 1454 | +Object.defineProperty(exports, "GlobalColors", ({ | |
| 1455 | + enumerable: true, | |
| 1456 | + get: function get() { | |
| 1457 | + return _globalColors.GlobalColors; | |
| 1458 | + } | |
| 1459 | +})); | |
| 1460 | +Object.defineProperty(exports, "GlobalTypography", ({ | |
| 1461 | + enumerable: true, | |
| 1462 | + get: function get() { | |
| 1463 | + return _globalTypography.GlobalTypography; | |
| 1464 | + } | |
| 1465 | +})); | |
| 1466 | +Object.defineProperty(exports, "Hide", ({ | |
| 1467 | + enumerable: true, | |
| 1468 | + get: function get() { | |
| 1469 | + return _hide.Hide; | |
| 1470 | + } | |
| 1471 | +})); | |
| 1472 | +Object.defineProperty(exports, "SwitcherChange", ({ | |
| 1473 | + enumerable: true, | |
| 1474 | + get: function get() { | |
| 1475 | + return _switcherChange.SwitcherChange; | |
| 1476 | + } | |
| 1477 | +})); | |
| 1478 | +var _enable = __webpack_require__(/*! ./enable */ "../modules/styleguide/assets/js/commands/enable.js"); | |
| 1479 | +var _globalColors = __webpack_require__(/*! ./global-colors */ "../modules/styleguide/assets/js/commands/global-colors.js"); | |
| 1480 | +var _globalTypography = __webpack_require__(/*! ./global-typography */ "../modules/styleguide/assets/js/commands/global-typography.js"); | |
| 1481 | +var _hide = __webpack_require__(/*! ./hide */ "../modules/styleguide/assets/js/commands/hide.js"); | |
| 1482 | +var _switcherChange = __webpack_require__(/*! ./switcher-change */ "../modules/styleguide/assets/js/commands/switcher-change.js"); | |
| 1483 | + | |
| 1484 | +/***/ }), | |
| 1485 | + | |
| 1486 | +/***/ "../modules/styleguide/assets/js/commands/switcher-change.js": | |
| 1487 | +/*!*******************************************************************!*\ | |
| 1488 | + !*** ../modules/styleguide/assets/js/commands/switcher-change.js ***! | |
| 1489 | + \*******************************************************************/ | |
| 1490 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1491 | + | |
| 1492 | +"use strict"; | |
| 1493 | + | |
| 1494 | + | |
| 1495 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1496 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1497 | + value: true | |
| 1498 | +})); | |
| 1499 | +exports["default"] = exports.SwitcherChange = void 0; | |
| 1500 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1501 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1502 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1503 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1504 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1505 | +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); }; } | |
| 1506 | +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; } } | |
| 1507 | +var SwitcherChange = /*#__PURE__*/function (_$e$modules$CommandBa) { | |
| 1508 | + (0, _inherits2.default)(SwitcherChange, _$e$modules$CommandBa); | |
| 1509 | + var _super = _createSuper(SwitcherChange); | |
| 1510 | + function SwitcherChange() { | |
| 1511 | + (0, _classCallCheck2.default)(this, SwitcherChange); | |
| 1512 | + return _super.apply(this, arguments); | |
| 1513 | + } | |
| 1514 | + (0, _createClass2.default)(SwitcherChange, [{ | |
| 1515 | + key: "validateArgs", | |
| 1516 | + value: function validateArgs() { | |
| 1517 | + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 1518 | + this.requireArgumentType('name', 'string', args); | |
| 1519 | + this.requireArgumentType('value', 'string', args); | |
| 1520 | + } | |
| 1521 | + }, { | |
| 1522 | + key: "apply", | |
| 1523 | + value: function apply(args) { | |
| 1524 | + if (args.name.includes('enable_styleguide_preview')) { | |
| 1525 | + $e.components.get('preview/styleguide').enableStyleguidePreview({ | |
| 1526 | + value: args.value | |
| 1527 | + }); | |
| 1528 | + } | |
| 1529 | + } | |
| 1530 | + }]); | |
| 1531 | + return SwitcherChange; | |
| 1532 | +}($e.modules.CommandBase); | |
| 1533 | +exports.SwitcherChange = SwitcherChange; | |
| 1534 | +var _default = SwitcherChange; | |
| 1535 | +exports["default"] = _default; | |
| 1536 | + | |
| 1537 | +/***/ }), | |
| 1538 | + | |
| 1539 | +/***/ "../modules/styleguide/assets/js/controls/switcher.js": | |
| 1540 | +/*!************************************************************!*\ | |
| 1541 | + !*** ../modules/styleguide/assets/js/controls/switcher.js ***! | |
| 1542 | + \************************************************************/ | |
| 1543 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1544 | + | |
| 1545 | +"use strict"; | |
| 1546 | + | |
| 1547 | + | |
| 1548 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1549 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1550 | + value: true | |
| 1551 | +})); | |
| 1552 | +exports["default"] = void 0; | |
| 1553 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1554 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1555 | +var _get3 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 1556 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1557 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1558 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1559 | +var _switcher = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/editor/controls/switcher */ "../assets/dev/js/editor/controls/switcher.js")); | |
| 1560 | +var _baseData = _interopRequireDefault(__webpack_require__(/*! elementor-controls/base-data */ "../assets/dev/js/editor/controls/base-data.js")); | |
| 1561 | +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); }; } | |
| 1562 | +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; } } | |
| 1563 | +var _default = /*#__PURE__*/function (_Switcher) { | |
| 1564 | + (0, _inherits2.default)(_default, _Switcher); | |
| 1565 | + var _super = _createSuper(_default); | |
| 1566 | + function _default() { | |
| 1567 | + (0, _classCallCheck2.default)(this, _default); | |
| 1568 | + return _super.apply(this, arguments); | |
| 1569 | + } | |
| 1570 | + (0, _createClass2.default)(_default, [{ | |
| 1571 | + key: "initialize", | |
| 1572 | + value: function initialize() { | |
| 1573 | + _baseData.default.prototype.initialize.apply(this, arguments); | |
| 1574 | + this.$el.addClass('elementor-control-type-switcher'); | |
| 1575 | + } | |
| 1576 | + }, { | |
| 1577 | + key: "onBeforeRender", | |
| 1578 | + value: function onBeforeRender() { | |
| 1579 | + var _get2; | |
| 1580 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 1581 | + args[_key] = arguments[_key]; | |
| 1582 | + } | |
| 1583 | + (_get2 = (0, _get3.default)((0, _getPrototypeOf2.default)(_default.prototype), "onBeforeRender", this)).call.apply(_get2, [this].concat(args)); | |
| 1584 | + var actualValue = elementor.getPreferences('enable_styleguide_preview'); | |
| 1585 | + if (actualValue !== this.getCurrentValue()) { | |
| 1586 | + this.setValue(actualValue); | |
| 1587 | + } | |
| 1588 | + } | |
| 1589 | + }, { | |
| 1590 | + key: "onBaseInputChange", | |
| 1591 | + value: function onBaseInputChange(event) { | |
| 1592 | + _baseData.default.prototype.onBaseInputChange.apply(this, arguments); | |
| 1593 | + var input = event.currentTarget, | |
| 1594 | + value = this.getInputValue(input); | |
| 1595 | + if (this.model.get('on_change_command')) { | |
| 1596 | + this.runCommand(value); | |
| 1597 | + } | |
| 1598 | + this.model.set('return_value', null); | |
| 1599 | + } | |
| 1600 | + }, { | |
| 1601 | + key: "runCommand", | |
| 1602 | + value: function runCommand(value) { | |
| 1603 | + $e.run('preview/styleguide/switcher-change', { | |
| 1604 | + name: this.model.get('name'), | |
| 1605 | + value: value | |
| 1606 | + }); | |
| 1607 | + } | |
| 1608 | + }]); | |
| 1609 | + return _default; | |
| 1610 | +}(_switcher.default); | |
| 1611 | +exports["default"] = _default; | |
| 1612 | + | |
| 1613 | +/***/ }), | |
| 1614 | + | |
| 1615 | +/***/ "../modules/styleguide/assets/js/e-component.js": | |
| 1616 | +/*!******************************************************!*\ | |
| 1617 | + !*** ../modules/styleguide/assets/js/e-component.js ***! | |
| 1618 | + \******************************************************/ | |
| 1619 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1620 | + | |
| 1621 | +"use strict"; | |
| 1622 | + | |
| 1623 | + | |
| 1624 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1625 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1626 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1627 | + value: true | |
| 1628 | +})); | |
| 1629 | +exports["default"] = void 0; | |
| 1630 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1631 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1632 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1633 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1634 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1635 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands */ "../modules/styleguide/assets/js/commands/index.js")); | |
| 1636 | +var _switcher = _interopRequireDefault(__webpack_require__(/*! ./controls/switcher */ "../modules/styleguide/assets/js/controls/switcher.js")); | |
| 1637 | +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); } | |
| 1638 | +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; } | |
| 1639 | +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); }; } | |
| 1640 | +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; } } | |
| 1641 | +var _default = /*#__PURE__*/function (_$e$modules$Component) { | |
| 1642 | + (0, _inherits2.default)(_default, _$e$modules$Component); | |
| 1643 | + var _super = _createSuper(_default); | |
| 1644 | + function _default(args) { | |
| 1645 | + var _this; | |
| 1646 | + (0, _classCallCheck2.default)(this, _default); | |
| 1647 | + _this = _super.call(this, args); | |
| 1648 | + elementor.addControlView('global-style-switcher', _switcher.default); | |
| 1649 | + _this.registerStyleguideDialogType(); | |
| 1650 | + elementor.once('preview:loaded', function () { | |
| 1651 | + _this.initModal(); | |
| 1652 | + }); | |
| 1653 | + return _this; | |
| 1654 | + } | |
| 1655 | + (0, _createClass2.default)(_default, [{ | |
| 1656 | + key: "getNamespace", | |
| 1657 | + value: function getNamespace() { | |
| 1658 | + return 'preview/styleguide'; | |
| 1659 | + } | |
| 1660 | + }, { | |
| 1661 | + key: "defaultCommands", | |
| 1662 | + value: function defaultCommands() { | |
| 1663 | + return this.importCommands(commands); | |
| 1664 | + } | |
| 1665 | + }, { | |
| 1666 | + key: "registerStyleguideDialogType", | |
| 1667 | + value: function registerStyleguideDialogType() { | |
| 1668 | + DialogsManager.addWidgetType('styleguide', DialogsManager.getWidgetType('lightbox').extend('alert', { | |
| 1669 | + buildWidget: function buildWidget() { | |
| 1670 | + DialogsManager.getWidgetType('lightbox').prototype.buildWidget.apply(this, arguments); | |
| 1671 | + var $widgetContent = this.addElement('widgetContent'), | |
| 1672 | + elements = this.getElements(); | |
| 1673 | + $widgetContent.append(elements.message); | |
| 1674 | + elements.widget.html($widgetContent); | |
| 1675 | + } | |
| 1676 | + })); | |
| 1677 | + } | |
| 1678 | + }, { | |
| 1679 | + key: "initModal", | |
| 1680 | + value: function initModal() { | |
| 1681 | + var modal; | |
| 1682 | + this.getModal = function () { | |
| 1683 | + if (modal) { | |
| 1684 | + return modal; | |
| 1685 | + } | |
| 1686 | + modal = elementorCommon.dialogsManager.createWidget('styleguide', { | |
| 1687 | + id: 'e-styleguide-preview-dialog', | |
| 1688 | + message: "<div class=\"e-styleguide-preview-root\"></div>", | |
| 1689 | + position: { | |
| 1690 | + my: 'center center', | |
| 1691 | + at: 'center center' | |
| 1692 | + }, | |
| 1693 | + hide: { | |
| 1694 | + onOutsideClick: false, | |
| 1695 | + onEscKeyPress: false, | |
| 1696 | + onClick: false, | |
| 1697 | + onBackgroundClick: false | |
| 1698 | + }, | |
| 1699 | + container: elementor.$previewContents.find('body') | |
| 1700 | + }); | |
| 1701 | + return modal; | |
| 1702 | + }; | |
| 1703 | + } | |
| 1704 | + | |
| 1705 | + /** | |
| 1706 | + * Show the Styleguide Preview. | |
| 1707 | + * If skipPreferences is true, it will not check the User Preferences before showing the dialog. | |
| 1708 | + * | |
| 1709 | + * @param {boolean} skipPreferencesCheck | |
| 1710 | + */ | |
| 1711 | + }, { | |
| 1712 | + key: "showStyleguidePreview", | |
| 1713 | + value: function showStyleguidePreview() { | |
| 1714 | + var skipPreferencesCheck = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; | |
| 1715 | + if (this.getModal().isVisible() || !skipPreferencesCheck && !elementor.getPreferences('enable_styleguide_preview')) { | |
| 1716 | + return; | |
| 1717 | + } | |
| 1718 | + this.getPreviewFrame().postMessage({ | |
| 1719 | + name: 'elementor/styleguide/preview/show' | |
| 1720 | + }, '*'); | |
| 1721 | + this.getModal().show(); | |
| 1722 | + } | |
| 1723 | + | |
| 1724 | + /** | |
| 1725 | + * Hide the Styleguide Preview. | |
| 1726 | + */ | |
| 1727 | + }, { | |
| 1728 | + key: "hideStyleguidePreview", | |
| 1729 | + value: function hideStyleguidePreview() { | |
| 1730 | + this.getPreviewFrame().postMessage({ | |
| 1731 | + name: 'elementor/styleguide/preview/hide' | |
| 1732 | + }, '*'); | |
| 1733 | + this.getModal().hide(); | |
| 1734 | + } | |
| 1735 | + | |
| 1736 | + /** | |
| 1737 | + * Update the User Preferences to show the global settings. | |
| 1738 | + * Triggered on switcher change at Global Colors / Global Typography panels. | |
| 1739 | + * | |
| 1740 | + * @param {Array} options | |
| 1741 | + */ | |
| 1742 | + }, { | |
| 1743 | + key: "enableStyleguidePreview", | |
| 1744 | + value: function enableStyleguidePreview(options) { | |
| 1745 | + if (options.value) { | |
| 1746 | + this.showStyleguidePreview(true); | |
| 1747 | + } else { | |
| 1748 | + this.hideStyleguidePreview(); | |
| 1749 | + } | |
| 1750 | + $e.run('document/elements/settings', { | |
| 1751 | + container: elementor.settings.editorPreferences.getEditedView().getContainer(), | |
| 1752 | + settings: { | |
| 1753 | + enable_styleguide_preview: options.value | |
| 1754 | + }, | |
| 1755 | + options: { | |
| 1756 | + external: true | |
| 1757 | + } | |
| 1758 | + }); | |
| 1759 | + } | |
| 1760 | + | |
| 1761 | + /** | |
| 1762 | + * Check if the current script context is the Editor. | |
| 1763 | + * | |
| 1764 | + * @return {boolean} | |
| 1765 | + */ | |
| 1766 | + }, { | |
| 1767 | + key: "isInEditor", | |
| 1768 | + value: function isInEditor() { | |
| 1769 | + return !!window.elementor; | |
| 1770 | + } | |
| 1771 | + | |
| 1772 | + /** | |
| 1773 | + * Get the Preview Frame. | |
| 1774 | + * | |
| 1775 | + * @return {Window} | |
| 1776 | + */ | |
| 1777 | + }, { | |
| 1778 | + key: "getPreviewFrame", | |
| 1779 | + value: function getPreviewFrame() { | |
| 1780 | + return this.isInEditor() ? elementor.$preview[0].contentWindow : window; | |
| 1781 | + } | |
| 1782 | + }]); | |
| 1783 | + return _default; | |
| 1784 | +}($e.modules.ComponentBase); | |
| 1785 | +exports["default"] = _default; | |
| 1786 | + | |
| 1787 | +/***/ }), | |
| 1788 | + | |
| 1789 | +/***/ "@wordpress/i18n": | |
| 1790 | +/*!**************************!*\ | |
| 1791 | + !*** external "wp.i18n" ***! | |
| 1792 | + \**************************/ | |
| 1793 | +/***/ ((module) => { | |
| 1794 | + | |
| 1795 | +"use strict"; | |
| 1796 | +module.exports = wp.i18n; | |
| 1797 | + | |
| 1798 | +/***/ }), | |
| 1799 | + | |
| 1800 | +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 1801 | +/*!******************************************************************!*\ | |
| 1802 | + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 1803 | + \******************************************************************/ | |
| 1804 | +/***/ ((module) => { | |
| 1805 | + | |
| 1806 | +function _arrayLikeToArray(arr, len) { | |
| 1807 | + if (len == null || len > arr.length) len = arr.length; | |
| 1808 | + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | |
| 1809 | + return arr2; | |
| 1810 | +} | |
| 1811 | +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1812 | + | |
| 1813 | +/***/ }), | |
| 1814 | + | |
| 1815 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 1816 | +/*!****************************************************************!*\ | |
| 1817 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 1818 | + \****************************************************************/ | |
| 1819 | +/***/ ((module) => { | |
| 1820 | + | |
| 1821 | +function _arrayWithHoles(arr) { | |
| 1822 | + if (Array.isArray(arr)) return arr; | |
| 1823 | +} | |
| 1824 | +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1825 | + | |
| 1826 | +/***/ }), | |
| 1827 | + | |
| 1828 | +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 1829 | +/*!***********************************************************************!*\ | |
| 1830 | + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 1831 | + \***********************************************************************/ | |
| 1832 | +/***/ ((module) => { | |
| 1833 | + | |
| 1834 | +function _assertThisInitialized(self) { | |
| 1835 | + if (self === void 0) { | |
| 1836 | + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 1837 | + } | |
| 1838 | + return self; | |
| 1839 | +} | |
| 1840 | +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1841 | + | |
| 1842 | +/***/ }), | |
| 1843 | + | |
| 1844 | +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 1845 | +/*!****************************************************************!*\ | |
| 1846 | + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 1847 | + \****************************************************************/ | |
| 1848 | +/***/ ((module) => { | |
| 1849 | + | |
| 1850 | +function _classCallCheck(instance, Constructor) { | |
| 1851 | + if (!(instance instanceof Constructor)) { | |
| 1852 | + throw new TypeError("Cannot call a class as a function"); | |
| 1853 | + } | |
| 1854 | +} | |
| 1855 | +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1856 | + | |
| 1857 | +/***/ }), | |
| 1858 | + | |
| 1859 | +/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 1860 | +/*!*************************************************************!*\ | |
| 1861 | + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 1862 | + \*************************************************************/ | |
| 1863 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1864 | + | |
| 1865 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 1866 | +function _defineProperties(target, props) { | |
| 1867 | + for (var i = 0; i < props.length; i++) { | |
| 1868 | + var descriptor = props[i]; | |
| 1869 | + descriptor.enumerable = descriptor.enumerable || false; | |
| 1870 | + descriptor.configurable = true; | |
| 1871 | + if ("value" in descriptor) descriptor.writable = true; | |
| 1872 | + Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor); | |
| 1873 | + } | |
| 1874 | +} | |
| 1875 | +function _createClass(Constructor, protoProps, staticProps) { | |
| 1876 | + if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
| 1877 | + if (staticProps) _defineProperties(Constructor, staticProps); | |
| 1878 | + Object.defineProperty(Constructor, "prototype", { | |
| 1879 | + writable: false | |
| 1880 | + }); | |
| 1881 | + return Constructor; | |
| 1882 | +} | |
| 1883 | +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1884 | + | |
| 1885 | +/***/ }), | |
| 1886 | + | |
| 1887 | +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 1888 | +/*!****************************************************************!*\ | |
| 1889 | + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 1890 | + \****************************************************************/ | |
| 1891 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1892 | + | |
| 1893 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 1894 | +function _defineProperty(obj, key, value) { | |
| 1895 | + key = toPropertyKey(key); | |
| 1896 | + if (key in obj) { | |
| 1897 | + Object.defineProperty(obj, key, { | |
| 1898 | + value: value, | |
| 1899 | + enumerable: true, | |
| 1900 | + configurable: true, | |
| 1901 | + writable: true | |
| 1902 | + }); | |
| 1903 | + } else { | |
| 1904 | + obj[key] = value; | |
| 1905 | + } | |
| 1906 | + return obj; | |
| 1907 | +} | |
| 1908 | +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1909 | + | |
| 1910 | +/***/ }), | |
| 1911 | + | |
| 1912 | +/***/ "../node_modules/@babel/runtime/helpers/get.js": | |
| 1913 | +/*!*****************************************************!*\ | |
| 1914 | + !*** ../node_modules/@babel/runtime/helpers/get.js ***! | |
| 1915 | + \*****************************************************/ | |
| 1916 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1917 | + | |
| 1918 | +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); | |
| 1919 | +function _get() { | |
| 1920 | + if (typeof Reflect !== "undefined" && Reflect.get) { | |
| 1921 | + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1922 | + } else { | |
| 1923 | + module.exports = _get = function _get(target, property, receiver) { | |
| 1924 | + var base = superPropBase(target, property); | |
| 1925 | + if (!base) return; | |
| 1926 | + var desc = Object.getOwnPropertyDescriptor(base, property); | |
| 1927 | + if (desc.get) { | |
| 1928 | + return desc.get.call(arguments.length < 3 ? target : receiver); | |
| 1929 | + } | |
| 1930 | + return desc.value; | |
| 1931 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1932 | + } | |
| 1933 | + return _get.apply(this, arguments); | |
| 1934 | +} | |
| 1935 | +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1936 | + | |
| 1937 | +/***/ }), | |
| 1938 | + | |
| 1939 | +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 1940 | +/*!****************************************************************!*\ | |
| 1941 | + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 1942 | + \****************************************************************/ | |
| 1943 | +/***/ ((module) => { | |
| 1944 | + | |
| 1945 | +function _getPrototypeOf(o) { | |
| 1946 | + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | |
| 1947 | + return o.__proto__ || Object.getPrototypeOf(o); | |
| 1948 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1949 | + return _getPrototypeOf(o); | |
| 1950 | +} | |
| 1951 | +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1952 | + | |
| 1953 | +/***/ }), | |
| 1954 | + | |
| 1955 | +/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 1956 | +/*!**********************************************************!*\ | |
| 1957 | + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 1958 | + \**********************************************************/ | |
| 1959 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1960 | + | |
| 1961 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 1962 | +function _inherits(subClass, superClass) { | |
| 1963 | + if (typeof superClass !== "function" && superClass !== null) { | |
| 1964 | + throw new TypeError("Super expression must either be null or a function"); | |
| 1965 | + } | |
| 1966 | + subClass.prototype = Object.create(superClass && superClass.prototype, { | |
| 1967 | + constructor: { | |
| 1968 | + value: subClass, | |
| 1969 | + writable: true, | |
| 1970 | + configurable: true | |
| 1971 | + } | |
| 1972 | + }); | |
| 1973 | + Object.defineProperty(subClass, "prototype", { | |
| 1974 | + writable: false | |
| 1975 | + }); | |
| 1976 | + if (superClass) setPrototypeOf(subClass, superClass); | |
| 1977 | +} | |
| 1978 | +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1979 | + | |
| 1980 | +/***/ }), | |
| 1981 | + | |
| 1982 | +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 1983 | +/*!***********************************************************************!*\ | |
| 1984 | + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 1985 | + \***********************************************************************/ | |
| 1986 | +/***/ ((module) => { | |
| 1987 | + | |
| 1988 | +function _interopRequireDefault(obj) { | |
| 1989 | + return obj && obj.__esModule ? obj : { | |
| 1990 | + "default": obj | |
| 1991 | + }; | |
| 1992 | +} | |
| 1993 | +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1994 | + | |
| 1995 | +/***/ }), | |
| 1996 | + | |
| 1997 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 1998 | +/*!**********************************************************************!*\ | |
| 1999 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 2000 | + \**********************************************************************/ | |
| 2001 | +/***/ ((module) => { | |
| 2002 | + | |
| 2003 | +function _iterableToArrayLimit(r, l) { | |
| 2004 | + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 2005 | + if (null != t) { | |
| 2006 | + var e, | |
| 2007 | + n, | |
| 2008 | + i, | |
| 2009 | + u, | |
| 2010 | + a = [], | |
| 2011 | + f = !0, | |
| 2012 | + o = !1; | |
| 2013 | + try { | |
| 2014 | + if (i = (t = t.call(r)).next, 0 === l) { | |
| 2015 | + if (Object(t) !== t) return; | |
| 2016 | + f = !1; | |
| 2017 | + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 2018 | + } catch (r) { | |
| 2019 | + o = !0, n = r; | |
| 2020 | + } finally { | |
| 2021 | + try { | |
| 2022 | + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 2023 | + } finally { | |
| 2024 | + if (o) throw n; | |
| 2025 | + } | |
| 2026 | + } | |
| 2027 | + return a; | |
| 2028 | + } | |
| 2029 | +} | |
| 2030 | +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2031 | + | |
| 2032 | +/***/ }), | |
| 2033 | + | |
| 2034 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 2035 | +/*!*****************************************************************!*\ | |
| 2036 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 2037 | + \*****************************************************************/ | |
| 2038 | +/***/ ((module) => { | |
| 2039 | + | |
| 2040 | +function _nonIterableRest() { | |
| 2041 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 2042 | +} | |
| 2043 | +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2044 | + | |
| 2045 | +/***/ }), | |
| 2046 | + | |
| 2047 | +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": | |
| 2048 | +/*!***************************************************************************!*\ | |
| 2049 | + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! | |
| 2050 | + \***************************************************************************/ | |
| 2051 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2052 | + | |
| 2053 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 2054 | +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); | |
| 2055 | +function _possibleConstructorReturn(self, call) { | |
| 2056 | + if (call && (_typeof(call) === "object" || typeof call === "function")) { | |
| 2057 | + return call; | |
| 2058 | + } else if (call !== void 0) { | |
| 2059 | + throw new TypeError("Derived constructors may only return object or undefined"); | |
| 2060 | + } | |
| 2061 | + return assertThisInitialized(self); | |
| 2062 | +} | |
| 2063 | +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2064 | + | |
| 2065 | +/***/ }), | |
| 2066 | + | |
| 2067 | +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 2068 | +/*!****************************************************************!*\ | |
| 2069 | + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 2070 | + \****************************************************************/ | |
| 2071 | +/***/ ((module) => { | |
| 2072 | + | |
| 2073 | +function _setPrototypeOf(o, p) { | |
| 2074 | + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | |
| 2075 | + o.__proto__ = p; | |
| 2076 | + return o; | |
| 2077 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2078 | + return _setPrototypeOf(o, p); | |
| 2079 | +} | |
| 2080 | +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2081 | + | |
| 2082 | +/***/ }), | |
| 2083 | + | |
| 2084 | +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 2085 | +/*!***************************************************************!*\ | |
| 2086 | + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 2087 | + \***************************************************************/ | |
| 2088 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2089 | + | |
| 2090 | +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 2091 | +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 2092 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 2093 | +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 2094 | +function _slicedToArray(arr, i) { | |
| 2095 | + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); | |
| 2096 | +} | |
| 2097 | +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2098 | + | |
| 2099 | +/***/ }), | |
| 2100 | + | |
| 2101 | +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": | |
| 2102 | +/*!***************************************************************!*\ | |
| 2103 | + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! | |
| 2104 | + \***************************************************************/ | |
| 2105 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2106 | + | |
| 2107 | +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 2108 | +function _superPropBase(object, property) { | |
| 2109 | + while (!Object.prototype.hasOwnProperty.call(object, property)) { | |
| 2110 | + object = getPrototypeOf(object); | |
| 2111 | + if (object === null) break; | |
| 2112 | + } | |
| 2113 | + return object; | |
| 2114 | +} | |
| 2115 | +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2116 | + | |
| 2117 | +/***/ }), | |
| 2118 | + | |
| 2119 | +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 2120 | +/*!*************************************************************!*\ | |
| 2121 | + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 2122 | + \*************************************************************/ | |
| 2123 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2124 | + | |
| 2125 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 2126 | +function toPrimitive(t, r) { | |
| 2127 | + if ("object" != _typeof(t) || !t) return t; | |
| 2128 | + var e = t[Symbol.toPrimitive]; | |
| 2129 | + if (void 0 !== e) { | |
| 2130 | + var i = e.call(t, r || "default"); | |
| 2131 | + if ("object" != _typeof(i)) return i; | |
| 2132 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 2133 | + } | |
| 2134 | + return ("string" === r ? String : Number)(t); | |
| 2135 | +} | |
| 2136 | +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2137 | + | |
| 2138 | +/***/ }), | |
| 2139 | + | |
| 2140 | +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 2141 | +/*!***************************************************************!*\ | |
| 2142 | + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 2143 | + \***************************************************************/ | |
| 2144 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2145 | + | |
| 2146 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 2147 | +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 2148 | +function toPropertyKey(t) { | |
| 2149 | + var i = toPrimitive(t, "string"); | |
| 2150 | + return "symbol" == _typeof(i) ? i : String(i); | |
| 2151 | +} | |
| 2152 | +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2153 | + | |
| 2154 | +/***/ }), | |
| 2155 | + | |
| 2156 | +/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 2157 | +/*!********************************************************!*\ | |
| 2158 | + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 2159 | + \********************************************************/ | |
| 2160 | +/***/ ((module) => { | |
| 2161 | + | |
| 2162 | +function _typeof(o) { | |
| 2163 | + "@babel/helpers - typeof"; | |
| 2164 | + | |
| 2165 | + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 2166 | + return typeof o; | |
| 2167 | + } : function (o) { | |
| 2168 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 2169 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); | |
| 2170 | +} | |
| 2171 | +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2172 | + | |
| 2173 | +/***/ }), | |
| 2174 | + | |
| 2175 | +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 2176 | +/*!****************************************************************************!*\ | |
| 2177 | + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 2178 | + \****************************************************************************/ | |
| 2179 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2180 | + | |
| 2181 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 2182 | +function _unsupportedIterableToArray(o, minLen) { | |
| 2183 | + if (!o) return; | |
| 2184 | + if (typeof o === "string") return arrayLikeToArray(o, minLen); | |
| 2185 | + var n = Object.prototype.toString.call(o).slice(8, -1); | |
| 2186 | + if (n === "Object" && o.constructor) n = o.constructor.name; | |
| 2187 | + if (n === "Map" || n === "Set") return Array.from(o); | |
| 2188 | + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); | |
| 2189 | +} | |
| 2190 | +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2191 | + | |
| 2192 | +/***/ }) | |
| 2193 | + | |
| 2194 | +/******/ }); | |
| 2195 | +/************************************************************************/ | |
| 2196 | +/******/ // The module cache | |
| 2197 | +/******/ var __webpack_module_cache__ = {}; | |
| 2198 | +/******/ | |
| 2199 | +/******/ // The require function | |
| 2200 | +/******/ function __webpack_require__(moduleId) { | |
| 2201 | +/******/ // Check if module is in cache | |
| 2202 | +/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 2203 | +/******/ if (cachedModule !== undefined) { | |
| 2204 | +/******/ return cachedModule.exports; | |
| 2205 | +/******/ } | |
| 2206 | +/******/ // Create a new module (and put it into the cache) | |
| 2207 | +/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 2208 | +/******/ // no module.id needed | |
| 2209 | +/******/ // no module.loaded needed | |
| 2210 | +/******/ exports: {} | |
| 2211 | +/******/ }; | |
| 2212 | +/******/ | |
| 2213 | +/******/ // Execute the module function | |
| 2214 | +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 2215 | +/******/ | |
| 2216 | +/******/ // Return the exports of the module | |
| 2217 | +/******/ return module.exports; | |
| 2218 | +/******/ } | |
| 2219 | +/******/ | |
| 2220 | +/************************************************************************/ | |
| 2221 | +var __webpack_exports__ = {}; | |
| 2222 | +// This entry need to be wrapped in an IIFE because it need to be in strict mode. | |
| 2223 | +(() => { | |
| 2224 | +"use strict"; | |
| 2225 | +/*!*****************************************************!*\ | |
| 2226 | + !*** ../modules/styleguide/assets/js/styleguide.js ***! | |
| 2227 | + \*****************************************************/ | |
| 2228 | + | |
| 2229 | + | |
| 2230 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2231 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2232 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2233 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 2234 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 2235 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 2236 | +var _eComponent = _interopRequireDefault(__webpack_require__(/*! ./e-component */ "../modules/styleguide/assets/js/e-component.js")); | |
| 2237 | +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); }; } | |
| 2238 | +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; } } | |
| 2239 | +var Styleguide = /*#__PURE__*/function (_elementorModules$edi) { | |
| 2240 | + (0, _inherits2.default)(Styleguide, _elementorModules$edi); | |
| 2241 | + var _super = _createSuper(Styleguide); | |
| 2242 | + function Styleguide() { | |
| 2243 | + (0, _classCallCheck2.default)(this, Styleguide); | |
| 2244 | + return _super.apply(this, arguments); | |
| 2245 | + } | |
| 2246 | + (0, _createClass2.default)(Styleguide, [{ | |
| 2247 | + key: "onInit", | |
| 2248 | + value: function onInit() { | |
| 2249 | + $e.components.register(new _eComponent.default()); | |
| 2250 | + this.addHooks(); | |
| 2251 | + } | |
| 2252 | + }, { | |
| 2253 | + key: "getGlobalRoutes", | |
| 2254 | + value: function getGlobalRoutes() { | |
| 2255 | + return { | |
| 2256 | + 'global-colors': 'panel/global/global-colors', | |
| 2257 | + 'global-typography': 'panel/global/global-typography' | |
| 2258 | + }; | |
| 2259 | + } | |
| 2260 | + }, { | |
| 2261 | + key: "addHooks", | |
| 2262 | + value: function addHooks() { | |
| 2263 | + elementor.hooks.addAction('panel/global/tab/before-show', this.show.bind(this)); | |
| 2264 | + elementor.hooks.addAction('panel/global/tab/before-destroy', this.hide.bind(this)); | |
| 2265 | + } | |
| 2266 | + | |
| 2267 | + /** | |
| 2268 | + * Function show() triggered before showing a new tab at the Globals panel. | |
| 2269 | + * | |
| 2270 | + * @param {Object} args | |
| 2271 | + */ | |
| 2272 | + }, { | |
| 2273 | + key: "show", | |
| 2274 | + value: function show(args) { | |
| 2275 | + if (!args.id || !(args.id in this.getGlobalRoutes())) { | |
| 2276 | + return; | |
| 2277 | + } | |
| 2278 | + $e.run("preview/styleguide/".concat(args.id)); | |
| 2279 | + } | |
| 2280 | + | |
| 2281 | + /** | |
| 2282 | + * Function hide() triggered before hiding a tab at the Globals panel. | |
| 2283 | + * | |
| 2284 | + * @param {Object} args | |
| 2285 | + */ | |
| 2286 | + }, { | |
| 2287 | + key: "hide", | |
| 2288 | + value: function hide(args) { | |
| 2289 | + if (!args.id || !(args.id in this.getGlobalRoutes())) { | |
| 2290 | + return; | |
| 2291 | + } | |
| 2292 | + var isGlobalsRoute = Object.values(this.getGlobalRoutes()).some(function (route) { | |
| 2293 | + return $e.routes.current.panel === route; | |
| 2294 | + }); | |
| 2295 | + if (isGlobalsRoute) { | |
| 2296 | + return; | |
| 2297 | + } | |
| 2298 | + $e.run('preview/styleguide/hide'); | |
| 2299 | + } | |
| 2300 | + }]); | |
| 2301 | + return Styleguide; | |
| 2302 | +}(elementorModules.editor.utils.Module); | |
| 2303 | +new Styleguide(); | |
| 2304 | +})(); | |
| 2305 | + | |
| 2306 | +/******/ })() | |
| 2307 | +; | |
| 1765 | 2308 | //# sourceMappingURL=styleguide.js.map |