| 1 |
(function(_wordpress_i18n) { |
| 2 |
|
| 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 |
var __exportAll = (all, no_symbols) => { |
| 10 |
let target = {}; |
| 11 |
for (var name in all) { |
| 12 |
__defProp(target, name, { |
| 13 |
get: all[name], |
| 14 |
enumerable: true |
| 15 |
}); |
| 16 |
} |
| 17 |
if (!no_symbols) { |
| 18 |
__defProp(target, Symbol.toStringTag, { value: "Module" }); |
| 19 |
} |
| 20 |
return target; |
| 21 |
}; |
| 22 |
|
| 23 |
//#endregion |
| 24 |
|
| 25 |
//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js |
| 26 |
function _classCallCheck(a, n) { |
| 27 |
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); |
| 28 |
} |
| 29 |
|
| 30 |
//#endregion |
| 31 |
//#region node_modules/@babel/runtime/helpers/esm/typeof.js |
| 32 |
function _typeof(o) { |
| 33 |
"@babel/helpers - typeof"; |
| 34 |
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 35 |
return typeof o; |
| 36 |
} : function(o) { |
| 37 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 38 |
}, _typeof(o); |
| 39 |
} |
| 40 |
|
| 41 |
//#endregion |
| 42 |
//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js |
| 43 |
function toPrimitive(t, r) { |
| 44 |
if ("object" != _typeof(t) || !t) return t; |
| 45 |
var e = t[Symbol.toPrimitive]; |
| 46 |
if (void 0 !== e) { |
| 47 |
var i = e.call(t, r || "default"); |
| 48 |
if ("object" != _typeof(i)) return i; |
| 49 |
throw new TypeError("@@toPrimitive must return a primitive value."); |
| 50 |
} |
| 51 |
return ("string" === r ? String : Number)(t); |
| 52 |
} |
| 53 |
|
| 54 |
//#endregion |
| 55 |
//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js |
| 56 |
function toPropertyKey(t) { |
| 57 |
var i = toPrimitive(t, "string"); |
| 58 |
return "symbol" == _typeof(i) ? i : i + ""; |
| 59 |
} |
| 60 |
|
| 61 |
//#endregion |
| 62 |
//#region node_modules/@babel/runtime/helpers/esm/createClass.js |
| 63 |
function _defineProperties(e, r) { |
| 64 |
for (var t = 0; t < r.length; t++) { |
| 65 |
var o = r[t]; |
| 66 |
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); |
| 67 |
} |
| 68 |
} |
| 69 |
function _createClass(e, r, t) { |
| 70 |
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; |
| 71 |
} |
| 72 |
|
| 73 |
//#endregion |
| 74 |
//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js |
| 75 |
function _assertThisInitialized(e) { |
| 76 |
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 77 |
return e; |
| 78 |
} |
| 79 |
|
| 80 |
//#endregion |
| 81 |
//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js |
| 82 |
function _possibleConstructorReturn(t, e) { |
| 83 |
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; |
| 84 |
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); |
| 85 |
return _assertThisInitialized(t); |
| 86 |
} |
| 87 |
|
| 88 |
//#endregion |
| 89 |
//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js |
| 90 |
function _getPrototypeOf(t) { |
| 91 |
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { |
| 92 |
return t.__proto__ || Object.getPrototypeOf(t); |
| 93 |
}, _getPrototypeOf(t); |
| 94 |
} |
| 95 |
|
| 96 |
//#endregion |
| 97 |
//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js |
| 98 |
function _setPrototypeOf(t, e) { |
| 99 |
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { |
| 100 |
return t.__proto__ = e, t; |
| 101 |
}, _setPrototypeOf(t, e); |
| 102 |
} |
| 103 |
|
| 104 |
//#endregion |
| 105 |
//#region node_modules/@babel/runtime/helpers/esm/inherits.js |
| 106 |
function _inherits(t, e) { |
| 107 |
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); |
| 108 |
t.prototype = Object.create(e && e.prototype, { constructor: { |
| 109 |
value: t, |
| 110 |
writable: !0, |
| 111 |
configurable: !0 |
| 112 |
} }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); |
| 113 |
} |
| 114 |
|
| 115 |
//#endregion |
| 116 |
//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
| 117 |
function _arrayWithHoles(r) { |
| 118 |
if (Array.isArray(r)) return r; |
| 119 |
} |
| 120 |
|
| 121 |
//#endregion |
| 122 |
//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
| 123 |
function _iterableToArrayLimit(r, l) { |
| 124 |
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 125 |
if (null != t) { |
| 126 |
var e; |
| 127 |
var n; |
| 128 |
var i; |
| 129 |
var u; |
| 130 |
var a = []; |
| 131 |
var f = !0; |
| 132 |
var o = !1; |
| 133 |
try { |
| 134 |
if (i = (t = t.call(r)).next, 0 === l) { |
| 135 |
if (Object(t) !== t) return; |
| 136 |
f = !1; |
| 137 |
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); |
| 138 |
} catch (r) { |
| 139 |
o = !0, n = r; |
| 140 |
} finally { |
| 141 |
try { |
| 142 |
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; |
| 143 |
} finally { |
| 144 |
if (o) throw n; |
| 145 |
} |
| 146 |
} |
| 147 |
return a; |
| 148 |
} |
| 149 |
} |
| 150 |
|
| 151 |
//#endregion |
| 152 |
//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js |
| 153 |
function _arrayLikeToArray(r, a) { |
| 154 |
(null == a || a > r.length) && (a = r.length); |
| 155 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 156 |
return n; |
| 157 |
} |
| 158 |
|
| 159 |
//#endregion |
| 160 |
//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
| 161 |
function _unsupportedIterableToArray(r, a) { |
| 162 |
if (r) { |
| 163 |
if ("string" == typeof r) return _arrayLikeToArray(r, a); |
| 164 |
var t = {}.toString.call(r).slice(8, -1); |
| 165 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; |
| 166 |
} |
| 167 |
} |
| 168 |
|
| 169 |
//#endregion |
| 170 |
//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
| 171 |
function _nonIterableRest() { |
| 172 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 173 |
} |
| 174 |
|
| 175 |
//#endregion |
| 176 |
//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
| 177 |
function _slicedToArray(r, e) { |
| 178 |
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); |
| 179 |
} |
| 180 |
|
| 181 |
//#endregion |
| 182 |
//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js |
| 183 |
function _defineProperty(e, r, t) { |
| 184 |
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { |
| 185 |
value: t, |
| 186 |
enumerable: !0, |
| 187 |
configurable: !0, |
| 188 |
writable: !0 |
| 189 |
}) : e[r] = t, e; |
| 190 |
} |
| 191 |
|
| 192 |
//#endregion |
| 193 |
//#region node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
| 194 |
function _arrayWithoutHoles(r) { |
| 195 |
if (Array.isArray(r)) return _arrayLikeToArray(r); |
| 196 |
} |
| 197 |
|
| 198 |
//#endregion |
| 199 |
//#region node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
| 200 |
function _iterableToArray(r) { |
| 201 |
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); |
| 202 |
} |
| 203 |
|
| 204 |
//#endregion |
| 205 |
//#region node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
| 206 |
function _nonIterableSpread() { |
| 207 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 208 |
} |
| 209 |
|
| 210 |
//#endregion |
| 211 |
//#region node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
| 212 |
function _toConsumableArray(r) { |
| 213 |
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); |
| 214 |
} |
| 215 |
|
| 216 |
//#endregion |
| 217 |
//#region modules/container-converter/assets/js/editor/maps/utils.js |
| 218 |
/** |
| 219 |
* Generate a mapping object for responsive controls. |
| 220 |
* |
| 221 |
* Usage: |
| 222 |
* 1. responsive( 'old_key', 'new_key' ); |
| 223 |
* 2. responsive( 'old_key', ( { key, value, deviceValue, settings, breakpoint } ) => { return [ key, value ] } ); |
| 224 |
* |
| 225 |
* @param {string} key - Control name without device suffix. |
| 226 |
* @param {string | Function} value - New control name without device suffix, or a callback. |
| 227 |
* |
| 228 |
* @return {Object} mapping object |
| 229 |
*/ |
| 230 |
function responsive(key, value) { |
| 231 |
var breakpoints = [""].concat(_toConsumableArray(Object.keys(elementorFrontend.config.responsive.activeBreakpoints))); |
| 232 |
return Object.fromEntries(breakpoints.map(function(breakpoint) { |
| 233 |
var deviceKey = getDeviceKey(key, breakpoint); |
| 234 |
if ("string" === typeof value) { |
| 235 |
var newDeviceKey = getDeviceKey(value, breakpoint); |
| 236 |
return [deviceKey, function(_ref) { |
| 237 |
return [newDeviceKey, _ref.settings[deviceKey]]; |
| 238 |
}]; |
| 239 |
} |
| 240 |
return [deviceKey, function(_ref2) { |
| 241 |
var settings = _ref2.settings; |
| 242 |
var desktopValue = _ref2.value; |
| 243 |
return value({ |
| 244 |
key, |
| 245 |
deviceKey, |
| 246 |
value: desktopValue, |
| 247 |
deviceValue: settings[deviceKey], |
| 248 |
settings, |
| 249 |
breakpoint |
| 250 |
}); |
| 251 |
}]; |
| 252 |
})); |
| 253 |
} |
| 254 |
/** |
| 255 |
* Get a setting key for a device. |
| 256 |
* |
| 257 |
* Examples: |
| 258 |
* 1. getDeviceKey( 'some_control', 'mobile' ) => 'some_control_mobile'. |
| 259 |
* 2. getDeviceKey( 'some_control', '' ) => 'some_control'. |
| 260 |
* |
| 261 |
* @param {string} key - Setting key. |
| 262 |
* @param {string} breakpoint - Breakpoint name. |
| 263 |
* |
| 264 |
* @return {string} device key |
| 265 |
*/ |
| 266 |
function getDeviceKey(key, breakpoint) { |
| 267 |
return [key, breakpoint].filter(function(v) { |
| 268 |
return !!v; |
| 269 |
}).join("_"); |
| 270 |
} |
| 271 |
|
| 272 |
//#endregion |
| 273 |
//#region modules/container-converter/assets/js/editor/maps/section.js |
| 274 |
function ownKeys$2(e, r) { |
| 275 |
var t = Object.keys(e); |
| 276 |
if (Object.getOwnPropertySymbols) { |
| 277 |
var o = Object.getOwnPropertySymbols(e); |
| 278 |
r && (o = o.filter(function(r) { |
| 279 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 280 |
})), t.push.apply(t, o); |
| 281 |
} |
| 282 |
return t; |
| 283 |
} |
| 284 |
__name(ownKeys$2, "ownKeys"); |
| 285 |
function _objectSpread$2(e) { |
| 286 |
for (var r = 1; r < arguments.length; r++) { |
| 287 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 288 |
r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) { |
| 289 |
_defineProperty(e, r, t[r]); |
| 290 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) { |
| 291 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 292 |
}); |
| 293 |
} |
| 294 |
return e; |
| 295 |
} |
| 296 |
__name(_objectSpread$2, "_objectSpread"); |
| 297 |
var map$1 = function map(_ref) { |
| 298 |
var isInner = _ref.isInner; |
| 299 |
var _ref$settings = _ref.settings; |
| 300 |
var settings = _ref$settings === void 0 ? {} : _ref$settings; |
| 301 |
var widthKey = isInner ? "width" : "boxed_width"; |
| 302 |
return _objectSpread$2(_objectSpread$2(_objectSpread$2({}, "boxed" === settings.layout ? responsive("content_width", widthKey) : { content_width: null }), "min-height" === settings.height && responsive("custom_height", "min_height")), {}, { |
| 303 |
layout: function layout(_ref2) { |
| 304 |
var value = _ref2.value; |
| 305 |
return ["content_width", { |
| 306 |
boxed: "boxed", |
| 307 |
full_width: "full" |
| 308 |
}[value] || value]; |
| 309 |
}, |
| 310 |
height: function height(_ref3) { |
| 311 |
var value = _ref3.value; |
| 312 |
var sectionSettings = _ref3.settings; |
| 313 |
switch (value) { |
| 314 |
case "full": |
| 315 |
value = { |
| 316 |
size: 100, |
| 317 |
unit: "vh" |
| 318 |
}; |
| 319 |
break; |
| 320 |
case "min-height": |
| 321 |
value = sectionSettings.custom_height || { |
| 322 |
size: 400, |
| 323 |
unit: "px" |
| 324 |
}; |
| 325 |
break; |
| 326 |
default: return false; |
| 327 |
} |
| 328 |
return ["min_height", value]; |
| 329 |
}, |
| 330 |
gap: function gap(_ref4) { |
| 331 |
var value = _ref4.value; |
| 332 |
var sectionSettings = _ref4.settings; |
| 333 |
var sizesMap = { |
| 334 |
no: 0, |
| 335 |
narrow: 5, |
| 336 |
extended: 15, |
| 337 |
wide: 20, |
| 338 |
wider: 30 |
| 339 |
}; |
| 340 |
value = "custom" === value ? sectionSettings.gap_columns_custom : { |
| 341 |
size: sizesMap[value], |
| 342 |
column: "" + sizesMap[value], |
| 343 |
row: "" + sizesMap[value], |
| 344 |
unit: "px" |
| 345 |
}; |
| 346 |
return ["flex_gap", value]; |
| 347 |
}, |
| 348 |
gap_columns_custom: null, |
| 349 |
column_position: function column_position(_ref5) { |
| 350 |
var value = _ref5.value; |
| 351 |
return ["flex_align_items", { |
| 352 |
top: "flex-start", |
| 353 |
middle: "center", |
| 354 |
bottom: "flex-end" |
| 355 |
}[value] || value]; |
| 356 |
} |
| 357 |
}); |
| 358 |
}; |
| 359 |
|
| 360 |
//#endregion |
| 361 |
//#region modules/container-converter/assets/js/editor/maps/column.js |
| 362 |
function ownKeys$1(e, r) { |
| 363 |
var t = Object.keys(e); |
| 364 |
if (Object.getOwnPropertySymbols) { |
| 365 |
var o = Object.getOwnPropertySymbols(e); |
| 366 |
r && (o = o.filter(function(r) { |
| 367 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 368 |
})), t.push.apply(t, o); |
| 369 |
} |
| 370 |
return t; |
| 371 |
} |
| 372 |
__name(ownKeys$1, "ownKeys"); |
| 373 |
function _objectSpread$1(e) { |
| 374 |
for (var r = 1; r < arguments.length; r++) { |
| 375 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 376 |
r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) { |
| 377 |
_defineProperty(e, r, t[r]); |
| 378 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) { |
| 379 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 380 |
}); |
| 381 |
} |
| 382 |
return e; |
| 383 |
} |
| 384 |
__name(_objectSpread$1, "_objectSpread"); |
| 385 |
var map = function map() { |
| 386 |
return _objectSpread$1(_objectSpread$1(_objectSpread$1({}, responsive("_inline_size", function(_ref) { |
| 387 |
var deviceValue = _ref.deviceValue; |
| 388 |
var breakpoint = _ref.breakpoint; |
| 389 |
return [getDeviceKey("width", breakpoint), { |
| 390 |
size: deviceValue, |
| 391 |
unit: "%" |
| 392 |
}]; |
| 393 |
})), responsive("content_position", function(_ref2) { |
| 394 |
var deviceValue = _ref2.deviceValue; |
| 395 |
var breakpoint = _ref2.breakpoint; |
| 396 |
return [getDeviceKey("flex_justify_content", breakpoint), { |
| 397 |
top: "flex-start", |
| 398 |
bottom: "flex-end" |
| 399 |
}[deviceValue] || deviceValue]; |
| 400 |
})), responsive("space_between_widgets", function(_ref3) { |
| 401 |
var deviceValue = _ref3.deviceValue; |
| 402 |
var breakpoint = _ref3.breakpoint; |
| 403 |
return [getDeviceKey("flex_gap", breakpoint), { |
| 404 |
size: deviceValue, |
| 405 |
column: "" + deviceValue, |
| 406 |
row: "" + deviceValue, |
| 407 |
unit: "px" |
| 408 |
}]; |
| 409 |
})); |
| 410 |
}; |
| 411 |
|
| 412 |
//#endregion |
| 413 |
//#region modules/container-converter/assets/js/editor/migrator.js |
| 414 |
function ownKeys(e, r) { |
| 415 |
var t = Object.keys(e); |
| 416 |
if (Object.getOwnPropertySymbols) { |
| 417 |
var o = Object.getOwnPropertySymbols(e); |
| 418 |
r && (o = o.filter(function(r) { |
| 419 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 420 |
})), t.push.apply(t, o); |
| 421 |
} |
| 422 |
return t; |
| 423 |
} |
| 424 |
function _objectSpread(e) { |
| 425 |
for (var r = 1; r < arguments.length; r++) { |
| 426 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 427 |
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { |
| 428 |
_defineProperty(e, r, t[r]); |
| 429 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { |
| 430 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 431 |
}); |
| 432 |
} |
| 433 |
return e; |
| 434 |
} |
| 435 |
var Migrator = /*#__PURE__*/ function() { |
| 436 |
function Migrator() { |
| 437 |
_classCallCheck(this, Migrator); |
| 438 |
} |
| 439 |
return _createClass(Migrator, null, [ |
| 440 |
{ |
| 441 |
key: "migrate", |
| 442 |
value: function migrate(settings, map) { |
| 443 |
return Object.fromEntries(Object.entries(_objectSpread({}, settings)).map(function(_ref) { |
| 444 |
var _ref2 = _slicedToArray(_ref, 2); |
| 445 |
var key = _ref2[0]; |
| 446 |
var value = _ref2[1]; |
| 447 |
var mapped = map[key]; |
| 448 |
if (null === mapped) return null; |
| 449 |
if ("string" === typeof mapped) return [mapped, value]; |
| 450 |
if ("function" === typeof mapped) return mapped({ |
| 451 |
key, |
| 452 |
value, |
| 453 |
settings |
| 454 |
}); |
| 455 |
return [key, value]; |
| 456 |
}).filter(Boolean)); |
| 457 |
} |
| 458 |
}, |
| 459 |
{ |
| 460 |
key: "canConvertToContainer", |
| 461 |
value: function canConvertToContainer(elType) { |
| 462 |
return Object.keys(this.config).includes(elType); |
| 463 |
} |
| 464 |
}, |
| 465 |
{ |
| 466 |
key: "getLegacyControlsMapping", |
| 467 |
value: function getLegacyControlsMapping(model) { |
| 468 |
var config = this.config[model.elType]; |
| 469 |
if (!config) return {}; |
| 470 |
var mapping = config.legacyControlsMapping; |
| 471 |
return "function" === typeof mapping ? mapping(model) : mapping; |
| 472 |
} |
| 473 |
}, |
| 474 |
{ |
| 475 |
key: "normalizeSettings", |
| 476 |
value: function normalizeSettings(model, settings) { |
| 477 |
var config = this.config[model.elType]; |
| 478 |
if (!config.normalizeSettings) return settings; |
| 479 |
return config.normalizeSettings(settings, model); |
| 480 |
} |
| 481 |
} |
| 482 |
]); |
| 483 |
}(); |
| 484 |
/** |
| 485 |
* Migrations configuration by `elType`. |
| 486 |
* |
| 487 |
* @type {Object} |
| 488 |
*/ |
| 489 |
_defineProperty(Migrator, "config", { |
| 490 |
section: { |
| 491 |
legacyControlsMapping: map$1, |
| 492 |
normalizeSettings: function normalizeSettings(settings, _ref3) { |
| 493 |
var isInner = _ref3.isInner; |
| 494 |
return _objectSpread(_objectSpread({}, settings), {}, { |
| 495 |
flex_direction: "row", |
| 496 |
flex_align_items: settings.flex_align_items || "stretch", |
| 497 |
flex_gap: settings.flex_gap || { |
| 498 |
size: 10, |
| 499 |
column: "10", |
| 500 |
row: "10", |
| 501 |
unit: "px" |
| 502 |
} |
| 503 |
}, isInner ? { content_width: "full" } : {}); |
| 504 |
} |
| 505 |
}, |
| 506 |
column: { |
| 507 |
legacyControlsMapping: map, |
| 508 |
normalizeSettings: function normalizeSettings(settings) { |
| 509 |
return _objectSpread(_objectSpread({}, settings), {}, { content_width: "full" }); |
| 510 |
} |
| 511 |
} |
| 512 |
}); |
| 513 |
|
| 514 |
//#endregion |
| 515 |
//#region modules/container-converter/assets/js/editor/commands/convert.js |
| 516 |
function _callSuper$3(t, o, e) { |
| 517 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 518 |
} |
| 519 |
__name(_callSuper$3, "_callSuper"); |
| 520 |
function _isNativeReflectConstruct$3() { |
| 521 |
try { |
| 522 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 523 |
} catch (t) {} |
| 524 |
return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { |
| 525 |
return !!t; |
| 526 |
})(); |
| 527 |
} |
| 528 |
__name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct"); |
| 529 |
/** |
| 530 |
* @typedef {import('../../../../../../assets/dev/js/editor/container/container')} Container |
| 531 |
*/ |
| 532 |
var Convert = /*#__PURE__*/ function(_$e$modules$editor$do) { |
| 533 |
function Convert() { |
| 534 |
_classCallCheck(this, Convert); |
| 535 |
return _callSuper$3(this, Convert, arguments); |
| 536 |
} |
| 537 |
_inherits(Convert, _$e$modules$editor$do); |
| 538 |
return _createClass(Convert, [ |
| 539 |
{ |
| 540 |
key: "getHistory", |
| 541 |
value: function getHistory() { |
| 542 |
return { |
| 543 |
type: (0, _wordpress_i18n.__)("Converted to Container", "elementor"), |
| 544 |
title: (0, _wordpress_i18n.__)("Section", "elementor") |
| 545 |
}; |
| 546 |
} |
| 547 |
}, |
| 548 |
{ |
| 549 |
key: "validateArgs", |
| 550 |
value: function validateArgs() { |
| 551 |
var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; |
| 552 |
this.requireContainer(args); |
| 553 |
} |
| 554 |
}, |
| 555 |
{ |
| 556 |
key: "apply", |
| 557 |
value: function apply(args) { |
| 558 |
this.constructor.convert(args); |
| 559 |
} |
| 560 |
} |
| 561 |
], [{ |
| 562 |
key: "convert", |
| 563 |
value: function convert(_ref) { |
| 564 |
var container = _ref.container; |
| 565 |
var _ref$rootContainer = _ref.rootContainer; |
| 566 |
var rootContainer = _ref$rootContainer === void 0 ? container.parent : _ref$rootContainer; |
| 567 |
var view = container.view; |
| 568 |
var elType = container.type; |
| 569 |
var at = rootContainer === container.parent ? view._index + 1 : view._index; |
| 570 |
if (!Migrator.canConvertToContainer(elType)) { |
| 571 |
$e.run("document/elements/create", { |
| 572 |
model: { |
| 573 |
elType: container.model.get("elType"), |
| 574 |
widgetType: container.model.get("widgetType"), |
| 575 |
settings: container.settings.toJSON({ remove: "default" }) |
| 576 |
}, |
| 577 |
container: rootContainer, |
| 578 |
options: { |
| 579 |
at, |
| 580 |
edit: false |
| 581 |
} |
| 582 |
}); |
| 583 |
return; |
| 584 |
} |
| 585 |
var model = container.model.toJSON(); |
| 586 |
var controlsMapping = Migrator.getLegacyControlsMapping(model); |
| 587 |
var settings = container.settings.toJSON({ remove: "default" }); |
| 588 |
settings = Migrator.migrate(settings, controlsMapping); |
| 589 |
settings = Migrator.normalizeSettings(model, settings); |
| 590 |
var newContainer = $e.run("document/elements/create", { |
| 591 |
model: { |
| 592 |
elType: "container", |
| 593 |
settings |
| 594 |
}, |
| 595 |
container: rootContainer, |
| 596 |
options: { |
| 597 |
at, |
| 598 |
edit: false |
| 599 |
} |
| 600 |
}); |
| 601 |
container.children.forEach(function(child) { |
| 602 |
$e.run("container-converter/convert", { |
| 603 |
container: child, |
| 604 |
rootContainer: newContainer |
| 605 |
}); |
| 606 |
}); |
| 607 |
} |
| 608 |
}]); |
| 609 |
}($e.modules.editor.document.CommandHistoryBase); |
| 610 |
|
| 611 |
//#endregion |
| 612 |
//#region modules/container-converter/assets/js/editor/commands/convert-all.js |
| 613 |
function _callSuper$2(t, o, e) { |
| 614 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 615 |
} |
| 616 |
__name(_callSuper$2, "_callSuper"); |
| 617 |
function _isNativeReflectConstruct$2() { |
| 618 |
try { |
| 619 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 620 |
} catch (t) {} |
| 621 |
return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { |
| 622 |
return !!t; |
| 623 |
})(); |
| 624 |
} |
| 625 |
__name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct"); |
| 626 |
var ConvertAll = /*#__PURE__*/ function(_$e$modules$editor$do) { |
| 627 |
function ConvertAll() { |
| 628 |
_classCallCheck(this, ConvertAll); |
| 629 |
return _callSuper$2(this, ConvertAll, arguments); |
| 630 |
} |
| 631 |
_inherits(ConvertAll, _$e$modules$editor$do); |
| 632 |
return _createClass(ConvertAll, [{ |
| 633 |
key: "getHistory", |
| 634 |
value: function getHistory() { |
| 635 |
return { |
| 636 |
type: (0, _wordpress_i18n.__)("Converted to Containers", "elementor"), |
| 637 |
title: (0, _wordpress_i18n.__)("All Content", "elementor") |
| 638 |
}; |
| 639 |
} |
| 640 |
}, { |
| 641 |
key: "apply", |
| 642 |
value: function apply() { |
| 643 |
var children = elementor.getPreviewContainer().children; |
| 644 |
_toConsumableArray(children).forEach(function(container) { |
| 645 |
$e.run("container-converter/convert", { container }); |
| 646 |
}); |
| 647 |
} |
| 648 |
}]); |
| 649 |
}($e.modules.editor.document.CommandHistoryBase); |
| 650 |
|
| 651 |
//#endregion |
| 652 |
//#region modules/container-converter/assets/js/editor/commands/index.js |
| 653 |
var commands_exports = /* @__PURE__ */ __exportAll({ |
| 654 |
Convert: () => Convert, |
| 655 |
ConvertAll: () => ConvertAll |
| 656 |
}); |
| 657 |
|
| 658 |
//#endregion |
| 659 |
//#region modules/container-converter/assets/js/editor/component.js |
| 660 |
function _callSuper$1(t, o, e) { |
| 661 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 662 |
} |
| 663 |
__name(_callSuper$1, "_callSuper"); |
| 664 |
function _isNativeReflectConstruct$1() { |
| 665 |
try { |
| 666 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 667 |
} catch (t) {} |
| 668 |
return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { |
| 669 |
return !!t; |
| 670 |
})(); |
| 671 |
} |
| 672 |
__name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); |
| 673 |
var _default = /*#__PURE__*/ function(_$e$modules$Component) { |
| 674 |
function _default() { |
| 675 |
var _this; |
| 676 |
_classCallCheck(this, _default); |
| 677 |
_this = _callSuper$1(this, _default); |
| 678 |
_this.bindEvents(); |
| 679 |
return _this; |
| 680 |
} |
| 681 |
/** |
| 682 |
* Listen to click event in the panel. |
| 683 |
* |
| 684 |
* @return {void} |
| 685 |
*/ |
| 686 |
_inherits(_default, _$e$modules$Component); |
| 687 |
return _createClass(_default, [ |
| 688 |
{ |
| 689 |
key: "bindEvents", |
| 690 |
value: function bindEvents() { |
| 691 |
elementor.channels.editor.on("elementorContainerConverter:convert", function(_ref) { |
| 692 |
var container = _ref.container; |
| 693 |
var button = _ref.el.querySelector(".elementor-button"); |
| 694 |
var loadingClass = "e-loading"; |
| 695 |
button.classList.add(loadingClass); |
| 696 |
setTimeout(function() { |
| 697 |
if ("document" === container.type) $e.run("container-converter/convert-all"); |
| 698 |
else $e.run("container-converter/convert", { container }); |
| 699 |
button.classList.remove(loadingClass); |
| 700 |
button.setAttribute("disabled", true); |
| 701 |
elementor.notifications.showToast({ message: (0, _wordpress_i18n.__)("Your changes have been updated.", "elementor") }); |
| 702 |
}); |
| 703 |
}); |
| 704 |
} |
| 705 |
}, |
| 706 |
{ |
| 707 |
key: "getNamespace", |
| 708 |
value: function getNamespace() { |
| 709 |
return "container-converter"; |
| 710 |
} |
| 711 |
}, |
| 712 |
{ |
| 713 |
key: "defaultCommands", |
| 714 |
value: function defaultCommands() { |
| 715 |
return this.importCommands(commands_exports); |
| 716 |
} |
| 717 |
} |
| 718 |
]); |
| 719 |
}($e.modules.ComponentBase); |
| 720 |
|
| 721 |
//#endregion |
| 722 |
//#region modules/container-converter/assets/js/editor/module.js |
| 723 |
function _callSuper(t, o, e) { |
| 724 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 725 |
} |
| 726 |
function _isNativeReflectConstruct() { |
| 727 |
try { |
| 728 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 729 |
} catch (t) {} |
| 730 |
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { |
| 731 |
return !!t; |
| 732 |
})(); |
| 733 |
} |
| 734 |
new (/* @__PURE__ */ function(_elementorModules$edi) { |
| 735 |
function Module() { |
| 736 |
_classCallCheck(this, Module); |
| 737 |
return _callSuper(this, Module, arguments); |
| 738 |
} |
| 739 |
_inherits(Module, _elementorModules$edi); |
| 740 |
return _createClass(Module, [{ |
| 741 |
key: "onInit", |
| 742 |
value: function onInit() { |
| 743 |
$e.components.register(new _default()); |
| 744 |
} |
| 745 |
}]); |
| 746 |
}(elementorModules.editor.utils.Module))(); |
| 747 |
|
| 748 |
//#endregion |
| 749 |
})(wp.i18n); |
| 750 |
//# sourceMappingURL=container-converter.js.map |