| 1 |
(self["webpackChunkelementor"] = self["webpackChunkelementor"] || []).push([["modules_nested-elements_assets_js_editor_nested-element-types-base_js"],{ |
| 2 |
|
| 3 |
/***/ "../assets/dev/js/editor/utils/editor-one-events.js": |
| 4 |
/*!**********************************************************!*\ |
| 5 |
!*** ../assets/dev/js/editor/utils/editor-one-events.js ***! |
| 6 |
\**********************************************************/ |
| 7 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 8 |
|
| 9 |
"use strict"; |
| 10 |
|
| 11 |
|
| 12 |
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 13 |
Object.defineProperty(exports, "__esModule", ({ |
| 14 |
value: true |
| 15 |
})); |
| 16 |
exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0; |
| 17 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 18 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 19 |
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 20 |
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; } |
| 21 |
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; } |
| 22 |
var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () { |
| 23 |
function EditorOneEventManager() { |
| 24 |
(0, _classCallCheck2.default)(this, EditorOneEventManager); |
| 25 |
} |
| 26 |
return (0, _createClass2.default)(EditorOneEventManager, null, [{ |
| 27 |
key: "getEventsManager", |
| 28 |
value: function getEventsManager() { |
| 29 |
var _elementorCommon; |
| 30 |
return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager; |
| 31 |
} |
| 32 |
}, { |
| 33 |
key: "getConfig", |
| 34 |
value: function getConfig() { |
| 35 |
var _this$getEventsManage; |
| 36 |
return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config; |
| 37 |
} |
| 38 |
}, { |
| 39 |
key: "canSendEvents", |
| 40 |
value: function canSendEvents() { |
| 41 |
var _elementorCommon2; |
| 42 |
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; |
| 43 |
} |
| 44 |
}, { |
| 45 |
key: "isEventsManagerAvailable", |
| 46 |
value: function isEventsManagerAvailable() { |
| 47 |
var eventsManager = this.getEventsManager(); |
| 48 |
return eventsManager && 'function' === typeof eventsManager.dispatchEvent; |
| 49 |
} |
| 50 |
}, { |
| 51 |
key: "dispatchEvent", |
| 52 |
value: function dispatchEvent(eventName, payload) { |
| 53 |
if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { |
| 54 |
return false; |
| 55 |
} |
| 56 |
try { |
| 57 |
return this.getEventsManager().dispatchEvent(eventName, payload); |
| 58 |
} catch (error) { |
| 59 |
return false; |
| 60 |
} |
| 61 |
} |
| 62 |
}, { |
| 63 |
key: "toLowerSnake", |
| 64 |
value: function toLowerSnake(value) { |
| 65 |
if (!value || 'string' !== typeof value) { |
| 66 |
return value; |
| 67 |
} |
| 68 |
return value.replace(/\s+/g, '_').toLowerCase(); |
| 69 |
} |
| 70 |
}, { |
| 71 |
key: "decodeHtmlEntities", |
| 72 |
value: function decodeHtmlEntities(text) { |
| 73 |
if (!text || 'string' !== typeof text) { |
| 74 |
return text; |
| 75 |
} |
| 76 |
var doc = new DOMParser().parseFromString(text, 'text/html'); |
| 77 |
return doc.body.textContent || text; |
| 78 |
} |
| 79 |
}, { |
| 80 |
key: "isInEditorContext", |
| 81 |
value: function isInEditorContext() { |
| 82 |
var _window$elementor; |
| 83 |
return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents); |
| 84 |
} |
| 85 |
}, { |
| 86 |
key: "getFinderContext", |
| 87 |
value: function getFinderContext() { |
| 88 |
var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2; |
| 89 |
var config = this.getConfig(); |
| 90 |
var isEditor = this.isInEditorContext(); |
| 91 |
return { |
| 92 |
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, |
| 93 |
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) |
| 94 |
}; |
| 95 |
} |
| 96 |
}, { |
| 97 |
key: "createBasePayload", |
| 98 |
value: function createBasePayload() { |
| 99 |
var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4; |
| 100 |
var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 101 |
var config = this.getConfig(); |
| 102 |
return _objectSpread({ |
| 103 |
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', |
| 104 |
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' |
| 105 |
}, overrides); |
| 106 |
} |
| 107 |
}, { |
| 108 |
key: "sendTopBarPublishDropdown", |
| 109 |
value: function sendTopBarPublishDropdown(targetName) { |
| 110 |
var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2; |
| 111 |
var config = this.getConfig(); |
| 112 |
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({ |
| 113 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click), |
| 114 |
target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem, |
| 115 |
target_name: targetName, |
| 116 |
interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected, |
| 117 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar), |
| 118 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown), |
| 119 |
location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem, |
| 120 |
interaction_description: 'User selected an action from the publish dropdown' |
| 121 |
})); |
| 122 |
} |
| 123 |
}, { |
| 124 |
key: "sendTopBarPageList", |
| 125 |
value: function sendTopBarPageList(targetName) { |
| 126 |
var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4; |
| 127 |
var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; |
| 128 |
var config = this.getConfig(); |
| 129 |
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({ |
| 130 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click), |
| 131 |
target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem, |
| 132 |
target_name: targetName, |
| 133 |
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, |
| 134 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar), |
| 135 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown), |
| 136 |
location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem, |
| 137 |
interaction_description: 'User selected an action from the page list dropdown' |
| 138 |
})); |
| 139 |
} |
| 140 |
}, { |
| 141 |
key: "sendSiteSettingsSession", |
| 142 |
value: function sendSiteSettingsSession(_ref) { |
| 143 |
var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3; |
| 144 |
var targetType = _ref.targetType, |
| 145 |
_ref$visitedItems = _ref.visitedItems, |
| 146 |
visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems, |
| 147 |
_ref$savedItems = _ref.savedItems, |
| 148 |
savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems, |
| 149 |
state = _ref.state; |
| 150 |
var config = this.getConfig(); |
| 151 |
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({ |
| 152 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click), |
| 153 |
target_type: targetType, |
| 154 |
target_name: 'site_settings', |
| 155 |
interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd, |
| 156 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel), |
| 157 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings), |
| 158 |
interaction_description: 'Records areas visited as part of the site setting session', |
| 159 |
metadata: { |
| 160 |
visited_items: visitedItems, |
| 161 |
saved_items: savedItems |
| 162 |
}, |
| 163 |
state: state |
| 164 |
})); |
| 165 |
} |
| 166 |
}, { |
| 167 |
key: "sendELibraryNav", |
| 168 |
value: function sendELibraryNav(tabName) { |
| 169 |
var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4; |
| 170 |
var config = this.getConfig(); |
| 171 |
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({ |
| 172 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect), |
| 173 |
target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab, |
| 174 |
target_name: this.toLowerSnake(tabName), |
| 175 |
interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged, |
| 176 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary), |
| 177 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs), |
| 178 |
interaction_description: 'User navigates within elementor library' |
| 179 |
})); |
| 180 |
} |
| 181 |
}, { |
| 182 |
key: "sendELibraryInsert", |
| 183 |
value: function sendELibraryInsert(_ref2) { |
| 184 |
var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5; |
| 185 |
var assetId = _ref2.assetId, |
| 186 |
assetName = _ref2.assetName, |
| 187 |
libraryType = _ref2.libraryType, |
| 188 |
_ref2$proRequired = _ref2.proRequired, |
| 189 |
proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired; |
| 190 |
var config = this.getConfig(); |
| 191 |
var payload = this.createBasePayload({ |
| 192 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert), |
| 193 |
target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button, |
| 194 |
target_name: String(assetId), |
| 195 |
interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted, |
| 196 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary), |
| 197 |
location_l1: this.toLowerSnake(libraryType), |
| 198 |
location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard), |
| 199 |
interaction_description: 'User inserts block/pages from elementor library', |
| 200 |
metadata: { |
| 201 |
template_id: String(assetId), |
| 202 |
template_name: this.decodeHtmlEntities(assetName) || '' |
| 203 |
} |
| 204 |
}); |
| 205 |
if (proRequired) { |
| 206 |
payload.state = 'pro_plan_required'; |
| 207 |
} |
| 208 |
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); |
| 209 |
} |
| 210 |
}, { |
| 211 |
key: "sendELibraryFavorite", |
| 212 |
value: function sendELibraryFavorite(_ref3) { |
| 213 |
var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6; |
| 214 |
var assetId = _ref3.assetId, |
| 215 |
assetName = _ref3.assetName, |
| 216 |
libraryType = _ref3.libraryType, |
| 217 |
isFavorite = _ref3.isFavorite, |
| 218 |
_ref3$proRequired = _ref3.proRequired, |
| 219 |
proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired; |
| 220 |
var config = this.getConfig(); |
| 221 |
var payload = this.createBasePayload({ |
| 222 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click), |
| 223 |
target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle, |
| 224 |
target_name: String(assetId), |
| 225 |
interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite, |
| 226 |
target_value: Boolean(isFavorite), |
| 227 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary), |
| 228 |
location_l1: this.toLowerSnake(libraryType), |
| 229 |
location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard), |
| 230 |
interaction_description: 'User favorite block/pages from elementor library', |
| 231 |
metadata: { |
| 232 |
template_id: String(assetId), |
| 233 |
template_name: this.decodeHtmlEntities(assetName) || '' |
| 234 |
} |
| 235 |
}); |
| 236 |
if (proRequired) { |
| 237 |
payload.state = 'pro_plan_required'; |
| 238 |
} |
| 239 |
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); |
| 240 |
} |
| 241 |
}, { |
| 242 |
key: "sendELibraryGenerateAi", |
| 243 |
value: function sendELibraryGenerateAi(_ref4) { |
| 244 |
var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7; |
| 245 |
var assetId = _ref4.assetId, |
| 246 |
assetName = _ref4.assetName, |
| 247 |
libraryType = _ref4.libraryType; |
| 248 |
var config = this.getConfig(); |
| 249 |
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({ |
| 250 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click), |
| 251 |
target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button, |
| 252 |
target_name: String(assetId), |
| 253 |
interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate, |
| 254 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary), |
| 255 |
location_l1: this.toLowerSnake(libraryType), |
| 256 |
location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard), |
| 257 |
interaction_description: 'User generated block/page based on a library asset', |
| 258 |
metadata: { |
| 259 |
template_id: String(assetId), |
| 260 |
template_name: this.decodeHtmlEntities(assetName) || '' |
| 261 |
} |
| 262 |
})); |
| 263 |
} |
| 264 |
}, { |
| 265 |
key: "sendFinderSearchInput", |
| 266 |
value: function sendFinderSearchInput(_ref5) { |
| 267 |
var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8; |
| 268 |
var resultsCount = _ref5.resultsCount, |
| 269 |
_ref5$searchTerm = _ref5.searchTerm, |
| 270 |
searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm; |
| 271 |
var config = this.getConfig(); |
| 272 |
var hasResults = resultsCount > 0; |
| 273 |
var finderContext = this.getFinderContext(); |
| 274 |
var payload = this.createBasePayload({ |
| 275 |
window_name: finderContext.windowName, |
| 276 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing), |
| 277 |
target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput, |
| 278 |
target_name: 'finder', |
| 279 |
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, |
| 280 |
target_location: finderContext.targetLocation, |
| 281 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder), |
| 282 |
interaction_description: 'Finder search input, follows debounce behavior', |
| 283 |
metadata: { |
| 284 |
results_count: resultsCount |
| 285 |
} |
| 286 |
}); |
| 287 |
if (!hasResults && searchTerm) { |
| 288 |
payload.metadata.search_term = searchTerm; |
| 289 |
} |
| 290 |
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); |
| 291 |
} |
| 292 |
}, { |
| 293 |
key: "sendFinderResultSelect", |
| 294 |
value: function sendFinderResultSelect(choice) { |
| 295 |
var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0; |
| 296 |
var config = this.getConfig(); |
| 297 |
var finderContext = this.getFinderContext(); |
| 298 |
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({ |
| 299 |
window_name: finderContext.windowName, |
| 300 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click), |
| 301 |
target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult, |
| 302 |
target_name: choice, |
| 303 |
interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected, |
| 304 |
target_location: finderContext.targetLocation, |
| 305 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder), |
| 306 |
location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults), |
| 307 |
interaction_description: 'Finder search results was selected' |
| 308 |
})); |
| 309 |
} |
| 310 |
}, { |
| 311 |
key: "sendCanvasEmptyBoxAction", |
| 312 |
value: function sendCanvasEmptyBoxAction(_ref6) { |
| 313 |
var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0; |
| 314 |
var targetName = _ref6.targetName, |
| 315 |
_ref6$metadata = _ref6.metadata, |
| 316 |
metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata, |
| 317 |
_ref6$containerCreate = _ref6.containerCreated, |
| 318 |
containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate; |
| 319 |
var config = this.getConfig(); |
| 320 |
var payload = this.createBasePayload({ |
| 321 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click), |
| 322 |
target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons, |
| 323 |
target_name: targetName, |
| 324 |
interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected, |
| 325 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas), |
| 326 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox), |
| 327 |
interaction_description: 'Empty box on canvas actions' |
| 328 |
}); |
| 329 |
if (Object.keys(metadata).length > 0) { |
| 330 |
payload.metadata = metadata; |
| 331 |
} |
| 332 |
if (containerCreated !== null) { |
| 333 |
payload.state = containerCreated; |
| 334 |
} |
| 335 |
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); |
| 336 |
} |
| 337 |
}, { |
| 338 |
key: "sendWidgetPanelSearch", |
| 339 |
value: function sendWidgetPanelSearch(_ref7) { |
| 340 |
var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1; |
| 341 |
var resultsCount = _ref7.resultsCount, |
| 342 |
_ref7$userInput = _ref7.userInput, |
| 343 |
userInput = _ref7$userInput === void 0 ? null : _ref7$userInput; |
| 344 |
var config = this.getConfig(); |
| 345 |
var hasResults = resultsCount > 0; |
| 346 |
var payload = this.createBasePayload({ |
| 347 |
interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing), |
| 348 |
target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget, |
| 349 |
target_name: 'search_widget', |
| 350 |
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, |
| 351 |
target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel), |
| 352 |
location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel), |
| 353 |
location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar), |
| 354 |
interaction_description: 'Widget search input, follows debounce behavior' |
| 355 |
}); |
| 356 |
if (!hasResults && userInput) { |
| 357 |
payload.metadata = { |
| 358 |
user_input: userInput |
| 359 |
}; |
| 360 |
} |
| 361 |
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); |
| 362 |
} |
| 363 |
}]); |
| 364 |
}(); |
| 365 |
var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() { |
| 366 |
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300; |
| 367 |
return _.debounce(function (resultsCount, searchTerm) { |
| 368 |
EditorOneEventManager.sendFinderSearchInput({ |
| 369 |
resultsCount: resultsCount, |
| 370 |
searchTerm: searchTerm |
| 371 |
}); |
| 372 |
}, delay); |
| 373 |
}; |
| 374 |
var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() { |
| 375 |
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000; |
| 376 |
return _.debounce(function (resultsCount, userInput) { |
| 377 |
EditorOneEventManager.sendWidgetPanelSearch({ |
| 378 |
resultsCount: resultsCount, |
| 379 |
userInput: userInput |
| 380 |
}); |
| 381 |
}, delay); |
| 382 |
}; |
| 383 |
var _default = exports["default"] = EditorOneEventManager; |
| 384 |
|
| 385 |
/***/ }), |
| 386 |
|
| 387 |
/***/ "../modules/nested-elements/assets/js/editor/nested-element-types-base.js": |
| 388 |
/*!********************************************************************************!*\ |
| 389 |
!*** ../modules/nested-elements/assets/js/editor/nested-element-types-base.js ***! |
| 390 |
\********************************************************************************/ |
| 391 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 392 |
|
| 393 |
"use strict"; |
| 394 |
|
| 395 |
|
| 396 |
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 397 |
Object.defineProperty(exports, "__esModule", ({ |
| 398 |
value: true |
| 399 |
})); |
| 400 |
exports["default"] = exports.NestedElementTypesBase = void 0; |
| 401 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 402 |
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 403 |
var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 404 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 405 |
var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 406 |
var _view = _interopRequireDefault(__webpack_require__(/*! ./views/view */ "../modules/nested-elements/assets/js/editor/views/view.js")); |
| 407 |
var _empty = _interopRequireDefault(__webpack_require__(/*! ./views/empty */ "../modules/nested-elements/assets/js/editor/views/empty.js")); |
| 408 |
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)); } |
| 409 |
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 410 |
/** |
| 411 |
* @typedef {import('../../../../../assets/dev/js/editor/elements/types/base/element-base')} ElementBase |
| 412 |
*/ |
| 413 |
var NestedElementTypesBase = exports.NestedElementTypesBase = /*#__PURE__*/function (_elementor$modules$el) { |
| 414 |
function NestedElementTypesBase() { |
| 415 |
(0, _classCallCheck2.default)(this, NestedElementTypesBase); |
| 416 |
return _callSuper(this, NestedElementTypesBase, arguments); |
| 417 |
} |
| 418 |
(0, _inherits2.default)(NestedElementTypesBase, _elementor$modules$el); |
| 419 |
return (0, _createClass2.default)(NestedElementTypesBase, [{ |
| 420 |
key: "getType", |
| 421 |
value: function getType() { |
| 422 |
elementorModules.ForceMethodImplementation(); |
| 423 |
} |
| 424 |
}, { |
| 425 |
key: "getView", |
| 426 |
value: function getView() { |
| 427 |
return _view.default; |
| 428 |
} |
| 429 |
}, { |
| 430 |
key: "getEmptyView", |
| 431 |
value: function getEmptyView() { |
| 432 |
return _empty.default; |
| 433 |
} |
| 434 |
}, { |
| 435 |
key: "getModel", |
| 436 |
value: function getModel() { |
| 437 |
return $e.components.get('nested-elements/nested-repeater').exports.NestedModelBase; |
| 438 |
} |
| 439 |
}]); |
| 440 |
}(elementor.modules.elements.types.Base); |
| 441 |
var _default = exports["default"] = NestedElementTypesBase; |
| 442 |
|
| 443 |
/***/ }), |
| 444 |
|
| 445 |
/***/ "../modules/nested-elements/assets/js/editor/views/add-section-area.js": |
| 446 |
/*!*****************************************************************************!*\ |
| 447 |
!*** ../modules/nested-elements/assets/js/editor/views/add-section-area.js ***! |
| 448 |
\*****************************************************************************/ |
| 449 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 450 |
|
| 451 |
"use strict"; |
| 452 |
/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; |
| 453 |
/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); |
| 454 |
|
| 455 |
|
| 456 |
var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); |
| 457 |
Object.defineProperty(exports, "__esModule", ({ |
| 458 |
value: true |
| 459 |
})); |
| 460 |
exports["default"] = AddSectionArea; |
| 461 |
var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); |
| 462 |
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); } |
| 463 |
/* eslint-disable jsx-a11y/click-events-have-key-events */ |
| 464 |
|
| 465 |
function AddSectionArea(props) { |
| 466 |
var addAreaElementRef = (0, _react.useRef)(), |
| 467 |
containerHelper = elementor.helpers.container; |
| 468 |
(0, _react.useEffect)(function () { |
| 469 |
var $addAreaElementRef = jQuery(addAreaElementRef.current), |
| 470 |
defaultDroppableOptions = props.container.view.getDroppableOptions(); |
| 471 |
defaultDroppableOptions.placeholder = false; |
| 472 |
defaultDroppableOptions.items = '> .elementor-add-section-inner'; |
| 473 |
defaultDroppableOptions.hasDraggingOnChildClass = 'elementor-dragging-on-child'; |
| 474 |
$addAreaElementRef.html5Droppable(defaultDroppableOptions); |
| 475 |
return function () { |
| 476 |
$addAreaElementRef.html5Droppable('destroy'); |
| 477 |
}; |
| 478 |
}, []); |
| 479 |
var handleAddContainerClick = function handleAddContainerClick() { |
| 480 |
props.setIsRenderPresets(true); |
| 481 |
}; |
| 482 |
return /*#__PURE__*/_react.default.createElement("div", { |
| 483 |
className: "elementor-add-section", |
| 484 |
onClick: function onClick() { |
| 485 |
return containerHelper.openEditMode(props.container); |
| 486 |
}, |
| 487 |
ref: addAreaElementRef, |
| 488 |
role: "button", |
| 489 |
tabIndex: "0" |
| 490 |
}, /*#__PURE__*/_react.default.createElement("div", { |
| 491 |
className: "elementor-add-section-inner" |
| 492 |
}, /*#__PURE__*/_react.default.createElement("div", { |
| 493 |
className: "e-view elementor-add-new-section" |
| 494 |
}, /*#__PURE__*/_react.default.createElement("button", { |
| 495 |
type: "button", |
| 496 |
className: "elementor-add-section-area-button elementor-add-section-button", |
| 497 |
"aria-label": __('Add new container', 'elementor'), |
| 498 |
onClick: handleAddContainerClick |
| 499 |
}, /*#__PURE__*/_react.default.createElement("i", { |
| 500 |
className: "eicon-plus", |
| 501 |
"aria-hidden": "true" |
| 502 |
})), /*#__PURE__*/_react.default.createElement("div", { |
| 503 |
className: "elementor-add-section-drag-title" |
| 504 |
}, __('Drag widget here', 'elementor'))))); |
| 505 |
} |
| 506 |
AddSectionArea.propTypes = { |
| 507 |
container: PropTypes.object.isRequired, |
| 508 |
setIsRenderPresets: PropTypes.func.isRequired |
| 509 |
}; |
| 510 |
|
| 511 |
/***/ }), |
| 512 |
|
| 513 |
/***/ "../modules/nested-elements/assets/js/editor/views/empty.js": |
| 514 |
/*!******************************************************************!*\ |
| 515 |
!*** ../modules/nested-elements/assets/js/editor/views/empty.js ***! |
| 516 |
\******************************************************************/ |
| 517 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 518 |
|
| 519 |
"use strict"; |
| 520 |
/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); |
| 521 |
|
| 522 |
|
| 523 |
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 524 |
var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); |
| 525 |
Object.defineProperty(exports, "__esModule", ({ |
| 526 |
value: true |
| 527 |
})); |
| 528 |
exports["default"] = Empty; |
| 529 |
var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); |
| 530 |
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 531 |
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); |
| 532 |
var _addSectionArea = _interopRequireDefault(__webpack_require__(/*! ./add-section-area */ "../modules/nested-elements/assets/js/editor/views/add-section-area.js")); |
| 533 |
var _selectPreset = _interopRequireDefault(__webpack_require__(/*! ./select-preset */ "../modules/nested-elements/assets/js/editor/views/select-preset.js")); |
| 534 |
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); } |
| 535 |
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; } |
| 536 |
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; } |
| 537 |
function Empty(props) { |
| 538 |
var _useState = (0, _react.useState)(false), |
| 539 |
_useState2 = (0, _slicedToArray2.default)(_useState, 2), |
| 540 |
isRenderPresets = _useState2[0], |
| 541 |
setIsRenderPresets = _useState2[1]; |
| 542 |
props = _objectSpread(_objectSpread({}, props), {}, { |
| 543 |
setIsRenderPresets: setIsRenderPresets |
| 544 |
}); |
| 545 |
return isRenderPresets ? /*#__PURE__*/_react.default.createElement(_selectPreset.default, props) : /*#__PURE__*/_react.default.createElement(_addSectionArea.default, props); |
| 546 |
} |
| 547 |
Empty.propTypes = { |
| 548 |
container: PropTypes.object.isRequired |
| 549 |
}; |
| 550 |
|
| 551 |
/***/ }), |
| 552 |
|
| 553 |
/***/ "../modules/nested-elements/assets/js/editor/views/select-preset.js": |
| 554 |
/*!**************************************************************************!*\ |
| 555 |
!*** ../modules/nested-elements/assets/js/editor/views/select-preset.js ***! |
| 556 |
\**************************************************************************/ |
| 557 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 558 |
|
| 559 |
"use strict"; |
| 560 |
/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; |
| 561 |
/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); |
| 562 |
|
| 563 |
|
| 564 |
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 565 |
Object.defineProperty(exports, "__esModule", ({ |
| 566 |
value: true |
| 567 |
})); |
| 568 |
exports["default"] = SelectPreset; |
| 569 |
var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 570 |
var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js"); |
| 571 |
/* eslint-disable jsx-a11y/click-events-have-key-events */ |
| 572 |
|
| 573 |
function SelectPreset(props) { |
| 574 |
var containerHelper = elementor.helpers.container, |
| 575 |
onPresetSelected = function onPresetSelected(preset, container) { |
| 576 |
var options = { |
| 577 |
createWrapper: false |
| 578 |
}; |
| 579 |
_editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({ |
| 580 |
targetName: 'add_container', |
| 581 |
metadata: { |
| 582 |
container_type: 'flexbox', |
| 583 |
structure_type: preset |
| 584 |
}, |
| 585 |
containerCreated: true |
| 586 |
}); |
| 587 |
containerHelper.createContainerFromPreset(preset, container, options); |
| 588 |
}; |
| 589 |
var handleClose = function handleClose() { |
| 590 |
_editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({ |
| 591 |
targetName: 'close', |
| 592 |
containerCreated: false |
| 593 |
}); |
| 594 |
props.setIsRenderPresets(false); |
| 595 |
}; |
| 596 |
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", { |
| 597 |
type: "button", |
| 598 |
className: "elementor-add-section-close", |
| 599 |
"aria-label": __('Close', 'elementor'), |
| 600 |
onClick: handleClose |
| 601 |
}, /*#__PURE__*/_react.default.createElement("i", { |
| 602 |
className: "eicon-close", |
| 603 |
"aria-hidden": "true" |
| 604 |
})), /*#__PURE__*/_react.default.createElement("div", { |
| 605 |
className: "e-view e-con-select-preset" |
| 606 |
}, /*#__PURE__*/_react.default.createElement("div", { |
| 607 |
className: "e-con-select-preset__title" |
| 608 |
}, __('Select your Structure', 'elementor')), /*#__PURE__*/_react.default.createElement("div", { |
| 609 |
className: "e-con-select-preset__list" |
| 610 |
}, elementor.presetsFactory.getContainerPresets().map(function (preset) { |
| 611 |
return /*#__PURE__*/_react.default.createElement("button", { |
| 612 |
type: "button", |
| 613 |
className: "e-con-preset", |
| 614 |
"data-preset": preset, |
| 615 |
key: preset, |
| 616 |
onClick: function onClick() { |
| 617 |
return onPresetSelected(preset, props.container); |
| 618 |
}, |
| 619 |
dangerouslySetInnerHTML: { |
| 620 |
__html: elementor.presetsFactory.generateContainerPreset(preset) |
| 621 |
} |
| 622 |
}); |
| 623 |
})))); |
| 624 |
} |
| 625 |
SelectPreset.propTypes = { |
| 626 |
container: PropTypes.object.isRequired, |
| 627 |
setIsRenderPresets: PropTypes.func.isRequired |
| 628 |
}; |
| 629 |
|
| 630 |
/***/ }), |
| 631 |
|
| 632 |
/***/ "../modules/nested-elements/assets/js/editor/views/view.js": |
| 633 |
/*!*****************************************************************!*\ |
| 634 |
!*** ../modules/nested-elements/assets/js/editor/views/view.js ***! |
| 635 |
\*****************************************************************/ |
| 636 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 637 |
|
| 638 |
"use strict"; |
| 639 |
|
| 640 |
|
| 641 |
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 642 |
Object.defineProperty(exports, "__esModule", ({ |
| 643 |
value: true |
| 644 |
})); |
| 645 |
exports["default"] = exports.View = void 0; |
| 646 |
var _readOnlyError2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/readOnlyError */ "../node_modules/@babel/runtime/helpers/readOnlyError.js")); |
| 647 |
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 648 |
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 649 |
var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 650 |
var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 651 |
var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); |
| 652 |
var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 653 |
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)); } |
| 654 |
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 655 |
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; } |
| 656 |
var View = exports.View = /*#__PURE__*/function (_$e$components$get$ex) { |
| 657 |
function View() { |
| 658 |
(0, _classCallCheck2.default)(this, View); |
| 659 |
return _callSuper(this, View, arguments); |
| 660 |
} |
| 661 |
(0, _inherits2.default)(View, _$e$components$get$ex); |
| 662 |
return (0, _createClass2.default)(View, [{ |
| 663 |
key: "events", |
| 664 |
value: function events() { |
| 665 |
var _this = this; |
| 666 |
var events = _superPropGet(View, "events", this, 3)([]); |
| 667 |
events.click = function (e) { |
| 668 |
// If the clicked Nested Element is not within the currently edited document, don't do anything with it. |
| 669 |
if (elementor.documents.currentDocument.id.toString() !== e.target.closest('.elementor').dataset.elementorId) { |
| 670 |
return; |
| 671 |
} |
| 672 |
var closest = e.target.closest('.elementor-element'); |
| 673 |
var targetContainer = null; |
| 674 |
|
| 675 |
// For clicks on container/widget. |
| 676 |
if (['container', 'widget'].includes(closest === null || closest === void 0 ? void 0 : closest.dataset.element_type)) { |
| 677 |
// eslint-disable-line camelcase |
| 678 |
// In case the container empty, click should be handled by the EmptyView. |
| 679 |
var container = elementor.getContainer(closest.dataset.id); |
| 680 |
if (container.view.isEmpty()) { |
| 681 |
return true; |
| 682 |
} |
| 683 |
|
| 684 |
// If not empty, open it. |
| 685 |
targetContainer = container; |
| 686 |
} |
| 687 |
e.stopPropagation(); |
| 688 |
$e.run('document/elements/select', { |
| 689 |
container: targetContainer || _this.getContainer() |
| 690 |
}); |
| 691 |
}; |
| 692 |
return events; |
| 693 |
} |
| 694 |
|
| 695 |
/** |
| 696 |
* Function renderHTML(). |
| 697 |
* |
| 698 |
* The `renderHTML()` method is overridden as it causes redundant renders when removing focus from any nested element. |
| 699 |
* This is because the original `renderHTML()` method sets `editModel.renderOnLeave = true;`. |
| 700 |
*/ |
| 701 |
}, { |
| 702 |
key: "renderHTML", |
| 703 |
value: function renderHTML() { |
| 704 |
var templateType = this.getTemplateType(), |
| 705 |
editModel = this.getEditModel(); |
| 706 |
if ('js' === templateType) { |
| 707 |
editModel.setHtmlCache(); |
| 708 |
this.render(); |
| 709 |
} else { |
| 710 |
editModel.renderRemoteServer(); |
| 711 |
} |
| 712 |
} |
| 713 |
}]); |
| 714 |
}($e.components.get('nested-elements/nested-repeater').exports.NestedViewBase); |
| 715 |
var _default = exports["default"] = View; |
| 716 |
|
| 717 |
/***/ }), |
| 718 |
|
| 719 |
/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": |
| 720 |
/*!***********************************************************************!*\ |
| 721 |
!*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! |
| 722 |
\***********************************************************************/ |
| 723 |
/***/ ((module) => { |
| 724 |
|
| 725 |
function _assertThisInitialized(e) { |
| 726 |
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 727 |
return e; |
| 728 |
} |
| 729 |
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 730 |
|
| 731 |
/***/ }), |
| 732 |
|
| 733 |
/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": |
| 734 |
/*!****************************************************************!*\ |
| 735 |
!*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! |
| 736 |
\****************************************************************/ |
| 737 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 738 |
|
| 739 |
var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); |
| 740 |
function _defineProperty(e, r, t) { |
| 741 |
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { |
| 742 |
value: t, |
| 743 |
enumerable: !0, |
| 744 |
configurable: !0, |
| 745 |
writable: !0 |
| 746 |
}) : e[r] = t, e; |
| 747 |
} |
| 748 |
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 749 |
|
| 750 |
/***/ }), |
| 751 |
|
| 752 |
/***/ "../node_modules/@babel/runtime/helpers/get.js": |
| 753 |
/*!*****************************************************!*\ |
| 754 |
!*** ../node_modules/@babel/runtime/helpers/get.js ***! |
| 755 |
\*****************************************************/ |
| 756 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 757 |
|
| 758 |
var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); |
| 759 |
function _get() { |
| 760 |
return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { |
| 761 |
var p = superPropBase(e, t); |
| 762 |
if (p) { |
| 763 |
var n = Object.getOwnPropertyDescriptor(p, t); |
| 764 |
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; |
| 765 |
} |
| 766 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); |
| 767 |
} |
| 768 |
module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 769 |
|
| 770 |
/***/ }), |
| 771 |
|
| 772 |
/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": |
| 773 |
/*!****************************************************************!*\ |
| 774 |
!*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! |
| 775 |
\****************************************************************/ |
| 776 |
/***/ ((module) => { |
| 777 |
|
| 778 |
function _getPrototypeOf(t) { |
| 779 |
return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { |
| 780 |
return t.__proto__ || Object.getPrototypeOf(t); |
| 781 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); |
| 782 |
} |
| 783 |
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 784 |
|
| 785 |
/***/ }), |
| 786 |
|
| 787 |
/***/ "../node_modules/@babel/runtime/helpers/inherits.js": |
| 788 |
/*!**********************************************************!*\ |
| 789 |
!*** ../node_modules/@babel/runtime/helpers/inherits.js ***! |
| 790 |
\**********************************************************/ |
| 791 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 792 |
|
| 793 |
var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); |
| 794 |
function _inherits(t, e) { |
| 795 |
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); |
| 796 |
t.prototype = Object.create(e && e.prototype, { |
| 797 |
constructor: { |
| 798 |
value: t, |
| 799 |
writable: !0, |
| 800 |
configurable: !0 |
| 801 |
} |
| 802 |
}), Object.defineProperty(t, "prototype", { |
| 803 |
writable: !1 |
| 804 |
}), e && setPrototypeOf(t, e); |
| 805 |
} |
| 806 |
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 807 |
|
| 808 |
/***/ }), |
| 809 |
|
| 810 |
/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": |
| 811 |
/*!***************************************************************************!*\ |
| 812 |
!*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! |
| 813 |
\***************************************************************************/ |
| 814 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 815 |
|
| 816 |
var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 817 |
var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); |
| 818 |
function _possibleConstructorReturn(t, e) { |
| 819 |
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; |
| 820 |
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); |
| 821 |
return assertThisInitialized(t); |
| 822 |
} |
| 823 |
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 824 |
|
| 825 |
/***/ }), |
| 826 |
|
| 827 |
/***/ "../node_modules/@babel/runtime/helpers/readOnlyError.js": |
| 828 |
/*!***************************************************************!*\ |
| 829 |
!*** ../node_modules/@babel/runtime/helpers/readOnlyError.js ***! |
| 830 |
\***************************************************************/ |
| 831 |
/***/ ((module) => { |
| 832 |
|
| 833 |
function _readOnlyError(r) { |
| 834 |
throw new TypeError('"' + r + '" is read-only'); |
| 835 |
} |
| 836 |
module.exports = _readOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 837 |
|
| 838 |
/***/ }), |
| 839 |
|
| 840 |
/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": |
| 841 |
/*!****************************************************************!*\ |
| 842 |
!*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! |
| 843 |
\****************************************************************/ |
| 844 |
/***/ ((module) => { |
| 845 |
|
| 846 |
function _setPrototypeOf(t, e) { |
| 847 |
return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { |
| 848 |
return t.__proto__ = e, t; |
| 849 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); |
| 850 |
} |
| 851 |
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 852 |
|
| 853 |
/***/ }), |
| 854 |
|
| 855 |
/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": |
| 856 |
/*!***************************************************************!*\ |
| 857 |
!*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! |
| 858 |
\***************************************************************/ |
| 859 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 860 |
|
| 861 |
var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); |
| 862 |
function _superPropBase(t, o) { |
| 863 |
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); |
| 864 |
return t; |
| 865 |
} |
| 866 |
module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 867 |
|
| 868 |
/***/ }) |
| 869 |
|
| 870 |
}]); |
| 871 |
//# sourceMappingURL=9b97a73ee8fdc5fb7dc3.bundle.js.map |