PluginProbe
Elementor Website Builder – more than just a page builder / 3.31.4
Elementor Website Builder – more than just a page builder v3.31.4
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/atomic-widgets-editor.js +610 -1679 4.2.0-beta2 → 3.31.4 View file →
@@ -1,4 +1,5 @@
1 +/*! elementor - v3.31.0 - 08-09-2025 */
1 2 /******/ (() => { // webpackBootstrap
2 3 /******/ var __webpack_modules__ = ({
3 4
4 5 /***/ "../assets/dev/js/editor/elements/views/behaviors/sortable.js":
@@ -302,463 +303,23 @@
302 303 value: true
303 304 }));
304 305 exports["default"] = EmptyComponent;
305 306 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
306 -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
307 307 /* eslint-disable jsx-a11y/no-static-element-interactions */
308 308 /* eslint-disable jsx-a11y/click-events-have-key-events */
309 -
310 309 function EmptyComponent() {
311 - var handleClick = function handleClick() {
312 - _editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({
313 - targetName: 'add_container'
314 - });
315 - $e.route('panel/elements/categories');
316 - };
317 310 return /*#__PURE__*/_react.default.createElement("div", {
318 311 className: "elementor-first-add"
319 312 }, /*#__PURE__*/_react.default.createElement("div", {
320 313 className: "elementor-icon eicon-plus",
321 - onClick: handleClick
314 + onClick: function onClick() {
315 + return $e.route('panel/elements/categories');
316 + }
322 317 }));
323 318 }
324 319
325 320 /***/ }),
326 321
327 -/***/ "../assets/dev/js/editor/utils/editor-one-events.js":
328 -/*!**********************************************************!*\
329 - !*** ../assets/dev/js/editor/utils/editor-one-events.js ***!
330 - \**********************************************************/
331 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
332 -
333 -"use strict";
334 -
335 -
336 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
337 -Object.defineProperty(exports, "__esModule", ({
338 - value: true
339 -}));
340 -exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0;
341 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
342 -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
343 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
344 -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
345 -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
346 -var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () {
347 - function EditorOneEventManager() {
348 - (0, _classCallCheck2.default)(this, EditorOneEventManager);
349 - }
350 - return (0, _createClass2.default)(EditorOneEventManager, null, [{
351 - key: "getEventsManager",
352 - value: function getEventsManager() {
353 - var _elementorCommon;
354 - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager;
355 - }
356 - }, {
357 - key: "getConfig",
358 - value: function getConfig() {
359 - var _this$getEventsManage;
360 - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config;
361 - }
362 - }, {
363 - key: "canSendEvents",
364 - value: function canSendEvents() {
365 - var _elementorCommon2;
366 - return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false;
367 - }
368 - }, {
369 - key: "isEventsManagerAvailable",
370 - value: function isEventsManagerAvailable() {
371 - var eventsManager = this.getEventsManager();
372 - return eventsManager && 'function' === typeof eventsManager.dispatchEvent;
373 - }
374 - }, {
375 - key: "dispatchEvent",
376 - value: function dispatchEvent(eventName, payload) {
377 - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) {
378 - return false;
379 - }
380 - this.getEventsManager().dispatchEvent(eventName, payload);
381 - }
382 - }, {
383 - key: "toLowerSnake",
384 - value: function toLowerSnake(value) {
385 - if (!value || 'string' !== typeof value) {
386 - return value;
387 - }
388 - return value.replace(/\s+/g, '_').toLowerCase();
389 - }
390 - }, {
391 - key: "decodeHtmlEntities",
392 - value: function decodeHtmlEntities(text) {
393 - if (!text || 'string' !== typeof text) {
394 - return text;
395 - }
396 - var doc = new DOMParser().parseFromString(text, 'text/html');
397 - return doc.body.textContent || text;
398 - }
399 - }, {
400 - key: "isInEditorContext",
401 - value: function isInEditorContext() {
402 - var _window$elementor;
403 - return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
404 - }
405 - }, {
406 - key: "getFinderContext",
407 - value: function getFinderContext() {
408 - var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2;
409 - var config = this.getConfig();
410 - var isEditor = this.isInEditorContext();
411 - return {
412 - windowName: isEditor ? config === null || config === void 0 || (_config$appTypes = config.appTypes) === null || _config$appTypes === void 0 ? void 0 : _config$appTypes.editor : config === null || config === void 0 || (_config$appTypes2 = config.appTypes) === null || _config$appTypes2 === void 0 ? void 0 : _config$appTypes2.wpAdmin,
413 - targetLocation: this.toLowerSnake(isEditor ? config === null || config === void 0 || (_config$locations = config.locations) === null || _config$locations === void 0 ? void 0 : _config$locations.topBar : config === null || config === void 0 || (_config$locations2 = config.locations) === null || _config$locations2 === void 0 ? void 0 : _config$locations2.sidebar)
414 - };
415 - }
416 - }, {
417 - key: "createBasePayload",
418 - value: function createBasePayload() {
419 - var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4;
420 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
421 - var config = this.getConfig();
422 - return _objectSpread({
423 - app_type: (_config$appTypes$edit = config === null || config === void 0 || (_config$appTypes3 = config.appTypes) === null || _config$appTypes3 === void 0 ? void 0 : _config$appTypes3.editor) !== null && _config$appTypes$edit !== void 0 ? _config$appTypes$edit : 'editor',
424 - window_name: (_config$appTypes$edit2 = config === null || config === void 0 || (_config$appTypes4 = config.appTypes) === null || _config$appTypes4 === void 0 ? void 0 : _config$appTypes4.editor) !== null && _config$appTypes$edit2 !== void 0 ? _config$appTypes$edit2 : 'editor'
425 - }, overrides);
426 - }
427 - }, {
428 - key: "sendTopBarPublishDropdown",
429 - value: function sendTopBarPublishDropdown(targetName) {
430 - var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2;
431 - var config = this.getConfig();
432 - return this.dispatchEvent(config === null || config === void 0 || (_config$names = config.names) === null || _config$names === void 0 || (_config$names = _config$names.editorOne) === null || _config$names === void 0 ? void 0 : _config$names.topBarPublishDropdown, this.createBasePayload({
433 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
434 - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
435 - target_name: targetName,
436 - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
437 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
438 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
439 - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
440 - interaction_description: 'User selected an action from the publish dropdown'
441 - }));
442 - }
443 - }, {
444 - key: "sendTopBarPageList",
445 - value: function sendTopBarPageList(targetName) {
446 - var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4;
447 - var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
448 - var config = this.getConfig();
449 - return this.dispatchEvent(config === null || config === void 0 || (_config$names2 = config.names) === null || _config$names2 === void 0 || (_config$names2 = _config$names2.editorOne) === null || _config$names2 === void 0 ? void 0 : _config$names2.topBarPageList, this.createBasePayload({
450 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
451 - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
452 - target_name: targetName,
453 - interaction_result: isCreate ? config === null || config === void 0 || (_config$interactionRe2 = config.interactionResults) === null || _config$interactionRe2 === void 0 ? void 0 : _config$interactionRe2.create : config === null || config === void 0 || (_config$interactionRe3 = config.interactionResults) === null || _config$interactionRe3 === void 0 ? void 0 : _config$interactionRe3.navigate,
454 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
455 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
456 - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
457 - interaction_description: 'User selected an action from the page list dropdown'
458 - }));
459 - }
460 - }, {
461 - key: "sendSiteSettingsSession",
462 - value: function sendSiteSettingsSession(_ref) {
463 - var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3;
464 - var targetType = _ref.targetType,
465 - _ref$visitedItems = _ref.visitedItems,
466 - visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems,
467 - _ref$savedItems = _ref.savedItems,
468 - savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems,
469 - state = _ref.state;
470 - var config = this.getConfig();
471 - return this.dispatchEvent(config === null || config === void 0 || (_config$names3 = config.names) === null || _config$names3 === void 0 || (_config$names3 = _config$names3.editorOne) === null || _config$names3 === void 0 ? void 0 : _config$names3.siteSettingsSession, this.createBasePayload({
472 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
473 - target_type: targetType,
474 - target_name: 'site_settings',
475 - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
476 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
477 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
478 - interaction_description: 'Records areas visited as part of the site setting session',
479 - metadata: {
480 - visited_items: visitedItems,
481 - saved_items: savedItems
482 - },
483 - state: state
484 - }));
485 - }
486 - }, {
487 - key: "sendELibraryNav",
488 - value: function sendELibraryNav(tabName) {
489 - var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4;
490 - var config = this.getConfig();
491 - return this.dispatchEvent(config === null || config === void 0 || (_config$names4 = config.names) === null || _config$names4 === void 0 || (_config$names4 = _config$names4.editorOne) === null || _config$names4 === void 0 ? void 0 : _config$names4.eLibraryNav, this.createBasePayload({
492 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
493 - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
494 - target_name: this.toLowerSnake(tabName),
495 - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
496 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
497 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
498 - interaction_description: 'User navigates within elementor library'
499 - }));
500 - }
501 - }, {
502 - key: "sendELibraryInsert",
503 - value: function sendELibraryInsert(_ref2) {
504 - var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5;
505 - var assetId = _ref2.assetId,
506 - assetName = _ref2.assetName,
507 - libraryType = _ref2.libraryType,
508 - _ref2$proRequired = _ref2.proRequired,
509 - proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
510 - var config = this.getConfig();
511 - var payload = this.createBasePayload({
512 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
513 - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
514 - target_name: String(assetId),
515 - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
516 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
517 - location_l1: this.toLowerSnake(libraryType),
518 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
519 - interaction_description: 'User inserts block/pages from elementor library',
520 - metadata: {
521 - template_id: String(assetId),
522 - template_name: this.decodeHtmlEntities(assetName) || ''
523 - }
524 - });
525 - if (proRequired) {
526 - payload.state = 'pro_plan_required';
527 - }
528 - return this.dispatchEvent(config === null || config === void 0 || (_config$names5 = config.names) === null || _config$names5 === void 0 || (_config$names5 = _config$names5.editorOne) === null || _config$names5 === void 0 ? void 0 : _config$names5.eLibraryInsert, payload);
529 - }
530 - }, {
531 - key: "sendELibraryFavorite",
532 - value: function sendELibraryFavorite(_ref3) {
533 - var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6;
534 - var assetId = _ref3.assetId,
535 - assetName = _ref3.assetName,
536 - libraryType = _ref3.libraryType,
537 - isFavorite = _ref3.isFavorite,
538 - _ref3$proRequired = _ref3.proRequired,
539 - proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
540 - var config = this.getConfig();
541 - var payload = this.createBasePayload({
542 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
543 - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
544 - target_name: String(assetId),
545 - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
546 - target_value: Boolean(isFavorite),
547 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
548 - location_l1: this.toLowerSnake(libraryType),
549 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
550 - interaction_description: 'User favorite block/pages from elementor library',
551 - metadata: {
552 - template_id: String(assetId),
553 - template_name: this.decodeHtmlEntities(assetName) || ''
554 - }
555 - });
556 - if (proRequired) {
557 - payload.state = 'pro_plan_required';
558 - }
559 - return this.dispatchEvent(config === null || config === void 0 || (_config$names6 = config.names) === null || _config$names6 === void 0 || (_config$names6 = _config$names6.editorOne) === null || _config$names6 === void 0 ? void 0 : _config$names6.eLibraryFavorite, payload);
560 - }
561 - }, {
562 - key: "sendELibraryGenerateAi",
563 - value: function sendELibraryGenerateAi(_ref4) {
564 - var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7;
565 - var assetId = _ref4.assetId,
566 - assetName = _ref4.assetName,
567 - libraryType = _ref4.libraryType;
568 - var config = this.getConfig();
569 - return this.dispatchEvent(config === null || config === void 0 || (_config$names7 = config.names) === null || _config$names7 === void 0 || (_config$names7 = _config$names7.editorOne) === null || _config$names7 === void 0 ? void 0 : _config$names7.eLibraryGenerateAi, this.createBasePayload({
570 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
571 - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
572 - target_name: String(assetId),
573 - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
574 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
575 - location_l1: this.toLowerSnake(libraryType),
576 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
577 - interaction_description: 'User generated block/page based on a library asset',
578 - metadata: {
579 - template_id: String(assetId),
580 - template_name: this.decodeHtmlEntities(assetName) || ''
581 - }
582 - }));
583 - }
584 - }, {
585 - key: "sendFinderSearchInput",
586 - value: function sendFinderSearchInput(_ref5) {
587 - var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8;
588 - var resultsCount = _ref5.resultsCount,
589 - _ref5$searchTerm = _ref5.searchTerm,
590 - searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
591 - var config = this.getConfig();
592 - var hasResults = resultsCount > 0;
593 - var finderContext = this.getFinderContext();
594 - var payload = this.createBasePayload({
595 - window_name: finderContext.windowName,
596 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
597 - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
598 - target_name: 'finder',
599 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe9 = config.interactionResults) === null || _config$interactionRe9 === void 0 ? void 0 : _config$interactionRe9.resultsUpdated : config === null || config === void 0 || (_config$interactionRe0 = config.interactionResults) === null || _config$interactionRe0 === void 0 ? void 0 : _config$interactionRe0.noResults,
600 - target_location: finderContext.targetLocation,
601 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
602 - interaction_description: 'Finder search input, follows debounce behavior',
603 - metadata: {
604 - results_count: resultsCount
605 - }
606 - });
607 - if (!hasResults && searchTerm) {
608 - payload.metadata.search_term = searchTerm;
609 - }
610 - return this.dispatchEvent(config === null || config === void 0 || (_config$names8 = config.names) === null || _config$names8 === void 0 || (_config$names8 = _config$names8.editorOne) === null || _config$names8 === void 0 ? void 0 : _config$names8.finderSearchInput, payload);
611 - }
612 - }, {
613 - key: "sendFinderResultSelect",
614 - value: function sendFinderResultSelect(choice) {
615 - var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0;
616 - var config = this.getConfig();
617 - var finderContext = this.getFinderContext();
618 - return this.dispatchEvent(config === null || config === void 0 || (_config$names9 = config.names) === null || _config$names9 === void 0 || (_config$names9 = _config$names9.editorOne) === null || _config$names9 === void 0 ? void 0 : _config$names9.finderResultSelect, this.createBasePayload({
619 - window_name: finderContext.windowName,
620 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
621 - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
622 - target_name: choice,
623 - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
624 - target_location: finderContext.targetLocation,
625 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
626 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
627 - interaction_description: 'Finder search results was selected'
628 - }));
629 - }
630 - }, {
631 - key: "sendCanvasEmptyBoxAction",
632 - value: function sendCanvasEmptyBoxAction(_ref6) {
633 - var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0;
634 - var targetName = _ref6.targetName,
635 - _ref6$metadata = _ref6.metadata,
636 - metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata,
637 - _ref6$containerCreate = _ref6.containerCreated,
638 - containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
639 - var config = this.getConfig();
640 - var payload = this.createBasePayload({
641 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
642 - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
643 - target_name: targetName,
644 - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
645 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
646 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
647 - interaction_description: 'Empty box on canvas actions'
648 - });
649 - if (Object.keys(metadata).length > 0) {
650 - payload.metadata = metadata;
651 - }
652 - if (containerCreated !== null) {
653 - payload.state = containerCreated;
654 - }
655 - return this.dispatchEvent(config === null || config === void 0 || (_config$names0 = config.names) === null || _config$names0 === void 0 || (_config$names0 = _config$names0.editorOne) === null || _config$names0 === void 0 ? void 0 : _config$names0.canvasEmptyBoxAction, payload);
656 - }
657 - }, {
658 - key: "sendWidgetPanelSearch",
659 - value: function sendWidgetPanelSearch(_ref7) {
660 - var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1;
661 - var resultsCount = _ref7.resultsCount,
662 - _ref7$userInput = _ref7.userInput,
663 - userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
664 - var config = this.getConfig();
665 - var hasResults = resultsCount > 0;
666 - var payload = this.createBasePayload({
667 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
668 - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
669 - target_name: 'search_widget',
670 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe11 = config.interactionResults) === null || _config$interactionRe11 === void 0 ? void 0 : _config$interactionRe11.resultsUpdated : config === null || config === void 0 || (_config$interactionRe12 = config.interactionResults) === null || _config$interactionRe12 === void 0 ? void 0 : _config$interactionRe12.noResults,
671 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
672 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
673 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
674 - interaction_description: 'Widget search input, follows debounce behavior'
675 - });
676 - if (!hasResults && userInput) {
677 - payload.metadata = {
678 - user_input: userInput
679 - };
680 - }
681 - return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload);
682 - }
683 - }, {
684 - key: "createWpDashPayload",
685 - value: function createWpDashPayload() {
686 - var _config$appTypes$wpDa, _config$appTypes5, _config$locations11;
687 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
688 - var config = this.getConfig();
689 - return this.createBasePayload(_objectSpread({
690 - window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes5 = config.appTypes) === null || _config$appTypes5 === void 0 ? void 0 : _config$appTypes5.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : 'wpdash',
691 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin),
692 - location_l2: ''
693 - }, overrides));
694 - }
695 - }, {
696 - key: "sendWpDashElementorMenuClick",
697 - value: function sendWpDashElementorMenuClick() {
698 - var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11;
699 - var config = this.getConfig();
700 - return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({
701 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click),
702 - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem,
703 - target_name: 'elementor_menu_item',
704 - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened,
705 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu),
706 - interaction_description: 'core_user_clicked_elementor_menu_item'
707 - }));
708 - }
709 - }, {
710 - key: "sendWpDashEditorSubMenuHover",
711 - value: function sendWpDashEditorSubMenuHover() {
712 - var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12;
713 - var config = this.getConfig();
714 - return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({
715 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover),
716 - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu,
717 - target_name: 'wpdash_editor_sub_menu',
718 - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened,
719 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu),
720 - interaction_description: 'core_user_hovered_sub_menu'
721 - }));
722 - }
723 - }, {
724 - key: "sendWpDashThemeBuilderClick",
725 - value: function sendWpDashThemeBuilderClick() {
726 - var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13;
727 - var config = this.getConfig();
728 - return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({
729 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click),
730 - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem,
731 - target_name: 'theme_builder_menu_item',
732 - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow,
733 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder),
734 - interaction_description: 'core_user_clicked_theme_builder_menu_item'
735 - }));
736 - }
737 - }]);
738 -}();
739 -var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() {
740 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
741 - return _.debounce(function (resultsCount, searchTerm) {
742 - EditorOneEventManager.sendFinderSearchInput({
743 - resultsCount: resultsCount,
744 - searchTerm: searchTerm
745 - });
746 - }, delay);
747 -};
748 -var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() {
749 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
750 - return _.debounce(function (resultsCount, userInput) {
751 - EditorOneEventManager.sendWidgetPanelSearch({
752 - resultsCount: resultsCount,
753 - userInput: userInput
754 - });
755 - }, delay);
756 -};
757 -var _default = exports["default"] = EditorOneEventManager;
758 -
759 -/***/ }),
760 -
761 322 /***/ "../assets/dev/js/editor/utils/element-types.js":
762 323 /*!******************************************************!*\
763 324 !*** ../assets/dev/js/editor/utils/element-types.js ***!
764 325 \******************************************************/
@@ -766,8 +327,15 @@
766 327
767 328 "use strict";
768 329
769 330
331 +var ELEMENT_TYPES = {
332 + SECTION: 'section',
333 + CONTAINER: 'container',
334 + DIV_BLOCK: 'e-div-block',
335 + FLEXBOX: 'e-flexbox'
336 +};
337 +
770 338 /**
771 339 * Returns an array of all available element types.
772 340 *
773 341 * @return {string[]} Array of element type strings.
@@ -772,11 +340,12 @@
772 340 *
773 341 * @return {string[]} Array of element type strings.
774 342 */
775 343 var getAllElementTypes = function getAllElementTypes() {
776 - return Object.keys(elementor.getConfig().elements);
344 + return Object.values(ELEMENT_TYPES);
777 345 };
778 346 module.exports = {
347 + ELEMENT_TYPES: ELEMENT_TYPES,
779 348 getAllElementTypes: getAllElementTypes
780 349 };
781 350
782 351 /***/ }),
@@ -833,12 +402,12 @@
833 402 };
834 403
835 404 /***/ }),
836 405
837 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js":
838 -/*!*******************************************************************************!*\
839 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js ***!
840 - \*******************************************************************************/
406 +/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
407 +/*!***************************************************************!*\
408 + !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
409 + \***************************************************************/
841 410 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
842 411
843 412 "use strict";
844 413
@@ -843,8 +412,9 @@
843 412 "use strict";
844 413
845 414
846 415 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
416 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
847 417 Object.defineProperty(exports, "__esModule", ({
848 418 value: true
849 419 }));
850 420 exports["default"] = void 0;
@@ -851,100 +421,38 @@
851 421 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
852 422 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
853 423 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
854 424 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
855 -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
856 425 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
426 +var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js"));
427 +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
857 428 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)); }
858 429 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
859 -function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
860 -var AtomicElementBaseModel = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
861 - function AtomicElementBaseModel() {
862 - (0, _classCallCheck2.default)(this, AtomicElementBaseModel);
863 - return _callSuper(this, AtomicElementBaseModel, arguments);
430 +var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) {
431 + function Component() {
432 + (0, _classCallCheck2.default)(this, Component);
433 + return _callSuper(this, Component, arguments);
864 434 }
865 - (0, _inherits2.default)(AtomicElementBaseModel, _elementor$modules$el);
866 - return (0, _createClass2.default)(AtomicElementBaseModel, [{
867 - key: "isValidChild",
868 - value:
869 - /**
870 - * Do not allow section, column or container be placed in the Atomic container.
871 - *
872 - * @param {*} childModel
873 - */
874 - function isValidChild(childModel) {
875 - var elType = childModel.get('elType');
876 - return 'section' !== elType && 'column' !== elType;
435 + (0, _inherits2.default)(Component, _$e$modules$Component);
436 + return (0, _createClass2.default)(Component, [{
437 + key: "getNamespace",
438 + value: function getNamespace() {
439 + return 'document/atomic-widgets';
877 440 }
878 441 }, {
879 - key: "initialize",
880 - value: function initialize(attributes, options) {
881 - var _this$config;
882 - var elementType = this.get('elType');
883 - this.config = elementor.config.elements[elementType];
884 - if ((_this$config = this.config) !== null && _this$config !== void 0 && (_this$config = _this$config.meta) !== null && _this$config !== void 0 && _this$config.permanently_locked) {
885 - this.set('isLocked', true);
886 - }
887 - var isNewElementCreate = 0 === this.get('elements').length && $e.commands.currentTrace.includes('document/elements/create');
888 - if (isNewElementCreate) {
889 - this.onElementCreate();
890 - }
891 - _superPropGet(AtomicElementBaseModel, "initialize", this, 3)([attributes, options]);
442 + key: "defaultHooks",
443 + value: function defaultHooks() {
444 + return this.importHooks(hooks);
892 445 }
893 - }, {
894 - key: "getDefaultChildren",
895 - value: function getDefaultChildren() {
896 - var defaultChildren = this.config.default_children;
897 - return this.modifyDefaultChildren(defaultChildren);
898 - }
899 - }, {
900 - key: "onElementCreate",
901 - value: function onElementCreate() {
902 - var _this = this;
903 - if (this.get('skipDefaultChildren')) {
904 - this.unset('skipDefaultChildren', {
905 - silent: true
906 - });
907 - return;
908 - }
909 - this.set('elements', this.getDefaultChildren().map(function (element) {
910 - return _this.buildElement(element);
911 - }));
912 - }
913 - }, {
914 - key: "modifyDefaultChildren",
915 - value: function modifyDefaultChildren(element) {
916 - return element;
917 - }
918 - }, {
919 - key: "buildElement",
920 - value: function buildElement(element) {
921 - var _this2 = this,
922 - _element$settings;
923 - var id = elementorCommon.helpers.getUniqueId();
924 - var elements = (element.elements || []).map(function (el) {
925 - return _this2.buildElement(el);
926 - });
927 - return {
928 - elType: element.elType,
929 - widgetType: element.widgetType,
930 - id: id,
931 - settings: (_element$settings = element.settings) !== null && _element$settings !== void 0 ? _element$settings : {},
932 - elements: elements,
933 - isLocked: element.isLocked || false,
934 - editor_settings: element.editor_settings || {},
935 - meta: element.meta || {}
936 - };
937 - }
938 446 }]);
939 -}(elementor.modules.elements.models.Element);
447 +}($e.modules.ComponentBase);
940 448
941 449 /***/ }),
942 450
943 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js":
944 -/*!******************************************************************************!*\
945 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js ***!
946 - \******************************************************************************/
451 +/***/ "../modules/atomic-widgets/assets/js/editor/container/div-block-empty-view.js":
452 +/*!************************************************************************************!*\
453 + !*** ../modules/atomic-widgets/assets/js/editor/container/div-block-empty-view.js ***!
454 + \************************************************************************************/
947 455 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
948 456
949 457 "use strict";
950 458
@@ -953,121 +461,61 @@
953 461 Object.defineProperty(exports, "__esModule", ({
954 462 value: true
955 463 }));
956 464 exports["default"] = void 0;
465 +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
957 466 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
958 467 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
959 468 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
960 469 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
961 470 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
471 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
472 +var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
473 +var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
962 474 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)); }
963 475 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
964 -var AtomicElementBaseType = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
965 - function AtomicElementBaseType(elementType, viewClass) {
476 +var DivBlockEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
477 + function DivBlockEmptyView() {
966 478 var _this;
967 - var modelClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
968 - var emptyViewClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
969 - (0, _classCallCheck2.default)(this, AtomicElementBaseType);
970 - _this = _callSuper(this, AtomicElementBaseType);
971 - _this.elementType = elementType;
972 - _this.viewClass = viewClass;
973 - _this.modelClass = modelClass;
974 - _this.emptyViewClass = emptyViewClass;
479 + (0, _classCallCheck2.default)(this, DivBlockEmptyView);
480 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
481 + args[_key] = arguments[_key];
482 + }
483 + _this = _callSuper(this, DivBlockEmptyView, [].concat(args));
484 + (0, _defineProperty2.default)(_this, "template", '<div></div>');
485 + (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view');
975 486 return _this;
976 487 }
977 - (0, _inherits2.default)(AtomicElementBaseType, _elementor$modules$el);
978 - return (0, _createClass2.default)(AtomicElementBaseType, [{
979 - key: "getType",
980 - value: function getType() {
981 - return this.elementType;
488 + (0, _inherits2.default)(DivBlockEmptyView, _Marionette$ItemView);
489 + return (0, _createClass2.default)(DivBlockEmptyView, [{
490 + key: "renderReactDefaultElement",
491 + value: function renderReactDefaultElement(container) {
492 + var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, {
493 + container: container
494 + }), this.el),
495 + unmount = _ReactUtils$render.unmount;
496 + this.unmount = unmount;
982 497 }
983 498 }, {
984 - key: "getView",
985 - value: function getView() {
986 - return this.viewClass;
499 + key: "onRender",
500 + value: function onRender() {
501 + this.$el.addClass(this.className);
502 + this.renderReactDefaultElement();
987 503 }
988 504 }, {
989 - key: "getEmptyView",
990 - value: function getEmptyView() {
991 - return this.emptyViewClass || elementor.modules.elements.views.EmptyComponent;
505 + key: "onDestroy",
506 + value: function onDestroy() {
507 + this.unmount();
992 508 }
993 - }, {
994 - key: "getModel",
995 - value: function getModel() {
996 - return this.modelClass || elementor.modules.elements.models.AtomicElementBase;
997 - }
998 509 }]);
999 -}(elementor.modules.elements.types.Base);
510 +}(Marionette.ItemView);
1000 511
1001 512 /***/ }),
1002 513
1003 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js":
1004 -/*!************************************************************************************************!*\
1005 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js ***!
1006 - \************************************************************************************************/
1007 -/***/ ((__unused_webpack_module, exports) => {
1008 -
1009 -"use strict";
1010 -
1011 -
1012 -Object.defineProperty(exports, "__esModule", ({
1013 - value: true
1014 -}));
1015 -exports["default"] = void 0;
1016 -var createDivBlockType = function createDivBlockType() {
1017 - var DivBlockView = elementor.modules.elements.views.createAtomicElementBase('e-div-block');
1018 - return new elementor.modules.elements.types.AtomicElementBase('e-div-block', DivBlockView);
1019 -};
1020 -var _default = exports["default"] = createDivBlockType;
1021 -
1022 -/***/ }),
1023 -
1024 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js":
1025 -/*!**********************************************************************************************!*\
1026 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js ***!
1027 - \**********************************************************************************************/
1028 -/***/ ((__unused_webpack_module, exports) => {
1029 -
1030 -"use strict";
1031 -
1032 -
1033 -Object.defineProperty(exports, "__esModule", ({
1034 - value: true
1035 -}));
1036 -exports["default"] = void 0;
1037 -var createFlexboxType = function createFlexboxType() {
1038 - var FlexboxView = elementor.modules.elements.views.createAtomicElementBase('e-flexbox');
1039 - return new elementor.modules.elements.types.AtomicElementBase('e-flexbox', FlexboxView);
1040 -};
1041 -var _default = exports["default"] = createFlexboxType;
1042 -
1043 -/***/ }),
1044 -
1045 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js":
1046 -/*!*******************************************************************************************!*\
1047 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js ***!
1048 - \*******************************************************************************************/
1049 -/***/ ((__unused_webpack_module, exports) => {
1050 -
1051 -"use strict";
1052 -
1053 -
1054 -Object.defineProperty(exports, "__esModule", ({
1055 - value: true
1056 -}));
1057 -exports["default"] = void 0;
1058 -var createGridType = function createGridType() {
1059 - var GridView = elementor.modules.elements.views.createAtomicElementBase('e-grid');
1060 - return new elementor.modules.elements.types.AtomicElementBase('e-grid', GridView);
1061 -};
1062 -var _default = exports["default"] = createGridType;
1063 -
1064 -/***/ }),
1065 -
1066 -/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
1067 -/*!***************************************************************!*\
1068 - !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
1069 - \***************************************************************/
514 +/***/ "../modules/atomic-widgets/assets/js/editor/div-block-model.js":
515 +/*!*********************************************************************!*\
516 + !*** ../modules/atomic-widgets/assets/js/editor/div-block-model.js ***!
517 + \*********************************************************************/
1070 518 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1071 519
1072 520 "use strict";
1073 521
@@ -1072,9 +520,8 @@
1072 520 "use strict";
1073 521
1074 522
1075 523 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1076 -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1077 524 Object.defineProperty(exports, "__esModule", ({
1078 525 value: true
1079 526 }));
1080 527 exports["default"] = void 0;
@@ -1082,37 +529,37 @@
1082 529 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1083 530 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1084 531 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1085 532 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1086 -var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js"));
1087 -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
1088 533 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)); }
1089 534 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1090 -var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) {
1091 - function Component() {
1092 - (0, _classCallCheck2.default)(this, Component);
1093 - return _callSuper(this, Component, arguments);
535 +var AtomicContainer = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
536 + function AtomicContainer() {
537 + (0, _classCallCheck2.default)(this, AtomicContainer);
538 + return _callSuper(this, AtomicContainer, arguments);
1094 539 }
1095 - (0, _inherits2.default)(Component, _$e$modules$Component);
1096 - return (0, _createClass2.default)(Component, [{
1097 - key: "getNamespace",
1098 - value: function getNamespace() {
1099 - return 'document/atomic-widgets';
540 + (0, _inherits2.default)(AtomicContainer, _elementor$modules$el);
541 + return (0, _createClass2.default)(AtomicContainer, [{
542 + key: "isValidChild",
543 + value:
544 + /**
545 + * Do not allow section, column or container be placed in the Atomic container.
546 + *
547 + * @param {*} childModel
548 + */
549 + function isValidChild(childModel) {
550 + var elType = childModel.get('elType');
551 + return 'section' !== elType && 'column' !== elType;
1100 552 }
1101 - }, {
1102 - key: "defaultHooks",
1103 - value: function defaultHooks() {
1104 - return this.importHooks(hooks);
1105 - }
1106 553 }]);
1107 -}($e.modules.ComponentBase);
554 +}(elementor.modules.elements.models.Element);
1108 555
1109 556 /***/ }),
1110 557
1111 -/***/ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js":
1112 -/*!*****************************************************************************************!*\
1113 - !*** ../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js ***!
1114 - \*****************************************************************************************/
558 +/***/ "../modules/atomic-widgets/assets/js/editor/div-block-type.js":
559 +/*!********************************************************************!*\
560 + !*** ../modules/atomic-widgets/assets/js/editor/div-block-type.js ***!
561 + \********************************************************************/
1115 562 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1116 563
1117 564 "use strict";
1118 565
@@ -1121,73 +568,54 @@
1121 568 Object.defineProperty(exports, "__esModule", ({
1122 569 value: true
1123 570 }));
1124 571 exports["default"] = void 0;
1125 -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
1126 572 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1127 573 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1128 574 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1129 575 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1130 576 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1131 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1132 -var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
1133 577 var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
578 +var _divBlockModel = _interopRequireDefault(__webpack_require__(/*! ./div-block-model */ "../modules/atomic-widgets/assets/js/editor/div-block-model.js"));
579 +var _divBlockView = _interopRequireDefault(__webpack_require__(/*! ./div-block-view */ "../modules/atomic-widgets/assets/js/editor/div-block-view.js"));
1134 580 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)); }
1135 581 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1136 -var AtomicElementEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
1137 - function AtomicElementEmptyView() {
1138 - var _this;
1139 - (0, _classCallCheck2.default)(this, AtomicElementEmptyView);
1140 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1141 - args[_key] = arguments[_key];
1142 - }
1143 - _this = _callSuper(this, AtomicElementEmptyView, [].concat(args));
1144 - (0, _defineProperty2.default)(_this, "template", '<div></div>');
1145 - (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view');
1146 - (0, _defineProperty2.default)(_this, "unmount", null);
1147 - return _this;
582 +var AtomicContainer = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
583 + function AtomicContainer() {
584 + (0, _classCallCheck2.default)(this, AtomicContainer);
585 + return _callSuper(this, AtomicContainer, arguments);
1148 586 }
1149 - (0, _inherits2.default)(AtomicElementEmptyView, _Marionette$ItemView);
1150 - return (0, _createClass2.default)(AtomicElementEmptyView, [{
1151 - key: "renderReactDefaultElement",
1152 - value: function renderReactDefaultElement(container) {
1153 - var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, {
1154 - container: container
1155 - }), this.el),
1156 - unmount = _ReactUtils$render.unmount;
1157 - this.unmount = unmount;
587 + (0, _inherits2.default)(AtomicContainer, _elementor$modules$el);
588 + return (0, _createClass2.default)(AtomicContainer, [{
589 + key: "getType",
590 + value: function getType() {
591 + return 'e-div-block';
1158 592 }
1159 593 }, {
1160 - key: "onBeforeRender",
1161 - value: function onBeforeRender() {
1162 - // In case the element is being rendered again, we need to unmount the previous React component.
1163 - if (this.unmount) {
1164 - this.unmount();
1165 - this.unmount = null;
1166 - }
594 + key: "getView",
595 + value: function getView() {
596 + return _divBlockView.default;
1167 597 }
1168 598 }, {
1169 - key: "onRender",
1170 - value: function onRender() {
1171 - this.$el.addClass(this.className);
1172 - this.renderReactDefaultElement();
599 + key: "getEmptyView",
600 + value: function getEmptyView() {
601 + return _emptyComponent.default;
1173 602 }
1174 603 }, {
1175 - key: "onDestroy",
1176 - value: function onDestroy() {
1177 - var _this$unmount;
1178 - (_this$unmount = this.unmount) === null || _this$unmount === void 0 || _this$unmount.call(this);
604 + key: "getModel",
605 + value: function getModel() {
606 + return _divBlockModel.default;
1179 607 }
1180 608 }]);
1181 -}(Marionette.ItemView);
609 +}(elementor.modules.elements.types.Base);
1182 610
1183 611 /***/ }),
1184 612
1185 -/***/ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js":
1186 -/*!*************************************************************************************!*\
1187 - !*** ../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js ***!
1188 - \*************************************************************************************/
1189 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
613 +/***/ "../modules/atomic-widgets/assets/js/editor/div-block-view.js":
614 +/*!********************************************************************!*\
615 + !*** ../modules/atomic-widgets/assets/js/editor/div-block-view.js ***!
616 + \********************************************************************/
617 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1190 618
1191 619 "use strict";
1192 620 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1193 621 /* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
@@ -1193,507 +621,472 @@
1193 621 /* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
1194 622
1195 623
1196 624 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1197 -Object.defineProperty(exports, "__esModule", ({
1198 - value: true
1199 -}));
1200 -exports["default"] = createAtomicElementBaseView;
1201 -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1202 -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1203 625 var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1204 -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
626 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
627 +var _divBlockEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/div-block-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/div-block-empty-view.js"));
1205 628 var _elementTypes = __webpack_require__(/*! elementor-editor/utils/element-types */ "../assets/dev/js/editor/utils/element-types.js");
1206 -var _atomicElementEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/atomic-element-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js"));
629 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
630 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1207 631 var BaseElementView = elementor.modules.elements.views.BaseElement;
1208 -function createAtomicElementBaseView(type) {
1209 - var AtomicElementView = BaseElementView.extend({
1210 - template: Marionette.TemplateCache.get("#tmpl-elementor-".concat(type, "-content")),
1211 - emptyView: _atomicElementEmptyView.default,
1212 - _childrenRenderPromises: [],
1213 - _createElement: function _createElement(tag) {
1214 - var _elementor$$preview;
1215 - var previewDocument = (_elementor$$preview = elementor.$preview) === null || _elementor$$preview === void 0 || (_elementor$$preview = _elementor$$preview[0]) === null || _elementor$$preview === void 0 ? void 0 : _elementor$$preview.contentDocument;
1216 - if (previewDocument) {
1217 - return previewDocument.createElement(tag);
632 +var DivBlockView = BaseElementView.extend({
633 + template: Marionette.TemplateCache.get('#tmpl-elementor-e-div-block-content'),
634 + emptyView: _divBlockEmptyView.default,
635 + tagName: function tagName() {
636 + if (this.haveLink()) {
637 + return 'a';
638 + }
639 + var tagControl = this.model.getSetting('tag');
640 + var tagControlValue = (tagControl === null || tagControl === void 0 ? void 0 : tagControl.value) || tagControl;
641 + return tagControlValue || 'div';
642 + },
643 + getChildViewContainer: function getChildViewContainer() {
644 + this.childViewContainer = '';
645 + return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments);
646 + },
647 + className: function className() {
648 + return "".concat(BaseElementView.prototype.className.apply(this), " e-con ").concat(this.getClassString());
649 + },
650 + // TODO: Copied from `views/column.js`.
651 + ui: function ui() {
652 + var ui = BaseElementView.prototype.ui.apply(this, arguments);
653 + ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip';
654 + return ui;
655 + },
656 + attributes: function attributes() {
657 + var _this$model$getSettin, _this$model$getSettin2;
658 + var attr = BaseElementView.prototype.attributes.apply(this);
659 + var local = {};
660 + var cssId = this.model.getSetting('_cssid');
661 + var customAttributes = (_this$model$getSettin = (_this$model$getSettin2 = this.model.getSetting('attributes')) === null || _this$model$getSettin2 === void 0 ? void 0 : _this$model$getSettin2.value) !== null && _this$model$getSettin !== void 0 ? _this$model$getSettin : [];
662 + if (cssId) {
663 + local.id = cssId.value;
664 + }
665 + var href = this.getHref();
666 + if (href) {
667 + local.href = href;
668 + }
669 + customAttributes.forEach(function (attribute) {
670 + var _attribute$value, _attribute$value2;
671 + var key = (_attribute$value = attribute.value) === null || _attribute$value === void 0 || (_attribute$value = _attribute$value.key) === null || _attribute$value === void 0 ? void 0 : _attribute$value.value;
672 + var value = (_attribute$value2 = attribute.value) === null || _attribute$value2 === void 0 || (_attribute$value2 = _attribute$value2.value) === null || _attribute$value2 === void 0 ? void 0 : _attribute$value2.value;
673 + if (key && value) {
674 + local[key] = value;
1218 675 }
1219 - return document.createElement(tag);
1220 - },
1221 - getChildViewContainer: function getChildViewContainer() {
1222 - this.childViewContainer = '';
1223 - return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments);
1224 - },
1225 - getChildType: function getChildType() {
1226 - var atomicElements = Object.entries(elementor.config.elements).filter(function (_ref) {
1227 - var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1228 - element = _ref2[1];
1229 - return !!(element !== null && element !== void 0 && element.atomic_props_schema);
1230 - }).map(function (_ref3) {
1231 - var _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
1232 - elType = _ref4[0];
1233 - return elType;
1234 - });
1235 - return ['widget', 'container'].concat((0, _toConsumableArray2.default)(atomicElements));
1236 - },
1237 - getRenderContext: function getRenderContext() {
1238 - var _this$_parent, _this$_parent$getRend;
1239 - return (_this$_parent = this._parent) === null || _this$_parent === void 0 || (_this$_parent$getRend = _this$_parent.getRenderContext) === null || _this$_parent$getRend === void 0 ? void 0 : _this$_parent$getRend.call(_this$_parent);
1240 - },
1241 - getResolverRenderContext: function getResolverRenderContext() {
1242 - var _this$_parent2, _this$_parent2$getRes;
1243 - return (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || (_this$_parent2$getRes = _this$_parent2.getResolverRenderContext) === null || _this$_parent2$getRes === void 0 ? void 0 : _this$_parent2$getRes.call(_this$_parent2);
1244 - },
1245 - render: function render() {
1246 - var _this = this;
1247 - this._currentRenderPromise = new Promise(function (resolve) {
1248 - // Optimize rendering by reusing existing child views instead of recreating them.
1249 - if (_this._shouldSkipFullRender()) {
1250 - _this._renderWithoutDomRecreation(resolve);
1251 - } else {
1252 - _this._renderWithDomRecreation(resolve);
676 + });
677 + return _objectSpread(_objectSpread({}, attr), local);
678 + },
679 + // TODO: Copied from `views/column.js`.
680 + attachElContent: function attachElContent() {
681 + BaseElementView.prototype.attachElContent.apply(this, arguments);
682 + var $tooltip = jQuery('<div>', {
683 + class: 'elementor-column-percents-tooltip',
684 + 'data-side': elementorCommon.config.isRTL ? 'right' : 'left'
685 + });
686 + this.$el.children('.elementor-element-overlay').append($tooltip);
687 + },
688 + // TODO: Copied from `views/column.js`.
689 + getPercentSize: function getPercentSize(size) {
690 + if (!size) {
691 + size = this.el.getBoundingClientRect().width;
692 + }
693 + return +(size / this.$el.parent().width() * 100).toFixed(3);
694 + },
695 + // TODO: Copied from `views/column.js`.
696 + getPercentsForDisplay: function getPercentsForDisplay() {
697 + var width = +this.model.getSetting('width') || this.getPercentSize();
698 + return width.toFixed(1) + '%';
699 + },
700 + renderOnChange: function renderOnChange(settings) {
701 + var _this = this;
702 + var changed = settings.changedAttributes();
703 + setTimeout(function () {
704 + _this.updateHandlesPosition();
705 + });
706 + if (!changed) {
707 + return;
708 + }
709 + BaseElementView.prototype.renderOnChange.apply(this, settings);
710 + if (changed.attributes) {
711 + var _this$model$getSettin3;
712 + var preserveAttrs = ['id', 'class', 'href'];
713 + var $elAttrs = this.$el[0].attributes;
714 + for (var i = $elAttrs.length - 1; i >= 0; i--) {
715 + var attrName = $elAttrs[i].name;
716 + if (!preserveAttrs.includes(attrName)) {
717 + this.$el.removeAttr(attrName);
1253 718 }
1254 - });
1255 - return this;
1256 - },
1257 - _shouldSkipFullRender: function _shouldSkipFullRender() {
1258 - return this.isRendered && this._hasConnectedChildren();
1259 - },
1260 - _hasConnectedChildren: function _hasConnectedChildren() {
1261 - var _this$children, _firstChild$$el$get$i, _firstChild$$el;
1262 - if (!((_this$children = this.children) !== null && _this$children !== void 0 && _this$children.length)) {
1263 - return false;
1264 719 }
1265 -
1266 - // If the parent's innerHTML was replaced, all children are detached together.
1267 - var firstChild = this.children.findByIndex(0);
1268 - return (_firstChild$$el$get$i = firstChild === null || firstChild === void 0 || (_firstChild$$el = firstChild.$el) === null || _firstChild$$el === void 0 || (_firstChild$$el = _firstChild$$el.get(0)) === null || _firstChild$$el === void 0 ? void 0 : _firstChild$$el.isConnected) !== null && _firstChild$$el$get$i !== void 0 ? _firstChild$$el$get$i : false;
1269 - },
1270 - _renderWithoutDomRecreation: function _renderWithoutDomRecreation(resolve) {
1271 - var _this2 = this;
1272 - this._beforeRender();
1273 - this._renderChildren();
1274 - this._waitForChildrenToComplete().then(function () {
1275 - _this2._afterRender();
1276 - resolve();
720 + var attrs = ((_this$model$getSettin3 = this.model.getSetting('attributes')) === null || _this$model$getSettin3 === void 0 ? void 0 : _this$model$getSettin3.value) || [];
721 + attrs.forEach(function (attribute) {
722 + var _attribute$value3, _attribute$value4;
723 + var key = attribute === null || attribute === void 0 || (_attribute$value3 = attribute.value) === null || _attribute$value3 === void 0 || (_attribute$value3 = _attribute$value3.key) === null || _attribute$value3 === void 0 ? void 0 : _attribute$value3.value;
724 + var value = attribute === null || attribute === void 0 || (_attribute$value4 = attribute.value) === null || _attribute$value4 === void 0 || (_attribute$value4 = _attribute$value4.value) === null || _attribute$value4 === void 0 ? void 0 : _attribute$value4.value;
725 + if (key && value) {
726 + _this.$el.attr(key, value);
727 + }
1277 728 });
1278 - },
1279 - _renderWithDomRecreation: function _renderWithDomRecreation(resolve) {
1280 - BaseElementView.prototype.render.apply(this, arguments);
1281 - this._waitForChildrenToComplete().then(function () {
1282 - resolve();
1283 - });
1284 - },
1285 - _beforeRender: function _beforeRender() {
1286 - this._isRendering = true;
1287 - this.triggerMethod('before:render', this);
1288 - },
1289 - _afterRender: function _afterRender() {
1290 - this._isRendering = false;
1291 - this.isRendered = true;
1292 - this.triggerMethod('render', this);
1293 - },
1294 - _waitForChildrenToComplete: function _waitForChildrenToComplete() {
1295 - var _this3 = this;
1296 - return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
1297 - return _regenerator.default.wrap(function (_context) {
1298 - while (1) switch (_context.prev = _context.next) {
1299 - case 0:
1300 - if (!(_this3._childrenRenderPromises.length > 0)) {
1301 - _context.next = 1;
1302 - break;
1303 - }
1304 - _context.next = 1;
1305 - return Promise.all(_this3._childrenRenderPromises);
1306 - case 1:
1307 - case "end":
1308 - return _context.stop();
1309 - }
1310 - }, _callee);
1311 - }))();
1312 - },
1313 - _renderChildren: function _renderChildren() {
1314 - if (this._shouldSkipFullRender()) {
1315 - var _this$children2;
1316 - (_this$children2 = this.children) === null || _this$children2 === void 0 || _this$children2.each(function (childView) {
1317 - return childView.render();
1318 - });
729 + return;
730 + }
731 + if (changed.classes) {
732 + this.$el.attr('class', this.className());
733 + return;
734 + }
735 + if (changed._cssid) {
736 + if (changed._cssid.value) {
737 + this.$el.attr('id', changed._cssid.value);
1319 738 } else {
1320 - BaseElementView.prototype._renderChildren.apply(this, arguments);
739 + this.$el.removeAttr('id');
1321 740 }
1322 - this._collectChildrenRenderPromises();
1323 - },
1324 - _collectChildrenRenderPromises: function _collectChildrenRenderPromises() {
1325 - var _this$children3,
1326 - _this4 = this;
1327 - this._childrenRenderPromises = [];
1328 - (_this$children3 = this.children) === null || _this$children3 === void 0 || _this$children3.each(function (childView) {
1329 - if (childView._currentRenderPromise) {
1330 - _this4._childrenRenderPromises.push(childView._currentRenderPromise);
1331 - }
1332 - });
1333 - },
1334 - onRender: function onRender() {
1335 - var _this5 = this;
1336 - this.dispatchPreviewEvent('elementor/element/render');
1337 - BaseElementView.prototype.onRender.apply(this, arguments);
741 + return;
742 + }
743 + this.$el.addClass(this.getClasses());
744 + if (this.isTagChanged(changed)) {
745 + this.rerenderEntireView();
746 + }
747 + },
748 + isTagChanged: function isTagChanged(changed) {
749 + return ((changed === null || changed === void 0 ? void 0 : changed.tag) !== undefined || (changed === null || changed === void 0 ? void 0 : changed.link) !== undefined) && this._parent && this.tagName() !== this.el.tagName;
750 + },
751 + rerenderEntireView: function rerenderEntireView() {
752 + var parent = this._parent;
753 + this._parent.removeChildView(this);
754 + parent.addChild(this.model, DivBlockView, this._index);
755 + },
756 + onRender: function onRender() {
757 + var _this2 = this;
758 + BaseElementView.prototype.onRender.apply(this, arguments);
1338 759
1339 - // Defer to wait for everything to render.
1340 - setTimeout(function () {
1341 - if (_this5.isAtomicGridContainer()) {
1342 - _this5.reInitEmptyView();
1343 - }
1344 - _this5.droppableInitialize();
1345 - _this5.updateHandlesPosition();
1346 - });
1347 - },
1348 - destroyEmptyView: function destroyEmptyView() {
1349 - if (this.isAtomicGridContainer()) {
1350 - return;
1351 - }
1352 - return Marionette.CompositeView.prototype.destroyEmptyView.apply(this, arguments);
1353 - },
1354 - isAtomicGridContainer: function isAtomicGridContainer() {
1355 - return 'e-grid' === type;
1356 - },
1357 - reInitEmptyView: function reInitEmptyView() {
1358 - var _this$el;
1359 - if ((_this$el = this.el) !== null && _this$el !== void 0 && _this$el.querySelector(':scope > .elementor-empty-view')) {
1360 - return;
1361 - }
1362 - delete this._showingEmptyView;
1363 - this.showEmptyView();
1364 - },
1365 - onDestroy: function onDestroy() {
1366 - BaseElementView.prototype.onDestroy.apply(this, arguments);
1367 - this.dispatchPreviewEvent('elementor/element/destroy');
1368 - },
1369 - dispatchPreviewEvent: function dispatchPreviewEvent(eventType) {
1370 - var _elementor;
1371 - (_elementor = elementor) === null || _elementor === void 0 || (_elementor = _elementor.$preview) === null || _elementor === void 0 || (_elementor = _elementor[0]) === null || _elementor === void 0 || _elementor.contentWindow.dispatchEvent(new CustomEvent(eventType, {
1372 - detail: {
1373 - id: this.model.get('id'),
1374 - type: this.model.get('elType'),
1375 - element: this.getDomElement().get(0)
1376 - }
760 + // Defer to wait for everything to render.
761 + setTimeout(function () {
762 + _this2.droppableInitialize();
763 + _this2.updateHandlesPosition();
764 + });
765 + },
766 + haveLink: function haveLink() {
767 + var _this$model$getSettin4;
768 + return !!((_this$model$getSettin4 = this.model.getSetting('link')) !== null && _this$model$getSettin4 !== void 0 && (_this$model$getSettin4 = _this$model$getSettin4.value) !== null && _this$model$getSettin4 !== void 0 && (_this$model$getSettin4 = _this$model$getSettin4.destination) !== null && _this$model$getSettin4 !== void 0 && _this$model$getSettin4.value);
769 + },
770 + getHref: function getHref() {
771 + if (!this.haveLink()) {
772 + return;
773 + }
774 + var _this$model$getSettin5 = this.model.getSetting('link').value.destination,
775 + $$type = _this$model$getSettin5.$$type,
776 + value = _this$model$getSettin5.value;
777 + var isPostId = 'number' === $$type;
778 + var hrefPrefix = isPostId ? elementor.config.home_url + '/?p=' : '';
779 + return hrefPrefix + value;
780 + },
781 + droppableInitialize: function droppableInitialize() {
782 + this.$el.html5Droppable(this.getDroppableOptions());
783 + },
784 + /**
785 + * Add a `Save as a Template` button to the context menu.
786 + *
787 + * @return {Object} groups
788 + */
789 + getContextMenuGroups: function getContextMenuGroups() {
790 + var _elementorCommon$conf,
791 + _this3 = this;
792 + var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments),
793 + transferGroupClipboardIndex = groups.indexOf(_.findWhere(groups, {
794 + name: 'clipboard'
1377 795 }));
1378 - },
1379 - droppableInitialize: function droppableInitialize() {
1380 - this.$el.html5Droppable(this.getDroppableOptions());
1381 - },
1382 - /**
1383 - * Add a `Save as a Template` button to the context menu.
1384 - *
1385 - * @return {Object} groups
1386 - */
1387 - getContextMenuGroups: function getContextMenuGroups() {
1388 - var _this6 = this,
1389 - _elementorCommon$conf;
1390 - var saveActions = [{
796 + groups.splice(transferGroupClipboardIndex + 1, 0, {
797 + name: 'save',
798 + actions: [{
1391 799 name: 'save',
1392 800 title: __('Save as a template', 'elementor'),
801 + shortcut: (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) !== null && _elementorCommon$conf !== void 0 && _elementorCommon$conf['cloud-library'] ? "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>") : '',
1393 802 callback: this.saveAsTemplate.bind(this),
1394 803 isEnabled: function isEnabled() {
1395 - return !_this6.getContainer().isLocked();
804 + return !_this3.getContainer().isLocked();
1396 805 }
1397 - }];
1398 - var isAdministrator = elementor.config.user.is_administrator;
1399 - var isExperimentalFeaturesEnabled = (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.e_components;
1400 - if (isExperimentalFeaturesEnabled && isAdministrator) {
1401 - var _window$elementorV2$u, _window$elementorV, _window$elementorV$is, _window$elementorV2$u2, _window$elementorV2, _window$elementorV2$h, _window$elementorV2$u3, _window$elementorV3, _window$elementorV3$i;
1402 - var isProActive = (_window$elementorV2$u = (_window$elementorV = window.elementorV2) === null || _window$elementorV === void 0 || (_window$elementorV = _window$elementorV.utils) === null || _window$elementorV === void 0 || (_window$elementorV$is = _window$elementorV.isProActive) === null || _window$elementorV$is === void 0 ? void 0 : _window$elementorV$is.call(_window$elementorV)) !== null && _window$elementorV2$u !== void 0 ? _window$elementorV2$u : true;
1403 - var hasProInstalled = (_window$elementorV2$u2 = (_window$elementorV2 = window.elementorV2) === null || _window$elementorV2 === void 0 || (_window$elementorV2 = _window$elementorV2.utils) === null || _window$elementorV2 === void 0 || (_window$elementorV2$h = _window$elementorV2.hasProInstalled) === null || _window$elementorV2$h === void 0 ? void 0 : _window$elementorV2$h.call(_window$elementorV2)) !== null && _window$elementorV2$u2 !== void 0 ? _window$elementorV2$u2 : false;
1404 - var isProOutdated = hasProInstalled && !((_window$elementorV2$u3 = (_window$elementorV3 = window.elementorV2) === null || _window$elementorV3 === void 0 || (_window$elementorV3 = _window$elementorV3.utils) === null || _window$elementorV3 === void 0 || (_window$elementorV3$i = _window$elementorV3.isProAtLeast) === null || _window$elementorV3$i === void 0 ? void 0 : _window$elementorV3$i.call(_window$elementorV3, '4.0')) !== null && _window$elementorV2$u3 !== void 0 ? _window$elementorV2$u3 : false);
1405 - var showPromoBadge = !isProActive && !isProOutdated;
1406 - var newBadge = "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>");
1407 - var badgeClass = 'elementor-context-menu-list__item__shortcut__promotion-badge';
1408 - var proBadge = "<a href=\"https://go.elementor.com/go-pro-components-Instance-create-context-menu/\" target=\"_blank\" onclick=\"event.stopPropagation()\" class=\"".concat(badgeClass, "\"><i class=\"eicon-upgrade-crown\"></i></a>");
1409 - saveActions.unshift({
1410 - name: 'save-component',
1411 - title: __('Create component', 'elementor'),
1412 - shortcut: isProActive || isProOutdated ? newBadge : proBadge,
1413 - hasShortcutAction: showPromoBadge,
1414 - callback: this.saveAsComponent.bind(this),
1415 - isEnabled: function isEnabled() {
1416 - return (isProActive || isProOutdated) && !_this6.getContainer().isLocked();
1417 - }
1418 - });
806 + }]
807 + });
808 + return groups;
809 + },
810 + saveAsTemplate: function saveAsTemplate() {
811 + $e.route('library/save-template', {
812 + model: this.model
813 + });
814 + },
815 + isDroppingAllowed: function isDroppingAllowed() {
816 + return true;
817 + },
818 + behaviors: function behaviors() {
819 + var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments);
820 + _.extend(behaviors, {
821 + Sortable: {
822 + behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"),
823 + elChildType: 'widget'
1419 824 }
1420 - var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments),
1421 - transferGroupClipboardIndex = groups.indexOf(_.findWhere(groups, {
1422 - name: 'clipboard'
1423 - }));
1424 - groups.splice(transferGroupClipboardIndex + 1, 0, {
1425 - name: 'save',
1426 - actions: saveActions
1427 - });
1428 - return groups;
1429 - },
1430 - saveAsTemplate: function saveAsTemplate() {
1431 - elementor.templates.eventManager.sendNewSaveTemplateClickedEvent();
1432 - $e.route('library/save-template', {
1433 - model: this.model
1434 - });
1435 - },
1436 - saveAsComponent: function saveAsComponent(openContextMenuEvent, options) {
1437 - var _window$elementorV2$u4, _window$elementorV4, _window$elementorV4$h, _window$elementorV2$u5, _window$elementorV5, _window$elementorV5$i, _window$elementorV2$u6, _window$elementorV7, _window$elementorV7$i;
1438 - var hasProInstalled = (_window$elementorV2$u4 = (_window$elementorV4 = window.elementorV2) === null || _window$elementorV4 === void 0 || (_window$elementorV4 = _window$elementorV4.utils) === null || _window$elementorV4 === void 0 || (_window$elementorV4$h = _window$elementorV4.hasProInstalled) === null || _window$elementorV4$h === void 0 ? void 0 : _window$elementorV4$h.call(_window$elementorV4)) !== null && _window$elementorV2$u4 !== void 0 ? _window$elementorV2$u4 : false;
1439 - var isProOutdated = hasProInstalled && !((_window$elementorV2$u5 = (_window$elementorV5 = window.elementorV2) === null || _window$elementorV5 === void 0 || (_window$elementorV5 = _window$elementorV5.utils) === null || _window$elementorV5 === void 0 || (_window$elementorV5$i = _window$elementorV5.isProAtLeast) === null || _window$elementorV5$i === void 0 ? void 0 : _window$elementorV5$i.call(_window$elementorV5, '4.0')) !== null && _window$elementorV2$u5 !== void 0 ? _window$elementorV2$u5 : false);
1440 - if (isProOutdated) {
1441 - var _window$elementorV6, _window$elementorV6$n;
1442 - (_window$elementorV6 = window.elementorV2) === null || _window$elementorV6 === void 0 || (_window$elementorV6 = _window$elementorV6.editorNotifications) === null || _window$elementorV6 === void 0 || (_window$elementorV6$n = _window$elementorV6.notify) === null || _window$elementorV6$n === void 0 || _window$elementorV6$n.call(_window$elementorV6, {
1443 - type: 'info',
1444 - id: 'component-create-update',
1445 - message: __('To create new components, update Elementor Pro to the latest version.', 'elementor'),
1446 - additionalActionProps: [{
1447 - size: 'small',
1448 - variant: 'contained',
1449 - color: 'info',
1450 - href: '/wp-admin/plugins.php',
1451 - target: '_blank',
1452 - children: __('Update Now', 'elementor')
1453 - }]
1454 - });
1455 - return;
1456 - }
1457 - var isProActive = (_window$elementorV2$u6 = (_window$elementorV7 = window.elementorV2) === null || _window$elementorV7 === void 0 || (_window$elementorV7 = _window$elementorV7.utils) === null || _window$elementorV7 === void 0 || (_window$elementorV7$i = _window$elementorV7.isProActive) === null || _window$elementorV7$i === void 0 ? void 0 : _window$elementorV7$i.call(_window$elementorV7)) !== null && _window$elementorV2$u6 !== void 0 ? _window$elementorV2$u6 : true;
1458 - if (!isProActive) {
1459 - return;
1460 - }
825 + });
826 + return elementor.hooks.applyFilters('elements/e-div-block/behaviors', behaviors, this);
827 + },
828 + /**
829 + * @return {{}} options
830 + */
831 + getSortableOptions: function getSortableOptions() {
832 + return {
833 + preventInit: true
834 + };
835 + },
836 + getDroppableOptions: function getDroppableOptions() {
837 + var _this4 = this;
838 + var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add';
839 + return {
840 + axis: null,
841 + items: items,
842 + groups: ['elementor-element'],
843 + horizontalThreshold: 0,
844 + isDroppingAllowed: this.isDroppingAllowed.bind(this),
845 + currentElementClass: 'elementor-html5dnd-current-element',
846 + placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder',
847 + hasDraggingOnChildClass: 'e-dragging-over',
848 + getDropContainer: function getDropContainer() {
849 + return _this4.getContainer();
850 + },
851 + onDropping: function onDropping(side, event) {
852 + event.stopPropagation();
1461 853
1462 - // Calculate the absolute position where the context menu was opened.
1463 - var openMenuOriginalEvent = openContextMenuEvent.originalEvent;
1464 - var iframeRect = elementor.$preview[0].getBoundingClientRect();
1465 - var anchorPosition = {
1466 - left: openMenuOriginalEvent.clientX + iframeRect.left,
1467 - top: openMenuOriginalEvent.clientY + iframeRect.top
1468 - };
1469 - window.dispatchEvent(new CustomEvent('elementor/editor/open-save-as-component-form', {
1470 - detail: {
1471 - element: elementor.getContainer(this.model.id).model.toJSON({
1472 - remove: ['default']
1473 - }),
1474 - anchorPosition: anchorPosition,
1475 - options: options
854 + // Triggering the drag end manually, since it won't fire above the iframe
855 + elementor.getPreviewView().onPanelElementDragEnd();
856 + var draggedView = elementor.channels.editor.request('element:dragged'),
857 + draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el,
858 + containerElement = event.currentTarget.parentElement,
859 + elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []);
860 + var targetIndex = elements.indexOf(event.currentTarget);
861 + if (_this4.isPanelElement(draggedView, draggedElement)) {
862 + if (_this4.draggingOnBottomOrRightSide(side) && !_this4.emptyViewIsCurrentlyBeingDraggedOver()) {
863 + targetIndex++;
864 + }
865 + _this4.onDrop(event, {
866 + at: targetIndex
867 + });
868 + return;
1476 869 }
1477 - }));
1478 - },
1479 - isDroppingAllowed: function isDroppingAllowed() {
1480 - return this.getContainer().isEditable();
1481 - },
1482 - behaviors: function behaviors() {
1483 - var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments);
1484 - _.extend(behaviors, {
1485 - Sortable: {
1486 - behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"),
1487 - elChildType: 'widget'
870 + if (_this4.isParentElement(draggedView.getContainer().id)) {
871 + return;
1488 872 }
1489 - });
1490 - return elementor.hooks.applyFilters("elements/".concat(type, "/behaviors"), behaviors, this);
1491 - },
1492 - /**
1493 - * @return {{}} options
1494 - */
1495 - getSortableOptions: function getSortableOptions() {
1496 - return {
1497 - preventInit: true
1498 - };
1499 - },
1500 - getDroppableOptions: function getDroppableOptions() {
1501 - var _this7 = this;
1502 - var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add';
1503 - return {
1504 - axis: this.isAtomicGridContainer() ? 'vertical' : null,
1505 - items: items,
1506 - groups: ['elementor-element'],
1507 - horizontalThreshold: 0,
1508 - isDroppingAllowed: this.isDroppingAllowed.bind(this),
1509 - currentElementClass: 'elementor-html5dnd-current-element',
1510 - placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder',
1511 - hasDraggingOnChildClass: 'e-dragging-over',
1512 - getDropContainer: function getDropContainer() {
1513 - return _this7.getContainer();
1514 - },
1515 - onDropping: function onDropping(side, event) {
1516 - event.stopPropagation();
1517 -
1518 - // Triggering the drag end manually, since it won't fire above the iframe
1519 - elementor.getPreviewView().onPanelElementDragEnd();
1520 - var draggedView = elementor.channels.editor.request('element:dragged'),
1521 - draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el,
1522 - isEmptyViewTarget = _this7.emptyViewIsCurrentlyBeingDraggedOver(),
1523 - containerElement = isEmptyViewTarget ? _this7.el : event.currentTarget.parentElement,
1524 - elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []);
1525 - var targetIndex = isEmptyViewTarget ? elements.length : elements.indexOf(event.currentTarget);
1526 - if (_this7.isPanelElement(draggedView, draggedElement)) {
1527 - if (_this7.draggingOnBottomOrRightSide(side) && !isEmptyViewTarget) {
1528 - targetIndex++;
1529 - }
1530 - _this7.onDrop(event, {
1531 - at: targetIndex
1532 - });
1533 - return;
1534 - }
1535 - if (_this7.isParentElement(draggedView.getContainer().id)) {
1536 - return;
1537 - }
1538 - if (isEmptyViewTarget) {
1539 - _this7.moveDroppedItem(draggedView, targetIndex);
1540 - return;
1541 - }
1542 - _this7.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
873 + if (_this4.emptyViewIsCurrentlyBeingDraggedOver()) {
874 + _this4.moveDroppedItem(draggedView, 0);
875 + return;
1543 876 }
1544 - };
1545 - },
1546 - moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) {
1547 - var selfIndex = elements.indexOf(draggedElement);
1548 - if (targetIndex === selfIndex) {
1549 - return;
877 + _this4.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
1550 878 }
1551 - var dropIndex = this.getDropIndex(containerElement, side, targetIndex, selfIndex);
1552 - this.moveDroppedItem(draggedView, dropIndex);
1553 - },
1554 - isPanelElement: function isPanelElement(draggedView, draggedElement) {
1555 - return !draggedView || !draggedElement;
1556 - },
1557 - isParentElement: function isParentElement(draggedId) {
1558 - var current = this.container;
1559 - while (current) {
1560 - if (current.id === draggedId) {
1561 - return true;
1562 - }
1563 - current = current.parent;
879 + };
880 + },
881 + moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) {
882 + var selfIndex = elements.indexOf(draggedElement);
883 + if (targetIndex === selfIndex) {
884 + return;
885 + }
886 + var dropIndex = this.getDropIndex(containerElement, side, targetIndex, selfIndex);
887 + this.moveDroppedItem(draggedView, dropIndex);
888 + },
889 + isPanelElement: function isPanelElement(draggedView, draggedElement) {
890 + return !draggedView || !draggedElement;
891 + },
892 + isParentElement: function isParentElement(draggedId) {
893 + var current = this.container;
894 + while (current) {
895 + if (current.id === draggedId) {
896 + return true;
1564 897 }
1565 - return false;
1566 - },
1567 - getDropIndex: function getDropIndex(container, side, index, selfIndex) {
1568 - var styles = window.getComputedStyle(container);
1569 - var isFlex = ['flex', 'inline-flex'].includes(styles.display);
1570 - var isFlexReverse = isFlex && ['column-reverse', 'row-reverse'].includes(styles.flexDirection);
1571 - var isRow = isFlex && ['row-reverse', 'row'].includes(styles.flexDirection);
1572 - var isRtl = elementorCommon.config.isRTL;
1573 - var isReverse = isRow ? isFlexReverse !== isRtl : isFlexReverse;
898 + current = current.parent;
899 + }
900 + return false;
901 + },
902 + getDropIndex: function getDropIndex(container, side, index, selfIndex) {
903 + var styles = window.getComputedStyle(container);
904 + var isFlex = ['flex', 'inline-flex'].includes(styles.display);
905 + var isFlexReverse = isFlex && ['column-reverse', 'row-reverse'].includes(styles.flexDirection);
906 + var isRow = isFlex && ['row-reverse', 'row'].includes(styles.flexDirection);
907 + var isRtl = elementorCommon.config.isRTL;
908 + var isReverse = isRow ? isFlexReverse !== isRtl : isFlexReverse;
1574 909
1575 - // The element should be placed BEFORE the current target
1576 - // if is reversed + side is bottom/right OR not is reversed + side is top/left
1577 - if (isReverse === this.draggingOnBottomOrRightSide(side)) {
1578 - if (-1 === selfIndex || selfIndex >= index - 1) {
1579 - return index;
1580 - }
1581 - return index > 0 ? index - 1 : 0;
1582 - }
1583 - if (0 <= selfIndex && selfIndex < index) {
910 + // The element should be placed BEFORE the current target
911 + // if is reversed + side is bottom/right OR not is reversed + side is top/left
912 + if (isReverse === this.draggingOnBottomOrRightSide(side)) {
913 + if (-1 === selfIndex || selfIndex >= index - 1) {
1584 914 return index;
1585 915 }
1586 - return index + 1;
1587 - },
1588 - moveDroppedItem: function moveDroppedItem(draggedView, dropIndex) {
1589 - // Reset the dragged element cache.
1590 - elementor.channels.editor.reply('element:dragged', null);
1591 - $e.run('document/elements/move', {
1592 - container: draggedView.getContainer(),
1593 - target: this.getContainer(),
1594 - options: {
1595 - at: dropIndex
1596 - }
1597 - });
1598 - },
1599 - getEditButtons: function getEditButtons() {
1600 - var elementData = elementor.getElementData(this.model),
1601 - editTools = {};
1602 - if ($e.components.get('document/elements').utils.allowAddingWidgets()) {
1603 - editTools.add = {
1604 - /* Translators: %s: Element Name. */
1605 - title: sprintf(__('Add %s', 'elementor'), elementData.title),
1606 - icon: 'plus'
1607 - };
1608 - editTools.edit = {
1609 - /* Translators: %s: Element Name. */
1610 - title: sprintf(__('Edit %s', 'elementor'), elementData.title),
1611 - icon: 'handle'
1612 - };
916 + return index > 0 ? index - 1 : 0;
917 + }
918 + if (0 <= selfIndex && selfIndex < index) {
919 + return index;
920 + }
921 + return index + 1;
922 + },
923 + moveDroppedItem: function moveDroppedItem(draggedView, dropIndex) {
924 + // Reset the dragged element cache.
925 + elementor.channels.editor.reply('element:dragged', null);
926 + $e.run('document/elements/move', {
927 + container: draggedView.getContainer(),
928 + target: this.getContainer(),
929 + options: {
930 + at: dropIndex
1613 931 }
1614 - if (!this.getContainer().isLocked()) {
1615 - if (elementor.getPreferences('edit_buttons') && $e.components.get('document/elements').utils.allowAddingWidgets()) {
1616 - editTools.duplicate = {
1617 - /* Translators: %s: Element Name. */
1618 - title: sprintf(__('Duplicate %s', 'elementor'), elementData.title),
1619 - icon: 'clone'
1620 - };
1621 - }
1622 - editTools.remove = {
932 + });
933 + },
934 + getEditButtons: function getEditButtons() {
935 + var elementData = elementor.getElementData(this.model),
936 + editTools = {};
937 + if ($e.components.get('document/elements').utils.allowAddingWidgets()) {
938 + editTools.add = {
939 + /* Translators: %s: Element Name. */
940 + title: sprintf(__('Add %s', 'elementor'), elementData.title),
941 + icon: 'plus'
942 + };
943 + editTools.edit = {
944 + /* Translators: %s: Element Name. */
945 + title: sprintf(__('Edit %s', 'elementor'), elementData.title),
946 + icon: 'handle'
947 + };
948 + }
949 + if (!this.getContainer().isLocked()) {
950 + if (elementor.getPreferences('edit_buttons') && $e.components.get('document/elements').utils.allowAddingWidgets()) {
951 + editTools.duplicate = {
1623 952 /* Translators: %s: Element Name. */
1624 - title: sprintf(__('Delete %s', 'elementor'), elementData.title),
1625 - icon: 'close'
953 + title: sprintf(__('Duplicate %s', 'elementor'), elementData.title),
954 + icon: 'clone'
1626 955 };
1627 956 }
1628 - return editTools;
1629 - },
1630 - draggingOnBottomOrRightSide: function draggingOnBottomOrRightSide(side) {
1631 - return ['bottom', 'right'].includes(side);
1632 - },
1633 - emptyViewIsCurrentlyBeingDraggedOver: function emptyViewIsCurrentlyBeingDraggedOver() {
1634 - return this.$el.find('> .elementor-empty-view > .elementor-first-add.elementor-html5dnd-current-element').length > 0;
1635 - },
1636 - /**
1637 - * Toggle the `New Section` view when clicking the `add` button in the edit tools.
1638 - *
1639 - * @return {void}
1640 - */
1641 - onAddButtonClick: function onAddButtonClick() {
1642 - if (this.addSectionView && !this.addSectionView.isDestroyed) {
1643 - this.addSectionView.fadeToDeath();
1644 - return;
1645 - }
1646 - var addSectionView = new elementor.modules.elements.components.AddSectionView({
1647 - at: this.model.collection.indexOf(this.model)
957 + editTools.remove = {
958 + /* Translators: %s: Element Name. */
959 + title: sprintf(__('Delete %s', 'elementor'), elementData.title),
960 + icon: 'close'
961 + };
962 + }
963 + return editTools;
964 + },
965 + draggingOnBottomOrRightSide: function draggingOnBottomOrRightSide(side) {
966 + return ['bottom', 'right'].includes(side);
967 + },
968 + emptyViewIsCurrentlyBeingDraggedOver: function emptyViewIsCurrentlyBeingDraggedOver() {
969 + return this.$el.find('> .elementor-empty-view > .elementor-first-add.elementor-html5dnd-current-element').length > 0;
970 + },
971 + /**
972 + * Toggle the `New Section` view when clicking the `add` button in the edit tools.
973 + *
974 + * @return {void}
975 + */
976 + onAddButtonClick: function onAddButtonClick() {
977 + if (this.addSectionView && !this.addSectionView.isDestroyed) {
978 + this.addSectionView.fadeToDeath();
979 + return;
980 + }
981 + var addSectionView = new elementor.modules.elements.components.AddSectionView({
982 + at: this.model.collection.indexOf(this.model)
983 + });
984 + addSectionView.render();
985 + this.$el.before(addSectionView.$el);
986 + addSectionView.$el.hide();
987 +
988 + // Delaying the slide down for slow-render browsers (such as FF)
989 + setTimeout(function () {
990 + addSectionView.$el.slideDown(null, function () {
991 + // Remove inline style, for preview mode.
992 + jQuery(this).css('display', '');
1648 993 });
1649 - addSectionView.render();
1650 - this.$el.before(addSectionView.$el);
1651 - addSectionView.$el.hide();
994 + });
995 + this.addSectionView = addSectionView;
996 + },
997 + getClasses: function getClasses() {
998 + var _window, _window$get, _this$options;
999 + var transformer = (_window = window) === null || _window === void 0 || (_window = _window.elementorV2) === null || _window === void 0 || (_window = _window.editorCanvas) === null || _window === void 0 || (_window = _window.settingsTransformersRegistry) === null || _window === void 0 || (_window$get = _window.get) === null || _window$get === void 0 ? void 0 : _window$get.call(_window, 'classes');
1000 + if (!transformer) {
1001 + return [];
1002 + }
1003 + return transformer(((_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.model) === null || _this$options === void 0 || (_this$options = _this$options.getSetting('classes')) === null || _this$options === void 0 ? void 0 : _this$options.value) || []);
1004 + },
1005 + getClassString: function getClassString() {
1006 + var classes = this.getClasses();
1007 + var base = this.getBaseClass();
1008 + return [base].concat((0, _toConsumableArray2.default)(classes)).join(' ');
1009 + },
1010 + getBaseClass: function getBaseClass() {
1011 + var _this$options2, _Object$keys$;
1012 + var baseStyles = elementor.helpers.getAtomicWidgetBaseStyles((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.model);
1013 + return (_Object$keys$ = Object.keys(baseStyles !== null && baseStyles !== void 0 ? baseStyles : {})[0]) !== null && _Object$keys$ !== void 0 ? _Object$keys$ : '';
1014 + },
1015 + isOverflowHidden: function isOverflowHidden() {
1016 + var elementStyles = window.getComputedStyle(this.el);
1017 + var overflowStyles = [elementStyles.overflowX, elementStyles.overflowY, elementStyles.overflow];
1018 + return overflowStyles.includes('hidden') || overflowStyles.includes('auto');
1019 + },
1020 + updateHandlesPosition: function updateHandlesPosition() {
1021 + var elementType = this.$el.data('element_type');
1022 + var isElement = (0, _elementTypes.getAllElementTypes)().includes(elementType);
1023 + if (!isElement) {
1024 + return;
1025 + }
1026 + if (this.isOverflowHidden()) {
1027 + this.$el.addClass('e-handles-inside');
1028 + } else {
1029 + this.$el.removeClass('e-handles-inside');
1030 + }
1031 + }
1032 +});
1033 +module.exports = DivBlockView;
1652 1034
1653 - // Delaying the slide down for slow-render browsers (such as FF)
1654 - setTimeout(function () {
1655 - addSectionView.$el.slideDown(null, function () {
1656 - // Remove inline style, for preview mode.
1657 - jQuery(this).css('display', '');
1658 - });
1659 - });
1660 - this.addSectionView = addSectionView;
1661 - },
1662 - isOverflowHidden: function isOverflowHidden() {
1663 - var elementStyles = window.getComputedStyle(this.el);
1664 - var overflowStyles = [elementStyles.overflowX, elementStyles.overflowY, elementStyles.overflow];
1665 - return overflowStyles.includes('hidden') || overflowStyles.includes('auto');
1666 - },
1667 - updateHandlesPosition: function updateHandlesPosition() {
1668 - var elementType = this.$el.data('element_type');
1669 - var isElement = (0, _elementTypes.getAllElementTypes)().includes(elementType);
1670 - if (!isElement) {
1671 - return;
1672 - }
1673 - var shouldPlaceInside = this.isOverflowHidden();
1674 - if (!shouldPlaceInside && this.isTopLevelElement() && this.isFirstElementInStructure()) {
1675 - shouldPlaceInside = true;
1676 - }
1677 - this.$el.toggleClass('e-handles-inside', shouldPlaceInside);
1678 - },
1679 - isTopLevelElement: function isTopLevelElement() {
1680 - return this.container.parent && 'document' === this.container.parent.id;
1681 - },
1682 - isFirstElementInStructure: function isFirstElementInStructure() {
1683 - if (!this.model.collection) {
1684 - return true;
1685 - }
1686 - return 0 === this.model.collection.indexOf(this.model);
1687 - },
1688 - getInteractionId: function getInteractionId() {
1689 - var originId = this.model.get('originId');
1690 - var id = this.model.get('id');
1691 - return originId !== null && originId !== void 0 ? originId : id;
1035 +/***/ }),
1036 +
1037 +/***/ "../modules/atomic-widgets/assets/js/editor/flexbox-type.js":
1038 +/*!******************************************************************!*\
1039 + !*** ../modules/atomic-widgets/assets/js/editor/flexbox-type.js ***!
1040 + \******************************************************************/
1041 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1042 +
1043 +"use strict";
1044 +
1045 +
1046 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1047 +Object.defineProperty(exports, "__esModule", ({
1048 + value: true
1049 +}));
1050 +exports["default"] = void 0;
1051 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1052 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1053 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1054 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1055 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1056 +var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
1057 +var _divBlockModel = _interopRequireDefault(__webpack_require__(/*! ./div-block-model */ "../modules/atomic-widgets/assets/js/editor/div-block-model.js"));
1058 +var _divBlockView = _interopRequireDefault(__webpack_require__(/*! ./div-block-view */ "../modules/atomic-widgets/assets/js/editor/div-block-view.js"));
1059 +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)); }
1060 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1061 +var AtomicContainer = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
1062 + function AtomicContainer() {
1063 + (0, _classCallCheck2.default)(this, AtomicContainer);
1064 + return _callSuper(this, AtomicContainer, arguments);
1065 + }
1066 + (0, _inherits2.default)(AtomicContainer, _elementor$modules$el);
1067 + return (0, _createClass2.default)(AtomicContainer, [{
1068 + key: "getType",
1069 + value: function getType() {
1070 + return 'e-flexbox';
1692 1071 }
1693 - });
1694 - return AtomicElementView;
1695 -}
1072 + }, {
1073 + key: "getView",
1074 + value: function getView() {
1075 + return _divBlockView.default;
1076 + }
1077 + }, {
1078 + key: "getEmptyView",
1079 + value: function getEmptyView() {
1080 + return _emptyComponent.default;
1081 + }
1082 + }, {
1083 + key: "getModel",
1084 + value: function getModel() {
1085 + return _divBlockModel.default;
1086 + }
1087 + }]);
1088 +}(elementor.modules.elements.types.Base);
1696 1089
1697 1090 /***/ }),
1698 1091
1699 1092 /***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js":
@@ -1893,16 +1286,25 @@
1893 1286 value: true
1894 1287 }));
1895 1288 exports.getElementChildren = getElementChildren;
1896 1289 var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1290 +/**
1291 + * @typedef {import('assets/dev/js/editor/container/container')} Container
1292 + */
1293 +
1294 +/**
1295 + * return all recursively nested elements in a flat array
1296 + *
1297 + * @param {Container} model
1298 + * @return {Container[]}
1299 + */
1897 1300 function getElementChildren(model) {
1898 - var _model$get$models, _model$get;
1899 - if (!model) {
1900 - return [];
1901 - }
1902 - var childModels = (_model$get$models = (_model$get = model.get('elements')) === null || _model$get === void 0 ? void 0 : _model$get.models) !== null && _model$get$models !== void 0 ? _model$get$models : [];
1903 - var children = childModels.flatMap(getElementChildren);
1904 - return [model].concat((0, _toConsumableArray2.default)(children));
1301 + var _flatMap, _container$model$get$, _container$model;
1302 + var container = window.elementor.getContainer(model.id);
1303 + var children = (_flatMap = ((_container$model$get$ = (_container$model = container.model) === null || _container$model === void 0 || (_container$model = _container$model.get('elements')) === null || _container$model === void 0 ? void 0 : _container$model.models) !== null && _container$model$get$ !== void 0 ? _container$model$get$ : []).flatMap(function (child) {
1304 + return getElementChildren(child);
1305 + })) !== null && _flatMap !== void 0 ? _flatMap : [];
1306 + return [container].concat((0, _toConsumableArray2.default)(children));
1905 1307 }
1906 1308
1907 1309 /***/ }),
1908 1310
@@ -1958,38 +1360,38 @@
1958 1360 var _getElementChildren = __webpack_require__(/*! ./get-element-children */ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js");
1959 1361 var _getRandomStyleId = __webpack_require__(/*! ./get-random-style-id */ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js");
1960 1362 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1961 1363 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1962 -function regenerateLocalStyleIds(container) {
1963 - if (!(container !== null && container !== void 0 && container.model)) {
1964 - return;
1965 - }
1966 - var allElements = (0, _getElementChildren.getElementChildren)(container.model);
1967 - var styledElements = allElements.filter(function (model) {
1968 - var _model$get;
1969 - return model && Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0;
1970 - });
1971 - updateElementsStyleIdsInsideOut(styledElements);
1972 -}
1364 +/**
1365 + * @typedef {import('assets/dev/js/editor/container/container')} Container
1366 + */
1367 +
1973 1368 function isClassesProp(prop) {
1974 1369 return prop.$$type && 'classes' === prop.$$type && Array.isArray(prop.value) && prop.value.length > 0;
1975 1370 }
1976 -function calculateNewStylesAndSettings(element, model, settings) {
1977 - var _settings$toJSON;
1978 - var originalStyles = model.get('styles');
1979 - var settingsJson = (_settings$toJSON = settings === null || settings === void 0 ? void 0 : settings.toJSON()) !== null && _settings$toJSON !== void 0 ? _settings$toJSON : {};
1980 - var classesProps = Object.entries(settingsJson).filter(function (_ref) {
1371 +
1372 +/**
1373 + * Update the style id of the container.
1374 + *
1375 + * @param {Container} container
1376 + */
1377 +function updateStyleId(container) {
1378 + var _container$settings$t, _container$settings;
1379 + var originalStyles = container.model.get('styles');
1380 + var settings = (_container$settings$t = (_container$settings = container.settings) === null || _container$settings === void 0 ? void 0 : _container$settings.toJSON()) !== null && _container$settings$t !== void 0 ? _container$settings$t : {};
1381 + var classesProps = Object.entries(settings).filter(function (_ref) {
1981 1382 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1982 1383 propValue = _ref2[1];
1983 1384 return isClassesProp(propValue);
1984 1385 });
1985 1386 var newStyles = {};
1986 - var changedIds = {};
1387 + var changedIds = {}; // Conversion map - {[originalId: string]: newId: string}
1388 +
1987 1389 Object.entries(originalStyles).forEach(function (_ref3) {
1988 1390 var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
1989 1391 originalStyleId = _ref4[0],
1990 1392 style = _ref4[1];
1991 - var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(element, newStyles);
1393 + var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(container, newStyles);
1992 1394 newStyles[newStyleId] = structuredClone(_objectSpread(_objectSpread({}, style), {}, {
1993 1395 id: newStyleId
1994 1396 }));
1995 1397 changedIds[originalStyleId] = newStyleId;
@@ -2004,59 +1406,35 @@
2004 1406 return (_changedIds$className = changedIds[className]) !== null && _changedIds$className !== void 0 ? _changedIds$className : className;
2005 1407 })
2006 1408 })];
2007 1409 }, {});
2008 - return {
2009 - newStyles: newStyles,
2010 - newSettings: Object.fromEntries(newClassesProps)
2011 - };
2012 -}
2013 -function updateStyleIdForContainer(container) {
2014 - var model = container.model,
2015 - settings = container.settings;
2016 - var _calculateNewStylesAn = calculateNewStylesAndSettings(container, model, settings),
2017 - newStyles = _calculateNewStylesAn.newStyles,
2018 - newSettings = _calculateNewStylesAn.newSettings;
1410 +
1411 + // Update classes array
2019 1412 $e.internal('document/elements/set-settings', {
2020 1413 container: container,
2021 - settings: newSettings
1414 + settings: Object.fromEntries(newClassesProps)
2022 1415 });
2023 - model.set('styles', newStyles);
2024 -}
2025 -function updateStyleIdForModel(model) {
2026 - var settings = model.get('settings');
2027 - var _calculateNewStylesAn2 = calculateNewStylesAndSettings(model, model, settings),
2028 - newStyles = _calculateNewStylesAn2.newStyles,
2029 - newSettings = _calculateNewStylesAn2.newSettings;
2030 - settings.set(newSettings);
2031 - model.set('styles', newStyles);
2032 -}
2033 -function updateStyleId(model) {
2034 - var container = window.elementor.getContainer(model.get('id'));
2035 1416
2036 - // If view exists, update the styles via the container
2037 - if (container) {
2038 - updateStyleIdForContainer(container);
2039 - return;
2040 - }
2041 - updateStyleIdForModel(model);
1417 + // Update local styles
1418 + container.model.set('styles', newStyles);
2042 1419 }
2043 1420 function updateElementsStyleIdsInsideOut(styledElements) {
2044 1421 styledElements === null || styledElements === void 0 || styledElements.reverse().forEach(updateStyleId);
2045 1422 }
2046 1423
2047 -/***/ }),
2048 -
2049 -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
2050 -/*!***************************************************************!*\
2051 - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
2052 - \***************************************************************/
2053 -/***/ ((module) => {
2054 -
2055 -function _OverloadYield(e, d) {
2056 - this.v = e, this.k = d;
1424 +/**
1425 + * Get a container - iterate over its children, find all styled atomic widgets and update their style ids
1426 + *
1427 + * @param {Container} container
1428 + */
1429 +function regenerateLocalStyleIds(container) {
1430 + var allElements = (0, _getElementChildren.getElementChildren)(container);
1431 + var styledElements = allElements.filter(function (element) {
1432 + var _element$model$get;
1433 + return Object.keys((_element$model$get = element.model.get('styles')) !== null && _element$model$get !== void 0 ? _element$model$get : {}).length > 0;
1434 + });
1435 + updateElementsStyleIdsInsideOut(styledElements);
2057 1436 }
2058 -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
2059 1437
2060 1438 /***/ }),
2061 1439
2062 1440 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
@@ -2114,43 +1492,8 @@
2114 1492 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
2115 1493
2116 1494 /***/ }),
2117 1495
2118 -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
2119 -/*!******************************************************************!*\
2120 - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
2121 - \******************************************************************/
2122 -/***/ ((module) => {
2123 -
2124 -function asyncGeneratorStep(n, t, e, r, o, a, c) {
2125 - try {
2126 - var i = n[a](c),
2127 - u = i.value;
2128 - } catch (n) {
2129 - return void e(n);
2130 - }
2131 - i.done ? t(u) : Promise.resolve(u).then(r, o);
2132 -}
2133 -function _asyncToGenerator(n) {
2134 - return function () {
2135 - var t = this,
2136 - e = arguments;
2137 - return new Promise(function (r, o) {
2138 - var a = n.apply(t, e);
2139 - function _next(n) {
2140 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
2141 - }
2142 - function _throw(n) {
2143 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
2144 - }
2145 - _next(void 0);
2146 - });
2147 - };
2148 -}
2149 -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2150 -
2151 -/***/ }),
2152 -
2153 1496 /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
2154 1497 /*!****************************************************************!*\
2155 1498 !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
2156 1499 \****************************************************************/
@@ -2203,28 +1546,8 @@
2203 1546 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
2204 1547
2205 1548 /***/ }),
2206 1549
2207 -/***/ "../node_modules/@babel/runtime/helpers/get.js":
2208 -/*!*****************************************************!*\
2209 - !*** ../node_modules/@babel/runtime/helpers/get.js ***!
2210 - \*****************************************************/
2211 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2212 -
2213 -var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
2214 -function _get() {
2215 - return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
2216 - var p = superPropBase(e, t);
2217 - if (p) {
2218 - var n = Object.getOwnPropertyDescriptor(p, t);
2219 - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
2220 - }
2221 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments);
2222 -}
2223 -module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
2224 -
2225 -/***/ }),
2226 -
2227 1550 /***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
2228 1551 /*!****************************************************************!*\
2229 1552 !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
2230 1553 \****************************************************************/
@@ -2369,344 +1692,8 @@
2369 1692 module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
2370 1693
2371 1694 /***/ }),
2372 1695
2373 -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
2374 -/*!*************************************************************!*\
2375 - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
2376 - \*************************************************************/
2377 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2378 -
2379 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2380 -function _regenerator() {
2381 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2382 - var e,
2383 - t,
2384 - r = "function" == typeof Symbol ? Symbol : {},
2385 - n = r.iterator || "@@iterator",
2386 - o = r.toStringTag || "@@toStringTag";
2387 - function i(r, n, o, i) {
2388 - var c = n && n.prototype instanceof Generator ? n : Generator,
2389 - u = Object.create(c.prototype);
2390 - return regeneratorDefine(u, "_invoke", function (r, n, o) {
2391 - var i,
2392 - c,
2393 - u,
2394 - f = 0,
2395 - p = o || [],
2396 - y = !1,
2397 - G = {
2398 - p: 0,
2399 - n: 0,
2400 - v: e,
2401 - a: d,
2402 - f: d.bind(e, 4),
2403 - d: function d(t, r) {
2404 - return i = t, c = 0, u = e, G.n = r, a;
2405 - }
2406 - };
2407 - function d(r, n) {
2408 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2409 - var o,
2410 - i = p[t],
2411 - d = G.p,
2412 - l = i[2];
2413 - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
2414 - }
2415 - if (o || r > 1) return a;
2416 - throw y = !0, n;
2417 - }
2418 - return function (o, p, l) {
2419 - if (f > 1) throw TypeError("Generator is already running");
2420 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2421 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2422 - try {
2423 - if (f = 2, i) {
2424 - if (c || (o = "next"), t = i[o]) {
2425 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2426 - if (!t.done) return t;
2427 - u = t.value, c < 2 && (c = 0);
2428 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2429 - i = e;
2430 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2431 - } catch (t) {
2432 - i = e, c = 1, u = t;
2433 - } finally {
2434 - f = 1;
2435 - }
2436 - }
2437 - return {
2438 - value: t,
2439 - done: y
2440 - };
2441 - };
2442 - }(r, o, i), !0), u;
2443 - }
2444 - var a = {};
2445 - function Generator() {}
2446 - function GeneratorFunction() {}
2447 - function GeneratorFunctionPrototype() {}
2448 - t = Object.getPrototypeOf;
2449 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
2450 - return this;
2451 - }), t),
2452 - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2453 - function f(e) {
2454 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2455 - }
2456 - return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () {
2457 - return this;
2458 - }), regeneratorDefine(u, "toString", function () {
2459 - return "[object Generator]";
2460 - }), (module.exports = _regenerator = function _regenerator() {
2461 - return {
2462 - w: i,
2463 - m: f
2464 - };
2465 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2466 -}
2467 -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2468 -
2469 -/***/ }),
2470 -
2471 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
2472 -/*!******************************************************************!*\
2473 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
2474 - \******************************************************************/
2475 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2476 -
2477 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2478 -function _regeneratorAsync(n, e, r, t, o) {
2479 - var a = regeneratorAsyncGen(n, e, r, t, o);
2480 - return a.next().then(function (n) {
2481 - return n.done ? n.value : a.next();
2482 - });
2483 -}
2484 -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
2485 -
2486 -/***/ }),
2487 -
2488 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
2489 -/*!*********************************************************************!*\
2490 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
2491 - \*********************************************************************/
2492 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2493 -
2494 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2495 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2496 -function _regeneratorAsyncGen(r, e, t, o, n) {
2497 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
2498 -}
2499 -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
2500 -
2501 -/***/ }),
2502 -
2503 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
2504 -/*!**************************************************************************!*\
2505 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
2506 - \**************************************************************************/
2507 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2508 -
2509 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2510 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2511 -function AsyncIterator(t, e) {
2512 - function n(r, o, i, f) {
2513 - try {
2514 - var c = t[r](o),
2515 - u = c.value;
2516 - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
2517 - n("next", t, i, f);
2518 - }, function (t) {
2519 - n("throw", t, i, f);
2520 - }) : e.resolve(u).then(function (t) {
2521 - c.value = t, i(c);
2522 - }, function (t) {
2523 - return n("throw", t, i, f);
2524 - });
2525 - } catch (t) {
2526 - f(t);
2527 - }
2528 - }
2529 - var r;
2530 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
2531 - return this;
2532 - })), regeneratorDefine(this, "_invoke", function (t, o, i) {
2533 - function f() {
2534 - return new e(function (e, r) {
2535 - n(t, i, e, r);
2536 - });
2537 - }
2538 - return r = r ? r.then(f, f) : f();
2539 - }, !0);
2540 -}
2541 -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2542 -
2543 -/***/ }),
2544 -
2545 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
2546 -/*!*******************************************************************!*\
2547 - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
2548 - \*******************************************************************/
2549 -/***/ ((module) => {
2550 -
2551 -function _regeneratorDefine(e, r, n, t) {
2552 - var i = Object.defineProperty;
2553 - try {
2554 - i({}, "", {});
2555 - } catch (e) {
2556 - i = 0;
2557 - }
2558 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
2559 - function o(r, n) {
2560 - _regeneratorDefine(e, r, function (e) {
2561 - return this._invoke(r, n, e);
2562 - });
2563 - }
2564 - r ? i ? i(e, r, {
2565 - value: n,
2566 - enumerable: !t,
2567 - configurable: !t,
2568 - writable: !t
2569 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2570 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
2571 -}
2572 -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
2573 -
2574 -/***/ }),
2575 -
2576 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
2577 -/*!*****************************************************************!*\
2578 - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
2579 - \*****************************************************************/
2580 -/***/ ((module) => {
2581 -
2582 -function _regeneratorKeys(e) {
2583 - var n = Object(e),
2584 - r = [];
2585 - for (var t in n) r.unshift(t);
2586 - return function e() {
2587 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
2588 - return e.done = !0, e;
2589 - };
2590 -}
2591 -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
2592 -
2593 -/***/ }),
2594 -
2595 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
2596 -/*!********************************************************************!*\
2597 - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
2598 - \********************************************************************/
2599 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2600 -
2601 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2602 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2603 -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
2604 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2605 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2606 -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
2607 -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
2608 -function _regeneratorRuntime() {
2609 - "use strict";
2610 -
2611 - var r = regenerator(),
2612 - e = r.m(_regeneratorRuntime),
2613 - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
2614 - function n(r) {
2615 - var e = "function" == typeof r && r.constructor;
2616 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
2617 - }
2618 - var o = {
2619 - "throw": 1,
2620 - "return": 2,
2621 - "break": 3,
2622 - "continue": 3
2623 - };
2624 - function a(r) {
2625 - var e, t;
2626 - return function (n) {
2627 - e || (e = {
2628 - stop: function stop() {
2629 - return t(n.a, 2);
2630 - },
2631 - "catch": function _catch() {
2632 - return n.v;
2633 - },
2634 - abrupt: function abrupt(r, e) {
2635 - return t(n.a, o[r], e);
2636 - },
2637 - delegateYield: function delegateYield(r, o, a) {
2638 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
2639 - },
2640 - finish: function finish(r) {
2641 - return t(n.f, r);
2642 - }
2643 - }, t = function t(r, _t, o) {
2644 - n.p = e.prev, n.n = e.next;
2645 - try {
2646 - return r(_t, o);
2647 - } finally {
2648 - e.next = n.n;
2649 - }
2650 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
2651 - try {
2652 - return r.call(this, e);
2653 - } finally {
2654 - n.p = e.prev, n.n = e.next;
2655 - }
2656 - };
2657 - }
2658 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2659 - return {
2660 - wrap: function wrap(e, t, n, o) {
2661 - return r.w(a(e), t, n, o && o.reverse());
2662 - },
2663 - isGeneratorFunction: n,
2664 - mark: r.m,
2665 - awrap: function awrap(r, e) {
2666 - return new OverloadYield(r, e);
2667 - },
2668 - AsyncIterator: regeneratorAsyncIterator,
2669 - async: function async(r, e, t, o, u) {
2670 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
2671 - },
2672 - keys: regeneratorKeys,
2673 - values: regeneratorValues
2674 - };
2675 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2676 -}
2677 -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2678 -
2679 -/***/ }),
2680 -
2681 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
2682 -/*!*******************************************************************!*\
2683 - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
2684 - \*******************************************************************/
2685 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2686 -
2687 -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2688 -function _regeneratorValues(e) {
2689 - if (null != e) {
2690 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
2691 - r = 0;
2692 - if (t) return t.call(e);
2693 - if ("function" == typeof e.next) return e;
2694 - if (!isNaN(e.length)) return {
2695 - next: function next() {
2696 - return e && r >= e.length && (e = void 0), {
2697 - value: e && e[r++],
2698 - done: !e
2699 - };
2700 - }
2701 - };
2702 - }
2703 - throw new TypeError(_typeof(e) + " is not iterable");
2704 -}
2705 -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
2706 -
2707 -/***/ }),
2708 -
2709 1696 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
2710 1697 /*!****************************************************************!*\
2711 1698 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
2712 1699 \****************************************************************/
@@ -2737,23 +1724,8 @@
2737 1724 module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2738 1725
2739 1726 /***/ }),
2740 1727
2741 -/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
2742 -/*!***************************************************************!*\
2743 - !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
2744 - \***************************************************************/
2745 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2746 -
2747 -var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
2748 -function _superPropBase(t, o) {
2749 - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t)););
2750 - return t;
2751 -}
2752 -module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
2753 -
2754 -/***/ }),
2755 -
2756 1728 /***/ "../node_modules/@babel/runtime/helpers/toConsumableArray.js":
2757 1729 /*!*******************************************************************!*\
2758 1730 !*** ../node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
2759 1731 \*******************************************************************/
@@ -2843,33 +1815,8 @@
2843 1815 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2844 1816
2845 1817 /***/ }),
2846 1818
2847 -/***/ "../node_modules/@babel/runtime/regenerator/index.js":
2848 -/*!***********************************************************!*\
2849 - !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
2850 - \***********************************************************/
2851 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2852 -
2853 -// TODO(Babel 8): Remove this file.
2854 -
2855 -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
2856 -module.exports = runtime;
2857 -
2858 -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
2859 -try {
2860 - regeneratorRuntime = runtime;
2861 -} catch (accidentalStrictMode) {
2862 - if (typeof globalThis === "object") {
2863 - globalThis.regeneratorRuntime = runtime;
2864 - } else {
2865 - Function("r", "regeneratorRuntime = r")(runtime);
2866 - }
2867 -}
2868 -
2869 -
2870 -/***/ }),
2871 -
2872 1819 /***/ "../node_modules/react-dom/client.js":
2873 1820 /*!*******************************************!*\
2874 1821 !*** ../node_modules/react-dom/client.js ***!
2875 1822 \*******************************************/
@@ -2978,14 +1925,8 @@
2978 1925 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2979 1926 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2980 1927 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2981 1928 var _component = _interopRequireDefault(__webpack_require__(/*! ./component */ "../modules/atomic-widgets/assets/js/editor/component.js"));
2982 -var _atomicElementBaseType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js"));
2983 -var _createAtomicElementBaseView = _interopRequireDefault(__webpack_require__(/*! ./create-atomic-element-base-view */ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js"));
2984 -var _atomicElementBaseModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js"));
2985 -var _createDivBlockType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-div-block-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js"));
2986 -var _createFlexboxType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-flexbox-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js"));
2987 -var _createGridType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-grid-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js"));
2988 1929 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)); }
2989 1930 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2990 1931 var Module = /*#__PURE__*/function (_elementorModules$edi) {
2991 1932 function Module() {
@@ -2996,32 +1937,22 @@
2996 1937 return (0, _createClass2.default)(Module, [{
2997 1938 key: "onInit",
2998 1939 value: function onInit() {
2999 1940 $e.components.register(new _component.default());
3000 - this.exposeAtomicElementClasses();
3001 - this.registerAtomicElements();
1941 + this.registerAtomicWidgetTypes();
3002 1942 }
3003 1943 }, {
3004 - key: "exposeAtomicElementClasses",
3005 - value: function exposeAtomicElementClasses() {
3006 - elementor.modules.elements.types.AtomicElementBase = _atomicElementBaseType.default;
3007 - elementor.modules.elements.views.createAtomicElementBase = _createAtomicElementBaseView.default;
3008 - elementor.modules.elements.models.AtomicElementBase = _atomicElementBaseModel.default;
1944 + key: "registerAtomicWidgetTypes",
1945 + value: function registerAtomicWidgetTypes() {
1946 + this.registerAtomicDivBlockType();
3009 1947 }
3010 1948 }, {
3011 - key: "registerAtomicElements",
3012 - value: function registerAtomicElements() {
3013 - this.registerAtomicElementTypeIfAbsent((0, _createDivBlockType.default)());
3014 - this.registerAtomicElementTypeIfAbsent((0, _createFlexboxType.default)());
3015 - this.registerAtomicElementTypeIfAbsent((0, _createGridType.default)());
3016 - }
3017 - }, {
3018 - key: "registerAtomicElementTypeIfAbsent",
3019 - value: function registerAtomicElementTypeIfAbsent(elementType) {
3020 - if (elementor.elementsManager.getElementTypeClass(elementType.getType())) {
3021 - return;
3022 - }
3023 - elementor.elementsManager.registerElementType(elementType);
1949 + key: "registerAtomicDivBlockType",
1950 + value: function registerAtomicDivBlockType() {
1951 + var DivBlock = (__webpack_require__(/*! ./div-block-type */ "../modules/atomic-widgets/assets/js/editor/div-block-type.js")["default"]);
1952 + var FlexBox = (__webpack_require__(/*! ./flexbox-type */ "../modules/atomic-widgets/assets/js/editor/flexbox-type.js")["default"]);
1953 + elementor.elementsManager.registerElementType(new DivBlock());
1954 + elementor.elementsManager.registerElementType(new FlexBox());
3024 1955 }
3025 1956 }]);
3026 1957 }(elementorModules.editor.utils.Module);
3027 1958 new Module();