| @@ -376,9 +376,13 @@ | ||
| 376 | 376 | value: function dispatchEvent(eventName, payload) { |
| 377 | 377 | if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { |
| 378 | 378 | return false; |
| 379 | 379 | } |
| 380 | - this.getEventsManager().dispatchEvent(eventName, payload); | |
| 380 | + try { | |
| 381 | + return this.getEventsManager().dispatchEvent(eventName, payload); | |
| 382 | + } catch (error) { | |
| 383 | + return false; | |
| 384 | + } | |
| 381 | 385 | } |
| 382 | 386 | }, { |
| 383 | 387 | key: "toLowerSnake", |
| 384 | 388 | value: function toLowerSnake(value) { |
| @@ -679,62 +683,8 @@ | ||
| 679 | 683 | }; |
| 680 | 684 | } |
| 681 | 685 | 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 | 686 | } |
| 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 | 687 | }]); |
| 738 | 688 | }(); |
| 739 | 689 | var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() { |
| 740 | 690 | var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300; |
| @@ -1041,29 +991,8 @@ | ||
| 1041 | 991 | var _default = exports["default"] = createFlexboxType; |
| 1042 | 992 | |
| 1043 | 993 | /***/ }), |
| 1044 | 994 | |
| 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 | 995 | /***/ "../modules/atomic-widgets/assets/js/editor/component.js": |
| 1067 | 996 | /*!***************************************************************!*\ |
| 1068 | 997 | !*** ../modules/atomic-widgets/assets/js/editor/component.js ***! |
| 1069 | 998 | \***************************************************************/ |
| @@ -1337,32 +1266,12 @@ | ||
| 1337 | 1266 | BaseElementView.prototype.onRender.apply(this, arguments); |
| 1338 | 1267 | |
| 1339 | 1268 | // Defer to wait for everything to render. |
| 1340 | 1269 | setTimeout(function () { |
| 1341 | - if (_this5.isAtomicGridContainer()) { | |
| 1342 | - _this5.reInitEmptyView(); | |
| 1343 | - } | |
| 1344 | 1270 | _this5.droppableInitialize(); |
| 1345 | 1271 | _this5.updateHandlesPosition(); |
| 1346 | 1272 | }); |
| 1347 | 1273 | }, |
| 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 | 1274 | onDestroy: function onDestroy() { |
| 1366 | 1275 | BaseElementView.prototype.onDestroy.apply(this, arguments); |
| 1367 | 1276 | this.dispatchPreviewEvent('elementor/element/destroy'); |
| 1368 | 1277 | }, |
| @@ -1500,9 +1409,9 @@ | ||
| 1500 | 1409 | getDroppableOptions: function getDroppableOptions() { |
| 1501 | 1410 | var _this7 = this; |
| 1502 | 1411 | var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add'; |
| 1503 | 1412 | return { |
| 1504 | - axis: this.isAtomicGridContainer() ? 'vertical' : null, | |
| 1413 | + axis: null, | |
| 1505 | 1414 | items: items, |
| 1506 | 1415 | groups: ['elementor-element'], |
| 1507 | 1416 | horizontalThreshold: 0, |
| 1508 | 1417 | isDroppingAllowed: this.isDroppingAllowed.bind(this), |
| @@ -1518,26 +1427,41 @@ | ||
| 1518 | 1427 | // Triggering the drag end manually, since it won't fire above the iframe |
| 1519 | 1428 | elementor.getPreviewView().onPanelElementDragEnd(); |
| 1520 | 1429 | var draggedView = elementor.channels.editor.request('element:dragged'), |
| 1521 | 1430 | draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el, |
| 1522 | - isEmptyViewTarget = _this7.emptyViewIsCurrentlyBeingDraggedOver(), | |
| 1523 | - containerElement = isEmptyViewTarget ? _this7.el : event.currentTarget.parentElement, | |
| 1431 | + containerElement = event.currentTarget.parentElement, | |
| 1524 | 1432 | 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); | |
| 1433 | + var targetIndex = elements.indexOf(event.currentTarget); | |
| 1526 | 1434 | if (_this7.isPanelElement(draggedView, draggedElement)) { |
| 1527 | - if (_this7.draggingOnBottomOrRightSide(side) && !isEmptyViewTarget) { | |
| 1435 | + var _elementorCommon; | |
| 1436 | + if (_this7.draggingOnBottomOrRightSide(side) && !_this7.emptyViewIsCurrentlyBeingDraggedOver()) { | |
| 1528 | 1437 | targetIndex++; |
| 1529 | 1438 | } |
| 1530 | 1439 | _this7.onDrop(event, { |
| 1531 | 1440 | at: targetIndex |
| 1532 | 1441 | }); |
| 1442 | + if ((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.eventsManager) !== null && _elementorCommon !== void 0 && _elementorCommon.dispatchEvent) { | |
| 1443 | + var selectedElement = elementor.channels.panelElements.request('element:selected'); | |
| 1444 | + if (selectedElement) { | |
| 1445 | + var _selectedElement$mode, _selectedElement$mode2, _selectedElement$mode3, _selectedElement$mode4; | |
| 1446 | + var elType = (_selectedElement$mode = (_selectedElement$mode2 = selectedElement.model) === null || _selectedElement$mode2 === void 0 ? void 0 : _selectedElement$mode2.get('elType')) !== null && _selectedElement$mode !== void 0 ? _selectedElement$mode : ''; | |
| 1447 | + var widgetType = (_selectedElement$mode3 = (_selectedElement$mode4 = selectedElement.model) === null || _selectedElement$mode4 === void 0 ? void 0 : _selectedElement$mode4.get('widgetType')) !== null && _selectedElement$mode3 !== void 0 ? _selectedElement$mode3 : ''; | |
| 1448 | + var elementName = 'widget' === elType ? widgetType : elType; | |
| 1449 | + elementorCommon.eventsManager.dispatchEvent('add_element', { | |
| 1450 | + location: 'editor_panel', | |
| 1451 | + element_name: elementName, | |
| 1452 | + element_type: elType, | |
| 1453 | + widget_type: widgetType | |
| 1454 | + }); | |
| 1455 | + } | |
| 1456 | + } | |
| 1533 | 1457 | return; |
| 1534 | 1458 | } |
| 1535 | 1459 | if (_this7.isParentElement(draggedView.getContainer().id)) { |
| 1536 | 1460 | return; |
| 1537 | 1461 | } |
| 1538 | - if (isEmptyViewTarget) { | |
| 1539 | - _this7.moveDroppedItem(draggedView, targetIndex); | |
| 1462 | + if (_this7.emptyViewIsCurrentlyBeingDraggedOver()) { | |
| 1463 | + _this7.moveDroppedItem(draggedView, 0); | |
| 1540 | 1464 | return; |
| 1541 | 1465 | } |
| 1542 | 1466 | _this7.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement); |
| 1543 | 1467 | } |
| @@ -1895,12 +1819,9 @@ | ||
| 1895 | 1819 | exports.getElementChildren = getElementChildren; |
| 1896 | 1820 | var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); |
| 1897 | 1821 | function getElementChildren(model) { |
| 1898 | 1822 | 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 : []; | |
| 1823 | + var childModels = (_model$get$models = model === null || model === void 0 || (_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 | 1824 | var children = childModels.flatMap(getElementChildren); |
| 1904 | 1825 | return [model].concat((0, _toConsumableArray2.default)(children)); |
| 1905 | 1826 | } |
| 1906 | 1827 | |
| @@ -1959,15 +1880,12 @@ | ||
| 1959 | 1880 | var _getRandomStyleId = __webpack_require__(/*! ./get-random-style-id */ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js"); |
| 1960 | 1881 | 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 | 1882 | 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 | 1883 | function regenerateLocalStyleIds(container) { |
| 1963 | - if (!(container !== null && container !== void 0 && container.model)) { | |
| 1964 | - return; | |
| 1965 | - } | |
| 1966 | 1884 | var allElements = (0, _getElementChildren.getElementChildren)(container.model); |
| 1967 | 1885 | var styledElements = allElements.filter(function (model) { |
| 1968 | 1886 | var _model$get; |
| 1969 | - return model && Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0; | |
| 1887 | + return Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0; | |
| 1970 | 1888 | }); |
| 1971 | 1889 | updateElementsStyleIdsInsideOut(styledElements); |
| 1972 | 1890 | } |
| 1973 | 1891 | function isClassesProp(prop) { |
| @@ -2983,9 +2901,8 @@ | ||
| 2983 | 2901 | var _createAtomicElementBaseView = _interopRequireDefault(__webpack_require__(/*! ./create-atomic-element-base-view */ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js")); |
| 2984 | 2902 | var _atomicElementBaseModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js")); |
| 2985 | 2903 | 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 | 2904 | 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 | 2905 | 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 | 2906 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 2990 | 2907 | var Module = /*#__PURE__*/function (_elementorModules$edi) { |
| 2991 | 2908 | function Module() { |
| @@ -3009,19 +2926,10 @@ | ||
| 3009 | 2926 | } |
| 3010 | 2927 | }, { |
| 3011 | 2928 | key: "registerAtomicElements", |
| 3012 | 2929 | 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); | |
| 2930 | + elementor.elementsManager.registerElementType((0, _createDivBlockType.default)()); | |
| 2931 | + elementor.elementsManager.registerElementType((0, _createFlexboxType.default)()); | |
| 3024 | 2932 | } |
| 3025 | 2933 | }]); |
| 3026 | 2934 | }(elementorModules.editor.utils.Module); |
| 3027 | 2935 | new Module(); |