PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.8
Elementor Website Builder – more than just a page builder v4.0.8
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/editor-one-menu.js +0 -527 4.2.0-beta1 → 4.0.8 View file →
@@ -1,445 +1,7 @@
1 1 /******/ (() => { // webpackBootstrap
2 2 /******/ var __webpack_modules__ = ({
3 3
4 -/***/ "../assets/dev/js/editor/utils/editor-one-events.js":
5 -/*!**********************************************************!*\
6 - !*** ../assets/dev/js/editor/utils/editor-one-events.js ***!
7 - \**********************************************************/
8 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9 -
10 -"use strict";
11 -
12 -
13 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
14 -Object.defineProperty(exports, "__esModule", ({
15 - value: true
16 -}));
17 -exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0;
18 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
19 -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
20 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
21 -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; }
22 -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; }
23 -var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () {
24 - function EditorOneEventManager() {
25 - (0, _classCallCheck2.default)(this, EditorOneEventManager);
26 - }
27 - return (0, _createClass2.default)(EditorOneEventManager, null, [{
28 - key: "getEventsManager",
29 - value: function getEventsManager() {
30 - var _elementorCommon;
31 - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager;
32 - }
33 - }, {
34 - key: "getConfig",
35 - value: function getConfig() {
36 - var _this$getEventsManage;
37 - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config;
38 - }
39 - }, {
40 - key: "canSendEvents",
41 - value: function canSendEvents() {
42 - var _elementorCommon2;
43 - 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;
44 - }
45 - }, {
46 - key: "isEventsManagerAvailable",
47 - value: function isEventsManagerAvailable() {
48 - var eventsManager = this.getEventsManager();
49 - return eventsManager && 'function' === typeof eventsManager.dispatchEvent;
50 - }
51 - }, {
52 - key: "dispatchEvent",
53 - value: function dispatchEvent(eventName, payload) {
54 - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) {
55 - return false;
56 - }
57 - try {
58 - return this.getEventsManager().dispatchEvent(eventName, payload);
59 - } catch (error) {
60 - return false;
61 - }
62 - }
63 - }, {
64 - key: "toLowerSnake",
65 - value: function toLowerSnake(value) {
66 - if (!value || 'string' !== typeof value) {
67 - return value;
68 - }
69 - return value.replace(/\s+/g, '_').toLowerCase();
70 - }
71 - }, {
72 - key: "decodeHtmlEntities",
73 - value: function decodeHtmlEntities(text) {
74 - if (!text || 'string' !== typeof text) {
75 - return text;
76 - }
77 - var doc = new DOMParser().parseFromString(text, 'text/html');
78 - return doc.body.textContent || text;
79 - }
80 - }, {
81 - key: "isInEditorContext",
82 - value: function isInEditorContext() {
83 - var _window$elementor;
84 - return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
85 - }
86 - }, {
87 - key: "getFinderContext",
88 - value: function getFinderContext() {
89 - var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2;
90 - var config = this.getConfig();
91 - var isEditor = this.isInEditorContext();
92 - return {
93 - 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,
94 - 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)
95 - };
96 - }
97 - }, {
98 - key: "createBasePayload",
99 - value: function createBasePayload() {
100 - var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4;
101 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
102 - var config = this.getConfig();
103 - return _objectSpread({
104 - 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',
105 - 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'
106 - }, overrides);
107 - }
108 - }, {
109 - key: "sendTopBarPublishDropdown",
110 - value: function sendTopBarPublishDropdown(targetName) {
111 - var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2;
112 - var config = this.getConfig();
113 - 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({
114 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
115 - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
116 - target_name: targetName,
117 - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
118 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
119 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
120 - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
121 - interaction_description: 'User selected an action from the publish dropdown'
122 - }));
123 - }
124 - }, {
125 - key: "sendTopBarPageList",
126 - value: function sendTopBarPageList(targetName) {
127 - var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4;
128 - var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
129 - var config = this.getConfig();
130 - 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({
131 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
132 - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
133 - target_name: targetName,
134 - 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,
135 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
136 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
137 - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
138 - interaction_description: 'User selected an action from the page list dropdown'
139 - }));
140 - }
141 - }, {
142 - key: "sendSiteSettingsSession",
143 - value: function sendSiteSettingsSession(_ref) {
144 - var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3;
145 - var targetType = _ref.targetType,
146 - _ref$visitedItems = _ref.visitedItems,
147 - visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems,
148 - _ref$savedItems = _ref.savedItems,
149 - savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems,
150 - state = _ref.state;
151 - var config = this.getConfig();
152 - 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({
153 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
154 - target_type: targetType,
155 - target_name: 'site_settings',
156 - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
157 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
158 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
159 - interaction_description: 'Records areas visited as part of the site setting session',
160 - metadata: {
161 - visited_items: visitedItems,
162 - saved_items: savedItems
163 - },
164 - state: state
165 - }));
166 - }
167 - }, {
168 - key: "sendELibraryNav",
169 - value: function sendELibraryNav(tabName) {
170 - var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4;
171 - var config = this.getConfig();
172 - 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({
173 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
174 - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
175 - target_name: this.toLowerSnake(tabName),
176 - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
177 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
178 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
179 - interaction_description: 'User navigates within elementor library'
180 - }));
181 - }
182 - }, {
183 - key: "sendELibraryInsert",
184 - value: function sendELibraryInsert(_ref2) {
185 - var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5;
186 - var assetId = _ref2.assetId,
187 - assetName = _ref2.assetName,
188 - libraryType = _ref2.libraryType,
189 - _ref2$proRequired = _ref2.proRequired,
190 - proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
191 - var config = this.getConfig();
192 - var payload = this.createBasePayload({
193 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
194 - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
195 - target_name: String(assetId),
196 - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
197 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
198 - location_l1: this.toLowerSnake(libraryType),
199 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
200 - interaction_description: 'User inserts block/pages from elementor library',
201 - metadata: {
202 - template_id: String(assetId),
203 - template_name: this.decodeHtmlEntities(assetName) || ''
204 - }
205 - });
206 - if (proRequired) {
207 - payload.state = 'pro_plan_required';
208 - }
209 - 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);
210 - }
211 - }, {
212 - key: "sendELibraryFavorite",
213 - value: function sendELibraryFavorite(_ref3) {
214 - var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6;
215 - var assetId = _ref3.assetId,
216 - assetName = _ref3.assetName,
217 - libraryType = _ref3.libraryType,
218 - isFavorite = _ref3.isFavorite,
219 - _ref3$proRequired = _ref3.proRequired,
220 - proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
221 - var config = this.getConfig();
222 - var payload = this.createBasePayload({
223 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
224 - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
225 - target_name: String(assetId),
226 - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
227 - target_value: Boolean(isFavorite),
228 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
229 - location_l1: this.toLowerSnake(libraryType),
230 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
231 - interaction_description: 'User favorite block/pages from elementor library',
232 - metadata: {
233 - template_id: String(assetId),
234 - template_name: this.decodeHtmlEntities(assetName) || ''
235 - }
236 - });
237 - if (proRequired) {
238 - payload.state = 'pro_plan_required';
239 - }
240 - 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);
241 - }
242 - }, {
243 - key: "sendELibraryGenerateAi",
244 - value: function sendELibraryGenerateAi(_ref4) {
245 - var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7;
246 - var assetId = _ref4.assetId,
247 - assetName = _ref4.assetName,
248 - libraryType = _ref4.libraryType;
249 - var config = this.getConfig();
250 - 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({
251 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
252 - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
253 - target_name: String(assetId),
254 - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
255 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
256 - location_l1: this.toLowerSnake(libraryType),
257 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
258 - interaction_description: 'User generated block/page based on a library asset',
259 - metadata: {
260 - template_id: String(assetId),
261 - template_name: this.decodeHtmlEntities(assetName) || ''
262 - }
263 - }));
264 - }
265 - }, {
266 - key: "sendFinderSearchInput",
267 - value: function sendFinderSearchInput(_ref5) {
268 - var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8;
269 - var resultsCount = _ref5.resultsCount,
270 - _ref5$searchTerm = _ref5.searchTerm,
271 - searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
272 - var config = this.getConfig();
273 - var hasResults = resultsCount > 0;
274 - var finderContext = this.getFinderContext();
275 - var payload = this.createBasePayload({
276 - window_name: finderContext.windowName,
277 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
278 - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
279 - target_name: 'finder',
280 - 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,
281 - target_location: finderContext.targetLocation,
282 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
283 - interaction_description: 'Finder search input, follows debounce behavior',
284 - metadata: {
285 - results_count: resultsCount
286 - }
287 - });
288 - if (!hasResults && searchTerm) {
289 - payload.metadata.search_term = searchTerm;
290 - }
291 - 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);
292 - }
293 - }, {
294 - key: "sendFinderResultSelect",
295 - value: function sendFinderResultSelect(choice) {
296 - var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0;
297 - var config = this.getConfig();
298 - var finderContext = this.getFinderContext();
299 - 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({
300 - window_name: finderContext.windowName,
301 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
302 - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
303 - target_name: choice,
304 - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
305 - target_location: finderContext.targetLocation,
306 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
307 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
308 - interaction_description: 'Finder search results was selected'
309 - }));
310 - }
311 - }, {
312 - key: "sendCanvasEmptyBoxAction",
313 - value: function sendCanvasEmptyBoxAction(_ref6) {
314 - var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0;
315 - var targetName = _ref6.targetName,
316 - _ref6$metadata = _ref6.metadata,
317 - metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata,
318 - _ref6$containerCreate = _ref6.containerCreated,
319 - containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
320 - var config = this.getConfig();
321 - var payload = this.createBasePayload({
322 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
323 - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
324 - target_name: targetName,
325 - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
326 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
327 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
328 - interaction_description: 'Empty box on canvas actions'
329 - });
330 - if (Object.keys(metadata).length > 0) {
331 - payload.metadata = metadata;
332 - }
333 - if (containerCreated !== null) {
334 - payload.state = containerCreated;
335 - }
336 - 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);
337 - }
338 - }, {
339 - key: "sendWidgetPanelSearch",
340 - value: function sendWidgetPanelSearch(_ref7) {
341 - var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1;
342 - var resultsCount = _ref7.resultsCount,
343 - _ref7$userInput = _ref7.userInput,
344 - userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
345 - var config = this.getConfig();
346 - var hasResults = resultsCount > 0;
347 - var payload = this.createBasePayload({
348 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
349 - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
350 - target_name: 'search_widget',
351 - 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,
352 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
353 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
354 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
355 - interaction_description: 'Widget search input, follows debounce behavior'
356 - });
357 - if (!hasResults && userInput) {
358 - payload.metadata = {
359 - user_input: userInput
360 - };
361 - }
362 - 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);
363 - }
364 - }, {
365 - key: "createWpDashPayload",
366 - value: function createWpDashPayload() {
367 - var _config$appTypes$wpDa, _config$appTypes5, _config$locations11;
368 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
369 - var config = this.getConfig();
370 - return this.createBasePayload(_objectSpread({
371 - 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',
372 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin),
373 - location_l2: ''
374 - }, overrides));
375 - }
376 - }, {
377 - key: "sendWpDashElementorMenuClick",
378 - value: function sendWpDashElementorMenuClick() {
379 - var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11;
380 - var config = this.getConfig();
381 - 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({
382 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click),
383 - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem,
384 - target_name: 'elementor_menu_item',
385 - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened,
386 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu),
387 - interaction_description: 'core_user_clicked_elementor_menu_item'
388 - }));
389 - }
390 - }, {
391 - key: "sendWpDashEditorSubMenuHover",
392 - value: function sendWpDashEditorSubMenuHover() {
393 - var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12;
394 - var config = this.getConfig();
395 - 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({
396 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover),
397 - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu,
398 - target_name: 'wpdash_editor_sub_menu',
399 - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened,
400 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu),
401 - interaction_description: 'core_user_hovered_sub_menu'
402 - }));
403 - }
404 - }, {
405 - key: "sendWpDashThemeBuilderClick",
406 - value: function sendWpDashThemeBuilderClick() {
407 - var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13;
408 - var config = this.getConfig();
409 - 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({
410 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click),
411 - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem,
412 - target_name: 'theme_builder_menu_item',
413 - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow,
414 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder),
415 - interaction_description: 'core_user_clicked_theme_builder_menu_item'
416 - }));
417 - }
418 - }]);
419 -}();
420 -var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() {
421 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
422 - return _.debounce(function (resultsCount, searchTerm) {
423 - EditorOneEventManager.sendFinderSearchInput({
424 - resultsCount: resultsCount,
425 - searchTerm: searchTerm
426 - });
427 - }, delay);
428 -};
429 -var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() {
430 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
431 - return _.debounce(function (resultsCount, userInput) {
432 - EditorOneEventManager.sendWidgetPanelSearch({
433 - resultsCount: resultsCount,
434 - userInput: userInput
435 - });
436 - }, delay);
437 -};
438 -var _default = exports["default"] = EditorOneEventManager;
439 -
440 -/***/ }),
441 -
442 4 /***/ "../modules/editor-one/assets/js/admin-menu/classes/flyout-interaction-handler.js":
443 5 /*!****************************************************************************************!*\
444 6 !*** ../modules/editor-one/assets/js/admin-menu/classes/flyout-interaction-handler.js ***!
445 7 \****************************************************************************************/
@@ -454,9 +16,8 @@
454 16 }));
455 17 exports.FlyoutInteractionHandler = void 0;
456 18 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
457 19 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
458 -var _menuEventsTracker = __webpack_require__(/*! ./menu-events-tracker */ "../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js");
459 20 var FlyoutInteractionHandler = exports.FlyoutInteractionHandler = /*#__PURE__*/function () {
460 21 function FlyoutInteractionHandler() {
461 22 (0, _classCallCheck2.default)(this, FlyoutInteractionHandler);
462 23 this.activeMenu = null;
@@ -548,9 +109,8 @@
548 109 }
549 110 }, {
550 111 key: "showFlyout",
551 112 value: function showFlyout(parentLi, flyoutMenu) {
552 - var wasAlreadyVisible = flyoutMenu.classList.contains('elementor-submenu-flyout-visible');
553 113 if (this.activeMenu && this.activeMenu !== flyoutMenu) {
554 114 this.hideFlyout(this.activeMenu);
555 115 }
556 116 this.exitPoint = null;
@@ -557,11 +117,8 @@
557 117 this.positionFlyout(parentLi, flyoutMenu);
558 118 flyoutMenu.classList.add('elementor-submenu-flyout-visible');
559 119 this.activeMenu = flyoutMenu;
560 120 this.activeParent = parentLi;
561 - if (!wasAlreadyVisible) {
562 - _menuEventsTracker.MenuEventsTracker.trackEditorSubMenuOpened();
563 - }
564 121 }
565 122 }, {
566 123 key: "hideFlyout",
567 124 value: function hideFlyout(flyoutMenu) {
@@ -861,9 +418,8 @@
861 418 editorFlyoutUl.appendChild(dividerLi);
862 419 }
863 420 var li = document.createElement('li');
864 421 li.setAttribute('data-group-id', item.group_id || '');
865 - li.setAttribute('data-slug', item.slug || '');
866 422 var a = document.createElement('a');
867 423 a.href = item.url;
868 424 a.textContent = item.label;
869 425 li.appendChild(a);
@@ -893,70 +449,8 @@
893 449 }();
894 450
895 451 /***/ }),
896 452
897 -/***/ "../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js":
898 -/*!*********************************************************************************!*\
899 - !*** ../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js ***!
900 - \*********************************************************************************/
901 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
902 -
903 -"use strict";
904 -
905 -
906 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
907 -Object.defineProperty(exports, "__esModule", ({
908 - value: true
909 -}));
910 -exports.MenuEventsTracker = void 0;
911 -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
912 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
913 -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
914 -var SELECTORS = {
915 - elementorMenuLink: '#toplevel_page_elementor-home > a.menu-top',
916 - themeBuilderItem: '[data-slug="elementor-theme-builder"] a, .wp-submenu a[href*="page=elementor-theme-builder"]'
917 -};
918 -var MenuEventsTracker = exports.MenuEventsTracker = /*#__PURE__*/function () {
919 - function MenuEventsTracker() {
920 - (0, _classCallCheck2.default)(this, MenuEventsTracker);
921 - }
922 - return (0, _createClass2.default)(MenuEventsTracker, null, [{
923 - key: "attach",
924 - value: function attach() {
925 - this.attachElementorMenuClick();
926 - this.attachThemeBuilderClick();
927 - }
928 - }, {
929 - key: "attachElementorMenuClick",
930 - value: function attachElementorMenuClick() {
931 - var menuLink = document.querySelector(SELECTORS.elementorMenuLink);
932 - if (!menuLink) {
933 - return;
934 - }
935 - menuLink.addEventListener('click', function () {
936 - _editorOneEvents.EditorOneEventManager.sendWpDashElementorMenuClick();
937 - });
938 - }
939 - }, {
940 - key: "attachThemeBuilderClick",
941 - value: function attachThemeBuilderClick() {
942 - document.addEventListener('click', function (event) {
943 - var link = event.target.closest(SELECTORS.themeBuilderItem);
944 - if (link) {
945 - _editorOneEvents.EditorOneEventManager.sendWpDashThemeBuilderClick();
946 - }
947 - }, true);
948 - }
949 - }, {
950 - key: "trackEditorSubMenuOpened",
951 - value: function trackEditorSubMenuOpened() {
952 - _editorOneEvents.EditorOneEventManager.sendWpDashEditorSubMenuHover();
953 - }
954 - }]);
955 -}();
956 -
957 -/***/ }),
958 -
959 453 /***/ "../modules/editor-one/assets/js/admin-menu/classes/sidebar-menu-handler.js":
960 454 /*!**********************************************************************************!*\
961 455 !*** ../modules/editor-one/assets/js/admin-menu/classes/sidebar-menu-handler.js ***!
962 456 \**********************************************************************************/
@@ -1083,27 +577,8 @@
1083 577 module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
1084 578
1085 579 /***/ }),
1086 580
1087 -/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
1088 -/*!****************************************************************!*\
1089 - !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
1090 - \****************************************************************/
1091 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1092 -
1093 -var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
1094 -function _defineProperty(e, r, t) {
1095 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
1096 - value: t,
1097 - enumerable: !0,
1098 - configurable: !0,
1099 - writable: !0
1100 - }) : e[r] = t, e;
1101 -}
1102 -module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
1103 -
1104 -/***/ }),
1105 -
1106 581 /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
1107 582 /*!***********************************************************************!*\
1108 583 !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
1109 584 \***********************************************************************/
@@ -1215,9 +690,8 @@
1215 690 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1216 691 var _flyoutMenuRenderer = __webpack_require__(/*! ./classes/flyout-menu-renderer */ "../modules/editor-one/assets/js/admin-menu/classes/flyout-menu-renderer.js");
1217 692 var _sidebarMenuHandler = __webpack_require__(/*! ./classes/sidebar-menu-handler */ "../modules/editor-one/assets/js/admin-menu/classes/sidebar-menu-handler.js");
1218 693 var _flyoutInteractionHandler = __webpack_require__(/*! ./classes/flyout-interaction-handler */ "../modules/editor-one/assets/js/admin-menu/classes/flyout-interaction-handler.js");
1219 -var _menuEventsTracker = __webpack_require__(/*! ./classes/menu-events-tracker */ "../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js");
1220 694 var EditorOneMenu = /*#__PURE__*/function () {
1221 695 function EditorOneMenu() {
1222 696 var _window;
1223 697 (0, _classCallCheck2.default)(this, EditorOneMenu);
@@ -1225,9 +699,8 @@
1225 699 }
1226 700 return (0, _createClass2.default)(EditorOneMenu, [{
1227 701 key: "init",
1228 702 value: function init() {
1229 - _menuEventsTracker.MenuEventsTracker.attach();
1230 703 if (this.isSidebarNavigationActive()) {
1231 704 new _sidebarMenuHandler.SidebarMenuHandler();
1232 705 return;
1233 706 }