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