| 1 |
/*! elementor - v3.25.0 - 28-10-2024 */ |
| 2 |
/******/ (() => { // webpackBootstrap |
| 3 |
/******/ var __webpack_modules__ = ({ |
| 4 |
|
| 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__) => { |
| 10 |
|
| 11 |
"use strict"; |
| 12 |
/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; |
| 13 |
|
| 14 |
|
| 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 |
} |
| 56 |
|
| 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 |
}); |
| 110 |
|
| 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'), {}); |
| 220 |
|
| 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 |
}); |
| 263 |
|
| 264 |
/***/ }), |
| 265 |
|
| 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) => { |
| 271 |
|
| 272 |
"use strict"; |
| 273 |
|
| 274 |
|
| 275 |
module.exports = Marionette.ItemView.extend({ |
| 276 |
className: 'elementor-tag-controls-stack-empty', |
| 277 |
template: '#tmpl-elementor-tag-controls-stack-empty' |
| 278 |
}); |
| 279 |
|
| 280 |
/***/ }), |
| 281 |
|
| 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__) => { |
| 287 |
|
| 288 |
"use strict"; |
| 289 |
|
| 290 |
|
| 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 |
}); |
| 317 |
|
| 318 |
/***/ }), |
| 319 |
|
| 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__) => { |
| 325 |
|
| 326 |
"use strict"; |
| 327 |
|
| 328 |
|
| 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 |
}); |
| 439 |
|
| 440 |
/***/ }), |
| 441 |
|
| 442 |
/***/ "../assets/dev/js/editor/components/validator/base.js": |
| 443 |
/*!************************************************************!*\ |
| 444 |
!*** ../assets/dev/js/editor/components/validator/base.js ***! |
| 445 |
\************************************************************/ |
| 446 |
/***/ ((module) => { |
| 447 |
|
| 448 |
"use strict"; |
| 449 |
|
| 450 |
|
| 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 |
}); |
| 483 |
|
| 484 |
/***/ }), |
| 485 |
|
| 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__) => { |
| 491 |
|
| 492 |
"use strict"; |
| 493 |
|
| 494 |
|
| 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 |
} |
| 525 |
|
| 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); |
| 562 |
|
| 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(); |
| 577 |
|
| 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 |
} |
| 582 |
|
| 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 |
} |
| 589 |
|
| 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 |
} |
| 595 |
|
| 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 |
} |
| 602 |
|
| 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; |
| 614 |
|
| 615 |
/***/ }), |
| 616 |
|
| 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 |
; |
| 2308 |
//# sourceMappingURL=styleguide.js.map |