| @@ -1,4 +1,5 @@ | ||
| 1 | +/*! elementor - v3.27.0 - 13-02-2025 */ | |
| 1 | 2 | /******/ (() => { // webpackBootstrap |
| 2 | 3 | /******/ var __webpack_modules__ = ({ |
| 3 | 4 | |
| 4 | 5 | /***/ "../assets/dev/js/editor/elements/views/behaviors/sortable.js": |
| @@ -194,12 +195,9 @@ | ||
| 194 | 195 | if (undefined === newIndex) { |
| 195 | 196 | newIndex = ui.item.index(); |
| 196 | 197 | } |
| 197 | 198 | var child = elementor.channels.data.request('dragging:view').getContainer(); |
| 198 | - var result = this.moveChild(child, newIndex); | |
| 199 | - if (!result) { | |
| 200 | - jQuery(ui.sender).sortable('cancel'); | |
| 201 | - } | |
| 199 | + this.moveChild(child, newIndex); | |
| 202 | 200 | }, |
| 203 | 201 | // On receiving element from another container |
| 204 | 202 | receiveSort: function receiveSort(event, ui, newIndex) { |
| 205 | 203 | event.stopPropagation(); |
| @@ -218,12 +216,9 @@ | ||
| 218 | 216 | if (undefined === newIndex) { |
| 219 | 217 | newIndex = ui.item.index(); |
| 220 | 218 | } |
| 221 | 219 | var child = elementor.channels.data.request('dragging:view').getContainer(); |
| 222 | - var result = this.moveChild(child, newIndex); | |
| 223 | - if (!result) { | |
| 224 | - jQuery(ui.sender).sortable('cancel'); | |
| 225 | - } | |
| 220 | + this.moveChild(child, newIndex); | |
| 226 | 221 | }, |
| 227 | 222 | onSortStart: function onSortStart(event, ui) { |
| 228 | 223 | if ('column' === this.options.elChildType) { |
| 229 | 224 | var uiData = ui.item.data('sortableItem'), |
| @@ -271,12 +266,12 @@ | ||
| 271 | 266 | * |
| 272 | 267 | * @param {Container} child - The child container to move. |
| 273 | 268 | * @param {number|string} index - New index. |
| 274 | 269 | * |
| 275 | - * @return {Container|boolean} | |
| 270 | + * @return {void} | |
| 276 | 271 | */ |
| 277 | 272 | moveChild: function moveChild(child, index) { |
| 278 | - return $e.run('document/elements/move', { | |
| 273 | + $e.run('document/elements/move', { | |
| 279 | 274 | container: child, |
| 280 | 275 | target: this.view.getContainer(), |
| 281 | 276 | options: { |
| 282 | 277 | at: index |
| @@ -302,536 +297,23 @@ | ||
| 302 | 297 | value: true |
| 303 | 298 | })); |
| 304 | 299 | exports["default"] = EmptyComponent; |
| 305 | 300 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 306 | -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js"); | |
| 307 | 301 | /* eslint-disable jsx-a11y/no-static-element-interactions */ |
| 308 | 302 | /* eslint-disable jsx-a11y/click-events-have-key-events */ |
| 309 | - | |
| 310 | 303 | function EmptyComponent() { |
| 311 | - var handleClick = function handleClick() { | |
| 312 | - _editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({ | |
| 313 | - targetName: 'add_container' | |
| 314 | - }); | |
| 315 | - $e.route('panel/elements/categories'); | |
| 316 | - }; | |
| 317 | 304 | return /*#__PURE__*/_react.default.createElement("div", { |
| 318 | 305 | className: "elementor-first-add" |
| 319 | 306 | }, /*#__PURE__*/_react.default.createElement("div", { |
| 320 | 307 | className: "elementor-icon eicon-plus", |
| 321 | - onClick: handleClick | |
| 308 | + onClick: function onClick() { | |
| 309 | + return $e.route('panel/elements/categories'); | |
| 310 | + } | |
| 322 | 311 | })); |
| 323 | 312 | } |
| 324 | 313 | |
| 325 | 314 | /***/ }), |
| 326 | 315 | |
| 327 | -/***/ "../assets/dev/js/editor/utils/editor-one-events.js": | |
| 328 | -/*!**********************************************************!*\ | |
| 329 | - !*** ../assets/dev/js/editor/utils/editor-one-events.js ***! | |
| 330 | - \**********************************************************/ | |
| 331 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 332 | - | |
| 333 | -"use strict"; | |
| 334 | - | |
| 335 | - | |
| 336 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 337 | -Object.defineProperty(exports, "__esModule", ({ | |
| 338 | - value: true | |
| 339 | -})); | |
| 340 | -exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0; | |
| 341 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 342 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 343 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 344 | -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | |
| 345 | -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | |
| 346 | -var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () { | |
| 347 | - function EditorOneEventManager() { | |
| 348 | - (0, _classCallCheck2.default)(this, EditorOneEventManager); | |
| 349 | - } | |
| 350 | - return (0, _createClass2.default)(EditorOneEventManager, null, [{ | |
| 351 | - key: "getEventsManager", | |
| 352 | - value: function getEventsManager() { | |
| 353 | - var _elementorCommon; | |
| 354 | - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager; | |
| 355 | - } | |
| 356 | - }, { | |
| 357 | - key: "getConfig", | |
| 358 | - value: function getConfig() { | |
| 359 | - var _this$getEventsManage; | |
| 360 | - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config; | |
| 361 | - } | |
| 362 | - }, { | |
| 363 | - key: "canSendEvents", | |
| 364 | - value: function canSendEvents() { | |
| 365 | - var _elementorCommon2; | |
| 366 | - return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false; | |
| 367 | - } | |
| 368 | - }, { | |
| 369 | - key: "isEventsManagerAvailable", | |
| 370 | - value: function isEventsManagerAvailable() { | |
| 371 | - var eventsManager = this.getEventsManager(); | |
| 372 | - return eventsManager && 'function' === typeof eventsManager.dispatchEvent; | |
| 373 | - } | |
| 374 | - }, { | |
| 375 | - key: "dispatchEvent", | |
| 376 | - value: function dispatchEvent(eventName, payload) { | |
| 377 | - try { | |
| 378 | - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { | |
| 379 | - return false; | |
| 380 | - } | |
| 381 | - this.getEventsManager().dispatchEvent(eventName, payload); | |
| 382 | - return true; | |
| 383 | - } catch (error) { | |
| 384 | - return false; | |
| 385 | - } | |
| 386 | - } | |
| 387 | - }, { | |
| 388 | - key: "toLowerSnake", | |
| 389 | - value: function toLowerSnake(value) { | |
| 390 | - if (!value || 'string' !== typeof value) { | |
| 391 | - return value; | |
| 392 | - } | |
| 393 | - return value.replace(/\s+/g, '_').toLowerCase(); | |
| 394 | - } | |
| 395 | - }, { | |
| 396 | - key: "decodeHtmlEntities", | |
| 397 | - value: function decodeHtmlEntities(text) { | |
| 398 | - if (!text || 'string' !== typeof text) { | |
| 399 | - return text; | |
| 400 | - } | |
| 401 | - var doc = new DOMParser().parseFromString(text, 'text/html'); | |
| 402 | - return doc.body.textContent || text; | |
| 403 | - } | |
| 404 | - }, { | |
| 405 | - key: "isInEditorContext", | |
| 406 | - value: function isInEditorContext() { | |
| 407 | - var _window$elementor; | |
| 408 | - return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents); | |
| 409 | - } | |
| 410 | - }, { | |
| 411 | - key: "getFinderContext", | |
| 412 | - value: function getFinderContext() { | |
| 413 | - var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2; | |
| 414 | - var config = this.getConfig(); | |
| 415 | - var isEditor = this.isInEditorContext(); | |
| 416 | - return { | |
| 417 | - 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, | |
| 418 | - 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) | |
| 419 | - }; | |
| 420 | - } | |
| 421 | - }, { | |
| 422 | - key: "createBasePayload", | |
| 423 | - value: function createBasePayload() { | |
| 424 | - var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4; | |
| 425 | - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 426 | - var config = this.getConfig(); | |
| 427 | - return _objectSpread({ | |
| 428 | - 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', | |
| 429 | - 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' | |
| 430 | - }, overrides); | |
| 431 | - } | |
| 432 | - }, { | |
| 433 | - key: "sendTopBarPublishDropdown", | |
| 434 | - value: function sendTopBarPublishDropdown(targetName) { | |
| 435 | - var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2; | |
| 436 | - var config = this.getConfig(); | |
| 437 | - 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({ | |
| 438 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click), | |
| 439 | - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem, | |
| 440 | - target_name: targetName, | |
| 441 | - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected, | |
| 442 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar), | |
| 443 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown), | |
| 444 | - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem, | |
| 445 | - interaction_description: 'User selected an action from the publish dropdown' | |
| 446 | - })); | |
| 447 | - } | |
| 448 | - }, { | |
| 449 | - key: "sendTopBarPageList", | |
| 450 | - value: function sendTopBarPageList(targetName) { | |
| 451 | - var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4; | |
| 452 | - var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | |
| 453 | - var config = this.getConfig(); | |
| 454 | - 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({ | |
| 455 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click), | |
| 456 | - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem, | |
| 457 | - target_name: targetName, | |
| 458 | - 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, | |
| 459 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar), | |
| 460 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown), | |
| 461 | - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem, | |
| 462 | - interaction_description: 'User selected an action from the page list dropdown' | |
| 463 | - })); | |
| 464 | - } | |
| 465 | - }, { | |
| 466 | - key: "sendSiteSettingsSession", | |
| 467 | - value: function sendSiteSettingsSession(_ref) { | |
| 468 | - var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3; | |
| 469 | - var targetType = _ref.targetType, | |
| 470 | - _ref$visitedItems = _ref.visitedItems, | |
| 471 | - visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems, | |
| 472 | - _ref$savedItems = _ref.savedItems, | |
| 473 | - savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems, | |
| 474 | - state = _ref.state; | |
| 475 | - var config = this.getConfig(); | |
| 476 | - 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({ | |
| 477 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click), | |
| 478 | - target_type: targetType, | |
| 479 | - target_name: 'site_settings', | |
| 480 | - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd, | |
| 481 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel), | |
| 482 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings), | |
| 483 | - interaction_description: 'Records areas visited as part of the site setting session', | |
| 484 | - metadata: { | |
| 485 | - visited_items: visitedItems, | |
| 486 | - saved_items: savedItems | |
| 487 | - }, | |
| 488 | - state: state | |
| 489 | - })); | |
| 490 | - } | |
| 491 | - }, { | |
| 492 | - key: "sendELibraryNav", | |
| 493 | - value: function sendELibraryNav(tabName) { | |
| 494 | - var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4; | |
| 495 | - var config = this.getConfig(); | |
| 496 | - 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({ | |
| 497 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect), | |
| 498 | - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab, | |
| 499 | - target_name: this.toLowerSnake(tabName), | |
| 500 | - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged, | |
| 501 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary), | |
| 502 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs), | |
| 503 | - interaction_description: 'User navigates within elementor library' | |
| 504 | - })); | |
| 505 | - } | |
| 506 | - }, { | |
| 507 | - key: "sendELibraryInsert", | |
| 508 | - value: function sendELibraryInsert(_ref2) { | |
| 509 | - var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5; | |
| 510 | - var assetId = _ref2.assetId, | |
| 511 | - assetName = _ref2.assetName, | |
| 512 | - libraryType = _ref2.libraryType, | |
| 513 | - _ref2$proRequired = _ref2.proRequired, | |
| 514 | - proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired; | |
| 515 | - var config = this.getConfig(); | |
| 516 | - var payload = this.createBasePayload({ | |
| 517 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert), | |
| 518 | - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button, | |
| 519 | - target_name: String(assetId), | |
| 520 | - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted, | |
| 521 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary), | |
| 522 | - location_l1: this.toLowerSnake(libraryType), | |
| 523 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard), | |
| 524 | - interaction_description: 'User inserts block/pages from elementor library', | |
| 525 | - metadata: { | |
| 526 | - template_id: String(assetId), | |
| 527 | - template_name: this.decodeHtmlEntities(assetName) || '' | |
| 528 | - } | |
| 529 | - }); | |
| 530 | - if (proRequired) { | |
| 531 | - payload.state = 'pro_plan_required'; | |
| 532 | - } | |
| 533 | - 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); | |
| 534 | - } | |
| 535 | - }, { | |
| 536 | - key: "sendELibraryFavorite", | |
| 537 | - value: function sendELibraryFavorite(_ref3) { | |
| 538 | - var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6; | |
| 539 | - var assetId = _ref3.assetId, | |
| 540 | - assetName = _ref3.assetName, | |
| 541 | - libraryType = _ref3.libraryType, | |
| 542 | - isFavorite = _ref3.isFavorite, | |
| 543 | - _ref3$proRequired = _ref3.proRequired, | |
| 544 | - proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired; | |
| 545 | - var config = this.getConfig(); | |
| 546 | - var payload = this.createBasePayload({ | |
| 547 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click), | |
| 548 | - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle, | |
| 549 | - target_name: String(assetId), | |
| 550 | - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite, | |
| 551 | - target_value: Boolean(isFavorite), | |
| 552 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary), | |
| 553 | - location_l1: this.toLowerSnake(libraryType), | |
| 554 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard), | |
| 555 | - interaction_description: 'User favorite block/pages from elementor library', | |
| 556 | - metadata: { | |
| 557 | - template_id: String(assetId), | |
| 558 | - template_name: this.decodeHtmlEntities(assetName) || '' | |
| 559 | - } | |
| 560 | - }); | |
| 561 | - if (proRequired) { | |
| 562 | - payload.state = 'pro_plan_required'; | |
| 563 | - } | |
| 564 | - 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); | |
| 565 | - } | |
| 566 | - }, { | |
| 567 | - key: "sendELibraryGenerateAi", | |
| 568 | - value: function sendELibraryGenerateAi(_ref4) { | |
| 569 | - var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7; | |
| 570 | - var assetId = _ref4.assetId, | |
| 571 | - assetName = _ref4.assetName, | |
| 572 | - libraryType = _ref4.libraryType; | |
| 573 | - var config = this.getConfig(); | |
| 574 | - 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({ | |
| 575 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click), | |
| 576 | - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button, | |
| 577 | - target_name: String(assetId), | |
| 578 | - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate, | |
| 579 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary), | |
| 580 | - location_l1: this.toLowerSnake(libraryType), | |
| 581 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard), | |
| 582 | - interaction_description: 'User generated block/page based on a library asset', | |
| 583 | - metadata: { | |
| 584 | - template_id: String(assetId), | |
| 585 | - template_name: this.decodeHtmlEntities(assetName) || '' | |
| 586 | - } | |
| 587 | - })); | |
| 588 | - } | |
| 589 | - }, { | |
| 590 | - key: "sendFinderSearchInput", | |
| 591 | - value: function sendFinderSearchInput(_ref5) { | |
| 592 | - var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8; | |
| 593 | - var resultsCount = _ref5.resultsCount, | |
| 594 | - _ref5$searchTerm = _ref5.searchTerm, | |
| 595 | - searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm; | |
| 596 | - var config = this.getConfig(); | |
| 597 | - var hasResults = resultsCount > 0; | |
| 598 | - var finderContext = this.getFinderContext(); | |
| 599 | - var payload = this.createBasePayload({ | |
| 600 | - window_name: finderContext.windowName, | |
| 601 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing), | |
| 602 | - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput, | |
| 603 | - target_name: 'finder', | |
| 604 | - 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, | |
| 605 | - target_location: finderContext.targetLocation, | |
| 606 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder), | |
| 607 | - interaction_description: 'Finder search input, follows debounce behavior', | |
| 608 | - metadata: { | |
| 609 | - results_count: resultsCount | |
| 610 | - } | |
| 611 | - }); | |
| 612 | - if (!hasResults && searchTerm) { | |
| 613 | - payload.metadata.search_term = searchTerm; | |
| 614 | - } | |
| 615 | - 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); | |
| 616 | - } | |
| 617 | - }, { | |
| 618 | - key: "sendFinderResultSelect", | |
| 619 | - value: function sendFinderResultSelect(choice) { | |
| 620 | - var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0; | |
| 621 | - var config = this.getConfig(); | |
| 622 | - var finderContext = this.getFinderContext(); | |
| 623 | - 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({ | |
| 624 | - window_name: finderContext.windowName, | |
| 625 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click), | |
| 626 | - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult, | |
| 627 | - target_name: choice, | |
| 628 | - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected, | |
| 629 | - target_location: finderContext.targetLocation, | |
| 630 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder), | |
| 631 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults), | |
| 632 | - interaction_description: 'Finder search results was selected' | |
| 633 | - })); | |
| 634 | - } | |
| 635 | - }, { | |
| 636 | - key: "sendCanvasEmptyBoxAction", | |
| 637 | - value: function sendCanvasEmptyBoxAction(_ref6) { | |
| 638 | - var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0; | |
| 639 | - var targetName = _ref6.targetName, | |
| 640 | - _ref6$metadata = _ref6.metadata, | |
| 641 | - metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata, | |
| 642 | - _ref6$containerCreate = _ref6.containerCreated, | |
| 643 | - containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate; | |
| 644 | - var config = this.getConfig(); | |
| 645 | - var payload = this.createBasePayload({ | |
| 646 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click), | |
| 647 | - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons, | |
| 648 | - target_name: targetName, | |
| 649 | - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected, | |
| 650 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas), | |
| 651 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox), | |
| 652 | - interaction_description: 'Empty box on canvas actions' | |
| 653 | - }); | |
| 654 | - if (Object.keys(metadata).length > 0) { | |
| 655 | - payload.metadata = metadata; | |
| 656 | - } | |
| 657 | - if (containerCreated !== null) { | |
| 658 | - payload.state = containerCreated; | |
| 659 | - } | |
| 660 | - 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); | |
| 661 | - } | |
| 662 | - }, { | |
| 663 | - key: "sendWidgetPanelSearch", | |
| 664 | - value: function sendWidgetPanelSearch(_ref7) { | |
| 665 | - var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1; | |
| 666 | - var resultsCount = _ref7.resultsCount, | |
| 667 | - _ref7$userInput = _ref7.userInput, | |
| 668 | - userInput = _ref7$userInput === void 0 ? null : _ref7$userInput; | |
| 669 | - var config = this.getConfig(); | |
| 670 | - var hasResults = resultsCount > 0; | |
| 671 | - var payload = this.createBasePayload({ | |
| 672 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing), | |
| 673 | - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget, | |
| 674 | - target_name: 'search_widget', | |
| 675 | - 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, | |
| 676 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel), | |
| 677 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel), | |
| 678 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar), | |
| 679 | - interaction_description: 'Widget search input, follows debounce behavior' | |
| 680 | - }); | |
| 681 | - if (!hasResults && userInput) { | |
| 682 | - payload.metadata = { | |
| 683 | - user_input: userInput | |
| 684 | - }; | |
| 685 | - } | |
| 686 | - 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); | |
| 687 | - } | |
| 688 | - }, { | |
| 689 | - key: "createWpDashPayload", | |
| 690 | - value: function createWpDashPayload() { | |
| 691 | - var _config$appTypes$wpDa, _config$appTypes5, _config$locations11; | |
| 692 | - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 693 | - var config = this.getConfig(); | |
| 694 | - return this.createBasePayload(_objectSpread({ | |
| 695 | - 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', | |
| 696 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin), | |
| 697 | - location_l2: '' | |
| 698 | - }, overrides)); | |
| 699 | - } | |
| 700 | - }, { | |
| 701 | - key: "sendWpDashElementorMenuClick", | |
| 702 | - value: function sendWpDashElementorMenuClick() { | |
| 703 | - var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11; | |
| 704 | - var config = this.getConfig(); | |
| 705 | - 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({ | |
| 706 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click), | |
| 707 | - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem, | |
| 708 | - target_name: 'elementor_menu_item', | |
| 709 | - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened, | |
| 710 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu), | |
| 711 | - interaction_description: 'core_user_clicked_elementor_menu_item' | |
| 712 | - })); | |
| 713 | - } | |
| 714 | - }, { | |
| 715 | - key: "sendWpDashEditorSubMenuHover", | |
| 716 | - value: function sendWpDashEditorSubMenuHover() { | |
| 717 | - var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12; | |
| 718 | - var config = this.getConfig(); | |
| 719 | - 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({ | |
| 720 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover), | |
| 721 | - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu, | |
| 722 | - target_name: 'wpdash_editor_sub_menu', | |
| 723 | - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened, | |
| 724 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu), | |
| 725 | - interaction_description: 'core_user_hovered_sub_menu' | |
| 726 | - })); | |
| 727 | - } | |
| 728 | - }, { | |
| 729 | - key: "sendWpDashThemeBuilderClick", | |
| 730 | - value: function sendWpDashThemeBuilderClick() { | |
| 731 | - var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13; | |
| 732 | - var config = this.getConfig(); | |
| 733 | - 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({ | |
| 734 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click), | |
| 735 | - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem, | |
| 736 | - target_name: 'theme_builder_menu_item', | |
| 737 | - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow, | |
| 738 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder), | |
| 739 | - interaction_description: 'core_user_clicked_theme_builder_menu_item' | |
| 740 | - })); | |
| 741 | - } | |
| 742 | - }, { | |
| 743 | - key: "sendSidebarMenuItemClicked", | |
| 744 | - value: function sendSidebarMenuItemClicked(_ref8) { | |
| 745 | - var eventId = _ref8.eventId, | |
| 746 | - groupEventId = _ref8.groupEventId; | |
| 747 | - try { | |
| 748 | - var _config$windowNames, _config$triggers13, _config$targetTypes14, _config$interactionRe16, _config$locations12, _config$names13; | |
| 749 | - var config = this.getConfig(); | |
| 750 | - var payload = this.createBasePayload({ | |
| 751 | - window_name: config === null || config === void 0 || (_config$windowNames = config.windowNames) === null || _config$windowNames === void 0 ? void 0 : _config$windowNames.sidebarMenu, | |
| 752 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers13 = config.triggers) === null || _config$triggers13 === void 0 ? void 0 : _config$triggers13.click), | |
| 753 | - target_type: config === null || config === void 0 || (_config$targetTypes14 = config.targetTypes) === null || _config$targetTypes14 === void 0 ? void 0 : _config$targetTypes14.link, | |
| 754 | - target_name: eventId, | |
| 755 | - interaction_result: config === null || config === void 0 || (_config$interactionRe16 = config.interactionResults) === null || _config$interactionRe16 === void 0 ? void 0 : _config$interactionRe16.pageOpened, | |
| 756 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations12 = config.locations) === null || _config$locations12 === void 0 ? void 0 : _config$locations12.sidebar) | |
| 757 | - }); | |
| 758 | - if (groupEventId) { | |
| 759 | - payload.location_l1 = groupEventId; | |
| 760 | - } | |
| 761 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names13 = config.names) === null || _config$names13 === void 0 || (_config$names13 = _config$names13.editorOne) === null || _config$names13 === void 0 ? void 0 : _config$names13.sidebarMenuItemClicked, payload); | |
| 762 | - } catch (error) { | |
| 763 | - return false; | |
| 764 | - } | |
| 765 | - } | |
| 766 | - }, { | |
| 767 | - key: "sendSidebarMenuGroupToggled", | |
| 768 | - value: function sendSidebarMenuGroupToggled(_ref9) { | |
| 769 | - var eventId = _ref9.eventId, | |
| 770 | - isExpanded = _ref9.isExpanded; | |
| 771 | - try { | |
| 772 | - var _config$interactionRe17, _config$interactionRe18, _config$names14, _config$windowNames2, _config$triggers14, _config$targetTypes15, _config$locations13; | |
| 773 | - var config = this.getConfig(); | |
| 774 | - var interactionResult = isExpanded ? config === null || config === void 0 || (_config$interactionRe17 = config.interactionResults) === null || _config$interactionRe17 === void 0 ? void 0 : _config$interactionRe17.expanded : config === null || config === void 0 || (_config$interactionRe18 = config.interactionResults) === null || _config$interactionRe18 === void 0 ? void 0 : _config$interactionRe18.collapsed; | |
| 775 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names14 = config.names) === null || _config$names14 === void 0 || (_config$names14 = _config$names14.editorOne) === null || _config$names14 === void 0 ? void 0 : _config$names14.sidebarMenuGroupToggled, this.createBasePayload({ | |
| 776 | - window_name: config === null || config === void 0 || (_config$windowNames2 = config.windowNames) === null || _config$windowNames2 === void 0 ? void 0 : _config$windowNames2.sidebarMenu, | |
| 777 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers14 = config.triggers) === null || _config$triggers14 === void 0 ? void 0 : _config$triggers14.click), | |
| 778 | - target_type: config === null || config === void 0 || (_config$targetTypes15 = config.targetTypes) === null || _config$targetTypes15 === void 0 ? void 0 : _config$targetTypes15.toggle, | |
| 779 | - target_name: eventId, | |
| 780 | - interaction_result: interactionResult, | |
| 781 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations13 = config.locations) === null || _config$locations13 === void 0 ? void 0 : _config$locations13.sidebar) | |
| 782 | - })); | |
| 783 | - } catch (error) { | |
| 784 | - return false; | |
| 785 | - } | |
| 786 | - } | |
| 787 | - }]); | |
| 788 | -}(); | |
| 789 | -var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() { | |
| 790 | - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300; | |
| 791 | - return _.debounce(function (resultsCount, searchTerm) { | |
| 792 | - EditorOneEventManager.sendFinderSearchInput({ | |
| 793 | - resultsCount: resultsCount, | |
| 794 | - searchTerm: searchTerm | |
| 795 | - }); | |
| 796 | - }, delay); | |
| 797 | -}; | |
| 798 | -var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() { | |
| 799 | - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000; | |
| 800 | - return _.debounce(function (resultsCount, userInput) { | |
| 801 | - EditorOneEventManager.sendWidgetPanelSearch({ | |
| 802 | - resultsCount: resultsCount, | |
| 803 | - userInput: userInput | |
| 804 | - }); | |
| 805 | - }, delay); | |
| 806 | -}; | |
| 807 | -var _default = exports["default"] = EditorOneEventManager; | |
| 808 | - | |
| 809 | -/***/ }), | |
| 810 | - | |
| 811 | -/***/ "../assets/dev/js/editor/utils/element-types.js": | |
| 812 | -/*!******************************************************!*\ | |
| 813 | - !*** ../assets/dev/js/editor/utils/element-types.js ***! | |
| 814 | - \******************************************************/ | |
| 815 | -/***/ ((module) => { | |
| 816 | - | |
| 817 | -"use strict"; | |
| 818 | - | |
| 819 | - | |
| 820 | -/** | |
| 821 | - * Returns an array of all available element types. | |
| 822 | - * | |
| 823 | - * @return {string[]} Array of element type strings. | |
| 824 | - */ | |
| 825 | -var getAllElementTypes = function getAllElementTypes() { | |
| 826 | - return Object.keys(elementor.getConfig().elements); | |
| 827 | -}; | |
| 828 | -module.exports = { | |
| 829 | - getAllElementTypes: getAllElementTypes | |
| 830 | -}; | |
| 831 | - | |
| 832 | -/***/ }), | |
| 833 | - | |
| 834 | 316 | /***/ "../assets/dev/js/utils/react.js": |
| 835 | 317 | /*!***************************************!*\ |
| 836 | 318 | !*** ../assets/dev/js/utils/react.js ***! |
| 837 | 319 | \***************************************/ |
| @@ -847,9 +329,10 @@ | ||
| 847 | 329 | exports["default"] = void 0; |
| 848 | 330 | var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); |
| 849 | 331 | var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom")); |
| 850 | 332 | var _client = __webpack_require__(/*! react-dom/client */ "../node_modules/react-dom/client.js"); |
| 851 | -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); } | |
| 333 | +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | |
| 334 | +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | |
| 852 | 335 | /** |
| 853 | 336 | * Support conditional rendering of a React App to the DOM, based on the React version. |
| 854 | 337 | * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions. |
| 855 | 338 | * |
| @@ -883,12 +366,12 @@ | ||
| 883 | 366 | }; |
| 884 | 367 | |
| 885 | 368 | /***/ }), |
| 886 | 369 | |
| 887 | -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js": | |
| 888 | -/*!*******************************************************************************!*\ | |
| 889 | - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js ***! | |
| 890 | - \*******************************************************************************/ | |
| 370 | +/***/ "../modules/atomic-widgets/assets/js/editor/atomic-widget-type.js": | |
| 371 | +/*!************************************************************************!*\ | |
| 372 | + !*** ../modules/atomic-widgets/assets/js/editor/atomic-widget-type.js ***! | |
| 373 | + \************************************************************************/ | |
| 891 | 374 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 892 | 375 | |
| 893 | 376 | "use strict"; |
| 894 | 377 | |
| @@ -896,105 +379,52 @@ | ||
| 896 | 379 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 897 | 380 | Object.defineProperty(exports, "__esModule", ({ |
| 898 | 381 | value: true |
| 899 | 382 | })); |
| 900 | -exports["default"] = void 0; | |
| 383 | +exports.AtomicWidgetType = void 0; | |
| 901 | 384 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 902 | 385 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 903 | 386 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 904 | 387 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 905 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 906 | 388 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 389 | +var _atomicWidgetView = __webpack_require__(/*! ./atomic-widget-view */ "../modules/atomic-widgets/assets/js/editor/atomic-widget-view.js"); | |
| 907 | 390 | 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)); } |
| 908 | 391 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 909 | -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; } | |
| 910 | -var AtomicElementBaseModel = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) { | |
| 911 | - function AtomicElementBaseModel() { | |
| 912 | - (0, _classCallCheck2.default)(this, AtomicElementBaseModel); | |
| 913 | - return _callSuper(this, AtomicElementBaseModel, arguments); | |
| 392 | +function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); } | |
| 393 | +function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } | |
| 394 | +function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); } | |
| 395 | +function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; } | |
| 396 | +function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } | |
| 397 | +var _type = /*#__PURE__*/new WeakMap(); | |
| 398 | +var AtomicWidgetType = exports.AtomicWidgetType = /*#__PURE__*/function (_elementor$modules$el) { | |
| 399 | + function AtomicWidgetType(type) { | |
| 400 | + var _this; | |
| 401 | + (0, _classCallCheck2.default)(this, AtomicWidgetType); | |
| 402 | + _this = _callSuper(this, AtomicWidgetType); | |
| 403 | + _classPrivateFieldInitSpec(_this, _type, void 0); | |
| 404 | + _classPrivateFieldSet(_type, _this, type); | |
| 405 | + return _this; | |
| 914 | 406 | } |
| 915 | - (0, _inherits2.default)(AtomicElementBaseModel, _elementor$modules$el); | |
| 916 | - return (0, _createClass2.default)(AtomicElementBaseModel, [{ | |
| 917 | - key: "isValidChild", | |
| 918 | - value: | |
| 919 | - /** | |
| 920 | - * Do not allow section, column or container be placed in the Atomic container. | |
| 921 | - * | |
| 922 | - * @param {*} childModel | |
| 923 | - */ | |
| 924 | - function isValidChild(childModel) { | |
| 925 | - var elType = childModel.get('elType'); | |
| 926 | - return 'section' !== elType && 'column' !== elType; | |
| 407 | + (0, _inherits2.default)(AtomicWidgetType, _elementor$modules$el); | |
| 408 | + return (0, _createClass2.default)(AtomicWidgetType, [{ | |
| 409 | + key: "getType", | |
| 410 | + value: function getType() { | |
| 411 | + return _classPrivateFieldGet(_type, this); | |
| 927 | 412 | } |
| 928 | 413 | }, { |
| 929 | - key: "initialize", | |
| 930 | - value: function initialize(attributes, options) { | |
| 931 | - var _this$config; | |
| 932 | - var elementType = this.get('elType'); | |
| 933 | - this.config = elementor.config.elements[elementType]; | |
| 934 | - if ((_this$config = this.config) !== null && _this$config !== void 0 && (_this$config = _this$config.meta) !== null && _this$config !== void 0 && _this$config.permanently_locked) { | |
| 935 | - this.set('isLocked', true); | |
| 936 | - } | |
| 937 | - var isNewElementCreate = 0 === this.get('elements').length && $e.commands.currentTrace.includes('document/elements/create'); | |
| 938 | - if (isNewElementCreate) { | |
| 939 | - this.onElementCreate(); | |
| 940 | - } | |
| 941 | - _superPropGet(AtomicElementBaseModel, "initialize", this, 3)([attributes, options]); | |
| 414 | + key: "getView", | |
| 415 | + value: function getView() { | |
| 416 | + return _atomicWidgetView.AtomicWidgetView; | |
| 942 | 417 | } |
| 943 | - }, { | |
| 944 | - key: "getDefaultChildren", | |
| 945 | - value: function getDefaultChildren() { | |
| 946 | - var defaultChildren = this.config.default_children; | |
| 947 | - return this.modifyDefaultChildren(defaultChildren); | |
| 948 | - } | |
| 949 | - }, { | |
| 950 | - key: "onElementCreate", | |
| 951 | - value: function onElementCreate() { | |
| 952 | - var _this = this; | |
| 953 | - if (this.get('skipDefaultChildren')) { | |
| 954 | - this.unset('skipDefaultChildren', { | |
| 955 | - silent: true | |
| 956 | - }); | |
| 957 | - return; | |
| 958 | - } | |
| 959 | - this.set('elements', this.getDefaultChildren().map(function (element) { | |
| 960 | - return _this.buildElement(element); | |
| 961 | - })); | |
| 962 | - } | |
| 963 | - }, { | |
| 964 | - key: "modifyDefaultChildren", | |
| 965 | - value: function modifyDefaultChildren(element) { | |
| 966 | - return element; | |
| 967 | - } | |
| 968 | - }, { | |
| 969 | - key: "buildElement", | |
| 970 | - value: function buildElement(element) { | |
| 971 | - var _this2 = this, | |
| 972 | - _element$settings; | |
| 973 | - var id = elementorCommon.helpers.getUniqueId(); | |
| 974 | - var elements = (element.elements || []).map(function (el) { | |
| 975 | - return _this2.buildElement(el); | |
| 976 | - }); | |
| 977 | - return { | |
| 978 | - elType: element.elType, | |
| 979 | - widgetType: element.widgetType, | |
| 980 | - id: id, | |
| 981 | - settings: (_element$settings = element.settings) !== null && _element$settings !== void 0 ? _element$settings : {}, | |
| 982 | - elements: elements, | |
| 983 | - isLocked: element.isLocked || false, | |
| 984 | - editor_settings: element.editor_settings || {}, | |
| 985 | - meta: element.meta || {} | |
| 986 | - }; | |
| 987 | - } | |
| 988 | 418 | }]); |
| 989 | -}(elementor.modules.elements.models.Element); | |
| 419 | +}(elementor.modules.elements.types.Widget); | |
| 990 | 420 | |
| 991 | 421 | /***/ }), |
| 992 | 422 | |
| 993 | -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js": | |
| 994 | -/*!******************************************************************************!*\ | |
| 995 | - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js ***! | |
| 996 | - \******************************************************************************/ | |
| 423 | +/***/ "../modules/atomic-widgets/assets/js/editor/atomic-widget-view.js": | |
| 424 | +/*!************************************************************************!*\ | |
| 425 | + !*** ../modules/atomic-widgets/assets/js/editor/atomic-widget-view.js ***! | |
| 426 | + \************************************************************************/ | |
| 997 | 427 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 998 | 428 | |
| 999 | 429 | "use strict"; |
| 1000 | 430 | |
| @@ -1002,122 +432,348 @@ | ||
| 1002 | 432 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1003 | 433 | Object.defineProperty(exports, "__esModule", ({ |
| 1004 | 434 | value: true |
| 1005 | 435 | })); |
| 1006 | -exports["default"] = void 0; | |
| 436 | +exports.AtomicWidgetView = void 0; | |
| 437 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 438 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1007 | 439 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1008 | 440 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1009 | 441 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1010 | 442 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 443 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 1011 | 444 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 445 | +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; } | |
| 446 | +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; } | |
| 1012 | 447 | 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)); } |
| 1013 | 448 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1014 | -var AtomicElementBaseType = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) { | |
| 1015 | - function AtomicElementBaseType(elementType, viewClass) { | |
| 449 | +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; } | |
| 450 | +function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); } | |
| 451 | +function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } | |
| 452 | +function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } | |
| 453 | +var _AtomicWidgetView_brand = /*#__PURE__*/new WeakSet(); | |
| 454 | +var AtomicWidgetView = exports.AtomicWidgetView = /*#__PURE__*/function (_elementor$modules$el) { | |
| 455 | + function AtomicWidgetView() { | |
| 1016 | 456 | var _this; |
| 1017 | - var modelClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | |
| 1018 | - var emptyViewClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; | |
| 1019 | - (0, _classCallCheck2.default)(this, AtomicElementBaseType); | |
| 1020 | - _this = _callSuper(this, AtomicElementBaseType); | |
| 1021 | - _this.elementType = elementType; | |
| 1022 | - _this.viewClass = viewClass; | |
| 1023 | - _this.modelClass = modelClass; | |
| 1024 | - _this.emptyViewClass = emptyViewClass; | |
| 457 | + (0, _classCallCheck2.default)(this, AtomicWidgetView); | |
| 458 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 459 | + args[_key] = arguments[_key]; | |
| 460 | + } | |
| 461 | + _this = _callSuper(this, AtomicWidgetView, [].concat(args)); | |
| 462 | + _classPrivateMethodInitSpec(_this, _AtomicWidgetView_brand); | |
| 1025 | 463 | return _this; |
| 1026 | 464 | } |
| 1027 | - (0, _inherits2.default)(AtomicElementBaseType, _elementor$modules$el); | |
| 1028 | - return (0, _createClass2.default)(AtomicElementBaseType, [{ | |
| 1029 | - key: "getType", | |
| 1030 | - value: function getType() { | |
| 1031 | - return this.elementType; | |
| 465 | + (0, _inherits2.default)(AtomicWidgetView, _elementor$modules$el); | |
| 466 | + return (0, _createClass2.default)(AtomicWidgetView, [{ | |
| 467 | + key: "onRender", | |
| 468 | + value: | |
| 469 | + // Dispatch `render` event so the overlay layer will be updated | |
| 470 | + function onRender() { | |
| 471 | + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | |
| 472 | + args[_key2] = arguments[_key2]; | |
| 473 | + } | |
| 474 | + _superPropGet(AtomicWidgetView, "onRender", this, 3)(args); | |
| 475 | + _assertClassBrand(_AtomicWidgetView_brand, this, _dispatchEvent).call(this, 'elementor/preview/atomic-widget/render'); | |
| 1032 | 476 | } |
| 477 | + | |
| 478 | + // Dispatch `destroy` event so the overlay layer will be updated | |
| 1033 | 479 | }, { |
| 1034 | - key: "getView", | |
| 1035 | - value: function getView() { | |
| 1036 | - return this.viewClass; | |
| 480 | + key: "onDestroy", | |
| 481 | + value: function onDestroy() { | |
| 482 | + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | |
| 483 | + args[_key3] = arguments[_key3]; | |
| 484 | + } | |
| 485 | + _superPropGet(AtomicWidgetView, "onDestroy", this, 3)(args); | |
| 486 | + _assertClassBrand(_AtomicWidgetView_brand, this, _dispatchEvent).call(this, 'elementor/preview/atomic-widget/destroy'); | |
| 1037 | 487 | } |
| 488 | + | |
| 489 | + // Removes behaviors that are not needed for atomic widgets (that are implemented in the overlay layer). | |
| 1038 | 490 | }, { |
| 1039 | - key: "getEmptyView", | |
| 1040 | - value: function getEmptyView() { | |
| 1041 | - return this.emptyViewClass || elementor.modules.elements.views.EmptyComponent; | |
| 491 | + key: "behaviors", | |
| 492 | + value: function behaviors() { | |
| 493 | + var disabledBehaviors = ['InlineEditing', 'Draggable', 'Resizable']; | |
| 494 | + var behaviorsAsEntries = Object.entries(_superPropGet(AtomicWidgetView, "behaviors", this, 3)([])).filter(function (_ref) { | |
| 495 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 1), | |
| 496 | + key = _ref2[0]; | |
| 497 | + return !disabledBehaviors.includes(key); | |
| 498 | + }); | |
| 499 | + return Object.fromEntries(behaviorsAsEntries); | |
| 1042 | 500 | } |
| 501 | + | |
| 502 | + // Change the drag handle because the $el is not the draggable element (`display: contents`). | |
| 1043 | 503 | }, { |
| 1044 | - key: "getModel", | |
| 1045 | - value: function getModel() { | |
| 1046 | - return this.modelClass || elementor.modules.elements.models.AtomicElementBase; | |
| 504 | + key: "getDraggableElement", | |
| 505 | + value: function getDraggableElement() { | |
| 506 | + return this.$el.find(':first-child'); | |
| 1047 | 507 | } |
| 508 | + | |
| 509 | + // Remove the overlay, so we can use the new overlay layer. | |
| 510 | + }, { | |
| 511 | + key: "getHandlesOverlay", | |
| 512 | + value: function getHandlesOverlay() { | |
| 513 | + return null; | |
| 514 | + } | |
| 515 | + }, { | |
| 516 | + key: "attributes", | |
| 517 | + value: function attributes() { | |
| 518 | + return _objectSpread(_objectSpread({}, _superPropGet(AtomicWidgetView, "attributes", this, 3)([])), {}, { | |
| 519 | + // Mark the widget as atomic, so the overlay layer can identify it. | |
| 520 | + 'data-atomic': '', | |
| 521 | + // Make the wrapper non-existent in terms of CSS to mimic the frontend DOM tree. | |
| 522 | + style: 'display: contents !important;' | |
| 523 | + }); | |
| 524 | + } | |
| 1048 | 525 | }]); |
| 1049 | -}(elementor.modules.elements.types.Base); | |
| 526 | +}(elementor.modules.elements.views.Widget); | |
| 527 | +function _dispatchEvent(type) { | |
| 528 | + window.top.dispatchEvent(new CustomEvent(type, { | |
| 529 | + detail: { | |
| 530 | + id: this.model.get('id') | |
| 531 | + } | |
| 532 | + })); | |
| 533 | +} | |
| 1050 | 534 | |
| 1051 | 535 | /***/ }), |
| 1052 | 536 | |
| 1053 | -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js": | |
| 1054 | -/*!************************************************************************************************!*\ | |
| 1055 | - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js ***! | |
| 1056 | - \************************************************************************************************/ | |
| 1057 | -/***/ ((__unused_webpack_module, exports) => { | |
| 537 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js": | |
| 538 | +/*!************************************************************************************!*\ | |
| 539 | + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js ***! | |
| 540 | + \************************************************************************************/ | |
| 541 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1058 | 542 | |
| 1059 | 543 | "use strict"; |
| 544 | +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; | |
| 1060 | 545 | |
| 1061 | 546 | |
| 547 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1062 | 548 | Object.defineProperty(exports, "__esModule", ({ |
| 1063 | 549 | value: true |
| 1064 | 550 | })); |
| 1065 | -exports["default"] = void 0; | |
| 1066 | -var createDivBlockType = function createDivBlockType() { | |
| 1067 | - var DivBlockView = elementor.modules.elements.views.createAtomicElementBase('e-div-block'); | |
| 1068 | - return new elementor.modules.elements.types.AtomicElementBase('e-div-block', DivBlockView); | |
| 1069 | -}; | |
| 1070 | -var _default = exports["default"] = createDivBlockType; | |
| 551 | +exports["default"] = exports.CreateStyle = void 0; | |
| 552 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 553 | +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 554 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 555 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 556 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 557 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 558 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 559 | +var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 560 | +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; } | |
| 561 | +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; } | |
| 562 | +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)); } | |
| 563 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 564 | +var PROP_TYPE_CLASSES = 'classes'; | |
| 1071 | 565 | |
| 566 | +/** | |
| 567 | + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container | |
| 568 | + */ | |
| 569 | +var CreateStyle = exports.CreateStyle = /*#__PURE__*/function (_$e$modules$editor$Co) { | |
| 570 | + function CreateStyle() { | |
| 571 | + (0, _classCallCheck2.default)(this, CreateStyle); | |
| 572 | + return _callSuper(this, CreateStyle, arguments); | |
| 573 | + } | |
| 574 | + (0, _inherits2.default)(CreateStyle, _$e$modules$editor$Co); | |
| 575 | + return (0, _createClass2.default)(CreateStyle, [{ | |
| 576 | + key: "validateArgs", | |
| 577 | + value: function validateArgs(args) { | |
| 578 | + this.requireContainer(args); | |
| 579 | + this.requireArgumentConstructor('bind', String, args); | |
| 580 | + if ('label' in args) { | |
| 581 | + var isValidLabel = 'string' === typeof args.label && args.label.length > 0; | |
| 582 | + if (!isValidLabel) { | |
| 583 | + throw new Error('Invalid label arg'); | |
| 584 | + } | |
| 585 | + } | |
| 586 | + } | |
| 587 | + }, { | |
| 588 | + key: "randomId", | |
| 589 | + value: function randomId(containerId) { | |
| 590 | + return "s-".concat(containerId, "-").concat(elementorCommon.helpers.getUniqueId()); | |
| 591 | + } | |
| 592 | + }, { | |
| 593 | + key: "apply", | |
| 594 | + value: function apply(args) { | |
| 595 | + var _container$settings$g; | |
| 596 | + var container = args.container, | |
| 597 | + styleDefID = args.styleDefID, | |
| 598 | + bind = args.bind, | |
| 599 | + label = args.label; | |
| 600 | + var oldStyles = container.model.get('styles') || {}; | |
| 601 | + var newStyle = { | |
| 602 | + id: styleDefID !== null && styleDefID !== void 0 ? styleDefID : this.randomId(container.id), | |
| 603 | + /* Translators: 1: container label, 2: number of old styles */ | |
| 604 | + label: label !== null && label !== void 0 ? label : sprintf((0, _i18n.__)('%1$s Style %2$s', 'elementor'), container.label, Object.keys(oldStyles).length + 1), | |
| 605 | + type: 'class', | |
| 606 | + variants: [] | |
| 607 | + }; | |
| 608 | + var oldBindSetting = (_container$settings$g = container.settings.get(bind)) !== null && _container$settings$g !== void 0 ? _container$settings$g : { | |
| 609 | + $$type: PROP_TYPE_CLASSES, | |
| 610 | + value: [] | |
| 611 | + }; | |
| 612 | + if (oldBindSetting.$$type !== PROP_TYPE_CLASSES || !Array.isArray(oldBindSetting.value)) { | |
| 613 | + throw new Error('Invalid bind setting prop type'); | |
| 614 | + } | |
| 615 | + var newBindSetting = (0, _defineProperty2.default)({}, bind, { | |
| 616 | + $$type: PROP_TYPE_CLASSES, | |
| 617 | + value: [].concat((0, _toConsumableArray2.default)(oldBindSetting.value), [newStyle.id]) | |
| 618 | + }); | |
| 619 | + $e.internal('document/elements/set-settings', { | |
| 620 | + container: container, | |
| 621 | + settings: newBindSetting | |
| 622 | + }); | |
| 623 | + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, newStyle.id, newStyle)); | |
| 624 | + container.model.set('styles', newStyles); | |
| 625 | + return newStyle; | |
| 626 | + } | |
| 627 | + }]); | |
| 628 | +}($e.modules.editor.CommandContainerInternalBase); | |
| 629 | +var _default = exports["default"] = CreateStyle; | |
| 630 | + | |
| 1072 | 631 | /***/ }), |
| 1073 | 632 | |
| 1074 | -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js": | |
| 1075 | -/*!**********************************************************************************************!*\ | |
| 1076 | - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js ***! | |
| 1077 | - \**********************************************************************************************/ | |
| 1078 | -/***/ ((__unused_webpack_module, exports) => { | |
| 633 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js": | |
| 634 | +/*!**************************************************************************************!*\ | |
| 635 | + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js ***! | |
| 636 | + \**************************************************************************************/ | |
| 637 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1079 | 638 | |
| 1080 | 639 | "use strict"; |
| 1081 | 640 | |
| 1082 | 641 | |
| 642 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1083 | 643 | Object.defineProperty(exports, "__esModule", ({ |
| 1084 | 644 | value: true |
| 1085 | 645 | })); |
| 1086 | -exports["default"] = void 0; | |
| 1087 | -var createFlexboxType = function createFlexboxType() { | |
| 1088 | - var FlexboxView = elementor.modules.elements.views.createAtomicElementBase('e-flexbox'); | |
| 1089 | - return new elementor.modules.elements.types.AtomicElementBase('e-flexbox', FlexboxView); | |
| 1090 | -}; | |
| 1091 | -var _default = exports["default"] = createFlexboxType; | |
| 646 | +exports["default"] = exports.CreateVariant = void 0; | |
| 647 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 648 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 649 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 650 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 651 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 652 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 653 | +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js"); | |
| 654 | +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; } | |
| 655 | +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; } | |
| 656 | +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)); } | |
| 657 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 658 | +/** | |
| 659 | + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container | |
| 660 | + */ | |
| 661 | +var CreateVariant = exports.CreateVariant = /*#__PURE__*/function (_$e$modules$editor$Co) { | |
| 662 | + function CreateVariant() { | |
| 663 | + (0, _classCallCheck2.default)(this, CreateVariant); | |
| 664 | + return _callSuper(this, CreateVariant, arguments); | |
| 665 | + } | |
| 666 | + (0, _inherits2.default)(CreateVariant, _$e$modules$editor$Co); | |
| 667 | + return (0, _createClass2.default)(CreateVariant, [{ | |
| 668 | + key: "validateArgs", | |
| 669 | + value: function validateArgs(args) { | |
| 670 | + this.requireContainer(args); | |
| 671 | + this.requireArgumentConstructor('styleDefID', String, args); | |
| 672 | + this.requireArgumentConstructor('meta', Object, args); | |
| 673 | + if (!('breakpoint' in args.meta && 'state' in args.meta)) { | |
| 674 | + throw new Error('Invalid meta arg'); | |
| 675 | + } | |
| 676 | + } | |
| 677 | + }, { | |
| 678 | + key: "apply", | |
| 679 | + value: function apply(args) { | |
| 680 | + var container = args.container, | |
| 681 | + styleDefID = args.styleDefID, | |
| 682 | + meta = args.meta; | |
| 683 | + var oldStyles = container.model.get('styles') || {}; | |
| 684 | + if (!oldStyles[styleDefID]) { | |
| 685 | + throw new Error('Style Def not found'); | |
| 686 | + } | |
| 687 | + var style = oldStyles[styleDefID]; | |
| 688 | + if ((0, _getVariants.getVariantByMeta)(style.variants, meta)) { | |
| 689 | + throw new Error('Style Variant already exits'); | |
| 690 | + } | |
| 691 | + style.variants.push({ | |
| 692 | + meta: meta, | |
| 693 | + props: {} | |
| 694 | + }); | |
| 695 | + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, styleDefID, style)); | |
| 696 | + container.model.set('styles', newStyles); | |
| 697 | + } | |
| 698 | + }]); | |
| 699 | +}($e.modules.editor.CommandContainerInternalBase); | |
| 700 | +var _default = exports["default"] = CreateVariant; | |
| 1092 | 701 | |
| 1093 | 702 | /***/ }), |
| 1094 | 703 | |
| 1095 | -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js": | |
| 1096 | -/*!*******************************************************************************************!*\ | |
| 1097 | - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js ***! | |
| 1098 | - \*******************************************************************************************/ | |
| 1099 | -/***/ ((__unused_webpack_module, exports) => { | |
| 704 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js": | |
| 705 | +/*!************************************************************************************!*\ | |
| 706 | + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js ***! | |
| 707 | + \************************************************************************************/ | |
| 708 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1100 | 709 | |
| 1101 | 710 | "use strict"; |
| 1102 | 711 | |
| 1103 | 712 | |
| 713 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1104 | 714 | Object.defineProperty(exports, "__esModule", ({ |
| 1105 | 715 | value: true |
| 1106 | 716 | })); |
| 1107 | -exports["default"] = void 0; | |
| 1108 | -var createGridType = function createGridType() { | |
| 1109 | - var GridView = elementor.modules.elements.views.createAtomicElementBase('e-grid'); | |
| 1110 | - return new elementor.modules.elements.types.AtomicElementBase('e-grid', GridView); | |
| 1111 | -}; | |
| 1112 | -var _default = exports["default"] = createGridType; | |
| 717 | +exports["default"] = exports.DeleteStyle = void 0; | |
| 718 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 719 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 720 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 721 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 722 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 723 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 724 | +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)); } | |
| 725 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 726 | +/** | |
| 727 | + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container | |
| 728 | + */ | |
| 729 | +var DeleteStyle = exports.DeleteStyle = /*#__PURE__*/function (_$e$modules$editor$Co) { | |
| 730 | + function DeleteStyle() { | |
| 731 | + (0, _classCallCheck2.default)(this, DeleteStyle); | |
| 732 | + return _callSuper(this, DeleteStyle, arguments); | |
| 733 | + } | |
| 734 | + (0, _inherits2.default)(DeleteStyle, _$e$modules$editor$Co); | |
| 735 | + return (0, _createClass2.default)(DeleteStyle, [{ | |
| 736 | + key: "validateArgs", | |
| 737 | + value: function validateArgs(args) { | |
| 738 | + this.requireContainer(args); | |
| 739 | + this.requireArgumentConstructor('styleDefID', String, args); | |
| 740 | + this.requireArgumentConstructor('bind', String, args); | |
| 741 | + } | |
| 742 | + }, { | |
| 743 | + key: "apply", | |
| 744 | + value: function apply(args) { | |
| 745 | + var container = args.container, | |
| 746 | + styleDefID = args.styleDefID, | |
| 747 | + bind = args.bind; | |
| 748 | + var oldBindSetting = container.settings.get(bind); | |
| 749 | + if (!oldBindSetting) { | |
| 750 | + throw new Error('Setting not found'); | |
| 751 | + } | |
| 752 | + var newBindSetting = (0, _defineProperty2.default)({}, bind, { | |
| 753 | + $$type: 'classes', | |
| 754 | + value: oldBindSetting.value.filter(function (id) { | |
| 755 | + return id !== styleDefID; | |
| 756 | + }) | |
| 757 | + }); | |
| 758 | + $e.internal('document/elements/set-settings', { | |
| 759 | + container: container, | |
| 760 | + settings: newBindSetting | |
| 761 | + }); | |
| 762 | + var styles = container.model.get('styles') || {}; | |
| 763 | + delete styles[styleDefID]; | |
| 764 | + container.model.set('styles', styles); | |
| 765 | + } | |
| 766 | + }]); | |
| 767 | +}($e.modules.editor.CommandContainerInternalBase); | |
| 768 | +var _default = exports["default"] = DeleteStyle; | |
| 1113 | 769 | |
| 1114 | 770 | /***/ }), |
| 1115 | 771 | |
| 1116 | -/***/ "../modules/atomic-widgets/assets/js/editor/component.js": | |
| 1117 | -/*!***************************************************************!*\ | |
| 1118 | - !*** ../modules/atomic-widgets/assets/js/editor/component.js ***! | |
| 1119 | - \***************************************************************/ | |
| 772 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js": | |
| 773 | +/*!**************************************************************************************!*\ | |
| 774 | + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js ***! | |
| 775 | + \**************************************************************************************/ | |
| 1120 | 776 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1121 | 777 | |
| 1122 | 778 | "use strict"; |
| 1123 | 779 | |
| @@ -1122,126 +778,228 @@ | ||
| 1122 | 778 | "use strict"; |
| 1123 | 779 | |
| 1124 | 780 | |
| 1125 | 781 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1126 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1127 | 782 | Object.defineProperty(exports, "__esModule", ({ |
| 1128 | 783 | value: true |
| 1129 | 784 | })); |
| 1130 | -exports["default"] = void 0; | |
| 785 | +exports["default"] = exports.DeleteVariant = void 0; | |
| 786 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1131 | 787 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1132 | 788 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1133 | 789 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1134 | 790 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1135 | 791 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1136 | -var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js")); | |
| 1137 | -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); } | |
| 792 | +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js"); | |
| 793 | +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; } | |
| 794 | +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; } | |
| 1138 | 795 | 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)); } |
| 1139 | 796 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1140 | -var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) { | |
| 1141 | - function Component() { | |
| 1142 | - (0, _classCallCheck2.default)(this, Component); | |
| 1143 | - return _callSuper(this, Component, arguments); | |
| 797 | +/** | |
| 798 | + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container | |
| 799 | + */ | |
| 800 | +var DeleteVariant = exports.DeleteVariant = /*#__PURE__*/function (_$e$modules$editor$Co) { | |
| 801 | + function DeleteVariant() { | |
| 802 | + (0, _classCallCheck2.default)(this, DeleteVariant); | |
| 803 | + return _callSuper(this, DeleteVariant, arguments); | |
| 1144 | 804 | } |
| 1145 | - (0, _inherits2.default)(Component, _$e$modules$Component); | |
| 1146 | - return (0, _createClass2.default)(Component, [{ | |
| 1147 | - key: "getNamespace", | |
| 1148 | - value: function getNamespace() { | |
| 1149 | - return 'document/atomic-widgets'; | |
| 805 | + (0, _inherits2.default)(DeleteVariant, _$e$modules$editor$Co); | |
| 806 | + return (0, _createClass2.default)(DeleteVariant, [{ | |
| 807 | + key: "validateArgs", | |
| 808 | + value: function validateArgs(args) { | |
| 809 | + this.requireContainer(args); | |
| 810 | + this.requireArgumentConstructor('styleDefID', String, args); | |
| 811 | + this.requireArgumentConstructor('meta', Object, args); | |
| 812 | + if (!('breakpoint' in args.meta && 'state' in args.meta)) { | |
| 813 | + throw new Error('Invalid meta arg'); | |
| 814 | + } | |
| 1150 | 815 | } |
| 1151 | 816 | }, { |
| 1152 | - key: "defaultHooks", | |
| 1153 | - value: function defaultHooks() { | |
| 1154 | - return this.importHooks(hooks); | |
| 817 | + key: "apply", | |
| 818 | + value: function apply(args) { | |
| 819 | + var container = args.container, | |
| 820 | + styleDefID = args.styleDefID, | |
| 821 | + meta = args.meta; | |
| 822 | + var oldStyles = container.model.get('styles') || {}; | |
| 823 | + var style = {}; | |
| 824 | + if (!oldStyles[styleDefID]) { | |
| 825 | + throw new Error('Style Def not found'); | |
| 826 | + } | |
| 827 | + style = oldStyles[styleDefID]; | |
| 828 | + style.variants = (0, _getVariants.getVariantsWithoutMeta)(style.variants, meta); | |
| 829 | + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, style.id, style)); | |
| 830 | + container.model.set('styles', newStyles); | |
| 1155 | 831 | } |
| 1156 | 832 | }]); |
| 1157 | -}($e.modules.ComponentBase); | |
| 833 | +}($e.modules.editor.CommandContainerInternalBase); | |
| 834 | +var _default = exports["default"] = DeleteVariant; | |
| 1158 | 835 | |
| 1159 | 836 | /***/ }), |
| 1160 | 837 | |
| 1161 | -/***/ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js": | |
| 1162 | -/*!*****************************************************************************************!*\ | |
| 1163 | - !*** ../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js ***! | |
| 1164 | - \*****************************************************************************************/ | |
| 838 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/index.js": | |
| 839 | +/*!*****************************************************************************!*\ | |
| 840 | + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/index.js ***! | |
| 841 | + \*****************************************************************************/ | |
| 1165 | 842 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1166 | 843 | |
| 1167 | 844 | "use strict"; |
| 1168 | 845 | |
| 1169 | 846 | |
| 847 | +Object.defineProperty(exports, "__esModule", ({ | |
| 848 | + value: true | |
| 849 | +})); | |
| 850 | +Object.defineProperty(exports, "CreateStyle", ({ | |
| 851 | + enumerable: true, | |
| 852 | + get: function get() { | |
| 853 | + return _createStyle.CreateStyle; | |
| 854 | + } | |
| 855 | +})); | |
| 856 | +Object.defineProperty(exports, "CreateVariant", ({ | |
| 857 | + enumerable: true, | |
| 858 | + get: function get() { | |
| 859 | + return _createVariant.CreateVariant; | |
| 860 | + } | |
| 861 | +})); | |
| 862 | +Object.defineProperty(exports, "DeleteStyle", ({ | |
| 863 | + enumerable: true, | |
| 864 | + get: function get() { | |
| 865 | + return _deleteStyle.DeleteStyle; | |
| 866 | + } | |
| 867 | +})); | |
| 868 | +Object.defineProperty(exports, "DeleteVariant", ({ | |
| 869 | + enumerable: true, | |
| 870 | + get: function get() { | |
| 871 | + return _deleteVariant.DeleteVariant; | |
| 872 | + } | |
| 873 | +})); | |
| 874 | +Object.defineProperty(exports, "UpdateProps", ({ | |
| 875 | + enumerable: true, | |
| 876 | + get: function get() { | |
| 877 | + return _updateProps.UpdateProps; | |
| 878 | + } | |
| 879 | +})); | |
| 880 | +var _updateProps = __webpack_require__(/*! ./update-props */ "../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js"); | |
| 881 | +var _createStyle = __webpack_require__(/*! ./create-style */ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js"); | |
| 882 | +var _deleteStyle = __webpack_require__(/*! ./delete-style */ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js"); | |
| 883 | +var _createVariant = __webpack_require__(/*! ./create-variant */ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js"); | |
| 884 | +var _deleteVariant = __webpack_require__(/*! ./delete-variant */ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js"); | |
| 885 | + | |
| 886 | +/***/ }), | |
| 887 | + | |
| 888 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js": | |
| 889 | +/*!************************************************************************************!*\ | |
| 890 | + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js ***! | |
| 891 | + \************************************************************************************/ | |
| 892 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 893 | + | |
| 894 | +"use strict"; | |
| 895 | + | |
| 896 | + | |
| 1170 | 897 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1171 | 898 | Object.defineProperty(exports, "__esModule", ({ |
| 1172 | 899 | value: true |
| 1173 | 900 | })); |
| 1174 | -exports["default"] = void 0; | |
| 1175 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 901 | +exports["default"] = exports.UpdateProps = void 0; | |
| 902 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1176 | 903 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1177 | 904 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1178 | 905 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1179 | 906 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1180 | 907 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1181 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1182 | -var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js")); | |
| 1183 | -var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js")); | |
| 908 | +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js"); | |
| 1184 | 909 | 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)); } |
| 1185 | 910 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1186 | -var AtomicElementEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) { | |
| 1187 | - function AtomicElementEmptyView() { | |
| 1188 | - var _this; | |
| 1189 | - (0, _classCallCheck2.default)(this, AtomicElementEmptyView); | |
| 1190 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 1191 | - args[_key] = arguments[_key]; | |
| 1192 | - } | |
| 1193 | - _this = _callSuper(this, AtomicElementEmptyView, [].concat(args)); | |
| 1194 | - (0, _defineProperty2.default)(_this, "template", '<div></div>'); | |
| 1195 | - (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view'); | |
| 1196 | - (0, _defineProperty2.default)(_this, "unmount", null); | |
| 1197 | - return _this; | |
| 911 | +/** | |
| 912 | + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container | |
| 913 | + */ | |
| 914 | +var UpdateProps = exports.UpdateProps = /*#__PURE__*/function (_$e$modules$editor$Co) { | |
| 915 | + function UpdateProps() { | |
| 916 | + (0, _classCallCheck2.default)(this, UpdateProps); | |
| 917 | + return _callSuper(this, UpdateProps, arguments); | |
| 1198 | 918 | } |
| 1199 | - (0, _inherits2.default)(AtomicElementEmptyView, _Marionette$ItemView); | |
| 1200 | - return (0, _createClass2.default)(AtomicElementEmptyView, [{ | |
| 1201 | - key: "renderReactDefaultElement", | |
| 1202 | - value: function renderReactDefaultElement(container) { | |
| 1203 | - var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, { | |
| 1204 | - container: container | |
| 1205 | - }), this.el), | |
| 1206 | - unmount = _ReactUtils$render.unmount; | |
| 1207 | - this.unmount = unmount; | |
| 1208 | - } | |
| 1209 | - }, { | |
| 1210 | - key: "onBeforeRender", | |
| 1211 | - value: function onBeforeRender() { | |
| 1212 | - // In case the element is being rendered again, we need to unmount the previous React component. | |
| 1213 | - if (this.unmount) { | |
| 1214 | - this.unmount(); | |
| 1215 | - this.unmount = null; | |
| 919 | + (0, _inherits2.default)(UpdateProps, _$e$modules$editor$Co); | |
| 920 | + return (0, _createClass2.default)(UpdateProps, [{ | |
| 921 | + key: "validateArgs", | |
| 922 | + value: function validateArgs(args) { | |
| 923 | + this.requireContainer(args); | |
| 924 | + this.requireArgumentConstructor('styleDefID', String, args); | |
| 925 | + this.requireArgumentConstructor('meta', Object, args); | |
| 926 | + this.requireArgumentConstructor('props', Object, args); | |
| 927 | + if (!('breakpoint' in args.meta && 'state' in args.meta)) { | |
| 928 | + throw new Error('Invalid meta arg'); | |
| 1216 | 929 | } |
| 930 | + if (0 === Object.keys(args.props).length) { | |
| 931 | + throw new Error('Props are empty'); | |
| 932 | + } | |
| 1217 | 933 | } |
| 1218 | 934 | }, { |
| 1219 | - key: "onRender", | |
| 1220 | - value: function onRender() { | |
| 1221 | - this.$el.addClass(this.className); | |
| 1222 | - this.renderReactDefaultElement(); | |
| 935 | + key: "updateExistingVariant", | |
| 936 | + value: function updateExistingVariant(variant, props) { | |
| 937 | + Object.entries(props).forEach(function (_ref) { | |
| 938 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 939 | + key = _ref2[0], | |
| 940 | + value = _ref2[1]; | |
| 941 | + if (null === value || undefined === value) { | |
| 942 | + delete variant.props[key]; | |
| 943 | + return; | |
| 944 | + } | |
| 945 | + variant.props[key] = value; | |
| 946 | + }); | |
| 1223 | 947 | } |
| 1224 | 948 | }, { |
| 1225 | - key: "onDestroy", | |
| 1226 | - value: function onDestroy() { | |
| 1227 | - var _this$unmount; | |
| 1228 | - (_this$unmount = this.unmount) === null || _this$unmount === void 0 || _this$unmount.call(this); | |
| 949 | + key: "apply", | |
| 950 | + value: function apply(args) { | |
| 951 | + var container = args.container, | |
| 952 | + styleDefID = args.styleDefID, | |
| 953 | + meta = args.meta, | |
| 954 | + props = args.props; | |
| 955 | + var styles = container.model.get('styles') || {}; | |
| 956 | + var style = styles[styleDefID]; | |
| 957 | + if (!style) { | |
| 958 | + throw new Error('Style Def not found'); | |
| 959 | + } | |
| 960 | + var variant = (0, _getVariants.getVariantByMeta)(style.variants, meta); | |
| 961 | + if (!variant) { | |
| 962 | + throw new Error('Style Variant not found'); | |
| 963 | + } | |
| 964 | + this.updateExistingVariant(variant, props); | |
| 1229 | 965 | } |
| 1230 | 966 | }]); |
| 1231 | -}(Marionette.ItemView); | |
| 967 | +}($e.modules.editor.CommandContainerInternalBase); | |
| 968 | +var _default = exports["default"] = UpdateProps; | |
| 1232 | 969 | |
| 1233 | 970 | /***/ }), |
| 1234 | 971 | |
| 1235 | -/***/ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js": | |
| 1236 | -/*!*************************************************************************************!*\ | |
| 1237 | - !*** ../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js ***! | |
| 1238 | - \*************************************************************************************/ | |
| 972 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands/index.js": | |
| 973 | +/*!********************************************************************!*\ | |
| 974 | + !*** ../modules/atomic-widgets/assets/js/editor/commands/index.js ***! | |
| 975 | + \********************************************************************/ | |
| 1239 | 976 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1240 | 977 | |
| 1241 | 978 | "use strict"; |
| 979 | + | |
| 980 | + | |
| 981 | +Object.defineProperty(exports, "__esModule", ({ | |
| 982 | + value: true | |
| 983 | +})); | |
| 984 | +Object.defineProperty(exports, "Styles", ({ | |
| 985 | + enumerable: true, | |
| 986 | + get: function get() { | |
| 987 | + return _styles.Styles; | |
| 988 | + } | |
| 989 | +})); | |
| 990 | +var _styles = __webpack_require__(/*! ./styles */ "../modules/atomic-widgets/assets/js/editor/commands/styles.js"); | |
| 991 | + | |
| 992 | +/***/ }), | |
| 993 | + | |
| 994 | +/***/ "../modules/atomic-widgets/assets/js/editor/commands/styles.js": | |
| 995 | +/*!*********************************************************************!*\ | |
| 996 | + !*** ../modules/atomic-widgets/assets/js/editor/commands/styles.js ***! | |
| 997 | + \*********************************************************************/ | |
| 998 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 999 | + | |
| 1000 | +"use strict"; | |
| 1242 | 1001 | /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; |
| 1243 | -/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; | |
| 1244 | 1002 | |
| 1245 | 1003 | |
| 1246 | 1004 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1247 | 1005 | Object.defineProperty(exports, "__esModule", ({ |
| @@ -1246,511 +1004,221 @@ | ||
| 1246 | 1004 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1247 | 1005 | Object.defineProperty(exports, "__esModule", ({ |
| 1248 | 1006 | value: true |
| 1249 | 1007 | })); |
| 1250 | -exports["default"] = createAtomicElementBaseView; | |
| 1251 | -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 1252 | -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 1253 | -var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 1254 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1255 | -var _elementTypes = __webpack_require__(/*! elementor-editor/utils/element-types */ "../assets/dev/js/editor/utils/element-types.js"); | |
| 1256 | -var _atomicElementEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/atomic-element-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js")); | |
| 1257 | -var BaseElementView = elementor.modules.elements.views.BaseElement; | |
| 1258 | -function createAtomicElementBaseView(type) { | |
| 1259 | - var AtomicElementView = BaseElementView.extend({ | |
| 1260 | - template: Marionette.TemplateCache.get("#tmpl-elementor-".concat(type, "-content")), | |
| 1261 | - emptyView: _atomicElementEmptyView.default, | |
| 1262 | - _childrenRenderPromises: [], | |
| 1263 | - _createElement: function _createElement(tag) { | |
| 1264 | - var _elementor$$preview; | |
| 1265 | - var previewDocument = (_elementor$$preview = elementor.$preview) === null || _elementor$$preview === void 0 || (_elementor$$preview = _elementor$$preview[0]) === null || _elementor$$preview === void 0 ? void 0 : _elementor$$preview.contentDocument; | |
| 1266 | - if (previewDocument) { | |
| 1267 | - return previewDocument.createElement(tag); | |
| 1008 | +exports["default"] = exports.Styles = void 0; | |
| 1009 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1010 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1011 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1012 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1013 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1014 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1015 | +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js"); | |
| 1016 | +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; } | |
| 1017 | +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; } | |
| 1018 | +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)); } | |
| 1019 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1020 | +/** | |
| 1021 | + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container | |
| 1022 | + */ | |
| 1023 | +var Styles = exports.Styles = /*#__PURE__*/function (_$e$modules$editor$do) { | |
| 1024 | + function Styles() { | |
| 1025 | + (0, _classCallCheck2.default)(this, Styles); | |
| 1026 | + return _callSuper(this, Styles, arguments); | |
| 1027 | + } | |
| 1028 | + (0, _inherits2.default)(Styles, _$e$modules$editor$do); | |
| 1029 | + return (0, _createClass2.default)(Styles, [{ | |
| 1030 | + key: "validateArgs", | |
| 1031 | + value: function validateArgs(args) { | |
| 1032 | + this.requireContainer(args); | |
| 1033 | + if (!args.bind && !args.styleDefID) { | |
| 1034 | + throw new Error('Missing bind or styleDefID'); | |
| 1268 | 1035 | } |
| 1269 | - return document.createElement(tag); | |
| 1270 | - }, | |
| 1271 | - getChildViewContainer: function getChildViewContainer() { | |
| 1272 | - this.childViewContainer = ''; | |
| 1273 | - return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments); | |
| 1274 | - }, | |
| 1275 | - getChildType: function getChildType() { | |
| 1276 | - var atomicElements = Object.entries(elementor.config.elements).filter(function (_ref) { | |
| 1277 | - var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 1278 | - element = _ref2[1]; | |
| 1279 | - return !!(element !== null && element !== void 0 && element.atomic_props_schema); | |
| 1280 | - }).map(function (_ref3) { | |
| 1281 | - var _ref4 = (0, _slicedToArray2.default)(_ref3, 1), | |
| 1282 | - elType = _ref4[0]; | |
| 1283 | - return elType; | |
| 1284 | - }); | |
| 1285 | - return ['widget', 'container'].concat((0, _toConsumableArray2.default)(atomicElements)); | |
| 1286 | - }, | |
| 1287 | - getRenderContext: function getRenderContext() { | |
| 1288 | - var _this$_parent, _this$_parent$getRend; | |
| 1289 | - return (_this$_parent = this._parent) === null || _this$_parent === void 0 || (_this$_parent$getRend = _this$_parent.getRenderContext) === null || _this$_parent$getRend === void 0 ? void 0 : _this$_parent$getRend.call(_this$_parent); | |
| 1290 | - }, | |
| 1291 | - getResolverRenderContext: function getResolverRenderContext() { | |
| 1292 | - var _this$_parent2, _this$_parent2$getRes; | |
| 1293 | - return (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || (_this$_parent2$getRes = _this$_parent2.getResolverRenderContext) === null || _this$_parent2$getRes === void 0 ? void 0 : _this$_parent2$getRes.call(_this$_parent2); | |
| 1294 | - }, | |
| 1295 | - render: function render() { | |
| 1296 | - var _this = this; | |
| 1297 | - this._currentRenderPromise = new Promise(function (resolve) { | |
| 1298 | - // Optimize rendering by reusing existing child views instead of recreating them. | |
| 1299 | - if (_this._shouldSkipFullRender()) { | |
| 1300 | - _this._renderWithoutDomRecreation(resolve); | |
| 1301 | - } else { | |
| 1302 | - _this._renderWithDomRecreation(resolve); | |
| 1303 | - } | |
| 1304 | - }); | |
| 1305 | - return this; | |
| 1306 | - }, | |
| 1307 | - _shouldSkipFullRender: function _shouldSkipFullRender() { | |
| 1308 | - return this.isRendered && this._hasConnectedChildren(); | |
| 1309 | - }, | |
| 1310 | - _hasConnectedChildren: function _hasConnectedChildren() { | |
| 1311 | - var _this$children, _firstChild$$el$get$i, _firstChild$$el; | |
| 1312 | - if (!((_this$children = this.children) !== null && _this$children !== void 0 && _this$children.length)) { | |
| 1313 | - return false; | |
| 1036 | + if (args.bind && 'string' !== typeof args.bind) { | |
| 1037 | + throw new Error('Invalid bind arg'); | |
| 1314 | 1038 | } |
| 1315 | - | |
| 1316 | - // If the parent's innerHTML was replaced, all children are detached together. | |
| 1317 | - var firstChild = this.children.findByIndex(0); | |
| 1318 | - return (_firstChild$$el$get$i = firstChild === null || firstChild === void 0 || (_firstChild$$el = firstChild.$el) === null || _firstChild$$el === void 0 || (_firstChild$$el = _firstChild$$el.get(0)) === null || _firstChild$$el === void 0 ? void 0 : _firstChild$$el.isConnected) !== null && _firstChild$$el$get$i !== void 0 ? _firstChild$$el$get$i : false; | |
| 1319 | - }, | |
| 1320 | - _renderWithoutDomRecreation: function _renderWithoutDomRecreation(resolve) { | |
| 1321 | - var _this2 = this; | |
| 1322 | - this._beforeRender(); | |
| 1323 | - this._renderChildren(); | |
| 1324 | - this._waitForChildrenToComplete().then(function () { | |
| 1325 | - _this2._afterRender(); | |
| 1326 | - resolve(); | |
| 1327 | - }); | |
| 1328 | - }, | |
| 1329 | - _renderWithDomRecreation: function _renderWithDomRecreation(resolve) { | |
| 1330 | - BaseElementView.prototype.render.apply(this, arguments); | |
| 1331 | - this._waitForChildrenToComplete().then(function () { | |
| 1332 | - resolve(); | |
| 1333 | - }); | |
| 1334 | - }, | |
| 1335 | - _beforeRender: function _beforeRender() { | |
| 1336 | - this._isRendering = true; | |
| 1337 | - this.triggerMethod('before:render', this); | |
| 1338 | - }, | |
| 1339 | - _afterRender: function _afterRender() { | |
| 1340 | - this._isRendering = false; | |
| 1341 | - this.isRendered = true; | |
| 1342 | - this.triggerMethod('render', this); | |
| 1343 | - }, | |
| 1344 | - _waitForChildrenToComplete: function _waitForChildrenToComplete() { | |
| 1345 | - var _this3 = this; | |
| 1346 | - return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 1347 | - return _regenerator.default.wrap(function (_context) { | |
| 1348 | - while (1) switch (_context.prev = _context.next) { | |
| 1349 | - case 0: | |
| 1350 | - if (!(_this3._childrenRenderPromises.length > 0)) { | |
| 1351 | - _context.next = 1; | |
| 1352 | - break; | |
| 1353 | - } | |
| 1354 | - _context.next = 1; | |
| 1355 | - return Promise.all(_this3._childrenRenderPromises); | |
| 1356 | - case 1: | |
| 1357 | - case "end": | |
| 1358 | - return _context.stop(); | |
| 1359 | - } | |
| 1360 | - }, _callee); | |
| 1361 | - }))(); | |
| 1362 | - }, | |
| 1363 | - _renderChildren: function _renderChildren() { | |
| 1364 | - if (this._shouldSkipFullRender()) { | |
| 1365 | - var _this$children2; | |
| 1366 | - (_this$children2 = this.children) === null || _this$children2 === void 0 || _this$children2.each(function (childView) { | |
| 1367 | - return childView.render(); | |
| 1368 | - }); | |
| 1369 | - } else { | |
| 1370 | - BaseElementView.prototype._renderChildren.apply(this, arguments); | |
| 1039 | + if (args.styleDefID && 'string' !== typeof args.styleDefID) { | |
| 1040 | + throw new Error('Invalid styleDefID arg'); | |
| 1371 | 1041 | } |
| 1372 | - this._collectChildrenRenderPromises(); | |
| 1373 | - }, | |
| 1374 | - _collectChildrenRenderPromises: function _collectChildrenRenderPromises() { | |
| 1375 | - var _this$children3, | |
| 1376 | - _this4 = this; | |
| 1377 | - this._childrenRenderPromises = []; | |
| 1378 | - (_this$children3 = this.children) === null || _this$children3 === void 0 || _this$children3.each(function (childView) { | |
| 1379 | - if (childView._currentRenderPromise) { | |
| 1380 | - _this4._childrenRenderPromises.push(childView._currentRenderPromise); | |
| 1381 | - } | |
| 1382 | - }); | |
| 1383 | - }, | |
| 1384 | - onRender: function onRender() { | |
| 1385 | - var _this5 = this; | |
| 1386 | - this.dispatchPreviewEvent('elementor/element/render'); | |
| 1387 | - BaseElementView.prototype.onRender.apply(this, arguments); | |
| 1042 | + } | |
| 1388 | 1043 | |
| 1389 | - // Defer to wait for everything to render. | |
| 1390 | - setTimeout(function () { | |
| 1391 | - if (_this5.isAtomicGridContainer()) { | |
| 1392 | - _this5.reInitEmptyView(); | |
| 1393 | - } | |
| 1394 | - _this5.droppableInitialize(); | |
| 1395 | - _this5.updateHandlesPosition(); | |
| 1396 | - }); | |
| 1397 | - }, | |
| 1398 | - destroyEmptyView: function destroyEmptyView() { | |
| 1399 | - if (this.isAtomicGridContainer()) { | |
| 1400 | - return; | |
| 1401 | - } | |
| 1402 | - return Marionette.CompositeView.prototype.destroyEmptyView.apply(this, arguments); | |
| 1403 | - }, | |
| 1404 | - isAtomicGridContainer: function isAtomicGridContainer() { | |
| 1405 | - return 'e-grid' === type; | |
| 1406 | - }, | |
| 1407 | - reInitEmptyView: function reInitEmptyView() { | |
| 1408 | - var _this$el; | |
| 1409 | - if ((_this$el = this.el) !== null && _this$el !== void 0 && _this$el.querySelector(':scope > .elementor-empty-view')) { | |
| 1410 | - return; | |
| 1411 | - } | |
| 1412 | - delete this._showingEmptyView; | |
| 1413 | - this.showEmptyView(); | |
| 1414 | - }, | |
| 1415 | - onDestroy: function onDestroy() { | |
| 1416 | - BaseElementView.prototype.onDestroy.apply(this, arguments); | |
| 1417 | - this.dispatchPreviewEvent('elementor/element/destroy'); | |
| 1418 | - }, | |
| 1419 | - dispatchPreviewEvent: function dispatchPreviewEvent(eventType) { | |
| 1420 | - var _elementor; | |
| 1421 | - (_elementor = elementor) === null || _elementor === void 0 || (_elementor = _elementor.$preview) === null || _elementor === void 0 || (_elementor = _elementor[0]) === null || _elementor === void 0 || _elementor.contentWindow.dispatchEvent(new CustomEvent(eventType, { | |
| 1422 | - detail: { | |
| 1423 | - id: this.model.get('id'), | |
| 1424 | - type: this.model.get('elType'), | |
| 1425 | - element: this.getDomElement().get(0) | |
| 1426 | - } | |
| 1427 | - })); | |
| 1428 | - }, | |
| 1429 | - droppableInitialize: function droppableInitialize() { | |
| 1430 | - this.$el.html5Droppable(this.getDroppableOptions()); | |
| 1431 | - }, | |
| 1432 | 1044 | /** |
| 1433 | - * Add a `Save as a Template` button to the context menu. | |
| 1045 | + * Function restore(). | |
| 1434 | 1046 | * |
| 1435 | - * @return {Object} groups | |
| 1047 | + * Redo/Restore. | |
| 1048 | + * | |
| 1049 | + * @param {{}} historyItem | |
| 1050 | + * @param {boolean} isRedo | |
| 1436 | 1051 | */ |
| 1437 | - getContextMenuGroups: function getContextMenuGroups() { | |
| 1438 | - var _this6 = this, | |
| 1439 | - _elementorCommon$conf; | |
| 1440 | - var saveActions = [{ | |
| 1441 | - name: 'save', | |
| 1442 | - title: __('Save as a template', 'elementor'), | |
| 1443 | - callback: this.saveAsTemplate.bind(this), | |
| 1444 | - isEnabled: function isEnabled() { | |
| 1445 | - return !_this6.getContainer().isLocked(); | |
| 1446 | - } | |
| 1447 | - }]; | |
| 1448 | - var isAdministrator = elementor.config.user.is_administrator; | |
| 1449 | - var isExperimentalFeaturesEnabled = (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.e_components; | |
| 1450 | - if (isExperimentalFeaturesEnabled && isAdministrator) { | |
| 1451 | - var _window$elementorV2$u, _window$elementorV, _window$elementorV$is, _window$elementorV2$u2, _window$elementorV2, _window$elementorV2$h, _window$elementorV2$u3, _window$elementorV3, _window$elementorV3$i; | |
| 1452 | - var isProActive = (_window$elementorV2$u = (_window$elementorV = window.elementorV2) === null || _window$elementorV === void 0 || (_window$elementorV = _window$elementorV.utils) === null || _window$elementorV === void 0 || (_window$elementorV$is = _window$elementorV.isProActive) === null || _window$elementorV$is === void 0 ? void 0 : _window$elementorV$is.call(_window$elementorV)) !== null && _window$elementorV2$u !== void 0 ? _window$elementorV2$u : true; | |
| 1453 | - var hasProInstalled = (_window$elementorV2$u2 = (_window$elementorV2 = window.elementorV2) === null || _window$elementorV2 === void 0 || (_window$elementorV2 = _window$elementorV2.utils) === null || _window$elementorV2 === void 0 || (_window$elementorV2$h = _window$elementorV2.hasProInstalled) === null || _window$elementorV2$h === void 0 ? void 0 : _window$elementorV2$h.call(_window$elementorV2)) !== null && _window$elementorV2$u2 !== void 0 ? _window$elementorV2$u2 : false; | |
| 1454 | - var isProOutdated = hasProInstalled && !((_window$elementorV2$u3 = (_window$elementorV3 = window.elementorV2) === null || _window$elementorV3 === void 0 || (_window$elementorV3 = _window$elementorV3.utils) === null || _window$elementorV3 === void 0 || (_window$elementorV3$i = _window$elementorV3.isProAtLeast) === null || _window$elementorV3$i === void 0 ? void 0 : _window$elementorV3$i.call(_window$elementorV3, '4.0')) !== null && _window$elementorV2$u3 !== void 0 ? _window$elementorV2$u3 : false); | |
| 1455 | - var showPromoBadge = !isProActive && !isProOutdated; | |
| 1456 | - var newBadge = "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>"); | |
| 1457 | - var badgeClass = 'elementor-context-menu-list__item__shortcut__promotion-badge'; | |
| 1458 | - var proBadge = "<a href=\"https://go.elementor.com/go-pro-components-Instance-create-context-menu/\" target=\"_blank\" onclick=\"event.stopPropagation()\" class=\"".concat(badgeClass, "\"><i class=\"eicon-upgrade-crown\"></i></a>"); | |
| 1459 | - saveActions.unshift({ | |
| 1460 | - name: 'save-component', | |
| 1461 | - title: __('Create component', 'elementor'), | |
| 1462 | - shortcut: isProActive || isProOutdated ? newBadge : proBadge, | |
| 1463 | - hasShortcutAction: showPromoBadge, | |
| 1464 | - callback: this.saveAsComponent.bind(this), | |
| 1465 | - isEnabled: function isEnabled() { | |
| 1466 | - return (isProActive || isProOutdated) && !_this6.getContainer().isLocked(); | |
| 1467 | - } | |
| 1468 | - }); | |
| 1469 | - } | |
| 1470 | - var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), | |
| 1471 | - transferGroupClipboardIndex = groups.indexOf(_.findWhere(groups, { | |
| 1472 | - name: 'clipboard' | |
| 1473 | - })); | |
| 1474 | - groups.splice(transferGroupClipboardIndex + 1, 0, { | |
| 1475 | - name: 'save', | |
| 1476 | - actions: saveActions | |
| 1477 | - }); | |
| 1478 | - return groups; | |
| 1479 | - }, | |
| 1480 | - saveAsTemplate: function saveAsTemplate() { | |
| 1481 | - elementor.templates.eventManager.sendNewSaveTemplateClickedEvent(); | |
| 1482 | - $e.route('library/save-template', { | |
| 1483 | - model: this.model | |
| 1484 | - }); | |
| 1485 | - }, | |
| 1486 | - saveAsComponent: function saveAsComponent(openContextMenuEvent, options) { | |
| 1487 | - var _window$elementorV2$u4, _window$elementorV4, _window$elementorV4$h, _window$elementorV2$u5, _window$elementorV5, _window$elementorV5$i, _window$elementorV2$u6, _window$elementorV7, _window$elementorV7$i; | |
| 1488 | - var hasProInstalled = (_window$elementorV2$u4 = (_window$elementorV4 = window.elementorV2) === null || _window$elementorV4 === void 0 || (_window$elementorV4 = _window$elementorV4.utils) === null || _window$elementorV4 === void 0 || (_window$elementorV4$h = _window$elementorV4.hasProInstalled) === null || _window$elementorV4$h === void 0 ? void 0 : _window$elementorV4$h.call(_window$elementorV4)) !== null && _window$elementorV2$u4 !== void 0 ? _window$elementorV2$u4 : false; | |
| 1489 | - var isProOutdated = hasProInstalled && !((_window$elementorV2$u5 = (_window$elementorV5 = window.elementorV2) === null || _window$elementorV5 === void 0 || (_window$elementorV5 = _window$elementorV5.utils) === null || _window$elementorV5 === void 0 || (_window$elementorV5$i = _window$elementorV5.isProAtLeast) === null || _window$elementorV5$i === void 0 ? void 0 : _window$elementorV5$i.call(_window$elementorV5, '4.0')) !== null && _window$elementorV2$u5 !== void 0 ? _window$elementorV2$u5 : false); | |
| 1490 | - if (isProOutdated) { | |
| 1491 | - var _window$elementorV6, _window$elementorV6$n; | |
| 1492 | - (_window$elementorV6 = window.elementorV2) === null || _window$elementorV6 === void 0 || (_window$elementorV6 = _window$elementorV6.editorNotifications) === null || _window$elementorV6 === void 0 || (_window$elementorV6$n = _window$elementorV6.notify) === null || _window$elementorV6$n === void 0 || _window$elementorV6$n.call(_window$elementorV6, { | |
| 1493 | - type: 'info', | |
| 1494 | - id: 'component-create-update', | |
| 1495 | - message: __('To create new components, update Elementor Pro to the latest version.', 'elementor'), | |
| 1496 | - additionalActionProps: [{ | |
| 1497 | - size: 'small', | |
| 1498 | - variant: 'contained', | |
| 1499 | - color: 'info', | |
| 1500 | - href: '/wp-admin/plugins.php', | |
| 1501 | - target: '_blank', | |
| 1502 | - children: __('Update Now', 'elementor') | |
| 1503 | - }] | |
| 1504 | - }); | |
| 1505 | - return; | |
| 1506 | - } | |
| 1507 | - var isProActive = (_window$elementorV2$u6 = (_window$elementorV7 = window.elementorV2) === null || _window$elementorV7 === void 0 || (_window$elementorV7 = _window$elementorV7.utils) === null || _window$elementorV7 === void 0 || (_window$elementorV7$i = _window$elementorV7.isProActive) === null || _window$elementorV7$i === void 0 ? void 0 : _window$elementorV7$i.call(_window$elementorV7)) !== null && _window$elementorV2$u6 !== void 0 ? _window$elementorV2$u6 : true; | |
| 1508 | - if (!isProActive) { | |
| 1509 | - return; | |
| 1510 | - } | |
| 1511 | - | |
| 1512 | - // Calculate the absolute position where the context menu was opened. | |
| 1513 | - var openMenuOriginalEvent = openContextMenuEvent.originalEvent; | |
| 1514 | - var iframeRect = elementor.$preview[0].getBoundingClientRect(); | |
| 1515 | - var anchorPosition = { | |
| 1516 | - left: openMenuOriginalEvent.clientX + iframeRect.left, | |
| 1517 | - top: openMenuOriginalEvent.clientY + iframeRect.top | |
| 1518 | - }; | |
| 1519 | - window.dispatchEvent(new CustomEvent('elementor/editor/open-save-as-component-form', { | |
| 1520 | - detail: { | |
| 1521 | - element: elementor.getContainer(this.model.id).model.toJSON({ | |
| 1522 | - remove: ['default'] | |
| 1523 | - }), | |
| 1524 | - anchorPosition: anchorPosition, | |
| 1525 | - options: options | |
| 1526 | - } | |
| 1527 | - })); | |
| 1528 | - }, | |
| 1529 | - isDroppingAllowed: function isDroppingAllowed() { | |
| 1530 | - return this.getContainer().isEditable(); | |
| 1531 | - }, | |
| 1532 | - behaviors: function behaviors() { | |
| 1533 | - var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); | |
| 1534 | - _.extend(behaviors, { | |
| 1535 | - Sortable: { | |
| 1536 | - behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"), | |
| 1537 | - elChildType: 'widget' | |
| 1538 | - } | |
| 1539 | - }); | |
| 1540 | - return elementor.hooks.applyFilters("elements/".concat(type, "/behaviors"), behaviors, this); | |
| 1541 | - }, | |
| 1052 | + }, { | |
| 1053 | + key: "addToHistory", | |
| 1054 | + value: | |
| 1542 | 1055 | /** |
| 1543 | - * @return {{}} options | |
| 1056 | + * Function addToHistory(). | |
| 1057 | + * | |
| 1058 | + * @param {Container} container | |
| 1059 | + * @param {string} bind | |
| 1060 | + * @param {string} styleDefID | |
| 1061 | + * @param {{}} meta | |
| 1062 | + * @param {{}} props | |
| 1063 | + * @param {{}} oldProps | |
| 1064 | + * @param {string|undefined} label | |
| 1544 | 1065 | */ |
| 1545 | - getSortableOptions: function getSortableOptions() { | |
| 1066 | + function addToHistory(container, bind, styleDefID, meta, props, oldProps, label) { | |
| 1067 | + var newPropsEmpty = Object.keys(props).reduce(function (emptyValues, key) { | |
| 1068 | + emptyValues[key] = undefined; | |
| 1069 | + return emptyValues; | |
| 1070 | + }, {}); | |
| 1071 | + var changes = (0, _defineProperty2.default)({}, container.id, { | |
| 1072 | + bind: bind, | |
| 1073 | + styleDefID: styleDefID, | |
| 1074 | + meta: meta, | |
| 1075 | + label: label, | |
| 1076 | + old: { | |
| 1077 | + props: _objectSpread(_objectSpread({}, newPropsEmpty), oldProps) | |
| 1078 | + }, | |
| 1079 | + new: { | |
| 1080 | + props: props | |
| 1081 | + } | |
| 1082 | + }), | |
| 1083 | + historyItem = { | |
| 1084 | + container: container, | |
| 1085 | + data: { | |
| 1086 | + changes: changes | |
| 1087 | + }, | |
| 1088 | + type: 'change', | |
| 1089 | + restore: Styles.restore | |
| 1090 | + }; | |
| 1091 | + $e.internal('document/history/add-transaction', historyItem); | |
| 1092 | + } | |
| 1093 | + }, { | |
| 1094 | + key: "getHistory", | |
| 1095 | + value: function getHistory(args) { | |
| 1096 | + var container = args.container, | |
| 1097 | + subTitle = this.constructor.getSubTitle(args); | |
| 1546 | 1098 | return { |
| 1547 | - preventInit: true | |
| 1099 | + container: container, | |
| 1100 | + subTitle: subTitle, | |
| 1101 | + type: 'change' | |
| 1548 | 1102 | }; |
| 1549 | - }, | |
| 1550 | - getDroppableOptions: function getDroppableOptions() { | |
| 1551 | - var _this7 = this; | |
| 1552 | - var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add'; | |
| 1553 | - return { | |
| 1554 | - axis: this.isAtomicGridContainer() ? 'vertical' : null, | |
| 1555 | - items: items, | |
| 1556 | - groups: ['elementor-element'], | |
| 1557 | - horizontalThreshold: 0, | |
| 1558 | - isDroppingAllowed: this.isDroppingAllowed.bind(this), | |
| 1559 | - currentElementClass: 'elementor-html5dnd-current-element', | |
| 1560 | - placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder', | |
| 1561 | - hasDraggingOnChildClass: 'e-dragging-over', | |
| 1562 | - getDropContainer: function getDropContainer() { | |
| 1563 | - return _this7.getContainer(); | |
| 1564 | - }, | |
| 1565 | - onDropping: function onDropping(side, event) { | |
| 1566 | - event.stopPropagation(); | |
| 1103 | + } | |
| 1104 | + }, { | |
| 1105 | + key: "apply", | |
| 1106 | + value: function apply(args) { | |
| 1107 | + var _args$styleDefID, _container$model$get; | |
| 1108 | + var container = args.container; | |
| 1109 | + var bind = args.bind, | |
| 1110 | + meta = args.meta, | |
| 1111 | + props = args.props, | |
| 1112 | + label = args.label; | |
| 1113 | + container = container.lookup(); | |
| 1114 | + var styleDefID = (_args$styleDefID = args.styleDefID) !== null && _args$styleDefID !== void 0 ? _args$styleDefID : null; | |
| 1115 | + var currentStyle = (_container$model$get = container.model.get('styles')) !== null && _container$model$get !== void 0 ? _container$model$get : {}; | |
| 1567 | 1116 | |
| 1568 | - // Triggering the drag end manually, since it won't fire above the iframe | |
| 1569 | - elementor.getPreviewView().onPanelElementDragEnd(); | |
| 1570 | - var draggedView = elementor.channels.editor.request('element:dragged'), | |
| 1571 | - draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el, | |
| 1572 | - isEmptyViewTarget = _this7.emptyViewIsCurrentlyBeingDraggedOver(), | |
| 1573 | - containerElement = isEmptyViewTarget ? _this7.el : event.currentTarget.parentElement, | |
| 1574 | - elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []); | |
| 1575 | - var targetIndex = isEmptyViewTarget ? elements.length : elements.indexOf(event.currentTarget); | |
| 1576 | - if (_this7.isPanelElement(draggedView, draggedElement)) { | |
| 1577 | - if (_this7.draggingOnBottomOrRightSide(side) && !isEmptyViewTarget) { | |
| 1578 | - targetIndex++; | |
| 1579 | - } | |
| 1580 | - _this7.onDrop(event, { | |
| 1581 | - at: targetIndex | |
| 1582 | - }); | |
| 1583 | - return; | |
| 1584 | - } | |
| 1585 | - if (_this7.isParentElement(draggedView.getContainer().id)) { | |
| 1586 | - return; | |
| 1587 | - } | |
| 1588 | - if (isEmptyViewTarget) { | |
| 1589 | - _this7.moveDroppedItem(draggedView, targetIndex); | |
| 1590 | - return; | |
| 1591 | - } | |
| 1592 | - _this7.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement); | |
| 1593 | - } | |
| 1594 | - }; | |
| 1595 | - }, | |
| 1596 | - moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) { | |
| 1597 | - var selfIndex = elements.indexOf(draggedElement); | |
| 1598 | - if (targetIndex === selfIndex) { | |
| 1599 | - return; | |
| 1117 | + // Saving a deep clone of the style before it mutates, as part of this command | |
| 1118 | + var oldStyle = this.isHistoryActive() ? structuredClone(currentStyle) : null; | |
| 1119 | + var style = {}; | |
| 1120 | + if (!styleDefID) { | |
| 1121 | + // Create a new style definition for the first time | |
| 1122 | + style = $e.internal('document/atomic-widgets/create-style', { | |
| 1123 | + label: label, | |
| 1124 | + container: container, | |
| 1125 | + bind: bind | |
| 1126 | + }); | |
| 1127 | + styleDefID = style.id; | |
| 1128 | + } else if (!currentStyle[styleDefID]) { | |
| 1129 | + // Create a new style definition with the given ID | |
| 1130 | + // used when the style is deleted and then re-applied (i.e. history undo/redo) | |
| 1131 | + style = $e.internal('document/atomic-widgets/create-style', { | |
| 1132 | + label: label, | |
| 1133 | + container: container, | |
| 1134 | + styleDefID: styleDefID, | |
| 1135 | + bind: bind | |
| 1136 | + }); | |
| 1137 | + } else { | |
| 1138 | + // Use the existing style definition | |
| 1139 | + style = currentStyle[styleDefID]; | |
| 1600 | 1140 | } |
| 1601 | - var dropIndex = this.getDropIndex(containerElement, side, targetIndex, selfIndex); | |
| 1602 | - this.moveDroppedItem(draggedView, dropIndex); | |
| 1603 | - }, | |
| 1604 | - isPanelElement: function isPanelElement(draggedView, draggedElement) { | |
| 1605 | - return !draggedView || !draggedElement; | |
| 1606 | - }, | |
| 1607 | - isParentElement: function isParentElement(draggedId) { | |
| 1608 | - var current = this.container; | |
| 1609 | - while (current) { | |
| 1610 | - if (current.id === draggedId) { | |
| 1611 | - return true; | |
| 1612 | - } | |
| 1613 | - current = current.parent; | |
| 1141 | + var currentVariant = (0, _getVariants.getVariantByMeta)(style.variants, meta); | |
| 1142 | + if (!currentVariant) { | |
| 1143 | + $e.internal('document/atomic-widgets/create-variant', { | |
| 1144 | + container: container, | |
| 1145 | + styleDefID: styleDefID, | |
| 1146 | + meta: meta | |
| 1147 | + }); | |
| 1614 | 1148 | } |
| 1615 | - return false; | |
| 1616 | - }, | |
| 1617 | - getDropIndex: function getDropIndex(container, side, index, selfIndex) { | |
| 1618 | - var styles = window.getComputedStyle(container); | |
| 1619 | - var isFlex = ['flex', 'inline-flex'].includes(styles.display); | |
| 1620 | - var isFlexReverse = isFlex && ['column-reverse', 'row-reverse'].includes(styles.flexDirection); | |
| 1621 | - var isRow = isFlex && ['row-reverse', 'row'].includes(styles.flexDirection); | |
| 1622 | - var isRtl = elementorCommon.config.isRTL; | |
| 1623 | - var isReverse = isRow ? isFlexReverse !== isRtl : isFlexReverse; | |
| 1624 | - | |
| 1625 | - // The element should be placed BEFORE the current target | |
| 1626 | - // if is reversed + side is bottom/right OR not is reversed + side is top/left | |
| 1627 | - if (isReverse === this.draggingOnBottomOrRightSide(side)) { | |
| 1628 | - if (-1 === selfIndex || selfIndex >= index - 1) { | |
| 1629 | - return index; | |
| 1630 | - } | |
| 1631 | - return index > 0 ? index - 1 : 0; | |
| 1632 | - } | |
| 1633 | - if (0 <= selfIndex && selfIndex < index) { | |
| 1634 | - return index; | |
| 1635 | - } | |
| 1636 | - return index + 1; | |
| 1637 | - }, | |
| 1638 | - moveDroppedItem: function moveDroppedItem(draggedView, dropIndex) { | |
| 1639 | - // Reset the dragged element cache. | |
| 1640 | - elementor.channels.editor.reply('element:dragged', null); | |
| 1641 | - $e.run('document/elements/move', { | |
| 1642 | - container: draggedView.getContainer(), | |
| 1643 | - target: this.getContainer(), | |
| 1644 | - options: { | |
| 1645 | - at: dropIndex | |
| 1646 | - } | |
| 1149 | + var nonEmptyValues = Object.values(_objectSpread(_objectSpread({}, currentVariant === null || currentVariant === void 0 ? void 0 : currentVariant.props), props)).filter(function (value) { | |
| 1150 | + return value !== undefined; | |
| 1647 | 1151 | }); |
| 1648 | - }, | |
| 1649 | - getEditButtons: function getEditButtons() { | |
| 1650 | - var elementData = elementor.getElementData(this.model), | |
| 1651 | - editTools = {}; | |
| 1652 | - if ($e.components.get('document/elements').utils.allowAddingWidgets()) { | |
| 1653 | - editTools.add = { | |
| 1654 | - /* Translators: %s: Element Name. */ | |
| 1655 | - title: sprintf(__('Add %s', 'elementor'), elementData.title), | |
| 1656 | - icon: 'plus' | |
| 1657 | - }; | |
| 1658 | - editTools.edit = { | |
| 1659 | - /* Translators: %s: Element Name. */ | |
| 1660 | - title: sprintf(__('Edit %s', 'elementor'), elementData.title), | |
| 1661 | - icon: 'handle' | |
| 1662 | - }; | |
| 1663 | - } | |
| 1664 | - if (!this.getContainer().isLocked()) { | |
| 1665 | - if (elementor.getPreferences('edit_buttons') && $e.components.get('document/elements').utils.allowAddingWidgets()) { | |
| 1666 | - editTools.duplicate = { | |
| 1667 | - /* Translators: %s: Element Name. */ | |
| 1668 | - title: sprintf(__('Duplicate %s', 'elementor'), elementData.title), | |
| 1669 | - icon: 'clone' | |
| 1670 | - }; | |
| 1152 | + if (0 === nonEmptyValues.length) { | |
| 1153 | + // Doesn't have any props to use for this variant | |
| 1154 | + $e.internal('document/atomic-widgets/delete-variant', { | |
| 1155 | + container: container, | |
| 1156 | + styleDefID: styleDefID, | |
| 1157 | + meta: meta | |
| 1158 | + }); | |
| 1159 | + var newStyles = container.model.get('styles'); | |
| 1160 | + var newVariants = newStyles[styleDefID].variants; | |
| 1161 | + if (0 === newVariants.length) { | |
| 1162 | + // After deleting the variant, there are no variants left | |
| 1163 | + $e.internal('document/atomic-widgets/delete-style', { | |
| 1164 | + container: container, | |
| 1165 | + styleDefID: styleDefID, | |
| 1166 | + bind: bind | |
| 1167 | + }); | |
| 1671 | 1168 | } |
| 1672 | - editTools.remove = { | |
| 1673 | - /* Translators: %s: Element Name. */ | |
| 1674 | - title: sprintf(__('Delete %s', 'elementor'), elementData.title), | |
| 1675 | - icon: 'close' | |
| 1676 | - }; | |
| 1169 | + } else { | |
| 1170 | + // Has valid props in the current variant | |
| 1171 | + $e.internal('document/atomic-widgets/update-props', { | |
| 1172 | + container: container, | |
| 1173 | + styleDefID: styleDefID, | |
| 1174 | + bind: bind, | |
| 1175 | + meta: meta, | |
| 1176 | + props: props | |
| 1177 | + }); | |
| 1677 | 1178 | } |
| 1678 | - return editTools; | |
| 1679 | - }, | |
| 1680 | - draggingOnBottomOrRightSide: function draggingOnBottomOrRightSide(side) { | |
| 1681 | - return ['bottom', 'right'].includes(side); | |
| 1682 | - }, | |
| 1683 | - emptyViewIsCurrentlyBeingDraggedOver: function emptyViewIsCurrentlyBeingDraggedOver() { | |
| 1684 | - return this.$el.find('> .elementor-empty-view > .elementor-first-add.elementor-html5dnd-current-element').length > 0; | |
| 1685 | - }, | |
| 1686 | - /** | |
| 1687 | - * Toggle the `New Section` view when clicking the `add` button in the edit tools. | |
| 1688 | - * | |
| 1689 | - * @return {void} | |
| 1690 | - */ | |
| 1691 | - onAddButtonClick: function onAddButtonClick() { | |
| 1692 | - if (this.addSectionView && !this.addSectionView.isDestroyed) { | |
| 1693 | - this.addSectionView.fadeToDeath(); | |
| 1694 | - return; | |
| 1179 | + if (null !== oldStyle) { | |
| 1180 | + var _getVariantByMeta; | |
| 1181 | + var oldStyleDef = oldStyle[styleDefID]; | |
| 1182 | + var oldProps = oldStyleDef !== null && oldStyleDef !== void 0 && oldStyleDef.variants ? (_getVariantByMeta = (0, _getVariants.getVariantByMeta)(oldStyleDef.variants, meta)) === null || _getVariantByMeta === void 0 ? void 0 : _getVariantByMeta.props : {}; | |
| 1183 | + this.addToHistory(container, bind, styleDefID, meta, props, oldProps, label); | |
| 1695 | 1184 | } |
| 1696 | - var addSectionView = new elementor.modules.elements.components.AddSectionView({ | |
| 1697 | - at: this.model.collection.indexOf(this.model) | |
| 1185 | + } | |
| 1186 | + }], [{ | |
| 1187 | + key: "getSubTitle", | |
| 1188 | + value: function getSubTitle() { | |
| 1189 | + return __('Style', 'elementor'); | |
| 1190 | + } | |
| 1191 | + }, { | |
| 1192 | + key: "restore", | |
| 1193 | + value: function restore(historyItem, isRedo) { | |
| 1194 | + var container = historyItem.get('container'); | |
| 1195 | + var changes = historyItem.get('data').changes[container.id]; | |
| 1196 | + var bind = changes.bind, | |
| 1197 | + styleDefID = changes.styleDefID, | |
| 1198 | + meta = changes.meta, | |
| 1199 | + label = changes.label; | |
| 1200 | + var _ref = isRedo ? changes.new : changes.old, | |
| 1201 | + props = _ref.props; | |
| 1202 | + $e.run('document/atomic-widgets/styles', { | |
| 1203 | + container: container, | |
| 1204 | + bind: bind, | |
| 1205 | + styleDefID: styleDefID, | |
| 1206 | + meta: meta, | |
| 1207 | + props: props, | |
| 1208 | + label: label | |
| 1698 | 1209 | }); |
| 1699 | - addSectionView.render(); | |
| 1700 | - this.$el.before(addSectionView.$el); | |
| 1701 | - addSectionView.$el.hide(); | |
| 1702 | - | |
| 1703 | - // Delaying the slide down for slow-render browsers (such as FF) | |
| 1704 | - setTimeout(function () { | |
| 1705 | - addSectionView.$el.slideDown(null, function () { | |
| 1706 | - // Remove inline style, for preview mode. | |
| 1707 | - jQuery(this).css('display', ''); | |
| 1708 | - }); | |
| 1709 | - }); | |
| 1710 | - this.addSectionView = addSectionView; | |
| 1711 | - }, | |
| 1712 | - isOverflowHidden: function isOverflowHidden() { | |
| 1713 | - var elementStyles = window.getComputedStyle(this.el); | |
| 1714 | - var overflowStyles = [elementStyles.overflowX, elementStyles.overflowY, elementStyles.overflow]; | |
| 1715 | - return overflowStyles.includes('hidden') || overflowStyles.includes('auto'); | |
| 1716 | - }, | |
| 1717 | - updateHandlesPosition: function updateHandlesPosition() { | |
| 1718 | - var elementType = this.$el.data('element_type'); | |
| 1719 | - var isElement = (0, _elementTypes.getAllElementTypes)().includes(elementType); | |
| 1720 | - if (!isElement) { | |
| 1721 | - return; | |
| 1722 | - } | |
| 1723 | - var shouldPlaceInside = this.isOverflowHidden(); | |
| 1724 | - if (!shouldPlaceInside && this.isTopLevelElement() && this.isFirstElementInStructure()) { | |
| 1725 | - shouldPlaceInside = true; | |
| 1726 | - } | |
| 1727 | - this.$el.toggleClass('e-handles-inside', shouldPlaceInside); | |
| 1728 | - }, | |
| 1729 | - isTopLevelElement: function isTopLevelElement() { | |
| 1730 | - return this.container.parent && 'document' === this.container.parent.id; | |
| 1731 | - }, | |
| 1732 | - isFirstElementInStructure: function isFirstElementInStructure() { | |
| 1733 | - if (!this.model.collection) { | |
| 1734 | - return true; | |
| 1735 | - } | |
| 1736 | - return 0 === this.model.collection.indexOf(this.model); | |
| 1737 | - }, | |
| 1738 | - getInteractionId: function getInteractionId() { | |
| 1739 | - var originId = this.model.get('originId'); | |
| 1740 | - var id = this.model.get('id'); | |
| 1741 | - return originId !== null && originId !== void 0 ? originId : id; | |
| 1742 | 1210 | } |
| 1743 | - }); | |
| 1744 | - return AtomicElementView; | |
| 1745 | -} | |
| 1211 | + }]); | |
| 1212 | +}($e.modules.editor.document.CommandHistoryDebounceBase); | |
| 1213 | +var _default = exports["default"] = Styles; | |
| 1746 | 1214 | |
| 1747 | 1215 | /***/ }), |
| 1748 | 1216 | |
| 1749 | -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js": | |
| 1750 | -/*!*************************************************************************************************************!*\ | |
| 1751 | - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js ***! | |
| 1752 | - \*************************************************************************************************************/ | |
| 1217 | +/***/ "../modules/atomic-widgets/assets/js/editor/component.js": | |
| 1218 | +/*!***************************************************************!*\ | |
| 1219 | + !*** ../modules/atomic-widgets/assets/js/editor/component.js ***! | |
| 1220 | + \***************************************************************/ | |
| 1753 | 1221 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1754 | 1222 | |
| 1755 | 1223 | "use strict"; |
| 1756 | 1224 | |
| @@ -1755,51 +1223,54 @@ | ||
| 1755 | 1223 | "use strict"; |
| 1756 | 1224 | |
| 1757 | 1225 | |
| 1758 | 1226 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1227 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1759 | 1228 | Object.defineProperty(exports, "__esModule", ({ |
| 1760 | 1229 | value: true |
| 1761 | 1230 | })); |
| 1762 | -exports.DuplicateElement = void 0; | |
| 1231 | +exports["default"] = void 0; | |
| 1763 | 1232 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1764 | 1233 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1765 | 1234 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1766 | 1235 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1767 | 1236 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1768 | -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js"); | |
| 1237 | +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/atomic-widgets/assets/js/editor/commands/index.js")); | |
| 1238 | +var commandsInternal = _interopRequireWildcard(__webpack_require__(/*! ./commands-internal/ */ "../modules/atomic-widgets/assets/js/editor/commands-internal/index.js")); | |
| 1239 | +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | |
| 1240 | +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | |
| 1769 | 1241 | 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)); } |
| 1770 | 1242 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1771 | -var DuplicateElement = exports.DuplicateElement = /*#__PURE__*/function (_$e$modules$hookData$) { | |
| 1772 | - function DuplicateElement() { | |
| 1773 | - (0, _classCallCheck2.default)(this, DuplicateElement); | |
| 1774 | - return _callSuper(this, DuplicateElement, arguments); | |
| 1243 | +var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) { | |
| 1244 | + function Component() { | |
| 1245 | + (0, _classCallCheck2.default)(this, Component); | |
| 1246 | + return _callSuper(this, Component, arguments); | |
| 1775 | 1247 | } |
| 1776 | - (0, _inherits2.default)(DuplicateElement, _$e$modules$hookData$); | |
| 1777 | - return (0, _createClass2.default)(DuplicateElement, [{ | |
| 1778 | - key: "getCommand", | |
| 1779 | - value: function getCommand() { | |
| 1780 | - return 'document/elements/duplicate'; | |
| 1248 | + (0, _inherits2.default)(Component, _$e$modules$Component); | |
| 1249 | + return (0, _createClass2.default)(Component, [{ | |
| 1250 | + key: "getNamespace", | |
| 1251 | + value: function getNamespace() { | |
| 1252 | + return 'document/atomic-widgets'; | |
| 1781 | 1253 | } |
| 1782 | 1254 | }, { |
| 1783 | - key: "getId", | |
| 1784 | - value: function getId() { | |
| 1785 | - return 'regenerate-local-style-ids--document/elements/duplicate'; | |
| 1255 | + key: "defaultCommands", | |
| 1256 | + value: function defaultCommands() { | |
| 1257 | + return this.importCommands(commands); | |
| 1786 | 1258 | } |
| 1787 | 1259 | }, { |
| 1788 | - key: "apply", | |
| 1789 | - value: function apply(args, result) { | |
| 1790 | - var containers = Array.isArray(result) ? result : [result]; | |
| 1791 | - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds); | |
| 1260 | + key: "defaultCommandsInternal", | |
| 1261 | + value: function defaultCommandsInternal() { | |
| 1262 | + return this.importCommands(commandsInternal); | |
| 1792 | 1263 | } |
| 1793 | 1264 | }]); |
| 1794 | -}($e.modules.hookData.After); | |
| 1265 | +}($e.modules.ComponentBase); | |
| 1795 | 1266 | |
| 1796 | 1267 | /***/ }), |
| 1797 | 1268 | |
| 1798 | -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js": | |
| 1799 | -/*!**********************************************************************************************************!*\ | |
| 1800 | - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js ***! | |
| 1801 | - \**********************************************************************************************************/ | |
| 1269 | +/***/ "../modules/atomic-widgets/assets/js/editor/container/div-block-empty-view.js": | |
| 1270 | +/*!************************************************************************************!*\ | |
| 1271 | + !*** ../modules/atomic-widgets/assets/js/editor/container/div-block-empty-view.js ***! | |
| 1272 | + \************************************************************************************/ | |
| 1802 | 1273 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1803 | 1274 | |
| 1804 | 1275 | "use strict"; |
| 1805 | 1276 | |
| @@ -1807,48 +1278,62 @@ | ||
| 1807 | 1278 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1808 | 1279 | Object.defineProperty(exports, "__esModule", ({ |
| 1809 | 1280 | value: true |
| 1810 | 1281 | })); |
| 1811 | -exports.ImportElement = void 0; | |
| 1282 | +exports["default"] = void 0; | |
| 1283 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1812 | 1284 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1813 | 1285 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1814 | 1286 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1815 | 1287 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1816 | 1288 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1817 | -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js"); | |
| 1289 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1290 | +var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js")); | |
| 1291 | +var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js")); | |
| 1818 | 1292 | 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)); } |
| 1819 | 1293 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1820 | -var ImportElement = exports.ImportElement = /*#__PURE__*/function (_$e$modules$hookData$) { | |
| 1821 | - function ImportElement() { | |
| 1822 | - (0, _classCallCheck2.default)(this, ImportElement); | |
| 1823 | - return _callSuper(this, ImportElement, arguments); | |
| 1294 | +var DivBlockEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) { | |
| 1295 | + function DivBlockEmptyView() { | |
| 1296 | + var _this; | |
| 1297 | + (0, _classCallCheck2.default)(this, DivBlockEmptyView); | |
| 1298 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 1299 | + args[_key] = arguments[_key]; | |
| 1300 | + } | |
| 1301 | + _this = _callSuper(this, DivBlockEmptyView, [].concat(args)); | |
| 1302 | + (0, _defineProperty2.default)(_this, "template", '<div></div>'); | |
| 1303 | + (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view'); | |
| 1304 | + return _this; | |
| 1824 | 1305 | } |
| 1825 | - (0, _inherits2.default)(ImportElement, _$e$modules$hookData$); | |
| 1826 | - return (0, _createClass2.default)(ImportElement, [{ | |
| 1827 | - key: "getCommand", | |
| 1828 | - value: function getCommand() { | |
| 1829 | - return 'document/elements/import'; | |
| 1306 | + (0, _inherits2.default)(DivBlockEmptyView, _Marionette$ItemView); | |
| 1307 | + return (0, _createClass2.default)(DivBlockEmptyView, [{ | |
| 1308 | + key: "renderReactDefaultElement", | |
| 1309 | + value: function renderReactDefaultElement(container) { | |
| 1310 | + var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, { | |
| 1311 | + container: container | |
| 1312 | + }), this.el), | |
| 1313 | + unmount = _ReactUtils$render.unmount; | |
| 1314 | + this.unmount = unmount; | |
| 1830 | 1315 | } |
| 1831 | 1316 | }, { |
| 1832 | - key: "getId", | |
| 1833 | - value: function getId() { | |
| 1834 | - return 'regenerate-local-style-ids--document/elements/import'; | |
| 1317 | + key: "onRender", | |
| 1318 | + value: function onRender() { | |
| 1319 | + this.$el.addClass(this.className); | |
| 1320 | + this.renderReactDefaultElement(); | |
| 1835 | 1321 | } |
| 1836 | 1322 | }, { |
| 1837 | - key: "apply", | |
| 1838 | - value: function apply(args, result) { | |
| 1839 | - var containers = Array.isArray(result) ? result : [result]; | |
| 1840 | - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds); | |
| 1323 | + key: "onDestroy", | |
| 1324 | + value: function onDestroy() { | |
| 1325 | + this.unmount(); | |
| 1841 | 1326 | } |
| 1842 | 1327 | }]); |
| 1843 | -}($e.modules.hookData.After); | |
| 1328 | +}(Marionette.ItemView); | |
| 1844 | 1329 | |
| 1845 | 1330 | /***/ }), |
| 1846 | 1331 | |
| 1847 | -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js": | |
| 1848 | -/*!*********************************************************************************************************!*\ | |
| 1849 | - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js ***! | |
| 1850 | - \*********************************************************************************************************/ | |
| 1332 | +/***/ "../modules/atomic-widgets/assets/js/editor/div-block-model.js": | |
| 1333 | +/*!*********************************************************************!*\ | |
| 1334 | + !*** ../modules/atomic-widgets/assets/js/editor/div-block-model.js ***! | |
| 1335 | + \*********************************************************************/ | |
| 1851 | 1336 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1852 | 1337 | |
| 1853 | 1338 | "use strict"; |
| 1854 | 1339 | |
| @@ -1856,111 +1341,339 @@ | ||
| 1856 | 1341 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1857 | 1342 | Object.defineProperty(exports, "__esModule", ({ |
| 1858 | 1343 | value: true |
| 1859 | 1344 | })); |
| 1860 | -exports.PasteElement = void 0; | |
| 1345 | +exports["default"] = void 0; | |
| 1861 | 1346 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1862 | 1347 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1863 | 1348 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1864 | 1349 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1865 | 1350 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1866 | -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js"); | |
| 1867 | 1351 | 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)); } |
| 1868 | 1352 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1869 | -var PasteElement = exports.PasteElement = /*#__PURE__*/function (_$e$modules$hookData$) { | |
| 1870 | - function PasteElement() { | |
| 1871 | - (0, _classCallCheck2.default)(this, PasteElement); | |
| 1872 | - return _callSuper(this, PasteElement, arguments); | |
| 1353 | +var AtomicContainer = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) { | |
| 1354 | + function AtomicContainer() { | |
| 1355 | + (0, _classCallCheck2.default)(this, AtomicContainer); | |
| 1356 | + return _callSuper(this, AtomicContainer, arguments); | |
| 1873 | 1357 | } |
| 1874 | - (0, _inherits2.default)(PasteElement, _$e$modules$hookData$); | |
| 1875 | - return (0, _createClass2.default)(PasteElement, [{ | |
| 1876 | - key: "getCommand", | |
| 1877 | - value: function getCommand() { | |
| 1878 | - return 'document/elements/paste'; | |
| 1358 | + (0, _inherits2.default)(AtomicContainer, _elementor$modules$el); | |
| 1359 | + return (0, _createClass2.default)(AtomicContainer, [{ | |
| 1360 | + key: "isValidChild", | |
| 1361 | + value: | |
| 1362 | + /** | |
| 1363 | + * Do not allow section, column or container be placed in the Atomic container. | |
| 1364 | + * | |
| 1365 | + * @param {*} childModel | |
| 1366 | + */ | |
| 1367 | + function isValidChild(childModel) { | |
| 1368 | + var elType = childModel.get('elType'); | |
| 1369 | + return 'section' !== elType && 'column' !== elType && 'container' !== elType; | |
| 1879 | 1370 | } |
| 1880 | - }, { | |
| 1881 | - key: "getId", | |
| 1882 | - value: function getId() { | |
| 1883 | - return 'regenerate-local-style-ids--document/elements/paste'; | |
| 1884 | - } | |
| 1885 | - }, { | |
| 1886 | - key: "apply", | |
| 1887 | - value: function apply(args, result) { | |
| 1888 | - var containers = Array.isArray(result) ? result : [result]; | |
| 1889 | - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds); | |
| 1890 | - } | |
| 1891 | 1371 | }]); |
| 1892 | -}($e.modules.hookData.After); | |
| 1372 | +}(elementor.modules.elements.models.Element); | |
| 1893 | 1373 | |
| 1894 | 1374 | /***/ }), |
| 1895 | 1375 | |
| 1896 | -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/index.js": | |
| 1897 | -/*!*****************************************************************!*\ | |
| 1898 | - !*** ../modules/atomic-widgets/assets/js/editor/hooks/index.js ***! | |
| 1899 | - \*****************************************************************/ | |
| 1376 | +/***/ "../modules/atomic-widgets/assets/js/editor/div-block-type.js": | |
| 1377 | +/*!********************************************************************!*\ | |
| 1378 | + !*** ../modules/atomic-widgets/assets/js/editor/div-block-type.js ***! | |
| 1379 | + \********************************************************************/ | |
| 1900 | 1380 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1901 | 1381 | |
| 1902 | 1382 | "use strict"; |
| 1903 | 1383 | |
| 1904 | 1384 | |
| 1385 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1905 | 1386 | Object.defineProperty(exports, "__esModule", ({ |
| 1906 | 1387 | value: true |
| 1907 | 1388 | })); |
| 1908 | -Object.defineProperty(exports, "DuplicateElement", ({ | |
| 1909 | - enumerable: true, | |
| 1910 | - get: function get() { | |
| 1911 | - return _duplicateElement.DuplicateElement; | |
| 1389 | +exports["default"] = void 0; | |
| 1390 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1391 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1392 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1393 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1394 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1395 | +var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js")); | |
| 1396 | +var _divBlockModel = _interopRequireDefault(__webpack_require__(/*! ./div-block-model */ "../modules/atomic-widgets/assets/js/editor/div-block-model.js")); | |
| 1397 | +var _divBlockView = _interopRequireDefault(__webpack_require__(/*! ./div-block-view */ "../modules/atomic-widgets/assets/js/editor/div-block-view.js")); | |
| 1398 | +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)); } | |
| 1399 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1400 | +var AtomicContainer = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) { | |
| 1401 | + function AtomicContainer() { | |
| 1402 | + (0, _classCallCheck2.default)(this, AtomicContainer); | |
| 1403 | + return _callSuper(this, AtomicContainer, arguments); | |
| 1912 | 1404 | } |
| 1913 | -})); | |
| 1914 | -Object.defineProperty(exports, "ImportElement", ({ | |
| 1915 | - enumerable: true, | |
| 1916 | - get: function get() { | |
| 1917 | - return _importElement.ImportElement; | |
| 1918 | - } | |
| 1919 | -})); | |
| 1920 | -Object.defineProperty(exports, "PasteElement", ({ | |
| 1921 | - enumerable: true, | |
| 1922 | - get: function get() { | |
| 1923 | - return _pasteElement.PasteElement; | |
| 1924 | - } | |
| 1925 | -})); | |
| 1926 | -var _duplicateElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/duplicate-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js"); | |
| 1927 | -var _pasteElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/paste-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js"); | |
| 1928 | -var _importElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/import-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js"); | |
| 1405 | + (0, _inherits2.default)(AtomicContainer, _elementor$modules$el); | |
| 1406 | + return (0, _createClass2.default)(AtomicContainer, [{ | |
| 1407 | + key: "getType", | |
| 1408 | + value: function getType() { | |
| 1409 | + return 'div-block'; | |
| 1410 | + } | |
| 1411 | + }, { | |
| 1412 | + key: "getView", | |
| 1413 | + value: function getView() { | |
| 1414 | + return _divBlockView.default; | |
| 1415 | + } | |
| 1416 | + }, { | |
| 1417 | + key: "getEmptyView", | |
| 1418 | + value: function getEmptyView() { | |
| 1419 | + return _emptyComponent.default; | |
| 1420 | + } | |
| 1421 | + }, { | |
| 1422 | + key: "getModel", | |
| 1423 | + value: function getModel() { | |
| 1424 | + return _divBlockModel.default; | |
| 1425 | + } | |
| 1426 | + }]); | |
| 1427 | +}(elementor.modules.elements.types.Base); | |
| 1929 | 1428 | |
| 1930 | 1429 | /***/ }), |
| 1931 | 1430 | |
| 1932 | -/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js": | |
| 1933 | -/*!********************************************************************************!*\ | |
| 1934 | - !*** ../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js ***! | |
| 1935 | - \********************************************************************************/ | |
| 1936 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1431 | +/***/ "../modules/atomic-widgets/assets/js/editor/div-block-view.js": | |
| 1432 | +/*!********************************************************************!*\ | |
| 1433 | + !*** ../modules/atomic-widgets/assets/js/editor/div-block-view.js ***! | |
| 1434 | + \********************************************************************/ | |
| 1435 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1937 | 1436 | |
| 1938 | 1437 | "use strict"; |
| 1438 | +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; | |
| 1439 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 1939 | 1440 | |
| 1940 | 1441 | |
| 1941 | 1442 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1942 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1943 | - value: true | |
| 1944 | -})); | |
| 1945 | -exports.getElementChildren = getElementChildren; | |
| 1946 | 1443 | var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); |
| 1947 | -function getElementChildren(model) { | |
| 1948 | - var _model$get$models, _model$get; | |
| 1949 | - if (!model) { | |
| 1950 | - return []; | |
| 1444 | +var _divBlockEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/div-block-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/div-block-empty-view.js")); | |
| 1445 | +var BaseElementView = elementor.modules.elements.views.BaseElement; | |
| 1446 | +var DivBlockView = BaseElementView.extend({ | |
| 1447 | + template: Marionette.TemplateCache.get('#tmpl-elementor-div-block-content'), | |
| 1448 | + emptyView: _divBlockEmptyView.default, | |
| 1449 | + tagName: function tagName() { | |
| 1450 | + return this.model.getSetting('tag') || 'div'; | |
| 1451 | + }, | |
| 1452 | + getChildViewContainer: function getChildViewContainer() { | |
| 1453 | + this.childViewContainer = ''; | |
| 1454 | + return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments); | |
| 1455 | + }, | |
| 1456 | + className: function className() { | |
| 1457 | + return "".concat(BaseElementView.prototype.className.apply(this), " e-con e-div-block").concat(this.getClassString()); | |
| 1458 | + }, | |
| 1459 | + // TODO: Copied from `views/column.js`. | |
| 1460 | + ui: function ui() { | |
| 1461 | + var ui = BaseElementView.prototype.ui.apply(this, arguments); | |
| 1462 | + ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip'; | |
| 1463 | + return ui; | |
| 1464 | + }, | |
| 1465 | + // TODO: Copied from `views/column.js`. | |
| 1466 | + attachElContent: function attachElContent() { | |
| 1467 | + BaseElementView.prototype.attachElContent.apply(this, arguments); | |
| 1468 | + var $tooltip = jQuery('<div>', { | |
| 1469 | + class: 'elementor-column-percents-tooltip', | |
| 1470 | + 'data-side': elementorCommon.config.isRTL ? 'right' : 'left' | |
| 1471 | + }); | |
| 1472 | + this.$el.children('.elementor-element-overlay').append($tooltip); | |
| 1473 | + }, | |
| 1474 | + // TODO: Copied from `views/column.js`. | |
| 1475 | + getPercentSize: function getPercentSize(size) { | |
| 1476 | + if (!size) { | |
| 1477 | + size = this.el.getBoundingClientRect().width; | |
| 1478 | + } | |
| 1479 | + return +(size / this.$el.parent().width() * 100).toFixed(3); | |
| 1480 | + }, | |
| 1481 | + // TODO: Copied from `views/column.js`. | |
| 1482 | + getPercentsForDisplay: function getPercentsForDisplay() { | |
| 1483 | + var width = +this.model.getSetting('width') || this.getPercentSize(); | |
| 1484 | + return width.toFixed(1) + '%'; | |
| 1485 | + }, | |
| 1486 | + renderOnChange: function renderOnChange() { | |
| 1487 | + BaseElementView.prototype.renderOnChange.apply(this, arguments); | |
| 1488 | + this.$el.addClass(this.getClasses()); | |
| 1489 | + }, | |
| 1490 | + onRender: function onRender() { | |
| 1491 | + var _this = this; | |
| 1492 | + BaseElementView.prototype.onRender.apply(this, arguments); | |
| 1493 | + | |
| 1494 | + // Defer to wait for everything to render. | |
| 1495 | + setTimeout(function () { | |
| 1496 | + _this.droppableInitialize(); | |
| 1497 | + }); | |
| 1498 | + }, | |
| 1499 | + droppableInitialize: function droppableInitialize() { | |
| 1500 | + this.$el.html5Droppable(this.getDroppableOptions()); | |
| 1501 | + }, | |
| 1502 | + isDroppingAllowed: function isDroppingAllowed() { | |
| 1503 | + return true; | |
| 1504 | + }, | |
| 1505 | + behaviors: function behaviors() { | |
| 1506 | + var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); | |
| 1507 | + _.extend(behaviors, { | |
| 1508 | + Sortable: { | |
| 1509 | + behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"), | |
| 1510 | + elChildType: 'widget' | |
| 1511 | + } | |
| 1512 | + }); | |
| 1513 | + return elementor.hooks.applyFilters('elements/div-block/behaviors', behaviors, this); | |
| 1514 | + }, | |
| 1515 | + /** | |
| 1516 | + * @return {{}} options | |
| 1517 | + */ | |
| 1518 | + getSortableOptions: function getSortableOptions() { | |
| 1519 | + return { | |
| 1520 | + preventInit: true | |
| 1521 | + }; | |
| 1522 | + }, | |
| 1523 | + getDroppableOptions: function getDroppableOptions() { | |
| 1524 | + var _this2 = this; | |
| 1525 | + var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add'; | |
| 1526 | + return { | |
| 1527 | + items: items, | |
| 1528 | + groups: ['elementor-element'], | |
| 1529 | + horizontalThreshold: 5, | |
| 1530 | + isDroppingAllowed: this.isDroppingAllowed.bind(this), | |
| 1531 | + currentElementClass: 'elementor-html5dnd-current-element', | |
| 1532 | + placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder', | |
| 1533 | + hasDraggingOnChildClass: 'e-dragging-over', | |
| 1534 | + getDropContainer: function getDropContainer() { | |
| 1535 | + return _this2.getContainer(); | |
| 1536 | + }, | |
| 1537 | + onDropping: function onDropping(side, event) { | |
| 1538 | + event.stopPropagation(); | |
| 1539 | + | |
| 1540 | + // Triggering drag end manually, since it won't fired above iframe | |
| 1541 | + elementor.getPreviewView().onPanelElementDragEnd(); | |
| 1542 | + var draggedView = elementor.channels.editor.request('element:dragged'), | |
| 1543 | + draggingInSameParent = (draggedView === null || draggedView === void 0 ? void 0 : draggedView.parent) === _this2, | |
| 1544 | + containerSelector = event.currentTarget.parentElement; | |
| 1545 | + var $elements = jQuery(containerSelector).find('> .elementor-element'); | |
| 1546 | + | |
| 1547 | + // Exclude the dragged element from the indexing calculations. | |
| 1548 | + if (draggingInSameParent) { | |
| 1549 | + $elements = $elements.not(draggedView.$el); | |
| 1550 | + } | |
| 1551 | + var widgetsArray = Object.values($elements); | |
| 1552 | + var newIndex = widgetsArray.indexOf(event.currentTarget); | |
| 1553 | + | |
| 1554 | + // Plus one in order to insert it after the current target element. | |
| 1555 | + if (_this2.shouldIncrementIndex(side)) { | |
| 1556 | + newIndex++; | |
| 1557 | + } | |
| 1558 | + | |
| 1559 | + // User is sorting inside a Container. | |
| 1560 | + if (draggedView) { | |
| 1561 | + // Prevent the user from dragging a parent container into its own child container | |
| 1562 | + var draggedId = draggedView.getContainer().id; | |
| 1563 | + var currentTargetParentContainer = _this2.container; | |
| 1564 | + while (currentTargetParentContainer) { | |
| 1565 | + if (currentTargetParentContainer.id === draggedId) { | |
| 1566 | + return; | |
| 1567 | + } | |
| 1568 | + currentTargetParentContainer = currentTargetParentContainer.parent; | |
| 1569 | + } | |
| 1570 | + | |
| 1571 | + // Reset the dragged element cache. | |
| 1572 | + elementor.channels.editor.reply('element:dragged', null); | |
| 1573 | + $e.run('document/elements/move', { | |
| 1574 | + container: draggedView.getContainer(), | |
| 1575 | + target: _this2.getContainer(), | |
| 1576 | + options: { | |
| 1577 | + at: newIndex | |
| 1578 | + } | |
| 1579 | + }); | |
| 1580 | + return; | |
| 1581 | + } | |
| 1582 | + | |
| 1583 | + // User is dragging an element from the panel. | |
| 1584 | + _this2.onDrop(event, { | |
| 1585 | + at: newIndex | |
| 1586 | + }); | |
| 1587 | + } | |
| 1588 | + }; | |
| 1589 | + }, | |
| 1590 | + getEditButtons: function getEditButtons() { | |
| 1591 | + var elementData = elementor.getElementData(this.model), | |
| 1592 | + editTools = {}; | |
| 1593 | + if ($e.components.get('document/elements').utils.allowAddingWidgets()) { | |
| 1594 | + editTools.add = { | |
| 1595 | + /* Translators: %s: Element Name. */ | |
| 1596 | + title: sprintf(__('Add %s', 'elementor'), elementData.title), | |
| 1597 | + icon: 'plus' | |
| 1598 | + }; | |
| 1599 | + editTools.edit = { | |
| 1600 | + /* Translators: %s: Element Name. */ | |
| 1601 | + title: sprintf(__('Edit %s', 'elementor'), elementData.title), | |
| 1602 | + icon: 'handle' | |
| 1603 | + }; | |
| 1604 | + } | |
| 1605 | + if (!this.getContainer().isLocked()) { | |
| 1606 | + if (elementor.getPreferences('edit_buttons') && $e.components.get('document/elements').utils.allowAddingWidgets()) { | |
| 1607 | + editTools.duplicate = { | |
| 1608 | + /* Translators: %s: Element Name. */ | |
| 1609 | + title: sprintf(__('Duplicate %s', 'elementor'), elementData.title), | |
| 1610 | + icon: 'clone' | |
| 1611 | + }; | |
| 1612 | + } | |
| 1613 | + editTools.remove = { | |
| 1614 | + /* Translators: %s: Element Name. */ | |
| 1615 | + title: sprintf(__('Delete %s', 'elementor'), elementData.title), | |
| 1616 | + icon: 'close' | |
| 1617 | + }; | |
| 1618 | + } | |
| 1619 | + return editTools; | |
| 1620 | + }, | |
| 1621 | + shouldIncrementIndex: function shouldIncrementIndex(side) { | |
| 1622 | + if (!this.draggingOnBottomOrRightSide(side)) { | |
| 1623 | + return false; | |
| 1624 | + } | |
| 1625 | + return !this.emptyViewIsCurrentlyBeingDraggedOver(); | |
| 1626 | + }, | |
| 1627 | + draggingOnBottomOrRightSide: function draggingOnBottomOrRightSide(side) { | |
| 1628 | + return ['bottom', 'right'].includes(side); | |
| 1629 | + }, | |
| 1630 | + emptyViewIsCurrentlyBeingDraggedOver: function emptyViewIsCurrentlyBeingDraggedOver() { | |
| 1631 | + return this.$el.find('> .elementor-empty-view > .elementor-first-add.elementor-html5dnd-current-element').length > 0; | |
| 1632 | + }, | |
| 1633 | + /** | |
| 1634 | + * Toggle the `New Section` view when clicking the `add` button in the edit tools. | |
| 1635 | + * | |
| 1636 | + * @return {void} | |
| 1637 | + */ | |
| 1638 | + onAddButtonClick: function onAddButtonClick() { | |
| 1639 | + if (this.addSectionView && !this.addSectionView.isDestroyed) { | |
| 1640 | + this.addSectionView.fadeToDeath(); | |
| 1641 | + return; | |
| 1642 | + } | |
| 1643 | + var addSectionView = new elementor.modules.elements.components.AddSectionView({ | |
| 1644 | + at: this.model.collection.indexOf(this.model) | |
| 1645 | + }); | |
| 1646 | + addSectionView.render(); | |
| 1647 | + this.$el.before(addSectionView.$el); | |
| 1648 | + addSectionView.$el.hide(); | |
| 1649 | + | |
| 1650 | + // Delaying the slide down for slow-render browsers (such as FF) | |
| 1651 | + setTimeout(function () { | |
| 1652 | + addSectionView.$el.slideDown(null, function () { | |
| 1653 | + // Remove inline style, for preview mode. | |
| 1654 | + jQuery(this).css('display', ''); | |
| 1655 | + }); | |
| 1656 | + }); | |
| 1657 | + this.addSectionView = addSectionView; | |
| 1658 | + }, | |
| 1659 | + getClasses: function getClasses() { | |
| 1660 | + var _this$options; | |
| 1661 | + return ((_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.model) === null || _this$options === void 0 || (_this$options = _this$options.getSetting('classes')) === null || _this$options === void 0 ? void 0 : _this$options.value) || []; | |
| 1662 | + }, | |
| 1663 | + getClassString: function getClassString() { | |
| 1664 | + var classes = this.getClasses(); | |
| 1665 | + return classes.length ? [''].concat((0, _toConsumableArray2.default)(classes)).join(' ') : ''; | |
| 1951 | 1666 | } |
| 1952 | - var childModels = (_model$get$models = (_model$get = model.get('elements')) === null || _model$get === void 0 ? void 0 : _model$get.models) !== null && _model$get$models !== void 0 ? _model$get$models : []; | |
| 1953 | - var children = childModels.flatMap(getElementChildren); | |
| 1954 | - return [model].concat((0, _toConsumableArray2.default)(children)); | |
| 1955 | -} | |
| 1667 | +}); | |
| 1668 | +module.exports = DivBlockView; | |
| 1956 | 1669 | |
| 1957 | 1670 | /***/ }), |
| 1958 | 1671 | |
| 1959 | -/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js": | |
| 1960 | -/*!*******************************************************************************!*\ | |
| 1961 | - !*** ../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js ***! | |
| 1962 | - \*******************************************************************************/ | |
| 1672 | +/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js": | |
| 1673 | +/*!************************************************************************!*\ | |
| 1674 | + !*** ../modules/atomic-widgets/assets/js/editor/utils/get-variants.js ***! | |
| 1675 | + \************************************************************************/ | |
| 1963 | 1676 | /***/ ((__unused_webpack_module, exports) => { |
| 1964 | 1677 | |
| 1965 | 1678 | "use strict"; |
| 1966 | 1679 | |
| @@ -1967,149 +1680,89 @@ | ||
| 1967 | 1680 | |
| 1968 | 1681 | Object.defineProperty(exports, "__esModule", ({ |
| 1969 | 1682 | value: true |
| 1970 | 1683 | })); |
| 1971 | -exports.getRandomStyleId = getRandomStyleId; | |
| 1972 | -/** | |
| 1973 | - * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container | |
| 1974 | - */ | |
| 1975 | - | |
| 1976 | -/** | |
| 1977 | - * @param {Container} container | |
| 1978 | - * @param {Object} existingStyleIds | |
| 1979 | - * @return {string} | |
| 1980 | - */ | |
| 1981 | -function getRandomStyleId(container) { | |
| 1982 | - var existingStyleIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 1983 | - var id; | |
| 1984 | - do { | |
| 1985 | - id = "e-".concat(container.id, "-").concat(elementorCommon.helpers.getUniqueId()); | |
| 1986 | - } while (existingStyleIds.hasOwnProperty(id)); | |
| 1987 | - return id; | |
| 1684 | +exports.getVariantByMeta = getVariantByMeta; | |
| 1685 | +exports.getVariantsWithoutMeta = getVariantsWithoutMeta; | |
| 1686 | +function getVariantByMeta(variants, meta) { | |
| 1687 | + return variants.find(function (variant) { | |
| 1688 | + return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state; | |
| 1689 | + }); | |
| 1988 | 1690 | } |
| 1691 | +function getVariantsWithoutMeta(variants, meta) { | |
| 1692 | + return variants.filter(function (variant) { | |
| 1693 | + return variant.meta.breakpoint !== meta.breakpoint || variant.meta.state !== meta.state; | |
| 1694 | + }); | |
| 1695 | +} | |
| 1989 | 1696 | |
| 1990 | 1697 | /***/ }), |
| 1991 | 1698 | |
| 1992 | -/***/ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js": | |
| 1993 | -/*!**************************************************************************************!*\ | |
| 1994 | - !*** ../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js ***! | |
| 1995 | - \**************************************************************************************/ | |
| 1699 | +/***/ "../node_modules/react-dom/client.js": | |
| 1700 | +/*!*******************************************!*\ | |
| 1701 | + !*** ../node_modules/react-dom/client.js ***! | |
| 1702 | + \*******************************************/ | |
| 1996 | 1703 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1997 | 1704 | |
| 1998 | 1705 | "use strict"; |
| 1999 | 1706 | |
| 2000 | 1707 | |
| 2001 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2002 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2003 | - value: true | |
| 2004 | -})); | |
| 2005 | -exports.regenerateLocalStyleIds = regenerateLocalStyleIds; | |
| 2006 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 2007 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 2008 | -var _getElementChildren = __webpack_require__(/*! ./get-element-children */ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js"); | |
| 2009 | -var _getRandomStyleId = __webpack_require__(/*! ./get-random-style-id */ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js"); | |
| 2010 | -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; } | |
| 2011 | -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; } | |
| 2012 | -function regenerateLocalStyleIds(container) { | |
| 2013 | - if (!(container !== null && container !== void 0 && container.model)) { | |
| 2014 | - return; | |
| 2015 | - } | |
| 2016 | - var allElements = (0, _getElementChildren.getElementChildren)(container.model); | |
| 2017 | - var styledElements = allElements.filter(function (model) { | |
| 2018 | - var _model$get; | |
| 2019 | - return model && Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0; | |
| 2020 | - }); | |
| 2021 | - updateElementsStyleIdsInsideOut(styledElements); | |
| 2022 | -} | |
| 2023 | -function isClassesProp(prop) { | |
| 2024 | - return prop.$$type && 'classes' === prop.$$type && Array.isArray(prop.value) && prop.value.length > 0; | |
| 2025 | -} | |
| 2026 | -function calculateNewStylesAndSettings(element, model, settings) { | |
| 2027 | - var _settings$toJSON; | |
| 2028 | - var originalStyles = model.get('styles'); | |
| 2029 | - var settingsJson = (_settings$toJSON = settings === null || settings === void 0 ? void 0 : settings.toJSON()) !== null && _settings$toJSON !== void 0 ? _settings$toJSON : {}; | |
| 2030 | - var classesProps = Object.entries(settingsJson).filter(function (_ref) { | |
| 2031 | - var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 2032 | - propValue = _ref2[1]; | |
| 2033 | - return isClassesProp(propValue); | |
| 2034 | - }); | |
| 2035 | - var newStyles = {}; | |
| 2036 | - var changedIds = {}; | |
| 2037 | - Object.entries(originalStyles).forEach(function (_ref3) { | |
| 2038 | - var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), | |
| 2039 | - originalStyleId = _ref4[0], | |
| 2040 | - style = _ref4[1]; | |
| 2041 | - var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(element, newStyles); | |
| 2042 | - newStyles[newStyleId] = structuredClone(_objectSpread(_objectSpread({}, style), {}, { | |
| 2043 | - id: newStyleId | |
| 2044 | - })); | |
| 2045 | - changedIds[originalStyleId] = newStyleId; | |
| 2046 | - }); | |
| 2047 | - var newClassesProps = classesProps.map(function (_ref5) { | |
| 2048 | - var _ref6 = (0, _slicedToArray2.default)(_ref5, 2), | |
| 2049 | - key = _ref6[0], | |
| 2050 | - value = _ref6[1]; | |
| 2051 | - return [key, _objectSpread(_objectSpread({}, value), {}, { | |
| 2052 | - value: value.value.map(function (className) { | |
| 2053 | - var _changedIds$className; | |
| 2054 | - return (_changedIds$className = changedIds[className]) !== null && _changedIds$className !== void 0 ? _changedIds$className : className; | |
| 2055 | - }) | |
| 2056 | - })]; | |
| 2057 | - }, {}); | |
| 2058 | - return { | |
| 2059 | - newStyles: newStyles, | |
| 2060 | - newSettings: Object.fromEntries(newClassesProps) | |
| 1708 | +var m = __webpack_require__(/*! react-dom */ "react-dom"); | |
| 1709 | +if (false) {} else { | |
| 1710 | + var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | |
| 1711 | + exports.createRoot = function(c, o) { | |
| 1712 | + i.usingClientEntryPoint = true; | |
| 1713 | + try { | |
| 1714 | + return m.createRoot(c, o); | |
| 1715 | + } finally { | |
| 1716 | + i.usingClientEntryPoint = false; | |
| 1717 | + } | |
| 2061 | 1718 | }; |
| 1719 | + exports.hydrateRoot = function(c, h, o) { | |
| 1720 | + i.usingClientEntryPoint = true; | |
| 1721 | + try { | |
| 1722 | + return m.hydrateRoot(c, h, o); | |
| 1723 | + } finally { | |
| 1724 | + i.usingClientEntryPoint = false; | |
| 1725 | + } | |
| 1726 | + }; | |
| 2062 | 1727 | } |
| 2063 | -function updateStyleIdForContainer(container) { | |
| 2064 | - var model = container.model, | |
| 2065 | - settings = container.settings; | |
| 2066 | - var _calculateNewStylesAn = calculateNewStylesAndSettings(container, model, settings), | |
| 2067 | - newStyles = _calculateNewStylesAn.newStyles, | |
| 2068 | - newSettings = _calculateNewStylesAn.newSettings; | |
| 2069 | - $e.internal('document/elements/set-settings', { | |
| 2070 | - container: container, | |
| 2071 | - settings: newSettings | |
| 2072 | - }); | |
| 2073 | - model.set('styles', newStyles); | |
| 2074 | -} | |
| 2075 | -function updateStyleIdForModel(model) { | |
| 2076 | - var settings = model.get('settings'); | |
| 2077 | - var _calculateNewStylesAn2 = calculateNewStylesAndSettings(model, model, settings), | |
| 2078 | - newStyles = _calculateNewStylesAn2.newStyles, | |
| 2079 | - newSettings = _calculateNewStylesAn2.newSettings; | |
| 2080 | - settings.set(newSettings); | |
| 2081 | - model.set('styles', newStyles); | |
| 2082 | -} | |
| 2083 | -function updateStyleId(model) { | |
| 2084 | - var container = window.elementor.getContainer(model.get('id')); | |
| 2085 | 1728 | |
| 2086 | - // If view exists, update the styles via the container | |
| 2087 | - if (container) { | |
| 2088 | - updateStyleIdForContainer(container); | |
| 2089 | - return; | |
| 2090 | - } | |
| 2091 | - updateStyleIdForModel(model); | |
| 2092 | -} | |
| 2093 | -function updateElementsStyleIdsInsideOut(styledElements) { | |
| 2094 | - styledElements === null || styledElements === void 0 || styledElements.reverse().forEach(updateStyleId); | |
| 2095 | -} | |
| 2096 | 1729 | |
| 2097 | 1730 | /***/ }), |
| 2098 | 1731 | |
| 2099 | -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js": | |
| 2100 | -/*!***************************************************************!*\ | |
| 2101 | - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***! | |
| 2102 | - \***************************************************************/ | |
| 1732 | +/***/ "react": | |
| 1733 | +/*!************************!*\ | |
| 1734 | + !*** external "React" ***! | |
| 1735 | + \************************/ | |
| 2103 | 1736 | /***/ ((module) => { |
| 2104 | 1737 | |
| 2105 | -function _OverloadYield(e, d) { | |
| 2106 | - this.v = e, this.k = d; | |
| 2107 | -} | |
| 2108 | -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1738 | +"use strict"; | |
| 1739 | +module.exports = React; | |
| 2109 | 1740 | |
| 2110 | 1741 | /***/ }), |
| 2111 | 1742 | |
| 1743 | +/***/ "react-dom": | |
| 1744 | +/*!***************************!*\ | |
| 1745 | + !*** external "ReactDOM" ***! | |
| 1746 | + \***************************/ | |
| 1747 | +/***/ ((module) => { | |
| 1748 | + | |
| 1749 | +"use strict"; | |
| 1750 | +module.exports = ReactDOM; | |
| 1751 | + | |
| 1752 | +/***/ }), | |
| 1753 | + | |
| 1754 | +/***/ "@wordpress/i18n": | |
| 1755 | +/*!**************************!*\ | |
| 1756 | + !*** external "wp.i18n" ***! | |
| 1757 | + \**************************/ | |
| 1758 | +/***/ ((module) => { | |
| 1759 | + | |
| 1760 | +"use strict"; | |
| 1761 | +module.exports = wp.i18n; | |
| 1762 | + | |
| 1763 | +/***/ }), | |
| 1764 | + | |
| 2112 | 1765 | /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": |
| 2113 | 1766 | /*!******************************************************************!*\ |
| 2114 | 1767 | !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! |
| 2115 | 1768 | \******************************************************************/ |
| @@ -2164,43 +1817,8 @@ | ||
| 2164 | 1817 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2165 | 1818 | |
| 2166 | 1819 | /***/ }), |
| 2167 | 1820 | |
| 2168 | -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": | |
| 2169 | -/*!******************************************************************!*\ | |
| 2170 | - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! | |
| 2171 | - \******************************************************************/ | |
| 2172 | -/***/ ((module) => { | |
| 2173 | - | |
| 2174 | -function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 2175 | - try { | |
| 2176 | - var i = n[a](c), | |
| 2177 | - u = i.value; | |
| 2178 | - } catch (n) { | |
| 2179 | - return void e(n); | |
| 2180 | - } | |
| 2181 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 2182 | -} | |
| 2183 | -function _asyncToGenerator(n) { | |
| 2184 | - return function () { | |
| 2185 | - var t = this, | |
| 2186 | - e = arguments; | |
| 2187 | - return new Promise(function (r, o) { | |
| 2188 | - var a = n.apply(t, e); | |
| 2189 | - function _next(n) { | |
| 2190 | - asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 2191 | - } | |
| 2192 | - function _throw(n) { | |
| 2193 | - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 2194 | - } | |
| 2195 | - _next(void 0); | |
| 2196 | - }); | |
| 2197 | - }; | |
| 2198 | -} | |
| 2199 | -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2200 | - | |
| 2201 | -/***/ }), | |
| 2202 | - | |
| 2203 | 1821 | /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": |
| 2204 | 1822 | /*!****************************************************************!*\ |
| 2205 | 1823 | !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! |
| 2206 | 1824 | \****************************************************************/ |
| @@ -2419,344 +2037,8 @@ | ||
| 2419 | 2037 | module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2420 | 2038 | |
| 2421 | 2039 | /***/ }), |
| 2422 | 2040 | |
| 2423 | -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js": | |
| 2424 | -/*!*************************************************************!*\ | |
| 2425 | - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***! | |
| 2426 | - \*************************************************************/ | |
| 2427 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2428 | - | |
| 2429 | -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); | |
| 2430 | -function _regenerator() { | |
| 2431 | - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 2432 | - var e, | |
| 2433 | - t, | |
| 2434 | - r = "function" == typeof Symbol ? Symbol : {}, | |
| 2435 | - n = r.iterator || "@@iterator", | |
| 2436 | - o = r.toStringTag || "@@toStringTag"; | |
| 2437 | - function i(r, n, o, i) { | |
| 2438 | - var c = n && n.prototype instanceof Generator ? n : Generator, | |
| 2439 | - u = Object.create(c.prototype); | |
| 2440 | - return regeneratorDefine(u, "_invoke", function (r, n, o) { | |
| 2441 | - var i, | |
| 2442 | - c, | |
| 2443 | - u, | |
| 2444 | - f = 0, | |
| 2445 | - p = o || [], | |
| 2446 | - y = !1, | |
| 2447 | - G = { | |
| 2448 | - p: 0, | |
| 2449 | - n: 0, | |
| 2450 | - v: e, | |
| 2451 | - a: d, | |
| 2452 | - f: d.bind(e, 4), | |
| 2453 | - d: function d(t, r) { | |
| 2454 | - return i = t, c = 0, u = e, G.n = r, a; | |
| 2455 | - } | |
| 2456 | - }; | |
| 2457 | - function d(r, n) { | |
| 2458 | - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 2459 | - var o, | |
| 2460 | - i = p[t], | |
| 2461 | - d = G.p, | |
| 2462 | - l = i[2]; | |
| 2463 | - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); | |
| 2464 | - } | |
| 2465 | - if (o || r > 1) return a; | |
| 2466 | - throw y = !0, n; | |
| 2467 | - } | |
| 2468 | - return function (o, p, l) { | |
| 2469 | - if (f > 1) throw TypeError("Generator is already running"); | |
| 2470 | - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 2471 | - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 2472 | - try { | |
| 2473 | - if (f = 2, i) { | |
| 2474 | - if (c || (o = "next"), t = i[o]) { | |
| 2475 | - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 2476 | - if (!t.done) return t; | |
| 2477 | - u = t.value, c < 2 && (c = 0); | |
| 2478 | - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 2479 | - i = e; | |
| 2480 | - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 2481 | - } catch (t) { | |
| 2482 | - i = e, c = 1, u = t; | |
| 2483 | - } finally { | |
| 2484 | - f = 1; | |
| 2485 | - } | |
| 2486 | - } | |
| 2487 | - return { | |
| 2488 | - value: t, | |
| 2489 | - done: y | |
| 2490 | - }; | |
| 2491 | - }; | |
| 2492 | - }(r, o, i), !0), u; | |
| 2493 | - } | |
| 2494 | - var a = {}; | |
| 2495 | - function Generator() {} | |
| 2496 | - function GeneratorFunction() {} | |
| 2497 | - function GeneratorFunctionPrototype() {} | |
| 2498 | - t = Object.getPrototypeOf; | |
| 2499 | - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () { | |
| 2500 | - return this; | |
| 2501 | - }), t), | |
| 2502 | - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 2503 | - function f(e) { | |
| 2504 | - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 2505 | - } | |
| 2506 | - return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () { | |
| 2507 | - return this; | |
| 2508 | - }), regeneratorDefine(u, "toString", function () { | |
| 2509 | - return "[object Generator]"; | |
| 2510 | - }), (module.exports = _regenerator = function _regenerator() { | |
| 2511 | - return { | |
| 2512 | - w: i, | |
| 2513 | - m: f | |
| 2514 | - }; | |
| 2515 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 2516 | -} | |
| 2517 | -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2518 | - | |
| 2519 | -/***/ }), | |
| 2520 | - | |
| 2521 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js": | |
| 2522 | -/*!******************************************************************!*\ | |
| 2523 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***! | |
| 2524 | - \******************************************************************/ | |
| 2525 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2526 | - | |
| 2527 | -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); | |
| 2528 | -function _regeneratorAsync(n, e, r, t, o) { | |
| 2529 | - var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 2530 | - return a.next().then(function (n) { | |
| 2531 | - return n.done ? n.value : a.next(); | |
| 2532 | - }); | |
| 2533 | -} | |
| 2534 | -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2535 | - | |
| 2536 | -/***/ }), | |
| 2537 | - | |
| 2538 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js": | |
| 2539 | -/*!*********************************************************************!*\ | |
| 2540 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***! | |
| 2541 | - \*********************************************************************/ | |
| 2542 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2543 | - | |
| 2544 | -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); | |
| 2545 | -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); | |
| 2546 | -function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 2547 | - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 2548 | -} | |
| 2549 | -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2550 | - | |
| 2551 | -/***/ }), | |
| 2552 | - | |
| 2553 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js": | |
| 2554 | -/*!**************************************************************************!*\ | |
| 2555 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***! | |
| 2556 | - \**************************************************************************/ | |
| 2557 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2558 | - | |
| 2559 | -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); | |
| 2560 | -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); | |
| 2561 | -function AsyncIterator(t, e) { | |
| 2562 | - function n(r, o, i, f) { | |
| 2563 | - try { | |
| 2564 | - var c = t[r](o), | |
| 2565 | - u = c.value; | |
| 2566 | - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) { | |
| 2567 | - n("next", t, i, f); | |
| 2568 | - }, function (t) { | |
| 2569 | - n("throw", t, i, f); | |
| 2570 | - }) : e.resolve(u).then(function (t) { | |
| 2571 | - c.value = t, i(c); | |
| 2572 | - }, function (t) { | |
| 2573 | - return n("throw", t, i, f); | |
| 2574 | - }); | |
| 2575 | - } catch (t) { | |
| 2576 | - f(t); | |
| 2577 | - } | |
| 2578 | - } | |
| 2579 | - var r; | |
| 2580 | - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { | |
| 2581 | - return this; | |
| 2582 | - })), regeneratorDefine(this, "_invoke", function (t, o, i) { | |
| 2583 | - function f() { | |
| 2584 | - return new e(function (e, r) { | |
| 2585 | - n(t, i, e, r); | |
| 2586 | - }); | |
| 2587 | - } | |
| 2588 | - return r = r ? r.then(f, f) : f(); | |
| 2589 | - }, !0); | |
| 2590 | -} | |
| 2591 | -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2592 | - | |
| 2593 | -/***/ }), | |
| 2594 | - | |
| 2595 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js": | |
| 2596 | -/*!*******************************************************************!*\ | |
| 2597 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***! | |
| 2598 | - \*******************************************************************/ | |
| 2599 | -/***/ ((module) => { | |
| 2600 | - | |
| 2601 | -function _regeneratorDefine(e, r, n, t) { | |
| 2602 | - var i = Object.defineProperty; | |
| 2603 | - try { | |
| 2604 | - i({}, "", {}); | |
| 2605 | - } catch (e) { | |
| 2606 | - i = 0; | |
| 2607 | - } | |
| 2608 | - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 2609 | - function o(r, n) { | |
| 2610 | - _regeneratorDefine(e, r, function (e) { | |
| 2611 | - return this._invoke(r, n, e); | |
| 2612 | - }); | |
| 2613 | - } | |
| 2614 | - r ? i ? i(e, r, { | |
| 2615 | - value: n, | |
| 2616 | - enumerable: !t, | |
| 2617 | - configurable: !t, | |
| 2618 | - writable: !t | |
| 2619 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 2620 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 2621 | -} | |
| 2622 | -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2623 | - | |
| 2624 | -/***/ }), | |
| 2625 | - | |
| 2626 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js": | |
| 2627 | -/*!*****************************************************************!*\ | |
| 2628 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***! | |
| 2629 | - \*****************************************************************/ | |
| 2630 | -/***/ ((module) => { | |
| 2631 | - | |
| 2632 | -function _regeneratorKeys(e) { | |
| 2633 | - var n = Object(e), | |
| 2634 | - r = []; | |
| 2635 | - for (var t in n) r.unshift(t); | |
| 2636 | - return function e() { | |
| 2637 | - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 2638 | - return e.done = !0, e; | |
| 2639 | - }; | |
| 2640 | -} | |
| 2641 | -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2642 | - | |
| 2643 | -/***/ }), | |
| 2644 | - | |
| 2645 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js": | |
| 2646 | -/*!********************************************************************!*\ | |
| 2647 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! | |
| 2648 | - \********************************************************************/ | |
| 2649 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2650 | - | |
| 2651 | -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); | |
| 2652 | -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); | |
| 2653 | -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js"); | |
| 2654 | -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); | |
| 2655 | -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); | |
| 2656 | -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js"); | |
| 2657 | -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js"); | |
| 2658 | -function _regeneratorRuntime() { | |
| 2659 | - "use strict"; | |
| 2660 | - | |
| 2661 | - var r = regenerator(), | |
| 2662 | - e = r.m(_regeneratorRuntime), | |
| 2663 | - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 2664 | - function n(r) { | |
| 2665 | - var e = "function" == typeof r && r.constructor; | |
| 2666 | - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 2667 | - } | |
| 2668 | - var o = { | |
| 2669 | - "throw": 1, | |
| 2670 | - "return": 2, | |
| 2671 | - "break": 3, | |
| 2672 | - "continue": 3 | |
| 2673 | - }; | |
| 2674 | - function a(r) { | |
| 2675 | - var e, t; | |
| 2676 | - return function (n) { | |
| 2677 | - e || (e = { | |
| 2678 | - stop: function stop() { | |
| 2679 | - return t(n.a, 2); | |
| 2680 | - }, | |
| 2681 | - "catch": function _catch() { | |
| 2682 | - return n.v; | |
| 2683 | - }, | |
| 2684 | - abrupt: function abrupt(r, e) { | |
| 2685 | - return t(n.a, o[r], e); | |
| 2686 | - }, | |
| 2687 | - delegateYield: function delegateYield(r, o, a) { | |
| 2688 | - return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 2689 | - }, | |
| 2690 | - finish: function finish(r) { | |
| 2691 | - return t(n.f, r); | |
| 2692 | - } | |
| 2693 | - }, t = function t(r, _t, o) { | |
| 2694 | - n.p = e.prev, n.n = e.next; | |
| 2695 | - try { | |
| 2696 | - return r(_t, o); | |
| 2697 | - } finally { | |
| 2698 | - e.next = n.n; | |
| 2699 | - } | |
| 2700 | - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 2701 | - try { | |
| 2702 | - return r.call(this, e); | |
| 2703 | - } finally { | |
| 2704 | - n.p = e.prev, n.n = e.next; | |
| 2705 | - } | |
| 2706 | - }; | |
| 2707 | - } | |
| 2708 | - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 2709 | - return { | |
| 2710 | - wrap: function wrap(e, t, n, o) { | |
| 2711 | - return r.w(a(e), t, n, o && o.reverse()); | |
| 2712 | - }, | |
| 2713 | - isGeneratorFunction: n, | |
| 2714 | - mark: r.m, | |
| 2715 | - awrap: function awrap(r, e) { | |
| 2716 | - return new OverloadYield(r, e); | |
| 2717 | - }, | |
| 2718 | - AsyncIterator: regeneratorAsyncIterator, | |
| 2719 | - async: function async(r, e, t, o, u) { | |
| 2720 | - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 2721 | - }, | |
| 2722 | - keys: regeneratorKeys, | |
| 2723 | - values: regeneratorValues | |
| 2724 | - }; | |
| 2725 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 2726 | -} | |
| 2727 | -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2728 | - | |
| 2729 | -/***/ }), | |
| 2730 | - | |
| 2731 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js": | |
| 2732 | -/*!*******************************************************************!*\ | |
| 2733 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***! | |
| 2734 | - \*******************************************************************/ | |
| 2735 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2736 | - | |
| 2737 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 2738 | -function _regeneratorValues(e) { | |
| 2739 | - if (null != e) { | |
| 2740 | - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], | |
| 2741 | - r = 0; | |
| 2742 | - if (t) return t.call(e); | |
| 2743 | - if ("function" == typeof e.next) return e; | |
| 2744 | - if (!isNaN(e.length)) return { | |
| 2745 | - next: function next() { | |
| 2746 | - return e && r >= e.length && (e = void 0), { | |
| 2747 | - value: e && e[r++], | |
| 2748 | - done: !e | |
| 2749 | - }; | |
| 2750 | - } | |
| 2751 | - }; | |
| 2752 | - } | |
| 2753 | - throw new TypeError(_typeof(e) + " is not iterable"); | |
| 2754 | -} | |
| 2755 | -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2756 | - | |
| 2757 | -/***/ }), | |
| 2758 | - | |
| 2759 | 2041 | /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": |
| 2760 | 2042 | /*!****************************************************************!*\ |
| 2761 | 2043 | !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! |
| 2762 | 2044 | \****************************************************************/ |
| @@ -2891,100 +2173,8 @@ | ||
| 2891 | 2173 | } |
| 2892 | 2174 | } |
| 2893 | 2175 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2894 | 2176 | |
| 2895 | -/***/ }), | |
| 2896 | - | |
| 2897 | -/***/ "../node_modules/@babel/runtime/regenerator/index.js": | |
| 2898 | -/*!***********************************************************!*\ | |
| 2899 | - !*** ../node_modules/@babel/runtime/regenerator/index.js ***! | |
| 2900 | - \***********************************************************/ | |
| 2901 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2902 | - | |
| 2903 | -// TODO(Babel 8): Remove this file. | |
| 2904 | - | |
| 2905 | -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); | |
| 2906 | -module.exports = runtime; | |
| 2907 | - | |
| 2908 | -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | |
| 2909 | -try { | |
| 2910 | - regeneratorRuntime = runtime; | |
| 2911 | -} catch (accidentalStrictMode) { | |
| 2912 | - if (typeof globalThis === "object") { | |
| 2913 | - globalThis.regeneratorRuntime = runtime; | |
| 2914 | - } else { | |
| 2915 | - Function("r", "regeneratorRuntime = r")(runtime); | |
| 2916 | - } | |
| 2917 | -} | |
| 2918 | - | |
| 2919 | - | |
| 2920 | -/***/ }), | |
| 2921 | - | |
| 2922 | -/***/ "../node_modules/react-dom/client.js": | |
| 2923 | -/*!*******************************************!*\ | |
| 2924 | - !*** ../node_modules/react-dom/client.js ***! | |
| 2925 | - \*******************************************/ | |
| 2926 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2927 | - | |
| 2928 | -"use strict"; | |
| 2929 | - | |
| 2930 | - | |
| 2931 | -var m = __webpack_require__(/*! react-dom */ "react-dom"); | |
| 2932 | -if (false) // removed by dead control flow | |
| 2933 | -{} else { | |
| 2934 | - var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | |
| 2935 | - exports.createRoot = function(c, o) { | |
| 2936 | - i.usingClientEntryPoint = true; | |
| 2937 | - try { | |
| 2938 | - return m.createRoot(c, o); | |
| 2939 | - } finally { | |
| 2940 | - i.usingClientEntryPoint = false; | |
| 2941 | - } | |
| 2942 | - }; | |
| 2943 | - exports.hydrateRoot = function(c, h, o) { | |
| 2944 | - i.usingClientEntryPoint = true; | |
| 2945 | - try { | |
| 2946 | - return m.hydrateRoot(c, h, o); | |
| 2947 | - } finally { | |
| 2948 | - i.usingClientEntryPoint = false; | |
| 2949 | - } | |
| 2950 | - }; | |
| 2951 | -} | |
| 2952 | - | |
| 2953 | - | |
| 2954 | -/***/ }), | |
| 2955 | - | |
| 2956 | -/***/ "@wordpress/i18n": | |
| 2957 | -/*!**************************!*\ | |
| 2958 | - !*** external "wp.i18n" ***! | |
| 2959 | - \**************************/ | |
| 2960 | -/***/ ((module) => { | |
| 2961 | - | |
| 2962 | -"use strict"; | |
| 2963 | -module.exports = wp.i18n; | |
| 2964 | - | |
| 2965 | -/***/ }), | |
| 2966 | - | |
| 2967 | -/***/ "react": | |
| 2968 | -/*!************************!*\ | |
| 2969 | - !*** external "React" ***! | |
| 2970 | - \************************/ | |
| 2971 | -/***/ ((module) => { | |
| 2972 | - | |
| 2973 | -"use strict"; | |
| 2974 | -module.exports = React; | |
| 2975 | - | |
| 2976 | -/***/ }), | |
| 2977 | - | |
| 2978 | -/***/ "react-dom": | |
| 2979 | -/*!***************************!*\ | |
| 2980 | - !*** external "ReactDOM" ***! | |
| 2981 | - \***************************/ | |
| 2982 | -/***/ ((module) => { | |
| 2983 | - | |
| 2984 | -"use strict"; | |
| 2985 | -module.exports = ReactDOM; | |
| 2986 | - | |
| 2987 | 2177 | /***/ }) |
| 2988 | 2178 | |
| 2989 | 2179 | /******/ }); |
| 2990 | 2180 | /************************************************************************/ |
| @@ -3022,8 +2212,9 @@ | ||
| 3022 | 2212 | \************************************************************/ |
| 3023 | 2213 | |
| 3024 | 2214 | |
| 3025 | 2215 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2216 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 3026 | 2217 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 3027 | 2218 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 3028 | 2219 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 3029 | 2220 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| @@ -3028,14 +2219,9 @@ | ||
| 3028 | 2219 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 3029 | 2220 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 3030 | 2221 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 3031 | 2222 | var _component = _interopRequireDefault(__webpack_require__(/*! ./component */ "../modules/atomic-widgets/assets/js/editor/component.js")); |
| 3032 | -var _atomicElementBaseType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js")); | |
| 3033 | -var _createAtomicElementBaseView = _interopRequireDefault(__webpack_require__(/*! ./create-atomic-element-base-view */ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js")); | |
| 3034 | -var _atomicElementBaseModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js")); | |
| 3035 | -var _createDivBlockType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-div-block-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js")); | |
| 3036 | -var _createFlexboxType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-flexbox-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js")); | |
| 3037 | -var _createGridType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-grid-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js")); | |
| 2223 | +var _atomicWidgetType = __webpack_require__(/*! ./atomic-widget-type */ "../modules/atomic-widgets/assets/js/editor/atomic-widget-type.js"); | |
| 3038 | 2224 | 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)); } |
| 3039 | 2225 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 3040 | 2226 | var Module = /*#__PURE__*/function (_elementorModules$edi) { |
| 3041 | 2227 | function Module() { |
| @@ -3046,32 +2232,30 @@ | ||
| 3046 | 2232 | return (0, _createClass2.default)(Module, [{ |
| 3047 | 2233 | key: "onInit", |
| 3048 | 2234 | value: function onInit() { |
| 3049 | 2235 | $e.components.register(new _component.default()); |
| 3050 | - this.exposeAtomicElementClasses(); | |
| 3051 | - this.registerAtomicElements(); | |
| 2236 | + this.registerAtomicWidgetTypes(); | |
| 3052 | 2237 | } |
| 3053 | 2238 | }, { |
| 3054 | - key: "exposeAtomicElementClasses", | |
| 3055 | - value: function exposeAtomicElementClasses() { | |
| 3056 | - elementor.modules.elements.types.AtomicElementBase = _atomicElementBaseType.default; | |
| 3057 | - elementor.modules.elements.views.createAtomicElementBase = _createAtomicElementBaseView.default; | |
| 3058 | - elementor.modules.elements.models.AtomicElementBase = _atomicElementBaseModel.default; | |
| 2239 | + key: "registerAtomicWidgetTypes", | |
| 2240 | + value: function registerAtomicWidgetTypes() { | |
| 2241 | + var _elementor$widgetsCac; | |
| 2242 | + Object.entries((_elementor$widgetsCac = elementor.widgetsCache) !== null && _elementor$widgetsCac !== void 0 ? _elementor$widgetsCac : {}).filter(function (_ref) { | |
| 2243 | + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 2244 | + widget = _ref2[1]; | |
| 2245 | + return !!widget.atomic; | |
| 2246 | + }).forEach(function (_ref3) { | |
| 2247 | + var _ref4 = (0, _slicedToArray2.default)(_ref3, 1), | |
| 2248 | + type = _ref4[0]; | |
| 2249 | + return elementor.elementsManager.registerElementType(new _atomicWidgetType.AtomicWidgetType(type)); | |
| 2250 | + }); | |
| 2251 | + this.registerAtomicDivBlockType(); | |
| 3059 | 2252 | } |
| 3060 | 2253 | }, { |
| 3061 | - key: "registerAtomicElements", | |
| 3062 | - value: function registerAtomicElements() { | |
| 3063 | - this.registerAtomicElementTypeIfAbsent((0, _createDivBlockType.default)()); | |
| 3064 | - this.registerAtomicElementTypeIfAbsent((0, _createFlexboxType.default)()); | |
| 3065 | - this.registerAtomicElementTypeIfAbsent((0, _createGridType.default)()); | |
| 3066 | - } | |
| 3067 | - }, { | |
| 3068 | - key: "registerAtomicElementTypeIfAbsent", | |
| 3069 | - value: function registerAtomicElementTypeIfAbsent(elementType) { | |
| 3070 | - if (elementor.elementsManager.getElementTypeClass(elementType.getType())) { | |
| 3071 | - return; | |
| 3072 | - } | |
| 3073 | - elementor.elementsManager.registerElementType(elementType); | |
| 2254 | + key: "registerAtomicDivBlockType", | |
| 2255 | + value: function registerAtomicDivBlockType() { | |
| 2256 | + var DivBlock = (__webpack_require__(/*! ./div-block-type */ "../modules/atomic-widgets/assets/js/editor/div-block-type.js")["default"]); | |
| 2257 | + elementor.elementsManager.registerElementType(new DivBlock()); | |
| 3074 | 2258 | } |
| 3075 | 2259 | }]); |
| 3076 | 2260 | }(elementorModules.editor.utils.Module); |
| 3077 | 2261 | new Module(); |