| @@ -42735,12 +42735,17 @@ | ||
| 42735 | 42735 | } |
| 42736 | 42736 | }, { |
| 42737 | 42737 | key: "dispatchEvent", |
| 42738 | 42738 | value: function dispatchEvent(eventName, payload) { |
| 42739 | - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { | |
| 42739 | + try { | |
| 42740 | + if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { | |
| 42741 | + return false; | |
| 42742 | + } | |
| 42743 | + this.getEventsManager().dispatchEvent(eventName, payload); | |
| 42744 | + return true; | |
| 42745 | + } catch (error) { | |
| 42740 | 42746 | return false; |
| 42741 | 42747 | } |
| 42742 | - this.getEventsManager().dispatchEvent(eventName, payload); | |
| 42743 | 42748 | } |
| 42744 | 42749 | }, { |
| 42745 | 42750 | key: "toLowerSnake", |
| 42746 | 42751 | value: function toLowerSnake(value) { |
| @@ -43095,8 +43100,53 @@ | ||
| 43095 | 43100 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder), |
| 43096 | 43101 | interaction_description: 'core_user_clicked_theme_builder_menu_item' |
| 43097 | 43102 | })); |
| 43098 | 43103 | } |
| 43104 | + }, { | |
| 43105 | + key: "sendSidebarMenuItemClicked", | |
| 43106 | + value: function sendSidebarMenuItemClicked(_ref8) { | |
| 43107 | + var eventId = _ref8.eventId, | |
| 43108 | + groupEventId = _ref8.groupEventId; | |
| 43109 | + try { | |
| 43110 | + var _config$windowNames, _config$triggers13, _config$targetTypes14, _config$interactionRe16, _config$locations12, _config$names13; | |
| 43111 | + var config = this.getConfig(); | |
| 43112 | + var payload = this.createBasePayload({ | |
| 43113 | + window_name: config === null || config === void 0 || (_config$windowNames = config.windowNames) === null || _config$windowNames === void 0 ? void 0 : _config$windowNames.sidebarMenu, | |
| 43114 | + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers13 = config.triggers) === null || _config$triggers13 === void 0 ? void 0 : _config$triggers13.click), | |
| 43115 | + target_type: config === null || config === void 0 || (_config$targetTypes14 = config.targetTypes) === null || _config$targetTypes14 === void 0 ? void 0 : _config$targetTypes14.link, | |
| 43116 | + target_name: eventId, | |
| 43117 | + interaction_result: config === null || config === void 0 || (_config$interactionRe16 = config.interactionResults) === null || _config$interactionRe16 === void 0 ? void 0 : _config$interactionRe16.pageOpened, | |
| 43118 | + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations12 = config.locations) === null || _config$locations12 === void 0 ? void 0 : _config$locations12.sidebar) | |
| 43119 | + }); | |
| 43120 | + if (groupEventId) { | |
| 43121 | + payload.location_l1 = groupEventId; | |
| 43122 | + } | |
| 43123 | + return this.dispatchEvent(config === null || config === void 0 || (_config$names13 = config.names) === null || _config$names13 === void 0 || (_config$names13 = _config$names13.editorOne) === null || _config$names13 === void 0 ? void 0 : _config$names13.sidebarMenuItemClicked, payload); | |
| 43124 | + } catch (error) { | |
| 43125 | + return false; | |
| 43126 | + } | |
| 43127 | + } | |
| 43128 | + }, { | |
| 43129 | + key: "sendSidebarMenuGroupToggled", | |
| 43130 | + value: function sendSidebarMenuGroupToggled(_ref9) { | |
| 43131 | + var eventId = _ref9.eventId, | |
| 43132 | + isExpanded = _ref9.isExpanded; | |
| 43133 | + try { | |
| 43134 | + var _config$interactionRe17, _config$interactionRe18, _config$names14, _config$windowNames2, _config$triggers14, _config$targetTypes15, _config$locations13; | |
| 43135 | + var config = this.getConfig(); | |
| 43136 | + var interactionResult = isExpanded ? config === null || config === void 0 || (_config$interactionRe17 = config.interactionResults) === null || _config$interactionRe17 === void 0 ? void 0 : _config$interactionRe17.expanded : config === null || config === void 0 || (_config$interactionRe18 = config.interactionResults) === null || _config$interactionRe18 === void 0 ? void 0 : _config$interactionRe18.collapsed; | |
| 43137 | + return this.dispatchEvent(config === null || config === void 0 || (_config$names14 = config.names) === null || _config$names14 === void 0 || (_config$names14 = _config$names14.editorOne) === null || _config$names14 === void 0 ? void 0 : _config$names14.sidebarMenuGroupToggled, this.createBasePayload({ | |
| 43138 | + window_name: config === null || config === void 0 || (_config$windowNames2 = config.windowNames) === null || _config$windowNames2 === void 0 ? void 0 : _config$windowNames2.sidebarMenu, | |
| 43139 | + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers14 = config.triggers) === null || _config$triggers14 === void 0 ? void 0 : _config$triggers14.click), | |
| 43140 | + target_type: config === null || config === void 0 || (_config$targetTypes15 = config.targetTypes) === null || _config$targetTypes15 === void 0 ? void 0 : _config$targetTypes15.toggle, | |
| 43141 | + target_name: eventId, | |
| 43142 | + interaction_result: interactionResult, | |
| 43143 | + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations13 = config.locations) === null || _config$locations13 === void 0 ? void 0 : _config$locations13.sidebar) | |
| 43144 | + })); | |
| 43145 | + } catch (error) { | |
| 43146 | + return false; | |
| 43147 | + } | |
| 43148 | + } | |
| 43099 | 43149 | }]); |
| 43100 | 43150 | }(); |
| 43101 | 43151 | var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() { |
| 43102 | 43152 | var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300; |
| @@ -45591,12 +45641,13 @@ | ||
| 45591 | 45641 | return getContainerById(model.id); |
| 45592 | 45642 | } |
| 45593 | 45643 | }; |
| 45594 | 45644 | } |
| 45595 | - var created = $e.run('document/elements/create', _objectSpread({ | |
| 45645 | + var created = $e.run('document/elements/create', { | |
| 45596 | 45646 | container: resolvedTarget !== null && resolvedTarget !== void 0 ? resolvedTarget : target, |
| 45597 | - model: model | |
| 45598 | - }, options)); | |
| 45647 | + model: model, | |
| 45648 | + options: options | |
| 45649 | + }); | |
| 45599 | 45650 | var resolvedCreated = resolveContainer(created); |
| 45600 | 45651 | if (resolvedCreated || !containerClass) { |
| 45601 | 45652 | return resolvedCreated !== null && resolvedCreated !== void 0 ? resolvedCreated : created; |
| 45602 | 45653 | } |