PluginProbe
Elementor Website Builder – more than just a page builder / 3.31.4
Elementor Website Builder – more than just a page builder v3.31.4
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | assets/js/responsive-bar.js +579 -420 4.3.13.31.4 View file →
@@ -1,437 +1,596 @@
1 -(function(_wordpress_i18n) {
1 +/*! elementor - v3.31.0 - 08-09-2025 */
2 +/******/ (() => { // webpackBootstrap
3 +/******/ var __webpack_modules__ = ({
2 4
3 -//#region \0rolldown/runtime.js
4 - var __defProp = Object.defineProperty;
5 - var __name = (target, value) => __defProp(target, "name", {
6 - value,
7 - configurable: true
8 - });
5 +/***/ "../assets/dev/js/editor/regions/responsive-bar/responsive-bar.js":
6 +/*!************************************************************************!*\
7 + !*** ../assets/dev/js/editor/regions/responsive-bar/responsive-bar.js ***!
8 + \************************************************************************/
9 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9 10
10 -//#endregion
11 +"use strict";
11 12
12 -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
13 - function _classCallCheck(a, n) {
14 - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
15 - }
16 13
17 -//#endregion
18 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
19 - function _typeof(o) {
20 - "@babel/helpers - typeof";
21 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
22 - return typeof o;
23 - } : function(o) {
24 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
25 - }, _typeof(o);
26 - }
14 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
15 +Object.defineProperty(exports, "__esModule", ({
16 + value: true
17 +}));
18 +exports["default"] = void 0;
19 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
20 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
21 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
22 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
23 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
24 +var _view = _interopRequireDefault(__webpack_require__(/*! ./view */ "../assets/dev/js/editor/regions/responsive-bar/view.js"));
25 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
26 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
27 +var _default = exports["default"] = /*#__PURE__*/function (_Marionette$Region) {
28 + function _default() {
29 + (0, _classCallCheck2.default)(this, _default);
30 + return _callSuper(this, _default, arguments);
31 + }
32 + (0, _inherits2.default)(_default, _Marionette$Region);
33 + return (0, _createClass2.default)(_default, [{
34 + key: "initialize",
35 + value: function initialize() {
36 + var _this = this;
37 + this.show(new _view.default());
38 + elementor.panel.$el.on({
39 + resizestart: function resizestart() {
40 + return _this.onPanelResizeStart();
41 + },
42 + resizestop: function resizestop() {
43 + return _this.onPanelResizeStop();
44 + }
45 + });
46 + }
47 + }, {
48 + key: "onPanelResizeStart",
49 + value: function onPanelResizeStart() {
50 + this.$el.addClass('ui-resizable-resizing');
51 + }
52 + }, {
53 + key: "onPanelResizeStop",
54 + value: function onPanelResizeStop() {
55 + this.$el.removeClass('ui-resizable-resizing');
56 + }
57 + }]);
58 +}(Marionette.Region);
27 59
28 -//#endregion
29 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
30 - function toPrimitive(t, r) {
31 - if ("object" != _typeof(t) || !t) return t;
32 - var e = t[Symbol.toPrimitive];
33 - if (void 0 !== e) {
34 - var i = e.call(t, r || "default");
35 - if ("object" != _typeof(i)) return i;
36 - throw new TypeError("@@toPrimitive must return a primitive value.");
37 - }
38 - return ("string" === r ? String : Number)(t);
39 - }
60 +/***/ }),
40 61
41 -//#endregion
42 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
43 - function toPropertyKey(t) {
44 - var i = toPrimitive(t, "string");
45 - return "symbol" == _typeof(i) ? i : i + "";
46 - }
62 +/***/ "../assets/dev/js/editor/regions/responsive-bar/view.js":
63 +/*!**************************************************************!*\
64 + !*** ../assets/dev/js/editor/regions/responsive-bar/view.js ***!
65 + \**************************************************************/
66 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
47 67
48 -//#endregion
49 -//#region node_modules/@babel/runtime/helpers/esm/createClass.js
50 - function _defineProperties(e, r) {
51 - for (var t = 0; t < r.length; t++) {
52 - var o = r[t];
53 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
54 - }
55 - }
56 - function _createClass(e, r, t) {
57 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
58 - }
68 +"use strict";
69 +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
59 70
60 -//#endregion
61 -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
62 - function _assertThisInitialized(e) {
63 - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
64 - return e;
65 - }
66 71
67 -//#endregion
68 -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
69 - function _possibleConstructorReturn(t, e) {
70 - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
71 - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
72 - return _assertThisInitialized(t);
73 - }
72 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
73 +Object.defineProperty(exports, "__esModule", ({
74 + value: true
75 +}));
76 +exports["default"] = void 0;
77 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
78 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
79 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
80 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
81 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
82 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
83 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
84 +var View = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
85 + function View() {
86 + (0, _classCallCheck2.default)(this, View);
87 + return _callSuper(this, View, arguments);
88 + }
89 + (0, _inherits2.default)(View, _Marionette$ItemView);
90 + return (0, _createClass2.default)(View, [{
91 + key: "getTemplate",
92 + value: function getTemplate() {
93 + return '#tmpl-elementor-templates-responsive-bar';
94 + }
95 + }, {
96 + key: "id",
97 + value: function id() {
98 + return 'e-responsive-bar';
99 + }
100 + }, {
101 + key: "ui",
102 + value: function ui() {
103 + var prefix = '#' + this.id();
104 + return {
105 + switcherInput: '.e-responsive-bar-switcher__option input',
106 + switcherLabel: '.e-responsive-bar-switcher__option',
107 + switcher: prefix + '-switcher',
108 + sizeInputWidth: prefix + '__input-width',
109 + sizeInputHeight: prefix + '__input-height',
110 + scaleValue: prefix + '-scale__value',
111 + scalePlusButton: prefix + '-scale__plus',
112 + scaleMinusButton: prefix + '-scale__minus',
113 + scaleResetButton: prefix + '-scale__reset',
114 + closeButton: prefix + '__close-button',
115 + breakpointSettingsButton: prefix + '__settings-button'
116 + };
117 + }
118 + }, {
119 + key: "events",
120 + value: function events() {
121 + return {
122 + 'change @ui.switcherInput': 'onBreakpointSelected',
123 + 'input @ui.sizeInputWidth': 'onSizeInputChange',
124 + 'input @ui.sizeInputHeight': 'onSizeInputChange',
125 + 'click @ui.scalePlusButton': 'onScalePlusButtonClick',
126 + 'click @ui.scaleMinusButton': 'onScaleMinusButtonClick',
127 + 'click @ui.scaleResetButton': 'onScaleResetButtonClick',
128 + 'click @ui.closeButton': 'onCloseButtonClick',
129 + 'click @ui.breakpointSettingsButton': 'onBreakpointSettingsOpen'
130 + };
131 + }
132 + }, {
133 + key: "initialize",
134 + value: function initialize() {
135 + this.listenTo(elementor.channels.deviceMode, 'change', this.onDeviceModeChange);
136 + this.listenTo(elementor.channels.responsivePreview, 'resize', this.onPreviewResize);
137 + this.listenTo(elementor.channels.responsivePreview, 'open', this.onPreviewOpen);
138 + this.listenTo(elementor.channels.deviceMode, 'close', this.resetScale);
139 + }
140 + }, {
141 + key: "addTipsyToIconButtons",
142 + value: function addTipsyToIconButtons() {
143 + this.ui.switcherLabel.add(this.ui.closeButton).add(this.ui.breakpointSettingsButton).tipsy({
144 + html: true,
145 + gravity: 'n',
146 + title: function title() {
147 + return jQuery(this).data('tooltip');
148 + }
149 + });
150 + }
151 + }, {
152 + key: "restoreLastValidPreviewSize",
153 + value: function restoreLastValidPreviewSize() {
154 + var lastSize = elementor.channels.responsivePreview.request('size');
155 + this.ui.sizeInputWidth.val(lastSize.width).tipsy({
156 + html: true,
157 + trigger: 'manual',
158 + gravity: 'n',
159 + title: function title() {
160 + return __('The value inserted isn\'t in the breakpoint boundaries', 'elementor');
161 + }
162 + });
163 + var tipsy = this.ui.sizeInputWidth.data('tipsy');
164 + tipsy.show();
165 + setTimeout(function () {
166 + return tipsy.hide();
167 + }, 3000);
168 + }
169 + }, {
170 + key: "autoScale",
171 + value: function autoScale() {
172 + var handlesWidth = 40 * this.scalePercentage / 100,
173 + previewWidth = elementor.$previewWrapper.width() - handlesWidth,
174 + iframeWidth = parseInt(elementor.$preview.css('--e-editor-preview-width')),
175 + iframeScaleWidth = iframeWidth * this.scalePercentage / 100;
176 + if (iframeScaleWidth > previewWidth) {
177 + var scalePercentage = previewWidth / iframeWidth * 100;
178 + this.setScalePercentage(scalePercentage);
179 + } else {
180 + this.setScalePercentage();
181 + }
182 + this.scalePreview();
183 + }
184 + }, {
185 + key: "scalePreview",
186 + value: function scalePreview() {
187 + var scale = this.scalePercentage / 100;
188 + elementor.$previewWrapper.css('--e-preview-scale', scale);
189 + }
190 + }, {
191 + key: "resetScale",
192 + value: function resetScale() {
193 + this.setScalePercentage();
194 + this.scalePreview();
195 + }
196 + }, {
197 + key: "setScalePercentage",
198 + value: function setScalePercentage() {
199 + var scalePercentage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;
200 + this.scalePercentage = scalePercentage;
201 + this.ui.scaleValue.text(parseInt(this.scalePercentage));
202 + }
203 + }, {
204 + key: "onRender",
205 + value: function onRender() {
206 + this.addTipsyToIconButtons();
207 + this.setScalePercentage();
208 + }
209 + }, {
210 + key: "onDeviceModeChange",
211 + value: function onDeviceModeChange() {
212 + var currentDeviceMode = elementor.channels.deviceMode.request('currentMode'),
213 + $currentDeviceSwitcherInput = this.ui.switcherInput.filter('[value=' + currentDeviceMode + ']');
214 + this.setWidthHeightInputsEditableState();
215 + this.ui.switcherLabel.attr('aria-selected', false);
216 + $currentDeviceSwitcherInput.closest('label').attr('aria-selected', true);
217 + if (!$currentDeviceSwitcherInput.prop('checked')) {
218 + $currentDeviceSwitcherInput.prop('checked', true);
219 + }
220 + }
221 + }, {
222 + key: "onBreakpointSelected",
223 + value: function onBreakpointSelected(e) {
224 + var selectedDeviceMode = e.target.value;
225 + elementor.changeDeviceMode(selectedDeviceMode, false);
226 + this.autoScale();
227 + }
228 + }, {
229 + key: "onBreakpointSettingsOpen",
230 + value: function onBreakpointSettingsOpen() {
231 + var isWPPreviewMode = elementorCommon.elements.$body.hasClass('elementor-editor-preview');
232 + if (isWPPreviewMode) {
233 + elementor.exitPreviewMode();
234 + }
235 + var isInSettingsPanelActive = 'panel/global/menu' === elementor.documents.currentDocument.config.panel.default_route;
236 + if (isInSettingsPanelActive) {
237 + $e.run('panel/global/close');
238 + return;
239 + }
74 240
75 -//#endregion
76 -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
77 - function _getPrototypeOf(t) {
78 - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
79 - return t.__proto__ || Object.getPrototypeOf(t);
80 - }, _getPrototypeOf(t);
81 - }
241 + // Open Settings Panel for Global/Layout/Breakpoints Settings
242 + $e.run('editor/documents/switch', {
243 + id: elementor.config.kit_id,
244 + mode: 'autosave'
245 + }).then(function () {
246 + return $e.route('panel/global/settings-layout');
247 + })
248 + // TODO: Replace with a standard routing solution once one is available
249 + .then(function () {
250 + return jQuery('.elementor-control-section_breakpoints').trigger('click');
251 + });
252 + }
253 + }, {
254 + key: "onPreviewResize",
255 + value: function onPreviewResize() {
256 + if (this.updatingPreviewSize) {
257 + return;
258 + }
259 + var size = elementor.channels.responsivePreview.request('size');
260 + this.ui.sizeInputWidth.val(Math.round(size.width));
261 + this.ui.sizeInputHeight.val(Math.round(size.height));
262 + }
263 + }, {
264 + key: "onPreviewOpen",
265 + value: function onPreviewOpen() {
266 + this.setWidthHeightInputsEditableState();
267 + }
268 + }, {
269 + key: "setWidthHeightInputsEditableState",
270 + value: function setWidthHeightInputsEditableState() {
271 + var currentDeviceMode = elementor.channels.deviceMode.request('currentMode');
272 + // TODO: disable inputs
273 + if ('desktop' === currentDeviceMode) {
274 + this.ui.sizeInputWidth.attr('disabled', 'disabled');
275 + this.ui.sizeInputHeight.attr('disabled', 'disabled');
276 + } else {
277 + this.ui.sizeInputWidth.removeAttr('disabled');
278 + this.ui.sizeInputHeight.removeAttr('disabled');
279 + }
280 + }
281 + }, {
282 + key: "onCloseButtonClick",
283 + value: function onCloseButtonClick() {
284 + elementor.changeDeviceMode('desktop');
285 + // Force exit if device mode is already desktop
286 + elementor.exitDeviceMode();
287 + }
288 + }, {
289 + key: "onSizeInputChange",
290 + value: function onSizeInputChange() {
291 + var _this = this;
292 + clearTimeout(this.restorePreviewSizeTimeout);
293 + var size = {
294 + width: this.ui.sizeInputWidth.val(),
295 + height: this.ui.sizeInputHeight.val()
296 + };
297 + var currentDeviceConstrains = elementor.getCurrentDeviceConstrains();
298 + if (size.width < currentDeviceConstrains.minWidth || size.width > currentDeviceConstrains.maxWidth) {
299 + this.restorePreviewSizeTimeout = setTimeout(function () {
300 + return _this.restoreLastValidPreviewSize();
301 + }, 1500);
302 + return;
303 + }
304 + this.updatingPreviewSize = true;
305 + setTimeout(function () {
306 + return _this.updatingPreviewSize = false;
307 + }, 300);
308 + elementor.updatePreviewSize(size);
309 + this.autoScale();
310 + }
311 + }, {
312 + key: "onScalePlusButtonClick",
313 + value: function onScalePlusButtonClick() {
314 + var scaleUp = 0 === this.scalePercentage % 10 ? this.scalePercentage + 10 : Math.ceil(this.scalePercentage / 10) * 10;
315 + if (scaleUp > 200) {
316 + return;
317 + }
318 + this.setScalePercentage(scaleUp);
319 + this.scalePreview();
320 + }
321 + }, {
322 + key: "onScaleMinusButtonClick",
323 + value: function onScaleMinusButtonClick() {
324 + var scaleDown = 0 === this.scalePercentage % 10 ? this.scalePercentage - 10 : Math.floor(this.scalePercentage / 10) * 10;
325 + if (scaleDown < 50) {
326 + return;
327 + }
328 + this.setScalePercentage(scaleDown);
329 + this.scalePreview();
330 + }
331 + }, {
332 + key: "onScaleResetButtonClick",
333 + value: function onScaleResetButtonClick() {
334 + this.resetScale();
335 + }
336 + }]);
337 +}(Marionette.ItemView);
82 338
83 -//#endregion
84 -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
85 - function _setPrototypeOf(t, e) {
86 - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
87 - return t.__proto__ = e, t;
88 - }, _setPrototypeOf(t, e);
89 - }
339 +/***/ }),
90 340
91 -//#endregion
92 -//#region node_modules/@babel/runtime/helpers/esm/inherits.js
93 - function _inherits(t, e) {
94 - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
95 - t.prototype = Object.create(e && e.prototype, { constructor: {
96 - value: t,
97 - writable: !0,
98 - configurable: !0
99 - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
100 - }
341 +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
342 +/*!***********************************************************************!*\
343 + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
344 + \***********************************************************************/
345 +/***/ ((module) => {
101 346
102 -//#endregion
103 -//#region assets/dev/js/editor/regions/responsive-bar/view.js
104 - function _callSuper$1(t, o, e) {
105 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
106 - }
107 - __name(_callSuper$1, "_callSuper");
108 - function _isNativeReflectConstruct$1() {
109 - try {
110 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
111 - } catch (t) {}
112 - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
113 - return !!t;
114 - })();
115 - }
116 - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct");
117 - var View = /*#__PURE__*/ function(_Marionette$ItemView) {
118 - function View() {
119 - _classCallCheck(this, View);
120 - return _callSuper$1(this, View, arguments);
121 - }
122 - _inherits(View, _Marionette$ItemView);
123 - return _createClass(View, [
124 - {
125 - key: "getTemplate",
126 - value: function getTemplate() {
127 - return "#tmpl-elementor-templates-responsive-bar";
128 - }
129 - },
130 - {
131 - key: "id",
132 - value: function id() {
133 - return "e-responsive-bar";
134 - }
135 - },
136 - {
137 - key: "ui",
138 - value: function ui() {
139 - var prefix = "#" + this.id();
140 - return {
141 - switcherInput: ".e-responsive-bar-switcher__option input",
142 - switcherLabel: ".e-responsive-bar-switcher__option",
143 - switcher: prefix + "-switcher",
144 - sizeInputWidth: prefix + "__input-width",
145 - sizeInputHeight: prefix + "__input-height",
146 - scaleValue: prefix + "-scale__value",
147 - scalePlusButton: prefix + "-scale__plus",
148 - scaleMinusButton: prefix + "-scale__minus",
149 - scaleResetButton: prefix + "-scale__reset",
150 - closeButton: prefix + "__close-button",
151 - breakpointSettingsButton: prefix + "__settings-button"
152 - };
153 - }
154 - },
155 - {
156 - key: "events",
157 - value: function events() {
158 - return {
159 - "change @ui.switcherInput": "onBreakpointSelected",
160 - "input @ui.sizeInputWidth": "onSizeInputChange",
161 - "input @ui.sizeInputHeight": "onSizeInputChange",
162 - "click @ui.scalePlusButton": "onScalePlusButtonClick",
163 - "click @ui.scaleMinusButton": "onScaleMinusButtonClick",
164 - "click @ui.scaleResetButton": "onScaleResetButtonClick",
165 - "click @ui.closeButton": "onCloseButtonClick",
166 - "click @ui.breakpointSettingsButton": "onBreakpointSettingsOpen"
167 - };
168 - }
169 - },
170 - {
171 - key: "initialize",
172 - value: function initialize() {
173 - this.listenTo(elementor.channels.deviceMode, "change", this.onDeviceModeChange);
174 - this.listenTo(elementor.channels.responsivePreview, "resize", this.onPreviewResize);
175 - this.listenTo(elementor.channels.responsivePreview, "open", this.onPreviewOpen);
176 - this.listenTo(elementor.channels.deviceMode, "close", this.resetScale);
177 - }
178 - },
179 - {
180 - key: "addTipsyToIconButtons",
181 - value: function addTipsyToIconButtons() {
182 - this.ui.switcherLabel.add(this.ui.closeButton).add(this.ui.breakpointSettingsButton).tipsy({
183 - html: true,
184 - gravity: "n",
185 - title: function title() {
186 - return jQuery(this).data("tooltip");
187 - }
188 - });
189 - }
190 - },
191 - {
192 - key: "restoreLastValidPreviewSize",
193 - value: function restoreLastValidPreviewSize() {
194 - var lastSize = elementor.channels.responsivePreview.request("size");
195 - this.ui.sizeInputWidth.val(lastSize.width).tipsy({
196 - html: true,
197 - trigger: "manual",
198 - gravity: "n",
199 - title: function title() {
200 - return (0, _wordpress_i18n.__)("The value inserted isn't in the breakpoint boundaries", "elementor");
201 - }
202 - });
203 - var tipsy = this.ui.sizeInputWidth.data("tipsy");
204 - tipsy.show();
205 - setTimeout(function() {
206 - return tipsy.hide();
207 - }, 3e3);
208 - }
209 - },
210 - {
211 - key: "autoScale",
212 - value: function autoScale() {
213 - var handlesWidth = 40 * this.scalePercentage / 100;
214 - var previewWidth = elementor.$previewWrapper.width() - handlesWidth;
215 - var iframeWidth = parseInt(elementor.$preview.css("--e-editor-preview-width"));
216 - if (iframeWidth * this.scalePercentage / 100 > previewWidth) {
217 - var scalePercentage = previewWidth / iframeWidth * 100;
218 - this.setScalePercentage(scalePercentage);
219 - } else this.setScalePercentage();
220 - this.scalePreview();
221 - }
222 - },
223 - {
224 - key: "scalePreview",
225 - value: function scalePreview() {
226 - var scale = this.scalePercentage / 100;
227 - elementor.$previewWrapper.css("--e-preview-scale", scale);
228 - }
229 - },
230 - {
231 - key: "resetScale",
232 - value: function resetScale() {
233 - this.setScalePercentage();
234 - this.scalePreview();
235 - }
236 - },
237 - {
238 - key: "setScalePercentage",
239 - value: function setScalePercentage() {
240 - var scalePercentage = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 100;
241 - this.scalePercentage = scalePercentage;
242 - this.ui.scaleValue.text(parseInt(this.scalePercentage));
243 - }
244 - },
245 - {
246 - key: "onRender",
247 - value: function onRender() {
248 - this.addTipsyToIconButtons();
249 - this.setScalePercentage();
250 - }
251 - },
252 - {
253 - key: "onDeviceModeChange",
254 - value: function onDeviceModeChange() {
255 - var currentDeviceMode = elementor.channels.deviceMode.request("currentMode");
256 - var $currentDeviceSwitcherInput = this.ui.switcherInput.filter("[value=" + currentDeviceMode + "]");
257 - this.setWidthHeightInputsEditableState();
258 - this.ui.switcherLabel.attr("aria-selected", false);
259 - $currentDeviceSwitcherInput.closest("label").attr("aria-selected", true);
260 - if (!$currentDeviceSwitcherInput.prop("checked")) $currentDeviceSwitcherInput.prop("checked", true);
261 - }
262 - },
263 - {
264 - key: "onBreakpointSelected",
265 - value: function onBreakpointSelected(e) {
266 - var selectedDeviceMode = e.target.value;
267 - elementor.changeDeviceMode(selectedDeviceMode, false);
268 - this.autoScale();
269 - }
270 - },
271 - {
272 - key: "onBreakpointSettingsOpen",
273 - value: function onBreakpointSettingsOpen() {
274 - if (elementorCommon.elements.$body.hasClass("elementor-editor-preview")) elementor.exitPreviewMode();
275 - if ("panel/global/menu" === elementor.documents.currentDocument.config.panel.default_route) {
276 - $e.run("panel/global/close");
277 - return;
278 - }
279 - $e.run("editor/documents/switch", {
280 - id: elementor.config.kit_id,
281 - mode: "autosave"
282 - }).then(function() {
283 - return $e.route("panel/global/settings-layout");
284 - }).then(function() {
285 - return jQuery(".elementor-control-section_breakpoints").trigger("click");
286 - });
287 - }
288 - },
289 - {
290 - key: "onPreviewResize",
291 - value: function onPreviewResize() {
292 - if (this.updatingPreviewSize) return;
293 - var size = elementor.channels.responsivePreview.request("size");
294 - this.ui.sizeInputWidth.val(Math.round(size.width));
295 - this.ui.sizeInputHeight.val(Math.round(size.height));
296 - }
297 - },
298 - {
299 - key: "onPreviewOpen",
300 - value: function onPreviewOpen() {
301 - this.setWidthHeightInputsEditableState();
302 - }
303 - },
304 - {
305 - key: "setWidthHeightInputsEditableState",
306 - value: function setWidthHeightInputsEditableState() {
307 - if ("desktop" === elementor.channels.deviceMode.request("currentMode")) {
308 - this.ui.sizeInputWidth.attr("disabled", "disabled");
309 - this.ui.sizeInputHeight.attr("disabled", "disabled");
310 - } else {
311 - this.ui.sizeInputWidth.removeAttr("disabled");
312 - this.ui.sizeInputHeight.removeAttr("disabled");
313 - }
314 - }
315 - },
316 - {
317 - key: "onCloseButtonClick",
318 - value: function onCloseButtonClick() {
319 - elementor.changeDeviceMode("desktop");
320 - elementor.exitDeviceMode();
321 - }
322 - },
323 - {
324 - key: "onSizeInputChange",
325 - value: function onSizeInputChange() {
326 - var _this = this;
327 - clearTimeout(this.restorePreviewSizeTimeout);
328 - var size = {
329 - width: this.ui.sizeInputWidth.val(),
330 - height: this.ui.sizeInputHeight.val()
331 - };
332 - var currentDeviceConstrains = elementor.getCurrentDeviceConstrains();
333 - if (size.width < currentDeviceConstrains.minWidth || size.width > currentDeviceConstrains.maxWidth) {
334 - this.restorePreviewSizeTimeout = setTimeout(function() {
335 - return _this.restoreLastValidPreviewSize();
336 - }, 1500);
337 - return;
338 - }
339 - this.updatingPreviewSize = true;
340 - setTimeout(function() {
341 - return _this.updatingPreviewSize = false;
342 - }, 300);
343 - elementor.updatePreviewSize(size);
344 - this.autoScale();
345 - }
346 - },
347 - {
348 - key: "onScalePlusButtonClick",
349 - value: function onScalePlusButtonClick() {
350 - var scaleUp = 0 === this.scalePercentage % 10 ? this.scalePercentage + 10 : Math.ceil(this.scalePercentage / 10) * 10;
351 - if (scaleUp > 200) return;
352 - this.setScalePercentage(scaleUp);
353 - this.scalePreview();
354 - }
355 - },
356 - {
357 - key: "onScaleMinusButtonClick",
358 - value: function onScaleMinusButtonClick() {
359 - var scaleDown = 0 === this.scalePercentage % 10 ? this.scalePercentage - 10 : Math.floor(this.scalePercentage / 10) * 10;
360 - if (scaleDown < 50) return;
361 - this.setScalePercentage(scaleDown);
362 - this.scalePreview();
363 - }
364 - },
365 - {
366 - key: "onScaleResetButtonClick",
367 - value: function onScaleResetButtonClick() {
368 - this.resetScale();
369 - }
370 - }
371 - ]);
372 - }(Marionette.ItemView);
347 +function _assertThisInitialized(e) {
348 + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
349 + return e;
350 +}
351 +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
373 352
374 -//#endregion
375 -//#region assets/dev/js/editor/regions/responsive-bar/responsive-bar.js
376 - function _callSuper(t, o, e) {
377 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
378 - }
379 - function _isNativeReflectConstruct() {
380 - try {
381 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
382 - } catch (t) {}
383 - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
384 - return !!t;
385 - })();
386 - }
387 - var _default = /*#__PURE__*/ function(_Marionette$Region) {
388 - function _default() {
389 - _classCallCheck(this, _default);
390 - return _callSuper(this, _default, arguments);
391 - }
392 - _inherits(_default, _Marionette$Region);
393 - return _createClass(_default, [
394 - {
395 - key: "initialize",
396 - value: function initialize() {
397 - var _this = this;
398 - this.show(new View());
399 - elementor.panel.$el.on({
400 - resizestart: function resizestart() {
401 - return _this.onPanelResizeStart();
402 - },
403 - resizestop: function resizestop() {
404 - return _this.onPanelResizeStop();
405 - }
406 - });
407 - }
408 - },
409 - {
410 - key: "onPanelResizeStart",
411 - value: function onPanelResizeStart() {
412 - this.$el.addClass("ui-resizable-resizing");
413 - }
414 - },
415 - {
416 - key: "onPanelResizeStop",
417 - value: function onPanelResizeStop() {
418 - this.$el.removeClass("ui-resizable-resizing");
419 - }
420 - }
421 - ]);
422 - }(Marionette.Region);
353 +/***/ }),
423 354
424 -//#endregion
425 -//#region assets/dev/js/editor/regions/responsive-bar/index.js
426 - elementor.on("preview:loaded", function(isFirstLoad) {
427 - if (!isFirstLoad) return;
428 - elementor.addRegions({ responsiveBar: {
429 - el: "#elementor-responsive-bar",
430 - regionClass: _default
431 - } });
432 - elementor.trigger("responsiveBar:init");
433 - });
355 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
356 +/*!****************************************************************!*\
357 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
358 + \****************************************************************/
359 +/***/ ((module) => {
434 360
435 -//#endregion
436 -})(wp.i18n);
361 +function _classCallCheck(a, n) {
362 + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
363 +}
364 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
365 +
366 +/***/ }),
367 +
368 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
369 +/*!*************************************************************!*\
370 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
371 + \*************************************************************/
372 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
373 +
374 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
375 +function _defineProperties(e, r) {
376 + for (var t = 0; t < r.length; t++) {
377 + var o = r[t];
378 + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
379 + }
380 +}
381 +function _createClass(e, r, t) {
382 + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
383 + writable: !1
384 + }), e;
385 +}
386 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
387 +
388 +/***/ }),
389 +
390 +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
391 +/*!****************************************************************!*\
392 + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
393 + \****************************************************************/
394 +/***/ ((module) => {
395 +
396 +function _getPrototypeOf(t) {
397 + return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
398 + return t.__proto__ || Object.getPrototypeOf(t);
399 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t);
400 +}
401 +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
402 +
403 +/***/ }),
404 +
405 +/***/ "../node_modules/@babel/runtime/helpers/inherits.js":
406 +/*!**********************************************************!*\
407 + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
408 + \**********************************************************/
409 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
410 +
411 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
412 +function _inherits(t, e) {
413 + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
414 + t.prototype = Object.create(e && e.prototype, {
415 + constructor: {
416 + value: t,
417 + writable: !0,
418 + configurable: !0
419 + }
420 + }), Object.defineProperty(t, "prototype", {
421 + writable: !1
422 + }), e && setPrototypeOf(t, e);
423 +}
424 +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
425 +
426 +/***/ }),
427 +
428 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
429 +/*!***********************************************************************!*\
430 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
431 + \***********************************************************************/
432 +/***/ ((module) => {
433 +
434 +function _interopRequireDefault(e) {
435 + return e && e.__esModule ? e : {
436 + "default": e
437 + };
438 +}
439 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
440 +
441 +/***/ }),
442 +
443 +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
444 +/*!***************************************************************************!*\
445 + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
446 + \***************************************************************************/
447 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
448 +
449 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
450 +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
451 +function _possibleConstructorReturn(t, e) {
452 + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
453 + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
454 + return assertThisInitialized(t);
455 +}
456 +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
457 +
458 +/***/ }),
459 +
460 +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
461 +/*!****************************************************************!*\
462 + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
463 + \****************************************************************/
464 +/***/ ((module) => {
465 +
466 +function _setPrototypeOf(t, e) {
467 + return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
468 + return t.__proto__ = e, t;
469 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e);
470 +}
471 +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
472 +
473 +/***/ }),
474 +
475 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
476 +/*!*************************************************************!*\
477 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
478 + \*************************************************************/
479 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
480 +
481 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
482 +function toPrimitive(t, r) {
483 + if ("object" != _typeof(t) || !t) return t;
484 + var e = t[Symbol.toPrimitive];
485 + if (void 0 !== e) {
486 + var i = e.call(t, r || "default");
487 + if ("object" != _typeof(i)) return i;
488 + throw new TypeError("@@toPrimitive must return a primitive value.");
489 + }
490 + return ("string" === r ? String : Number)(t);
491 +}
492 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
493 +
494 +/***/ }),
495 +
496 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
497 +/*!***************************************************************!*\
498 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
499 + \***************************************************************/
500 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
501 +
502 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
503 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
504 +function toPropertyKey(t) {
505 + var i = toPrimitive(t, "string");
506 + return "symbol" == _typeof(i) ? i : i + "";
507 +}
508 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
509 +
510 +/***/ }),
511 +
512 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
513 +/*!********************************************************!*\
514 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
515 + \********************************************************/
516 +/***/ ((module) => {
517 +
518 +function _typeof(o) {
519 + "@babel/helpers - typeof";
520 +
521 + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
522 + return typeof o;
523 + } : function (o) {
524 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
525 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
526 +}
527 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
528 +
529 +/***/ }),
530 +
531 +/***/ "@wordpress/i18n":
532 +/*!**************************!*\
533 + !*** external "wp.i18n" ***!
534 + \**************************/
535 +/***/ ((module) => {
536 +
537 +"use strict";
538 +module.exports = wp.i18n;
539 +
540 +/***/ })
541 +
542 +/******/ });
543 +/************************************************************************/
544 +/******/ // The module cache
545 +/******/ var __webpack_module_cache__ = {};
546 +/******/
547 +/******/ // The require function
548 +/******/ function __webpack_require__(moduleId) {
549 +/******/ // Check if module is in cache
550 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
551 +/******/ if (cachedModule !== undefined) {
552 +/******/ return cachedModule.exports;
553 +/******/ }
554 +/******/ // Create a new module (and put it into the cache)
555 +/******/ var module = __webpack_module_cache__[moduleId] = {
556 +/******/ // no module.id needed
557 +/******/ // no module.loaded needed
558 +/******/ exports: {}
559 +/******/ };
560 +/******/
561 +/******/ // Execute the module function
562 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
563 +/******/
564 +/******/ // Return the exports of the module
565 +/******/ return module.exports;
566 +/******/ }
567 +/******/
568 +/************************************************************************/
569 +var __webpack_exports__ = {};
570 +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
571 +(() => {
572 +"use strict";
573 +/*!***************************************************************!*\
574 + !*** ../assets/dev/js/editor/regions/responsive-bar/index.js ***!
575 + \***************************************************************/
576 +
577 +
578 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
579 +var _responsiveBar = _interopRequireDefault(__webpack_require__(/*! elementor-regions/responsive-bar/responsive-bar */ "../assets/dev/js/editor/regions/responsive-bar/responsive-bar.js"));
580 +elementor.on('preview:loaded', function (isFirstLoad) {
581 + if (!isFirstLoad) {
582 + return;
583 + }
584 + elementor.addRegions({
585 + responsiveBar: {
586 + el: '#elementor-responsive-bar',
587 + regionClass: _responsiveBar.default
588 + }
589 + });
590 + elementor.trigger('responsiveBar:init');
591 +});
592 +})();
593 +
594 +/******/ })()
595 +;
437 596 //# sourceMappingURL=responsive-bar.js.map