← All changes
|
assets/js/packages/editor-responsive/editor-responsive.js
+2
-358
4.2.0-beta2
→
3.20.2
View file →
| @@ -1,358 +1,2 @@ | ||
| 1 | -/******/ (function() { // webpackBootstrap | |
| 2 | -/******/ "use strict"; | |
| 3 | -/******/ var __webpack_modules__ = ({ | |
| 4 | - | |
| 5 | -/***/ "./packages/packages/libs/editor-responsive/src/hooks/use-activate-breakpoint.ts": | |
| 6 | -/*!***************************************************************************************!*\ | |
| 7 | - !*** ./packages/packages/libs/editor-responsive/src/hooks/use-activate-breakpoint.ts ***! | |
| 8 | - \***************************************************************************************/ | |
| 9 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 10 | - | |
| 11 | -__webpack_require__.r(__webpack_exports__); | |
| 12 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 13 | -/* harmony export */ useActivateBreakpoint: function() { return /* binding */ useActivateBreakpoint; } | |
| 14 | -/* harmony export */ }); | |
| 15 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 16 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 17 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/editor-v1-adapters */ "@elementor/editor-v1-adapters"); | |
| 18 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__); | |
| 19 | - | |
| 20 | - | |
| 21 | -function useActivateBreakpoint() { | |
| 22 | - return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(breakpoint => { | |
| 23 | - return (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__.__privateRunCommand)('panel/change-device-mode', { | |
| 24 | - device: breakpoint | |
| 25 | - }); | |
| 26 | - }, []); | |
| 27 | -} | |
| 28 | - | |
| 29 | -/***/ }), | |
| 30 | - | |
| 31 | -/***/ "./packages/packages/libs/editor-responsive/src/hooks/use-active-breakpoint.ts": | |
| 32 | -/*!*************************************************************************************!*\ | |
| 33 | - !*** ./packages/packages/libs/editor-responsive/src/hooks/use-active-breakpoint.ts ***! | |
| 34 | - \*************************************************************************************/ | |
| 35 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 36 | - | |
| 37 | -__webpack_require__.r(__webpack_exports__); | |
| 38 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 39 | -/* harmony export */ useActiveBreakpoint: function() { return /* binding */ useActiveBreakpoint; } | |
| 40 | -/* harmony export */ }); | |
| 41 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor-v1-adapters */ "@elementor/editor-v1-adapters"); | |
| 42 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__); | |
| 43 | - | |
| 44 | -function useActiveBreakpoint() { | |
| 45 | - return (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__.__privateUseListenTo)((0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__.windowEvent)('elementor/device-mode/change'), getActiveBreakpoint); | |
| 46 | -} | |
| 47 | -function getActiveBreakpoint() { | |
| 48 | - const extendedWindow = window; | |
| 49 | - return extendedWindow.elementor?.channels?.deviceMode?.request?.('currentMode') || null; | |
| 50 | -} | |
| 51 | - | |
| 52 | -/***/ }), | |
| 53 | - | |
| 54 | -/***/ "./packages/packages/libs/editor-responsive/src/hooks/use-breakpoints-map.ts": | |
| 55 | -/*!***********************************************************************************!*\ | |
| 56 | - !*** ./packages/packages/libs/editor-responsive/src/hooks/use-breakpoints-map.ts ***! | |
| 57 | - \***********************************************************************************/ | |
| 58 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 59 | - | |
| 60 | -__webpack_require__.r(__webpack_exports__); | |
| 61 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 62 | -/* harmony export */ useBreakpointsMap: function() { return /* binding */ useBreakpointsMap; } | |
| 63 | -/* harmony export */ }); | |
| 64 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 65 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 66 | -/* harmony import */ var _use_breakpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-breakpoints */ "./packages/packages/libs/editor-responsive/src/hooks/use-breakpoints.ts"); | |
| 67 | - | |
| 68 | - | |
| 69 | -function useBreakpointsMap() { | |
| 70 | - const breakpoints = (0,_use_breakpoints__WEBPACK_IMPORTED_MODULE_1__.useBreakpoints)(); | |
| 71 | - return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { | |
| 72 | - const entries = breakpoints.map(breakpoint => [breakpoint.id, breakpoint]); | |
| 73 | - return Object.fromEntries(entries); | |
| 74 | - }, [breakpoints]); | |
| 75 | -} | |
| 76 | - | |
| 77 | -/***/ }), | |
| 78 | - | |
| 79 | -/***/ "./packages/packages/libs/editor-responsive/src/hooks/use-breakpoints.ts": | |
| 80 | -/*!*******************************************************************************!*\ | |
| 81 | - !*** ./packages/packages/libs/editor-responsive/src/hooks/use-breakpoints.ts ***! | |
| 82 | - \*******************************************************************************/ | |
| 83 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 84 | - | |
| 85 | -__webpack_require__.r(__webpack_exports__); | |
| 86 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 87 | -/* harmony export */ useBreakpoints: function() { return /* binding */ useBreakpoints; } | |
| 88 | -/* harmony export */ }); | |
| 89 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor-v1-adapters */ "@elementor/editor-v1-adapters"); | |
| 90 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__); | |
| 91 | -/* harmony import */ var _sync_get_breakpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../sync/get-breakpoints */ "./packages/packages/libs/editor-responsive/src/sync/get-breakpoints.ts"); | |
| 92 | - | |
| 93 | - | |
| 94 | -function useBreakpoints() { | |
| 95 | - return (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__.__privateUseListenTo)((0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_0__.v1ReadyEvent)(), _sync_get_breakpoints__WEBPACK_IMPORTED_MODULE_1__.getBreakpoints); | |
| 96 | -} | |
| 97 | - | |
| 98 | -/***/ }), | |
| 99 | - | |
| 100 | -/***/ "./packages/packages/libs/editor-responsive/src/sync/get-breakpoints-tree.ts": | |
| 101 | -/*!***********************************************************************************!*\ | |
| 102 | - !*** ./packages/packages/libs/editor-responsive/src/sync/get-breakpoints-tree.ts ***! | |
| 103 | - \***********************************************************************************/ | |
| 104 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 105 | - | |
| 106 | -__webpack_require__.r(__webpack_exports__); | |
| 107 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 108 | -/* harmony export */ getBreakpointsTree: function() { return /* binding */ getBreakpointsTree; } | |
| 109 | -/* harmony export */ }); | |
| 110 | -/* harmony import */ var _utils_get_breakpoints_by_widths__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/get-breakpoints-by-widths */ "./packages/packages/libs/editor-responsive/src/sync/utils/get-breakpoints-by-widths.ts"); | |
| 111 | - | |
| 112 | -function getBreakpointsTree() { | |
| 113 | - const { | |
| 114 | - minWidth, | |
| 115 | - defaults, | |
| 116 | - maxWidth | |
| 117 | - } = (0,_utils_get_breakpoints_by_widths__WEBPACK_IMPORTED_MODULE_0__.getBreakpointsByWidths)(); | |
| 118 | - const [rootBreakpoint] = defaults; | |
| 119 | - const rootNode = { | |
| 120 | - ...rootBreakpoint, | |
| 121 | - children: [] | |
| 122 | - }; | |
| 123 | - | |
| 124 | - // gets an array of breakpoints and nest one in the prior breakpoint | |
| 125 | - const buildBranch = breakpoints => { | |
| 126 | - let last = rootNode; | |
| 127 | - breakpoints.forEach(breakpoint => { | |
| 128 | - const newNode = { | |
| 129 | - ...breakpoint, | |
| 130 | - children: [] | |
| 131 | - }; | |
| 132 | - last.children.push(newNode); | |
| 133 | - last = newNode; | |
| 134 | - }); | |
| 135 | - }; | |
| 136 | - buildBranch(minWidth); | |
| 137 | - buildBranch(maxWidth); | |
| 138 | - return rootNode; | |
| 139 | -} | |
| 140 | - | |
| 141 | -/***/ }), | |
| 142 | - | |
| 143 | -/***/ "./packages/packages/libs/editor-responsive/src/sync/get-breakpoints.ts": | |
| 144 | -/*!******************************************************************************!*\ | |
| 145 | - !*** ./packages/packages/libs/editor-responsive/src/sync/get-breakpoints.ts ***! | |
| 146 | - \******************************************************************************/ | |
| 147 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 148 | - | |
| 149 | -__webpack_require__.r(__webpack_exports__); | |
| 150 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 151 | -/* harmony export */ getBreakpoints: function() { return /* binding */ getBreakpoints; } | |
| 152 | -/* harmony export */ }); | |
| 153 | -/* harmony import */ var _utils_get_breakpoints_by_widths__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/get-breakpoints-by-widths */ "./packages/packages/libs/editor-responsive/src/sync/utils/get-breakpoints-by-widths.ts"); | |
| 154 | - | |
| 155 | -function getBreakpoints() { | |
| 156 | - const { | |
| 157 | - minWidth, | |
| 158 | - defaults, | |
| 159 | - maxWidth | |
| 160 | - } = (0,_utils_get_breakpoints_by_widths__WEBPACK_IMPORTED_MODULE_0__.getBreakpointsByWidths)(); | |
| 161 | - return [...minWidth, ...defaults, ...maxWidth]; | |
| 162 | -} | |
| 163 | - | |
| 164 | -/***/ }), | |
| 165 | - | |
| 166 | -/***/ "./packages/packages/libs/editor-responsive/src/sync/utils/get-breakpoints-by-widths.ts": | |
| 167 | -/*!**********************************************************************************************!*\ | |
| 168 | - !*** ./packages/packages/libs/editor-responsive/src/sync/utils/get-breakpoints-by-widths.ts ***! | |
| 169 | - \**********************************************************************************************/ | |
| 170 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 171 | - | |
| 172 | -__webpack_require__.r(__webpack_exports__); | |
| 173 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 174 | -/* harmony export */ getBreakpointsByWidths: function() { return /* binding */ getBreakpointsByWidths; } | |
| 175 | -/* harmony export */ }); | |
| 176 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 177 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); | |
| 178 | - | |
| 179 | -function getBreakpointsByWidths() { | |
| 180 | - const { | |
| 181 | - breakpoints | |
| 182 | - } = window.elementor?.config?.responsive || {}; | |
| 183 | - if (!breakpoints || Object.entries(breakpoints).length === 0) { | |
| 184 | - return { | |
| 185 | - minWidth: [], | |
| 186 | - defaults: [], | |
| 187 | - maxWidth: [] | |
| 188 | - }; | |
| 189 | - } | |
| 190 | - const minWidth = []; | |
| 191 | - const maxWidth = []; | |
| 192 | - const defaults = [ | |
| 193 | - // Desktop breakpoint is not included in V1 config. | |
| 194 | - { | |
| 195 | - id: 'desktop', | |
| 196 | - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Desktop', 'elementor') | |
| 197 | - }]; | |
| 198 | - Object.entries(breakpoints).forEach(([id, v1Breakpoint]) => { | |
| 199 | - if (!v1Breakpoint.is_enabled) { | |
| 200 | - return; | |
| 201 | - } | |
| 202 | - const breakpoint = { | |
| 203 | - id: id, | |
| 204 | - label: v1Breakpoint.label, | |
| 205 | - width: v1Breakpoint.value, | |
| 206 | - type: v1Breakpoint.direction === 'min' ? 'min-width' : 'max-width' | |
| 207 | - }; | |
| 208 | - if (!breakpoint.width) { | |
| 209 | - defaults.push(breakpoint); | |
| 210 | - } else if (breakpoint.type === 'min-width') { | |
| 211 | - minWidth.push(breakpoint); | |
| 212 | - } else if (breakpoint.type === 'max-width') { | |
| 213 | - maxWidth.push(breakpoint); | |
| 214 | - } | |
| 215 | - }); | |
| 216 | - const byWidth = (a, b) => { | |
| 217 | - return a.width && b.width ? b.width - a.width : 0; | |
| 218 | - }; | |
| 219 | - return { | |
| 220 | - minWidth: minWidth.sort(byWidth), | |
| 221 | - defaults, | |
| 222 | - maxWidth: maxWidth.sort(byWidth) | |
| 223 | - }; | |
| 224 | -} | |
| 225 | - | |
| 226 | -/***/ }), | |
| 227 | - | |
| 228 | -/***/ "@elementor/editor-v1-adapters": | |
| 229 | -/*!***************************************************!*\ | |
| 230 | - !*** external ["elementorV2","editorV1Adapters"] ***! | |
| 231 | - \***************************************************/ | |
| 232 | -/***/ (function(module) { | |
| 233 | - | |
| 234 | -module.exports = window["elementorV2"]["editorV1Adapters"]; | |
| 235 | - | |
| 236 | -/***/ }), | |
| 237 | - | |
| 238 | -/***/ "@wordpress/i18n": | |
| 239 | -/*!******************************!*\ | |
| 240 | - !*** external ["wp","i18n"] ***! | |
| 241 | - \******************************/ | |
| 242 | -/***/ (function(module) { | |
| 243 | - | |
| 244 | -module.exports = window["wp"]["i18n"]; | |
| 245 | - | |
| 246 | -/***/ }), | |
| 247 | - | |
| 248 | -/***/ "react": | |
| 249 | -/*!**************************!*\ | |
| 250 | - !*** external ["React"] ***! | |
| 251 | - \**************************/ | |
| 252 | -/***/ (function(module) { | |
| 253 | - | |
| 254 | -module.exports = window["React"]; | |
| 255 | - | |
| 256 | -/***/ }) | |
| 257 | - | |
| 258 | -/******/ }); | |
| 259 | -/************************************************************************/ | |
| 260 | -/******/ // The module cache | |
| 261 | -/******/ var __webpack_module_cache__ = {}; | |
| 262 | -/******/ | |
| 263 | -/******/ // The require function | |
| 264 | -/******/ function __webpack_require__(moduleId) { | |
| 265 | -/******/ // Check if module is in cache | |
| 266 | -/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 267 | -/******/ if (cachedModule !== undefined) { | |
| 268 | -/******/ return cachedModule.exports; | |
| 269 | -/******/ } | |
| 270 | -/******/ // Create a new module (and put it into the cache) | |
| 271 | -/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 272 | -/******/ // no module.id needed | |
| 273 | -/******/ // no module.loaded needed | |
| 274 | -/******/ exports: {} | |
| 275 | -/******/ }; | |
| 276 | -/******/ | |
| 277 | -/******/ // Execute the module function | |
| 278 | -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 279 | -/******/ | |
| 280 | -/******/ // Return the exports of the module | |
| 281 | -/******/ return module.exports; | |
| 282 | -/******/ } | |
| 283 | -/******/ | |
| 284 | -/************************************************************************/ | |
| 285 | -/******/ /* webpack/runtime/compat get default export */ | |
| 286 | -/******/ !function() { | |
| 287 | -/******/ // getDefaultExport function for compatibility with non-harmony modules | |
| 288 | -/******/ __webpack_require__.n = function(module) { | |
| 289 | -/******/ var getter = module && module.__esModule ? | |
| 290 | -/******/ function() { return module['default']; } : | |
| 291 | -/******/ function() { return module; }; | |
| 292 | -/******/ __webpack_require__.d(getter, { a: getter }); | |
| 293 | -/******/ return getter; | |
| 294 | -/******/ }; | |
| 295 | -/******/ }(); | |
| 296 | -/******/ | |
| 297 | -/******/ /* webpack/runtime/define property getters */ | |
| 298 | -/******/ !function() { | |
| 299 | -/******/ // define getter functions for harmony exports | |
| 300 | -/******/ __webpack_require__.d = function(exports, definition) { | |
| 301 | -/******/ for(var key in definition) { | |
| 302 | -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 303 | -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 304 | -/******/ } | |
| 305 | -/******/ } | |
| 306 | -/******/ }; | |
| 307 | -/******/ }(); | |
| 308 | -/******/ | |
| 309 | -/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 310 | -/******/ !function() { | |
| 311 | -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } | |
| 312 | -/******/ }(); | |
| 313 | -/******/ | |
| 314 | -/******/ /* webpack/runtime/make namespace object */ | |
| 315 | -/******/ !function() { | |
| 316 | -/******/ // define __esModule on exports | |
| 317 | -/******/ __webpack_require__.r = function(exports) { | |
| 318 | -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 319 | -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 320 | -/******/ } | |
| 321 | -/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 322 | -/******/ }; | |
| 323 | -/******/ }(); | |
| 324 | -/******/ | |
| 325 | -/************************************************************************/ | |
| 326 | -var __webpack_exports__ = {}; | |
| 327 | -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. | |
| 328 | -!function() { | |
| 329 | -/*!***************************************************************!*\ | |
| 330 | - !*** ./packages/packages/libs/editor-responsive/src/index.ts ***! | |
| 331 | - \***************************************************************/ | |
| 332 | -__webpack_require__.r(__webpack_exports__); | |
| 333 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 334 | -/* harmony export */ getBreakpoints: function() { return /* reexport safe */ _sync_get_breakpoints__WEBPACK_IMPORTED_MODULE_4__.getBreakpoints; }, | |
| 335 | -/* harmony export */ getBreakpointsTree: function() { return /* reexport safe */ _sync_get_breakpoints_tree__WEBPACK_IMPORTED_MODULE_5__.getBreakpointsTree; }, | |
| 336 | -/* harmony export */ useActivateBreakpoint: function() { return /* reexport safe */ _hooks_use_activate_breakpoint__WEBPACK_IMPORTED_MODULE_0__.useActivateBreakpoint; }, | |
| 337 | -/* harmony export */ useActiveBreakpoint: function() { return /* reexport safe */ _hooks_use_active_breakpoint__WEBPACK_IMPORTED_MODULE_1__.useActiveBreakpoint; }, | |
| 338 | -/* harmony export */ useBreakpoints: function() { return /* reexport safe */ _hooks_use_breakpoints__WEBPACK_IMPORTED_MODULE_2__.useBreakpoints; }, | |
| 339 | -/* harmony export */ useBreakpointsMap: function() { return /* reexport safe */ _hooks_use_breakpoints_map__WEBPACK_IMPORTED_MODULE_3__.useBreakpointsMap; } | |
| 340 | -/* harmony export */ }); | |
| 341 | -/* harmony import */ var _hooks_use_activate_breakpoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hooks/use-activate-breakpoint */ "./packages/packages/libs/editor-responsive/src/hooks/use-activate-breakpoint.ts"); | |
| 342 | -/* harmony import */ var _hooks_use_active_breakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hooks/use-active-breakpoint */ "./packages/packages/libs/editor-responsive/src/hooks/use-active-breakpoint.ts"); | |
| 343 | -/* harmony import */ var _hooks_use_breakpoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hooks/use-breakpoints */ "./packages/packages/libs/editor-responsive/src/hooks/use-breakpoints.ts"); | |
| 344 | -/* harmony import */ var _hooks_use_breakpoints_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks/use-breakpoints-map */ "./packages/packages/libs/editor-responsive/src/hooks/use-breakpoints-map.ts"); | |
| 345 | -/* harmony import */ var _sync_get_breakpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sync/get-breakpoints */ "./packages/packages/libs/editor-responsive/src/sync/get-breakpoints.ts"); | |
| 346 | -/* harmony import */ var _sync_get_breakpoints_tree__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./sync/get-breakpoints-tree */ "./packages/packages/libs/editor-responsive/src/sync/get-breakpoints-tree.ts"); | |
| 347 | - | |
| 348 | - | |
| 349 | - | |
| 350 | - | |
| 351 | - | |
| 352 | - | |
| 353 | -}(); | |
| 354 | -(window.elementorV2 = window.elementorV2 || {}).editorResponsive = __webpack_exports__; | |
| 355 | -/******/ })() | |
| 356 | -; | |
| 357 | -window.elementorV2.editorResponsive?.init?.(); | |
| 358 | -//# sourceMappingURL=editor-responsive.js.map | |
| 1 | +/*! For license information please see editor-responsive.js.LICENSE.txt */ | |
| 2 | +!function(){"use strict";var e={react:function(e){e.exports=window.React},"@elementor/editor-app-bar":function(e){e.exports=window.elementorV2.editorAppBar},"@elementor/editor-v1-adapters":function(e){e.exports=window.elementorV2.editorV1Adapters},"@elementor/icons":function(e){e.exports=window.elementorV2.icons},"@elementor/store":function(e){e.exports=window.elementorV2.store},"@elementor/ui":function(e){e.exports=window.elementorV2.ui},"@wordpress/i18n":function(e){e.exports=window.wp.i18n}},t={};function o(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,o),r.exports}o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};!function(){o.r(i);var e=o("@elementor/store"),t=o("@elementor/editor-v1-adapters"),n=o("@wordpress/i18n"),r=o("@elementor/editor-app-bar"),a=o("react"),l=o("@elementor/ui"),c=o("@elementor/icons"),s=(0,e.__createSlice)({name:"breakpoints",initialState:{entities:{},activeId:null},reducers:{init(e,t){e.activeId=t.payload.activeId,e.entities=t.payload.entities.reduce(((e,t)=>({...e,[t.id]:t})),{})},activateBreakpoint(e,t){e.entities[t.payload]&&(e.activeId=t.payload)}}});function d(){const{breakpoints:e}=window.elementor?.config?.responsive||{};if(!e)return[];const t=Object.entries(e).filter((([,e])=>e.is_enabled)).map((([e,{value:t,direction:o,label:i}])=>({id:e,label:i,width:t,type:"min"===o?"min-width":"max-width"})));return t.push({id:"desktop",label:(0,n.__)("Desktop","elementor")}),t}function p(){const e=window;return e.elementor?.channels?.deviceMode?.request?.("currentMode")||null}var u=e=>e.breakpoints.entities,m=(0,e.__createSelector)(u,(e=>e.breakpoints.activeId),((e,t)=>t&&e[t]?e[t]:null)),v=(0,e.__createSelector)(u,(e=>{const t=(e,t)=>e.width&&t.width?t.width-e.width:0,o=Object.values(e),i=o.filter((e=>!e.width)),n=o.filter((e=>"min-width"===e.type)),r=o.filter((e=>"max-width"===e.type));return[...n.sort(t),...i,...r.sort(t)]}));function w(e){return a.createElement(l.Tooltip,{PopperProps:{sx:{"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom":{mt:2.5}}},...e})}var _={widescreen:c.WidescreenIcon,desktop:c.DesktopIcon,laptop:c.LaptopIcon,tablet_extra:c.TabletLandscapeIcon,tablet:c.TabletPortraitIcon,mobile_extra:c.MobileLandscapeIcon,mobile:c.MobilePortraitIcon},b={default:"%s","min-width":(0,n.__)("%s (%dpx and up)","elementor"),"max-width":(0,n.__)("%s (up to %dpx)","elementor")};(0,e.__registerSlice)(s),function(){const{init:o}=s.actions;(0,t.__privateListenTo)((0,t.v1ReadyEvent)(),(()=>{(0,e.__dispatch)(o({entities:d(),activeId:p()}))}))}(),function(){const{activateBreakpoint:o}=s.actions;(0,t.__privateListenTo)((0,t.windowEvent)("elementor/device-mode/change"),(()=>{const t=p();(0,e.__dispatch)(o(t))}))}(),(0,r.injectIntoResponsive)({id:"responsive-breakpoints-switcher",component:function(){const{all:o,active:i}={all:(0,e.__useSelector)(v),active:(0,e.__useSelector)(m)},{activate:r}={activate:(0,a.useCallback)((e=>(0,t.__privateRunCommand)("panel/change-device-mode",{device:e})),[])};return o.length&&i?a.createElement(l.Tabs,{textColor:"inherit",indicatorColor:"secondary",value:i.id,onChange:(e,t)=>r(t),"aria-label":(0,n.__)("Switch Device","elementor"),sx:{"& .MuiTabs-indicator":{backgroundColor:"text.primary"}}},o.map((({id:e,label:t,type:o,width:i})=>{const n=_[e],r=b[o||"default"].replace("%s",t).replace("%d",i?.toString()||"");return a.createElement(l.Tab,{value:e,key:e,"aria-label":r,icon:a.createElement(w,{title:r},a.createElement(n,null)),sx:{minWidth:"auto"}})}))):null},options:{priority:20}})}(),(window.elementorV2=window.elementorV2||{}).editorResponsive=i}(); | |